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

node lists

Subject: node lists
From: Richard Lewis <richardlewis@xxxxxxxxxxxxxx>
Date: Tue, 19 Oct 2004 11:38:17 +0100
node lists
Hello XSLers,

Is there a way of selecting a node in a node list (as opposed to set, I've been reading the FAQ ;-) other than the current one?

e.g.

01:<xsl:template match="//item[@id=$selected-item]">
02: <!-- item navigator -->
03: <xsl:variable name="current-node-class" select="@class">
04: <xsl:variable name="current-node" select="@id">
05: <xsl:variable name="next-item-id">
06: <xsl:for-each select="//item[@class=$current-node-class">
07: <xsl:sort select="@id" />
08: <xsl:if test="@id=$current-node and position()!=last()">
09: <xsl:value-of select="item[position()+1]/@id /> <!-- :-o -->
10: </xsl:if>
11: </xsl:for-each>
12: </xsl:variable>
13: <a href="?selected-item={$next-item-id}">NEXT</a>
14: <!-- some similar code for previous item..... -->
15:
16: <!-- item content -->
17: <h2><xsl:value-of select="@name" /></h2>
........
18:</xsl:template>


Line 09 here doesn't work because I need some expression which allows me to select the next item in the sorted node list generated by the <xsl:for-each>.

Any ideas?

Cheers,
Richard

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.