util:base-to-integer($number as item(), $base as xs:integer) xs:integer
Converts the number $number from base $base to xs:integer.
Returns the xs:integer representation of $number in base $base
util:binary-doc($binary-resource as xs:string?) xs:base64Binary?
Retrieves the binary resource and returns its contents as a value of type xs:base64Binary. An empty sequence is returned if the resource could not be found or $binary-resource was empty.
Returns the binary document
util:binary-doc-available($binary-resource as xs:string?) xs:boolean
Checks if the binary resource identified by $binary-resource is available.
Returns true if the binary document is available
util:binary-to-string($binary-resource 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 the default of UTF-8.
Returns the string containing the encoded binary resource
util:binary-to-string($binary-resource as xs:base64Binary?, $encoding 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 the default of UTF-8.
Returns the string containing the encoded binary resource
util:call($function-reference as function, $parameters as item()*, ...) item()*
Invokes a first-class function reference created by util:function. The function to be called is passed as the first argument. All remaining arguments are forwarded to the called function.
Returns the results from the function called
util:catch($java-classnames as xs:string+, $try-code-blocks as item()*, $catch-code-blocks as item()*) item()*
This function corresponds to a try-catch statement in Java. The code block in $try-code-blocks will be put inside a try-catch statement. If an exception is thrown while executing $try-code-blocks, the function checks the name of the exception and calls $catch-code-blocks if it matches one of the fully qualified Java class names specified in $java-classnames. A value of "*" in $java-classnames will catch all java exceptions
Returns the results from the try-catch
util:collations() xs:string*
Returns a sequence of strings containing all collation locales that might be specified in the '?lang=' parameter of a collation URI.
Returns the sequence of strings containing all collation locales that might be specified in the '?lang=' parameter of a collation URI.
util:collection-name($node-or-path-string as item()?) xs:string?
Returns the name of the collection from a passed node or path string. If the argument is a node, the function returns the name of the collection to which the node's document belongs. If the argument is a string, it is interpreted as path to a resource and the function returns the computed parent collection path for this resource.
Returns the name of the collection.
util:compile($expression as xs:string) xs:string
Dynamically evaluates the XPath/XQuery expression specified in $expression within the current instance of the query engine.
Returns the results of the expression
util:declare-namespace($prefix as xs:string, $namespace-uri as xs:anyURI) empty()
Dynamically declares a namespace/prefix mapping for the current context.
util:declare-option($name as xs:string, $option as xs:string) empty()
Dynamically declares a serialization option as with 'declare option'.
util:deep-copy($item as item()?) item()?
Performs a Deep Clone of the passed in item.
Returns the item clone
util:describe-function($function-name as xs:QName) node()
Describes a built-in function. Returns an element describing the function signature.
Returns the signature of the function
util:disable-profiling() empty()
Disable profiling output within the query.
util:doctype($doctype as xs:string+, ...) node()*
Returns the document nodes of the documents with the given DOCTYPE(s).
Returns the document nodes
util:document-id($node-or-path as item()) xs:int?
Returns the internal integer id of a document. The argument can either be a node or a string path pointing to a resource in the database. If the resource does not exist or the node does not belong to a stored document, the empty sequence is returned.
Returns the ID of the document
util:document-name($node-or-path as item()) xs:string?
Returns the name of a document (excluding the collection path). The argument can either be a node or a string path pointing to a resource in the database. If the resource does not exist or the node does not belong to a stored document, the empty sequence is returned.
Returns the name of the document
util:enable-profiling($verbosity as xs:int) empty()
Enable profiling output within the query. The profiling starts with this function call and will end with a call to 'disable-profiling'. Argument $verbosity specifies the verbosity. All other profiling options can be configured via the 'declare option exist:profiling ...' in the query prolog.
util:eval($expression as item()) node()*
Dynamically evaluates an XPath/XQuery expression.
Returns the results of the evaluated XPath/XQuery expression
util:eval($expression as item(), $cache-flag as xs:boolean) node()*
Dynamically evaluates an XPath/XQuery expression.
Returns the results of the evaluated XPath/XQuery expression
util:eval-inline($inline-context as item()*, $expression as item()) item()*
Dynamically evaluates an XPath/XQuery expression.
Returns the results of the evaluated XPath/XQuery expression
util:eval-with-context($expression as item(), $context as node()?, $cache-flag as xs:boolean) node()*
Dynamically evaluates an XPath/XQuery expression.
Returns the results of the evaluated XPath/XQuery expression
util:eval-with-context($expression as item(), $context as node()?, $cache-flag as xs:boolean, $eval-context-item as item()?) node()*
Dynamically evaluates an XPath/XQuery expression.
Returns the results of the evaluated XPath/XQuery expression
util:exclusive-lock($nodes as node()*, $expression as item()*) item()*
Puts an exclusive lock on the owner documents of all nodes in the first argument $nodes. Then evaluates the expressions in the second argument $expression and releases the acquired locks after their completion.
Returns the results of the evaluated expression(s)
util:eXist-version() xs:string
Returns the version of eXist running this query.
Returns the version string
Deprecated: Moved to system module and renamed to system:get-version.
This function could be removed at anytime during the 1.5 development and will be removed in the 1.6 release.
util:expand($node as node()*) node()*
Creates an in-memory copy of the passed node set, using the specified serialization options. By default, full-text match terms will be tagged with <exist:match> and XIncludes will be expanded.
Returns the results
util:expand($node as node()*, $serialization-parameters as xs:string) node()*
Creates an in-memory copy of the passed node set, using the specified serialization options. By default, full-text match terms will be tagged with <exist:match> and XIncludes will be expanded. Serialization parameters can be set in the second argument, which accepts the same parameters as the exist:serialize option.
Returns the results
util:extract-docs($uri as xs:string) node()?
Returns an XML document which describes the functions available in a given module. The module is identified through its module namespace URI, which is passed as an argument. The function returns a module documentation in XQDoc format.
Returns the xqdocs for the function module
util:file-read($url as item()) xs:string?
Read the contents of a file as a string.
Returns the contents of the file
Deprecated: Moved to the file extension module. See file:read() in the file extension module
This function could be removed at anytime during the 1.5 development and will be removed in the 1.6 release.
util:file-read($url as item(), $encoding as xs:string) xs:string?
Read the contents of a file as a string.
Returns the contents of the file
Deprecated: Moved to the file extension module. See file:read() in the file extension module
This function could be removed at anytime during the 1.5 development and will be removed in the 1.6 release.
util:function($name as xs:QName, $arity 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 (number of parameters) of the function. If no function can be found that matches the name and arity, an error is thrown. Please note: the arguments to this function have to be literals or need to be resolvable at compile time at least.
Returns the reference to the XQuery function
util:get-fragment-between($beginning-node as node()?, $ending-node as node()?, $make-fragment as xs:boolean?) xs:string
Returns an xml fragment or a sequence of nodes between two elements (normally milestone elements). The $beginning-node represents the first node/milestone element, $ending-node, the second one. The third argument, $make-fragment, is a boolean value for the path completion. If it is set to true() the result sequence is wrapped into a parent element node. Example call of the function for getting the fragment between two TEI page break element nodes: let $fragment := util:get-fragment-between(//pb[1], //pb[2], true())
Returns the string containing the fragments between the two node/milestone elements.
util:get-module-description($namespace-uri as xs:string) xs:string
Returns a short description of the module identified by the namespace URI.
Returns the description of the active function module identified by the namespace URI
util:get-sequence-type($sequence-type as xs:anyType*) xs:string
Returns the string representation of the type of sequence.
Returns the string representation of the type of sequence
util:hash($message as item(), $algorithm as xs:string) xs:string
Calculates a hashcode from a string based on a specified algorithm.
Returns the hashcode
util:hash($message as item(), $algorithm as xs:string, $base64flag as xs:boolean) xs:string
Calculates a hashcode from a string based on a specified algorithm.
Returns the hashcode
util:import-module($module-uri as xs:anyURI, $prefix as xs:string, $location as xs:anyURI) empty()
Dynamically imports an XQuery module into the current context. The parameters have the same meaning as in an 'import module ...' expression in the query prolog.
util:index-key-documents($nodes as node()*, $value as xdt:anyAtomicType) xs:integer?
Return the number of documents for an indexed value.
Returns the number of documents for the indexed value
util:index-key-documents($nodes as node()*, $value as xdt:anyAtomicType, $index as xs:string) xs:integer?
Return the number of documents for an indexed value.
Returns the number of documents for the indexed value
util:index-key-occurrences($nodes as node()*, $value as xdt:anyAtomicType) xs:integer?
Return the number of occurrences for an indexed value.
Returns the number of occurrences for the indexed value
util:index-key-occurrences($nodes as node()*, $value as xdt:anyAtomicType, $index as xs:string) xs:integer?
Return the number of occurrences for an indexed value.
Returns the number of occurrences for the indexed value
util:index-keys($node-set as node()*, $start-value as xdt:anyAtomicType, $function-reference as function, $max-number-returned 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 function will check for indexes defined on path as well as indexes defined by QName.
Returns the results of the eval of the $function-reference
util:index-keys($node-set as node()*, $start-value as xdt:anyAtomicType, $function-reference as function, $max-number-returned as xs:int, $index as xs:string) 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 function will check for indexes defined on path as well as indexes defined by QName.
Returns the results of the eval of the $function-reference
util:index-type($set-of-nodes as node()*) xs:string?
Returns the range index type for a set of nodes or an empty sequence if no index is defined.
Returns the range index type
util:integer-to-base($number as xs:integer, $base as xs:integer) xs:string
Converts the xs:integer $number (unsigned) into base $base as xs:string. Bases 2, 8, and 16 are supported.
Returns the xs:string representation of $number in base $base
util:is-binary-doc($binary-resource as xs:string?) xs:boolean
Checks if the resource identified by $binary-resource is a binary resource.
Returns true if the resource is a binary document
util:is-module-registered($namespace-uri as xs:string) xs:boolean
Returns a Boolean value if the module identified by the namespace URI is registered.
Returns true if the namespace URI is registered as an active function module
util:log($priority as xs:string, $message as item()*) empty()
Logs the message to the current logger.
util:log-app($priority as xs:string, $logger-name as xs:string, $message as item()*) empty()
Logs the message to the named logger
util:log-system-err($message as item()*) empty()
Logs the message to System.err.
util:log-system-out($message as item()*) empty()
Logs the message to System.out.
util:md5($arg as item()) xs:string
Generates an MD5 key from a string.
Returns the MD5 key
Deprecated: Use the hash($a, "MD5") function instead. SHA-1 is supported as more secure message digest algorithm.
This function could be removed at anytime during the 1.5 development and will be removed in the 1.6 release.
util:md5($arg as item(), $base64encoded as xs:boolean) xs:string
Generates an MD5 key from a string. $b specifies whether to return result Base64 encoded
Returns the MD5 key
Deprecated: Use the hash($a, "MD5") function instead. SHA-1 is supported as more secure message digest algorithm.
This function could be removed at anytime during the 1.5 development and will be removed in the 1.6 release.
util:node-by-id($document as node(), $node-id as xs:string) node()
Retrieves a node by its internal node-id. The document is specified via the first argument. It may either be a document node or another node from the same document from which the target node will be retrieved by its id. The second argument is the internal node-id, specified as a string. Please note: the function does not check if the passed id does really point to an existing node. It just returns a pointer, which may thus be invalid.
Returns the node
util:node-id($node as node()) xs:string
Returns the internal node-id of a node. The internal node-id uniquely identifies a node within its document. It is encoded as a long number.
Returns the internal node-id
util:node-xpath($node as node()) xs:string?
Returns the XPath for a Node.
Returns the XPath expression of the node
util:parse($to-be-parsed as xs:string?) node()*
Parses the passed string value into an XML fragment. The string has to be well-formed XML. An empty sequence is returned if the argument is an empty string or sequence.
Returns the XML fragment parsed from the string
util:parse-html($to-be-parsed as xs:string?) node()*
Parses the passed string value into an XML fragment. The HTML string may not be well-formed XML. It will be passed through the Neko HTML parser to make it well-formed. An empty sequence is returned if the argument is an empty string or sequence.
Returns the XML fragment parsed from the string
util:qname-index-lookup($qname as xs:QName, $comparison-value as xdt:anyAtomicType) node()*
Can be used to query existing qname indexes defined on a set of nodes.
Returns the result
util:random($max as xs:integer) xs:integer
Returns a random number between 0 and $max
Returns a random number between 0 and $max
util:random() xs:double
Returns a random number between 0.0 and 1.0
Returns a random number between 0.0 and 1.0
util:registered-functions($namespace-uri 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.
Returns the sequence of function names
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.
Returns the sequence of function names
util:registered-modules() xs:string+
Returns a sequence containing the namespace URIs of all modules currently known to the system, including built in and imported modules.
Returns the sequence of all of the active function modules namespace URIs
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.
Deprecated: Use the file:serialize() function in the file extension module instead!
This function could be removed at anytime during the 1.5 development and will be removed in the 1.6 release.
util:serialize($node-set as node()*, $parameters as xs:string*) xs:string?
Returns the Serialized node set passed in parameter $node-set. $parameters 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.
Returns the string containing the serialized node set.
util:shared-lock($nodes as node()*, $expression as item()*) item()*
Puts a shared lock on the owner documents of all nodes in the first argument $nodes. Then evaluates the expressions in the second argument $expression and releases the acquired locks aftertheir completion.
Returns the results of the evaluation of the expression(s)
util:string-to-binary($encoded-string as xs:string?) xs:base64Binary?
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 the default of UTF-8.
Returns the binary resource
util:string-to-binary($encoded-string as xs:string?, $encoding as xs:string) xs:base64Binary?
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 the default of UTF-8.
Returns the binary resource
util:system-date() xs:date
Returns the current xs:date (with timezone) as reported by the Java method System.currentTimeMillis(). Contrary to fn:current-date, this function is not stable, i.e. the returned xs:date will change during the evaluation time of a query and can be used to measure time differences.
Returns the current xs:date (with timezone)
util:system-dateTime() xs:dateTime
Returns the current xs:dateTime (with timezone) as reported by the Java method System.currentTimeMillis(). Contrary to fn:current-dateTime, this function is not stable, i.e. the returned xs:dateTime will change during the evaluation time of a query and can be used to measure time differences.
Returns the current xs:dateTime (with timezone)
util:system-property($property-name 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.
Returns the value of the named system property
util:system-time() xs:time
Returns the current xs:time (with timezone) as reported by the Java method System.currentTimeMillis(). Contrary to fn:current-time, this function is not stable, i.e. the returned xs:time will change during the evaluation time of a query and can be used to measure time differences.
Returns the current xs:time (with timezone)
util:unescape-uri($escaped-string as xs:string, $encoding as xs:string) xs:string
Returns an un-escaped URL escaped string with the encoding scheme (e.g. "UTF-8"). Decodes encoded sensitive characters from a URL, for example "%2F" becomes "/", i.e. does the oposite to escape-uri()
Returns the un-escaped string
util:uuid($name as item()) xs:string
Generate a version 3 universally unique identifier (UUID) string, e.g. 154ad200-9c79-44f3-8cff-9780d91552a6
Returns a generated UUID string
util:uuid() xs:string
Generate a version 4 (random) universally unique identifier (UUID) string, e.g. 154ad200-9c79-44f3-8cff-9780d91552a6
Returns a generated UUID string