db2x_xsltproc(1)
π db2x_xsltproc β XSLT processor invocation wrapper π
okay so. this is a page from the docbook2X manual, and it's about a lil command called db2x_xsltproc. bestie, if you've ever needed to run an XSLT 1.0 processor without losing your whole entire mind, this is your girl. let's get into it π«Ά
πΈ NAME πΈ
db2x_xsltproc β the XSLT processor invocation wrapper. that's it, that's the vibe. it wraps. it processes. it slays. β¨
π SYNOPSIS π
db2x_xsltproc [options] xml-document
π¦ DESCRIPTION π¦
So db2x_xsltproc invokes the XSLT 1.0 processor for docbook2X. no cap.
This command applies the XSLT stylesheet β usually the one you handed over with the --stylesheet option β to the XML document sitting in the file xml-document. πβ¨
The result gets written to standard output, unless you changed that with --output. simple as.
And listen: if you want to read the source XML document from standard input, you literally just specify - as the input document. iconic behaviour honestly. π
π OPTIONS π
π the lone wolf option π
--versionβ displays the docbook2X version. that's it. she's little but she's doing her best. π
π₯ TRANSFORMATION OUTPUT OPTIONS π₯
--outputfile,-ofile β write the output to the given file (or URI), instead of standard output. take your output somewhere nice, bestie. π
πΈ SOURCE DOCUMENT OPTIONS πΈ
--xinclude,-Iβ process XInclude directives in the source document. include-ception, we love to see it. β¨--sgml,-Sβ this one says: hey, the input document is SGML, not XML. you need to set this option ifxml-documentis actually an SGML file. no setting it = no SGML, periodt.
So here's the tea on how SGML parsing happens: it's implemented by conversion to XML via sgml2xml(1) from the SP package (or osx(1) from the OpenSP package). And some details you should know:
- All tag names in the SGML file get normalized to lowercase β meaning the
-xloweroption ofsgml2xml(1)is used. - ID attributes are available for the stylesheet β that's the
-xidoption. - Any ISO SDATA entities used in the SGML document are automatically converted to their XML Unicode equivalents. (this is done by a
sedfilter. a whole sed filter. iconic.)
The encoding of the SGML document β if it is not us-ascii β must be specified with the standard SP environment variables:
SP_CHARSET_FIXED=1 SP_ENCODING=encoding
(and btw, XML files specify their encoding with the XML declaration <?xml version="1.0" encoding="encoding" ?> at the top of the file. just so you know the difference π)
β οΈ 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. do it yourself era, I guess. π
π RETRIEVAL OPTIONS π
--catalogscatalog-files,-Ccatalog-files β specify additional XML catalogs to use for resolving Formal Public Identifiers or URIs. ποΈ and no, SGML catalogs are not supported.
heads up bestie: these catalogs are not used for parsing an SGML document under the--sgmloption. use the environment variableSGML_CATALOG_FILESinstead to specify the catalogs for parsing the SGML document. π«Ά
--network,-Nβ so normallydb2x_xsltprocwill refuse to load external resources from the network, for security reasons (she's protective, we stan). 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. local files = the moment. π
π STYLESHEET OPTIONS π
--stylesheetfile,-sfile β specify the filename (or URI) of the stylesheet to use. and here's a cute lil shortcut: the special valuesmanandtexiare accepted as abbreviations, to specify thatxml-documentis in DocBook and should be converted to man pages or Texinfo (respectively). so convenient, so slay. β¨--paramname=expr,-pname=expr β add or modify a parameter to the stylesheet.nameis an XSLT parameter name, andexpris 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 β double quoting?? yes bestie, it's giving nesting doll energy. use --string-param to avoid this.) π
--string-paramname=string,-gname=string β add or modify a string-valued parameter to the stylesheet. the easy way out, and honestly? valid.
The string must be encoded in UTF-8 (regardless of the locale character encoding). no exceptions, she's strict about her encoding. π
π DEBUGGING AND PROFILING π
--debug,-dβ display, to standard error, logs of what is happening during the XSL transformation. the play-by-play commentary we all deserve. π--nesting-limitn,-Dn β change the maximum number of nested calls to XSL templates, used to detect potential infinite loops. π If not specified, the limit is500(libxslt's default). so if you're spiraling, she'll catch you at 500 deep. π--profile,-Pβ 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. it's giving stats class but make it cute. π--xslt-processorprocessor,-Xprocessor β select the underlying XSLT processor used. The possible choices for processor are:libxslt,saxon,xalan-j.
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. read the fine print bestie, it's there for a reason. π
π± ENVIRONMENT π±
XML_CATALOG_FILESβ specify XML Catalogs. If not specified, the standard catalog (/etc/xml/catalog) is loaded, if available. ποΈβ¨DB2X_XSLT_PROCESSORβ specify the XSLT processor to use. The effect is the same as the--xslt-processoroption. The primary use of this variable is to allow you to quickly test different XSLT processors without having to add--xslt-processorto every script or make file in your documentation build system. set it once, vibe forever. π₯
π CONFORMING TO π
XML Stylesheet Language β Transformations (XSLT), version 1.0 β¨http://www.w3.org/TR/xsltβ©, a W3C Recommendation. certified official, no cap. π
π NOTES π
okay, story time π. 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. glow-up arc, honestly. β¨
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. she's versatile like that. π¦
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!) β and honestly? the author ate with that take. π
π«Ά AUTHOR π«Ά
Steve Cheng <stevecheng@users.sourceforge.net>. thank you for your service, king. π
π SEE ALSO π
- 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 docbook2X Web site β¨http://docbook2x.sourceforge.net/β©. π
- 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. π
and that's the whole page bestie!! this was docbook2X 0.8.8, dated 3 March 2007. yeah she's vintage, she's classic, she's still serving. mwah πβ¨π
π¦ where this page comes from
- alpine 3.22: docbook2x-doc 0.8.8-r10 Β· MIT
- alpine 3.23: docbook2x-doc 0.8.8-r10 Β· MIT
- alpine 3.24: docbook2x-doc 0.8.8-r10 Β· MIT
- arch rolling: docbook2x 0.8.8-19 Β· MIT
- centos-stream 10: docbook2X 0.8.8-50.el10 Β· MIT AND DocBook-XML
- centos-stream 9: docbook2X 0.8.8-40.el9 Β· MIT
- debian bookworm: docbook2x 0.8.8-17+b1
- fedora 43: docbook2X 0.8.8-50.fc43 Β· MIT
- fedora 44: docbook2X 0.8.8-52.fc44 Β· MIT
- nixos 26.05: docbook2X 0.8.8
- nixpkgs unstable: docbook2X 0.8.8
- opensuse-leap 16.0: docbook2x-doc 0.8.8-160000.2.2 Β· MIT
- opensuse-leap 16.0: docbook2x-doc 0.8.8-160000.2.2 Β· MIT
- opensuse-leap 16.0: docbook2x-doc 0.8.8-160000.2.2 Β· MIT
- opensuse-leap 16.0: docbook2x-doc 0.8.8-160000.2.2 Β· MIT
- ubuntu jammy: docbook2x 0.8.8-17
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms