2 <?xml-stylesheet type="text/xsl"
3 href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"?>
4 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
5 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
10 <title>xsltproc Manual</title>
12 <year>2001, 2002</year>
15 <firstname>John</firstname>
16 <surname>Fleck</surname>
18 <address><email>jfleck@inkstain.net</email></address>
20 <releaseinfo>This is release 0.4 of the xsltproc Manual.</releaseinfo>
24 <refentrytitle>xsltproc</refentrytitle>
25 <manvolnum>1</manvolnum>
29 <refname>xsltproc</refname>
30 <refpurpose>command line xslt processor</refpurpose>
35 <command>xsltproc</command>
39 <arg>-o <replaceable>file</replaceable></arg>
45 <arg>--maxdepth <replaceable>val</replaceable></arg>
47 <arg>--param <replaceable>name</replaceable> <replaceable>value</replaceable></arg>
48 <arg>--stringparam <replaceable>name</replaceable> <replaceable>value</replaceable></arg>
50 <arg>--path <replaceable>paths</replaceable></arg>
51 <arg>--load-trace</arg>
55 <arg>--dumpextensions</arg>
58 <arg>--writesubtree</arg>
60 <arg><option><replaceable>stylesheet</replaceable></option></arg>
61 <arg><replaceable>file1</replaceable></arg>
62 <arg><replaceable>file2</replaceable></arg>
63 <arg><replaceable>....</replaceable></arg>
68 <refsect1 id="introduction">
69 <title>Introduction</title>
71 <application>xsltproc</application> is a command line tool for applying
72 <acronym>XSLT</acronym> stylesheets to <acronym>XML</acronym>
73 documents. It is part of <application>libxslt</application>, the XSLT C
74 library for GNOME. While it was developed as part of the GNOME project, it
75 can operate independently of the GNOME desktop.
79 <application>xsltproc</application> is invoked from the command line with
80 the name of the stylesheet to be used followed by the name of the file or
81 files to which the stylesheet is to be applied.
85 If a stylesheet is included in an <acronym>XML</acronym> document with a
86 Stylesheet Processing Instruction, no stylesheet need be named at the
87 command line. <application>xsltproc</application> will automatically
88 detect the included stylesheet and use it.
92 By default, output is to stdout. You can specify a file for output using
93 the <option>-o</option> option.
97 <refsect1 id="options">
98 <title>Command Line Options</title>
102 <term><option>-V</option> or <option>--version</option></term>
104 <simpara>Show the version of
105 <application>libxml</application> and <application>libxslt</application> used.
113 <option>-v</option> or <option>--verbose</option></term>
115 <simpara>Output each step taken
116 by <application>xsltproc</application> in processing the stylesheet and the document.
124 <option>-o</option> or <option>--output</option> <replaceable>file</replaceable></term>
126 <simpara>Direct output to the file named
127 <replaceable>file</replaceable>. For multiple outputs, also known as
128 "chunking", <option>-o</option> <option>directory/</option> directs the
129 output files to a specified directory. The directory must already exist.
137 <option>--timing</option></term>
139 <simpara>Display the time used for parsing the
140 stylesheet, parsing the document and applying the stylesheet and saving
141 the result. Displayed in milliseconds.
149 <option>--repeat</option></term>
151 <simpara>Run the transformation 20 times. Used for
160 <option>--debug</option></term>
162 <simpara>Output an <acronym>XML</acronym> tree of the
163 transformed document for debugging purposes.
171 <option>--novalid</option></term>
173 <simpara>Skip loading the document's <acronym>DTD</acronym>.
181 <option>--noout</option></term>
183 <simpara>Do not output the result.
191 <option>--maxdepth</option> <replaceable>value</replaceable></term>
194 maximum depth of the template stack before
195 <application>libxslt</application> concludes it is in an infinite
196 loop. The default is 500.
204 <option>--html</option></term>
206 <simpara>The input document is an <acronym>HTML</acronym>
214 <option>--param</option> <replaceable>name</replaceable> <replaceable>value</replaceable></term>
216 <simpara>Pass a parameter of name
217 <replaceable>name</replaceable> and value
218 <replaceable>value</replaceable> to the stylesheet. You may pass multiple
219 name/value pairs up to a maximum of 32. If the value being passed is a
220 string rather than a node identifier, use
221 <option>--stringparam</option> instead.
228 <option>--stringparam</option> <replaceable>name</replaceable> <replaceable>value</replaceable></term>
230 <simpara>Pass a paramenter of name <replaceable>name</replaceable> and
231 value <replaceable>value</replaceable> where
232 <replaceable>value</replaceable> is a string rather than a node
233 identifier. (Note: The string must be utf-8.) </simpara>
239 <option>--nonet</option></term>
241 <simpara>Do not use the Internet to fetch DTD's,
242 entities or documents.
248 <term> <option>--path</option> <replaceable>paths</replaceable></term>
251 Use the list (separated by space or column) of filesystem paths
252 specified by <replaceable>paths</replaceable> to load
253 <acronym>DTDs</acronym>, entities or documents.
259 <term><option>--load-trace</option></term>
262 Display to stderr all the documents loaded during the processing.
269 <option>--catalogs</option></term>
271 <simpara>Use the <acronym>SGML</acronym> catalog specified in
272 <envar>SGML_CATALOG_FILES</envar> to resolve the location of
273 external entities. By default, <application>xsltproc</application>
274 looks for the catalog specified in
275 <envar>XML_CATALOG_FILES</envar>. If that is not specified, it uses
276 <filename>/etc/xml/catalog</filename>.
284 <option>--xinclude</option></term>
286 <simpara>Process the input document using the
287 Xinclude specification. More details on this can be found in the Xinclude
288 specification: <ulink
289 url="http://www.w3.org/TR/xinclude/">http://www.w3.org/TR/xinclude/</ulink>
297 <option>--profile</option> or <option>--norman</option></term>
299 <simpara>Output profiling
300 information detailing the amount of time spent in each part of the
301 stylesheet. This is useful in optimizing stylesheet performance.
308 <option>--dumpextensions</option></term>
310 <simpara>Dumps the list of all registered extensions on stdout.
317 <option>--nowrite</option></term>
319 <simpara>Refuses to write to any file or resource.
326 <option>--nomkdir</option></term>
328 <simpara>Refuses to create directories.
335 <option>--writesubtree</option> <replaceable>path</replaceable></term>
337 <simpara>Allow file write only within the
338 <replaceable>path</replaceable> subtree.
347 <refsect1 id="return">
348 <title>Return values</title>
349 <para><application>xsltproc</application>'s return codes provide information
350 that can be used when calling it from scripts.</para>
352 <para>0: normal</para>
353 <para>1: no argument</para>
354 <para>2: too many parameters</para>
355 <para>3: unknown option</para>
356 <para>4: failed to parse the stylesheet</para>
357 <para>5: error in the stylesheet</para>
358 <para>6: error in one of the documents</para>
359 <para>7: unsupported xsl:output method</para>
360 <para>8: string parameter contains both quote and double-quotes</para>
361 <para>9: internal processing error</para>
362 <para>10: processing was stopped by a terminating message</para>
367 <refsect1 id="moreinfo">
368 <title>More Information</title>
370 <para><application>libxml web page: </application><ulink url="http://www.xmlsoft.org/">http://www.xmlsoft.org/</ulink></para>
372 <para>W3C <acronym>XSLT page: </acronym><ulink url="http://www.w3.org/TR/xslt">http://www.w3.org/TR/xslt</ulink></para>