chris

chris

  • NA
  • 1
  • 1.6k

Using XSD.exe generated classes to create xml documents

May 12 2013 3:46 AM
I got excited about the XSD.exe tool to create c# classes from a xsd file.

It allowed me to use the XMLSerializer to generate xml documents that must be validated against rather complicated xsd.

I notice that all the types used in the xsd were converted to strings in the c# classes.  This means the classes will not be able to 
validate my xml documents to insure xml element types such as "unsignedByte-or-empty".  

Does anyone have this experience regarding complex xsd files?  

My goal is to pull all the data required for each xml document into memory from a sql server DB.  
Then I hoping to use the declarations in the classes that XSD.exe generates to guide any data conversions required 
before serializing the output to an xml file.

Now it seems I must validate the xml data types before the data is converted to strings and serialized.

I keep reading how useful XSD.exe can be, but perhaps not for my project?
Thanks in advance for any insight offered,
Chris.