Browse Source

2005-09-30 Atsushi Enomoto <[email protected]>

	* XmlSchema.cs : XmlReader position after Read() is the end of the
	  schema element.

	* XmlSchemaTests.cs : test for reader position after Read().


svn path=/trunk/mcs/; revision=51030
Atsushi Eno 20 years ago
parent
commit
d5feae8969

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

@@ -1,3 +1,8 @@
+2005-09-30  Atsushi Enomoto <[email protected]>
+
+	* XmlSchema.cs : XmlReader position after Read() is the end of the
+	  schema element.
+
 2005-09-25  Atsushi Enomoto <[email protected]>
 
 	* XmlSchemaBuiltInType.cs : removed obsolete beta file.

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

@@ -658,8 +658,6 @@ namespace System.Xml.Schema
 						else
 							rdr.Skip ();
 
-						if (rdr.NodeType == XmlNodeType.EndElement)
-							rdr.Read ();
 						return schema;
 					}
 					else

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

@@ -1,3 +1,7 @@
+2005-09-30  Atsushi Enomoto <[email protected]>
+
+	* XmlSchemaTests.cs : test for reader position after Read().
+
 2005-08-31  Sebastien Pouliot  <[email protected]>
 
 	* XmlSchemaExceptionCas.cs: New. CAS unit tests for exception 

+ 10 - 0
mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaTests.cs

@@ -289,5 +289,15 @@ namespace MonoTests.System.Xml
 			//AssertEquals (xmldecl + "<q2:schema xmlns:foo=\"urn:foo\" xmlns:q1=\"urn:q1\" xmlns=\"urn:foo\" xmlns:q2=\"http://www.w3.org/2001/XMLSchema\" />", sw.ToString ());
 			Assert("q1", sw.ToString ().IndexOf ("xmlns:q1=\"urn:q1\"") != -1);
 		}
+
+		[Test]
+		public void ReaderPositionAfterRead ()
+		{
+			string xsd = @"<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault='qualified'>  <xs:element name='test' type='xs:integer'/></xs:schema>";
+			XmlTextReader xtr = new XmlTextReader (xsd, XmlNodeType.Document, null);
+			xtr.Read ();
+			XmlSchema xs = XmlSchema.Read (xtr, null);
+			AssertEquals (XmlNodeType.EndElement, xtr.NodeType);
+		}
 	}
 }