Browse Source

2004-03-27 Atsushi Enomoto <[email protected]>

	* DTDReader.cs : In some places sequential parameter entity was
	  incorrectly skipped (and caused invalid result).

svn path=/trunk/mcs/; revision=24661
Atsushi Eno 22 năm trước cách đây
mục cha
commit
dcdf2745d6

+ 5 - 0
mcs/class/System.XML/System.Xml/ChangeLog

@@ -1,3 +1,8 @@
+2004-03-27  Atsushi Enomoto <[email protected]>
+
+	* DTDReader.cs : In some places sequential parameter entity was
+	  incorrectly skipped (and caused invalid result).
+
 2004-03-24  Atsushi Enomoto <[email protected]>
 2004-03-24  Atsushi Enomoto <[email protected]>
 
 
 	* XmlDocumentNavigator.cs : MoveTo*Namespace() should not iterate
 	* XmlDocumentNavigator.cs : MoveTo*Namespace() should not iterate

+ 16 - 4
mcs/class/System.XML/System.Xml/DTDReader.cs

@@ -393,6 +393,12 @@ namespace System.Xml
 					TryExpandPERef ();
 					TryExpandPERef ();
 					SkipWhitespace ();
 					SkipWhitespace ();
 					while(PeekChar () != ')') {
 					while(PeekChar () != ')') {
+						SkipWhitespace ();
+						if (PeekChar () == '%') {
+							TryExpandPERef ();
+							SkipWhitespace ();
+							continue;
+						}
 						Expect('|');
 						Expect('|');
 						SkipWhitespace ();
 						SkipWhitespace ();
 						TryExpandPERef ();
 						TryExpandPERef ();
@@ -417,8 +423,11 @@ namespace System.Xml
 					SkipWhitespace ();
 					SkipWhitespace ();
 
 
 					do {	// copied from ReadCP() ...;-)
 					do {	// copied from ReadCP() ...;-)
-						TryExpandPERef ();
-						SkipWhitespace ();
+						if (PeekChar () == '%') {
+							TryExpandPERef ();
+							SkipWhitespace ();
+							continue;
+						}
 						if(PeekChar ()=='|') {
 						if(PeekChar ()=='|') {
 							// CPType=Or
 							// CPType=Or
 							if (model.OrderType == DTDContentOrderType.Seq)
 							if (model.OrderType == DTDContentOrderType.Seq)
@@ -485,8 +494,11 @@ namespace System.Xml
 				model.ChildModels.Add (ReadCP (elem));
 				model.ChildModels.Add (ReadCP (elem));
 				SkipWhitespace ();
 				SkipWhitespace ();
 				do {
 				do {
-					TryExpandPERef ();
-					SkipWhitespace ();
+					if (PeekChar () == '%') {
+						TryExpandPERef ();
+						SkipWhitespace ();
+						continue;
+					}
 					if(PeekChar ()=='|') {
 					if(PeekChar ()=='|') {
 						// CPType=Or
 						// CPType=Or
 						if (model.OrderType == DTDContentOrderType.Seq)
 						if (model.OrderType == DTDContentOrderType.Seq)