|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Infinite Recursion Looking for Whitespace.
Hello again, I'm still trying to fix my line-break problem. I'm trying to get my recursion loop to rifle through the value of $leftStringValue from the end to the start, but stop when it encounters the first blank space. The xsl:if test works if I set it to the value of $stringLength with a test of "> 0". But the second I change it to look for a space at the last position in a substring of $stringValue it goes infinite and overflows the stack. Any suggestions? <xsl:template name="loop"> <xsl:param name="leftStringLength"/> <xsl:param name="leftStringValue"/> <xsl:if test="(normalize-space(substring($leftStringValue,number($leftStringLength),'1'))) != ' ' "> String Length: <xsl:value-of select="$leftStringLength" /> <BR/> String Value: <xsl:value-of select="$leftStringValue" /> <BR/> String End: <xsl:value-of select="substring($leftStringValue,number($leftStringLength),'1')" /><BR/> <!-- recursive call --> <xsl:call-template name="loop"> <xsl:with-param name="leftStringLength" select="$leftStringLength - 1"/> <xsl:with-param name="leftStringValue" select="substring($leftStringValue,'1',number($leftStringLength)-'1')" /> </xsl:call-template> </xsl:if> </xsl:template> heath deforrest allison "Arrowed!" XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








