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

Re: html toc

Subject: Re: html toc
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 23 Feb 2005 13:06:51 -0500
xslt toc
Carsten,

We generally use keys for this -- they enable us to create the necessary associations between headers and the nodes that "belong" to them. The XSLT then uses the key function to retrieve the nodes, grouping them into the new hierarchy as it goes.

Jeni has some discussion of this problem at http://www.biglist.com/lists/xsl-list/archives/200012/msg00175.html. You could check that out (and there's a bunch more elsewhere in the list archives) to see how it's done.

XSLT 2.0 has constructs particularly for grouping, which you should also look at if that's an option.

Cheers,
Wendell

At 12:38 PM 2/23/2005, you wrote:
I don't know how to do this.

<h1>first level</h1>
...
<h2>second</h2>
...
<h3>third<h3>
...
<h3>third o</h3>
...
<h1>first o</h1>

currently this is transformed into a ToC using a table where
i make use of a <xsl:choose> and test for element name
(h1, h2, h3) and insert the appropriate columns to have
indention between the headline levels.

i want to improve the ToC and make it into a menu which
uses the css 'display:none' and javascript to toggleDisplay.
for this, it would be much easier to have a list instead of a
table. would look like this:

<ul>
<li>first level</li>
<li><ul>
<li>second</li>
<li><ul>
<li>third</li>
<li>third o</li>
</ul></li>
</ul></li>
<li>first o</li>
</ul>

my problem is that all the headline elements are part of the
same axis and i don't know how do the transformation without
something like a 'break loop', or 'select all following 'h3' until
the next 'h2' or 'h1'.

any ideas?

Thanks,
Carst
--
Carsten Heinrigs
Ocean-7 Development
Tel: 212 533-8460


======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

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.