【发布时间】:2017-04-03 18:51:45
【问题描述】:
我有以下 XML 可能性:
<Platform>iTunes</Platform><Platform IsSubscriptionPlatform="True">Netflix</Platform>
什么是正确的 XSD 元素?到目前为止,我有:
<xs:element name="Platform">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="IsSubscriptionPlatform" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="(True|False)?" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
我将如何进一步将平台值的限制添加为“iTunes”或“Netflix”。也就是说,我会在哪里添加:
<xs:restriction base="xs:string">
<xs:enumeration value="iTunes" />
<xs:enumeration value="Netflix" />
</xs:restriction>
【问题讨论】: