Skip to content

janiveer/PACBook

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PACBook

PACBook is a suite of pre-processing tools for working with XML documentation. It deals with two inter-related areas:

  1. Translating documents;

  2. The linguistic consequences of transclusion and / or conditional processing.

PACBook was originally written for pre-processing DocBook XML files. Parts of it are specific to DocBook 5.0 or later. However, most of it is intended for general use with any XML documentation schema, even SVG images.

Documentation

For information on each stylesheet, see the wiki or the Documentation folder.

Prerequisites

To run PACBook, you need an XSLT processor compatible with XSLT 1.0 or 1.1 and eXSLT. PACBook has been tested with XSLTProc and Saxon 6.5.5.

PACBook is a pre-processor. It doesn’t produce formatted output. You will require third party processing tools to take the XML that PACBook produces and and turn it into something meaningful. For example, you can use the DocBook XSL stylesheets to turn a pre-processed DocBook file into Web help or an ePub file. Or you could use Apache Batik to render a pre-processed SVG file as PNG or JPEG.

The stylesheet DBProfile.xsl relies on the DocBook XSL stylesheets. The stylesheet RefResolve.xsl relies on the Apache Commons XML Catalog resolver.

Finally, to save processing time and bandwidth, you should set up an XML catalog so that your XSLT processor uses local copies of all stylesheets and data files.

DocBook XSL: The Complete Guide by Bob Stayton contains comprehensive instructions for setting up an XSLT processor, the DocBook XSL stylesheets, and XML catalog files.

Installation

Clone the project, or click on Download Zip and unzip it to a directory of your choice.

Running

PACBook is a set of small XSLT stylesheets, each of which does one particular job.

Example 1: create an XLIFF diff file using XSLTProc

xsltproc --stringparam Xliff Current_Translations.de.xliff \
         --stringparam Language de \
         --output Changed_Translations.de.xliff \
         $PACBOOK/xsl/XlateDiff.xsl \
         My_File.docbook

Example 2: create an XLIFF diff file using Saxon

java com.icl.saxon.StyleSheet -o Changed_Translations.de.xliff \
                              My_File.docbook \
                              $PACBOOK/xsl/XlateDiff.xsl \
                              Xliff=Current_Translations.de.xliff \
                              Language=de

Pipelining

To use PACBook most effectively you should chain the stylesheets together so that each successive stylesheet works on the output of the previous one.

You can use a shell script, batch file or Apache ANT build script to chain stylesheets together, but the most effective method would be to use an XProc pipeline. More information on this soon.

License

PACBook is released under the LGPL. See the LICENSE file.

PACBook includes code from the XSLT Standard Library project, which is also released under the LGPL.

Contributions

Contributions are welcome. In particular, PACBook needs translations and contributions from linguists for the syntactic dictionaries. Please fork the code and send a pull request!

Acknowledgements

Thanks to:

  • STANLEY Security for help and support when developing and releasing these tools.

  • Edwin Beasant, Peter Crowther, Mina Nielsen for suggestions on licensing.