[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

a table-of-contents for XHTML problem

Subject: a table-of-contents for XHTML problem
From: "Ivan Shmakov" <oneingray@xxxxxxxxx>
Date: Mon, 16 Jun 2008 01:46:27 +0700
 a table-of-contents for XHTML problem
        I wonder, what would be the simplest way to transform a sequence
        of sibling nodes, e. g.:

   <body>
     <h1>Chapter</h1>
     <h2>Section</h2>
     <h3>Subsection</h3>
     <h3>Another subsection</h3>
     <h2>Another section</h2>
   </body>

        into a nested list, like:

   <body>
     <ul>
       <li>Chapter
         <ul>
           <li>Section
             <ul>
               <li>Subsection</li>
               <li>Another subsection</li>
             </ul>
           </li>
           <li>Another section</li>
         </ul>
       </li>
     </ul>
   </body>

        in XSLT 1.0?

        The following conditions are assumed to be true:

        * all the `hN' nodes are the children of a single `body' node;

        * for any consequent elements `hN' and `hM', M <= 1 + N; the
          first child of the `body' node is `h1'; i. e., it's assumed
          that, e. g., the following input could never happen:

   <body>
     <h1>Foo</h1>
     <h3>Bar</h3>
   </body>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.