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

Re: Find out current node and display next one

Subject: Re: Find out current node and display next one
From: "Joris Gillis" <roac@xxxxxxxxxx>
Date: Sat, 10 Sep 2005 15:03:53 +0200
xslt current node name
Tempore 14:36:44, die 09/10/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Ragnar Heil <r@xxxxxxx>:

using the following xml I want to find out with XSLT which node is the next to the current node. "Next" is defined as a number-prefix of the node-title"

Try this little XSLT:


<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tcm="http://www.CMS.com/ContentManager/5.0">
  <xsl:output method="xml" indent="yes"/>

<xsl:key name="nextItem" match="tcm:Item"
	use="../tcm:Item[number(substring-before(current()/@Title,' '))=
	 number(substring-before(@Title,' '))+1]/@ID"/>

<xsl:template match="tcm:Item">
Current node ID: <xsl:value-of select="@ID"/>
	Next node ID: <xsl:value-of select="key('nextItem',@ID)/@ID"/>
</xsl:template>

</xsl:stylesheet>


regards, -- Joris Gillis (http://users.telenet.be/root-jg/me.html) Gaudiam omnibus traderat W3C, nec vana fides

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.