Changes

Jump to navigation Jump to search
No change in size ,  15:14, 26 May 2012
m
Text replace - "{{Mono|" to "{{Code|"
> _</pre>
Available command-line flags can be listed with {{MonoCode|-h}}:
<pre>
$ basex -h
! Examples
|- valign="top"
| {{MonoCode|[file]}}
| Executes the specified XQuery file.
|
|- valign="top"
|- valign="top"
| {{MonoCode|-b&lt;pars&gt;}}
| Binds external variables to XQuery expressions. This flag may be specified multiple times. Variables names and their values are delimited by equality signs (<code>=</code>). The names may be optionally prefixed with dollar signs. If a variable uses a namespace different to the default namespace, it can be specified with the [http://www.jclark.com/xml/xmlns.htm Clark Notation] or [http://www.w3.org/TR/xquery-30/#id-basics Expanded QName Notation].
| <code>[[Options#BINDINGS|BINDINGS]]</code>
| <ul><li><code>-b$v=example -q$v</code></li><li><code>-b{URL}ln=value<br/>-q"declare namespace ns='URL'; $ns:ln"</code></li></ul>
|- valign="top"
| {{MonoCode|-c&lt;cmd&gt;}}
| Runs the specified [[commands]] and quits. Several commands can be separated by semicolons.
|
| {{MonoCode|-c"list;info"}}
|- valign="top"
| {{MonoCode|-C&lt;file&gt;}}| Runs all [[commands]] from the specified text file and quits. Empty lines and lines starting with the number sign {{MonoCode|#}} are skipped.
|
| {{MonoCode|-C commands.txt}}
|- valign="top"
| {{MonoCode|-d}}
| Turns on the debugging mode. Debugging information is output to ''standard error''.
| <code>[[Options#DEBUG|DEBUG]]</code>
|
|- valign="top"
| {{MonoCode|-i&lt;input&gt;}}
| Opens a database or XML document specified by the argument. The opened input may be further processed by an XQuery expression.
|
| {{MonoCode|-iitems.xml -q"//item"}}
|- valign="top"
| {{MonoCode|-L}}
| Add trailing newline after query result. Useful for batch processing or pipelining on Unix systems.
|
|
|- valign="top"
| {{MonoCode|-o&lt;file&gt;}}
| All command and query output is written to the specified file.
|
| {{MonoCode|-o output.txt}}
|- valign="top"
| {{MonoCode|-q&lt;expr&gt;}}
| Executes the specified string as XQuery expression.
|
| {{MonoCode|-q"doc('input')//head"}}
|- valign="top"
| {{MonoCode|-s&lt;pars&gt;}}
| Specifies parameters for serializing XQuery results; see [[Serialization]] for more details. This flag may be specified multiple times. Key and values are separated by the equality sign (<code>=</code>).
| <code>[[Options#SERIALIZER|SERIALIZER]]</code>
| <code>-smethod=text</code>
|- valign="top"
| {{MonoCode|-u}}
| Modifies original files after evaluating XQuery Update expressions.
| <code>[[Options#WRITEBACK|WRITEBACK]]</code>
|
|- valign="top"
| {{MonoCode|-v}}
| Prints process and timing information to the ''standard output''.
|
|
|- valign="top"
| {{MonoCode|-V}}
| Prints detailed query information to the ''standard output'', including details on the compilation and profiling steps.
| <code>[[Options#QUERYINFO|QUERYINFO]]</code>
|
|- valign="top"
| {{MonoCode|-w}}
| By default, whitespaces around text nodes are chopped when a database is created. This flag can be specified to preserve whitespaces.
| <code>[[Options#CHOP|CHOP]]</code>
|
|- valign="top"
| {{MonoCode|-x}}
| This flags turn on the output of the query execution plan, formatted in [[Options#XMLPLAN|XML]].
| <code>[[Options#XMLPLAN|XMLPLAN]]</code>
|
|- valign="top"
| {{MonoCode|-z}}
| Skips the serialization of XQuery results. This flag is useful if the query is profiled or analyzed.
| <code>[[Options#SERIALIZE|SERIALIZE]]</code>
|}
Multiple query files and {{MonoCode|-c}}/{{MonoCode|-i}}/{{MonoCode|-q}} flags can be specified. All other options will be set before any other operation takes place. The specified inputs, query files, queries and commands will be subsequently evaluated after that in the given order. The standard input can be parsed by specifying a single dash ({{mono|-}}) as argument.
=BaseX Server=
</pre>
Available command-line flags can be listed with {{MonoCode|-h}}:
<pre>
$ basexserver -h
! width='165' | Examples
|- valign="top"
| {{MonoCode|stop}}
| Stops an existing server instance and quits.
|
|
|- valign="top"
| {{MonoCode|-c&lt;cmd&gt;}}
| Launches database commands before the server itself is started. Several commands can be separated by semicolons.
|
|
| {{MonoCode|-c"open database;info"}}
|- valign="top"
| {{MonoCode|-d}}
| Turns on the debugging mode. Debugging information is output to ''standard error''.
| <code>[[Options#DEBUG|DEBUG]]</code>
|
|- valign="top"
| {{MonoCode|-e&lt;num&gt;}}
| Specifies the port on which the server will send events to clients.
| <code>[[Options#EVENTPORT|EVENTPORT]]</code>
| {{MonoCode|1985}}| {{MonoCode|-e9998}}
|- valign="top"
| {{MonoCode|-i}}
| Starts the interactive console mode, which can be used to enter database commands. This mode is similar to the default standalone and client mode.
|
|
|- valign="top"
| {{MonoCode|-p&lt;num&gt;}}
| Specifies the port on which the server will be addressable.
| <code>[[Options#PORT|PORT]]</code>
| {{MonoCode|1984}}| {{MonoCode|-p9999}}
|- valign="top"
| {{MonoCode|-S}}
| Starts the server as service (i.e., in the background).
|
|
|- valign="top"
| {{MonoCode|-z}}
| Does not generate any [[Logging|log files]].
|
|}
Multiple {{MonoCode|-c}} and {{MonoCode|-i}} flags can be specified. All other options will be set before any other operation takes place. The specified inputs, query files, queries and commands will be subsequently evaluated after that in the given order. The standard input can be parsed by specifying a single dash ({{mono|-}}) as argument.
=BaseX Client=
</pre>
Available command-line flags can be listed with {{MonoCode|-h}}:
<pre>
$ basexclient -h
! width='165' | Examples
|- valign="top"
| {{MonoCode|[file]}}
| Executes the specified XQuery file.
|
|
|- valign="top"
| {{MonoCode|-b&lt;pars&gt;}}
| Binds external variables to XQuery expressions. This flag may be specified multiple times. Variables names and their values are delimited by equality signs (<code>=</code>). The names may be optionally prefixed with dollar signs. If a variable uses a namespace different to the default namespace, it can be specified with the [http://www.jclark.com/xml/xmlns.htm Clark Notation] or [http://www.w3.org/TR/xquery-30/#id-basics Expanded QName Notation].
| <code>[[Options#BINDINGS|BINDINGS]]</code>
| <ul><li><code>-b$v=example -q$v</code></li><li><code>-b{URL}ln=value<br/>-q"declare namespace ns='URL'; $ns:ln"</code></li></ul>
|- valign="top"
| {{MonoCode|-c&lt;cmd&gt;}}
| Runs the specified [[commands]] and quits. Several commands can be separated by semicolons.
|
|
| {{MonoCode|-c"list;info"}}
|- valign="top"
| {{MonoCode|-C&lt;file&gt;}}| Runs all [[commands]] from the specified text file and quits. Empty lines and lines starting with the number sign {{MonoCode|#}} are skipped.
|
| {{MonoCode|-C commands.txt}}
|- valign="top"
| {{MonoCode|-d}}
| Turns on the debugging mode. Debugging information is output to ''standard error''.
| <code>[[Options#DEBUG|DEBUG]]</code>
|
|- valign="top"
| {{MonoCode|-i&lt;input&gt;}}
| Opens a database or XML document specified by the argument. The opened input may be further processed by an XQuery expression.
|
|
| {{MonoCode|-iitems.xml -q"//item"}}
|- valign="top"
| {{MonoCode|-L}}
| Add trailing newline after query result. Useful for batch processing or pipelining on Unix systems.
|
|
|- valign="top"
| {{MonoCode|-n&lt;name&gt;}}
| Specifies the host name on which the server is running.
| <code>[[Options#HOST|HOST]]</code>
| {{MonoCode|localhost}}| {{MonoCode|-nserver.basex.org}}
|- valign="top"
| {{MonoCode|-o&lt;file&gt;}}
| All command and query output is written to the specified file.
|
|
|- valign="top"
| {{MonoCode|-p&lt;num&gt;}}
| Specifies the port on which the server is running.
| <code>[[Options#PORT|PORT]]</code>
| {{MonoCode|1984}}| {{MonoCode|-p9999}}
|- valign="top"
| {{MonoCode|-P&lt;pass&gt;}}
| Specifies the user password. If this flag is omitted, the password will be requested on command line. ''Warning'': when the password is specified via this flag, it may be visible to others.
|
|
| {{MonoCode|-Uadmin -Padmin}}
|- valign="top"
| {{MonoCode|-q&lt;expr&gt;}}
| Executes the specified string as XQuery expression.
|
|
| {{MonoCode|-q"doc('input')//head"}}
|- valign="top"
| {{MonoCode|-s&lt;pars&gt;}}
| Specifies parameters for serializing XQuery results; see [[Serialization]] for more details. This flag may be specified multiple times. Key and values are separated by the equality sign (<code>=</code>).
| <code>[[Options#SERIALIZER|SERIALIZER]]</code>
| <code>-smethod=text</code>
|- valign="top"
| {{MonoCode|-U&lt;name&gt;}}
| Specifies the user name. If this flag is omitted, the user name will be requested on command line.
|
|
| {{MonoCode|-Uadmin}}
|- valign="top"
| {{MonoCode|-v}}
| Prints process and timing information to the ''standard output''.
|
|
|- valign="top"
| {{MonoCode|-V}}
| Prints detailed query information to the ''standard output'', including details on the compilation and profiling steps.
| <code>[[Options#QUERYINFO|QUERYINFO]]</code>
|
|- valign="top"
| {{MonoCode|-w}}
| By default, whitespaces around text nodes are chopped when a database is created. This flag can be specified to preserve whitespaces.
| <code>[[Options#CHOP|CHOP]]</code>
|
|- valign="top"
| {{MonoCode|-x}}
| This flags turn on the output of the query execution plan, formatted in [[Options#XMLPLAN|XML]].
| <code>[[Options#XMLPLAN|XMLPLAN]]</code>
|
|- valign="top"
| {{MonoCode|-z}}
| Skips the serialization of XQuery results. This flag is useful if the query is profiled or analyzed.
| <code>[[Options#SERIALIZE|SERIALIZE]]</code>
|}
Multiple query files and {{MonoCode|-c}}/{{MonoCode|-i}}/{{MonoCode|-q}} flags can be specified. All other options will be set before any other operation takes place. The specified inputs, query files, queries and commands will be subsequently evaluated after that in the given order. The standard input can be parsed by specifying a single dash ({{mono|-}}) as argument.
=BaseX HTTP Server=
2011-01-02 03:04:05.800:INFO::Started SocketConnector@0.0.0.0:8984</pre>
Available command-line flags can be listed with {{MonoCode|-h}}:
<pre>
$ basexhttp -h
! width='145' | Examples
|- valign="top"
| {{MonoCode|stop}}| Stops a running HTTP server. By default, the database server will be stopped as well, unless one of the flags {{MonoCode|-c}} or {{MonoCode|-l}} is specified.
|
|
|
|- valign="top"
| {{MonoCode|-c}}
| Starts the server in ''client mode'', and sends all commands to a database server instance.
|
|
|- valign="top"
| {{MonoCode|-d}}
| Turns on the debugging mode. Debugging information is output to ''standard error''.
| <code>[[Options#DEBUG|DEBUG]]</code>
|
|- valign="top"
| {{MonoCode|-e&lt;num&gt;}}
| Specifies the port on which the server will send events to clients.
| <code>[[Options#EVENTPORT|EVENTPORT]]</code>
| {{MonoCode|1985}}| {{MonoCode|-e9998}}
|- valign="top"
| {{MonoCode|-h&lt;num&gt;}}
| Specifies the port on which the HTTP server will be addressable. This port is e.g. specified in the HTTP URLs.
| <code>[[Options#HTTPPORT|HTTPPORT]]</code>
| {{MonoCode|8984}}| {{MonoCode|-h9999}}
|- valign="top"
| {{MonoCode|-l}}
| Starts the server in ''local mode'', and executes all commands in the embedded database context.
|
|
|- valign="top"
| {{MonoCode|-n&lt;name&gt;}}
| Specifies the host name on which the server is running.
| <code>[[Options#HOST|HOST]]</code>
| {{MonoCode|localhost}}| {{MonoCode|-nserver.basex.org}}
|- valign="top"
| {{MonoCode|-p&lt;num&gt;}}
| Specifies the port on which the BaseX Server will be addressable.
| <code>[[Options#SERVERPORT|SERVERPORT]]</code>
| {{MonoCode|1984}}| {{MonoCode|-p9998}}
|- valign="top"
| {{MonoCode|-P&lt;pass&gt;}}
| Specifies the user password, which will be used by the HTTP services to open a new session. If this flag is omitted, the password will be requested on command line. ''Warning'': when the password is specified on command-line, it may be visible to others.
|
| {{MonoCode|admin}}| {{MonoCode|-Uadmin -Padmin}}
|- valign="top"
| {{MonoCode|-R}}
| Deactivates the [[REST]] service.
|
|
|- valign="top"
| {{MonoCode|-s&lt;num&gt;}}
| Specifies the port that will be used to stop the HTTP server.
| <code>[[Options#STOPPORT|STOPPORT]]</code>
|
|- valign="top"
| {{MonoCode|-S}}
| Starts the server as service (i.e., in the background).
|
|
|- valign="top"
| {{MonoCode|-U&lt;name&gt;}}
| Specifies the user name, which will be used by the HTTP services for opening a new session. If this flag is omitted, the password will be requested on command line.
|
| {{MonoCode|admin}}| {{MonoCode|-Uadmin}}
|- valign="top"
| {{MonoCode|-W}}
| Deactivates the [[WebDAV]] service.
|
|
|- valign="top"
| {{MonoCode|-X}}
| Deactivates the [[RESTXQ]] service. {{Mark|Since Version 7.2}}
|
|
|- valign="top"
| {{MonoCode|-z}}
| Does not generate any [[Logging|log files]].
|
Some options can also be triggered by setting the following system properties:
* {{MonoCode|org.basex.user}}: user name for opening new sessions* {{MonoCode|org.basex.password}}: user password for opening new sessions* {{MonoCode|org.basex.mode}}: by default, the HTTP server also starts an instance of the database server. If the mode is set to {{MonoCode|local}}, an embedded database context is used for executing commands. If the mode is set to {{MonoCode|client}}, all commands are sent to an existing database server instance.* {{MonoCode|org.basex.path}}: path to the BaseX [[Configuration|Home Directory]]
=Changelog=
===Version 7.1.1===
* Added: Options {{MonoCode|-C}} and {{MonoCode|-L}} in standalone and client mode
===Version 7.1===
* Multiple query files and {{MonoCode|-c}}/{{MonoCode|-i}}/{{MonoCode|-q}} flags can be specified.
[[Category:Beginner]]
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu