Implementation Report for xml:id

XML Core Working Group

23 June 2005


This document lists implementation feedback about xml:id implementations known by the XML Core Working Group at this time.

There is an xml:id specific test suite available via the xml:id Test Suite page.


The following table summarizes the implementation experience of the processors known to the Core WG at this time. Additional details about each implementation follow.

Test xmlidfilter libxml2 lxt xom 1.1 Notes:
normal_001 pass fail fail pass Failure expected; XSLT cannot perform this test.
undecl_001 pass pass pass pass
declar_001 pass pass pass pass
declar_002 N/A N/A N/A N/A Require a W3C XML Schema processor
baddcl_001 pass pass pass pass
dupdup_001 pass pass pass pass
baddcl_002 N/A N/A N/A N/A Require a W3C XML Schema processor
dupdup_002 pass pass pass pass
okchar_001 pass pass pass pass
okchar_002 pass fail pass fail Requires XML 1.1. support
xref___001 pass pass pass pass
normal_002 pass pass pass pass
normal_003 pass fail fail pass Failure expected; XSLT cannot perform this test.


Most implementations fail two tests, normal_001 and normal_003. This is an artifact of the test suite and does not reflect any real implementation problems. The test uses the XSLT id() function in a way that is guaranteed to fail according to the semantics of that function, independent of the underlying ID value.

A specially instrumented build of the xmlidfilter implementation and the XOM implementation demonstrate that the functionality can be implemented.

Two additional tests, declar_002 and baddcl_002 are not actually tested by any known implementation. These tests rely on W3C XML Schema processing and at the moment no implementation is known to support XML Schema. However, there is nothing about the requirements of xml:id with respect to schema processing that should be the cause of any concern.

Finally, the failures of test okchar_002 are easily explained. Those implementations do not support XML 1.1.

Additional Comments


An implementation report is available.

The xml:id Filter is a SAX 2 XMLFilter that performs xml:id processing. It is a complete implementation within the constraints imposed by SAX and the caller:

See http://xmlidfilter.dev.java.net/.


An implementation report is available.

The libxml2 library has had support for xml:id since version 2.6.9 released Apr 18 2004. The support is switched on by default, and xml:id attributes when not in error are handled like DTD ID attributes. As a result they are available as ID for libxml2 XPath, XPointer implementation, as well as for XSLT, XML DSig and other tools or languages based on the libxml2 library since then.

See http://xmlsoft.org/.


An implementation report is available.

The current version of RXP (1.4.4) supports xml:id. Two flags in the API, XMLID and XMLIDCheckUnique, enable xml:id processing and the checking of xml:id values for uniqueness respectively. For the command-line program, there are corresponding options -i and -I.

RXP is available at http://www.cogsci.ed.ac.uk/~richard/rxp.html.

XOM 1.1

An implementation report is available.

XOM 1.1 (d3 and later) automatically recognizes xml:id attributes as having ID type. It normalizes all xml:id attributes per the rules for ID type normalization when parsing documents. It requires all xml:id attributes to have values that are XML 1.0 NCNames. It does not require that these names be unique within a document. It does not attempt to detect duplicate ID values. xml:id is recognized as an ID by XOM's Xinclude and XPath engines.

See http://www.xom.nu/.


Saxonica report that xml:id has been implemented in the Saxon product and will be included in the next release of the software after version 8.4.

Saxon recognizes the xml:id attribute in its two native implementations of the XPath 2.0 data model, so that the XPath 2.0 fn:id() function will retrieve elements having such an attribute. This is independent of any support in the underlying XML parser; it applies both to data model trees constructed by parsing raw XML and to the results of tree construction using XSLT or XQuery, and indeed to trees constructed programmatically by a user application.

Saxon's schema processor also recognizes xml:id in attribute declarations, and enforces the constraint that such an attribute, if used, must be declared with type xs:ID.

See http://www.saxonica.com/.