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

Context node/Predicates in Expressions

Subject: Context node/Predicates in Expressions
From: John Robert Gardner <jrgardn@xxxxxxxxx>
Date: Thu, 25 May 2000 13:18:39 -0400 (EDT)
Context node/Predicates in Expressions
One more question of abstract nature.  Reading XPath 3.3, viz. Node Sets,
I saw the following:

<snip>
NOTE: The meaning of a Predicate depends crucially on which axis applies.
For example, preceding::foo[1] returns the first foo element in reverse
document order, because the axis that applies to the [1] predicate is the
preceding axis; by contrast, (preceding::foo)[1] returns the first foo
element in document order, because the axis that applies to the [1]
predicate is the child axis.
</snip>

I can see that preceding::foo[1] returns the first foo element in reverse
order--by this I am given to understand, the foo immediately preceding the
context node.  However, in  (preceding::foo)[1], I do not understand the
"discursive meaning" (cf. my prev. post looking for a human-readable
meaning of "::") of the ()'s in this such that preceding::foo, when in
()'s, is child axis . . . 

It could be that I'm not "getting" the notion of context node.  It makes
clear sense to me, per 2.5, that "The most important abbreviation is that
child:: can be omitted from a location step. In effect, child is the
default axis. For example, a location path div/para is short for
child::div/child::para."  In the (preceding::foo)[1] example, I can't
quite verbally/narratively parse this so I can wrap my head around it.

I'm working for the assumption that, in such a stylesheet with a first
template of:

<xsl:template match="body">

The context node --unless something else has been specified-- is the
document root, correct?  Sort of "by default" -- rather than, for
instance, the root element.

thanks for any clarifications.

john robert


 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.