[xep-support] Creating a Table of Contents from an HTML file being transformed using XSL to FO

Kenneth Aitken kenneth_aitken at freenet.de
Wed Sep 29 00:51:54 PDT 2004


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?



-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo at renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html



More information about the Xep-support mailing list