W3C home > Mailing lists > Public > xsl-editors@w3.org > April to June 2000

XPath and XSLT specs disagree about node()?

From: <keshlam@us.ibm.com>
Date: Tue, 6 Jun 2000 16:59:59 -0400
To: xsl-editors@w3.org, www-xpath-comments@w3.org
Message-ID: <852568F6.0073574E.00@D51MTA03.pok.ibm.com>
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.
     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

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

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:15 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:44:18 UTC