[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: RE: Alternatives to "Stopping" a for-each
Just in case someone else is in the same situation. This became my solution. Thanks for valuable feedback to Michael and Serhiy. <xsl:template name="getRanking"> <xsl:param name="structure"/> <xsl:param name="counter"/> <xsl:param name="winner"/> <xsl:choose> <xsl:when test="$structure/Start[Ranking=$counter]/StartNo = $winner"> <xsl:value-of select="$structure/Start[Ranking=$counter]/StartNo"/> <!--<xsl:text> </xsl:text>--> </xsl:when> <xsl:otherwise> <xsl:value-of select="$structure/Start[Ranking=$counter]/StartNo"/> <xsl:text>-</xsl:text> <xsl:call-template name="getRanking"> <xsl:with-param name="structure" select="$structure"/> <xsl:with-param name="counter" select="$counter + 1"/> <xsl:with-param name="winner" select="$winner"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:template> Called like this: <xsl:for-each select="Legs[@ResultsComplete='true']/Leg"> <xsl:value-of select="LegNo" /> <xsl:text>. avd: </xsl:text> <xsl:call-template name="getRanking"> <xsl:with-param name="structure" select="Starts" /> <xsl:with-param name="counter" select="1" /> <xsl:with-param name="winner" select="Winners/Winner/@StartNo" /> </xsl:call-template> .... </xsl:for-each> Trond
|
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
|