Xslt processor invocation wrapper
db2x_xsltproc \kx [options] xml-document
db2x_xsltproc invokes the XSLT 1.0 processor for docbook2X.
This command applies the XSLT stylesheet (usually given by the \*(T<--stylesheet\*(T> option) to the XML document in the file xml-document. The result is written to standard output (unless changed with \*(T<--output\*(T>).
To read the source XML document from standard input, specify \*(T<-\*(T> as the input document.
\*(T<--version\*(T>
Display the docbook2X version.
\*(T<--output \*(T>file, \*(T<-o \*(T>file
Write output to the given file (or URI), instead of standard output.
\*(T<--xinclude\*(T>, \*(T<-I\*(T>
Process XInclude directives in the source document.
\*(T<--sgml\*(T>, \*(T<-S\*(T>
Indicate that the input document is SGML instead of XML. You need this set this option if xml-document is actually a SGML file.
SGML parsing is implemented by conversion to XML via sgml2xml(1) from the SP package (or osx(1) from the OpenSP package). All tag names in the SGML file will be normalized to lowercase (i.e. the \*(T<-xlower\*(T> option of sgml2xml(1) is used). ID attributes are available for the stylesheet (i.e. option \*(T<-xid\*(T>). In addition, any ISO SDATA entities used in the SGML document are automatically converted to their XML Unicode equivalents. (This is done by a sed filter.)
The encoding of the SGML document, if it is not \*(T<us-ascii\*(T>, must be specified with the standard SP environment variables: \*(T<SP_CHARSET_FIXED=1 SP_ENCODING=encoding\*(T>. (Note that XML files specify their encoding with the XML declaration \*(T<<?xml version="1.0" encoding="encoding" ?>\*(T> at the top of the file.)
The above conversion options cannot be changed. If you desire different conversion options, you should invoke sgml2xml(1) manually, and then pass the results of that conversion to this program.
\*(T<--catalogs \*(T>catalog-files, \*(T<-C \*(T>catalog-files
Specify additional XML catalogs to use for resolving Formal Public Identifiers or URIs. SGML catalogs are not supported.
These catalogs are not used for parsing an SGML document under the \*(T<--sgml\*(T> option. Use the environment variable SGML_CATALOG_FILES instead to specify the catalogs for parsing the SGML document.
\*(T<--network\*(T>, \*(T<-N\*(T>
db2x_xsltproc will normally refuse to load external resources from the network, for security reasons. If you do want to load from the network, set this option.
Usually you want to have installed locally the relevent DTDs and other files, and set up catalogs for them, rather than load them automatically from the network.
\*(T<--stylesheet \*(T>file, \*(T<-s \*(T>file
Specify the filename (or URI) of the stylesheet to use. The special values \*(T<man\*(T> and \*(T<texi\*(T> are accepted as abbreviations, to specify that xml-document is in DocBook and should be converted to man pages or Texinfo (respectively).
\*(T<--param \*(T>name\*(T<=\*(T>expr, \*(T<-p \*(T>name\*(T<=\*(T>expr
Add or modify a parameter to the stylesheet. name is a XSLT parameter name, and expr is an XPath expression that evaluates to the desired value for the parameter. (This means that strings must be quoted, in addition to the usual quoting of shell arguments; use \*(T<--string-param\*(T> to avoid this.)
\*(T<--string-param \*(T>name\*(T<=\*(T>string, \*(T<-g \*(T>name\*(T<=\*(T>string
Add or modify a string-valued parameter to the stylesheet.
The string must be encoded in UTF-8 (regardless of the locale character encoding).
\*(T<--debug\*(T>, \*(T<-d\*(T>
Display, to standard error, logs of what is happening during the XSL transformation.
\*(T<--nesting-limit \*(T>n, \*(T<-D \*(T>n
Change the maximum number of nested calls to XSL templates, used to detect potential infinite loops. If not specified, the limit is 500 (libxslt\(cqs default).
\*(T<--profile\*(T>, \*(T<-P\*(T>
Display profile information: the total number of calls to each template in the stylesheet and the time taken for each. This information is output to standard error.
\*(T<--xslt-processor \*(T>processor, \*(T<-X \*(T>processor
Select the underlying XSLT processor used. The possible choices for processor are: \*(T<libxslt\*(T>, \*(T<saxon\*(T>, \*(T<xalan-j\*(T>.
The default processor is whatever was set when docbook2X was built. libxslt is recommended (because it is lean and fast), but SAXON is much more robust and would be more helpful when debugging stylesheets.
All the processors have XML catalogs support enabled. (docbook2X requires it.) But note that not all the options above work with processors other than the libxslt one.
XML_CATALOG_FILES
Specify XML Catalogs. If not specified, the standard catalog (\*(T</etc/xml/catalog\*(T>) is loaded, if available.
DB2X_XSLT_PROCESSOR
Specify the XSLT processor to use. The effect is the same as the \*(T<--xslt-processor\*(T> option. The primary use of this variable is to allow you to quickly test different XSLT processors without having to add \*(T<--xslt-processor\*(T> to every script or make file in your documentation build system.
\$2 \(la\$1\(ra\$3 , a W3C Recommendation.
In its earlier versions (< 0.8.4), docbook2X required XSLT extensions to run, and db2x_xsltproc was a special libxslt-based processor that had these extensions compiled-in. When the requirement for XSLT extensions was dropped, db2x_xsltproc became a Perl script which translates the options to db2x_xsltproc to conform to the format accepted by the stock xsltproc(1) which comes with libxslt.
The prime reason for the existence of this script is backward compatibility with any scripts or make files that invoke docbook2X. However, it also became easy to add in support for invoking other XSLT processors with a unified command-line interface. Indeed, there is nothing special in this script to docbook2X, or even to DocBook, and it may be used for running other sorts of stylesheets if you desire. Certainly the author prefers using this command, because its invocation format is sane and is easy to use. (e.g. no typing long class names for the Java-based processors!)
Steve Cheng <\*(T<[email protected]\*(T>>.
The docbook2X manual (in Texinfo or HTML format) fully describes how to convert DocBook to man pages and Texinfo.
Up-to-date information about this program can be found at the .
You may wish to consult the documentation that comes with libxslt, SAXON, or Xalan. The W3C XSLT 1.0 specification would be useful for writing stylesheets.