How can I recursively read in an XML Schema(including user-defined types) with VB?
Posted on 2003-11-24
I'm re-writing a tool of ours that reads in XML Schemas, and generates XML instances of them. The original one was hard-coded to read in only certain schemas, and there are no situations with user-defined schema types like:
<xs:element name="dataPoint1" type="dataPoint" minOccurs="0"/>
The thing is, I need to re-write it to be more general, to take in any schema if possible, so the updated version will need to:
1) Read in the XSD, and save it into a node list(done).
2) Parse through the list, and trigger a flag if the current node is of a user-defined type(done).
3) Recursively go back through the list & replace the given node with the complexType information that defines it.(???)
Still relatively new to VB, and I'm having trouble coming up with the right syntax for recursive functions in VB.
Suggestions anyone? Even some examples for recursion with xml node lists would be helpful.