W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2001

Re: namespace nodes and their naming properties

From: Philippe Le Hegaret <plh@w3.org>
Date: Tue, 20 Mar 2001 16:36:02 -0500
Message-ID: <3AB7CD42.9D16BEB4@w3.org>
To: Jeffrey Hantin <jhantin@verisign.com>
Cc: www-dom@w3.org
Jeffrey Hantin wrote:
> The way namespace nodes interact with the ...NS() level 2 calls seems a
> bit unclear to me.  XML-Infoset distinguishes attribute nodes from
> namespace nodes, whereas apparently DOM does not, other than requiring a
> fixed namespaceURI for them.
> As I read the spec, the namespaceURI of namespace nodes is fixed as
> "http://www.w3.org/2000/xmlns/".  What are the localName and prefix of a
> namespace node?  Are they determined lexically in the usual way?

The DOM does not expose the namespace nodes. The main reason is that the
Infoset is not yet a recommendation.

> Also, suppose a document contains this element:
> <x xmlns:foo="baz" xmlns:bar="http://www.w3.org/2000/xmlns/"
> bar:foo="quux"/>
> If using getAttributeNS(), wouldn't xmlns:foo and bar:foo be essentially
> indistinguishable?

Your example is wrong according to the Namespace recommendation and can't be
represented in a DOM document:
In XML documents conforming to this specification, no tag may contain two
attributes which:
  1.have identical names, or 
  2.have qualified names with the same local part and with prefixes which have
    been bound to namespace names that are identical. 

-- Namespaces in XML
Thu, 14 Jan 1999 22:24:57 GMT

Received on Tuesday, 20 March 2001 16:36:11 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:08 UTC