<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl"
   href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
]>

<refentry>
  <refentryinfo>
    <title>xsltproc Manual</title>
    <copyright>
      <year>2001, 2002</year>
    </copyright>
    <author>
      <firstname>John</firstname>
      <surname>Fleck</surname>
    </author>
    <address><email>jfleck@inkstain.net</email></address>
    
    <releaseinfo>This is release 0.4 of the xsltproc Manual.</releaseinfo>
  </refentryinfo>

  <refmeta>
    <refentrytitle>xsltproc</refentrytitle>
    <manvolnum>1</manvolnum>
  </refmeta>

  <refnamediv>
    <refname>xsltproc</refname>
    <refpurpose>command line xslt processor</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <cmdsynopsis>
      <command>xsltproc</command>
      <group>
	<arg>-V</arg>
	<arg>-v</arg>
	<arg>-o <replaceable>file</replaceable></arg>
	<arg>--timing</arg>
	<arg>--repeat</arg>
	<arg>--debug</arg>
	<arg>--novalid</arg>
	<arg>--noout</arg>
	<arg>--maxdepth <replaceable>val</replaceable></arg>
	<arg>--html</arg>
	<arg>--param <replaceable>name</replaceable> <replaceable>value</replaceable></arg>
	<arg>--stringparam <replaceable>name</replaceable> <replaceable>value</replaceable></arg>
	<arg>--nonet</arg>
	<arg>--catalogs</arg>
	<arg>--xinclude</arg>
	<arg>--profile</arg>
	<arg>--dumpextensions</arg>
	<arg>--nowrite</arg>
	<arg>--nomkdir</arg>
	<arg>--writesubtree</arg>
      </group>
      <arg><option><replaceable>stylesheet</replaceable></option></arg>
      <arg><replaceable>file1</replaceable></arg>
      <arg><replaceable>file2</replaceable></arg>
      <arg><replaceable>....</replaceable></arg>
    </cmdsynopsis>
  </refsynopsisdiv>


  <refsect1 id="introduction">
    <title>Introduction</title>
    <para>
      <application>xsltproc</application> is a command line tool for applying
      <acronym>XSLT</acronym> stylesheets to <acronym>XML</acronym>
      documents. It is part of <application>libxslt</application>, the XSLT C
      library for GNOME. While it was developed as part of the GNOME project, it
      can operate independently of the GNOME desktop.
   </para>

    <para>
      <application>xsltproc</application> 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.
    </para>

    <para>
      If a stylesheet is included in an <acronym>XML</acronym> document with a
      Stylesheet Processing Instruction, no stylesheet need be named at the
      command line. <application>xsltproc</application> will automatically
      detect the included stylesheet and use it.
    </para>

    <para>
      By default, output is to stdout. You can specify a file for output using
      the <option>-o</option> option.
    </para>
  </refsect1>

  <refsect1 id="options">
    <title>Command Line Options</title>
    
    <variablelist>
      <varlistentry>
	<term><option>-V</option> or <option>--version</option></term>
	<listitem>
	  <simpara>Show the version of
      <application>libxml</application> and <application>libxslt</application> used.
    </simpara>
	</listitem>
      </varlistentry>

    
      <varlistentry>
	<term>
      <option>-v</option> or <option>--verbose</option></term>
	<listitem>
	  <simpara>Output each step taken
      by <application>xsltproc</application> in processing the stylesheet and the document.
    </simpara>
	</listitem>
      </varlistentry>

    
      <varlistentry>
	<term>
      <option>-o</option> or <option>--output</option> <replaceable>file</replaceable></term>
	<listitem>
	  <simpara>Direct output to the file named
      <replaceable>file</replaceable>. For multiple outputs, also known as
      "chunking", <option>-o</option> <option>directory/</option> directs the
      output files to a specified directory. The directory must already exist.
    </simpara>
	</listitem>
      </varlistentry>

    
      <varlistentry>
	<term>
      <option>--timing</option></term>
	<listitem>
	  <simpara>Display the time used for parsing the
      stylesheet, parsing the document and applying the stylesheet and saving
      the result. Displayed in milliseconds.
    </simpara>
	</listitem>
      </varlistentry>

    
      <varlistentry>
	<term>
      <option>--repeat</option></term>
	<listitem>
	  <simpara>Run the transformation 20 times. Used for
      timing tests.
    </simpara>
	</listitem>
      </varlistentry>

    
      <varlistentry>
	<term>
      <option>--debug</option></term>
	<listitem>
	  <simpara>Output an <acronym>XML</acronym> tree of the
      transformed document for debugging purposes.
    </simpara>
	</listitem>
      </varlistentry>

    
      <varlistentry>
	<term>
      <option>--novalid</option></term>
	<listitem>
	  <simpara>Skip loading the document's <acronym>DTD</acronym>.
    </simpara>
	</listitem>
      </varlistentry>

    
      <varlistentry>
	<term>
      <option>--noout</option></term>
	<listitem>
	  <simpara>Do not output the result.
    </simpara>
	</listitem>
      </varlistentry>

    
      <varlistentry>
	<term>
      <option>--maxdepth</option> <replaceable>value</replaceable></term>
	<listitem>
	  <simpara>Adjust the
      maximum depth of the template stack before
      <application>libxslt</application> concludes it is in an infinite
      loop. The default is 500.
    </simpara>
	</listitem>
      </varlistentry>

    
      <varlistentry>
	<term>
      <option>--html</option></term>
	<listitem>
	  <simpara>The input document is an <acronym>HTML</acronym>
      file.
    </simpara>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>
      <option>--param</option> <replaceable>name</replaceable> <replaceable>value</replaceable></term>
	<listitem>
	  <simpara>Pass a parameter of name
      <replaceable>name</replaceable> and value
      <replaceable>value</replaceable> to the stylesheet. You may pass multiple
      name/value pairs up to a maximum of 32. If the value being passed is a
	    string rather than a node identifier, use
	    <option>--stringparam</option> instead.
	  </simpara>
      	</listitem>
      </varlistentry>

      <varlistentry>
	<term>
	  <option>--stringparam</option> <replaceable>name</replaceable> <replaceable>value</replaceable></term>
	<listitem>
	  <simpara>Pass a paramenter of name <replaceable>name</replaceable> and
	    value <replaceable>value</replaceable> where
	    <replaceable>value</replaceable> is a string rather than a node
	    identifier. (Note: The string must be utf-8.) </simpara>
	</listitem>
      </varlistentry>
    
      <varlistentry>
	<term>
      <option>--nonet</option></term>
	<listitem>
	  <simpara>Do not use the Internet to fetch DTD's or
      entities.
    </simpara>
	</listitem>
      </varlistentry>
    
      <varlistentry>
	<term>
      <option>--catalogs</option></term>
	<listitem>
	  <simpara>Use the <acronym>SGML</acronym> catalog specified in
      <envar>SGML_CATALOG_FILES</envar> to resolve the location of
	    external entities. By default, <application>xsltproc</application>
	    looks for the catalog specified in
      <envar>XML_CATALOG_FILES</envar>. If that is not specified, it uses
      <filename>/etc/xml/catalog</filename>.
    </simpara>
	</listitem>
      </varlistentry>

    
      <varlistentry>
	<term>
      <option>--xinclude</option></term>
	<listitem>
	  <simpara>Process the input document using the
      Xinclude specification. More details on this can be found in the Xinclude
      specification: <ulink
      url="http://www.w3.org/TR/xinclude/">http://www.w3.org/TR/xinclude/</ulink>
    </simpara>
	</listitem>
      </varlistentry>
    
    
      <varlistentry>
	<term>
      <option>--profile</option> or <option>--norman</option></term>
	<listitem>
	  <simpara>Output profiling
      information detailing the amount of time spent in each part of the
      stylesheet. This is useful in optimizing stylesheet performance.
    </simpara>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>
      <option>--dumpextensions</option></term>
	<listitem>
	  <simpara>Dumps the list of all registered extensions on stdout.
    </simpara>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>
      <option>--nowrite</option></term>
	<listitem>
	  <simpara>Refuses to write to any file or resource.
    </simpara>
	</listitem>
      </varlistentry>
    
      <varlistentry>
	<term>
      <option>--nomkdir</option></term>
	<listitem>
	  <simpara>Refuses to create directories.
    </simpara>
	</listitem>
      </varlistentry>
    
      <varlistentry>
	<term>
      <option>--writesubtree</option> <replaceable>path</replaceable></term>
	<listitem>
	  <simpara>Allow file write only within the
	  <replaceable>path</replaceable> subtree.
    </simpara>
	</listitem>
      </varlistentry>
    
    
    </variablelist>
  </refsect1>

  <refsect1 id="return">
    <title>Return values</title>
    <para><application>xsltproc</application>'s return codes provide information
    that can be used when calling it from scripts.</para>

    <para>0: normal</para>
    <para>1: no argument</para>
    <para>2: too many parameters</para>
    <para>3: unknown option</para>
    <para>4: failed to parse the stylesheet</para>
    <para>5: error in the stylesheet</para>
    <para>6: error in one of the documents</para>
    <para>7: unsupported xsl:output method</para>
    <para>8: string parameter contains both quote and double-quotes</para>
    <para>9: internal processing error</para>
    <para>10: processing was stopped by a terminating message</para>
  </refsect1>



  <refsect1 id="moreinfo">
    <title>More Information</title>
    
	  <para><application>libxml web page: </application><ulink url="http://www.xmlsoft.org/">http://www.xmlsoft.org/</ulink></para>
	
	  <para>W3C <acronym>XSLT page: </acronym><ulink url="http://www.w3.org/TR/xslt">http://www.w3.org/TR/xslt</ulink></para>
	
  
  </refsect1>
</refentry>
