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

Re: xml to xml transformation

Subject: Re: xml to xml transformation
From: "karan bhasin" <jusky@xxxxxxxxxxxxx>
Date: Fri, 16 May 2003 02:04:59 +0530
karan bhasin
 <Log>
<Entity>
  <EntityName>Michigan</EntityName>
  <Batch>
   <TotalAmount>10</TotalAmount>
  </Batch>
  <Batch>
   <TotalAmount>20</TotalAmount>
  </Batch>
  <Entity>
   <EntityName>Detroit</EntityName>
   <Batch>
    <TotalAmount>30</TotalAmount>
   </Batch>
   <Batch>
    <TotalAmount>40</TotalAmount>
   </Batch>
  </Entity>
  <Entity>
   <EntityName>Kalamazoo</EntityName>
   <Batch>
    <TotalAmount>50</TotalAmount>
   </Batch>
   <Batch>
    <TotalAmount>60</TotalAmount>
   </Batch>
  </Entity>
 </Entity>
</Loop>

I have a XML which has the structure as follows:
Each Entity Element contains 'EntityName' Element, and one or more Batch Elements. Further it may contain several other Entity Elements.
My problem is that I want to Sum the total of all the Batches belonging to each Entity(including its Sub-Entities). For Example, Michigan should give me a result of (10+20+30+40+50+60), Detroit should give a sum of (3=+40). The XML is being generated dynamically, so i dont know how many Entity elements each Entity may contain, and i want to find the sum for all the Batches(Batches/TotalAmount), including those in the Entitiey elements any deep. Any ideas how chould I go about it. In a programming world, this would be achieved through recursive functions. How Would I do this in XSLt.
Thanks in advance.
Jaskaran


____________________________________________________________
Get 25MB of email storage with Lycos Mail Plus!
Sign up today -- http://www.mail.lycos.com/brandPage.shtml?pageId=plus 

 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.