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

Creating a Table of Contents from an HTML file being

Subject: Creating a Table of Contents from an HTML file being transformed using XSL to FO
From: "Kenneth Aitken" <kenneth_aitken@xxxxxxxxxx>
Date: Wed, 29 Sep 2004 09:43:07 +0200
creating a table of contents
Has anyone successfully created a Table of Contents (TOC) using XSLT to
transform HTML files to FO files (and, ultimately, to PDF, e.g. with XEP),
with the HTML structure:
<h1>Chapter 1</h1>
<h2>Section 1</h2>
<h3>Paragraph 1</h3>
<p>...........</p>
<h3>Paragraph 2</h3>
<p>...........</p>
<h3>Paragraph 3</h3>
<p>...........</p>
<h2>Section 2</h2>
<h3>Paragraph 1</h3>
<p>...........</p>
<h3>Paragraph 2</h3>
<h2>Section 3</h2>
<p>...........</p>
<h2>Section 4</h2>
<p>...........</p>

<h1>Chapter 2</h1>
<h2>Section 1</h2>
<h3>Paragraph 1</h3>
<p>...........</p>
<h3>Paragraph 2</h3>
<p>...........</p>
<h3>Paragraph 3</h3>
<p>...........</p>
<h2>Section 2</h2>
<h3>Paragraph 1</h3>
<p>...........</p>
<h3>Paragraph 2</h3>
<h2>Section 3</h2>
...........
<h2>Section 4</h2>
..........
<h1>Chapter 3</h1>
...........

This should generate a TOC structure in PDF via XSL-FO as follows:
Chapter 1..................................1
Section 1..................................1
Paragraph 1
Paragraph 2
Paragraph 3
Section 2..................................3
Paragraph 1
Paragraph 2
Section 3..................................5
Section 4..................................5
Chapter 2..................................7
Section 1..................................7
Paragraph 1
Paragraph 2
Paragraph 3
Section 2..................................9
Paragraph 1
Paragraph 2
Section 3..................................11
..........
Section 4..................................12
.........
Chapter 3..................................14
We have already tried using <div class="first">...</div> to create a nested
structure in HTML, and this succeeded in creating a TOC with 2 levels (i.e.
h1, h2), but we need help with three levels (i.e. also with h3).Can anyone
give us an example with some XSLT code?

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.