DOM 3 XPath: Implementation Questions

We have started an implementation of the XPath API on our existing DOM
implementation.  We'd like clarification on a couple of items, due to
disagreement within the implementation team about what was intended by the
specification writers.

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

The specification of XPathEvaluator.createNSResolver seems to suggest that
XPathNSResolver implementations must always be bound to some Node, i.e.,
that they must always work by calling lookupNamespaceURI on some Node. 
However, Issue XPath-6 seems to hint that users can alternatively create
XPathNSResolver implementations from wholecloth, or from whatever they want,
include Nodes.

Which is it, MUST be bound to a Node, or users can create any resolver
implementation they want and createNSResolver is just a convenience
function?

* 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?  We can come up with good reasons to have it
either way.  Does this suggest that an NSResolver is essential for
precomputing an expression (not true in the Xalan-C implementation)?  Is it
merely convenient to have at precomputation time, or mandatory?  Is it
intended to be used and discarded by the time the createExpression function
returns, or is it kept in the XPathExpression object for later use?

This also touches on previously raised issues about whether the NSResolver
must be from the same Document as the XPathEvaluator that creates the
expression.

Thanks,

Perry A. Caro
Adobe Systems Incorporated

Received on Wednesday, 15 May 2002 12:04:09 UTC