August 2003
Beginner to intermediate
600 pages
12h 57m
English
In most cases your XML will consist of only elements and attributes, but there are situations where you may need to add comments, CDATA, or other uncommon nodes to your XML document.
Let's first look at writing comments. Comments can appear anywhere in the document after the prolog (everything before the root element) and even in the epilog (everything after the root element). Although the W3C XML specification states that a comment may appear anywhere in the document, even before the prolog, this is not true for documents created by the XmlTextWriter. Attempting to write a comment before writing an XML declaration will result in an InvalidOperationException. Listing 10.33 demonstrates how to add a comment ...
Read now
Unlock full access