[ https://issues.apache.org/jira/browse/XALANJ-2430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17939293#comment-17939293 ]
Andreas Martens commented on XALANJ-2430: ----------------------------------------- I believe I have fixed this in [https://github.com/apache/xalan-java/pull/192,] if someone could be as kind as to review and merge please? > Circular variable/parameter reference if recursive template is used in global > variable > -------------------------------------------------------------------------------------- > > Key: XALANJ-2430 > URL: https://issues.apache.org/jira/browse/XALANJ-2430 > Project: XalanJ2 > Issue Type: Bug > Components: XSLTC > Affects Versions: 2.7.1 > Environment: Ubuntu 7.10, java-1.5.0-sun-1.5.0.13, Xalan 2.7.1, > Xerces 2.9.0 (from Xalan package) > Reporter: Auke Schrijnen > Priority: Major > > Xalan 2.7.1 won't compile an xslt when a recursive template is used in a > global variable. This works in Xalan 2.7.0! > 2.7.1 throws a TransformerException: Circular variable/parameter reference in > '[variable(countInfo)]'. > Example: > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version='1.0'> > <xsl:template name='countRecursive'> > <xsl:param name='info'/> > <xsl:param name='count' select='"1"'/> > <xsl:choose> > <xsl:when test='$info != "" and number($count) < 4'> > <xsl:call-template name='countRecursive'> > <xsl:with-param name='info' select='substring-after($info, " > ")'/> > <xsl:with-param name='count' select='$count + 1'/> > </xsl:call-template> > </xsl:when> > <xsl:otherwise> > <xsl:value-of select='$count'/> > </xsl:otherwise> > </xsl:choose> > </xsl:template> > <xsl:variable name='countInfo'> > <xsl:variable name='someElement'> > <xsl:value-of select='/root/vars'/> > </xsl:variable> > <xsl:call-template name='countRecursive'> > <xsl:with-param name='info' select='$someElement'/> > </xsl:call-template> > </xsl:variable> > <xsl:template match='/'> > <xsl:element name='count'> > <xsl:value-of select='$countInfo'/> > </xsl:element> > </xsl:template> > </xsl:stylesheet> -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org For additional commands, e-mail: dev-h...@xalan.apache.org