I'd like to generate the classes the xsd.exe way and not the linqtoxsd way.
Thanks, --Ran.
I'd like to generate the classes the xsd.exe way and not the linqtoxsd way.
Thanks, --Ran.
Look at the System.Xml.Serialization.XmlCodeExporter class.
UPDATE (in case John Saunders didnt bother reading further)
"Xsd.exe uses XmlCodeExporter to generate classes from XML Schema Definition (XSD) documents."
Which part of the process do you not know how to do?
You can load one or more instances of the XmlSchema class into an XmlSchemaSet. This will allow you to programmaticly examine all parts of the schema and other schemas it may reference. You can use this information to generate code, either as text that will later need to be compiled, or else using the CodeDOM. See Dynamic Source Code Generation and Compilation.
If you are generating code in the context of Visual Studio, then I'd suggest you do so via T4 Templates. See Generating Artifacts By Using Text Templates.
You can call xsd.exe from your code using Process Class. I did it once and its fast and straightforward. You won't need to bored much :).