|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] xsl numeric calculations-NP
Dear Friends, I am trying to achoeve simple calcuateion from xsl. I do not know the way out of this. Please help. Here is the code. XML: ====== <Shopping> <fruits> <apple quantity="10" unit_price="1"></apple> <orange quantity="20" unit_price="5"></orange> <banana quantity="30" unit_price="5"></banana> <grapes quantity="40" unit_price="5"></grapes> </fruits> <vegs> <onion quantity="10" unit_price="5"></onion> <carrot quantity="5" unit_price="10"></carrot> <chiili quantity="20" unit_price="5"></chilli> <tomato quantity="10" unit_price="5"></tomato> <potato quantity="20" unit_price="5"></potato> </vegs> </shopping> XSL: ====== //suggest xsl template here, because I tried using sum() and numbers and so on but could not work the way around it. I could do individual multiplication using <xsl:for-each select="//fruits/*">. but did not achieve results.SO I BEG TO THE COMMUNITY, PLEASE HELP ME NOW.
Basically, I want to multiply "quantity" and "unit_price" first then add the multiplication-result.May be using javascript or xsl built in functions, please suggest. Thanks very much in advance. Nilesh Patel _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








