XSD File obatining schema information programaticallyhttp://forums.asp.net/t/351645.aspx/1?XSD+File+obatining+schema+information+programaticallyWed, 01 Oct 2003 13:43:06 -0400351645351645http://forums.asp.net/p/351645/351645.aspx/1?XSD+File+obatining+schema+information+programaticallyXSD File obatining schema information programatically I have created an xsd file named reason.xsd what I would like to do is is determine the fields within the file programatically. Could someone please show me how I would open up the file and traverse through each element in the file obtaining the field name and its type? Thanks in advance The schema is below Reason.xsd <hr> ReasonID integer image string Description string 2003-09-29T19:24:31-04:00352727http://forums.asp.net/p/351645/352727.aspx/1?Re+XSD+File+obatining+schema+information+programaticallyRe: XSD File obatining schema information programatically You don't have to do all that manually. Check out the System.Xml.Schema namespace. It lets you access the information in a schema file via a nice object model. The Framework SDK documentation has a whole section dedicated to the classes in that namespace [0] ( this link is local, but it also available online in the MSDN library ). You'll also find some samples on the Xml Schema Object Model on gotdotnet [1] [0] ms-help://MS.NETFrameworkSDKv1.1/cpguidenf/html/cpconxsdschemaobjectmodelsom.htm [1] http://samples.gotdotnet.com/quickstart/howto/doc/Xml/XmlSchemaObjectModel.aspx HTH 2003-09-30T17:30:13-04:00353687http://forums.asp.net/p/351645/353687.aspx/1?Re+XSD+File+obatining+schema+information+programaticallyRe: XSD File obatining schema information programatically here is what worked for me. If you have other alternatives please post would like to to look at them. Thanks again Dim myDS As DataSet = New DataSet myDS.ReadXmlSchema(&quot;reason.xsd&quot;) Dim s As String Dim i As Integer For i = 0 To myDS.Tables(0).Columns.Count - 1 s = myDS.Tables(0).Columns(i).ToString Next 2003-10-01T13:43:06-04:00