by Eric van der Vlist is published by O'Reilly & Associates (ISBN: 0596004214)


xsd:QName — Namespaces in XML-qualified names


<xsd:simpleType name="QName" id="QName">
 <xsd:restriction base="xsd:anySimpleType">
 <xsd:whiteSpace value="collapse" fixed="true"/>

Derived from




Known subtypes


Data parameters (facets)

enumeration, length, maxLength, minLength, pattern


The lexical space of xsd:QName is a qualified name according to Namespaces in XML. It is a local name (which is an xsd:NCName) with an optional prefix (itself an xsd:NCName), separated by a colon. The prefix is declared a namespace prefix in the scope of the element carrying the value. Its value space comprises the pairs (namespace URI, local name) in which the namespace URI is the URI associated to the prefix in the namespace declaration.


It is impossible to apply a pattern on the namespace URI.

The usage of QNames in elements and attributes is controversial because it creates a dependency between the content of the document and its markup. However, the official position of the W3C doesn't discourage this practice.


W3C XML Schema itself has already provided some examples of QNames. When I wrote "<xsd:attribute name="lang" type="xsd:language"/>", the type attribute was a xsd:QName, and its value was the tuple {"", "language"}, because the URI "" had been assigned to the prefix "xsd:". If there is no namespace declaration for this prefix, the type attribute is considered invalid.

This text is released under the Free Software Foundation GFDL.