Jump to content

Summation Of Different Node Attribute Values


Guest S J Arvind
 Share

Recommended Posts

Guest S J Arvind

Hi,I am new to XML and XSL. I need to display a xml using a XSL. In that XSL i need to sum the different node attribute values. Can anyone help me on this?Here is my XML,<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="inv.xsl"?><Customer id="1" name="" type="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="cust.xsd"> <Invoice Invno="Inv 001"> <Rule rulename="R1" Level="Default"><!-- This <subid>, <Transaction>, <Txn_type> are dynamic. it may come any number of times--> <subid value="subid1"> <Transaction value="type1"> <Txn_type type="online" quantity="1000" rate="0.10" /> </Transaction> <Transaction value="type1"> <Txn_type type="online" quantity="1000" rate="0.10" /> </Transaction> </subid> <subid value="subid2"> <Transaction value="type1"> <Txn_type type="online" quantity="500" rate="0.10" /> </Transaction> <Transaction value="type1"> <Txn_type type="EDI" quantity="1000" rate="0.10" /> </Transaction> <Transaction value="type1"> <Txn_type type="online" quantity="2000" rate="0.10" /> </Transaction> <Transaction value="type1"> <Txn_type type="EDI" quantity="2000" rate="0.10" /> </Transaction> </subid> </Rule> </Invoice></Customer>I need to create a XSL which will display like,subid1 type1 online $2000subid2 type1 online $2500 EDI $3000Please help me to create XSL for the above XML.ThanksRegards,S.J.Arvind

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...