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

1

1

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?

Colorist answered 2/2, 2015 at 20:32 Comment(0)
L
2

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.

Landowska answered 2/2, 2015 at 21:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.