The W3C XML Core Working Group has posted the candidate recommendation
of xml:id Version 1.0. This describes an idea that's been kicked around in the community for some time. The basic problem is how to link to elements by IDs when a document doesn't have a DTD or schema. The proposed solution is to predefine an xml:id
attribute that
would alays be recognized as an ID, regardless of the presence or absence of a DTD or schema. Unfortunately, it's recently been discovered that
this is pretty badly incompatible with canonical XML, which likes to inherit attributes in the XML namespace onto descendant elements, thus moving xml:id's from one element to another. This has downstream effects on XML digital signatures and XML encryption. The working group is still trying to figure out what to do about this, and fixing may necessitate going back to last call.
The problem is really in canonical XML, which assumed that all attributes in the XML namespace would act like xml:lang
and xml:space
.
Unfortunately the two defined after canonical XML don't behave that way.
(xml:base
also turns out to be subtly incompatible with canonicalization.)
If we could go back in time, then fixing canonical XML would be the obvious choice. Hindsight's 20/20. However since we can't do that, and since canonical XML is already widely deployed,
the proposal I favor suggests using an xmlid
attribute in no namespace instead. The working group doesn't seem to like that. I'm afraid that solution is just a little too simple for the W3C since it doesn't activate the whole namespace machinery they're so fond of.