[saxon/f21] Resolves: rhbz#1023753 - Fix script param handling.

Mat Booth mbooth at fedoraproject.org
Mon Jan 12 20:42:33 UTC 2015


commit 4feb48412e2af4e216e3e47684787d6ee985fa6a
Author: Mat Booth <mat.booth at redhat.com>
Date:   Mon Jan 12 20:41:59 2015 +0000

    Resolves: rhbz#1023753 - Fix script param handling.
    
    - Update man pages.

 saxon.1             |  443 ++++++++++++++++++++++++++++++++++-----------------
 saxon.saxon.script  |    4 +-
 saxon.saxonq.script |   10 +-
 saxon.spec          |    6 +-
 saxonq.1            |  355 ++++++++++++++++++++++++++++-------------
 5 files changed, 557 insertions(+), 261 deletions(-)
---
diff --git a/saxon.1 b/saxon.1
index 48da29e..8ea9e1a 100644
--- a/saxon.1
+++ b/saxon.1
@@ -1,148 +1,305 @@
-.\" Kudos to: xsltproc(1), help2man,
-.\" http://www.saxonica.com/documentation/using-xsl/commandline.html
-.TH SAXON8 "1" "March 2006" "8.7" "User Commands"
-.SH NAME
-saxon8 \- manual page for saxon8 
-.SH SYNOPSIS
-.B saxon8
-[\fIoptions\fR] \fIsource-document stylesheet \fR[ \fIparams\fR...]
-.SH DESCRIPTION
-saxon8 applies a given stylesheet to a given source XML document. 
-
-.SH OPTIONS
-
-For a schema\-aware transformation, specify the option \fB\-sa\fR, or (on the Java platform only) use the alternate entry point com.saxonica.Transform. For more details see Schema\-Aware Transformations.
-.TP
-The options must come first, then the two file names, then the params. The stylesheet is omitted if the \fB\-a\fR option is present.
-.TP
-The options are as follows (in any order):
-.TP
-\fB\-a\fR
-Use the xml\-stylesheet processing instruction in the source document to identify the stylesheet to be used. The stylesheet argument should be omitted.
-.TP
-\fB\-c\fR
-Indicates that the stylesheet argument identifies a compiled stylesheet rather than an XML source stylesheet. The stylesheet must have been previously compiled as described in Compiling a Stylesheet.
-.TP
-\fB\-cr\fR classname
-Use the specified CollectionURIResolver to process collection URIs passed to the collection() function. The CollectionURIResolver is a user\-defined class that implements the net.sf.saxon.CollectionURIResolver interface.
-.TP
-\fB\-ds\fR | \fB\-dt\fR
-Selects the implementation of the internal tree model. \fB\-dt\fR selects the tiny tree model (the default). \fB\-ds\fR selects the linked tree model. See Choosing a tree model.
-.TP
-\fB\-im\fR modename
-Selects the initial mode for the transformation. If this is namespaced, it can be written as {uri}localname
-.TP
-\fB\-it\fR template
-Selects the initial named template to be executed. If this is namespaced, it can be written as {uri}localname. When this option is used, the source file should be omitted.
-.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 classname
-Use the specified Emitter to process the output from xsl:message. The class must implement the net.sf.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\-novw\fR
-No version warnings. This suppresses the warning message that is normally issued (as required by the W3C specification) when running an XSLT 2.0 processor against a stylesheet that specifies version=1.0.
-.TP
-\fB\-o\fR filename
-Send output to named file. In the absence of this option, the results go to standard output. If the source argument identifies a directory, this option is mandatory and must also identify a directory; on completion it will contain one output file for each file in the source directory. If the stylesheet writes secondary output files using the xsl:result\-document instruction; this filename acts as the base URI for the href attribute of this instruction. In the absence of this option, secondary output files are written relative to the current working directory.
-.TP
-\fB\-p\fR
-Use the PTreeURIResolver. This option is available in Saxon\-SA only. It cannot be used in conjunction with the \fB\-r\fR option, and it automatically switches on the \fB\-u\fR and \fB\-sa\fR options. The effect is twofold. Firstly, Saxon\-specific file extensions are recognized in URIs (including the URI of the source document on the command line). Currently the only Saxon\-specific file extension is .ptree, which indicates that the source document is supplied in the form of a Saxon PTree. This is a binary representation of an XML document, designed for speed of loading. Secondly, Saxon\-specific query parameters are recognized in a URI. Currently the only query parameter that is recognized is val. This may take the values strict, lax, or strip. For example, source.xml?val=strict loads a document with strict schema validation.
-.TP
-\fB\-r\fR classname
-Use the specified URIResolver to process all URIs. The URIResolver is a user\-defined class, that extends the net.sf.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 \fB\-u\fR is also specified) to process the URIs of the source file and stylesheet file provided on the command line.
-.TP
+.\"     Title: saxon
+.\"    Author: 
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: February 2008
+.\"    Manual: 
+.\"    Source: 
+.\"
+.TH "SAXON" "1" "February 2008" "" ""
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.SH "NAME"
+saxon - command line XSLT 2.0 processor
+.SH "SYNOPSIS"
+.HP 12
+\fBsaxon\fR [\fIOPTION\fR...] [\fB\-s:\fR\fB\fISOURCEFILE\fR\fR] [\fB\-xsl:\fR\fB\fISTYLESHEET\fR\fR] [\fB\-o:\fR\fB\fIOUTPUT\fR\fR] [\fINAME\fR=\fIVALUE\fR...]
+.SH "DESCRIPTION"
+.PP
+This manual page documents briefly the
+\fBsaxon\fR
+command\. This page was written for the
+Debian(TM)
+distribution because the original program does not have a manual page\. Instead, it has HTML documentation which is shipped in the "saxon\-manual" package\.
+.PP
+\fBsaxon\fR
+is a command line wrapper around the Saxon\-B XSLT and XQuery processor\. Using
+\fBsaxon\fR
+you can process XML documents with
+\fIXSLT 2\.0\fR
+stylesheets directly from the command line\. Internally,
+\fBsaxon\fR
+is a wrapper around the Java class
+\fBnet\.sf\.saxon\.Transform\fR
+implemented by Saxon\-B\.
+.PP
+\fBsaxon\fR
+is usually invoked passing the 3 options made explicit in the above synopsis\. Usually, those options correspond respectively to the input XML file to be transformed, the XSLT stylesheet describing the desired transformation, and the output file where to save the result\. However, the meaning and the need of passing them is affected by a number of other options that can be specified\. See the option reference below for more information\.
+.SS "Parameters"
+.PP
+At the end of the command line, a list of
+\fIparameters\fR
+can be given\. Parameters are passed using the syntax
+\fINAME\fR=\fIVALUE\fR, to specify parameters\' names and values\.
+.PP
+A parameter name prefixed with "+" (plus sign) will be interpreted as a
+\fIfilesystem path parameter\fR
+If the path points to a single file, that file will be parsed as XML and its document node will be passed as the parameter value\. If the path points to a directory, all directly contained files will be parsed as XML files, and the sequence of their document nodes will be passed as the parameter value\.
+.PP
+A parameter name prefixed with "!" (exclamation mark) will be interpted as a output/serialization parameter\. See the specifications of XQuery and XSLT 2\.0 for more information on output/serialization parameters\.
+.PP
+To pass parameters belonging to the non\-null namespace, the syntax {\fIuri\fR}\fIlocalname\fR=\fIvalue\fR
+is provided\.
+.PP
+Parameters will be visible as global variables during XSLT processing, provided they have been declared with <xsl:param>\. evaluation, provided they have been declared in the query prolog\. See the XSLT specification for more information on variables and their declarations\.
+.SH "OPTIONS"
+.PP
+A summary of supported options is included below\. Options can be passed in any order\.
+.PP
+We first report the options which are shared by
+\fBsaxon\fR
+and
+\fBsaxonq\fR, then those specific to
+\fBsaxon\fR
+(or which have a different semantics)\.
+.PP
+Some options are flagged as "Saxon\-SA only", such options work only if Saxon\-SA is installed\. Note that Saxon\-SA is a commercial product, as such it is not available in Debian\.
+.SS "Common options"
+.PP
+\fB\-cr\fR:\fIclassname\fR
+.RS 4
+Specify a class to be used for processing collection URIs passed to the
+\fBcollection()\fR
+function\. The class must implement
+net\.sf\.saxon\.CollectionURIResolver\.
+.RE
+.PP
+\fB\-dtd\fR: {[on] | [off]}
+.RS 4
+Enable or disable DTD validation\. Default: off\.
+.RE
+.PP
+\fB\-expand\fR: {[on] | [off]}
+.RS 4
+When validation is enabled, expand default values in validated documents\. This option enables or disables such an expansion\. Default: on\.
+.RE
+.PP
+\fB\-explain\fR [:\fIfilename\fR]
+.RS 4
+Display an execution plan; the output is in XML format\. If filename is not given it will be displayed on standard output\.
+.RE
+.PP
+\fB\-ext\fR: {[on] | [off]}
+.RS 4
+Enable or disable the ability to invoke external Java functions from query files and stylesheets\. Beware that enabling them is a potential security risk when processing untrusted files\. Default: off\.
+.RE
+.PP
+\fB\-l\fR: {[on] | [off]}
+.RS 4
+Keep (when on) or throw away (when off) line numbers in tress corresponding to source documents\. When kept, line numbers can be accessed using the function
+\fBsaxon:line\-number()\fR\. Default: off\.
+.RE
+.PP
+\fB\-outval\fR: {[recover] | [fatal]}
+.RS 4
+When validation is required, set whether validation errors are fatal (when "fatal" is passed) or if they only trigger warnings (when "recover" is)\. Default: fatal\.
+.RE
+.PP
+\fB\-p\fR: {[on] | [off]}
+.RS 4
+Enable or disable usage of the
+PTreeURIResolver\. Saxon\-SA only\.
+.RE
+.PP
+\fB\-r\fR:\fIclassname\fR
+.RS 4
+Specify a class to be used for resolving all URIs\.
+.RE
+.PP
+\fB\-repeat\fR:\fIN\fR
+.RS 4
+Repeat the transformation N times\. For benchmarking purposes\.
+.RE
+.PP
 \fB\-sa\fR
