System.Xml.Tests.TCWriteNode_XmlReader.writeNode_XmlReader21a C# (CSharp) Method

writeNode_XmlReader21a() public method

public writeNode_XmlReader21a ( ) : int
return int
        public int writeNode_XmlReader21a()
        {
            string strxml = "<a xmlns=\"p1\"><b xmlns=\"p2\"><c xmlns=\"p1\" /></b><d xmlns=\"\"><e xmlns=\"p1\"><f xmlns=\"\" /></d></a>";
            try
            {
                using (XmlWriter w = CreateWriter())
                {
                    try
                    {
                        using (XmlReader xr = CreateReader(new StringReader(strxml)))
                        {
                            w.WriteNode(xr, true);
                            CError.Compare(false, "Failed");
                        }
                    }
                    catch (XmlException xe) { CError.WriteLine(xe.Message); return TEST_PASS; }
                }
            }
            catch (ObjectDisposedException e) { CError.WriteLine(e.Message); return TEST_PASS; }
            return TEST_FAIL;
        }