Converting .NET Compact Framework Data Types through XmlConvert

When writing encoded strings to an XML stream, WriteString and WriteChars encode any special characters so that the XML will be well formed. But what about writing .NET Compact Framework data types to the XML stream? It is not safe to call ToString on the data types, because ToString will not write the correct string. The data types must be written using the XML Schema (XSD) data type mapping defined by the XML Schema Part 2: DataTypes specification (http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/).

The XmlConvert class provides static methods that will convert .NET Compact Framework data types to their correct XML Schema mapping. The class also supplies static methods to convert ...

Get Microsoft® .NET Compact Framework Kick Start now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.