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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading XSD files for display 1

Status
Not open for further replies.

fcoomermd

Programmer
Nov 20, 2002
218
CA
How can I do this..., I have tried, but with no luck thus far.
I want to read an xsd file and loop through for reporting purposes of a program and write out:
1. name
2. type ie (integer)
3. minOccurs
etc., all of the particulars of the xsd file

How can I do this?
 
Easiest way is to read the Xml file into a dataset and iterate through it.

The code below will get you column names, and Im sure you can manage the rest
Code:
Dim ds As New DataSet
ds.ReadXml("c:\vbutils\test1.xsd")
For iloop1 As Integer = 0 To ds.Tables.Count - 1
   For iloop2 As Integer = 0 To ds.Tables(iloop1).Columns.Count - 1
      Debug.Write(ds.Tables(iloop1).Columns(iloop2).ColumnName)
   Next
Next


Sweep
...if it works dont mess with it
 
Thanks, I really appreciate it... I never thought of doing the dataset way. I thought I would iterate through the nodes within the XSD. Simple answer for a simple question.
Once again, thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top