-Invoke a schema\-aware transformation. Requires Saxon\-SA to be installed.
-.TP
-\fB\-sall\fR
-Strips all whitespace text nodes from source documents before any further processing, regardless of any xsl:strip\-space declarations in the stylesheet, or any xml:space attributes in the source document.
-.TP
-\fB\-signorable\fR
-Strips all ignorable whitespace text nodes from source documents before any further processing, regardless of any xsl:strip\-space declarations in the stylesheet, or any xml:space attributes in the source document. Whitespace text nodes are ignorable if they appear in elements defined in the DTD or schema as having element\-only content.
-.TP
-\fB\-snone\fR
-Strips no whitespace before further processing. (However, whitespace will still be stripped if this is specified in the stylesheet using xsl:strip\-space).
-.TP
+.RS 4
+Perform Schema\-aware processing\. Saxon\-SA only\.
+.RE
+.PP
+\fB\-strip\fR: {[all] | [none] | [ignorable]}
+.RS 4
+Specify whitespace stripping policy for source documents: strip all of them ("all"), strip none of them ("none"), strip ignorable whitespace only ("ignorable")\. Default: none\.
+.RE
+.PP
 \fB\-t\fR
-Display version and timing information to the standard error output. The output also traces the files that are read and writing, and extension modules that are loaded.
-.TP
-\fB\-T\fR
-Display stylesheet tracing information to the standard error output. This traces execution of each instruction in the stylesheet, so the output can be quite voluminous. Also switches line numbering on for the source document.
-.TP
+.RS 4
+Display version, timing, and other debugging information on standard error\.
+.RE
+.PP
+\fB\-tree\fR: {[tiny] | [linked]}
+.RS 4
+Select the implementation of the internal tree model: tiny tree model ("tiny") or linked tree model ("linked")\. See the Saxon documentation for more information on the internal tree model\. Default: tiny\.
+.RE
+.PP
+\fB\-T\fR [:\fIclassname\fR]
+.RS 4
+Trace various aspect of the processing; an optional class name can be given to specify a user\-chosen tracer\. The class must implement
+net\.sf\.saxon\.trace\.TraceListener\. The default is a system supplied tracer\. This option implies
+\fB\-l\fR\.
+.RE
+.PP
 \fB\-TJ\fR
