1
属性我有以下XML可能性:XML/XSD与扩展类型和限制
<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>