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" [
7 <!ENTITY xsltproc "<command>xsltproc</command>">
13 <title>xsltproc Manual</title>
14 <productname>libxslt</productname>
20 <firstname>John</firstname>
21 <surname>Fleck</surname>
24 <email>jfleck@inkstain.net</email>
28 <!-- date should be the date of the latest change or the release version -->
30 <!-- still a bit buggy output, will talk to docbook-xsl upstream to fix this -->
31 <!-- <releaseinfo>This is release 0.4 of the xsltproc Manual.</releaseinfo> -->
32 <!-- <edition>0.4</edition> -->
36 <refentrytitle>xsltproc</refentrytitle>
37 <manvolnum>1</manvolnum>
41 <refname>xsltproc</refname>
42 <refpurpose>command line XSLT processor</refpurpose>
47 <command>xsltproc</command>
50 <arg choice="plain"><option>-V</option></arg>
51 <arg choice="plain"><option>--version</option></arg>
54 <arg choice="plain"><option>-v</option></arg>
55 <arg choice="plain"><option>--verbose</option></arg>
59 <arg choice="plain"><option>-o</option></arg>
60 <arg choice="plain"><option>--output</option></arg>
63 <arg choice="plain"><replaceable class="option">FILE</replaceable></arg>
64 <arg choice="plain"><replaceable class="option">DIRECTORY</replaceable></arg>
67 <arg choice="plain"><option>--timing</option></arg>
68 <arg choice="plain"><option>--repeat</option></arg>
69 <arg choice="plain"><option>--debug</option></arg>
70 <arg choice="plain"><option>--novalid</option></arg>
71 <arg choice="plain"><option>--noout</option></arg>
72 <arg choice="plain"><option>--maxdepth <replaceable class="option">VALUE</replaceable></option></arg>
73 <arg choice="plain"><option>--html</option></arg>
74 <arg choice="plain"><option>--param
75 <replaceable class="option">PARAMNAME</replaceable>
76 <replaceable class="option">PARAMVALUE</replaceable>
78 <arg choice="plain"><option>--stringparam
79 <replaceable class="option">PARAMNAME</replaceable>
80 <replaceable class="option">PARAMVALUE</replaceable>
82 <arg choice="plain"><option>--nonet</option></arg>
83 <arg choice="plain"><option>--path "<replaceable class="option">PATH(S)</replaceable>"</option></arg>
84 <arg choice="plain"><option>--load-trace</option></arg>
85 <arg choice="plain"><option>--catalogs</option></arg>
86 <arg choice="plain"><option>--xinclude</option></arg>
89 <arg choice="plain"><option>--profile</option></arg>
90 <arg choice="plain"><option>--norman</option></arg>
93 <arg choice="plain"><option>--dumpextensions</option></arg>
94 <arg choice="plain"><option>--nowrite</option></arg>
95 <arg choice="plain"><option>--nomkdir</option></arg>
96 <arg choice="plain"><option>--writesubtree <replaceable>PATH</replaceable></option></arg>
97 <arg choice="plain"><option>--nodtdattr</option></arg>
99 <arg choice="opt"><replaceable>STYLESHEET</replaceable></arg>
101 <arg choice="plain" rep="norepeat"><replaceable>XML-FILE</replaceable></arg>
102 <arg choice="plain" rep="norepeat">-</arg>
107 <refsect1 id="description">
108 <title>DESCRIPTION</title>
110 &xsltproc; is a command line tool for applying <acronym>XSLT</acronym>
111 stylesheets to <acronym>XML</acronym> documents. It is part
113 <refentrytitle>libxslt</refentrytitle>
114 <manvolnum>3</manvolnum>
115 </citerefentry>, the XSLT C library for GNOME.
116 While it was developed as part of the GNOME project, it can operate
117 independently of the GNOME desktop.
120 &xsltproc; is invoked from the command line with the name of the
121 stylesheet to be used followed by the name of the file or files to which
122 the stylesheet is to be applied. It will use the standard input if a
123 filename provided is <emphasis role="bold">-</emphasis> .
126 If a stylesheet is included in an <acronym>XML</acronym> document with a
127 Stylesheet Processing Instruction, no stylesheet need to be named at the
128 command line. &xsltproc; will automatically detect the included stylesheet
132 By default, output is to <filename class="devicefile">stdout</filename>.
133 You can specify a file for output using
134 the <option>-o</option> or <option>--output</option> option.
138 <refsect1 id="options">
139 <title>OPTIONS</title>
141 &xsltproc; accepts the following options (in alphabetical order):
146 <term><option>--catalogs</option></term>
149 Use the <acronym>SGML</acronym> catalog specified
150 in <envar>SGML_CATALOG_FILES</envar> to resolve the location of
151 external entities. By default, &xsltproc; looks for the catalog
152 specified in <envar>XML_CATALOG_FILES</envar>. If that is not
153 specified, it uses <filename>/etc/xml/catalog</filename>.
159 <term><option>--debug</option></term>
162 Output an <acronym>XML</acronym> tree of the transformed document
163 for debugging purposes.
169 <term><option>--dumpextensions</option></term>
172 Dumps the list of all registered extensions
173 on <filename class="devicefile">stdout</filename>.
179 <term><option>--html</option></term>
181 <para>The input document is an <acronym>HTML</acronym> file.</para>
186 <term><option>--load-trace</option></term>
189 Display all the documents loaded during the processing
190 to <filename class="devicefile">stderr</filename>.
196 <term><option>--maxdepth <replaceable>VALUE</replaceable></option></term>
199 Adjust the maximum depth of the template stack
200 before <citerefentry>
201 <refentrytitle>libxslt</refentrytitle>
202 <manvolnum>3</manvolnum>
203 </citerefentry> concludes it is in an infinite loop. The default is 500.
209 <term><option>--nodtdattr</option></term>
212 Do not apply default attributes from the
213 document's <acronym>DTD</acronym>.
219 <term><option>--nomkdir</option></term>
221 <para>Refuses to create directories.</para>
226 <term><option>--nonet</option></term>
229 Do not use the Internet to fetch <acronym>DTD</acronym>s, entities
236 <term><option>--noout</option></term>
238 <para>Do not output the result.</para>
243 <term><option>--novalid</option></term>
245 <para>Skip loading the document's <acronym>DTD</acronym>.</para>
250 <term><option>--nowrite</option></term>
252 <para>Refuses to write to any file or resource.</para>
258 <option>-o</option> or <option>--output</option>
259 <replaceable>FILE</replaceable> | <replaceable>DIRECTORY</replaceable>
263 Direct output to the given <replaceable>FILE</replaceable>. Using
264 the option with a <replaceable>DIRECTORY</replaceable> directs the
265 output files to the specified directory. This can be
266 useful for multiple outputs (also known as "chunking") or manpage
271 The given directory <emphasis role="bold">must</emphasis> already exist.
276 Make sure that <replaceable>FILE</replaceable>
277 and <replaceable>DIRECTORY</replaceable> follow the <quote>URI reference
278 computation</quote> as described in RFC 2396 and laters. This means, that
279 e.g. <option>-o directory</option> will maybe not work,
280 but <option>-o directory/</option> will.
288 <option>--param <replaceable>PARAMNAME</replaceable> <replaceable>PARAMVALUE</replaceable></option>
292 Pass a parameter of name <replaceable>PARAMNAME</replaceable> and
293 value <replaceable>PARAMVALUE</replaceable> to the stylesheet. You
294 may pass multiple name/value pairs up to a maximum of 32. If the
295 value being passed is a string rather than a node identifier,
296 use <option>--stringparam</option> instead.
302 <term><option>--path "<replaceable>PATH(S)</replaceable>"</option></term>
305 Use the (space- or colon-separated) list of filesystem paths specified
306 by <replaceable>PATHS</replaceable> to load <acronym>DTD</acronym>s,
307 entities or documents. Enclose space-separated lists by quotation marks.
313 <term><option>--profile</option> or <option>--norman</option></term>
316 Output profiling information detailing the amount of time spent in
317 each part of the stylesheet. This is useful in optimizing stylesheet
324 <term><option>--repeat</option></term>
326 <para>Run the transformation 20 times. Used for timing tests.</para>
332 <option>--stringparam <replaceable>PARAMNAME</replaceable> <replaceable>PARAMVALUE</replaceable></option>
336 Pass a parameter of name <replaceable>PARAMNAME</replaceable> and
337 value <replaceable>PARAMVALUE</replaceable>
338 where <replaceable>PARAMVALUE</replaceable> is a string rather than a
339 node identifier. <emphasis role="bold">Note:</emphasis> The string
340 must be UTF-8 encoded.
346 <term><option>--timing</option></term>
349 Display the time used for parsing the stylesheet, parsing the document
350 and applying the stylesheet and saving the result. Displayed in
357 <term><option>-v</option> or <option>--verbose</option></term>
360 Output each step taken by &xsltproc; in processing the stylesheet
367 <term><option>-V</option> or <option>--version</option></term>
370 Show the version of <citerefentry>
371 <refentrytitle>libxml</refentrytitle>
372 <manvolnum>3</manvolnum>
373 </citerefentry> and <citerefentry>
374 <refentrytitle>libxslt</refentrytitle>
375 <manvolnum>3</manvolnum>
376 </citerefentry> used.
382 <term><option>--writesubtree <replaceable>PATH</replaceable></option></term>
385 Allow file write only within the <replaceable>PATH</replaceable>
392 <term><option>--xinclude</option></term>
395 Process the input document using the XInclude specification. More
396 details on this can be found in the XInclude
397 specification: <ulink url="http://www.w3.org/TR/xinclude/"/>
405 <refsect1 id="environment">
406 <title>ENVIRONMENT</title>
410 <term><envar>SGML_CATALOG_FILES</envar></term>
412 <para><acronym>SGML</acronym> catalog behavior can be changed by redirecting
413 queries to the user's own set of catalogs. This can be done by setting
414 the <envar>SGML_CATALOG_FILES</envar> environment variable to a list
415 of catalogs. An empty one should deactivate loading the
416 default <filename>/etc/sgml/catalog</filename> catalog.
422 <term><envar>XML_CATALOG_FILES</envar></term>
424 <para><acronym>XML</acronym> catalog behavior can be changed by redirecting
425 queries to the user's own set of catalogs. This can be done by setting
426 the <envar>XML_CATALOG_FILES</envar> environment variable to a list
427 of catalogs. An empty one should deactivate loading the
428 default <filename>/etc/xml/catalog</filename> catalog.
436 <refsect1 id="diagnostics">
437 <title>DIAGNOSTICS</title>
439 &xsltproc; return codes provide information that can be used when
440 calling it from scripts.
445 <term><errorcode>0</errorcode></term>
447 <para>No error (normal operation)</para>
452 <term><errorcode>1</errorcode></term>
454 <para>No argument</para>
459 <term><errorcode>2</errorcode></term>
461 <para>Too many parameters</para>
466 <term><errorcode>3</errorcode></term>
468 <para>Unknown option</para>
473 <term><errorcode>4</errorcode></term>
475 <para>Failed to parse the stylesheet</para>
480 <term><errorcode>5</errorcode></term>
482 <para>Error in the stylesheet</para>
487 <term><errorcode>6</errorcode></term>
489 <para>Error in one of the documents</para>
494 <term><errorcode>7</errorcode></term>
496 <para>Unsupported xsl:output method</para>
501 <term><errorcode>8</errorcode></term>
503 <para>String parameter contains both quote and double-quotes</para>
508 <term><errorcode>9</errorcode></term>
510 <para>Internal processing error</para>
515 <term><errorcode>10</errorcode></term>
517 <para>Processing was stopped by a terminating message</para>
524 <refsect1 id="seealso">
525 <title>SEE ALSO</title>
527 <refentrytitle>libxml</refentrytitle>
528 <manvolnum>3</manvolnum>
529 </citerefentry>, <citerefentry>
530 <refentrytitle>libxslt</refentrytitle>
531 <manvolnum>3</manvolnum>
535 More information can be found at
539 <refentrytitle>libxml</refentrytitle>
540 <manvolnum>3</manvolnum>
541 </citerefentry> web page <ulink url="http://www.xmlsoft.org/"/>
545 <para>W3C <acronym>XSLT</acronym> page <ulink url="http://www.w3.org/TR/xslt"/>