Re: Advice please on XML: attributes and namespaces

* 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 UTC