[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Flat DB structure into XML Hierarchy
Hi there, pretty new to XSLT and wondered if anyone could point me in the right direction. I'm trying to take a flat db structure from a query and transform it into a hierarchical xml structure. This is the flat structure from the db: <data> <row> <section_depth>1</section_depth> <section_title>Home</section_title> </row> <row> <section_depth>2</section_depth> <section_title>Events</section_title> </row> <row> <section_depth>3</section_depth> <section_title>Event 1</section_title> </row> <row> <section_depth>3</section_depth> <section_title>Event 2</section_title> </row> <row> <section_depth>2</section_depth> <section_title>Equipment</section_title> </row> <row> <section_depth>2</section_depth> <section_title>News</section_title> </row> <row> <section_depth>3</section_depth> <section_title>News 1</section_title> </row> <row> <section_depth>3</section_depth> <section_title>News 2</section_title> </row> </data> I'm looking to transform this with XSLT 2, into this using the section_depth as the indentation, can always assume the flat structure will be in the right order: <site> <section> <title>Home</title> <section> <title>Events</title> <section> <title>Event 1</title> </section> <section> <title>Event 2</title> </section> </section> <section> <title>Equipment</title> </section> <section> <title>News</title> <section> <title>News 1</title> </section> <section> <title>News 2</title> </section> </section> </section> I've played around with grouping but my head started to hurt. Thanks in advance for any help! Dave
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|