Home Forums General XMetaL Discussion Getting started w/ Author Enterprise 6.0.1 and DocBook Reply To: Getting started w/ Author Enterprise 6.0.1 and DocBook

Derek Read

Reply to: Getting started w/ Author Enterprise 6.0.1 and DocBook

Note that if anything below sounds like it is beyond the capabilities of your company (“customizing the product”) we have various partners and our own Professional Services team that can be contracted.

DocBook Sample Customization:
There is a sample customization for DocBook 5 included with XMetaL Author Enterprise and XMetaL Author Essential, however, this does not provide transformation support, this sample would need to be extended to provide that feature. This sample is provided in part to demonstrate some features that a developer might use in their own customization of DocBook or in other schemas.

You may have seen this DocBook sample customization listed in Help > Samples (two sample documents are provided there, both end with “(DocBook)”.

The DocBook sample customization (everything that makes the sample work, including the DTDs) is here: AuthorRulesDocBook

Transformation (PDF / HTML):
This sample could be extended to support output to PDF using Apache FOP (which we bundle) and as demonstrated in the Journalist sample. If you have XMetaL Author Enterprise (not Essential) you might choose instead to use the bundled copy of RenderX instead of FOP (there is no documentation on that but our Professional Service team could probably do something).

The same demo shows one way to transform to HTML. This concept might be extended to run any kind of XSLT or other 3rd party tool to produce any kind of output. Since you plan to work with DocBook it might be preferable to integrate the “DocBook XSL stylesheets” into this process: http://sourceforge.net/projects/docbook/ Note that programming (writing scripts) will be required.

We don't have any tutorials on doing that, but having a look at the “Journalist” demo's support for PDF and HTML output would give you an idea of what is possible. Note that the Journalist sample DTD was created long ago (the same time as the original DocBook DTD was being created) and is based on it but with some significant differences that make them incompatible (the most obvious being the element name camel casing). To see a PDF or HTML file produced from a Journalist document do this:

1. Open a sample: Help > Samples > Cameras in Focus (Journalist)
2. Right click anywhere on the toolbar area in XMetaL and enable the “Journalist” toolbar.
3. Select the “Save as PDF” or “Save as HTML” button and specify a place to save to.

To view the code that drives this feature see the following files:
(search for “saveAsPDF”, “saveAsHTML”, “previewHTML” or “previewPDF”)

The following file defines most of the functionality:

This functionality could be extended to produce other types of output based on the same principles for producing HTML by replacing theĀ  XSLT used to produce HTML with something else (such as portions of the DocBook XSL stylesheets).

Our *.mcr files (which contain scripts to extend XMetaL functionality) are plain text files viewable in any text editor.

DocBook -> CHM:
There is a stylesheet driver file for generating HTML Help (CHM) as well as a short tutorial included with the “DocBook XSL stylesheets” at SourceForge (see link above).