Kendall,

Interesting observation, there must be some history as to why the "or node list" was removed (mind you I only found this in a "for example" sentence, it was probably never normative). As far as I can tell, the code in both JDK 6 and in Xalan 2.7.0 only support Node as a context item now --in fact, I'm unsure what the semantics would be if a NodeList is passed instead.

Perhaps the original intention was to support different types for a context, but as I said, only Node seems to be supported now.

 Hope this helps.

-- Santiago

On Jun 17, 2007, at 1:58 PM, Kendall Shaw wrote:

Hi,

I'm familiar with the notion of xpath expressions being evaluated
relative to a context node within a current node list.

The javadoc for the XPath.evaluate(String, Object, QName) method says
that the second parameter is the context, "a node or node list, for
example". Using Xalan 2.7, If I pass a NodeList as the second
parameter "count(self::node())" returns 0, and "self:node()" returns
an empty node list. "*/node()" results in an "Unknown error in XPath".

In Sun's SE 6 the javadoc now leaves out the words "or node list".

So, if a node list can be passed as the second parameter, how should
the XPath expression refer to it? Or, if a node list should not be
passed as the second paraemter, is there a reason why the parameter
is not of type Node? Is there another type of object other than a
sub-class of Node that can be passed as the second parameter?

Kendall


Reply via email to