W3C home > Mailing lists > Public > xml-names-editor@w3.org > November 2005

Re: Applying namespaces to unprefixed attribute names

From: Tim Bray <tbray@textuality.com>
Date: Wed, 02 Nov 2005 07:44:13 -0800
To: "Sean M. Burke" <sburke@cpan.org>
Cc: xml-names-editor@w3.org
Message-id: <BFCB8F2C-11FF-4A6D-9161-A4DEDB73CD4D@textuality.com>

On Nov 1, 2005, at 11:17 PM, Sean M. Burke wrote:

> I am confused about a particular aspect of XML namespaces as  
> defined in the "Namespaces in XML" document and its errata.   
> Namely: I can't find anywhere in the spec (or errata) that  
> explicitly explains how to treat unqualified attributes -- i.e.,  
> explaining how they get their namespace.

That's because unprefixed attribute names can never be in an XML  
namespace.  Element and attribute names are different.  Element names  
can be in a namespace in two different ways; by being prefixed, or  
unprefixed with a default namespace in effect.  An attribute can be  
in a namespace only when prefixed.

That is to say, in

<e1 xmlns="a:c" xmlns:x="d:e"><e2 a1="1"/><x:e3 a2="2"/><e4 x:a3="3"/ 

only a3 is in a namespace, neither a1 nor a2 are in any namespace. -Tim
Received on Wednesday, 2 November 2005 18:37:36 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:13:34 UTC