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

Help with a Transform

Subject: Help with a Transform
From: Brandon Schenz <brandons@xxxxxxxxxxxxxxxxx>
Date: Thu, 02 Sep 2004 16:12:56 -0400
currency transform
This is a piece of an XML file I'm working on:
<?xml version="1.0" encoding="utf-8"?>
<Orders>
   <OrderReport>
       <Item>
           <ItemPrice>
               <Component>
                   <Type>Principal</Type>
                   <Amount currency="USD">179.85</Amount>
               </Component>
               <Component>
                   <Type>Shipping</Type>
                   <Amount currency="USD">21.95</Amount>
               </Component>
               <Component>
                   <Type>Tax</Type>
                   <Amount currency="USD">0.00</Amount>
               </Component>
               <Component>
                   <Type>ShippingTax</Type>
                   <Amount currency="USD">0.00</Amount>
               </Component>
           </ItemPrice>
       </Item>
   </OrderReport>
   <OrderReport>
       <Item>
           <ItemPrice>
               <Component>
                   <Type>Principal</Type>
                   <Amount currency="USD">7.99</Amount>
               </Component>
               <Component>
                   <Type>Shipping</Type>
                   <Amount currency="USD">2.32</Amount>
               </Component>
               <Component>
                   <Type>Tax</Type>
                   <Amount currency="USD">0.00</Amount>
               </Component>
               <Component>
                   <Type>ShippingTax</Type>
                   <Amount currency="USD">0.00</Amount>
               </Component>
           </ItemPrice>
           <Promotion>
               <Component>
                   <Type>Shipping</Type>
                   <Amount currency="USD">-2.32</Amount>
               </Component>
           </Promotion>
       </Item>
       <Item>
           <ItemPrice>
               <Component>
                   <Type>Principal</Type>
                   <Amount currency="USD">67.95</Amount>
               </Component>
               <Component>
                   <Type>Shipping</Type>
                   <Amount currency="USD">2.31</Amount>
               </Component>
               <Component>
                   <Type>Tax</Type>
                   <Amount currency="USD">0.00</Amount>
               </Component>
               <Component>
                   <Type>ShippingTax</Type>
                   <Amount currency="USD">0.00</Amount>
               </Component>
           </ItemPrice>
           <Promotion>
               <Component>
                   <Type>Shipping</Type>
                   <Amount currency="USD">-2.31</Amount>
               </Component>
           </Promotion>
       </Item>
       <Item>
           <ItemPrice>
               <Component>
                   <Type>Principal</Type>
                   <Amount currency="USD">24.95</Amount>
               </Component>
               <Component>
                   <Type>Shipping</Type>
                   <Amount currency="USD">2.32</Amount>
               </Component>
               <Component>
                   <Type>Tax</Type>
                   <Amount currency="USD">0.00</Amount>
               </Component>
               <Component>
                   <Type>ShippingTax</Type>
                   <Amount currency="USD">0.00</Amount>
               </Component>
           </ItemPrice>
           <Promotion>
               <Component>
                   <Type>Shipping</Type>
                   <Amount currency="USD">-2.32</Amount>
               </Component>
           </Promotion>
       </Item>
   </OrderReport>
</Orders>

I want to get to:
<?xml version="1.0" encoding="utf-8"?>
<Orders>
   <OrderReport>
       <shippingTotal>21.95</shippingTotal>
   </OrderReport>
   <OrderReport>
       <shippingTotal>0.00</shippingTotal>
   </OrderReport>
</Orders>

I'm having problems with the totaling the <Amount>'s where the <Type> =
Shipping.

Right now I'm getting the total of all the Amounts in the document.  Any
suggestions on this would be appreciated.

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.