You want to convert an assembly
structure and its associated
modular files into a single DocBook 5 file.
You need the following prerequisites:
An assembly file. This starts with
the assembly
root element from DocBook 5.1.
The assembly file contains references to all of your modules
which composes your realized DocBook document. Or in other
words: the assembly file maps the modules to structure.
The assembly/assemble.xsl
stylesheet
from the DocBook XSL distribution. Get the latest version as
it is added in 2012.
Your module files based on DocBook 5.
Use xsltproc to create a single
DocBook 5 (the variable DB
contains the path
of your DocBook XSL directory):
xsltproc \
$DB/assembly/assemble.xsl \
assembly.xml
The assemble.xsl
stylesheet contains
several parameters to influence the assembling process:
Parameter | Description |
---|---|
root.default.renderas | Sets the name of the root element of the assembled
document, if not specified with renderas attribute |
structure.id | Selects one structure element from
several; similar to the rootid
parameter for the XHTML stylesheets |
topic.default.renderas | Sets the name of the output element of any topic
elements if not specified with renderas attribute |
output.format | Selects which of the possible output formats are
being generated. The value of this parameter should match
on a format attribute on
output elements. |
output.type | Selects which structure element to process; the value
should match with the type
attribute on a structure element |
The following subsections shows some specific examples to influence the assembling process.
For example, your assembly file looks like this:
<assembly version="5.1" xmlns="http://docbook.org/ns/docbook"> <resources> ... </resources> <structure xml:id="quickstart"> ... </structure> <structure xml:id="reference"> ... </structure> </assembly>
As you can see, you have two structure
elements,
one for a quick start, another for a reference. To process only
the reference, set the parameter
structure.id
to the xml:id
of the reference as
follows:
xsltproc \
--stringparam structure.id reference \
$DB/assembly/assemble.xsl \
assembly.xml
If you omit the structure.id
parameter, the assemble.xsl
stlyesheet
selects always the first structure
element.
For example, your assembly file looks like this:
<assembly version="5.1" xmlns="http://docbook.org/ns/docbook"> <resources> ... </resources> <structure type="help.system"> ... </structure> <structure type="startup"> ... </structure> </assembly>
As you can see, there are two structure
elements,
one for a help system, another for a startup. To process only
the startup, set the parameter
output.type
as follows:
xsltproc \
--stringparam output.type startup \
$DB/assembly/assemble.xsl \
assembly.xml
Project@GitHub | Issue#8 |