XML technologies / DocBook / Generating (X)HTML / Generating linked chunks / Setting the output directory
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
By default, the stylesheets write output to the current directory. To write files elsewhere, use:
the parameter
base.dir,the processing instructions
<?dbhtml filename="..."?>and<?dbhtml dir="..."?>directly in the DocBook document,a combination of both.
Set the parameter base.dir to the output directory:
xsltproc --stringparam base.dir /irgendwo/hin/ ... On Linux and MacOS, ensure the directory always ends with a slash, or with a backslash on Windows. Otherwise, the filenames contain the supplied value as a prefix.
The second method uses the processing instruction <?dbhtml?>, allowing a more structured directory layout:
<book>
<?dbhtml dir="docbook"?>
<title>DocBook</title>
...
<chapter id="xml-intro">
<?dbhtml dir="xml"?>
<?dbhtml filename="index.html"?>
...
<chapter id="xslt-intro">
<?dbhtml dir="xsl"?>
...
</book>This code generates the following file structure:
docbook
|
+ index.html
|
+- xml
| |
| +- index.html
|
+- xsl
|
+- ch02.html
All children of the first chapter element go into the directory docbook/xml. If you also use the parameter use.id.as.filename, filenames are based on their ID attributes.
The third method combines the first two, so no further example is needed.
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