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

Re: Applying namespaces to unprefixed attribute names

From: Richard Tobin <richard@inf.ed.ac.uk>
Date: Wed, 2 Nov 2005 13:31:35 +0000 (GMT)
To: "Sean M. Burke" <sburke@cpan.org>, xml-names-editor@w3.org
Message-Id: <20051102133135.3C6E153489B@macintosh.inf.ed.ac.uk>

>    <Stuff  xmlns       ="urn:Pies"
>            xmlns:cakes ="urn:Cakes"
>    >
>      <a       y="123/>
>      <cakes:b z="123/>
>    </Stuff>
> 
> I am looking for some part of the spec that explains what namespaces 
> apply to "y" and "z".  I'm guessing that each of the two attributes gets 
> its namespace from its element, so that y's namespace is a's namespace, 
> which is "urn:Pies", and z's namespace is cakes:b's namespace, which is 
> "urn:Cakes".  But this is just my guess.

The interpretation is of an unprefixed attribute is determined by the
element it belongs to.  But it's best to think of them as being an no
namespace, and this is consistent with the approach taken in standards
such as XPath, where an unprefixed attribute's namespace uri is null.

If you like, you can take the approach suggested in the
(non-normative) appendix, and consider them to be in a sort of
sub-namespace belonging to the element they are attached to.  But this
is not the same as the element's own namespace.

Either way, given <cakes:b z="123" cakes:z="123">, the attributes z
and cakes:z are not the same.

-- Richard
Received on Wednesday, 2 November 2005 13:32:06 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 19:56:50 UTC