Is there a way to scope ID and IDREF to specific attributes?

北慕城南 提交于 2020-02-05 02:50:21

问题


I'm trying to specify a DTD for an XML file. But in it, I have two IDs used for different things.

I'd like to keep these IDs separate so that one tag's attribute that uses a IDREF must match the ID for a particular tag's attribute and another tag that uses a attribute IDREF must match the ID for another particular tag's attribute

Is this possible?


回答1:


No, ID/IDREF/IDREFS have document scope.

If you can use XSD instead of DTD, you can get more control over id scoping via xsd:key and xsd:keyref.



来源:https://stackoverflow.com/questions/28286217/is-there-a-way-to-scope-id-and-idref-to-specific-attributes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!