Exemple #1
0
        internal static void Construction()
        {
            XDeclaration declaration = new XDeclaration("1.0", null, "no");

            declaration.WriteLine(); // <?xml version="1.0" standalone="no"?>

            XDocumentType documentType = new XDocumentType("html", null, null, null);

            documentType.WriteLine(); // <!DOCTYPE html >

            XText text = new XText("<p>text</p>");

            text.WriteLine(); // &lt;p&gt;text&lt;/p&gt;

            XCData cData = new XCData("cdata");

            cData.WriteLine(); // <![CDATA[cdata]]>

            XProcessingInstruction processingInstruction = new XProcessingInstruction(
                "xml-stylesheet", @"type=""text/xsl"" href=""Style.xsl""");

            processingInstruction.WriteLine(); // <?xml-stylesheet type="text/xsl" href="Style.xsl"?>
        }