[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: one function call twice for the same variable
Renate,
At 03:20 PM 7/10/2006, you wrote: I need to call one function for the same variable twice (somethin like recursive)... How to do this? I don't see any obvious syntax errors here, but it's also not clear from your description what you are trying to accomplish. Oh, I think I get it. Try this: <xsl:template name="change-string"> <xsl:param name="so-far" select="''"/> <xsl:param name="delimiter-string" select="'-- '"/> <xsl:choose> <xsl:when test="$delimiter-string"> <xsl:call-template name="change-string"> <xsl:with-param name="so-far"> <xsl:call-template name="change"> <xsl:with-param name="name_string" select="$so-far"/> <xsl:with-param name="delimiter" select="substring($delimiter-string,1,1)"/> </xsl:call-template> </xsl:with-param name="delimiter-string" select="substring($delimiter-string,2)"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$so-far"/> </xsl:otherwise> </xsl:choose> </xsl:template> Pass in $CustomerSignerLname to be the "so-far" value when you call it. This kind of thing is much nicer in XSLT 2.0, where XPath is stronger and we even have user-defined functions. Note: wild guess, not checked, tested or refined, comes without warranty. Cheers, Wendell
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|