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

Formatting the XmlTextWriter's Output

Before starting to write XML data, you should consider whether and how the XML should be formatted. Formatting can make your XML data appear more organized and more readable to the human eye.

Formatting is controlled by the Formatting property of the XmlTextWriter. The Formatting property accepts an enumeration of the type System.Xml.Formatting. The enumeration has two values: Indented and None. None is the default value, meaning that no formatting is performed by a newly created XmlTextWriter. Setting the Formatting property to Formatting.Indented means that child elements will be indented.

You can specify which character to use for indention as well as how many of those characters equal one indention. This ...

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