System.Xml.Tests.TCWriteAttributes.writeAttributes_8 C# (CSharp) Method

writeAttributes_8() public method

public writeAttributes_8 ( ) : int
return int
        public int writeAttributes_8()
        {
            if (IsXPathDataModelReader())
            {
                CError.WriteLine("{0} does not support XmlDecl node", readerType);
                return TEST_SKIPPED;
            }
            using (XmlWriter w = CreateWriter())
            {
                using (XmlReader xr = CreateReader("Simple.xml"))
                {
                    xr.Read();
                    if (xr.NodeType != XmlNodeType.XmlDeclaration)
                    {
                        CError.WriteLine("Reader not positioned on XmlDeclaration");
                        CError.WriteLine(xr.LocalName);
                        xr.Dispose();
                        w.Dispose();
                        return TEST_FAIL;
                    }
                    w.WriteStartElement("Root");
                    w.WriteAttributes(xr, false);
                    w.WriteEndElement();
                }
            }
            return CompareReader("<Root version=\"1.0\" standalone=\"yes\" />") ? TEST_PASS : TEST_FAIL;
        }