1
有誰知道XML Schema中所謂的「唯一粒子屬性」限制什麼,它爲什麼會被這個侵犯:XML Schema的唯一粒子屬性約束
<xs:complexType name="SMIL.switch.content">
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="smil:metadata"/>
<xs:element ref="SMIL.switch-control"/>
</xs:choice>
<xs:choice>
<xs:choice>
<xs:sequence maxOccurs="unbounded">
<xs:choice maxOccurs="unbounded">
<xs:element ref="SMIL.timecontainer.class"/>
<xs:element ref="SMIL.media-object"/>
</xs:choice>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="smil:metadata"/>
<xs:element ref="SMIL.switch-control"/>
</xs:choice>
</xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="smil:metadata"/>
<xs:element ref="SMIL.switch-control"/>
</xs:choice>
</xs:choice>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="smil:layout"/>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="smil:metadata"/>
<xs:element ref="SMIL.switch-control"/>
</xs:choice>
</xs:sequence>
</xs:choice>
</xs:sequence>
</xs:complexType>
運行XJC的錯誤如下:
[ERROR] COS-nonambig: 「http://www.w3.org/ns/SMIL 」:元數據和「 http://www.w3.org/ns/SMIL」:元數據(或元件 從它們的取代基)違反 「唯一粒子屬性」。在針對此模式進行驗證期間,將爲這兩個粒子創建模糊性 。
使用trang從SMIL 3.0 DTD生成模式。
莊並不總是完美的,XSD具有一定的侷限性:(你能後的原DTD的相關部分?我可以看到爲何出現錯誤但原來可能很方便解決它! – 2010-11-18 14:34:52