I have to make the attribute into single element. Please guide me.
Here my input and requirement.
Input:
<book pagenum="01">
<title pagenum="01">Book title</title>
<chapter pagenum="02">
<chaptertitle pagenum="02">CHAPTER TITLE</chaptertitle>
<section pagenum="03">
<sectiontitle pagenum="03">SECTION TITLE</chaptertitle>
<subsection pagenum="04">
<para pagenum="04">body content</para>
<para pagenum="04">body content</para>
<para pagenum="04">body content</para>
<para pagenum="05">body content</para>
<para pagenum="05">body content</para>
<para pagenum="05">body content</para>
<para pagenum="06">body content</para>
<para pagenum="06">body content</para>
</subsection></section></chapter></book>
output:
<book>
<?docpage num="01"?><pagenum id="p01">01</pagenum>
<booktitle>Book title</booktitle>
<chapter>
<?docpage num="02"?><pagenum id="p02">02</pagenum>
<chaptertitle>CHAPTER TITLE</chaptertitle>
<section>
<?docpage num="03"?><pagenum id="p03">03</pagenum>
<sectiontitle>SECTION TITLE</chaptertitle>
<subsection>
<?docpage num="04"?><pagenum id="p04">04</pagenum>
<para>body content</para>
<para>body content</para>
<para>body content</para>
<?docpage num="05"?><pagenum id="p05">05</pagenum>
<para>body content</para>
<para>body content</para>
<para>body content</para>
<?docpage num="06"?><pagenum id="p06">06</pagenum>
<para>body content</para>
<para>body content</para>
</subsection></section></chapter></book>
How to convert this in XSLT scripts...? please guide me.
Thanks, Micheal