Revision [1793]

Last edited on 2011-11-14 11:00:17 by DavidLee
Additions:
||-noxmlsh||Do not predeclare the xmlsh namespace for the [[XPathExtension xmlsh:eval]] xpath extension function||
Deletions:
||-noxmlsh||Do not predeclare the xmlsh namespace for the [[eval]]function||


Revision [1792]

Edited on 2011-11-14 10:59:51 by DavidLee
Additions:
||-noxmlsh||Do not predeclare the xmlsh namespace for the [[eval]]function||


Revision [1502]

Edited on 2010-09-09 14:10:01 by DavidLee
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.


Revision [1451]

Edited on 2010-06-04 12:11:05 by DavidLee
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.


Revision [1234]

Edited on 2010-02-15 10:24:30 by DavidLee
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||
Deletions:
||-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||
||-s
-string||convert every node value in the result to a string||


Revision [1175]

Edited on 2010-02-05 15:04:02 by DavidLee
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>


Revision [1070]

Edited on 2009-11-29 10:33:48 by DavidLee
Additions:
-string||convert every node value in the result to a string||
Deletions:
-strring||convert every node value in the result to a string||


Revision [1069]

Edited on 2009-11-29 10:33:34 by DavidLee
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
Deletions:
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]
||-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||


Revision [1061]

Edited on 2009-11-27 03:53:55 by DavidLee
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'
Deletions:
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]]


Revision [953]

Edited on 2009-11-24 18:50:22 by DavidLee

No Differences

Revision [952]

Edited on 2009-11-24 18:50:06 by DavidLee
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||
Deletions:
||-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||


Revision [951]

Edited on 2009-11-24 18:48:56 by DavidLee
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]]
Deletions:
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]]
-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


Revision [873]

Edited on 2009-11-23 06:55:30 by DavidLee
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)
Deletions:
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]]
-ns prefix=uri Add a predeclared namespace delcaration


Revision [787]

Edited on 2009-09-16 08:02:04 by DavidLee
Deletions:
[[CommandsInternal]]


Revision [358]

Edited on 2009-01-03 07:12:53 by DavidLee
Additions:
[[CommandsInternal]]


Revision [304]

Edited on 2008-11-21 10:21:38 by DavidLee
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"/>


Revision [303]

Edited on 2008-11-21 10:20:48 by DavidLee
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
Deletions:
xquery [-f xquery-file] [-v] [-q xquery-expr] [-i input-file] [-n] [xquery-expr] [var value [var value]]
xquery-expr xquery expression


Revision [264]

Edited on 2008-07-15 12:17:22 by DavidLee
Additions:
If no -q or -f is given then the next argument is treated as the xquery expression/script.
Deletions:
If no -q or -qf is given then the next argument is treated as the xquery expression/script.


Revision [263]

Edited on 2008-07-15 12:13:52 by DavidLee
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.
Deletions:
xquery [-qf xquery-file] [-v] [-q xquery-expr] [-i input-file] [-n] [xquery-expr] [var value [var value]]
-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.


Revision [238]

Edited on 2008-07-04 00:43:08 by DavidLee
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/>
Deletions:
xquery [-qf xquery-file] [-V] [-q xquery-expr] [-i input-file] [-n] [xquery-expr] [var value [var value]]
-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


Revision [228]

Edited on 2008-06-12 17:11:13 by DavidLee
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.
Deletions:
xquery [-qf xquery-file] [-q query] [-i input-file] [-n] [-V var value [var value]] [query]
-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.


Revision [149]

Edited on 2008-05-11 16:26:20 by DavidLee
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.
Deletions:
xquery [-f xquery-file] [-i input-file] [-n] [var=value ...] xquery-expr
-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).


Revision [143]

Edited on 2008-04-29 18:53:48 by DavidLee
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:
var=value 0 or more variable/value pairs. Every variable MUST be declared in the xquery script as an external variable


Revision [142]

Edited on 2008-04-29 16:54:30 by DavidLee
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
Deletions:
xquery [-f xquery-file] [-i input-file] [-n] xquery-expr


Revision [129]

Edited on 2008-04-25 19:06:32 by DavidLee
Additions:
======Command xquery======
Deletions:
======Command xpath======


Revision [128]

The oldest known version of this page was created on 2008-04-25 19:04:54 by DavidLee
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki