fn:adjust-date-to-timezone($a as xs:date?) xs:date?
Adjusts an xs:date value to the implicit timezone of the current locale.
adjust-date-to-timezone($a as xs:date?, $b as xdt:dayTimeDuration?) xs:date?
Adjusts an xs:date value to a specific timezone, or to no timezone at all. If $b is the empty sequence, returns an xs:date without a timezone.
fn:adjust-dateTime-to-timezone($a as xs:dateTime?) xs:dateTime?
Adjusts an xs:dateTime value to the implicit timezone of the current locale.
adjust-dateTime-to-timezone($a as xs:dateTime?, $b as xdt:dayTimeDuration?) xs:dateTime?
Adjusts an xs:dateTime value to a specific timezone, or to no timezone at all. If $b is the empty sequence, returns an xs:dateTime without a timezone.
fn:adjust-time-to-timezone($a as xs:time?) xs:time?
Adjusts an xs:time value to the implicit timezone of the current locale.
adjust-time-to-timezone($a as xs:time?, $b as xdt:dayTimeDuration?) xs:time?
Adjusts an xs:time value to a specific timezone, or to no timezone at all. If $b is the empty sequence, returns an xs:time without a timezone.
fn:base-uri() xs:anyURI?
This version of the function returns the value of the base-uri property from the static context. If the base-uri property is undefined, the empty sequence is returned.
base-uri($a as node?) xs:anyURI?
Returns the value of the base-uri property for $a. If $a is the empty sequence, the empty sequence is returned.
fn:contains($a as xs:string?, $b as xs:string?) xs:boolean
Returns an xs:boolean indicating whether or not the value of $arg1 contains (at the beginning, at the end, or anywhere within) at least one sequence of collation units that provides a minimal match to the collation units in the value of $arg2, according to the default collation.
contains($a as xs:string?, $b as xs:string?, $c as xs:string) xs:boolean
Returns an xs:boolean indicating whether or not the value of $arg1 contains (at the beginning, at the end, or anywhere within) at least one sequence of collation units that provides a minimal match to the collation units in the value of $arg2, according to the collation that is specified in $arg3.
fn:ends-with($a as xs:string?, $b as xs:string?) xs:boolean
Returns true if the string value of $b is a suffix of the string value of $a, false otherwise. If either $a or $b is the empty sequence, the empty sequence is returned.
ends-with($a as xs:string?, $b as xs:string?, $c as xs:string) xs:boolean?
Returns true if the string value of $b is a suffix of the string value of $a using collation $c, false otherwise. If either $a or $b is the empty sequence, the empty sequence is returned.
fn:error() empty()
Indicates that an irrecoverable error has occurred. The script will terminate immediately with an exception.
error($a as xs:QName) empty()
Indicates that an irrecoverable error has occurred. The script will terminate immediately with an exception.
error($a as xs:QName?, $b as xs:string) empty()
Indicates that an irrecoverable error has occurred. The script will terminate immediately with an exception.
error($a as xs:QName?, $b as xs:string, $c as item*) empty()
Indicates that an irrecoverable error has occurred. The script will terminate immediately with an exception.
fn:escape-uri($a as xs:string?, $b as xs:boolean) xs:string
This function applies the URI escaping rules defined in section 2 of [RFC 2396] as amended by [RFC 2732], with one exception, to the string supplied as $a, which typically represents all or part of a URI. The effect of the function is to escape a set of identified characters in the string. Each such character is replaced in the string by an escape sequence, which is formed by encoding the character as a sequence of octets in UTF-8, and then representing each of these octets in the form %HH, where HH is the hexadecimal representation of the octet. $b indicates whether to escape reserved characters.
fn:id($a as xs:string*) element*
Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $a. If none is matching or $a is the empty sequence, returns the empty sequence.
id($a as xs:string*, $b as node) element*
Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $a. If none is matching or $a is the empty sequence, returns the empty sequence.
fn:index-of($a as xdt:anyAtomicType*, $b as xdt:anyAtomicType) xs:integer?
Returns a sequence of positive integers giving the positions within the sequence $a of items that are equal to $b. If the value of $a is the empty sequence, or if no item in $a matches $b, then the empty sequence is returned.
index-of($a as xdt:anyAtomicType*, $b as xdt:anyAtomicType, $c as xs:string) xs:integer?
Returns a sequence of positive integers giving the positions within the sequence $a of items that are equal to $b. If the value of $a is the empty sequence, or if no item in $a matches $b, then the empty sequence is returned. Values are compared according to the collation specified in $c.
fn:local-name() xs:string
Returns the local part of the name of the context item as an xs:string that will either be the zero-length string or will have the lexical form of an xs:NCName.
local-name($a as node?) xs:string
Returns the local part of the name of the value of $a as an xs:string that will either be the zero-length string or will have the lexical form of an xs:NCName.
fn:matches($a as xs:string*, $b as xs:string) xs:boolean
Returns true if the first argument string matches the regular expression specified by the second argument. This function is optimized internally if a range index of type xs:string is defined on the nodes passed to the first argument. Please note that - in contrast - with the specification - this method allows zero or more items for the string argument.
matches($a as xs:string*, $b as xs:string, $c as xs:string) xs:boolean
Returns true if the first argument string matches the regular expression specified by the second argument. This function is optimized internally if a range index of type xs:string is defined on the nodes passed to the first argument. Please note that - in contrast - with the specification - this method allows zero or more items for the string argument.
fn:max($a as xdt:anyAtomicType*) xdt:anyAtomicType?
Selects an item from the input sequence $a whose value is greater than or equal to the value of every other item in the input sequence.
max($a as xdt:anyAtomicType*, $b as xs:string) xdt:anyAtomicType?
Selects an item from the input sequence $a whose value is greater than or equal to the value of every other item in the input sequence. The collation URI specified in $b will be used for string comparisons.
fn:min($a as xdt:anyAtomicType*) xdt:anyAtomicType?
Selects an item from the input sequence $a whose value is less than or equal to the value of every other item in the input sequence.
min($a as xdt:anyAtomicType*, $b as xs:string) xdt:anyAtomicType?
Selects an item from the input sequence $a whose value is less than or equal to the value of every other item in the input sequence. The collation specified in $b is used for string comparisons.
fn:name() xs:string?
Returns the name of a node, as an xs:string that is either the zero-length string, or has the lexical form of an xs:QName
name($a as node?) xs:string?
Returns the name of a node, as an xs:string that is either the zero-length string, or has the lexical form of an xs:QName
fn:namespace-uri(, ...) xs:anyURI
Returns the namespace URI of the xs:QName of the context item. If the context item is in no namespace or is neither an element nor attribute node, returns the xs:anyURI eqvivalent to the zero-length string. Raises an error if the context item is undefined or not a node.
namespace-uri($a as node?, ...) xs:anyURI
Returns the namespace URI of the xs:QName value of $aIf $a is in no namespace or is neither an element nor attribute node, returns the xs:anyURI eqvivalent to the zero-length string. Raises an error if the context item is undefined or not a node.
fn:namespace-uri-for-prefix($a as xs:string?, $b as element) xs:anyURI?
Returns the namespace URI of one of the in-scope namespaces for $b, identified by its namespace prefix. If $b has an in-scope namespace whose namespace prefix is equal to $a, it returns the namespace URI of that namespace. If $b is the zero-length string or the empty sequence, it returns the namespace URI of the default (unnamed) namespace. Otherwise, it returns the empty sequence.
fn:normalize-space() xs:string
Returns the value of the context item with whitespace normalized by stripping leading and trailing whitespace and replacing sequences of one or more whitespace character with a single space.
normalize-space($a as xs:string?) xs:string
Returns the value of $a with whitespace normalized by stripping leading and trailing whitespace and replacing sequences of one or more whitespace character with a single space.If the value of $a is the empty sequence, returns the zero-length string. If no argument is supplied $a defaults to the string value of the context item.
fn:number() xs:double
Returns the value of the context item as a xs:double. If the context item cannot be converted to a xs:double, NaN is returned.
number($a as xdt:anyAtomicType?) xs:double
Returns the value of $a as a xs:double. If the value of $a is the empty sequence or cannot be converted to a xs:double, NaN is returned.
fn:replace($a as xs:string?, $b as xs:string, $c as xs:string) xs:string?
The function returns the xs:string that is obtained by replacing all non-overlapping substrings of $a that match the given pattern $b with an occurrence of the $c replacement string.
replace($a as xs:string?, $b as xs:string, $c as xs:string, $d as xs:string) xs:string?
The function returns the xs:string that is obtained by replacing all non-overlapping substrings of $a that match the given pattern $b with an occurrence of the $c replacement string.
fn:round-half-to-even($a as number?) number
The first signature of this function produces the same result as the second signature with $b=0.
round-half-to-even($a as number?, $b as number?) number
The value returned is the nearest (that is, numerically closest) numeric to $a that is a multiple of ten to the power of minus $b. If two such values are equally near (e.g. if the fractional part in $a is exactly .500...), returns the one whose least significant digit is even.
fn:starts-with($a as xs:string?, $b as xs:string?) xs:boolean?
Returns true if the string value of $b is a prefix of the string value of $a, false otherwise. If either $a or $b is the empty sequence, the empty sequence is returned.
starts-with($a as xs:string?, $b as xs:string?, $c as xs:string) xs:boolean?
Returns true if the string value of $b is a prefix of the string value of $a using collation $c, false otherwise. If either $a or $b is the empty sequence, the empty sequence is returned.
fn:string() xs:string
Returns the value of the context item as xs:string. If the context item is undefined, an error is raised.
string($a as item?) xs:string
Returns the value of $a as xs:string. If the value of $ is the empty sequence, the zero-length string is returned. If the context item of $a is undefined, an error is raised.
fn:subsequence($a as item*, $b as xs:double) item*
Returns a subsequence of the values in the first argument sequence, starting at the position indicated by the value of the second argument and including the number of items indicated by the value of the optional thirdargument. If the third argument is missing, all items up to the end of the sequence are included.
subsequence($a as item*, $b as xs:double, $c as xs:double) item*
Returns a subsequence of the values in the first argument sequence, starting at the position indicated by the value of the second argument and including the number of items indicated by the value of the optional thirdargument. If the third argument is missing, all items up to the end of the sequence are included.
fn:substring($a as xs:string?, $b as xs:double) xs:string?
Returns the portion of the value of $a beginning at the position indicated by the value of $b and continuing to the end of $a. The characters returned do not extend beyond the end of $a. If $b is zero or negative, only those characters in positions greater than zero are returned. If the value of $a is the empty sequence, the zero-length string is returned.
substring($a as xs:string?, $b as xs:double, $c as xs:double) xs:string?
Returns the portion of the value of $a beginning at the position indicated by the value of $b and continuing for the number of characters indicated by the value of $c. The characters returned do not extend beyond the end of $a. If $b is zero or negative, only those characters in positions greater than zero are returned. If the value of $a is the empty sequence, the zero-length string is returned.
fn:substring-after($a as xs:string?, $b as xs:string?) xs:string?
Returns the substring of the value of $a that follows the first occurrence of a sequence of the value of $b. If the value of $a or $b is the empty sequence it is interpreted as the zero-length string. If the value of $b is the zero-length string, the zero-length string is returned. If the value of $a does not contain a string that is equal to the value of $b, the zero-length string is returned.
substring-after($a as xs:string?, $b as xs:string?, $c as xs:string) xs:string?
Returns the substring of the value of $a that follows the first occurrence of a sequence of the value of $b in the collation $c. If the value of $a or $b is the empty sequence it is interpreted as the zero-length string. If the value of $b is the zero-length string, the zero-length string is returned. If the value of $a does not contain a string that is equal to the value of $b, the zero-length string is returned.
fn:substring-before($a as xs:string?, $b as xs:string?) xs:string?
Returns the substring of the value of $a that precedes the first occurrence of a sequence of the value of $b. If the value of $a or $b is the empty sequence it is interpreted as the zero-length string. If the value of $b is the zero-length string, the zero-length string is returned. If the value of $a does not contain a string that is equal to the value of $b, the zero-length string is returned.
substring-before($a as xs:string?, $b as xs:string?, $c as xs:string) xs:string?
Returns the substring of the value of $a that precedes the first occurrence of a sequence of the value of $b in the collation $c. If the value of $a or $b is the empty sequence it is interpreted as the zero-length string. If the value of $b is the zero-length string, the zero-length string is returned. If the value of $a does not contain a string that is equal to the value of $b, the zero-length string is returned.
fn:sum($a as xdt:anyAtomicType*) xdt:anyAtomicType
Returns a value obtained by adding together the values in $a. If the single-argument form of the function is used, then the value returned for an empty sequence is the xs:double value 0.0e0.
sum($a as xdt:anyAtomicType*, $b as xdt:anyAtomicType?) xdt:anyAtomicType?
Returns a value obtained by adding together the values in $a. If the single-argument form of the function is used, then the value returned for an empty sequence is the xs:double value 0.0e0. If the two-argument form is used, then the value returned for an empty sequence is the value of the $b argument.
fn:tokenize($a as xs:string?, $b as xs:string) xs:string+
This function breaks the input string $a into a sequence of strings, treating any substring that matches pattern $b as a separator. The separators themselves are not returned.
tokenize($a as xs:string?, $b as xs:string, $c as xs:string) xs:string+
This function breaks the input string $a into a sequence of strings, treating any substring that matches pattern $b as a separator. The separators themselves are not returned.
fn:trace($a as item*, $b as xs:string) item*
This function is intended to be used in debugging queries by providing a trace of their execution. The input $a is returned, unchanged, as the result of the function. In addition, the inputs $a, converted to an xs:string, and $b is directed to a trace data set in the eXist log files.
xmldb:authenticate($a as xs:string, $b as xs:string?, $c as xs:string?) xs:boolean
Check if a user is registered as database user. The function simply tries to read the database collection specified in the first parameter $a, using the supplied username in $b and password in $c. It returns true if the attempt succeeds, false otherwise.
xmldb:change-user($a as xs:string, $b as xs:string?, $c as xs:string*, $d as xs:string?) empty()
Change properties of an existing user. Parameters are: username, password, group memberships, home collection.
xmldb:collection($a as xs:string, $b as xs:string, $c as xs:string) object?
Get a reference to a collection. The first argument is either a collection path like '/db/shakespeare/plays' or an XMLDB URI like 'xmldb:exist://localhost:8081//db/shakespeare/plays'. While the function accepts a string argument, this argument must conform to the xs:anyURI type specification. The second argument should specify the name of a valid user, the third is the password. The method returns a Java object type, which can then be used as argument to the create-collection or store functions.
xmldb:copy($a as item, $b as xs:string) empty()
Copy a collection. The collections can be specified either as a simple collection path, an XMLDB URI or a collection object.
xmldb:copy($a as item, $b as xs:string, $c as xs:string) empty()
Copy a resource from the collection specified in $a to collection in $b. The collections can be either specified as a simple collection path, an XMLDB URI or a collection object.
xmldb:create-user($a as xs:string, $b as xs:string, $c as xs:string+, $d as xs:string?) empty()
Create a new user in the database. Arguments are: username, password, group memberships,home collection.
xmldb:created($a as item, $b as xs:string) xs:dateTime
Returns the creation date of a resource in the collection specified by $a. The collection can be passed as a simple collection path, an XMLDB URI or a collection object (obtained from the collection function).
xmldb:created($a as item) xs:dateTime
Returns the creation date of a collection. The collection can be passed as a simple collection path, an XMLDB URI or a collection object (obtained from the collection function).
xmldb:get-group($a as item) xs:string?
Returns the owner group of a collection. The collection can be passed as a simple collection path, an XMLDB URI or a collection object (obtained from the collection function).
xmldb:get-group($a as item, $b as xs:string) xs:string?
Returns the owner group of a resource in the collection specified by $a. The collection can be passed as a simple collection path, an XMLDB URI or a collection object (obtained from the collection function).
xmldb:get-owner($a as item) xs:string?
Returns the owner of a collection. The collection can be passed as a simple collection path, an XMLDB URI or a collection object (obtained from the collection function).
xmldb:get-owner($a as item, $b as xs:string) xs:string?
Returns the owner of the specified resource $b in collection $a. The collection can be passed as a simple collection path, an XMLDB URI or a collection object (obtained from the collection function).
xmldb:get-permissions($a as item) xs:int?
Returns the permissions assigned to the collection. The collection can be specified as a simple collection path, an XMLDB URI or a collection object.
xmldb:get-permissions($a as item, $b as xs:string) xs:int?
Returns the permissions assigned to the resource specified in $b which is a child of the collection $a. The collection can be specified as a simple collection path, an XMLDB URI or a collection object.
xmldb:login($a as xs:string, $b as xs:string?, $c as xs:string?) xs:boolean
Check if a user is registered as database user and change the user identity for the current XQuery script. The function simply tries to read the database collection specified in the first parameter $a, using the supplied username in $b and password in $c. Contrary to the authenticate function,login will set the current user for the xquery script to the authenticated user. It returns true if the attempt succeeds, false otherwise. If called from a HTTP contextthen the login is cached for the lifetime of the HTTP session and may be used for all XQueryscripts in that session.
xmldb:move($a as item, $b as xs:string) empty()
Move a collection $a. The collection can be specified either as a simple collection path, an XMLDB URI or a collection object.
xmldb:move($a as item, $b as xs:string, $c as xs:string) empty()
Move a resource from the collection specified in $a to collection in $b. The collection can be either specified as a simple collection path, an XMLDB URI or a collection object.
xmldb:permissions-to-string($a as xs:integer) xs:string?
Format the resource or collection permissions passed as an integer value into a string. The returned string shows the permissions following the usual Unix conventions, i.e. all permissions set is returned as rwurwurwu, where the first three chars are for user permissions, followed by group and world. 'r' denotes read, 'w' write and 'u' update permissions
xmldb:remove($a as item) empty()
Remove a collection. The collection can be specified either as a simple collection path, an XMLDB URI or a collection object.
xmldb:remove($a as item, $b as xs:string) empty()
Remove a resource from the collection specified in $a. The collection can be either specified as a simple collection path, an XMLDB URI or a collection object.
xmldb:rename($a as item, $b as xs:string) empty()
Rename a collection $a. The collection can be specified either as a simple collection path, an XMLDB URI or a collection object.
xmldb:rename($a as item, $b as xs:string, $c as xs:string) empty()
Rename a resource $b in the collection specified in $a with name in $c. The collection can be either specified as a simple collection path, an XMLDB URI or a collection object.
xmldb:set-collection-permissions($a as xs:string, $b as xs:string, $c as xs:string, $d as xs:integer) empty()
Sets the permissions of the specified collection. $a is the collection, which can be specified as a simple collection path, an XMLDB URI or a collection object. $b specifies the user which will become the owner of the resource, $c the group. The final argument contains the permissions, specified as an xs:integer value. PLEASE REMEMBER that 0755 is 7*64+5*8+5, NOT decimal 755.
xmldb:set-resource-permissions($a as xs:string, $b as xs:string, $c as xs:string, $d as xs:string, $e as xs:integer) empty()
Sets the permissions of the specified resource. $a is the collection, which can be specified as a simple collection path, an XMLDB URI or a collection object. $b denotes the resource tochange. $c specifies the user which will become the owner of the resource, $d the group. The final argument contains the permissions, specified as an xs:integer value. PLEASE REMEMBER that 0755 is 7*64+5*8+5, NOT decimal 755.
xmldb:size($a as item, $b as xs:string) xs:long
Returns the estimated size of a resource (in bytes) in the collection specified by $a. The estimation is based on the number of pages occupied by a resource. If the document is serialized back to a string, it's size may be different, as parts of the structural information are stored in compressed form. The collection can be passed as a simple collection path, an XMLDB URI or a collection object (obtained from the collection function).
xmldb:store($a as item, $b as xs:string?, $c as item) xs:string?
Store a new resource into the database. The first argument denotes the collection where the resource should be stored. The collection can be either specified as a simple collection path, an XMLDB URI, or a collection object as returned by the collection or create-collection functions. The second argument is the name of the new resource. The third argument is either a node, an xs:string, a Java file object or an xs:anyURI. A node will be serialized to SAX. It becomes the root node of the new document. If the argument is of type xs:anyURI, the resource is loaded from that URI. The functions returns the path to the new document as an xs:string or - if the document could not be stored - the empty sequence.
xmldb:store($a as item, $b as xs:string?, $c as item, $d as xs:string) xs:string?
Store a new resource into the database. The first argument denotes the collection where the resource should be stored. The collection can be either specified as a simple collection path, an XMLDB URI, or a collection object as returned by the collection or create-collection functions. The second argument is the name of the new resource. The third argument is either a node, an xs:string, a Java file object or an xs:anyURI. A node will be serialized to SAX. It becomes the root node of the new document. If the argument is of type xs:anyURI, the resource is loaded from that URI. The final argument $d is used to specify a mime-type. If the mime-type is something other than 'text/xml' or 'application/xml', the resource will be stored as a binary resource. The functions returns the path to the new document as an xs:string or - if the document could not be stored - the empty sequence.
xmldb:store-files-from-pattern($a as item, $b as xs:string, $c as xs:string+) xs:string*
Store new resources into the database. Resources are read from the server's file system, using file patterns. The first argument denotes the collection where resources should be stored. The collection can be either specified as a simple collection path, an XMLDB URI, or a collection object as returned by the collection or create-collection functions. The second argument is the directory in the file system wherefrom the files are read.The third argument is the file pattern. File pattern matching is based on code from Apache's Ant, thus following the same conventions. For example: *.xml matches any file ending with .xml in the current directory, **/*.xml matches files in any directory below the current one. The function returns a sequence of all document paths added to the db. These can be directly passed to fn:doc() to retrieve the document.
xmldb:store-files-from-pattern($a as item, $b as xs:string, $c as xs:string+, $d as xs:string) xs:string*
Store new resources into the database. Resources are read from the server's file system, using file patterns. The first argument denotes the collection where resources should be stored. The collection can be either specified as a simple collection path, an XMLDB URI, or a collection object as returned by the collection or create-collection functions. The second argument is the directory in the file system wherefrom the files are read.The third argument is the file pattern. File pattern matching is based on code from Apache's Ant, thus following the same conventions. For example: *.xml matches any file ending with .xml in the current directory, **/*.xml matches files in any directory below the current one. The fourth argument $d is used to specify a mime-type. If the mime-type is something other than 'text/xml' or 'application/xml', the resource will be stored as a binary resource.The function returns a sequence of all document paths added to the db. These can be directly passed to fn:doc() to retrieve the document.
xmldb:store-files-from-pattern($a as item, $b as xs:string, $c as xs:string+, $d as xs:string, $e as xs:boolean) xs:string*
Store new resources into the database. Resources are read from the server's file system, using file patterns. The first argument denotes the collection where resources should be stored. The collection can be either specified as a simple collection path, an XMLDB URI, or a collection object as returned by the collection or create-collection functions. The second argument is the directory in the file system wherefrom the files are read.The third argument is the file pattern. File pattern matching is based on code from Apache's Ant, thus following the same conventions. For example: *.xml matches any file ending with .xml in the current directory, **/*.xml matches files in any directory below the current one. The fourth argument $d is used to specify a mime-type. If the mime-type is something other than 'text/xml' or 'application/xml', the resource will be stored as a binary resource.If the final boolean argument is true(), the directory structure will be kept in the collection, otherwise all the matching resources, including the ones in sub-directories, will be stored in the collection given in the first argument flatly.The function returns a sequence of all document paths added to the db. These can be directly passed to fn:doc() to retrieve the document.
validation:validate($a as xs:string) xs:boolean
Validate document specified by $a. The grammar files are searched inside the database.
validation:validate($a as xs:string, $b as xs:string) xs:boolean
Validate document specified by $a using path $b. $b can point a grammar, a collection containing grammars (usefull for XSD) or a OASIS catalog file.
validation:validate-report($a as xs:string) xs:string*
Validate document specified by $a, return a simple report. The grammar files are searched inside the database.
validation:validate-report($a as xs:string, $b as xs:string) xs:string*
Validate document specified by $a using path $b, return a simple report. $b can point a grammar, a collection containing grammars (usefull for XSD) or a OASIS catalog file.
util:binary-to-string($a as xs:base64Binary?, ...) xs:string?
Returns the contents of a binary resource as an xs:string value. The binary data is transformed into a Java string using the encoding specified in the optional second argument or UTF-8.
util:binary-to-string($a as xs:base64Binary?, $b as xs:string, ...) xs:string?
Returns the contents of a binary resource as an xs:string value. The binary data is transformed into a Java string using the encoding specified in the optional second argument or UTF-8.
util:catch($a as xs:string+, $b as item*, $c as item*) item*
This function corresponds to a try-catch statement in Java. The code block in $b will be put inside a try-catch statement. If an exception is thrown while executing $b, the function checks the name of the exception and calls $c if it matches one of the fully qualified Java class names specified in $a
util:eval($a as item) node*
Dynamically evaluates its string argument as an XPath/XQuery expression. The query is specified via the first argument. If it is of type xs:string, util:eval tries to execute this string as the query. If the first argument is an xs:anyURI, the function will try to load the query from the resource to which the (absolute) URI resolves. If the URI has no scheme, it is assumed that the query is stored in the db and the URI is interpreted as a database path. This is the same as calling util:eval('xmldb:exist:///db/test/test.xq'). The argument expression will inherit the current execution context, i.e. all namespace declarations and variable declarations are visible from within the inner expression. It will return an empty sequence if you pass a whitespace string.
util:eval($a as item, $b as xs:boolean) node*
Dynamically evaluates its string argument as an XPath/XQuery expression. The query is specified via the first argument. If it is of type xs:string, util:eval tries to execute this string as the query. If the first argument is an xs:anyURI, the function will try to load the query from the resource to which the URI resolves. If the URI has no scheme, it is assumed that the query is stored in the db and the URI is interpreted as a database path. This is the same as calling util:eval('xmldb:exist:///db/test/test.xq'). The argument expression will inherit the current execution context, i.e. all namespace declarations and variable declarations are visible from within the inner expression. It will return an empty sequence if you pass a whitespace string.
util:eval-inline($a as item*, $b as item) item*
Dynamically evaluates the XPath/XQuery expression specified in $b within the current instance of the query engine. The query is specified via the first argument. If it is of type xs:string, util:eval tries to execute this string as the query. If the first argument is an xs:anyURI, the function will try to load the query from the resource to which the URI resolves. If the URI has no scheme, it is assumed that the query is stored in the db and the URI is interpreted as a database path. This is the same as calling util:eval('xmldb:exist:///db/test/test.xq'). The evaluation context is taken from argument $a.
util:eval-inline($a as item*, $b as item, $c as xs:boolean) item*
Dynamically evaluates the XPath/XQuery expression specified in $b within the current instance of the query engine. The query is specified via the first argument. If it is of type xs:string, util:eval tries to execute this string as the query. If the first argument is an xs:anyURI, the function will try to load the query from the resource to which the URI resolves. If the URI has no scheme, it is assumed that the query is stored in the db and the URI is interpreted as a database path. This is the same as calling util:eval('xmldb:exist:///db/test/test.xq'). The evaluation context is taken from argument $a. The third argument, $c, specifies if the compiled query expression should be cached. The cached query will be globally available within the db instance.
util:eval-with-context($a as item, $b as node?, $c as xs:boolean) node*
Dynamically evaluates its string argument as an XPath/XQuery expression. The query is specified via the first argument. If it is of type xs:string, util:eval tries to execute this string as the query. If the first argument is an xs:anyURI, the function will try to load the query from the resource to which the URI resolves. If the URI has no scheme, it is assumed that the query is stored in the db and the URI is interpreted as a database path. This is the same as calling util:eval('xmldb:exist:///db/test/test.xq'). A new execution context will be created before the expression is evaluated. Static context properties can be set via the XML fragment in the second parameter. The XML fragment should have the format: <static-context><variable name="qname">variable value</variable></static-context>.
util:function($a as xs:string, $b as xs:integer) function
Creates a reference to an XQuery function which can later be called from util:call. This allows for higher-order functions to be implemented in XQuery. A higher-order function is a function that takes another function as argument. The first argument represents the name of the function, which should bea valid QName. The second argument is the arity of the function. If nofunction can be found that matches the name and arity, an error is thrown. Please note: due to the special character of util:function, the arguments to this function have to be literals or need to be resolvable at compile time at least.
util:import-module($a as xs:anyURI, $b as xs:string, $c as xs:anyURI) empty()
Dynamically imports an XQuery module into the current context. The namespace URI of the module is specified in argument $a, $b is the prefix that will be assigned to that namespace, $c is the location of the module. The parameters have the same meaning as in an 'import module ...' expression in the query prolog.
util:index-keys($a as node*, $b as xdt:anyAtomicType, $c as function, $d as xs:int) item*
Can be used to query existing range indexes defined on a set of nodes. All index keys defined for the given node set are reported to a callback function. The node set is specified in the first argument. The second argument specifies a start value. Only index keys of the same type but being greater than $b will be reported for non-stringtypes. For string types, only keys starting with the given prefix are reported. The third arguments is a function reference as created by the util:function function. It can be an arbitrary user-defined function, but it should take exactly 2 arguments: 1) the current index key as found in the range index as an atomic value, 2) a sequence containing three int values: a) the overall frequency of the key within the node set, b) the number of distinct documents in the node set the key occurs in, c) the current position of the key in the whole list of keys returned.
util:registered-functions($a as xs:string) xs:string+
Returns a sequence containing the QNames of all functions declared in the module identified by the specified namespace URI. An error is raised if no module is found for the specified URI.
util:registered-functions() xs:string+
Returns a sequence containing the QNames of all functions currently known to the system, including functions in imported and built-in modules.
util:serialize($a as node*, $b as xs:string, $c as xs:string*) xs:boolean?
Writes the node set passed in parameter $a into a file on the file system. The full path to the file is specified in parameter $b. $c contains a sequence of zero or more serialization parameters specified as key=value pairs. The serialization options are the same as those recognized by "declare option exist:serialize". The function does NOT automatically inherit the serialization options of the XQuery it is called from. False is returned if the specified file can not be created or is not writable, true on success. The empty sequence is returned if the argument sequence is empty.
util:serialize($a as node*, $b as xs:string*) xs:string?
Returns the Serialized node set passed in parameter $a. $b contains a sequence of zero or more serialization parameters specified as key=value pairs. The serialization options are the same as those recognized by "declare option exist:serialize". The function does NOT automatically inherit the serialization options of the XQuery it is called from.
util:system-property($a as xs:string) xs:string?
Returns the value of a system property. Similar to the corresponding XSLT function. Predefined properties are: vendor, vendor-url, product-name, product-version, product-build, and all Java system properties.
transform:transform($a as node?, $b as item, $c as node?) node?
Applies an XSL stylesheet to the node tree passed as first argument. The stylesheet is specified in the second argument. This should either be an URI or a node. If it is an URI, it can either point to an external location or to an XSL stored in the db by using the 'xmldb:' scheme. Stylesheets are cached unless they were just created from an XML fragment and not from a complete document. Stylesheet parameters may be passed in the third argument using an XML fragment with the following structure: <parameters><param name="param-name1" value="param-value1"/></parameters>
text:groups($a as xs:string, $b as xs:string) xs:string*
Tries to match the string in $a to the regular expression in $b. Returns an empty sequence if the string does not match, or a sequence whose first item is the entire string, and whose following items are the matched groups.
text:groups($a as xs:string, $b as xs:string, $c as xs:string) xs:string*
Tries to match the string in $a to the regular expression in $b, using the flags specified in $c. Returns an empty sequence if the string does not match, or a sequence whose first item is the entire string, and whose following items are the matched groups.
text:highlight-matches($a as text*, $b as function, $c as item*) node*
Highlight matching strings within text nodes that resulted from a fulltext search. When searching with one of the fulltext operators or functions, eXist keeps track of the fulltext matches within the text. Usually, the serializer will mark those matches by enclosing them into an 'exist:match' element. One can then use an XSLT stylesheet to replace those match elements and highlight matches to the user. However, this is not always possible, so Instead of using an XSLT to post-process the serialized output, the highlight-matches function provides direct access to the matching portions of the text within XQuery. The function takes a sequence of text nodes as first argument $a and a callback function (defined with util:function) as second parameter $b. $c may contain a sequence of additional values that will be passed to the callback functions third parameter. Text nodes without matches will be returned as they are. However, if the text contains a match marker, the matching character sequence is reported to the callback function, and the result of the function call is inserted into the resulting node set where the matching sequence occurred. For example, you can use this to mark all matching terms with a <span class="highlight">abc</span>.
text:index-terms($a as node*, $b as xs:string, $c as function, $d as xs:int) item*
This function can be used to collect some information on the distribution of index terms within a set of nodes. The set of nodes is specified in the first argument $a. The function returns term frequencies for all terms in the index found in descendants of the nodes in $a. The second argument $b specifies a start string. Only terms starting with the specified character sequence are returned. $c is a function reference, which points to a callback function that will be called for every term occurrence. $d defines the maximum number of terms that should be reported. The function reference for $c can be created with the util:function function. It can be an arbitrary user-defined function, but it should take exactly 2 arguments: 1) the current term as found in the index as xs:string, 2) a sequence containing four int values: a) the overall frequency of the term within the node set, b) the number of distinct documents in the node set the term occurs in, c) the current position of the term in the whole list of terms returned, d) the rank of the current term in the whole list of terms returned.
text:kwic-display($a as text*, $b as xs:positiveInteger, $c as function, $d as item*) node*
This function takes a sequence of text nodes in $a, containing matches from a fulltext search. It highlights matching strings within those text nodes in the same way as the text:highlight-matches function. However, only a defined portion of the text surrounding the first match (and maybe following matches) is returned. If the text preceding the first match is larger than the width specified in the second argument $b, it will be truncated to fill no more than (width - keyword-length) / 2 characters. Likewise, the text following the match will be truncated in such a way that the whole string sequence fits into width characters. The third parameter $c is a callback function (defined with util:function). $d may contain an additional sequence of values that will be passed to the last parameter of the callback function. Any matching character sequence is reported to the callback function, and the result of the function call is inserted into the resulting node set where the matching sequence occurred. For example, you can use this to mark all matching terms with a <span class="highlight">abc</span>. The callback function should take 3 or 4 arguments: 1) the text sequence corresponding to the match as xs:string, 2) the text node to which this match belongs, 3) the sequence passed as last argument to kwic-display. If the callback function accepts 4 arguments, the last argument will contain additional information on the match as a sequence of 4 integers: a) the number of the match if there's more than one match in a text node - the first match will be numbered 1; b) the offset of the match into the original text node string; c) the length of the match as reported by the index.
text:kwic-display($a as text*, $b as xs:positiveInteger, $c as function, $d as function, $e as item*) node*
This function takes a sequence of text nodes in $a, containing matches from a fulltext search. It highlights matching strings within those text nodes in the same way as the text:highlight-matches function. However, only a defined portion of the text surrounding the first match (and maybe following matches) is returned. If the text preceding the first match is larger than the width specified in the second argument $b, it will be truncated to fill no more than (width - keyword-length) / 2 characters. Likewise, the text following the match will be truncated in such a way that the whole string sequence fits into width characters. The third parameter $c is a callback function (defined with util:function). $d may contain an additional sequence of values that will be passed to the last parameter of the callback function. Any matching character sequence is reported to the callback function, and the result of the function call is inserted into the resulting node set where the matching sequence occurred. For example, you can use this to mark all matching terms with a <span class="highlight">abc</span>. The callback function should take 3 or 4 arguments: 1) the text sequence corresponding to the match as xs:string, 2) the text node to which this match belongs, 3) the sequence passed as last argument to kwic-display. If the callback function accepts 4 arguments, the last argument will contain additional information on the match as a sequence of 4 integers: a) the number of the match if there's more than one match in a text node - the first match will be numbered 1; b) the offset of the match into the original text node string; c) the length of the match as reported by the index.
text:match-all($a as node*, $b as xs:string+) node*
Tries to match each of the regular expression strings passed in $b against the keywords contained in the fulltext index. The keywords found are then compared to the node set in $a. Every node containing ALL of the keywords is copied to the result sequence. By default, a keyword is considered to match the pattern only if the entire string matches. To change this behaviour, use the 3-argument version of the function and specify flag 's'. With 's' specified, a string matches the pattern if any substring matches, i.e. 'explain.*' will match 'unexplained'.
text:match-all($a as node*, $b as xs:string+, $c as xs:string) node*
Tries to match each of the regular expression strings passed in $b against the keywords contained in the fulltext index. The keywords found are then compared to the node set in $a. Every node containing ALL of the keywords is copied to the result sequence. By default, a keyword is considered to match the pattern only if the entire string matches. To change this behaviour, use the 3-argument version of the function and specify flag 's'. With 's' specified, a string matches the pattern if any substring matches, i.e. 'explain.*' will match 'unexplained'.
text:match-any($a as node*, $b as xs:string+) node*
Tries to match each of the regular expression strings passed in $b against the keywords contained in the fulltext index. The keywords found are then compared to the node set in $a. Every node containing ANY of the keywords is copied to the result sequence. By default, a keyword is considered to match the pattern only if the entire string matches. To change this behaviour, use the 3-argument version of the function and specify flag 's'. With 's' specified, a string matches the pattern if any substring matches, i.e. 'explain.*' will match 'unexplained'.
text:match-any($a as node*, $b as xs:string+, $c as xs:string) node*
Tries to match each of the regular expression strings passed in $b against the keywords contained in the fulltext index. The keywords found are then compared to the node set in $a. Every node containing ANY of the keywords is copied to the result sequence. By default, a keyword is considered to match the pattern only if the entire string matches. To change this behaviour, use the 3-argument version of the function and specify flag 's'. With 's' specified, a string matches the pattern if any substring matches, i.e. 'explain.*' will match 'unexplained'.
system:shutdown($a as xs:string, $b as xs:string) empty()
Shutdown eXist. $a is the username and $b is the password.
system:shutdown($a as xs:string, $b as xs:string, $c as xs:long) empty()
Shutdown eXist. $a is the username, $b is the password and $c is the delay in milliseconds.