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 returns the first foo element in reverse document order, because the axis that applies to the  predicate is the preceding axis; by contrast, (preceding::foo) returns the first foo element in document order, because the axis that applies to the  predicate is the child axis. </snip> I can see that preceding::foo 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), 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) 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
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format