Customization
Prev |  | Next

## Customization

### XSLT Parameters

`<xsl:param name="anchor-id-prefix" select="''/>`

  Prefixed to every id generated from `<a name=>` and `<a href="#">`. This is useful to avoid collisions between multiple documents that are compiled into the same book. For instance, if a number of XHTML sources are assembled into chapters of a book, you style each source file with a prefix of ``docid`.` where `docid` is a unique id for each source file.

`<xsl:param name="document-root" select="'article'"/>`

  The default document root. This can be overridden by `<?html2db class="`name`">` within the document itself, and defaults to `article`.

### Processing instructions

Use the `<?html2db?>` processing instruction to customize the transformation of the XHTML source to Docbook:

Processing instruction | Content | Effect
--- | --- | ---
`<?html2db class="`xxx`"?>` | `body` | Sets the output document root to `xxx`. Useful for translating to `prefix`, `appendix`, or `chapter`; the default is `$document-root`.
`<?html2db class="simplelist"?>` | `ul` | Creates a vertical `simplelist`.[a]
`<?html2db rowsep="1"?>` | `[informal]table` | Sets the `rowsep` attribute on the generated `table`.[b]
[a] Note that the current implementation simply checks for the presence of any `html2db` processing instruction. [b] Note that the current implementation simply checks for the presence of any `html2db` processing instruction that begins with `rowsep`, and assumes the vlaue is `1`.

### Overriding the built-in templates

For cases where the previous techniques don't allow for enough customization, you can override the builtin templates. You will need to know XSLT in order to do this, and you will need to write a new stylesheet that uses the `xsl:import` element to import `html2db.xsl`.

The `example.xsl` stylesheet is an example customization layer. It recognizes the `<div class="abstract">` and `<p class="note">` classes in the source for this document, and generates the corresponding Docbook elements.

Prev | Up | Next
Specification | Home | FAQ