Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 1st, 2003, 04:02 AM
Registered User
 
Join Date: Sep 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default creating hierarchies

Hi,

I would like to get any advice to get a more detailed element hierarchy out of a very flat one.

E.g. my source xml is something like:
<book>
 <title1>title 1.1</title1>
 <para><para>
 <para>.. <footnote></footnote></para>
 <title2>title 1.1.1</title2>
 <para><para>
 <para>.. <footnote></footnote></para>
 <title2>title 1.1.2</title2>
 <para><para>
 <para>.. <footnote></footnote></para>
 <title1>title 1.2</title1>
 <para><para>
 <para>.. <footnote></footnote></para>
 <title2>title 1.2.1</title2>
 <para><para>
 <para>.. <footnote></footnote></para>
 <title2>title 1.2.2</title2>
 <para><para>
 <para>.. <footnote></footnote></para>
</book>

My desired result should be something like:
<book>
 <chapter1>
  <title>title 1.1</title>
  <para><para>
  <para>.. <footnote></footnote></para>
    <chapter2>
      <title>title 1.1.1</title>
      <para><para>
      <para>.. <footnote></footnote></para>
    </chapter2>
    <chapter2>
      <title>title 1.1.2</title>
      <para><para>
      <para>.. <footnote></footnote></para>
    </chapter2>
   </chapter1>
 <chapter1>
  <title>title 1.2</title>
  <para><para>
  <para>.. <footnote></footnote></para>
    <chapter2>
      <title>title 1.2.1</title>
      <para><para>
      <para>.. <footnote></footnote></para>
    </chapter2>
    <chapter2>
      <title>title 1.2.2</title>
      <para><para>
      <para>.. <footnote></footnote></para>
    </chapter2>
   </chapter1>
</book>

Is there any xslt construction for that purpose?







Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help in creating application SachinMalge ASP.NET 2.0 Professional 0 June 1st, 2007 02:15 PM
Dimension Hierarchies Not Working orangepower SQL Server 2005 1 December 14th, 2006 03:41 PM
creating tooltips? Hannibal Javascript How-To 6 April 27th, 2006 09:20 AM
Creating Files xchemicalbeatz VB.NET 2002/2003 Basics 6 April 14th, 2005 08:24 AM
Hierarchies acko SQL Server 2000 2 July 26th, 2003 09:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.