XSLTPROC(1)

NAME
xsltproc - command line XSLT processor

SYNOPSIS
    .HP u
        xsltproc
         [
             [
                 | -V
                 | --version
            ]
             [
                 | -v
                 | --verbose
            ]
             [
                 {
                     | -o
                     | --output
                }
                 {
                     | FILE
                     | DIRECTORY
                }
            ]
             | --timing
             | --repeat
             | --debug
             | --novalid
             | --noout
             | --maxdepth VALUE
             | --html
             | --encoding ENCODING
             | --param PARAMNAME PARAMVALUE
             | --stringparam PARAMNAME PARAMVALUE
             | --nonet
             | --path "PATH(S)"
             | --load-trace
             | --catalogs
             | --xinclude
             | [ | --profile | --norman ]
             | --dumpextensions
             | --nowrite
             | --nomkdir
             | --writesubtree PATH
             | --nodtdattr
        ]
         [STYLESHEET]
         {
             | XML-FILE...
             | -
        }

DESCRIPTION

    .PP xsltproc is a command line tool for applying XSLT stylesheets to XML documents. It is part of libxslt(3), the XSLT C library for GNOME. While it was developed as part of the GNOME project, it can operate independently of the GNOME desktop.
    .PP xsltproc is invoked from the command line with the name of the stylesheet to be used followed by the name of the file or files to which the stylesheet is to be applied. It will use the standard input if a filename provided is - .
    .PP If a stylesheet is included in an XML document with a Stylesheet Processing Instruction, no stylesheet need to be named at the command line. xsltproc will automatically detect the included stylesheet and use it.
    .PP By default, output is to stdout. You can specify a file for output using the -o or --output option.

OPTIONS

    .PP xsltproc accepts the following options (in alphabetical order):

        .PP --catalogs

            Use the SGML catalog specified in SGML_CATALOG_FILES to resolve the location of external entities. By default, xsltproc looks for the catalog specified in XML_CATALOG_FILES. If that is not specified, it uses /etc/xml/catalog.

            .RE
            .PP --debug

                Output an XML tree of the transformed document for debugging purposes.

                .RE
                .PP --dumpextensions

                    Dumps the list of all registered extensions on stdout.

                    .RE
                    .PP --html

                        The input document is an HTML file.

                        .RE
                        .PP --load-trace

                            Display all the documents loaded during the processing to stderr.

                            .RE
                            .PP --maxdepth VALUE

                                Adjust the maximum depth of the template stack before libxslt(3) concludes it is in an infinite loop. The default is 3000.

                                .RE
                                .PP --nodtdattr

                                    Do not apply default attributes from the document's DTD.

                                    .RE
                                    .PP --nomkdir

                                        Refuses to create directories.

                                        .RE
                                        .PP --nonet

                                            Do not use the Internet to fetch DTDs, entities or documents.

                                            .RE
                                            .PP --noout

                                                Do not output the result.

                                                .RE
                                                .PP --novalid

                                                    Skip loading the document's DTD.

                                                    .RE
                                                    .PP --nowrite

                                                        Refuses to write to any file or resource.

                                                        .RE
                                                        .PP -o or --output FILE | DIRECTORY

                                                            Direct output to the given FILE. Using the option with a DIRECTORY directs the output files to the specified directory. This can be useful for multiple outputs (also known as "chunking") or manpage processing.
                                                            .if n .sp
                                                        Important
                                                                    The given directory must already exist.
                                                                .sp .5v
                                                            .if n .sp
                                                        Note
                                                                    Make sure that FILE and DIRECTORY follow the “URI reference computation” as described in RFC 2396 and laters. This means, that e.g. -o directory will maybe not work, but -o directory/ will.
                                                                .sp .5v

                                                            .RE
                                                            .PP --encoding ENCODING

                                                                Allow to specify the encoding for the input.

                                                                .RE
                                                                .PP --param PARAMNAME PARAMVALUE

                                                                    Pass a parameter of name PARAMNAME and value PARAMVALUE to the stylesheet. You may pass multiple name/value pairs up to a maximum of 32. If the value being passed is a string, you can use --stringparam instead, to avoid additional quote characters that appear in string expressions. Note: the XPath expression must be UTF-8 encoded.

                                                                    .RE
                                                                    .PP --path "PATH(S)"

                                                                        Use the (space- or colon-separated) list of filesystem paths specified by PATHS to load DTDs, entities or documents. Enclose space-separated lists by quotation marks.

                                                                        .RE
                                                                        .PP --profile or --norman

                                                                            Output profiling information detailing the amount of time spent in each part of the stylesheet. This is useful in optimizing stylesheet performance.

                                                                            .RE
                                                                            .PP --repeat

                                                                                Run the transformation 20 times. Used for timing tests.

                                                                                .RE
                                                                                .PP --stringparam PARAMNAME PARAMVALUE

                                                                                    Pass a parameter of name PARAMNAME and value PARAMVALUE where PARAMVALUE is a string rather than a node identifier. Note: The string must be UTF-8 encoded.

                                                                                    .RE
                                                                                    .PP --timing

                                                                                        Display the time used for parsing the stylesheet, parsing the document and applying the stylesheet and saving the result. Displayed in milliseconds.

                                                                                        .RE
                                                                                        .PP -v or --verbose

                                                                                            Output each step taken by xsltproc in processing the stylesheet and the document.

                                                                                            .RE
                                                                                            .PP -V or --version

                                                                                                Show the version of libxml(3) and libxslt(3) used.

                                                                                                .RE
                                                                                                .PP --writesubtree PATH

                                                                                                    Allow file write only within the PATH subtree.

                                                                                                    .RE
                                                                                                    .PP --xinclude

                                                                                                        Process the input document using the XInclude specification. More details on this can be found in the XInclude specification: http://www.w3.org/TR/xinclude/

                                                                                                        .RE

ENVIRONMENT

        .PP SGML_CATALOG_FILES

            SGML catalog behavior can be changed by redirecting queries to the user's own set of catalogs. This can be done by setting the SGML_CATALOG_FILES environment variable to a list of catalogs. An empty one should deactivate loading the default /etc/sgml/catalog catalog.

            .RE
            .PP XML_CATALOG_FILES

                XML catalog behavior can be changed by redirecting queries to the user's own set of catalogs. This can be done by setting the XML_CATALOG_FILES environment variable to a list of catalogs. An empty one should deactivate loading the default /etc/xml/catalog catalog.

                .RE

DIAGNOSTICS

    .PP xsltproc return codes provide information that can be used when calling it from scripts.

        .PP 0

            No error (normal operation)

            .RE
            .PP 1

                No argument

                .RE
                .PP 2

                    Too many parameters

                    .RE
                    .PP 3

                        Unknown option

                        .RE
                        .PP 4

                            Failed to parse the stylesheet

                            .RE
                            .PP 5

                                Error in the stylesheet

                                .RE
                                .PP 6

                                    Error in one of the documents

                                    .RE
                                    .PP 7

                                        Unsupported xsl:output method

                                        .RE
                                        .PP 8

                                            String parameter contains both quote and double-quotes

                                            .RE
                                            .PP 9

                                                Internal processing error

                                                .RE
                                                .PP 10

                                                    Processing was stopped by a terminating message

                                                    .RE
                                                    .PP 11

                                                        Could not write the result to the output file

                                                        .RE

SEE ALSO

    .PP libxml(3), libxslt(3)
    .PP More information can be found at

    •
                    libxml(3) web page http://www.xmlsoft.org/
                .RE

        •
                        W3C XSLT page http://www.w3.org/TR/xslt
                    .RE

AUTHOR

John Fleck <jfleck@inkstain.net>

    Author.

COPYRIGHT
Copyright © 2001, 2002