W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2002

Re: DOM 3 XPath: Implementation Questions

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Thu, 16 May 2002 09:09:42 -0400
To: www-dom@w3.org, caro@Adobe.COM
Message-ID: <OF78210E9D.252D910B-ON85256BBB.0047DA85@pok.ibm.com>

 > * XPathNSResolver: MUST be bound to Node, or not?

Not. We provide a convenience function which creates one standard version
based on a context node, but users can plug in their own implementations if
they want to derive the data from some other source such as an
application-specific list.  Some existing XPath implementations, such as
Xalan, offer the same option: Wrap a convenience implementation around a
DOM node, if you have a DOM node, or provide your own.

> * XPathExpression: NSResolver at create time vs. at evaluate time
>
> What is intended by the fact that, for XPathExpression, the
XPathNSResolver
> is specified at XPathExpression creation time, rather than at
> XPathExpression.evaluate time?

XPath is namespace-aware. The meaning of an XPath depends on how prefixes
used in the XPath are bound. If you're doing any sort of
compilation/optimization in the process of creating the XPathExpression
object, you want to do that binding early, during the compilation process.

There really isn't a good justification, in my opinion, for late binding of
those prefixes; if anything, that would tend to defeat the namespace-aware
semantics of the XPath.

______________________________________
Joe Kesselman  / IBM Research
Received on Thursday, 16 May 2002 09:10:37 GMT

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