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

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

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

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

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