Wednesday, November 30, 2022
Code Search
Code Bank
.NET Applications
XSD Schema Generator
.NET/XML Training


Converting between XML Schema and CLR Types using the XmlConvert Class

Converting CLR types to XML Schema data types can be a painful process if you are not careful. After all, XML data types defined in the XML Schema specification (found here) do not always match up perfectly with their corresponding types in the CLR. However, by using the XmlConvert class in .NET this conversion process is greatly simplified. XmlConvert ensures that CLR types are properly converted to their corresponding XML schema types and vice versa.

This sample application demonstrates how to use the XmlConvert class to convert from XML Schema data types to corresponding CLR types (and vice versa), and shows how to use the EncodeName() method to ensure that dynamically created XML element and attribute names do not contain prohibited characters (as defined in the XML 1.0 specification).

Teaches XmlConvert
Requirements .NET 1.0
Example: Click Here
View Source Code: Click Here
Download Code: Click Here


.NET, SharePoint and Silverlight Training Solutions
    Online, Onsite and Video Training on .NET and SharePoint technologies available through The Wahlin Group.

© 2007 Wahlin Consulting LLC
XML for ASP.NET Developers in bookstores