1
私はスキーマの作成に取り組んでいますが、子要素、属性、およびの属性を持つcomplexTypeとして定義すると、ルート要素の近くに詰まっていますxsd:complexType子、属性、制限付き
この は(ブラインド形式)
<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>
私は
任意の考えを、この属性を組み込むための方法を見つけ、その制約問題を抱えてきた....私がこれまで試してみましたものです?
おかげで、@kjhughesが、これは多くのことを作りますより感覚的で、私はこれに近づけるために必要な明快さです – kmancusi