Changes

Jump to navigation Jump to search
1,246 bytes removed ,  12:53, 8 July 2020
no edit summary
=Standalone=
;Launch The following options are available for the standalone (console) mode:<pre>$ basexBaseX [Standalone[Command-Line Client]]Try "help" to get more information.> _</pre>:
You can list the command-line options available for the standalone mode using {{Code|-h}}:<presyntaxhighlight>
$ basex -h
BaseX [Standalone]
-x Toggle output of query plan
-z Toggle output of query result
</presyntaxhighlight>
The meaning of all options is Further details are listed in the following table. If an equivalent database option exists (which can be specified via the <code>[[Commands#SET|SET]]</code> command), it is listed as well. For the examples to work, it might be necessary to escape some characters, depending on your Operating Systemoperating system.
{| class="wikitable"
| {{Code|-b&lt;args&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].
| <code>[[Options#BINDINGS{{Option|BINDINGS]]</code>}}
|
|• <code>-bv=example "declare variable $v external; $v"</code><br/>• <code>-b{URL}ln=value<br/>"declare namespace ns='URL'; declare variable $ns:ln external; $ns:ln"</code>
|- valign="top"
| {{Code|-c&lt;input&gt;}}
| Executes [[commands]]:* Several commands in the input can be separated by semicolons ({{Code|;}}).* If the specified input is a valid URL URI or file reference, this file will be evaluated as [[Commands#Command_Scripts|Command Script]].
|
|
|• {{Code|-c"list;info"}}<br/>• {{Code|-ccommands.txt}}<br/>• {{Code|-c"<info/>"}}
|- valign="top"
| {{Code|-d}}
| Toggles the debugging mode. Debugging information is output to ''standard error''.
| <code>[[Options#DEBUG{{Option|DEBUG]]</code>}}
| <code>false</code>
|
|- valign="top"
| {{Code|-i&lt;input&gt;}}
| Opens an the specified XML file , directory with XML files, or database specified by the argument. The opened input can then be processed by a command or XQuery expression.
|
|
| {{Code|-r&lt;num&gt;}}
| Specifies how often a specified query will be evaluated.
| <code>[[Options#RUNS{{Option|RUNS]]</code>}}
| <code>1</code>
| {{Code|-V -r10 "1"}}
| {{Code|-R}}
| Specifies if a query will be executed or parsed only.
| <code>[[Options#RUNQUERY{{Option|RUNQUERY]]</code>}}
| <code>true</code>
| {{Code|-V -R "1"}}
| {{Code|-s&lt;args&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{{Option|SERIALIZER]]</code>}}
|
| <code>-smethod=text</code>
| {{Code|-u}}
| Propagates updates on input files back to disk.
| <code>[[Options#WRITEBACK{{Option|WRITEBACK]]</code>}}
| <code>false</code>
|
| {{Code|-V}}
| Prints detailed query information to the ''standard output'', including details on the compilation and profiling steps.
| <code>[[Options#QUERYINFO{{Option|QUERYINFO]]</code>}}
| <code>false</code>
|
| {{Code|-w}}
| Toggles whitespace chopping of XML text nodes. By default, whitespaces will be chopped.
| <code>[[Options#CHOP{{Option|CHOP]]</code>}}
| <code>true</code>
|
|- valign="top"
| {{Code|-x}}
| Toggles the output of the query execution plan, formatted as [[Options#XMLPLAN{{Option|XML]]}}.| <code>[[Options#XMLPLAN{{Option|XMLPLAN]]</code>}}
| <code>false</code>
|
| {{Code|-X}}
| Generates the query plan before or after query compilation. {{Code|-x}} needs to be activated to make the plan visible.
| <code>[[Options#COMPPLAN{{Option|COMPPLAN]]</code>}}
| <code>true</code>
|
| {{Code|-z}}
| Turns the serialization of XQuery results on/off. This flag is useful if the query is profiled or analyzed.
| <code>[[Options#SERIALIZE{{Option|SERIALIZE]]</code>}}
| <code>true</code>
|
=GUI=
;Launch the GUI:
The <code>basexgui</code> command has only one option. You can pass one or more XML and XQuery files as parameters. If an XML file is specified, a database instance is created from this file, or an existing database is opened. XQuery files following options are opened in available for the XQuery editor.standalone [[GUI|Graphical User Interface]]:
<presyntaxhighlight>$ basexgui -hBaseX [GUI]Usage: basexgui [-d] [filefiles] [files] Open specified files -d Enable debugging</presyntaxhighlightYou can pass one or more files as parameters. If an XML document is specified, a database instance can be created from this file. Other files are opened in the editor.
=Server=
;Launch The following options are available for the server<pre>$ basexserverBaseX [[Database Server]Server was started (port]: 1984)</pre>
Available command-line flags can be listed with {{Code|-h}}:<presyntaxhighlight>
$ basexserver -h
BaseX [Server]
-S Start as service
-z Suppress logging
</presyntaxhighlight>
The flags have Details on all options are listed in the following meaning table (equivalent database options are shown in the table as well).For the examples to work escaping some characters , it might be necessary, to escape some characters depending on your Operating Systemoperating system.
{| class="wikitable"
|- valign="top"
| {{Code|-c&lt;input&gt;}}
| Executes [[commands]]:* Several commands in the input can be separated by semicolons ({{Code|;}}).* If the specified input is a valid URL URI or file reference, this file will be evaluated as [[Commands#Command_Scripts|Command Script]].
|
|
|- valign="top"
| {{Code|-d}}
| Turns on the Enables debugging modeoutput. Debugging information is output to ''standard error''.| <code>[[Options#DEBUG{{Option|DEBUG]]</code>}}
| <code>false</code>
|
| {{Code|-n&lt;name&gt;}}
| Specifies the host the server will be bound to.
| <code>[[Options#SERVERHOST{{Option|SERVERHOST]]</code>}}
|
| {{Code|-p127.0.0.1}}
| {{Code|-p&lt;port&gt;}}
| Specifies the port on which the server will be addressable.
| <code>[[Options#SERVERPORT{{Option|SERVERPORT]]</code>}}
| {{Code|1984}}
| {{Code|-p9999}}
| {{Code|-z}}
| Prevents the generation of [[Logging|log files]].
| <code>[[Options#LOG{{Option|LOG]]</code>}}
| <code>true</code>
|
=Client=
;Launch If the console mode communicating with [[Database Server|Database Client]] is executed, the server The user name and password will be requestedon command-line. The default initial user/password combination is '''admin'''/'''admin'''. The following options are available:<pre>$ basexclientUsername: adminPassword: *****BaseX [Client]Try "help" to get more information.&gt; _</pre>
Available command-line flags can be listed with {{Code|-h}}:<presyntaxhighlight>
$ basexclient -h
BaseX [Client]
-x Toggle output of query plan
-z Toggle output of query result
</presyntaxhighlight>
The flags have See the following meaning table for details (equivalent database options are shown in the table as well).For the examples to work escaping some characters , it might be necessary, to escape some characters depending on your Operating Systemoperating system.
{| class="wikitable"
|- valign="top"
| {{Code|-b&lt;args&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 [httphttps://www.w3.org/TR/xquery-30/#id-basics Expanded QName Notation].| <code>[[Options#BINDINGS{{Option|BINDINGS]]</code>}}
|
|• <code>-b$v=example "declare variable $v external; $v"</code><br/>• <code>-b{URL}ln=value<br/>"declare namespace ns='URL'; declare variable $ns:ln external; $ns:ln"</code>
|- valign="top"
| {{Code|-c&lt;input&gt;}}
| Executes [[commands]]:* Several commands in the input can be separated by semicolons ({{Code|;}}).* If the specified input is a valid URI or file reference or URL, its content will be executed instead. Empty lines and lines starting with the number sign {{Code|#}} will be ignored.
|
|
|• {{Code|-c"list;info"}}<br/>• {{Code|-ccommands.txt}}<br/>• {{Code|-c"<info/>"}}
|- valign="top"
| {{Code|-d}}
| Toggles the debugging mode. Debugging information is output to ''standard error''.
| <code>[[Options#DEBUG{{Option|DEBUG]]</code>}}
| <code>false</code>
|
|- valign="top"
| {{Code|-i&lt;input&gt;}}
| Opens an the specified XML file , directory with XML files, or database specified by the argument. The opened input can then be processed by a command or XQuery expression.
|
|
| {{Code|-n&lt;name&gt;}}
| Specifies the host name on which the server is running.
| <code>[[Options#HOST{{Option|HOST]]</code>}}
| {{Code|localhost}}
| {{Code|-nserver.basex.org}}
| {{Code|-p&lt;port&gt;}}
| Specifies the port on which the server is running.
| <code>[[Options#PORT{{Option|PORT]]</code>}}
| {{Code|1984}}
| {{Code|-p9999}}
| {{Code|-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 with this flag, it may get visible to others.
| <code>[[Options#PASSWORD{{Option|PASSWORD]]</code>}}
|
| {{Code|-Uadmin -Padmin}}
| Executes the specified string as XQuery expression.
|
| {{Code|-q"doc('input')//head1+2"}}
|- valign="top"
| {{Code|-r&lt;num&gt;}}
| Specifies how often a specified query will be evaluated.
| <code>[[Options#RUNS{{Option|RUNS]]</code>}}
| <code>1</code>
| {{Code|-V -r10 "1"}}
| {{Code|-R}}
| Specifies if a query will be executed or parsed only.
| <code>[[Options#RUNQUERY{{Option|RUNQUERY]]</code>}}
| <code>true</code>
| {{Code|-V -R "1"}}
| {{Code|-s&lt;args&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{{Option|SERIALIZER]]</code>}}
|
| <code>-smethod=text</code>
| {{Code|-U&lt;name&gt;}}
| Specifies the user name. If this flag is omitted, the user name will be requested on command line.
| <code>[[Options#USER{{Option|USER]]</code>}}
|
| {{Code|-Uadmin}}
| {{Code|-V}}
| Prints detailed query information to the ''standard output'', including details on the compilation and profiling steps.
| <code>[[Options#QUERYINFO{{Option|QUERYINFO]]</code>}}
| <code>false</code>
|
| {{Code|-w}}
| Toggles whitespace chopping of XML text nodes. By default, whitespaces will be chopped.
| <code>[[Options#CHOP{{Option|CHOP]]</code>}}
| <code>chop</code>
|
|- valign="top"
| {{Code|-x}}
| Toggles the output of the query execution plan, formatted as [[Options#XMLPLAN{{Option|XML]]}}.| <code>[[Options#XMLPLAN{{Option|XMLPLAN]]</code>}}
| <code>false</code>
|
| {{Code|-X}}
| Generates the query plan before or after query compilation. {{Code|-x}} needs to be activated to make the plan visible.
| <code>[[Options#COMPPLAN{{Option|COMPPLAN]]</code>}}
| <code>after</code>
|
| {{Code|-z}}
| Turns the serialization of XQuery results on/off. This flag is useful if the query is profiled or analyzed.
| <code>[[Options#SERIALIZE{{Option|SERIALIZE]]</code>}}
| <code>true</code>
|
=HTTP Server=
;Launch The following options are available for the [[Web Application|HTTP server:<pre>$ basexhttpBaseX [Server]Server was started (port: 1984)HTTP Server was started (port]: 8984)</pre>
Available command-line flags can be listed with {{Code|-h}}:<presyntaxhighlight>
$ basexhttp -h
BaseX [HTTP]
-c<input> Execute commands from file or string
-d Enable debugging output
-g Enable GZIP support
-h<port> Set port of HTTP server
-l Start in local mode
-U<name> Specify user name
-z Suppress logging
</presyntaxhighlight>
The flags have meaning of all options is listed in the following meaning table (equivalent database options are shown in the table as well).For the examples to work escaping some characters , it might be necessary, to escape some characters depending on your Operating System.
{| class="wikitable"
|- valign="top"
| {{Code|-c&lt;input&gt;}}
| Executes [[commands]]:* Several commands in the input can be separated by semicolons ({{Code|;}}).* If the specified input is a valid URL URI or file reference, this file will be evaluated as [[Commands#Command_Scripts|Command Script]].
|
|
| {{Code|-c"open database"}}
|- valign="top"
| {{Code|-de}}| Turns on the Enables debugging modeoutput. Debugging information is output to ''standard error''.| <code>[[Options#{{Option|DEBUG}}|||- valign="top"|DEBUG]]</code>{{Code|-g}}| Enables GZIP support in Jetty.| {{Option|GZIP}}
|
|
| {{Code|-l}}
| Starts the server in ''local mode'', and executes all commands in the embedded database context.
| <code>[[Options#HTTPLOCAL{{Option|HTTPLOCAL]]</code>}}
|
|
| {{Code|-n&lt;name&gt;}}
| Specifies the host name on which the server is running.
| <code>[[Options#HOST{{Option|HOST]]</code>}}
| {{Code|localhost}}
| {{Code|-nserver.basex.org}}
| {{Code|-p&lt;port&gt;}}
| Specifies the port on which the database server will be addressable.
| <code>[[Options#SERVERPORT{{Option|SERVERPORT]]</code>}}
| {{Code|1984}}
| {{Code|-p9998}}
| {{Code|-s&lt;port&gt;}}
| Specifies the port that will be used to stop the HTTP server.
| <code>[[Options#STOPPORT{{Option|STOPPORT]]</code> }} or<br/><code>pom.xml</code>
| <code>8985</code>
|
| {{Code|-U&lt;name&gt;}}
| Specifies a user name, which will be used by the HTTP services for opening a new session.
| <code>[[Options#USER{{Option|USER]]</code>}}
|
| {{Code|-Uadmin}}
| {{Code|-z}}
| Prevents the generation of [[Logging|log files]].
| <code>[[Options#LOG{{Option|LOG]]</code>}}
|
|}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu