1
我正在創建一個模式,但我被困在我的根元素附近,將其定義爲一個複雜類型,它具有子元素,屬性,和對這些屬性的限制xsd:複雜類型與兒童,屬性和限制
這是我到目前爲止已經試過....(百葉簾格式)
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsd:element name="foos">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="foo" type="FooType" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="FooType">
<xsd:attribute name="exchangeType" type="xsd:string" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="S" />
<xsd:enumeration value="T" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:sequence>
<xsd:element name="thing1" type="Thing1Type" />
<xsd:element name="thing2" type="Thing2Type" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
我一直無法找到一個方法,將這個屬性和它的限制
任何思想S'
謝謝,@kjhughes,這使得很多更有意義,並且是我需要的關於如何解決這個問題的清晰度 – kmancusi