+2010-04-28 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XmlDocument.cs : it seems .net does allow Load() with such an xml
+ reader positioned in the middle of the document. Fixed bug #598953.
+
2010-04-21 Atsushi Enomoto <atsushi@ximian.com>
* XmlTextReader.cs, DTDReader.cs : 0xFFFF was treated as if it were
break;
if (preserveWhitespace || n.NodeType != XmlNodeType.Whitespace)
AppendChild (n, false);
- } while (true);
+ } while (xmlReader.NodeType != XmlNodeType.EndElement);
#if NET_2_0
if (xmlReader.Settings != null)
schemas = xmlReader.Settings.Schemas;
+2010-04-28 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XmlDocumentTests.cs : add test for bug #598953.
+
2010-03-26 Atsushi Enomoto <atsushi@ximian.com>
* XmlReaderCommonTests.cs : added test for ReadElementContentAs() for
Assert.IsNotNull (doc.DocumentElement.GetAttributeNode ("hijacked"));
Assert.IsNull (doc.DocumentElement.GetAttributeNode ("a"));
}
+
+ [Test]
+ public void LoadFromMiddleOfDocument ()
+ {
+ // bug #598953
+ string xml = @"<?xml version='1.0' encoding='utf-8' ?>
+<Racal>
+ <Ports>
+ <ConsolePort value='9998' />
+ </Ports>
+</Racal>";
+ var r = new XmlTextReader (new StringReader (xml));
+ r.WhitespaceHandling = WhitespaceHandling.All;
+ r.MoveToContent ();
+ r.Read ();
+ var doc = new XmlDocument ();
+ doc.Load (r);
+ Assert.AreEqual (XmlNodeType.EndElement, r.NodeType, "#1");
+ }
}
}