[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: determining position based on predicate
On 15/10/2010 18:05, Terry Ofner wrote:
<xsl:when position()=count(.[lesson/lessontitle='Lesson A'])-1"> .[anything] will select either this node (if the predicate is true) or nothing otherwise, so the count is always 0 or 1. I'd guess you intended count(../tocItem[lesson/lessontitle='Lesson A']) although it might be ore efficient to work out that number into a variable before starting the loop or perhaps your xslt system will be smart enough to notice that the value doesn't depend on the current item if that was selected with the child axis. David
|
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
|