[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [xml-dev] Re: determining ID-ness in XML
- From: Joe English <jenglish@flightlab.com>
- To: xml-dev@lists.xml.org
- Date: Mon, 29 Oct 2001 18:29:24 -0800
Tim Bray wrote:
> James Clark wrote:
> >
> > The problem that xml:id is not completely solving the problem,
> > at least as I see it. A complete solution would allow me to
> > declare in the instance that such and such an attribute is an
> > ID attribute, whereas xml:id only allows me to say what the
> > ID of an element is.
>>
> You're right. However the Web has an honorable tradition of
> succeeding by not trying to solve the whole problem. I suggest
> that "only being able to say what the ID is" constitutes a big
> juicy 80/20 point.
It looks more like a 20/80 solution to me. As James points out,
'xml:id' won't work for existing vocabularies that already have a
defined ID mechanism (like RDF and XHTML). Internal DTD subsets
won't work for application profiles that forbid document type
declarations (like SOAP), must work in streaming mode where the
complete set of vocabularies isn't known up front (like Jabber
or, again, SOAP), or already use external DTDs.
PIs might be workable, but there are profiles that forbid even those,
(not to mention that a PI-based solution is politically infeasible).
xml:id could really only be used for yet-to-be-defined vocabularies
and the Next Version of current vocabularies (and only for those
if they want to break backwards compatibility with the installed
base of software).
> >An alternative would be to have an attribute that declares the name
> >of the attribute that is an ID attribute, say xml:idatt.
>
> As the famous quote says, all hard problems in Computer Science
> are solved via the addition of one level of indirection. :)
Yep. This is why 'xml:idatt' (or better still, 'xml:idatts', plural)
is appealing.
The only other workable alternative I can think of is to
modify the XPointer spec -- which AFAICS is the principal
bit of technology that really needs to identify IDs without
prior knowledge of the vocabulary -- so that
http://somewhere/something#foo
is interpreted as
document("http://somewhere/something")
/ descendants-or-self::*[attval::*[local-name() = 'id'] = 'foo'][1]
An inelegant solution to be sure. (Though this is basically
what I always do anyway when I need to identify IDs, since
in practice it's more reliable than anything else.)
--Joe English
jenglish@flightlab.com