473,387 Members | 1,585 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Adding variables and storing in an array using xslt

Hi Friends,
I am unable to add variables and store it in an array.

The Question is:

let us take an example:
Here we have a senerio like this
Loop on InvoiceLineItem/Tax

Extract values:
taxamt=//taxamount
taxtypecd=//taxtypecode
taxlocation=//taxlocation
taxrate=//taxrate
construct an tax_key = taxamt+taxtypecode+taxlocation+taxrate

form refarray[] for holding taxkeys

sort the refarray and loop on it
obtain taxcd from first taxcd and also extract taxamt,taxlocation
During loop sum up all the tax amounts of same taxtypecd and map totaltax amount for every unique taxcode and also for other tax elements extracted above to the tax[0]
This is the requirment
<xsl:for-each select="NonExempt">
<xsl:variablename="taxAmt"select="TaxAmount/MonetaryAmount/MonetaryValue"/>
<xsl:variable name="taxTypeCd" select="TaxTypeCode"/>
<xsl:variable name="taxlocation" select="$PLeft1"/>

<xsl:variable name="taxrate" select="TaxRate"/>
<xsl:variable name="taxcurrency" select="TaxAmount/MonetaryAmount/CurrencyCode"/>

<xsl:variable name="tax_key">
Inside taxkey I need to add all variable and store in it from here i have unable to proceed further

Kindly help me.
.
Jul 13 '07 #1
1 6342
jkmyoung
2,057 Expert 2GB
Might be something like:
<xsl:value-of select="concat($taxAmt, '-', $taxTypeCD, '-', $taxlocation, '-', $taxRate, '-', $taxcurrency"/>

However, then you would simply have the result in a variable as opposed to output. Not sure how you want your array to be formatted.
Jul 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Federico | last post by:
Hi all, I don't know if this topic is perhaps a little bit off-topic, anyway I have a strange problem in transforming an XML file in an HTML file using XSLT form a Java program written with...
4
by: titanandrews | last post by:
Hi, I have ran into a situation that I think should be possible, but I am fairly new to XSLT so maybe not. Suppose I have the following document <ROOT> <FOO name="A"> <CHILD name="B"/>...
2
by: Allan Bredahl | last post by:
Hi All I'm trying hard to find out how to transform XML to HTML using XSLT files. I have searched all over for some examples on how to do this, but I have had no succes with any of them. ...
5
by: Fred | last post by:
Not much expertise on XSLT and trying to understand it's uses when creating apps in VS.NET? If I wanted flexibility on the UI (View aspect of M.V.C.): - How does it compare with creating...
22
by: guitarromantic | last post by:
Hey everyone, I run a site with staff-submitted reviews, and most of them are written by one author. However, we also do "multiple" reviews. Up until now I just had a userid for a 'Multiple'...
3
by: WideBoy | last post by:
Hi, I have a software generated schema which creates a few empty elements, e.g. <xsd:sequence/>. I would like to be able to delete these elements from the schema post-generation using XSLT. ...
6
by: kluge.wolfram | last post by:
Hi, i get stucked on a transformation problem using XSLT. What i need is to copy an XML Tree to an output XML without any automatic changes. Since i used <xsl:copyor <xsl:copy-ofthere occur...
1
by: saritha2008 | last post by:
Hi, I have to convert the following Input xml code to output xml code using xslt. Can any one please help on escaping single quotation present in the input xml file in my xslt? ...
0
by: Prashant M | last post by:
Hi All, I had created a XSLT which converts the XML file generated from the system to the excel format. The XSLT has the styles required for this transformation. Now i am told to insert image...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.