[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Accumulating Sum

Subject: Accumulating Sum
From: "KUMAR NINGASHETTY" <kningashetty@xxxxxxxxxxxxxxxx>
Date: Tue, 02 Apr 2002 14:15:52 -0500
accumulating sum
HI, 

Sample XML
―----------------------

<data>
<company>
 	<vehicle id="768">
		<region id="204">
			<region_name><![CDATA[Region 4]]></region_name>
		</region>
		<company_name><![CDATA[ABC Inc.]]></company_name>
		<status><![CDATA[t]]></status>
	</vehicle>
	<vehicle id="232">
		<region id="204">
			<region_name><![CDATA[Region 4]]></region_name>
		</region>
		<company_name><![CDATA[BBC Inc.]]></company_name>
		<status><![CDATA[f]]></status>
	</vehicle>
</company>

<review>
	<vehicle idref="768">
		<count type="N"><![CDATA[1]]></review_count>
		<count type="U"><![CDATA[2]]></review_count>
		<count type="Y"><![CDATA[3]]></review_count>
	</vehicle>
	<vehicle idref="232">
		<count type="N"><![CDATA[4]]></count>
		<count type="U"><![CDATA[5]]></count>
		<count type="Y"><![CDATA[6]]></count>
	</vehicle>
</review>
</data>

―-----------------------------------------

HTML O/P should look lilke follows after applying XSL
―-----------------------------------------------------------------------------------
 
Region 4

       Comp        stat	  typN    Total
        -----	-        -----	  ----        -----
      ABCInc        t	   1	5 
      BBCInc        f	   4	5	

Problem :  I could populate first 3 columns..To populate the 4th column 'Total' which is sum frm each row of column 'typeN'
	

Detailed Explanation in case :
I have put together a sample XML above and the html output it should look like ...
I have used xsl:key and have grouped by regions to get the first 4 columns data  and it works fine .. I have problem getting the 4 th column which is Total which  is total from all the rows under column typeN.....This is huge XML data and i have just put together to rows of XML data onto html .  My problem is to get the Total  and printing it on the Total column.  I have tough  time accumulating the average sum inspite if using recursive methods...Let me know if anyone has any ways...

Thanx in advance ...

- kumar





 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.