I have following xsd file(just an simple example) from which i want to extract some values.
Now i want the code which can fetch value of xs:enumeration and xs:maxLength value from an xsd file.
Code:
<xs:element name="ACES">
<xs:complexType>
<xs:sequence>
<xs:element ref="ADVANCE-PAYMENT-AMOUNT-DEPOSITEDS"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ADVANCE-PAYMENT-AMOUNT-DEPOSITEDS">
<xs:complexType>
<xs:sequence>
<xs:element ref="ADVANCE-PAYMENT-AMOUNT-DEPOSITED" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ADVANCE-PAYMENT-AMOUNT-DEPOSITED" type="T_GENERAL_DATA_ONE"/>
<xs:complexType name="T_GENERAL_DATA_ONE">
<xs:simpleContent>
<xs:extension base="ST_LEGNTH_13">
<xs:attribute name="Duration">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Jul-Jan"/>
<xs:enumeration value="Aug-Feb"/>
<xs:enumeration value="Sep-Mar"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Description">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Total"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="ST_LEGNTH_13">
<xs:restriction base="xs:string">
<xs:maxLength value="16"/>
<xs:pattern value="\d{0,13}(\.[0]{1,2})?"/>
</xs:restriction>
</xs:simpleType>