Question

Given a Docbook-based XML file, how do I extract just the table of contents (TOC) into its own HTML file - preferably without resorting to writing my own XSLT template? I am using xsltproc.

I'm convinced that this must be obviously easy, but for some reason the solution escapes me - after having looked through the DocBook documentation.

As a bonus, I would like the generated toc.html file not to have any html/head/body...body/html wrappers in order to make it simple to embed it within a CMS-powered site.

Any help is appreciated. Thanks.

P.S. My DocBook-content is derived from AsciiDoc, though that should make no difference.

Was it helpful?

Solution

Assuming that you are using the SourceForge DocBook stylesheets, you can use chunking with the chunk.tocs.and.lots parameter. This generates a separate TOC file (and the other chunked HTML files as well).

Some options relevant to the bonus question are discussed in this thread: http://www.mail-archive.com/docbook-apps@lists.oasis-open.org/msg09111.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top