Row Data in xsl 1.0

BamBam

New Member
I have multiple Rows data in my XML like this -\[code\]<ROW TYPE="SPECIFICATION" ID="1"> <R1>English1</R1></ROW><ROW TYPE="SPECIFICATION" ID="1"> <R1>Maths1</R1></ROW><ROW TYPE="TOTAL" ID="1"> <R1>Code1</R1></ROW><ROW TYPE="SPECIFICATION" ID="2"> <R1>English2</R1></ROW><ROW TYPE="SPECIFICATION" ID="2"> <R1>Maths2</R1></ROW><ROW TYPE="TOTAL" ID="2"> <R1>Code2</R1></ROW><ROW TYPE="MAIN" ID="3"> <R1>Code3</R1></ROW><ROW TYPE="SPECIFICATION" ID="4"> <R1>English4</R1></ROW><ROW TYPE="TOTAL" ID="4"> <R1>Code4</R1></ROW>\[/code\]I want my Output to be displayed in Image like that this ROW data works in a for-each loop. And the requirement is that ROW TYPE="TOTAL" ID="1" should be displayed first then its ROW TYPE="SPECIFICATION" data. Moving further in loop again, ROW TYPE="TOTAL" ID="2" should be displayed first then its ROW TYPE="SPECIFICATION" data. IF ROW_TYPE is different(can be anything) then it should come as in sequence. It is only specific for SPECIFICATION and TOTAL.Basically it should come like this -\[code\]Code1 English1 Maths1Code2 English2 Maths2Code3Code4 English4\[/code\]The xslt code works for sequence as for-each loop works. But I need to shift the TOTAL row first for that ID. Please suggest logic for this.
 
Back
Top