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

Re: XPath and XSLT specs disagree about node()?

From: <keshlam@us.ibm.com>
Date: Thu, 8 Jun 2000 11:36:44 -0400
cc: xsl-editors@w3.org, www-xpath-comments@w3.org
Message-ID: <852568F8.0055BDBB.00@D51MTA03.pok.ibm.com>
Ah. I did miss the context. Thanks for clarifying this; it impacts a
testcase I was looking at.

Still, I'm not sure the current wording is a chood choice. Explicitly
ruling out only attributes and the root raises an unnecessary opportunity
for confusion about what node() actually means, especially as you don't
explicitly refer folks to the XPath spec for more information about this

I think it would  be better to simply say "node() matches any child node".
That's a much more direct statement of your intent. And it's safer if
someone, some day, introduces some new type of node into the model -- you
wouldn't have to remember to update this description.

Joe Kesselman  / IBM Research

jcaruso@pageflexinc.com (Jeff Caruso) on 06/08/2000 10:46:25 AM

To:   Joseph Kesselman/Watson/IBM@IBMUS
cc:   xsl-editors@w3.org, www-xpath-comments@w3.org
Subject:  Re: XPath and XSLT specs disagree about node()?

keshlam@us.ibm.com wrote:

> 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
> 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

I don't see a disagreement. Section 5.2 is talking about examples of
for template matching. Used as a match pattern, "node()" cannot match an
attribute, because it is an abbreviation for "child::node()", and an
is never a child.

 -- JeffC

Dr. Jeffrey L. Caruso <jcaruso@bitstream.com>
Bitstream, Inc.  215 First St.  Cambridge, MA 02142
Received on Thursday, 8 June 2000 11:39:35 UTC

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