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. It will use the standard
82 input if a filename provided is - .
86 If a stylesheet is included in an <acronym>XML</acronym> document with a
87 Stylesheet Processing Instruction, no stylesheet need be named at the
88 command line. <application>xsltproc</application> will automatically
89 detect the included stylesheet and use it.
93 By default, output is to stdout. You can specify a file for output using
94 the <option>-o</option> option.
98 <refsect1 id="options">
99 <title>Command Line Options</title>
103 <term><option>-V</option> or <option>--version</option></term>
105 <simpara>Show the version of
106 <application>libxml</application> and <application>libxslt</application> used.
114 <option>-v</option> or <option>--verbose</option></term>
116 <simpara>Output each step taken
117 by <application>xsltproc</application> in processing the stylesheet and the document.
125 <option>-o</option> or <option>--output</option> <replaceable>file</replaceable></term>
127 <simpara>Direct output to the file named
128 <replaceable>file</replaceable>. For multiple outputs, also known as
129 "chunking", <option>-o</option> <option>directory/</option> directs the
130 output files to a specified directory. The directory must already exist.
138 <option>--timing</option></term>
140 <simpara>Display the time used for parsing the
141 stylesheet, parsing the document and applying the stylesheet and saving
142 the result. Displayed in milliseconds.
150 <option>--repeat</option></term>
152 <simpara>Run the transformation 20 times. Used for
161 <option>--debug</option></term>
163 <simpara>Output an <acronym>XML</acronym> tree of the
164 transformed document for debugging purposes.
172 <option>--novalid</option></term>
174 <simpara>Skip loading the document's <acronym>DTD</acronym>.
182 <option>--noout</option></term>
184 <simpara>Do not output the result.
192 <option>--maxdepth</option> <replaceable>value</replaceable></term>
195 maximum depth of the template stack before
196 <application>libxslt</application> concludes it is in an infinite
197 loop. The default is 500.
205 <option>--html</option></term>
207 <simpara>The input document is an <acronym>HTML</acronym>
215 <option>--param</option> <replaceable>name</replaceable> <replaceable>value</replaceable></term>
217 <simpara>Pass a parameter of name
218 <replaceable>name</replaceable> and value
219 <replaceable>value</replaceable> to the stylesheet. You may pass multiple
220 name/value pairs up to a maximum of 32. If the value being passed is a
221 string rather than a node identifier, use
222 <option>--stringparam</option> instead.
229 <option>--stringparam</option> <replaceable>name</replaceable> <replaceable>value</replaceable></term>
231 <simpara>Pass a paramenter of name <replaceable>name</replaceable> and
232 value <replaceable>value</replaceable> where
233 <replaceable>value</replaceable> is a string rather than a node
234 identifier. (Note: The string must be utf-8.) </simpara>
240 <option>--nonet</option></term>
242 <simpara>Do not use the Internet to fetch DTD's,
243 entities or documents.
249 <term> <option>--path</option> <replaceable>paths</replaceable></term>
252 Use the list (separated by space or column) of filesystem paths
253 specified by <replaceable>paths</replaceable> to load
254 <acronym>DTDs</acronym>, entities or documents.
260 <term><option>--load-trace</option></term>
263 Display to stderr all the documents loaded during the processing.
270 <option>--catalogs</option></term>
272 <simpara>Use the <acronym>SGML</acronym> catalog specified in
273 <envar>SGML_CATALOG_FILES</envar> to resolve the location of
274 external entities. By default, <application>xsltproc</application>
275 looks for the catalog specified in
276 <envar>XML_CATALOG_FILES</envar>. If that is not specified, it uses
277 <filename>/etc/xml/catalog</filename>.
285 <option>--xinclude</option></term>
287 <simpara>Process the input document using the
288 Xinclude specification. More details on this can be found in the Xinclude
289 specification: <ulink
290 url="http://www.w3.org/TR/xinclude/">http://www.w3.org/TR/xinclude/</ulink>
298 <option>--profile</option> or <option>--norman</option></term>
300 <simpara>Output profiling
301 information detailing the amount of time spent in each part of the
302 stylesheet. This is useful in optimizing stylesheet performance.
309 <option>--dumpextensions</option></term>
311 <simpara>Dumps the list of all registered extensions on stdout.
318 <option>--nowrite</option></term>
320 <simpara>Refuses to write to any file or resource.
327 <option>--nomkdir</option></term>
329 <simpara>Refuses to create directories.
336 <option>--writesubtree</option> <replaceable>path</replaceable></term>
338 <simpara>Allow file write only within the
339 <replaceable>path</replaceable> subtree.
348 <refsect1 id="return">
349 <title>Return values</title>
350 <para><application>xsltproc</application>'s return codes provide information
351 that can be used when calling it from scripts.</para>
353 <para>0: normal</para>
354 <para>1: no argument</para>
355 <para>2: too many parameters</para>
356 <para>3: unknown option</para>
357 <para>4: failed to parse the stylesheet</para>
358 <para>5: error in the stylesheet</para>
359 <para>6: error in one of the documents</para>
360 <para>7: unsupported xsl:output method</para>
361 <para>8: string parameter contains both quote and double-quotes</para>
362 <para>9: internal processing error</para>
363 <para>10: processing was stopped by a terminating message</para>
368 <refsect1 id="moreinfo">
369 <title>More Information</title>
371 <para><application>libxml web page: </application><ulink url="http://www.xmlsoft.org/">http://www.xmlsoft.org/</ulink></para>
373 <para>W3C <acronym>XSLT page: </acronym><ulink url="http://www.w3.org/TR/xslt">http://www.w3.org/TR/xslt</ulink></para>