+2010-04-21 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XDocument.cs : don't prohibit DTD.
+ * XNodeNavigator.cs : do not return true in MoveToFirstChild()
+ when there is no child node. Fixed bug #594877.
+
2010-04-02 Atsushi Enomoto <atsushi@ximian.com>
* XContainer.cs : create snapshot copy first before removal of nodes.
public static XDocument Load (TextReader reader, LoadOptions options)
{
XmlReaderSettings s = new XmlReaderSettings ();
+ s.ProhibitDtd = false; // see XNodeNavigatorTest.MoveToId().
s.IgnoreWhitespace = (options & LoadOptions.PreserveWhitespace) == 0;
using (XmlReader r = XmlReader.Create (reader, s)) {
return LoadCore (r, options);
+2010-04-21 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XNodeNavigatorTest.cs : added test for bug #594877. Enable and fix
+ tests that were commented out.
+
2010-04-02 Atsushi Enomoto <atsushi@ximian.com>
* XElementTest.cs : added test for bug #592435.
[TestFixture]
public class XNodeNavigatorTest
{
-/* It does not compile probably due to bug #359733.
[Test]
public void MoveToNext ()
{
}
[Test]
- public void MoveToId () // Not supported
+ [ExpectedException (typeof (NotSupportedException))]
+ public void MoveToId () // ID is not supported here.
{
string xml = @"
<!DOCTYPE root [
<!ATTLIST foo id ID #IMPLIED>
<!ATTLIST bar id ID #IMPLIED>
]>
-<root><foo id='foo' /><bar id='bar' /></root>",
+<root><foo id='foo' /><bar id='bar' /></root>";
XDocument doc = XDocument.Parse (xml, LoadOptions.SetLineInfo);
XPathNavigator nav = doc.CreateNavigator ();
nav.MoveToId ("foo");
}
-*/
+
+ [Test]
+ public void Bug594877 ()
+ {
+ string data = "<rt> <objsur t=\"o\" guid=\"06974d9a-ff86-4e1c-a3e5-7ce8c961dcb9\" /> </rt>";
+ XElement xeOldOwner = XElement.Parse(data);
+ string xpathOld = String.Format(".//objsur[@t='o']");
+ XElement xeOldRef = xeOldOwner.XPathSelectElement(xpathOld);
+ Assert.AreEqual ("<objsur t='o' guid='06974d9a-ff86-4e1c-a3e5-7ce8c961dcb9' />".Replace ('\'', '"'), xeOldRef.ToString (), "#1");
+ }
}
}