-Switches on tracing of the binding of calls to external Java methods. This is useful when analyzing why Saxon fails to find a Java method to match an extension function call in the stylesheet, or why it chooses one method over another when several are available.
-.TP
-\fB\-TL\fR classname
-Run the stylesheet using the specified TraceListener. The classname names a user\-defined class, which must implement net.sf.saxon.trace.TraceListener
-.TP
-\fB\-TP\fR
-Run the stylesheet using the TraceListener TimedTraceListener. This creates an output file giving timings for each instruction executed. This output file can subsequently be analyzed to give an execution time profile for the stylesheet. See Performance Analysis.
-.TP
+.RS 4
+Enable tracing of external Java method invocation\. See
+\fB\-ext\fR\.
+.RE
+.PP
+\fB\-u\fR
+.RS 4
+Force interpretation of source document names as URI\. By default they are considered to be file names, unless they start with "file:" or "http:"\.
+.RE
+.PP
+\fB\-val\fR: {[strict] | [lax]}
+.RS 4
+When validation is enabled, choose among "strict" or "lax" validation\. Saxon\-SA only\.
+.RE
+.PP
+\fB\-x\fR:\fIclassname\fR
+.RS 4
+Specify a class to be used as SAX parser for input documents\. The class must implement either
+org\.xml\.sax\.Parser
+or
+org\.xml\.sax\.XMLReader\.
+.RE
+.PP
+\fB\-xi\fR
+.RS 4
+Apply XInclude processing to all input documents\.
+.RE
+.PP
+\fB\-xmlversion\fR: {[1\.0] | [1\.1]}
+.RS 4
+Choose the XML version for processing input documents\. "1\.1" must be specified to process XML 1\.1 and Namespaces 1\.1 constructs\. Default: 1\.0\.
+.RE
+.PP
+\fB\-?\fR
+.RS 4
+Display a help message and exit\.
+.RE
+.SS "Options specific to saxon"
+.PP
+\fB\-a\fR
+.RS 4
+Use the "<?xml\-stylesheet \.\.\. ?>" processing instruction from the source document to find the stylesheet to be used\. This option is not compatible with
+\fB\-xsl\fR\.
+.RE
+.PP
+\fB\-c\fR:\fIfilename\fR
+.RS 4
+Use the compiled stylesheet stored in filename\. This option is not compatible with
+\fB\-xsl\fR\.
+.RE
+.PP
+\fB\-im\fR:\fImodename\fR
+.RS 4
+Use modename as the initial mode used for the transformation\. Qualified modes can be specified as "{\fIuri\fR}\fIlocalname\fR"\.
+.RE
+.PP
+\fB\-it\fR:\fItemplatename\fR
+.RS 4
+Use templatename as the initial named template for the transformation\. When this option is used,
+\fB\-xsl\fR
+is optional\.
+.RE
+.PP
+\fB\-m\fR:\fIclassname\fR
+.RS 4
+Specify a class to be used as the receiver for messages generated by <xsl:message>\. The class must implement
+net\.sf\.saxon\.event\.Receiver\.
+.RE
+.PP
+\fB\-o\fR:\fIpath\fR
+.RS 4
+Specify the path to be used for saving generated output\. Usually path points to a filename where the main result document will be saved\. If not specified such a document will be written to standard output\.
+.sp
+Additional output documents generated using the <xsl:result\-document> command uses path as the basename for the "href" attribute of the command\. If
+\fB\-o\fR
+is missing they will be saved relatively to the current working directory\.
+.sp
+When
+\fB\-s\fR
+identifies a directory, also
+\fB\-o\fR
+should identify one\. All the output documents will then be written under such a directory\.
+.RE
+.PP
+\fB\-or\fR:\fIclassname\fR
+.RS 4
+Specify a class to be used as the output resolver for the "href" attribute of <xsl:result\-document>\. The class must implement
+net\.sf\.saxon\.OutputURIResolver\.
+.RE
+.PP
+\fB\-s\fR:\fIpath\fR
+.RS 4
+Specify the input file or directory\. This option is required unless
+\fB\-it\fR
+has been given\. If path points to a filename, that file will be parsed as an XML document and its document node will be the context item at the beginning of the transformation\. The special filename "\-" can be used to require reading the input document from standard input\.
+.sp
+If path points to a directory all files directly contained in it will be individually transformed\. In such a case
+\fB\-o\fR
+is required\.
+\fB\-u\fR
+affects the intepretation of path\.
+.RE
+.PP
+\fB\-versmsg\fR: {[on] | [off]}
+.RS 4
+Enable or disable the warning about using an XSLT 2\.0 processor (which Saxon\-B is) on stylesheets which specify version="1\.0" in their root element\. Default: on\.
+.RE
+.PP
+\fB\-warnings\fR: {[silent] | [recover] | [fatal]}
+.RS 4
+Set the policy for handling recoverable errors: "silent" for silent recovery, "recover" for recovery with warning output on standard error, "fatal" for no recovery\. Default: recover\.
+.RE
+.PP
+\fB\-xsl\fR:\fIfilename\fR
+.RS 4
+Specify the main XSLT stylesheet to be used for the transformation\. This option is required unless
+\fB\-a\fR
+or
+\fB\-c\fR
+are specified\. The special filename "\-" can be used to require reading the sylesheet from standard input\.
 \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\-v\fR
