W3C home > Mailing lists > Public > www-tag@w3.org > July 2011

Re: Advice please on XML: attributes and namespaces

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Fri, 01 Jul 2011 17:12:09 +0200
To: Misha.Wolf@thomsonreuters.com
Cc: www-tag@w3.org, mdirector@iptc.org
Message-ID: <0pnr07p72njnf3sjsq71ac7brd9m73jffc@hive.bjoern.hoehrmann.de>
* Misha.Wolf@thomsonreuters.com wrote:
>This posting refers to the discussion on the NAR-dev conference call
>last Friday, 24 June. The issue was: do attributes inherit the namespace
>of its element and this way also default namespaces?

"The namespace name for an unprefixed attribute name always has no
value." ~ <http://www.w3.org/TR/xml-names/#defaulting> (the 'xmlns'
attribute is an exception). So, no, a default namespace declaration
does not affect the namespace name associated with any attribute.

The text "the interpretation of unprefixed attributes is determined
by the element on which they appear" refers to this:

  <set var='one'>1</set>     <!-- change variable $one to `1` -->

  <set var='one'>1 2 3</set> <!-- variance of set {1,2,3} is 1.0 -->

In the first example, the 'var' attribute is interpreted as variable
name. In the second example, the 'var' attribute is interpreted as
the statistical variance of the set of numbers. The interpretation of
the unprefixed attribute 'var' is determined by the element on which
it appears, it's meaning is local just as its name is local.

In contrast, the interpretation of the 'xml:lang' attribute does not
depend on which element it appears on. That's a prefixed, global name.
Prefixed names do not necessarily have global meaning, but unprefixed
names, apart from names starting with `xml`, never have global meaning.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Friday, 1 July 2011 15:12:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:48:39 GMT