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

Re: Template-matching nodes from input vs nodes in va

Subject: Re: Template-matching nodes from input vs nodes in variable based on their position
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 22 Jun 2015 17:30:46 -0000
Re:  Template-matching nodes from input vs nodes in  va
Jorge . chocolate.camera@xxxxxxxxx wrote:

And yet, indeed as per your answers, if I query the position of that
node, the value returned is 1 instead of 3:

<xsl:sequence select="$FOO[position() eq 3]/position()"/> b 1

which looks bizarre to me.

If you look at http://www.w3.org/TR/xpath20/#id-path-expressions then you see that for
E1/E2
(where in your case E1 is $FOO[position() eq 3] and E2 the position() function call) it says that first E1 is evaluated and then "Each node resulting from the evaluation of E1 then serves in turn to provide an inner focus for an evaluation of E2".


So doing
E1/position()
always (as long as E1 evaluates to a sequence of nodes) returns 1 as the context size is 1.


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.