-Requests DTD\-based validation of the source file and of any files read using the document() function. Requires an XML parser that supports validation.
-.TP
-\fB\-val\fR
-Requests schema\-based validation of the source file and of any files read using the document() function. This option is available only with Saxon\-SA, and it automatically switches on the \fB\-sa\fR option.
-.TP
-\fB\-vlax\fR
-This option is available only with Saxon\-SA, and it automatically switches on the \fB\-sa\fR option. It requests lax validation of source documents using an XML Schema. That is, the document will be validated if a suitable schema is available, and will not be validated otherwise.
-.TP
-\fB\-vw\fR
-Indicates that validation errors found when validating the result tree should be treated as warnings only. This option is available only with the Saxon\-SA version of the command, com.saxonica.Transform.
-.TP
-\fB\-w0\fR, w1, or w2
-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 classname
-Use specified SAX parser for source file and 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
-.TP
-\fB\-y\fR classname
-Use specified SAX parser for stylesheet file, 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
-.TP
-\fB\-1\fR.1
-Allow XML 1.1 and XML Namespaces 1.1 constructs. This option must be set if source documents using XML 1.1 are to be read, or if result documents are to be serialized as XML 1.1. This option also enables use of XML 1.1 constructs within the stylesheet itself.
-.TP
-\-?
-Display command syntax
-.TP
-source\-document
-Identifies the source file or directory. Mandatory. If this is a directory, all the files in the directory will be processed individually. In this case the \fB\-o\fR option is mandatory, and must also identify a directory, to contain the corresponding output files. A directory must be specified as a filename, not as a URL. The source\-document can be specified as \- to take the source from standard input.
-.TP
-stylesheet
-Identifies the stylesheet. Mandatory unless the \fB\-a\fR option is used. If the \fB\-c\fR option is used, this argument identifies a compiled stylesheet. The stylesheet argument can be specified as \- to read the stylesheet from standard input.
-
-A param 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  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. If the xsl:param element has an as  attribute indicating the required type, then the string value supplied on the command line is cast to this type: this may result in an error, for example if an integer is required and the supplied value cannot be converted to an integer.
-.TP
-A param preceded by a leading exclamation mark (!) is interpreted as an output parameter. For example, !indent=yes requests indented output. This is equivalent to specifying the attribute indent=yes on an xsl:output declaration in the stylesheet. An output parameter specified on the command line overrides one specified within the stylesheet.
-.TP
-A param preceded by a leading plus sign (+) is interpreted as a filename or directory. The content of the file is parsed as XML, and the resulting document node is passed to the stylesheet as the value of the parameter. If the parameter value is a directory, then all the immediately contained files are parsed as XML, and the resulting sequence of document nodes is passed as the value of the parameter. For example, +lookup=lookup.xml sets the value of the stylesheet parameter lookup to the document node at the root of the tree representing the parsed contents of the file lookup.xml.
-.TP
-Under Windows, and some other operating systems, it is possible to supply a value containing spaces by enclosing it in double quotes, for example name=John Smith. This is a feature of the operating system shell, not something Saxon does, so it may not work the same way under every operating system. (In the jEdit console plugin it has to be written as name=John Smith)
-.TP
-If the parameter name is in a non\-null namespace, the parameter can be given a value using the syntax {uri}localname=value. Here uri is the namespace URI of the parameter's name, and localname is the local part of the name.
-.TP
-This applies also to output parameters. For example, you can set the indentation level to 4 by using the parameter !{http://saxon.sf.net/}indent\-spaces=4. See also Additional attributes for xsl:output.
-.TP
-If the \fB\-a\fR option is used, the name of the stylesheet is omitted. The source document must contain a <?xml\-stylesheet?> processing instruction before the first element start tag; this processing instruction must have a pseudo\-attribute href that identifies the relative or absolute URL of the stylsheet document, and a pseudo\-attribute type whose value is text/xml, application/xml, or text/xsl. For example:
-.TP
-<?xml\-stylesheet type=text/xsl href=../style3.xsl ?>
-.TP
-It is also possible to refer to a stylesheet embedded within the source document, provided it has an id attribute and the id attribute is declared in the DTD as being of type ID.
-.SH FILES
-.B /etc/java/resolver/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.
+affects the intepretation of filename\.
+.RE
+.PP
+\fB\-y\fR:\fIfilename\fR
+.RS 4
+Specify a class to be used as SAX parser for stylesheets\. The class must implement either
+org\.xml\.sax\.Parser
+or
+org\.xml\.sax\.XMLReader\. See also
+\fB\-x\fR\.
+.RE
 .SH "SEE ALSO"
-.BR xsltproc (1)
-.SH AUTHOR 
-Michael H. Kay <mike at saxonica.com>
+.PP
+saxonq (1), XSL Transformations (XSLT) Version 2\.0 (W3C Recommendation)\.
+.PP
+This program is fully documented by the HTML documentation of Saxon, available in the "saxon\-manual" package\.
+.SH "AUTHOR"
+.PP
+This manual page was written by
+Stefano
+Zacchiroli
+<zack at debian\.org>
+for the
+Debian(TM)
+system (but may be used by others)\. Permission is granted to copy, distribute and/or modify this document under the terms of the
+GNU
+General Public License, Version 3 or any later version published by the Free Software Foundation\.
+.PP
+On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common\-licenses/GPL\.
+.SH "COPYRIGHT"
+Copyright \(co 2008 Stefano Zacchiroli
+.br
diff --git a/saxon.saxon.script b/saxon.saxon.script
index 732ee8d..a6423f3 100644
--- a/saxon.saxon.script
+++ b/saxon.saxon.script
@@ -21,12 +21,12 @@ if echo "$CLASSPATH" | grep xml-commons-resolver >/dev/null 2>&1 ; then
   # Tune options to use resolver.
   r=org.apache.xml.resolver.tools.ResolvingXMLReader
   for opt in -x -y ; do
-    if ! echo $@ | grep "\\$opt " >/dev/null 2>&1 ; then
+    if ! echo $@ | grep "\\$opt:" >/dev/null 2>&1 ; then
       args="$args $opt:$r"
     fi
   done
   r=org.apache.xml.resolver.tools.CatalogResolver
-  if ! echo $@ | grep "\\-r " >/dev/null 2>&1 ; then
+  if ! echo $@ | grep "\\-r:" >/dev/null 2>&1 ; then
     args="$args -r:$r"
   fi
 fi
diff --git a/saxon.saxonq.script b/saxon.saxonq.script
index 83b2a08..e9977ec 100644
--- a/saxon.saxonq.script
+++ b/saxon.saxonq.script
@@ -20,13 +20,11 @@ if echo "$CLASSPATH" | grep xml-commons-resolver >/dev/null 2>&1 ; then
   CLASSPATH="$CLASSPATH:/etc/java/resolver"
   # Tune options to use resolver.
   r=org.apache.xml.resolver.tools.ResolvingXMLReader
-  for opt in -x -y ; do
-    if ! echo $@ | grep "\\$opt " >/dev/null 2>&1 ; then
-      args="$args $opt:$r"
-    fi
-  done
+  if ! echo $@ | grep "\\-x:" >/dev/null 2>&1 ; then
+    args="$args -x:$r"
+  fi
   r=org.apache.xml.resolver.tools.CatalogResolver
-  if ! echo $@ | grep "\\-r " >/dev/null 2>&1 ; then
+  if ! echo $@ | grep "\\-r:" >/dev/null 2>&1 ; then
     args="$args -r:$r"
   fi
 fi
diff --git a/saxon.spec b/saxon.spec
index 78ed127..31c4711 100644
--- a/saxon.spec
+++ b/saxon.spec
@@ -31,7 +31,7 @@
 Summary:        Java XPath, XSLT 2.0 and XQuery implementation
 Name:           saxon
 Version:        9.3.0.4
-Release:        13%{?dist}
+Release:        14%{?dist}
 # net.sf.saxon.om.XMLChar is from ASL-licensed Xerces
 # net/sf/saxon/option/jdom/ is MPLv1.1
 # net/sf/saxon/serialize/codenorm/ is UCD
@@ -200,6 +200,10 @@ update-alternatives --install %{_javadir}/jaxp_transform_impl.jar \
 
 
 %changelog
+* Mon Jan 12 2015 Mat Booth <mat.booth at redhat.com> - 9.3.0.4-14
+- Resolves: rhbz#1023753 - Fix script param handling.
+- Update man pages.
+
 * Thu Jun 12 2014 Mikolaj Izdebski <mizdebsk at redhat.com> - 9.3.0.4-13
 - Restore removed Maven alias for net.sf.saxon:saxon::dom:
 
diff --git a/saxonq.1 b/saxonq.1
index 30d49f6..756d8c0 100644
--- a/saxonq.1
+++ b/saxonq.1
@@ -1,112 +1,249 @@
-.\" Kudos to: xsltproc(1), help2man,
-.\" http://www.saxonica.com/documentation/using-xquery/commandline.html
-.TH SAXON8Q "1" "March 2006" "8.7" "User Commands"
-.SH NAME
-saxon8q \- manual page for saxon8q
-.SH SYNOPSIS
-.B saxon8q
-[\fIoptions\fR]   \fIquery   \fR[ \fIparams\fR...]
-.SH DESCRIPTION
-saxon8q runs a query contained in a file.
-
-.SH OPTIONS
-The options must come first, then the file name containing the query, then the params.
-.TP
-The options are as follows (in any order):
-.TP
-\fB\-cr\fR classname
-Use the specified CollectionURIResolver to process collection URIs passed to the collection() function. The CollectionURIResolver is a user\-defined class that implements the net.sf.saxon.CollectionURIResolver interface.
-.TP
-\fB\-ds\fR
-Use the linked tree model for source documents. See Choosing a Tree Model.
-.TP
-\fB\-dt\fR
-Use the tinytree tree model for source documents. This is the default tree model. See Choosing a Tree Model.
-.TP
-\fB\-e\fR
-Display a query execution plan. This is a representation of the expression tree after rewriting by the optimizer.
-.TP
-\fB\-l\fR
-Causes line numbers to be maintained for source documents. These are accessible using the extension function saxon:line\-number(). Line numbers are useful when the purpose of the query is to find errors or anomalies in the source XML file. Without this option, line numbers are available while source documents are being parsed and validated, but they are not retained in the tree representation of the document.
-.TP
-\fB\-mr\fR classname
-Use the specified ModuleURIResolver to process all query module URIs. The ModuleURIResolver is a user\-defined class that implements the net.sf.saxon.query.ModuleURIResolver interface. It is invoked to process URIs used in the import module declaration in the query prolog, and (if \fB\-u\fR is also specified, or if the file name begins with http: or file:) to process the URI of the query source file provided on the command line.
-.TP
-\fB\-noext\fR
-Prevents the query calling external Java functions. This is useful for safety if the query is untrusted.
-.TP
-\fB\-o\fR filename
-Send output to named file. In the absence of this option, the results go to standard output. The output format depends on whether the \fB\-wrap\fR option is present.
-.TP
-\fB\-p\fR
-Use the PTreeURIResolver. This option is available in Saxon\-SA only. It cannot be used in conjunction with the \fB\-r\fR option, and it automatically switches on the \fB\-u\fR and \fB\-sa\fR options. The effect is twofold. Firstly, Saxon\-specific file extensions are recognized in URIs (including the URI of the source document on the command line). Currently the only Saxon\-specific file extension is .ptree, which indicates that the source document is supplied in the form of a Saxon PTree. This is a binary representation of an XML document, designed for speed of loading. Secondly, Saxon\-specific query parameters are recognized in a URI. Currently the only query parameter that is recognized is val. This may take the values strict, lax, or strip. For example, source.xml?validation=strict loads a document with strict schema validation.
-.TP
-\fB\-pull\fR
-Execute query in pull mode. This may give performance advantages for certain kinds of query, especially queries that construct intermediate trees in memory.
-.TP
-\fB\-r\fR classname
-Use the specified URIResolver to process all URIs. The URIResolver is a user\-defined class, that implements the URIResolver interface defined in JAXP, 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 doc() function, and (if \fB\-u\fR is also specified) to process the URI of the source file provided on the command line.
-.TP
-\fB\-s\fR filename\-or\-URI
-Take input from the specified file. If the \fB\-u\fR option is specified, or if the name begins with file: or http:, then the name is assumed to be a URI rather than a filename. This file must contain an XML document. The document node of the document is made available to the query as the context item. The source document can be specified as \- to take the source from standard input.
-.TP
-\fB\-sall\fR
-Strips all whitespace text nodes from source documents before any further processing, regardless of any xml:space attributes in the source document.
-.TP
-\fB\-signorable\fR
-Strips all ignorable whitespace text nodes from source documents before any further processing, regardless of any xml:space attributes in the source document. Whitespace text nodes are ignorable if they appear in elements defined in the DTD or schema as having element\-only content.
-.TP
-\fB\-snone\fR
-Strips no whitespace before further processing.
-.TP
-\fB\-strip\fR
-Equivalent to \fB\-sall\fR: retained for compatibility.
-.TP
+.\"     Title: saxonq
+.\"    Author: 
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: February 2008
+.\"    Manual: 
+.\"    Source: 
+.\"
+.TH "SAXONQ" "1" "February 2008" "" ""
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.SH "NAME"
+saxonq - command line XQuery processor
+.SH "SYNOPSIS"
+.HP 14
+\fBsaxonq\fR [\fIOPTION\fR...] \fI\fIQUERYFILE\fR\fR [\fINAME\fR=\fIVALUE\fR...]
+.SH "DESCRIPTION"
+.PP
+This manual page documents briefly the
+\fBsaxonq\fR
+command\. This page was written for the
+Debian(TM)
+distribution because the original program does not have a manual page\. Still, it has HTML documentation which is shipped in the "saxon\-manual" package\.
+.PP
+\fBsaxonq\fR
+is a command line wrapper around the Saxon\-B XSLT and XQuery processor\. Using
+\fBsaxonq\fR
+you can evaluate
+\fIXQuery\fR
+queries directly from the command line\. Internally,
+\fBsaxonq\fR
+is a wrapper around the Java class
+\fBnet\.sf\.saxon\.Query\fR
+implemented by Saxon\-B\.
+.PP
+\fBsaxonq\fR
+should be invoked passing a (required) filename containing the XQuery query to be evaluated; the special filename "\-" can be given to require reading the query from standard input\.
+.PP
+Before the query filename a list of options can be given, see below\.
+.SS "Parameters"
+.PP
+At the end of the command line, a list of
+\fIparameters\fR
+can be given\. Parameters are passed using the syntax
+\fINAME\fR=\fIVALUE\fR, to specify parameters\' names and values\.
+.PP
+A parameter name prefixed with "+" (plus sign) will be interpreted as a
+\fIfilesystem path parameter\fR
+If the path points to a single file, that file will be parsed as XML and its document node will be passed as the parameter value\. If the path points to a directory, all directly contained files will be parsed as XML files, and the sequence of their document nodes will be passed as the parameter value\.
+.PP
+A parameter name prefixed with "!" (exclamation mark) will be interpted as a output/serialization parameter\. See the specifications of XQuery and XSLT 2\.0 for more information on output/serialization parameters\.
+.PP
+To pass parameters belonging to the non\-null namespace, the syntax {\fIuri\fR}\fIlocalname\fR=\fIvalue\fR
+is provided\.
+.PP
+Parameters will be visible as external variables during query evaluation, provided they have been declared in the query prolog\. See the XQuery specification for more information on variables and their declarations\.
+.SH "OPTIONS"
+.PP
+A summary of supported options is included below\. Options can be passed in any order\.
+.PP
+We first report the options which are shared by
+\fBsaxonq\fR
+and
+\fBsaxon\fR, then those specific to
+\fBsaxonq\fR
+(or which have a different semantics)\.
+.PP
+Some options are flagged as "Saxon\-SA only", such options work only if Saxon\-SA is installed\. Note that Saxon\-SA is a commercial product, as such it is not available in Debian\.
+.SS "Common options"
+.PP
+\fB\-cr\fR:\fIclassname\fR
+.RS 4
+Specify a class to be used for processing collection URIs passed to the
+\fBcollection()\fR
+function\. The class must implement
+net\.sf\.saxon\.CollectionURIResolver\.
+.RE
+.PP
+\fB\-dtd\fR: {[on] | [off]}
+.RS 4
+Enable or disable DTD validation\. Default: off\.
+.RE
+.PP
+\fB\-expand\fR: {[on] | [off]}
+.RS 4
+When validation is enabled, expand default values in validated documents\. This option enables or disables such an expansion\. Default: on\.
+.RE
+.PP
+\fB\-explain\fR [:\fIfilename\fR]
+.RS 4
+Display an execution plan; the output is in XML format\. If filename is not given it will be displayed on standard output\.
+.RE
+.PP
+\fB\-ext\fR: {[on] | [off]}
+.RS 4
+Enable or disable the ability to invoke external Java functions from query files and stylesheets\. Beware that enabling them is a potential security risk when processing untrusted files\. Default: off\.
+.RE
+.PP
+\fB\-l\fR: {[on] | [off]}
+.RS 4
+Keep (when on) or throw away (when off) line numbers in tress corresponding to source documents\. When kept, line numbers can be accessed using the function
+\fBsaxon:line\-number()\fR\. Default: off\.
+.RE
+.PP
+\fB\-outval\fR: {[recover] | [fatal]}
+.RS 4
+When validation is required, set whether validation errors are fatal (when "fatal" is passed) or if they only trigger warnings (when "recover" is)\. Default: fatal\.
+.RE
+.PP
+\fB\-p\fR: {[on] | [off]}
+.RS 4
+Enable or disable usage of the
+PTreeURIResolver\. Saxon\-SA only\.
+.RE
+.PP
+\fB\-r\fR:\fIclassname\fR
+.RS 4
+Specify a class to be used for resolving all URIs\.
+.RE
+.PP
+\fB\-repeat\fR:\fIN\fR
+.RS 4
+Repeat the transformation N times\. For benchmarking purposes\.
+.RE
+.PP
+\fB\-sa\fR
+.RS 4
+Perform Schema\-aware processing\. Saxon\-SA only\.
+.RE
+.PP
+\fB\-strip\fR: {[all] | [none] | [ignorable]}
+.RS 4
+Specify whitespace stripping policy for source documents: strip all of them ("all"), strip none of them ("none"), strip ignorable whitespace only ("ignorable")\. Default: none\.
+.RE
+.PP
 \fB\-t\fR
-Display version and timing information to the standard error output. The output also traces the files that are read and written, and extension modules that are loaded.
-.TP
-\fB\-T\fR
-Enable execution tracing. This will cause a trace of the query execution to be output to the standard error output. The events that are traced are currently function calls (entry and exit) and element construction.
-.TP
+.RS 4
+Display version, timing, and other debugging information on standard error\.
+.RE
+.PP
+\fB\-tree\fR: {[tiny] | [linked]}
+.RS 4
+Select the implementation of the internal tree model: tiny tree model ("tiny") or linked tree model ("linked")\. See the Saxon documentation for more information on the internal tree model\. Default: tiny\.
+.RE
+.PP
+\fB\-T\fR [:\fIclassname\fR]
+.RS 4
+Trace various aspect of the processing; an optional class name can be given to specify a user\-chosen tracer\. The class must implement
+net\.sf\.saxon\.trace\.TraceListener\. The default is a system supplied tracer\. This option implies
+\fB\-l\fR\.
+.RE
+.PP
 \fB\-TJ\fR
-Switches on tracing of the binding of calls to external Java methods. This is useful when analyzing why Saxon fails to find a Java method to match an extension function call in the stylesheet, or why it chooses one method over another when several are available.
-.TP
+.RS 4
+Enable tracing of external Java method invocation\. See
+\fB\-ext\fR\.
+.RE
+.PP
+\fB\-u\fR
+.RS 4
+Force interpretation of source document names as URI\. By default they are considered to be file names, unless they start with "file:" or "http:"\.
+.RE
+.PP
+\fB\-val\fR: {[strict] | [lax]}
+.RS 4
+When validation is enabled, choose among "strict" or "lax" validation\. Saxon\-SA only\.
+.RE
+.PP
+\fB\-x\fR:\fIclassname\fR
+.RS 4
+Specify a class to be used as SAX parser for input documents\. The class must implement either
+org\.xml\.sax\.Parser
+or
+org\.xml\.sax\.XMLReader\.
+.RE
+.PP
+\fB\-xi\fR
+.RS 4
+Apply XInclude processing to all input documents\.
+.RE
+.PP
+\fB\-xmlversion\fR: {[1\.0] | [1\.1]}
+.RS 4
+Choose the XML version for processing input documents\. "1\.1" must be specified to process XML 1\.1 and Namespaces 1\.1 constructs\. Default: 1\.0\.
+.RE
+.PP
+\fB\-?\fR
+.RS 4
+Display a help message and exit\.
+.RE
+.SS "Options specific to saxonq"
+.PP
+\fB\-mr:\fR\fB\fIclassname\fR\fR
+.RS 4
+Use the specifed class as a
+ModuleURIResolver
+to resolve query module URIs\. The class must implement
+net\.sf\.saxon\.query\.ModuleURIResolver\.
+.RE
+.PP
+\fB\-o\fR:\fIfilename\fR
+.RS 4
+Send the query output to the specified filename\. If not specified the output will be sent to standard output\. See also
+\fB\-wrap\fR\.
+.RE
+.PP
+\fB\-pipe\fR: {[push] | [pull]}
+.RS 4
+Internally, execute query in push or pull mode\. Mainly for testing purposes\. Push mode is usually faster when intermediate tree are constructed in memory\. Default: push\.
+.RE
+.PP
+\fB\-projection\fR: {[on] | [off]}
+.RS 4
+Enable or disable document projection, i\.e\. the ability to throw away tree parts which will not be accessed by a query\. Saxon\-SA only\.
+.RE
+.PP
+\fB\-s\fR: {[\fIfile\fR] | [\fIURI\fR]}
+.RS 4
+Read document input from the specified filename ("\-" can be given to read from standard input)\. The read document will be available to the query as the context node\.
 \fB\-u\fR
-Indicates that the name of the source document is a URI; otherwise it is taken as a filename, unless it starts with http: or file:, in which case they it is taken as a URL.
-.TP
-\fB\-v\fR
-Indicates that source documents are to be parsed using a validating parser (this invokes DTD validation, not schema validation).
-.TP
-\fB\-val\fR
-This option is available only with Saxon\-SA, and it automatically switches on the \fB\-sa\fR option. It requests strict validation of source documents using an XML Schema.
-.TP
-\fB\-vlax\fR
-This option is available only with Saxon\-SA, and it automatically switches on the \fB\-sa\fR option. It requests lax validation of source documents using an XML Schema. That is, the document will be validated if a suitable schema is available, and will not be validated otherwise.
-.TP
-\fB\-vw\fR
-Indicates that validation errors found when validating the result tree should be treated as warnings only. This option is available only with the Saxon\-SA version of the command, com.saxonica.Query.
-.TP
-\fB\-wrap\fR
-Wraps the result sequence in an XML element structure that indicates the type of each node or atomic value in the query result. This format can handle any type of query result. In the absence of this option, the command effectively wraps a document{} constructor around the supplied query, so that the result is a single XML document, which is then serialized. This will fail if the query result includes constructs that cannot be added to a document node in this way, notably free\-standing attribute nodes.
-.TP
-\fB\-1\fR.1
-Allow XML 1.1 and XML Namespaces 1.1 constructs. This option must be set if source documents using XML 1.1 are to be read, or if result documents are to be serialized as XML 1.1. This option also enables use of XML 1.1 constructs within the query itself.
-.TP
-\-?
-Display command syntax
-.TP
-query   Identifies the file containing the query. Mandatory. The argument can be specified as \- to read the query from standard input. The query can also be specified inline by enclosing it in curly braces (if it contains spaces, you will also need quotes outside the curly braces to keep the command line processor happy). For example java net.sf.saxon.Query {doc('a.xml')//p[1]} selects elements within the file a.xml in the current directory.
-
-A param 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 query as external variables, using the  syntax, provided they are declared in the query prolog. If there is no such declaration, the supplied parameter value is silently ignored.
-.PP
-A param preceded by a leading plus sign (+) is interpreted as a filename or directory. The content of the file is parsed as XML, and the resulting document node is passed to the stylesheet as the value of the parameter. If the parameter value is a directory, then all the immediately contained files are parsed as XML, and the resulting sequence of document nodes is passed as the value of the parameter. For example, +lookup=lookup.xml sets the value of the external variable lookup to the document node at the root of the tree representing the parsed contents of the file lookup.xml.
-.PP
-A param preceded by a leading exclamation mark is interpreted as a serialization parameter. For example, !indent=yes requests indented output, and !encoding=iso\-8859\-1 requests that the serialized output be in ISO 8859/1 encoding. This is equivalent to specifying the option declaration declare option saxon:output indent=yes; or declare option saxon:output encoding=iso\-8859\-1; in the query prolog.
-.PP
-Under Windows, and some other operating systems, it is possible to supply a value containing spaces by enclosing it in double quotes, for example name=John Smith. This is a feature of the operating system shell, not something Saxon does, so it may not work the same way under every operating system.
-.PP
-If the parameter name is in a non\-null namespace, the parameter can be given a value using the syntax {uri}localname=value. Here uri is the namespace URI of the parameter's name, and localname is the local part of the name.
-.PP
-This applies also to output parameters. For example, you can set the indentation level to 4 by using the parameter !{http://saxon.sf.net/}indent\-spaces=4. For the extended set of output parameters supported by Saxon, see Additional serialization parameters.
-.SH AUTHOR
-Michael H. Kay <mike at saxonica.com>
+affects how filename is interpreted\.
+.RE
+.PP
+\fB\-wrap\fR: {[on] | [off]}
+.RS 4
+Enable or disable wrapping of query result in a XML structure which makes explicit the kind of each output node or atomic value\. For example free\-standing attributes will be wrapped in an explicit XML element stating that they are attributes\. When this is off, the query output will be wrapped only using a document node; in such a setting is possible that output parts, such as free\-standing attributes, can\'t be serialized\. Default: off\.
+.RE
+.SH "SEE ALSO"
+.PP
+saxon (1), XQuery 1\.0: An XML Query Language (W3C Recommendation)\.
+.PP
+This program is fully documented by the HTML documentation of Saxon, available in the "saxon\-manual" package\.
+.SH "AUTHOR"
+.PP
+This manual page was written by
+Stefano
+Zacchiroli
+<zack at debian\.org>
+for the
+Debian(TM)
+system (but may be used by others)\. Permission is granted to copy, distribute and/or modify this document under the terms of the
+GNU
+General Public License, Version 3 or any later version published by the Free Software Foundation\.
+.PP
+On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common\-licenses/GPL\.
+.SH "COPYRIGHT"
+Copyright \(co 2008 Stefano Zacchiroli
+.br


More information about the scm-commits mailing list