在 W3C Reco(这里)中,我发现
[...] ID 是一种属性,因此它不能应用于属性、元素或其内容
我可以在我必须处理的文件中找到一些,我想知道 xsi:ID 是否真的是一个有效的 xlm 元素类型
我现有的 xsd 提到:
<xsd:complexType name="customTypeName">
<xsd:sequence>
<xsd:element name="ID" type="xsd:ID"/>
<xsd:element name="myElement" type="string"/>
</xsd:sequence>
</xsd:complexType>
但根据我的阅读,我宁愿认为有效的声明应该是
<xsd:complexType name="customTypeName">
<xsd:element name="myElement" type="string"/>
<attribute name="ID" type="xsd:ID" use="required"/>
</xsd:complexType>
但不幸的是,我无法更改已经使用的 xsd... 我愿意使用 id() 函数应用 xslt 搜索。我应该放弃还是有办法?
提前感谢您在论坛上对我的第一个问题的任何帮助。