W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2001

QNames without prefix

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Wed, 24 Oct 2001 12:02:18 +0200
Message-ID: <3BD691AA.4030801@dyomedea.com>
To: xmlschema-dev@w3.org
Hi,

The definition of a QName isn't clear about the interpretation of QNames 
without prefixes.

The definition in part 2 is merely a reference to Namespaces in XML:


"3.2.18 QName

[Definition:]   QName represents XML qualified names. The ·value space· 
of QName is the set of tuples {namespace name, local part}, where 
namespace name is an anyURI and local part is an NCName. The ·lexical 
space· of QName is the set of strings that ·match· the QName production 
of [Namespaces in XML].
NOTE: The mapping between literals in the ·lexical space· and values in 
the ·value space· of QName requires a namespace declaration to be in 
scope for the context in which QName is used."

Namespaces in XML 1.0 is clear about the definition of a QName:

"The Prefix provides the namespace prefix part of the qualified name, 
and must be associated with a namespace URI reference in a namespace 
declaration. [Definition:] The LocalPart provides the local part of the 
qualified name."

But the meaning of omitted prefix is context dependent and is different 
when the QName is used for an element name (the URI associated to the 
QName is then the URI of the default namespace when defined):

"A default namespace is considered to apply to the element where it is 
declared (if that element has no namespace prefix), and to all elements 
with no prefix within the content of that element. If the URI reference 
in a default namespace declaration is empty, then unprefixed elements in 
the scope of the declaration are not considered to be in any namespace."

and for an attribute attribute (the default namespace doesn't apply):

"Note that default namespaces do not apply directly to attributes."

XPath which is using QNames has chosen to ignore default namespaces as well.

W3C XML Schema, judging by its own usage of QNames as references to 
components, seems to support the default namespace.

Can someone confirm this since this isn't crystal clear in the rec?

Thanks

Eric
-- 
Rendez-vous à Paris pour le Forum XML.
                    http://www.technoforum.fr/Pages/forumXML01/index.html
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
------------------------------------------------------------------------
Received on Wednesday, 24 October 2001 07:13:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:24 GMT