1
我有以下问题:是否可以从我的XML模式中删除此冗余?
我有两个复合类型,foo
和bar
同时与会员foobar
:
<xs:complexType name="foo">
<xs:sequence>
<xs:element name="foobar" type="xs:string" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="bar">
<xs:sequence>
<xs:element name="foobar" type="xs:string" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
以减少冗余,我要声明一个foobar的一个复杂类型,其被引用在这两个foo
和bar
,这样的事情:
<xs:complexType name="foobar">
<xs:sequence>
<xs:element type="xs:string />
</xs:sequence>
</xs:complexType>
但这似乎并没有被正确的方式。这实际上可能在XML模式中吗?