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