I'm new to XSL and need to know how to transform some XML structured like this:
Into this:
Essentially I want to make the child elements of the 'page' and 'level' elements into attributes of the child elements of the 'contents' element (so as to generate a table of contents for an online text).
Code:
<table> <contents> <DATA>Section 1</DATA> <DATA>Chapter 1</DATA> <DATA>Part 1</DATA> </contents> <page> <DATA>5</DATA> <DATA>15</DATA> <DATA>24</DATA> </page> <level> <DATA>1</DATA> <DATA>2</DATA> <DATA>3</DATA> </level> </table>
Code:
<toc> <tocentry level="1" page="5">Section 1</tocentry> <tocentry level="2" page="15">Chapter 1</tocentry> <tocentry level="3" page="24">Part 1</tocentry> </toc>
Comment