我需要創建.xsd模式,並指定屬性。我該怎麼做?XSD屬性指定
<?xml version="1.0" encoding="UTF-8"?>
<ConfigData>
<GlobalSettings>
<Logging param="Off"/> <-- param can be only in 'On' or 'Off' statement -->
</GlobalSettings>
</ConfigData>
我創造了這樣的事情,但它不`噸工作
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="ConfigData">
<xs:complexType>
<xs:element name="GlobalSettings">
<xs:complexType>
<xs:simpleType name="statement">
<xs:restriction base="xs:string">
<xs:enumeration value="On"/>
<xs:enumeration value="Off"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="Logging">
<xs:complexType>
<xs:extension base="xs:string">
<xs:attribute name="param" type="statement" use="required"/>
</xs:extension>
</xs:complexType>
</xs:element>
</xs:complexType>
</xs:element>
</xs:complexType>
</xs:element>
</xs:schema>
如果你得到這個接受它作爲答案請問 – Naren
你的問題的答案是否幫助你? –