Hi need some help in XSLT formatting for creating a sequence number for Element tag. Mostly Element tag misses some numbers in sequence and i need to get an output in a sequential format as shown below by adding missing numbers to Element tag in the same sequence of Seat tag.
Any help in this is much appreciated, thanks in advance.
Input
<book>
<Seat>
<seatNumber>12A</seatNumber>
<Element>1</Element>
<Number>1</Number>
</Seat>
<Seat>
<seatNumber>12B</seatNumber>
<Element>3</Element>
<Number>1</Number>
</Seat>
<Seat>
<seatNumber>12C</seatNumber>
<Element>4</Element>
<Number>1</Number>
</Seat>
<Seat>
<seatNumber>12D</seatNumber>
<Element>5</Element>
<Number>1</Number>
</Seat>
<Seat>
<seatNumber>12E</seatNumber>
<Element>7</Element>
<Number>1</Number>
</Seat>
</book>
Output
<book>
<Seat>
<seatNumber>12A</seatNumber>
<Element>1</Element>
<Number>1</Number>
</Seat>
<Seat>
<seatNumber>12B</seatNumber>
<Element>2</Element>
<Number>1</Number>
</Seat>
<Seat>
<seatNumber>12C</seatNumber>
<Element>3</Element>
<Number>1</Number>
</Seat>
<Seat>
<seatNumber>12D</seatNumber>
<Element>4</Element>
<Number>1</Number>
</Seat>
<Seat>
<seatNumber>12E</seatNumber>
<Element>5</Element>
<Number>1</Number>
</Seat>
</book>
Try it this way:
XSLT 1.0