Changes

Jump to navigation Jump to search
547 bytes removed ,  13:19, 24 May 2018
no edit summary
It gives more details on the command-line options of all BaseX [[Startup]] modes.
Options can be specified multiple times. All Please note that all options are will be evaluated in the given order (in earlier versions, the sequential evaluation was limited to the specified inputs, query files, queries and commands, while all other options were initially set). The standard input can be parsed by specifying a single dash ({{Code|-}}) as argument. =Standalone=
=BaseX Standalone=
;Launch the console mode:
<pre>
-i<input> Open XML file or database
-I<input> Assign input string to context
-L Append newlines to query results
-o<output> Write output to file
-q<expr> Execute XQuery expression
</pre>
The meaning of all flags is 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 escaping some characters might be necessary, depending on your Operating System.
{| class="wikitable"
| {{Code|[input]}}
|Evaluates the specified input:
* The input string may point to an existing file. If the file suffix is {{Code|.bxs}}, the file content contents will be evaluated as [[Commands#Basics|Command Script]]; otherwise, it will be evaluated as XQuery expression.
* Otherwise, the input string itself is evaluated as XQuery expression.
|
| <code>[[Options#BINDINGS|BINDINGS]]</code>
|
|• <code>-b$vbv=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 or file reference or URL, its content this file will be executed instead. Empty lines and lines starting with the number sign {{Codeevaluated as [[Commands#Command_Scripts|#}} will be ignoredCommand Script]].
|
|
|- valign="top"
| {{Code|-i&lt;input&gt;}}
| Opens an XML file or database specified by the argument. The opened input can then be processed by a command or XQuery expression.
|
|
|- valign="top"
| {{Code|-I&lt;input&gt;}}
| Assigns an input string as item of type {{Code|xs:untypedAtomic}} to the query context. {{Mark|Introduced with Version 8.1}}
|
|
| {{Code|-I "Hello Universe" -q "."}}
|- valign="top"
| {{Code|-L}}
| Separates returned query items by newlines (instead of spaces) and appends a newline to the end of a result.
|
|
|
|- valign="top"
| {{Code|-o&lt;file&gt;}}
|}
=BaseX Server= 
;Launch the server
<pre>
$ basexserver -h
BaseX [Server]
Usage: basexserver [-cdeinpSzcdinpSz] [stop] stop Stop running server -c<cmdsinput> Execute initial database commandsfrom file or string -d Activate debugging mode -e<port> Set event port -n<name> Set host the server is bound to -p<port> Set server port -S Start as service -z Suppress logging
</pre>
|- valign="top"
| {{Code|stop}}
| Stops an existing a local database server instance and quits.
|
|
|- valign="top"
| {{Code|-c&lt;cmd&gt;}}
| Launches database Executes [[Commands]]:* Several commands before in the server itself is started. Several commands input can be separated by semicolons ({{Code|;}}).* If the specified input is a valid URL or file reference, this file will be evaluated as [[Commands#Command_Scripts|Command Script]].
|
|
| <code>false</code>
|
|- valign="top"
| {{Code|-e&lt;num&gt;}}
| Specifies the port on which the server will send events to clients.
| <code>[[Options#EVENTPORT|EVENTPORT]]</code>
| {{Code|1985}}
| {{Code|-e9998}}
|- valign="top"
| {{Code|-n&lt;name&gt;}}
|- valign="top"
| {{Code|-S}}
| Starts the server as service (i.e., in the background). Use [[YAJSW]], or start BaseX as an ordinary background process, to get more options.
|
|
Multiple {{Code|-c}} and {{Code|-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 ({{Code|-}}) as argument.
=BaseX Client=
;Launch the console mode communicating with the server
-i<input> Open XML file or database
-I<input> Assign input string to context
-L Append newlines to query results
-n<name> Set server (host) name
-o<output> Write output to file
| {{Code|[input]}}
|Evaluates the specified input:
* The input string may point to an existing file. If the file suffix is {{Code|.bxs}}, the file content contents will be evaluated as [[Commands#Basics|Command Script]]; otherwise, it will be evaluated as XQuery expression.
* Otherwise, the input string itself is evaluated as XQuery expression.
|
|- valign="top"
| {{Code|-i&lt;input&gt;}}
| Opens an XML file or database specified by the argument. The opened input can then be processed by a command or XQuery expression.
|
|
|- valign="top"
| {{Code|-I&lt;input&gt;}}
| Assigns an input string as item of type {{Code|xs:untypedAtomic}} to the query context. {{Mark|Introduced with Version 8.1}}
|
|
| {{Code|-I "Hello Universe" -q "."}}
|- valign="top"
| {{Code|-L}}
| Separates returned query items by newlines (instead of spaces) and appends a newline to the end of a result.
|
|
|- valign="top"
| {{Code|-n&lt;name&gt;}}
|}
=BaseX HTTP Server=
;Launch the HTTP server:
$ basexhttp -h
BaseX [HTTP]
Usage: basexhttp [-dehlnpPRUWzdhlnpPRUWz] [stop] stop Stop running server -c<input> Execute commands from file or string -d Activate debugging mode -eh<port> Set event port -h<port> Set port of HTTP server -l Start in local mode -n<name> Set host name of database server -p<port> Set port of database server -P<pass> Specify user password -s<port> Specify port to stop HTTP server -S Start as service -U<name> Specify user name -z Suppress logging
</pre>
|- valign="top"
| {{Code|stop}}
| Stops a running local HTTP serverand quits. By default, the The database server will be stopped as well, unless {{Code|-l}} has been is specified.
| <code>pom.xml</code>
|
|
|- valign="top"
| {{Code|-c&lt;cmd&gt;}}
| Executes [[Commands]]:
* Several commands in the input can be separated by semicolons ({{Code|;}}).
* If the specified input is a valid URL or file reference, this file will be evaluated as [[Commands#Command_Scripts|Command Script]].
|
|
| {{Code|-c"open database"}}
|- valign="top"
| {{Code|-d}}
|
|
|- valign="top"
| {{Code|-e&lt;num&gt;}}
| Specifies the port on which the server will send events to clients.
| <code>[[Options#EVENTPORT|EVENTPORT]]</code>
| {{Code|1985}}
| {{Code|-e9998}}
|- valign="top"
| {{Code|-h&lt;num&gt;}}
| {{Code|1984}}
| {{Code|-p9998}}
|- valign="top"
| {{Code|-P&lt;pass&gt;}}
| Specifies a user password, which will be used by the HTTP services to open a new session. If this flag is omitted, and if {{Code|-U}} was specified, 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|PASSWORD]]</code>
|
| {{Code|-Uadmin -Padmin}}
|- valign="top"
| {{Code|-s&lt;num&gt;}}
|- valign="top"
| {{Code|-S}}
| Starts the server as service (i.e., in the background). Use [[YAJSW]], or start BaseX as an ordinary background process, to get more options.
|
|
|}
=BaseX GUI=
;Launch the GUI:
<pre>
=Changelog=
 
;Version 9.0
 
* Added: BaseXHTTP, command-line option {{Code|-c}}.
* Updated: BaseXHTTP, command-line option {{Code|-c}}, additionally accepts valid URLs and file references.
 
;Version 8.2
 
* Removed: Event ports, {{Code|-e}}.
;Version 8.1
* Added: Bind input strings to the query context with {{Code|-I}}.
 
;Version 8.0
 
* Removed: Command-line option <code>-L</code> (results will now be automatically separated by newlines).
;Version 7.9
* Updated: Multiple query files and {{Code|-c}}/{{Code|-i}}/{{Code|-q}} flags can be specified.
 
[[Category:Beginner]]
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu