for-each in XSLT
pavan4sJan 19 2010 — edited Jan 28 2010Hi,
I am using SOA, JDev 10.1.3.4
In XSLT I have a for-each
Source side I have a variable which is an O/P variable of DB adapter.
Target side I have an empVar which contains EMPID,EName,CustomVar,Sal.
So the requirement is.. if same employe appears 3 times we need to display only one time and we have to add three CustomVar.
I mean from DB if we get the below data for employe 1001
1001,XYZ,10,10000
1001,XYZ,20,10000
1001,XYZ,30,10000
then the target variable should contain data as below
1001,XYZ,*60* ,10000
The target variable should not contain 1001 three times. But bcoz i am using for-each i am getting 1001 three times
How can we achieve this in XSLT.
And in XSLT the variables are acting as constants...they are not getting updated. so how can i add all the CustomVar.
I have defined a variable in for-each and i assigned CustomVar to it.
For all three times it is holding the first value only.
Please help me regarding this.
Regards
PavanKumar.M