[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Difference between preceding::foo[1] and (precedin

Subject: Re: Difference between preceding::foo[1] and (preceding::foo)[1]
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Thu, 6 Sep 2001 15:07:34 +0100
precedin
Hi Marco,

> Now, I understand the syntactic difference between preceding::foo[1]
> and (preceding::foo)[1]. In the first expression, the predicate is
> part of a location path, whereas in the second it is applied to an
> expression. The fact that these two expressions select different
> nodes is also clear to me. What I don't understand is how the
> predicate could apply to a CHILD axis. WHOSE child axis?

Section 2.4 says:

  "An axis is either a forward axis or a reverse axis. An axis that
   only ever contains the context node or nodes that are after the
   context node in document order is a forward axis. An axis that only
   ever contains the context node or nodes that are before the context
   node in document order is a reverse axis... The proximity position
   of a member of a node-set with respect to an axis is defined to be
   the position of the node in the node-set ordered in document order
   if the axis is a forward axis and ordered in reverse document order
   if the axis is a reverse axis. The first position is 1.

   A predicate filters a node-set with respect to an axis to produce a
   new node-set. For each node in the node-set to be filtered, the
   PredicateExpr is evaluated with that node as the context node, with
   the number of nodes in the node-set as the context size, and with
   the proximity position of the node in the node-set with respect to
   the axis as the context position; if PredicateExpr evaluates to
   true for that node, the node is included in the new node-set;
   otherwise, it is not included."

>From this, the only aspect of the axis that's important when assessing
a predicate is whether it's a forward axis or a reverse axis. I
suspect that the use of the 'child axis' for interpreting predicates
on node-set expressions is just a means of saying 'a forward axis' to
make it clear that the node set is ordered in document order for the
purposes of proximity position. It could say 'descendant axis' instead
with the same effect.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.