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

Werner Donné werner.donne at re.be
Wed Sep 29 01:38:13 PDT 2004


Kenneth,

This is what I use. Note that the actual TOC-lines that are generated
are meant for processing with CSSToXSLFO, but you can easily replace it
with whatever you want.

Regards,

Werner.

Kenneth Aitken wrote:
> 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
> 
> 

-- 
Werner Donné  --  Re BVBA
Engelbeekstraat 8
B-3300 Tienen
tel: (+32) 486 425803	e-mail: werner.donne at re.be
-------------- next part --------------
A non-text attachment was scrubbed...
Name: toc.xsl.gz
Type: application/x-tar
Size: 1613 bytes
Desc: not available
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20040929/454934b6/attachment.tar>


More information about the Xep-support mailing list