Jump to content

Summation Of Different Node Attribute Values


Guest S J Arvind

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...