1SAXONQ(1) SAXONQ(1)
2
3
4
6 saxonq - command line XQuery processor
7
9 saxonq [OPTION...] QUERYFILE [NAME=VALUE...]
10
12 This manual page documents briefly the saxonq command. This page was
13 written for the Debian(TM) distribution because the original program
14 does not have a manual page. Still, it has HTML documentation which is
15 shipped in the "saxon-manual" package.
16
17 saxonq is a command line wrapper around the Saxon-B XSLT and XQuery
18 processor. Using saxonq you can evaluate XQuery queries directly from
19 the command line. Internally, saxonq is a wrapper around the Java class
20 net.sf.saxon.Query implemented by Saxon-B.
21
22 saxonq should be invoked passing a (required) filename containing the
23 XQuery query to be evaluated; the special filename "-" can be given to
24 require reading the query from standard input.
25
26 Before the query filename a list of options can be given, see below.
27
28 Parameters
29 At the end of the command line, a list of parameters can be given.
30 Parameters are passed using the syntax NAME=VALUE, to specify
31 parameters´ names and values.
32
33 A parameter name prefixed with "+" (plus sign) will be interpreted as a
34 filesystem path parameter If the path points to a single file, that
35 file will be parsed as XML and its document node will be passed as the
36 parameter value. If the path points to a directory, all directly
37 contained files will be parsed as XML files, and the sequence of their
38 document nodes will be passed as the parameter value.
39
40 A parameter name prefixed with "!" (exclamation mark) will be interpted
41 as a output/serialization parameter. See the specifications of XQuery
42 and XSLT 2.0 for more information on output/serialization parameters.
43
44 To pass parameters belonging to the non-null namespace, the syntax
45 {uri}localname=value is provided.
46
47 Parameters will be visible as external variables during query
48 evaluation, provided they have been declared in the query prolog. See
49 the XQuery specification for more information on variables and their
50 declarations.
51
53 A summary of supported options is included below. Options can be passed
54 in any order.
55
56 We first report the options which are shared by saxonq and saxon, then
57 those specific to saxonq (or which have a different semantics).
58
59 Some options are flagged as "Saxon-SA only", such options work only if
60 Saxon-SA is installed. Note that Saxon-SA is a commercial product, as
61 such it is not available in Debian.
62
63 Common options
64 -cr:classname
65 Specify a class to be used for processing collection URIs passed to
66 the collection() function. The class must implement
67 net.sf.saxon.CollectionURIResolver.
68
69 -dtd: {[on] | [off]}
70 Enable or disable DTD validation. Default: off.
71
72 -expand: {[on] | [off]}
73 When validation is enabled, expand default values in validated
74 documents. This option enables or disables such an expansion.
75 Default: on.
76
77 -explain [:filename]
78 Display an execution plan; the output is in XML format. If filename
79 is not given it will be displayed on standard output.
80
81 -ext: {[on] | [off]}
82 Enable or disable the ability to invoke external Java functions
83 from query files and stylesheets. Beware that enabling them is a
84 potential security risk when processing untrusted files. Default:
85 off.
86
87 -l: {[on] | [off]}
88 Keep (when on) or throw away (when off) line numbers in tress
89 corresponding to source documents. When kept, line numbers can be
90 accessed using the function saxon:line-number(). Default: off.
91
92 -outval: {[recover] | [fatal]}
93 When validation is required, set whether validation errors are
94 fatal (when "fatal" is passed) or if they only trigger warnings
95 (when "recover" is). Default: fatal.
96
97 -p: {[on] | [off]}
98 Enable or disable usage of the PTreeURIResolver. Saxon-SA only.
99
100 -r:classname
101 Specify a class to be used for resolving all URIs.
102
103 -repeat:N
104 Repeat the transformation N times. For benchmarking purposes.
105
106 -sa
107 Perform Schema-aware processing. Saxon-SA only.
108
109 -strip: {[all] | [none] | [ignorable]}
110 Specify whitespace stripping policy for source documents: strip all
111 of them ("all"), strip none of them ("none"), strip ignorable
112 whitespace only ("ignorable"). Default: none.
113
114 -t
115 Display version, timing, and other debugging information on
116 standard error.
117
118 -tree: {[tiny] | [linked]}
119 Select the implementation of the internal tree model: tiny tree
120 model ("tiny") or linked tree model ("linked"). See the Saxon
121 documentation for more information on the internal tree model.
122 Default: tiny.
123
124 -T [:classname]
125 Trace various aspect of the processing; an optional class name can
126 be given to specify a user-chosen tracer. The class must implement
127 net.sf.saxon.trace.TraceListener. The default is a system supplied
128 tracer. This option implies -l.
129
130 -TJ
131 Enable tracing of external Java method invocation. See -ext.
132
133 -u
134 Force interpretation of source document names as URI. By default
135 they are considered to be file names, unless they start with
136 "file:" or "http:".
137
138 -val: {[strict] | [lax]}
139 When validation is enabled, choose among "strict" or "lax"
140 validation. Saxon-SA only.
141
142 -x:classname
143 Specify a class to be used as SAX parser for input documents. The
144 class must implement either org.xml.sax.Parser or
145 org.xml.sax.XMLReader.
146
147 -xi
148 Apply XInclude processing to all input documents.
149
150 -xmlversion: {[1.0] | [1.1]}
151 Choose the XML version for processing input documents. "1.1" must
152 be specified to process XML 1.1 and Namespaces 1.1 constructs.
153 Default: 1.0.
154
155 -?
156 Display a help message and exit.
157
158 Options specific to saxonq
159 -mr:classname
160 Use the specifed class as a ModuleURIResolver to resolve query
161 module URIs. The class must implement
162 net.sf.saxon.query.ModuleURIResolver.
163
164 -o:filename
165 Send the query output to the specified filename. If not specified
166 the output will be sent to standard output. See also -wrap.
167
168 -pipe: {[push] | [pull]}
169 Internally, execute query in push or pull mode. Mainly for testing
170 purposes. Push mode is usually faster when intermediate tree are
171 constructed in memory. Default: push.
172
173 -projection: {[on] | [off]}
174 Enable or disable document projection, i.e. the ability to throw
175 away tree parts which will not be accessed by a query. Saxon-SA
176 only.
177
178 -s: {[file] | [URI]}
179 Read document input from the specified filename ("-" can be given
180 to read from standard input). The read document will be available
181 to the query as the context node. -u affects how filename is
182 interpreted.
183
184 -wrap: {[on] | [off]}
185 Enable or disable wrapping of query result in a XML structure which
186 makes explicit the kind of each output node or atomic value. For
187 example free-standing attributes will be wrapped in an explicit XML
188 element stating that they are attributes. When this is off, the
189 query output will be wrapped only using a document node; in such a
190 setting is possible that output parts, such as free-standing
191 attributes, can´t be serialized. Default: off.
192
194 saxon (1), XQuery 1.0: An XML Query Language (W3C Recommendation).
195
196 This program is fully documented by the HTML documentation of Saxon,
197 available in the "saxon-manual" package.
198
200 This manual page was written by Stefano Zacchiroli <zack@debian.org>
201 for the Debian(TM) system (but may be used by others). Permission is
202 granted to copy, distribute and/or modify this document under the terms
203 of the GNU General Public License, Version 3 or any later version
204 published by the Free Software Foundation.
205
206 On Debian systems, the complete text of the GNU General Public License
207 can be found in /usr/share/common-licenses/GPL.
208
210 Copyright © 2008 Stefano Zacchiroli
211
212
213
214 February 2008 SAXONQ(1)