System.Xml.Tests.TCWriteNode_XmlReader.writeNode_XmlReader28b C# (CSharp) Méthode

writeNode_XmlReader28b() public méthode

public writeNode_XmlReader28b ( ) : int
Résultat int
        public int writeNode_XmlReader28b()
        {
            string strxml = @"<root xmlns:p1='p1'><p2:child xmlns:p2='p2' xmlns:xml='http://www.w3.org/XML/1998/namespace' /></root>";
            XmlReader xr = CreateReader(new StringReader(strxml));
            while (xr.Read())
            {
                if (xr.LocalName == "child")
                    break;
            }
            using (XmlWriter w = CreateWriter())
            {
                w.WriteNode(xr, false);
                xr.Dispose();
            }
            string exp = (WriterType == WriterType.UnicodeWriter) ? "<p2:child xmlns:p2=\"p2\" />" : "<p2:child xmlns:p2=\"p2\" xmlns:xml='http://www.w3.org/XML/1998/namespace' />";
            return CompareReader(exp) ? TEST_PASS : TEST_FAIL;
        }