XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
martin kingSubject: xsl recursion question
Author: martin king
Date: 11 Jan 2007 08:31 AM
I'm pretty new to XSL and have a question regarding xsl recursion.....

12 months of the year, each containing a value...
jan 100
feb 125
march 100, etc, etc

I need to workout the yearly figure by adding each montly value..
100 + 125 + 100, etc
It looks like this can be done inside of a tempale using recursion -

<xsl:with-param name="total" select "$total+1">

but does this need to be within a for-each statement?
Has anyone got any examples of how this achieved - i'm playing but not making any progress!!

Thanks in advance,

Kingy

Posttop
James DurningSubject: xsl recursion question
Author: James Durning
Date: 11 Jan 2007 10:59 AM
do you have a short sample of your xml?
This could probably be done using the sum(xpath) function.

http://www.w3schools.com/xpath/xpath_functions.asp#sequence

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.