ReadOuterXml() public method

See XmlReader.ReadOuterXml
public ReadOuterXml ( ) : string
return string
Esempio n. 1
0
 public void ShouldPreserveCDATA()
 {
     string xml = "<HTML><![CDATA[<img src=\"/_layouts/images/\">]]></HTML>";
     XIncludingReader xir = new XIncludingReader(new StringReader(xml));
     xir.Read();
     Assert.AreEqual("<HTML><![CDATA[<img src=\"/_layouts/images/\">]]></HTML>", xir.ReadOuterXml());
 }
Esempio n. 2
0
        public void OuterXmlTest() 
        {
			XIncludingReader xir = new XIncludingReader("../../XInclude/tests/document.xml");
            xir.MoveToContent();
            string outerXml = xir.ReadOuterXml();
            xir.Close();
			xir = new XIncludingReader("../../XInclude/tests/document.xml");
            xir.MoveToContent();
            XmlDocument doc = new XmlDocument();
            doc.PreserveWhitespace = true;
            doc.Load(xir);              
            string outerXml2 = doc.DocumentElement.OuterXml;
            Assert.AreEqual(outerXml, outerXml2);
        }