Using XSD.exe

.Net has a tool called the XML Schema Definition Tool (XSD.EXE) which can turn XSD schemas into classes.  Also, it will try to make it so those classes will conform to the schema when serialized as XML.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpconxmlschemadefinitiontoolxsdexe.asp

xsd.exe pathToXSD.xsd /classes /language:VB /outputdir:C:output

You can then serialize and deserialize the object into/from XML.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlSerializationXmlSerializerClassTopic.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlSerializationXmlSerializerClassDeserializeTopic.asp

 

 

Leave a comment