2
我想在多个位置使用以下激活,但正如您现在所看到的,它与一种复杂类型相关联,我如何提取它以便我可以定义一次并在多个位置使用它。定义一次xsd枚举以在多个地方使用?
<xs:complexType name="MessageType">
<xs:sequence>
<xs:element name="Control" type="ControlType" minOccurs="1" maxOccurs="1" />
<xs:element name="LOS" type="LOSTYPE" minOccurs="0" maxOccurs="1" />
<xs:element name="UID" type="UIDTYPE" minOccurs="1" maxOccurs="1" />
<xs:element name="RS" type="RSTYPE" minOccurs="0" maxOccurs="1" />
</xs:sequence>
<xs:attribute name="BL" type="xs:string" use="optional"></xs:attribute>
<xs:attribute name="BLM" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="One" />
<xs:enumeration value="Two"/>
<xs:enumeration value="Three"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
基本上,我想提取的BLM枚举属性出来,所以我可以再定义它,使用它,如果需要多个地方,所以我就不必重复了。 DRY简而言之:)
由于使用它,我fugured了这一点,有一天为好。 – Xaisoft