|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: reccursive sum ?
Thanks Andrew for this example. Someone on a Forum send me something in this way : <xsl:template match="LISTE-ME"> <xsl:for-each select="ME"> ME <xsl:value-of select="@id"/> : <xsl:call-template name="NbreDevoirsME"> <xsl:with-param name="MEid" select="."/> </xsl:call-template> devoirs <br/> <xsl:call-template name="total"> <xsl:with-param name="TheNodes" select="ME"/> </xsl:call-template> <xsl:for-each/> </xsl:template> <xsl:template name="total"> <xsl:param name="TheNodes"/> <xsl:choose> <xsl:when test="not($TheNodes)"> <xsl:value-of select="0"/> </xsl:when> <xsl:otherwise> <xsl:variable name="FallowingsNodesSum"> <xsl:call-template name="total"> <xsl:with-param name="TheNodes" select="$TheNodes[position()!=1]"/> </xsl:call-template> </xsl:variable> <xsl:variable name="nbDevoirs"> <xsl:call-template name="NbreDevoirsME"> <xsl:with-param name="MEid" select="$noeuds[1]"/> </xsl:call-template> </xsl:variable> <xsl:value-of select="$FallowingsNodesSum+$nbDevoirs"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="NbreDevoirsME"> <xsl:param name="MEid"/> <xsl:variable name="MEfile"> <xsl:value-of select="$MEid">.xml </xsl:variable> <xsl:value-of select="count(document($MEfile)/ME/FOURN/DEVOIR"/> </xsl:template> Thanks philemon_siclone on http://www.developpez.net/forums/viewforum.php?f=25 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








