xsl-list
[Top] [All Lists]

FW: Re: Find out current node and display next one

2005-09-10 06:41:01

Thank you, John! Looks fine so far.

At the moment I cannot generate an output because Xselerator says "Invalid XML. 
A document must contain exactly one root element".

<?xml version="1.0"?><tcm:ListItems 
xmlns:tcm="http://www.tridion.com/ContentManager/5.0"; ID="tcm:9-10-4" 
Managed="68"><tcm:Item ID="tcm:9-26-64" Title="001 von Page1" Type="64" 
Modified="2005-09-10T14:30:18" Icon="T64L0P0"/><tcm:Item ID="tcm:9-28-64" 
Title="002 Kopie von Page1" Type="64" Modified="2005-09-10T14:31:34" 
Icon="T64L0P0"/><tcm:Item ID="tcm:9-27-64" Title="003 Kopie 3 von Page1" 
Type="64" Modified="2005-09-10T14:30:38" Icon="T64L0P0"/><tcm:Item 
ID="tcm:9-25-64" Title="004 Kopie von Page1" Type="64" 
Modified="2005-09-10T14:30:57" Icon="T64L0P0"/><tcm:Item ID="tcm:9-24-64" 
Title="index" Type="64" Modified="2005-09-10T14:31:10" 
Icon="T64L0P0"/></tcm:ListItems>


Ragnar


"Joris Gillis" <roac(_at_)pandora(_dot_)be> schrieb am 10.09.05 15:24:21:

Tempore 14:36:44, die 09/10/2005 AD, hinc in 
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com scripsit Ragnar Heil 
<r(_at_)gnar(_dot_)de>:

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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>