Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] Help with a Transform

From: Brandon Schenz <brandons@----------------->
To:
Date: 9/2/2004 8:12:00 PM
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.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent