Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] error:XSLT Stylesheet (possibly) contains a recursion.

From: Vaduvoiu Tiberiu <vaduvoiutibi@--------->
To:
Date: 12/1/2007 2:30:00 PM
Hi, i'm trying to do the following thing: I need to display a string until the last occurance of the space character.So if I would have "this is a news" i would need to display "this is a". I am using xslt1.0 and I tried doing the following:

<xsl:template name="extract">
<xsl:param name="text"/>
<xsl:variable name="length" select="string-length($text)"/>
<xsl:choose>
    <xsl:when test="substring($text,$length-1,$length)=' ' ">
        <xsl:value-of select="substring($text,1,$length-1)"/>
    </xsl:when>
<xsl:otherwise>
    <xsl:call-template name="extract">
        <xsl:with-param name="text" select="substring($text,1,$length-1)"/>
    </xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

basically I check if the last char of the string is space, display the text minus last char, otherwise, test again with text minus the last char. I get the error 
Error during XSLT transformation: XSLT Stylesheet (possibly) contains a recursion. I don't see why it would be interpreted as a infinit loop since the text keeps getting smaller.


      ____________________________________________________________________________________
Be a better pen pal. 
Text or chat with friends inside Yahoo! Mail. See how.  http://overview.mail.yahoo.com/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent