16.4. The refdbxml shell script

This is the XSL equivalent of the refdbjade script. Use it to transform your DocBook XML or TEI XML documents to HTML, PDF, or RTF output.

16.4.1. Starting refdbxml

refdbxml [-c fop_config_file] [-f fo_processor] [-h] [-p xslt_processor] [-s stylesheet] [-t format] {file...}

The command-line switches are:

-h

Prints a command synopsis on the screen and exits

-p processor

This determines the XSL processor that is to be used. refdbxsl currently knows to handle Xalan, XT, Saxon, and xsltproc. You can set your favourite processor as the default in the script so you don't have to use this option except when you need a little diversity. Of course you can only select a processor that is actually installed on your system.

-s stylesheet

Select the appropriate stylesheet driver file with this switch. The driver file that you want to use is one of the driver files which were generated by runbib. Use the HTML driver file for HTML output and the FO driver file for all other output. You can also use this script for non-RefDB documents. Use the values ""db"" and "tei" to select the plain DocBook and TEI XSL stylesheets, respectively.

-t format

Select an output format with this option. Possible values are html, rtf, and pdf, to generate HTML, RTF, and PDF output, respectively. The printable output formats depend on JFOR and PassiveTeX, respectively.

16.4.2. Configuring refdbxml

Instead of using the command-line switches, refdbxml can also be configured by means of the refdbxmlrc configuration file. As with all refdb configuration files, you may maintain a global copy in /usr/local/etc/refdb/ and one copy per user in $HOME.

Table 16-1. refdbxmlrc

VariableDefaultComment
xslt_processorxsltprocThe name of the XSLT processor used to transform XML documents to html or fo files. Supported values are xsltproc (default), xalan, xt, saxon, saxon-xerces (using the xerces parser instead of the built-in parser)
xslt_classpath/usr/share/javaSpecify the directory which contains the Java classes for Java-based XSLT processors. This variable is not required if you use a non-Java processor (xsltproc).
fo_processorfopThe name of the FO processor used to transform FO files into printable output. Supported values are fop (default), passivetex, xep, and xfor.
fo_classpath/usr/share/javaSpecify the directory which contains the Java classes for Java-based FO processors. This variable is not required if you use a non-Java processor (passivetex).
fop_config_file(none)The path to a custom configuration file for FOP.
outformathtmlSet the default output format. Supported values are html, xhtml, pdf, and rtf. Be aware that pdf and rtf are not supported by all FO processors.

16.4.3. Resolution of public identifiers

Public identifiers can be resolved to local files if you have a working XML catalog on your system and if your XSLT processor supports XML catalogs. xalan and saxon require additional Java classes to support XML catalogs. For further information, please consult Bob Stayton's book about XSLT.

16.4.4. Examples

Again we'll transform our document (which now is either a DocBook or TEI XML document) to a nice-looking PDF file with the following command:

~$ refdbxml -d J.Biol.Chem.fo.xsl -t pdf mypaper.xml

Note that we used the FO stylesheet for this purpose. If we want HTML output, we need to change the output type switch and use the corresponding HTML stylesheet:

~$ refdbxml -d J.Biol.Chem.html.xsl -t html mypaper.xml