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 Raw XML Markup

The XmlTextWriter provides a rich API for writing well-formed markup to an XML stream. There may be times when you need to strip away this rich API and write raw text to the XML stream without the XmlTexWriter's attempting to encode the text. This could be helpful if your markup input is created by an external source and you just want to paste that markup into the XML stream.

The WriteRaw method provides this functionality. This method will not check the string for well-formedness. No encoding will be done, and no characters will be replaced with their respective character entities. The text is written “as is” to the XML stream. You can forget about formatting, too. Listing 10.32 demonstrates how to use WriteRaw to write ...

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