TAG Finding: Using QNames as Identifiers

TAG Draft 30 Apr 2002

This version:
http://www.w3.org/2001/tag/doc/qnameids (HTML, XML)
Norman Walsh, Sun Microsystems, Inc. <Norman.Walsh@Sun.COM>


The question (see issue qnameAsId-18) that prompted this finding was "are QNames acceptable replacements for URIs as identifiers within specifications?" This finding documents the TAG's opinion on the use of QNames as identifiers.

Status of this Document

This document has been developed for discussion by the W3C Technical Architecture Group.

This document is the work of the editor. It is a draft with no official standing. It does not necessarily represent the consensus opinion of the TAG.

Comments may be directed to the W3C TAG mailing list www-tag@w3.org (archive).

Publication of this document by W3C indicates no endorsement by W3C or the W3C Team, or any W3C Members.

Table of Contents

1 QNames in Namespaces in XML
2 QNames in Other Specifications
3 Architectural Observations
4 Architectural Recommendations
5 References

1 QNames in Namespaces in XML

Qualified names (QNames) were introduced by [XML Namespaces]. They were defined for element and attribute names (only) and provided a mechanism for concisely identifying a URI/localname pair.

When used solely in element and attribute names, all QNames are identified by the XML processor and can logically be replaced by the URI/localname pair they identify.

2 QNames in Other Specifications

Other specifications, starting perhaps with [XSLT], have taken QNames and employed them in other contexts. Specifically, QNames have been used in element content and attribute values.

In these contexts, QNames are most often used to identify a particular element type; they are, in principal using QNames as they were intended.

It's possible that specifications will invent new uses for QNames as well, using them as shortcuts for unique identifiers derived from a URI/localname pair that have no relationship to element or attribute types.

3 Architectural Observations

The TAG makes the following observations:

4 Architectural Recommendations

The TAG recognizes that there are pragmatic reasons why it is desireable to provide the same kind of URI/localname shortcuts that QNames provide for element and attribute names in other contexts. In addition, the practice is already well established. Therefore, the TAG accepts that it is reasonable to use QNames in this way.

The TAG encourages designers to consider carefully the ramifications of the use of QNames in other contexts on the complexity of processors for their grammars. Where possible, limiting their use to attribute values and simple element content that can be identified as having a QName type may ultimately reduce the complexity.

5 References

XML Namespaces
Tim Bray, Dave Hollander, Andrew Layman, editors. Namespaces in XML. World Wide Web Consortium, 1999. (See http://www.w3.org/TR/REC-xml-names/.)
James Clark, editor. XML Transformations (XSLT) Version 1.0. World Wide Web Consortium, 1999. (See http://www.w3.org/TR/xslt.)