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 Element and Attribute Content

Writing elements and attributes piece by piece requires you to write the content separately from the start and end tags. Up to this point, this chapter has glossed over which methods are available for writing this content. This section will investigate these methods in more detail.

The XmlTextWriter provides the WriteString method to assist you in writing string data as content. To ensure that the resulting XML is still well-formed, the WriteString method will perform the following tasks before writing the string:

  • The characters &, <, and > are replaced by &amp;, &lt;, and &gt;, respectively.

  • Character values in the range 0x0x1F are replaced by numeric character entries. White space characters with this range ...

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