Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using an XSD (schema) to define XML nodes

Status
Not open for further replies.

Mystic1112

Programmer
Jan 2, 2004
20
0
0
US
I have an XSD file that defines all of the elements that I need to output information from my application. Is there a way to read the XSD in Visual Basic 6 and then use that information to create the appropriate XML tags for the output I have to generate?

The amount of data exported from this application is very large and I am looking for a short-cut way of creating the XML tags since I have an XSD.

Does anyone have any suggestions, or know of examples of using an XSD instead of defining each element with domdocument.CreateElement("FirstOfMany")?

Thanks in advance.
 
An XSD is itself an XML document, so there's no reason why you can't load it into a DOM. Once it's in a DOM, you can look for the xs:element and xs:attribute nodes that you'll need to build your other XML document.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Thanks Chip. I didn't think of it that way, but you are absolutely right.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top