Identity Crisis
by Leigh Dodds
|
Pages: 1, 2
xml:id
Tim Bray proposed that a reserved attribute, in the XML namespace, be used to explicitly associate identifiers with elements. One of the benefits of using the reserved XML namespace is that it need not be declared, making it simple to add identifiers without additional changes to the instance. The obvious downside is that many DTDs will have to be updated to make these attributes valid for use on particular elements.
Example usage:
<foo>
<bar xml:id="label1">
<baz xml:id="label2">
</foo>
xmlid:xx
Offered as a variant of Bray's proposal, this option uses an explicit "identifier namespace". Any attribute associated with this namespace would be taken as an identifier. This adds the possibility of multiple identifiers per element. There hasn't been much backing for this proposal as the benefits of the additional flexibility aren't widely acknowledged.
Example usage:
<foo xmlns:xmlid="http://w3.org/xmlid">
<bar xmlid:x="abc" />
<baz xmlid:z="hij" />
</foo>
xml:idatt
This proposal from James Clark has received the most vocal support so far.
An alternative would be to have an attribute that declares the name of the attribute that is an ID attribute, say xml:idatt. To make this usable, xml:idatt would be inherited. In the typical case where all elements use the same attribute name for an ID, this means that a user has only to add something like xml:idatt="id" or xml:idatt="rdf:ID" to their root element and everything works. You would also need to allow xml:idatt="" to disable inheritance.
Example usage:
<foo xml:idatts="x">
<bar x="abc"/>
<baz x="hij" />
</foo>
Minimal Victories
Not everyone has been convinced that a generic solution is required, and some of them have been looking instead for a minimal victory. David Carlisle proposed revising how XPointer interprets a fragment identifier, so that as well as using the id function, it checks for attributes called "id". This results in a rather scary XPath expression:
id('Chapter12')|/*[not(id('foo'))]/descendant-or-self::*[@*[local-name()=3D= 'id' and .3D 'Chapter12']][1]
Elliotte Harold was also of the opinion that the architectural hole could be plugged by a change limited to XPointer alone.
...I issue a new request for a standard xml:target attribute. This would provide a unique name for XPointers to link to. It would have no necessary type. It would have no affect on validity. The documents in which it appears may or may not have DTDs, may or may not be valid, and may or may not declare this attribute with any particular type. Whether such a document was valid would be determined exactly according to the rules of XML 1.0.
A good deal of discussion is likely to be needed before consensus forms. There are some issues related to all proposals presented so far (the Deviant is attempting to maintain a list of these separately), and there are several options for how things might proceed.
Moving Forward
If consensus settles on an XPointer-only fix, then there is likely to be pressure applied by the community to have the specification returned to Working Draft status to resolve this issue. It's disappointing that a specification can get this close to becoming a Recommendation with such a big loophole. Something has failed somewhere. In fact it may turn out that this problem has already been considered and rejected. Without disclosure of Working Group discussion it's difficult to surmise anything.
If the consensus is that a more general solution is required, then the appropriate way forward seems to be for a Note to be submitted to the W3C documenting the proposal with the aim of it becoming a separate Recommendation. Tim Bray has suggested that this would be simpler than re-opening the XML specification.
Michael Champion observed that such a specification might actually be created as a community activity, perhaps with it entering a standardization process after implementation experience.
Something like RDDL is *exactly* what I would like to see here. It's just a nice suggestion for a way forward that tools developers can implement rather than re-inventing the id-ness wheel or leaving it to the application writers. Concrete experience with it in the field may motivate the W3C (or ISO, or whoever comes along and applies the lessons of history to XML 1.0) to put it in a "real" standard someday.
While this discussion may seem slightly esoteric -- it certainly doesn't significantly derail the web service or XML-EDI approaches -- it demonstrates that gaps in the web architecture are still appearing, gaps which clearly point to a need for a group like the TAG, the elections for which end on 28 November.
Those with a keen eye will have also realized that separating out the responsibility for the declaration of identifiers could further attenuate the role of DTDs, taking us another step closer to a more layered architecture.
- Here's an idea....
2002-04-27 16:04:49 James Cerra - Can XPointer use an id declared in Schema?
2001-11-09 05:43:22 Steven Tolkin