XML technologies / DocBook / Generating (X)HTML / Generating linked chunks / Manual control of chunking
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
If some chunks are too short or too long, you can adjust chunking manually. Proceed as follows:
Applying the stylesheet
maketoc.xsl
Apply the stylesheetmaketoc.xslto your DocBook document. This generates an XML file containing DocBook elements, mainlytocentry.
xsltproc --output toc.xml html/maketoc.xsl mydocument.xml Editing the generated file
Edit the generated filetoc.xmland remove alltocentryelements that should be written to the same file as their parent. Conversely, addtocentryelements to create separate files. Part of the filetoc.xmllooks roughly like this:
<?xml version="1.0" encoding="UTF-8"?>
<toc role="chunk-toc">
<tocentry linkend="docbook-xml"><?dbhtml filename="index.html"?>
<tocentry linkend="preface"><?dbhtml filename="pr01.html"?>
<tocentry linkend=""><?dbhtml filename="pr01s02.html"?></tocentry>
...
</toc>To change filenames, edit only the processing instructions. Keep the attribute
linkendunchanged.
Processing your document with
chunktoc.xsl
Process your document with the stylesheetchunktoc.xsland also set the parameterchunk.tocto the filename from step 1 above:
xsltproc --stringparam chunk.toc toc.xml \
html/chunktoc.xsl mydocument.xmlThis command splits the document
mydocument.xmlaccording to your settings intoc.xml.
Each element needs an anchor to be written to a separate chunk. Otherwise, it is written to the same file as its parent (see the third tocentry element in step 2 above).
Copyright © 2009 Millin Verlag
You may print the online version for your private use.
Otherwise, this chapter from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" is subject to the same provisions as the printed edition: the work, including all its parts, is protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Millin Verlag, Siebengebirgsring 36, 53797 Lohmar, info(at)millin.de
back to top