2
0
Эх сурвалжийг харах

2006-08-14 Atsushi Enomoto <[email protected]>

	* XmlTextReader.cs : When a whitespace node comes after a text 
	  declaration in XML external entity (i.e. .ctor() with
	  XmlNodeType.Element), it contained extra value character ('<').

	* XmlTextReaderTests.cs : added test for whitespace node value which
	  comes after a text declaration in XML external entity (i.e. .ctor()
	  with XmlNodeType.Element).


svn path=/trunk/mcs/; revision=63726
Atsushi Eno 19 жил өмнө
parent
commit
beae7faea1

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

@@ -1,3 +1,9 @@
+2006-08-14  Atsushi Enomoto <[email protected]>
+
+	* XmlTextReader.cs : When a whitespace node comes after a text 
+	  declaration in XML external entity (i.e. .ctor() with
+	  XmlNodeType.Element), it contained extra value character ('<').
+
 2006-08-10  Atsushi Enomoto <[email protected]>
 
 	* XmlTextWriter2.cs : more indentation fixes. Now I believe it is

+ 2 - 0
mcs/class/System.XML/System.Xml/XmlTextReader.cs

@@ -2202,6 +2202,8 @@ namespace System.Xml
 #endif
 
 			Expect ("?>");
+
+			curNodePeekIndex = peekCharsIndex; // without this it causes incorrect value start indication.
 		}
 
 		// The reader is positioned on the first character after

+ 6 - 0
mcs/class/System.XML/Test/System.Xml/ChangeLog

@@ -1,3 +1,9 @@
+2006-08-14  Atsushi Enomoto <[email protected]>
+
+	* XmlTextReaderTests.cs : added test for whitespace node value which
+	  comes after a text declaration in XML external entity (i.e. .ctor()
+	  with XmlNodeType.Element).
+
 2006-08-10  Atsushi Enomoto <[email protected]>
 
 	* XmlTextWriterTests.cs : more indentation tests.

+ 12 - 0
mcs/class/System.XML/Test/System.Xml/XmlTextReaderTests.cs

@@ -1211,5 +1211,17 @@ namespace MonoTests.System.Xml
 			xtr.Read (); // end of root. skip whitespaces
 			AssertEquals ("#7", XmlNodeType.EndElement, xtr.NodeType);
 		}
+
+		[Test]
+		public void WhitespacesAfterTextDeclaration ()
+		{
+			XmlTextReader xtr = new XmlTextReader (
+				"<?xml version='1.0' encoding='utf-8' ?> <x/>",
+				XmlNodeType.Element,
+				null);
+			xtr.Read ();
+			AssertEquals ("#1", XmlNodeType.Whitespace, xtr.NodeType);
+			AssertEquals ("#2", " ", xtr.Value);
+		}
 	}
 }