Update 2005-02-09: In February 2005 the W3C XML Core Working Group released xml:id Version 1.0 as a Candidate Recommendation. It introduces a predefined attribute name that can always be treated as an ID and hence can always be recognized. The specification defines the meaning of the attribute xml:id as an ID attribute in XML documents and processing of the attribute to identify IDs in the absence of validation, without fetching external resources or relying on an internal subset. See details in the news story "W3C Publishes Candidate Recommendation for xml:id Universal Identifier."
[April 13, 2004] An initial public working draft for xml:id Version 1.0 has been released by the W3C XML Core Working Group. The proposal provides a mechanism for annotating markup elements with unique identifiers. It 'unreserves' the attribute xml:id which otherwise cannot be declared for use in a well-formed XML document.
The draft specification proposes xml:id "as a universal spelling for ID attributes, and defines processing of this attribute to identify IDs in the absence of validation." The document proposes that a parser would "validate that the ID value matches the allowed lexical form, that the value is unique within the XML document, and that each element has a single unique identifier."
The new working draft takes into account the W3C's xml:id Requirements document published in August 2003 and an earlier W3C Technical Architecture Group (TAG) finding, "How should the problem of identifying ID semantics in XML languages be addressed in the absence of a DTD?" The draft TAG finding summarized the problem and sketched a solution space in terms of applying ID semantics universally for XML processors. The xml:id Requirements document framed the problem thus: Since XML 1.0, the ability of processors to identify an XML element by an explicit identifier ('IDness') has depended upon validation: both DTDs and XML Schema have mechanisms to identify the structures containing unique identifiers, but neither XML Schema nor DTDs are required by all processors. A common processor type does not perform validation, nor fetch external resources for the purpose of acertaining whether the document contains unique identifiers."
The authors of the xml:id Version 1.0 document note that the Working Draft "does not yet fully address specific interactions between this specification and others. The intent is for this specification to compose smoothly with other specifications, but some specifications, particularly those not based on the XML Information Set, may require errata to realize the full benefits of xml:id. These interactions are a topic of study by the Working Group and will be documented in future Working Drafts."
xml:id Version 1.0. W3C Working Draft 7-April-2004. Edited by Jonathan Marsh (Microsoft) and Daniel Veillard (Invited Expert). Version URL: http://www.w3.org/TR/2004/WD-xml-id-20040407. Latest version URL: http://www.w3.org/TR/xml-id/. Also available in (non-normative) XML format.
See also: xml:id Requirements. W3C Working Draft 6-August-2003. Edited by Jonathan Marsh (Microsoft). Version URL: http://www.w3.org/TR/2003/WD-xml-id-req-20030806. Latest version URL: http://www.w3.org/TR/xml-id-req.
Overview of Proposed xml:id as a Universal ID Markup Construct
Background: XML specification Section 2.3 'Common Syntactic Constructs': defines Name as a "token beginning with a letter or one of a few punctuation characters, and continuing with letters, digits, hyphens, underscores, colons, or full stops, together known as name characters [however,] Names beginning with the string 'xml', or with any string which would match (('X'|'x') ('M'|'m') ('L'|'l')), are reserved for standardization in this or future versions of this specification." For this reason, the proposal needs to "unreserve" the name xml:id before designating it for use as an attribute in XML documents.
"XML 1.0 provides a mechanism for annotating elements with unique identifiers. This mechanism consists of declaring the type of an attribute as 'ID', after which the parser will validate that the ID value matches the allowed lexical form, that the value is unique within the XML document, and that each element has a single unique identifier. To declare IDs within an XML document, one need only provide an internal or external subset containing such a declaration. However, processing of this information if present in the external subset is optional for conformant XML processors, leaving no guarantee that all consumers of the XML document will be able to successfully recognize the identifiers.
Identifiers can be declared through external mechanisms as well. Of particular interest is [XML Schemas] which provides a type xs:ID with the same uniqueness and validity constraints as XML does. However, there are no guarantees that consumers will have the 'correct' schema available, nor that they will process it if they do.
An additional problem is that DTD-based and XML Schema-based identifiers are exposed through different conceptual mechanisms — the [attribute type] infoset property, and the [type definition] family of properties respectively. A uniform mechanism for recognizing identifiers is desirable.
A mechanism allowing unique element identifiers to be recognized by all conformant XML processors, whether they validate or not, is desirable in making XML sub-resource linking robust.
This specification unreserves the attribute xml:id for use as a common syntax for identifiers in XML. Authors of XML documents are encouraged to name their ID attributes xml:id to increase the interoperability of these identifiers on the Web.
In namespace-aware XML processors, the xml prefix is bound to the namespace name http://www.w3.org/XML/1998/namespace as described in Namespaces in XML. Note that xml:id can be still used by non-namespace-aware processors.
Usage: DTD authors are encouraged to exclusively use xml:id in their DTDs to indicate element identifiers... XML Schema authors are encouraged to exclusively use xml:id in their schemas to indicate element identifiers..." [excerpted from the 7-April-2004 specification]
Related: Mozilla and IE Support ID Attributes
In "Your Own ID Attributes as Link Destinations" (O'Reilly Developer Weblogs, 2004-04-29), Bob DuCharme wrote: "The XML world has debated the best way to assign identity to elements. Choices include attributes declared as being of type ID in a DTD or schema, the recently updated xml:id proposal, and rdf:ID attributes. I recently discovered that when you send Mozilla or IE to an XML document that points to a stylesheet transforming it to HTML, and that transformation adds unique ID values to the HTML versions of the elements, a fragment identifier of a particular element's ID added to the URL sends the browser right to that element. You can base these ID values on attribute (or element!) values from your original data, which means that any values that you use to assign identity to elements can turn those elements into Mozilla or IE linking destinations. Mozilla and IE no longer require a name attribute on a elements to let you link to a point within those web pages, because an id attribute on any HTML element can now turn it into a link destination."
- xml:id Version 1.0. W3C Working Draft 7-April-2004.
- xml:id Requirements. W3C Working Draft 6-August-2003.
- "How should the problem of identifying ID semantics in XML languages be addressed in the absence of a DTD?" Draft TAG Finding, 5-Oct-2003. Edited by Chris Lilley (W3C).
- "Options for dealing with IDs." By Chris Lilley (W3C). Posted January 19, 2003 to the W3C public list 'www-tag'. The email thread contains nearly 100 postings.
- Mail Archives for W3C public list 'firstname.lastname@example.org'
- W3C news item
- Extensible Markup Language (XML) 1.0 (Third Edition). W3C Recommendation 04-February-2004.
- W3C TAG Findings
- W3C Technical Architecture Group (TAG)
- W3C XML home page
- W3C XML Core Working Group Public Page
- W3C Extensible Markup Language (XML) Activity Statement