W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2002

Re: XPath namespace nodes

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Fri, 13 Sep 2002 13:46:10 -0400
To: www-dom@w3.org
Message-ID: <OFC73FAE39.8FBB7098-ON85256C33.00601406-85256C33.00624B23@us.ibm.com>

On Friday, 09/13/2002 at 10:25 MST, rayw@netscape.com (Ray Whitmer) wrote:
> DOM Namespace nodes are clearly NOT created when the DOM element is
> created.

They're created when the XPath runs, which I think is fine; anything 
before that is "parse time" for XPath's purposes.

The only thing which might make this distinction visible would be that we 
may produce new objects each time. HOWEVER -- remember that object 
identity is *not* the official way to test DOM node identity; that can 
only be done portably via the DOM L3  isSameNode() method. That could be 
appropriate jiggered to return true for namespace node objects created via 
two separate queries, if they declare the same prefix and namespace and if 
the ownerElements match (also conceptually tested via isSameNode()).


Note that in XPath 2.0 current draft the question of ownership of 
namespace nodes pretty much goes away -- they allow it to be assigned 
fairly arbitrarily, so it _could_ be the ownerElement of the actual Attr 
this namespace came from.  (Xalan takes that approach and trusts XPath 2.0 
will bless it. Fact is, almost nobody uses the namespace axis and of those 
a vanishingly small number ever ask for the XPath-parent of a namespace 
node, so this deliberate divergence from XPath 1.0 makes very little 
real-world difference.)

______________________________________
Joe Kesselman  / IBM Research
Received on Friday, 13 September 2002 13:46:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:56 GMT