Subject: Re: [xsl] Find out current node and display next one From: "Joris Gillis" <roac@xxxxxxxxxx> Date: Sat, 10 Sep 2005 15:03:53 +0200 |
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"
<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>
regards, -- Joris Gillis (http://users.telenet.be/root-jg/me.html) Gaudiam omnibus traderat W3C, nec vana fides
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Find out current node and dis, Ragnar Heil | Thread | FW: Re: [xsl] Find out current node, Ragnar Heil |
RE: [xsl] Apply-templates - how to , Michael Kay | Date | FW: Re: [xsl] Find out current node, Ragnar Heil |
Month |