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

limit the results of preceding in predicate

Subject: limit the results of preceding in predicate
From: Marc Lambrichs <marc.lambrichs@xxxxxxxxxxxxx>
Date: Wed, 14 Feb 2007 10:50:31 +0100
 limit the results of preceding in predicate
Suppose $tail is a nodeset of 'A' nodes:
<xsl:variable name="tail" select="//A"/>
All 'A' nodes have an attribute 'property' which contains a number.

Now I want to find the first 'A' node inside $tail that has a certain property ( in this case: the sum of all preceding @property = $someNumber ).

If you use the following declaration just once, there's no problem.

<xsl:variable name="test" select="$tail[sum(preceding-sibling::A/@property) = $someNumber][1]"/>

However, if $tail is part of a recursion process and changes, how can I make sure that the 'preceding-sibling::A' are restricted to the current $tail nodes?

--
Marc

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.