With the previous post.
here is the link
Again Small Update in input xml the other validation are all same. Here only the chapter (element) is changing instead of chapter i will have numbers
<tutorial>
<lessons>
<lesson>
12000 Bat 20
</lesson>
<lesson>
15000 Pen Ball 10~
</lesson>
<lesson>
14000 Book
</lesson>
<lesson>
note lesson
</lesson>
</lessons>
<lessons1>
<lesson>
24000 Pencil 10
</lesson>
<lesson>
description page
</lesson>
<lesson>
8000 Car Tank 25
</lesson>
</lessons1>
In the previous question we have Chapter was the first node (chapter Bat 20) but here I have 12000 bat 20
Desire output for the above input is
<Geography>
<historical>
<social>
<toc1>
<toc>
<chapter>12000</chapter>
<unit>Bat</unit>
<pages>20</pages>
</toc>
<toc>
<chapter>15000</chapter>
<unit>Pen Ball</unit>
<pages>10</pages>
</toc>
<toc>
<chapter>14000</chapter>
<unit>Book</unit>
<pages>10</pages>
</toc>
<toc>
<sample>
<original>note lesson</original>
</sample>
</toc>
</toc1>
<toc2>
<toc>
<chapter>24000</chapter>
<unit>Pencil</unit>
<pages>10</pages>
</toc>
<toc>
<sample>
<original>description page</original>
</sample>
</toc>
<toc>
<chapter>8000</chapter>
<unit>Car Tank</unit>
<pages>25</pages>
</toc>
</toc2>
</social>
@Dimitre & @Tomalak From next time i will write fully prepared question and definitely i will post it with the solution what i have, now i am started learning little faster(XSLT) with this below output and previous output.
Please guide me here
Thanks in advance
Karthic
This transformation:
when applied on the provided XML document:
produces the wanted, correct result: