参考
Reading and Writing XML Schema
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconreadingwritingxsdschema.asp?frame=true

解决方案 »

  1.   

    读取Schema以后,还需要获得其Element的name,type,批注等信息
    能不能检索Schema
      

  2.   

    XmlSchema object has Elements/Items property.....
      

  3.   

    <?xml version="1.0" encoding="utf-8" ?>
    <xs:schema id="test" targetNamespace="http://tempuri.org/test.xsd" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns="http://tempuri.org/test.xsd" xmlns:mstns="http://tempuri.org/test.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xs:element name="test" msdata:IsDataSet="true">
    <xs:complexType>
    <xs:choice maxOccurs="unbounded">
    <xs:element name="haha">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="A" type="xs:string" minOccurs="0" />
    <xs:element name="B" type="xs:string" minOccurs="0" />
    <xs:element name="C" type="xs:string" minOccurs="0" />
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:choice>
    </xs:complexType>
    </xs:element>
    </xs:schema>根节点的element我可以获得,但是如上所示这么多层下面的element节点A,B,C的信息怎么获取哦。XmlSchemaPath怎么用的呢?谢谢思归