Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have to use multiple XSD files from a state agency. They could change quite often. Is there a way to use the xsd files to generate xml files at runtime in vb.net?
Posted
Comments
Estys 20-Jan-11 12:22pm    
How do you mean "they could change quite often"? XSD are a form of contact for data-exchange, they shouldn't change (often). Anyway, how would you detect the changes a runtime?
Sergey Alexandrovich Kryukov 20-Jan-11 12:29pm    
There is not such contract which never changes... No, no, it makes sense, I would understand that. Event in production with support it may change -- incrementally, without breaking of validity of legacy data.

What I don't understand: what should be in the XMLs? XSD XML is meta-data for other XMLs which should conform to this meta-data, so each (non-trivial) XSD could generate infinite amount of conforming XMLs. What's the idea behind?

Look at this MSDN article:

Generating XML Documents from XML Schemas[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 20-Jan-11 13:07pm    
This is a good reference (my 5) but I doubt OP needs that samples to generate.
Sergey Alexandrovich Kryukov 20-Jan-11 13:09pm    
@duncanthescott: again, what's the idea? do you want to reconcile old XML data to conform the new schema by XSDs? Than it is quite a non-trivial (and kind of interesting) project.
I believe that a XSD file is nothing more than an XML file missing the header line. If you create a StringBuilder object, start it out with the xml file header, read the xsd file in as text and append the text to the StringBuilder object, you can then just call XDocuiment.Parse(stringBuilder.ToString()), and Bob's your uncle.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900