Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello!
Is it possible to pass the return value of a template call to a variable?
Something like this:
<xsl:template match="/"> <xsl:variable name="ReturnValue"> <xsl:call-template name="DoSamething"> <xsl:with-param name="Param1" select="'Hello '"/> <xsl:with-param name="Param2" select="'World'"/> </xsl:call-template> </xsl:variable> <xsl:choose> <xsl:when test="$ReturnValue = ''"> <xsl:value-of select="'Return Empty'"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$ReturnValue" /> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="DoSamething"> <xsl:param name="Param1" select="."/> <xsl:param name="Param2" select="."/> <xsl:value-of select="concat($Param1, $Param2)" /> </xsl:template>
I want to test if the "call-template" return anything.
Thanks
Paulo
Hi Paulo, not too sure what you are trying to achieve - guessing that it's not string concatenation? From looking at your XSLT, it should work, can't see any immediate problems with it.
Cheers, Lee.
You are right.... There is nothing wrong with this. The problem that I had was in another place in the code...
Thanks.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Return Value from a Template
Hello!
Is it possible to pass the return value of a template call to a variable?
Something like this:
I want to test if the "call-template" return anything.
Thanks
Paulo
Hi Paulo, not too sure what you are trying to achieve - guessing that it's not string concatenation? From looking at your XSLT, it should work, can't see any immediate problems with it.
Cheers, Lee.
You are right.... There is nothing wrong with this. The problem that I had was in another place in the code...
Thanks.
is working on a reply...