if invoke apply-template on the order node
then
i think this would work
sum("price")*sum("qty")
prob a better way though


-----Original Message-----
From: Eric Chow [mailto:[EMAIL PROTECTED]
Sent: Monday, March 29, 2004 3:51 AM
To: [EMAIL PROTECTED]
Subject: How can I get the sum() ???


Hello,

How can I get the sum() of two fields ??


<orders>
   <order>
      <item>Book</item>
      <price>29.9</price>
      <qty>3</qty>
   </order>

   <order>
      <item>CD</item>
      <price>10.5</price>
      <qty>5</qty>
   </order>
</orders>

I want to get the subtotal of the above order.xml, which result should be
(29.9*3 + 10.5*5) !!!

I tried sum("/orders/order/price*/orders/order/qty"), but failed !!!


Eric





==========================
If you know what you are doing,
it is not called RESEARCH!
==========================


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to