0

I need to map an incremental variable in XSLT to a target column. Below is the pseudo code am expecting to be done in XSLT.

varcounter = 0

for each outer loop

print varcounter

 varcounter = varcounter +1

for each inner loop

print varcounter

varcounter = varcounter +1

end for each inner loop

end for each outer loop.

Incrementing is not supported in SOA XSLT. I cant use position() as well as the variable needs to be persisted between outer and inner for loops.

Please suggest how can implement using a template or any other ways.

SantoshJ
  • 1
  • 1
  • 1
    Your pseudo code is pretty much useless in a functional language such as XSLT. Why don't you post a small example of XML input and explain what do you want to get as the output? – michael.hor257k Oct 24 '16 at 21:21
  • Ok. let me explain my requirement. I have list of employees in xml with data elements as 1. Emp_ID 2. Department_Id, 3. Sub_dep_id – SantoshJ Oct 25 '16 at 02:07
  • Now i Need to map to the target document by grouping first with department and then sub_department along with its employess. Along with each entity a unique sequence needs to be generated just beside to it. Department_Id1, 1 Sub_Dept1,2 Emp_Id1, 3 Emp_Id2, 4 Sub_Dept2,5 Emp_Id3,6 Emp_Id4,7 Department_Id2,8 Sub Dept3, 9 Emp_Id5,10 – SantoshJ Oct 25 '16 at 02:20
  • This is difficult to follow. Please edit your question and post your XML input (as code) and the expected output (also as code). – michael.hor257k Oct 25 '16 at 06:06

0 Answers0