This is a collection of XSLT 1.0 stylesheets that is designed to pick up where other stylesheets leave off. Most of the stylesheets extend the DocBook XSL-NS Stylesheets.
There is a small build process to generate some stylesheets from their sources. For this, you will need GNU make and one of Xalan-J, Saxon, or xsltproc. The default processor is Xalan-J; you can change this in the Makefile. You will also need either Internet access or a local copy of the DocBook XSL-NS stylesheets; if the latter, edit the Makefile accordingly.
To build, simply type make
. Once this process is completed, the stylesheets
can be used as-is with any XSLT 1.0 processor that supports the EXSLT Common
extensions. Note that the files in the docbook directory depend on access to
a copy of the DocBook XSL-NS stylesheets in order to function correctly.
A few different transformations exist. By directory, they are:
- docbook/atom
-
A DocBook 5 to Atom transformation. It is still in the preliminary stages, but can be used in many circumstances.
- docbook/fo
-
A DocBook 5 to XSL-FO transformation. It is designed for PDF output, but can be used with any XSL-FO processor.
- docbook/html
-
A DocBook 5 to HTML 4.01 Strict transformation. Note that in some styles, the conversion transformation will actually output XHTML of some sort that will only be converted to HTML by the post-processing transformation.
- docbook/xhtml
-
A DocBook 5 to XHTML+RDFa 1.0 transformation.
- docbook/xhtml5
-
A DocBook 5 to XHTML5 transformation. Any RDF metadata that is included is embedded directly into the <head> element.
In general, you’ll want to use a path such as docbook/fo/style/base/cvt.xsl. The cvt.xsl stylesheet will convert from DocBook into the desired output format; in this case, that would be XSL-FO. Using pstp.xsl will post-process the file to perform fix-ups that would be difficult or impossible to perform in the transformation process.
There are a couple different styles available for XSL-FO output:
- none
-
This does nothing except call the DocBook stylesheets.
- base
-
This performs some basic modifications that are common to all other styles. In general, this will not result in a particularly different output from
none
. - school
-
This modifies a variety of layout factors suitable for college papers.
- mla
-
This modifies articles to produce output in the MLA format, which is widely used at high schools and colleges in the United States.
- report
-
This style produces output much like the
-me
macros for troff. It is not, however, guaranteed to be suitable for a Ph.D. thesis at Berkeley.
There are also a few different styles for HTML and XHTML:
- none
-
This does nothing except call the DocBook stylesheets.
- base
-
This performs some basic modifications that are common to all other styles. In general, this will not result in a particularly different output from
none
. - bmc
-
This generates output designed for use on http://www.crustytoothpaste.net/. It is similar to the base style, but cleans up spacing and some uncommon elements, such as
hr
, that the DocBook stylesheets include.
Some stylesheets are derived from the DocBook XSL-NS stylesheets or other sources and therefore are copyrighted by those authors. Such files are noted with copyright and license statements in them. The rest of the stylesheets, as well as the modifications thereto, are licensed under the MIT License:
Copyright © 2006–2016 brian m. carlson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.