A Little update in my previous question already @Dimetre answered that
Input XML
<tutorial>
<lessons>
<lesson>
chapter Bat 20
</lesson>
<lesson>
chapter Pen Ball 10~
</lesson>
<lesson>
chapter Book
</lesson>
<lesson>
note lesson
</lesson>
<lessons1>
<lesson>
chapter Pencil 10
</lesson>
<lesson>
description page
</lesson>
<lesson>
chapter Car Tank 25
</lesson>
</lessons1>
</lessons>
The Output will be
<Geography>
<historical>
<social>
<toc1>
<toc>
<chapter>chapter</chapter>
<unit>Bat</unit>
<pages>20</pages>
</toc>
<toc>
<chapter>chapter</chapter>
<unit>Pen Ball</unit>
<pages>10</pages>
</toc>
<toc>
<chapter>chapter</chapter>
<unit>Book</unit>
<pages>10</pages>
</toc>
<sample>
<original>note lesson</original>
</sample>
</toc1>
<toc2>
<toc>
<chapter>chapter</chapter>
<unit>Pencil</unit>
<pages>10</pages>
</toc>
<sample>
<original>description page</original>
</sample>
<toc>
<chapter>chapter</chapter>
<unit>Car Tank</unit>
<pages>25</pages>
</toc>
</toc2>
</social>
Here in input XML I have for sample i have written two Lessons (lesson, Lesson1) actually but actually it my have n number of lessons. I think I am asking more but i am learning simultaneously.
Please help me & Guide me
Thanks in advance
Regards
Karthic
This transformation:
when applied on the provided XML document (corrected not to have
lessons1nested inlessons):produces the wanted, correct result: