O'Reilly logo

Microsoft® .NET Compact Framework Kick Start by Ronnie Yates, Erik Rubin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing an XML Declaration

Once the XmlTextWriter is created and initialized and the properties have been set to your liking, you can start writing XML data to the stream. The XmlTextWriter provides a rich API for writing nodes to the XML data stream. This section will look at the methods for writing the most important nodes: XML Declarations, Elements, and Attributes.

An XML declaration is not required in an XML document, but it can provide helpful information for parsers. The XmlTextWriter provides WriteStartDocument for writing the XML declaration to the XML stream. The API allows you to specify whether the document will be a standalone. Since DocumentType nodes are not supported by the .NET Compact Framework's XmlTextWriter, the document ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required