Notebook XML

Alex van Buitenen

This is not a XSLT tutorial or Quick Reference.
It is just my personal notebook for XML.

Header

<?xml version="1.0" ?>

Link the XSL Style Sheet to the XML Document

<?xml-stylesheet type="text/xsl" href="filename.xsl"?>

CDATA

Everything inside a CDATA section is ignored by the parser.

A CDATA section starts with "<![CDATA[" and ends with "]]>".
 

Add Xml declaration to XmlDocument (C#)

XmlDocument _xmlDocument = new XmlDocument();

// Create an XML declaration.
XmlNode declarationNode = _xmlDocument.CreateXmlDeclaration("1.0", "utf-8", "");
_xmlDocument.AppendChild(declarationNode);