Additions:
||-noxmlsh||Do not predeclare the xmlsh namespace for the [[XPathExtension xmlsh:eval]] xpath extension function||
Deletions:
Additions:
||-noxmlsh||Do not predeclare the xmlsh namespace for the [[eval]]function||
Additions:
||-baseuri uri||Specify the base uri for the xquery||
if -baseuri is supplied then the arguement is used as a relative or absolute uri. If relative it is relative to the current directory.
If no -baseuri is supplied, then if -f is supplied the absolute path of the script is used as the base uri, otherwise the current directory
is used as the base uri. The base URI is used for all URI resolution in the xquery, including modules and documents.
if -baseuri is supplied then the arguement is used as a relative or absolute uri. If relative it is relative to the current directory.
If no -baseuri is supplied, then if -f is supplied the absolute path of the script is used as the base uri, otherwise the current directory
is used as the base uri. The base URI is used for all URI resolution in the xquery, including modules and documents.
Additions:
||-b,-bool||Do not output result. Exit with effective boolean value||
if -b is supplied then no output, instead the return value is 0 if the effective boolean value of the result is true otherwise 1.
if -b is supplied then no output, instead the return value is 0 if the effective boolean value of the result is true otherwise 1.
Additions:
||-f,-file xquery-file||read xquery script from file||
||-i,-input context||(depreciated) use context as the source xml document, otherwise stdin if context is an XML expression which is an item then use it directly as the context item.||
||-c,-context context||Use context as a literal context||
||-cf,-context-file file||Use file as the name of an XML file for the context, or "-" for stdin||
||-s,-string||convert every node value in the result to a string||
||-i,-input context||(depreciated) use context as the source xml document, otherwise stdin if context is an XML expression which is an item then use it directly as the context item.||
||-c,-context context||Use context as a literal context||
||-cf,-context-file file||Use file as the name of an XML file for the context, or "-" for stdin||
||-s,-string||convert every node value in the result to a string||
Deletions:
-file xquery-file|| read xquery script from file||
||-i context
-input context||(depreciated) use context as the source xml document, otherwise stdin if context is an XML expression which is an item then use it directly as the context item.||
||-c context
-context context||Use context as a literal context||
||-cf file
-context-file file||Use file as the name of an XML file for the context, or "-" for stdin||
||-s
-string||convert every node value in the result to a string||
Additions:
When using large XQuery expressions consider storing the xquery in a file such as
xquery -f query.xquery
Or using the Block Quotes which makes managing the various quote options in XPath and XQuery easier
xquery -n -q <{{
declare variable $A external ;
declare function local:foo( $a )
{
<node>{ concat("foo",$a,'bar') }</node>
};
local:foo( $A/spam[2] )
}}> -v A <[ <elem><spam>text</spam><spam>text2</spam></elem> ]>
<node>footext2bar</node>
xquery -f query.xquery
Or using the Block Quotes which makes managing the various quote options in XPath and XQuery easier
xquery -n -q <{{
declare variable $A external ;
declare function local:foo( $a )
{
<node>{ concat("foo",$a,'bar') }</node>
};
local:foo( $A/spam[2] )
}}> -v A <[ <elem><spam>text</spam><spam>text2</spam></elem> ]>
<node>footext2bar</node>
Additions:
-string||convert every node value in the result to a string||
Deletions:
Additions:
xquery [ [[SerializationOptions serialization options]] ] [options] [-v var value [var value]]
Evaluates an XQuery expression
====Options====
||-f xquery-file
-file xquery-file|| read xquery script from file||
||-i context
-input context||(depreciated) use context as the source xml document, otherwise stdin if context is an XML expression which is an item then use it directly as the context item.||
||-c context
-context context||Use context as a literal context||
||-cf file
-context-file file||Use file as the name of an XML file for the context, or "-" for stdin||
||-v|| if -v is given then the remaining args are treated as name/value pairs and assigned to xquery external variables||
-i is depreciated. It is a convenience option that does the following
- If context is an atomic value then treat as a filename to be loaded as the context item
- Otherwise treat as the literal context for the context item
-c or -cf are suggested which explicitly indicate if to use the expression literally or as a filename
Evaluates an XQuery expression
====Options====
||-f xquery-file
-file xquery-file|| read xquery script from file||
||-i context
-input context||(depreciated) use context as the source xml document, otherwise stdin if context is an XML expression which is an item then use it directly as the context item.||
||-c context
-context context||Use context as a literal context||
||-cf file
-context-file file||Use file as the name of an XML file for the context, or "-" for stdin||
||-v|| if -v is given then the remaining args are treated as name/value pairs and assigned to xquery external variables||
-i is depreciated. It is a convenience option that does the following
- If context is an atomic value then treat as a filename to be loaded as the context item
- Otherwise treat as the literal context for the context item
-c or -cf are suggested which explicitly indicate if to use the expression literally or as a filename
Deletions:
||-f xquery-file|| read xquery script from file||
||-i context|| use context as the source xml document, otherwise stdin if context is an XML expression which is an item then use it directly as the context item.||
||-v|| if -V is given then the remaining args are treated as name/value pairs and assigned to xquery external variables||
Additions:
xquery [ [[SerializationOptions serialization options]] ] [-f xquery-file] [-v] [-q xquery-expr] [-i input-file] [-n] [-nons] [-ns prefix=uri [-ns prefix=uri ...] [xquery-expr] [var value [var value]] [-s]
||-s
-strring||convert every node value in the result to a string||
If the result (or any node of the result if a sequence) is an Attribute, or if the -s option is specified the it is converted to a string.
Simplified example, you dont need string()
xls | xquery '//file[1]/@name'
||-s
-strring||convert every node value in the result to a string||
If the result (or any node of the result if a sequence) is an Attribute, or if the -s option is specified the it is converted to a string.
Simplified example, you dont need string()
xls | xquery '//file[1]/@name'
Deletions:
No Differences
Additions:
||-i context|| use context as the source xml document, otherwise stdin if context is an XML expression which is an item then use it directly as the context item.||
||-q query|| use argument as xquery-expr||
||-n|| do not use a source context||
||-v|| if -V is given then the remaining args are treated as name/value pairs and assigned to xquery external variables||
||-nons ||Do not import global namespace declarations from the shell environment||
||-q query|| use argument as xquery-expr||
||-n|| do not use a source context||
||-v|| if -V is given then the remaining args are treated as name/value pairs and assigned to xquery external variables||
||-nons ||Do not import global namespace declarations from the shell environment||
Deletions:
if context is an XML expression which is an item then use it directly as the context item.||
||-q query|| use argument as xquery-expr||
||-n|| do not use a source context||
||-v|| if -V is given then the remaining args are treated as name/value pairs and assigned to xquery external variables||
||-nons ||Do not import global namespace declarations from the shell environment||
Additions:
xquery [ [[SerializationOptions serialization options]] ] [-f xquery-file] [-v] [-q xquery-expr] [-i input-file] [-n] [-nons] [-ns prefix=uri [-ns prefix=uri ...] [xquery-expr] [var value [var value]]
||-f xquery-file|| read xquery script from file||
||-i context|| use context as the source xml document, otherwise stdin
if context is an XML expression which is an item then use it directly as the context item.||
||-q query|| use argument as xquery-expr||
||-n|| do not use a source context||
||-v|| if -V is given then the remaining args are treated as name/value pairs and assigned to xquery external variables||
||-nons ||Do not import global namespace declarations from the shell environment||
||-ns prefix=uri|| Add a predeclared namespace declaration||
Supports the standard [ [[SerializationOptions serialization options]] ]
xls | xquery '//file[1]/@name/string()'
Result
Example
xquery -i <[<foo/>] .
Result
echo "<x:a xmlns:x='foo' />" | xquery -nons -ns y=foo /y:a
Result
[[Commands]]
||-f xquery-file|| read xquery script from file||
||-i context|| use context as the source xml document, otherwise stdin
if context is an XML expression which is an item then use it directly as the context item.||
||-q query|| use argument as xquery-expr||
||-n|| do not use a source context||
||-v|| if -V is given then the remaining args are treated as name/value pairs and assigned to xquery external variables||
||-nons ||Do not import global namespace declarations from the shell environment||
||-ns prefix=uri|| Add a predeclared namespace declaration||
Supports the standard [ [[SerializationOptions serialization options]] ]
xls | xquery '//file[1]/@name/string()'
Result
Example
xquery -i <[<foo/>] .
Result
echo "<x:a xmlns:x='foo' />" | xquery -nons -ns y=foo /y:a
Result
[[Commands]]
Deletions:
-f xquery-file read xquery script from file
-i context use context as the source xml document, otherwise stdin
if context is an XML expression which is an item then use it directly as the context item.
-q query use argument as xquery-expr
-n do not use a source context
-v if -V is given then the remaining args are treated as name/value pairs and assigned to xquery external variables
-nons Do not import global namespace declarations from the shell environment
-ns prefix=uri Add a predeclared namespace declaration
-method output-method Changes the default output method for serialzation. Must be one of (xml,html,xhtml,text)
$ xls | xquery '//file[1]/@name/string()'
$ xquery -i <[<foo/>] .
$ echo "<x:a xmlns:x='foo' />" | xquery -nons -ns y=foo /y:a
Additions:
xquery [-f xquery-file] [-v] [-q xquery-expr] [-i input-file] [-n] [-nons] [-ns prefix=uri [-ns prefix=uri ...] [-method method] [xquery-expr] [var value [var value]]
-ns prefix=uri Add a predeclared namespace declaration
-method output-method Changes the default output method for serialzation. Must be one of (xml,html,xhtml,text)
-ns prefix=uri Add a predeclared namespace declaration
-method output-method Changes the default output method for serialzation. Must be one of (xml,html,xhtml,text)
Deletions:
-ns prefix=uri Add a predeclared namespace delcaration
Deletions:
Additions:
[[CommandsInternal]]
Additions:
Namespace example using a renamed prefix for a namespace
$ echo "<x:a xmlns:x='foo' />" | xquery -nons -ns y=foo /y:a
<x:a xmlns:x="foo"/>
$ echo "<x:a xmlns:x='foo' />" | xquery -nons -ns y=foo /y:a
<x:a xmlns:x="foo"/>
Additions:
xquery [-f xquery-file] [-v] [-q xquery-expr] [-i input-file] [-n] [-nons] [-ns prefix=uri [-ns prefix=uri ...]] [xquery-expr] [var value [var value]]
-nons Do not import global namespace declarations from the shell environment
-ns prefix=uri Add a predeclared namespace delcaration
xquery-expr xquery expression
-nons Do not import global namespace declarations from the shell environment
-ns prefix=uri Add a predeclared namespace delcaration
xquery-expr xquery expression
Deletions:
xquery-expr xquery expression
Additions:
If no -q or -f is given then the next argument is treated as the xquery expression/script.
Deletions:
Additions:
xquery [-f xquery-file] [-v] [-q xquery-expr] [-i input-file] [-n] [xquery-expr] [var value [var value]]
-f xquery-file read xquery script from file
if context is an XML expression which is an item then use it directly as the context item.
-f xquery-file read xquery script from file
if context is an XML expression which is an item then use it directly as the context item.
Deletions:
-qf xquery-file read xquery script from file
if context is an XML expression which is an item then use it directly as the context item.
Additions:
xquery [-qf xquery-file] [-v] [-q xquery-expr] [-i input-file] [-n] [xquery-expr] [var value [var value]]
-i context use context as the source xml document, otherwise stdin
if context is an XML expression which is an item then use it directly as the context item.
-v if -V is given then the remaining args are treated as name/value pairs and assigned to xquery external variables
$ xquery -i <[<foo/>] .
<foo/>
-i context use context as the source xml document, otherwise stdin
if context is an XML expression which is an item then use it directly as the context item.
-v if -V is given then the remaining args are treated as name/value pairs and assigned to xquery external variables
$ xquery -i <[<foo/>] .
<foo/>
Deletions:
-i input-file use input-file as the source xml document, otherwise stdin
-V if -V is given then the remaining args are treated as name/value pairs and assigned to xquery external variables
Additions:
xquery [-qf xquery-file] [-V] [-q xquery-expr] [-i input-file] [-n] [xquery-expr] [var value [var value]]
-q query use argument as xquery-expr
-V if -V is given then the remaining args are treated as name/value pairs and assigned to xquery external variables
If no -q or -qf is given then the next argument is treated as the xquery expression/script.
-q query use argument as xquery-expr
-V if -V is given then the remaining args are treated as name/value pairs and assigned to xquery external variables
If no -q or -qf is given then the next argument is treated as the xquery expression/script.
Deletions:
-q query use argument as query
-V var value 1 or more variable/value pairs. Every variable MUST be declared in the xquery script as an external variable.
Additions:
xquery [-qf xquery-file] [-q query] [-i input-file] [-n] [-V var value [var value]] [query]
-qf xquery-file read xquery script from file
-q query use argument as query
-V var value 1 or more variable/value pairs. Every variable MUST be declared in the xquery script as an external variable.
Not all options are compatible. You cannot read both the query and the context from stdin.
If you supply variables then -q must be supplied.
-qf xquery-file read xquery script from file
-q query use argument as query
-V var value 1 or more variable/value pairs. Every variable MUST be declared in the xquery script as an external variable.
Not all options are compatible. You cannot read both the query and the context from stdin.
If you supply variables then -q must be supplied.
Deletions:
-f xquery-file read xquery script from file
var=value 0 or more variable/value pairs. Every variable MUST be declared in the xquery script as an external variable. Values are converted to strings (xs:string).
Additions:
var=value 0 or more variable/value pairs. Every variable MUST be declared in the xquery script as an external variable. Values are converted to strings (xs:string).
Deletions:
Additions:
xquery [-f xquery-file] [-i input-file] [-n] [var=value ...] xquery-expr
var=value 0 or more variable/value pairs. Every variable MUST be declared in the xquery script as an external variable
var=value 0 or more variable/value pairs. Every variable MUST be declared in the xquery script as an external variable
Deletions:
Additions:
======Command xquery======