|
|
@@ -28,5 +28,22 @@ namespace MonoTests.System.Xml
|
|
|
AssertEquals ("Name", "foo", er.Name);
|
|
|
AssertEquals ("WriteTo", "<root>&foo;</root>", doc.DocumentElement.OuterXml);
|
|
|
}
|
|
|
+
|
|
|
+ [Test]
|
|
|
+ public void TestDescendantsRecursively ()
|
|
|
+ {
|
|
|
+ string dtd = "<!DOCTYPE root [<!ELEMENT root (#PCDATA)*>"
|
|
|
+ + "<!ENTITY ent 'value'>"
|
|
|
+ + "<!ENTITY ent2 'my &ent; string'>"
|
|
|
+ + "]>";
|
|
|
+ string xml = dtd + "<root>&ent;</root>";
|
|
|
+ XmlTextReader xtr = new XmlTextReader (xml, XmlNodeType.Document, null);
|
|
|
+ XmlDocument doc = new XmlDocument ();
|
|
|
+ doc.Load (xtr);
|
|
|
+ XmlEntity ent = (XmlEntity) doc.DocumentType.Entities.GetNamedItem ("ent2");
|
|
|
+ AssertEquals ("ent2", ent.Name);
|
|
|
+ AssertEquals ("my", ent.FirstChild.Value);
|
|
|
+ AssertEquals ("value", ent.FirstChild.NextSibling.FirstChild.Value);
|
|
|
+ }
|
|
|
}
|
|
|
}
|