This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Difference between preceding::foo[1] and (preceding::foo)[1]


Could someone shed some light on the following statement from Section 
3.3 of the XPath 1.0 specification: "The Predicate [on an expression 
that is not a location path] filters the node-set with respect to 
the child axis"?

The spec gives the following example (to warn against surprises):
    "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."

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?

I mean, the expression preceding::foo will select a node-set. Is this
node-set anyone's child, and if so, whose then?

Regards,
Marco 


***************************DISCLAIMER***********************************
Deze e-mail is uitsluitend bestemd voor de geadresseerde(n). 
Verstrekking aan en gebruik door anderen is niet toegestaan.
Fortis sluit iedere aansprakelijkheid uit die voortvloeit uit
electronische verzending.

This e-mail is intended exclusively for the addressee(s), and may
not be passed on to, or made available for use by any person 
other than the addressee(s).
Fortis rules out any and every liability resulting from any
electronic transmission.
************************************************************************

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]