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

Re: recursive loop in XSL stylesheet is failing

Subject: Re: recursive loop in XSL stylesheet is failing
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 25 Mar 2010 21:19:07 +0000
Re:  recursive loop in XSL stylesheet is failing
On 25/03/2010 20:38, George wrote:
There is one tiny little bit that I want to change. On the output the
categories start with a colon:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:key name="c" match="Category" use="@ID"/>
<xsl:variable name="c" select="document('Categories.xml')"/>
<xsl:template match="Entry">
<xsl:text>&#10;</xsl:text>
<xsl:value-of select="Date"/>
<xsl:text>;</xsl:text>
<xsl:variable name="cid" select="CategoryID"/>
<xsl:for-each select="$c">
<xsl:apply-templates select="key('c',$cid)"/>
</xsl:for-each>
<xsl:text>;</xsl:text>
<xsl:value-of select="Recipient"/>
<xsl:text>;</xsl:text>
<xsl:value-of select="Value"/>
</xsl:template>

<xsl:template match="Category">
<xsl:variable name="cid" select="@ParentID"/>
<xsl:for-each select="$c">
 <xsl:apply-templates select="key('c',$cid)"/>
 <xsl:if test="key('c',$cid)">:</xsl:if>
</xsl:for-each>
 <xsl:value-of select="en"/>
</xsl:template>

</xsl:stylesheet>

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.