Subject: Re: [xsl] Return value from a template 2... From: Ruud Grosmann <r.grosmann@xxxxxx> Date: Wed, 23 Jan 2008 09:55:46 +0100 |
Hi Dave,I want to return a value from a template(getIdList). The returned value is saved in a variable ($idList) and is a string wich is the concatenation of my nodes id : id1,id2,id3,... I use this code wich is not working... i got nothing when i display the variable value...!!
Here's my code:
<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output indent="yes" method="html" omit-xml-declaration="no" encoding="ISO-8859-1" /> <xsl:param name="delimiter" select="','"/>
<xsl:template match="/root"> <xsl:variable name="idList"> <xsl:call-template select="/root/vid" name="getIdList" /> </xsl:variable> <xsl:value-of select="$idList"/> </xsl:template>
<xsl:template match="/root/vid" name="getIdList"> <xsl:for-each select="."> <xsl:variable name="var" select="concat($var,ids, $delimiter)"/> </xsl:for-each> <xsl:value-of select="$var"/> </xsl:template>
</xsl:stylesheet>
What's wrong in it? is there another simple way to get what i want?
<xsl:template match="/root"> <xsl:variable name="idList"> <xsl:call-template name="getIdList"> <xsl:with-param name='list' select="/root/vid"/> </xsl:call-template> </xsl:variable> <xsl:value-of select="$idList"/> </xsl:template>
<xsl:template name="getIdList"> <xsl:param name='list'/>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Return value from a template , Batis DAVE | Thread | RE: [xsl] Return value from a templ, Michael Kay |
[xsl] Return value from a template , Batis DAVE | Date | [xsl] RE: xsl-list Digest 23 Jan 20, Laura Porter |
Month |