Re: namespace nodes and their naming properties

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
http://www.w3.org/TR/1999/REC-xml-names-19990114/#uniqAttrs
Thu, 14 Jan 1999 22:24:57 GMT

Philippe

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