XPath and XSLT specs disagree about node()?

In the XPath spec, Section 2, there's an example:
     * child::node() selects all the children of the context node,
       whatever their node type
My thought processes: "OK, child:: is selecting all the children, and
node() is a wildcard meaning any-node-type. Compare this with the previous
example, child::*, which selects only elements."

That seems to be confirmed by later statements:
     A node test node() is true for any node of any type whatsoever.
and
     A location step of . is short for self::node()


BUT XSLT DISAGREES! In section 5.2, it says:
     * node() matches any node other than an attribute node  and the root
node

This is an important difference! If you try to use XPath's expansion for
"." with XSLT's definition of node(), "." fails when the current node is an
attribute.

It looks to me as if XSLT misread the example in the XPath spec. If so, an
erratum is needed. Otherwise,  the two specs seem to be incompatable, which
I'm sure is not what you had in mind!

______________________________________
Joe Kesselman  / IBM Research

Received on Tuesday, 6 June 2000 17:00:16 UTC