java-saxon6/java-saxon.1

136 lines
5.7 KiB
Groff

.\" Kudos to: xsltproc(1), help2man,
.\" http://saxon.sourceforge.net/saxon6.5.5/instant.html
.TH SAXON "1" "July 2004" "6.5.5" "User Commands"
.SH NAME
saxon \- Process XML documents with XSLT stylesheets
.SH SYNOPSIS
.B saxon
\fR[\fIoptions\fR] \fIsource-doc \fR[\fIstyle-doc\fR] [{param=value}\fR...]
.SH DESCRIPTION
saxon is a command line tool for applying XSLT stylesheets to XML
documents.
.PP
It is invoked from the command line with some options, followed by the
name of the source document to be transformed, followed by the the
name of the stylesheet to use for the transformation, and finally
followed by optional XSL parameters.
.PP
A parameter takes the form name=value, name being the name of the
parameter, and value the value of the parameter. These parameters are
accessible within the stylesheet as normal variables, using the $name
syntax, provided they are declared using a top-level xsl:param
element. If there is no such declaration, the supplied parameter value
is silently ignored. You can specify a parameter value containing
spaces by enclosing it in double quotes, for example name="John Brown".
.SH OPTIONS
.TP
\fB\-a\fR
Use the xml-stylesheet processing instruction in the source document
to identify the stylesheet to be used. When using this option, the
style-doc argument should be omitted.
.SP
The <?xml-stylesheet?> processing instruction must have a
pseudo-attribute href that identifies the relative or absolute URL of
the stylesheet document, and a pseudo-attribute type whose value is
"text/xml", "application/xml", or "text/xsl". For example:
<?xml-stylesheet type="text/xsl" href="../style3.xsl"?>
Stylesheets embedded within the source document are not
supported in this release.
.TP
\fB\-d\fR\fImodel\fR
Selects the implementation of the internal tree model. -dt selects the
"tinytree" model. -ds selects the traditional tree model. The default
is -dt.
.TP
\fB\-l\fR
Switches line numbering on for the source document. Line numbers are
accessible through the extension function saxon:line-number(), or from
a trace listener.
.TP
\fB\-m\fR \fIclassname\fR
Use the specified Emitter to process the output from xsl:message. The
class must implement the com.icl.saxon.output.Emitter class. This
interface is similar to a SAX ContentHandler, it takes a stream of
events to generate output. In general the content of a message is an
XML fragment. By default the standard XML emitter is used, configured
to write to the standard error stream, and to include no XML
declaration. Each message is output as a new document.
.TP
\fB\-noext\fR
Suppress calls on extension functions, other than system-supplied
Saxon and EXSLT extension functions. This option is useful when
loading an untrusted stylesheet, perhaps from a remote site using an
HTTP URL; it ensures that the stylesheet cannot call Java
methods and thereby gain privileged access to resources on your
machine.
.TP
\fB\-o\fR \fIfilename\fR
Send output to named file. In the absence of this option, output goes
to standard output. The file extension of the output file is used to
decide the default output method if none is specified.
.TP
\fB\-r\fR \fIclassname\fR
Use the specified URIResolver to process all URIs. The URIResolver is
a user-defined class, that extends the com.icl.saxon.URIResolver
class, whose function is to take a URI supplied as a string, and
return a SAX InputSource. It is invoked to process URIs used in the
document() function, in the xsl:include and xsl:import elements, and
(if -u is also specified) to process the URIs of the source file and
stylesheet file provided on the command line. If xml-commons-resolver
is available, defaults to org.apache.xml.resolver.tools.CatalogResolver.
.TP
\fB\-t\fR
Display version and timing information to the standard error output.
.TP
\fB\-T\fR
Display stylesheet tracing information to the standard error
output. Also switches line numbering on for the source document.
.TP
\fB\-TL\fR \fIclassname\fR
Run the stylesheet using the specified TraceListener. The classname
names a user-defined class, which must implement
com.icl.saxon.trace.TraceListener.
.TP
\fB\-u\fR
Indicates that the names of the source document and the style document
are URLs; otherwise they are taken as filenames, unless they start
with "http:" or "file:", in which case they are taken as URLs.
.TP
\fB\-w\fR\fIlevel\fR
Indicates the policy for handling recoverable errors in the
stylesheet: -w0 means recover silently, -w1 means recover after
writing a warning message to the system error output, -w2 means signal
the error and do not attempt recovery. (Note, this does not currently
apply to all errors that the XSLT recommendation describes as
recoverable). The default is -w1.
.TP
\fB\-x\fR \fIclassname\fR
Use the specified SAX parser for source file and for any files loaded
using the document() function. The parser must be the fully-qualified
class name of a Java class that implements the org.xml.sax.Parser or
org.xml.sax.XMLReader interface. If xml-commons-resolver is available,
defaults to org.apache.xml.resolver.tools.ResolvingXMLReader.
.TP
\fB\-y\fR \fIclassname\fR
Use the specified SAX parser for all stylesheet files, including any
loaded using xsl:include or xsl:import. The parser must be the
fully-qualified class name of a Java class that implements the
org.xml.sax.Parser or org.xml.sax.XMLReader interface. If
xml-commons-resolver is available, defaults to
org.apache.xml.resolver.tools.ResolvingXMLReader.
.TP
\fB\-?\fR
Display command syntax.
.SH FILES
.B __RESOLVERDIR__/CatalogManager.properties
.RS
The central catalog manager configuration file used by \fBsaxon\fR
for resolving XML entities and URIs if xml-commons-resolver is
available.
.SH "SEE ALSO"
.BR xsltproc (1)
.SH AUTHOR
Michael H. Kay <mike@saxonica.com>