-<xqdoc:xqdoc>
-<xqdoc:module type="library">
<xqdoc:uri>http://exist-db.org/xquery/util</xqdoc:uri>
-<xqdoc:comment>
<xqdoc:description>Various utility extension functions</xqdoc:description>
</xqdoc:comment>
</xqdoc:module>
-<xqdoc:functions>
-<xqdoc:function>
<xqdoc:name>binary-doc</xqdoc:name>
<xqdoc:signature>util:binary-doc($a as xs:string?) xs:base64Binary?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Retrieves the binary resource identified by $a and returns its contents as a value of type xs:base64Binary. An empty sequence is returned if the resource could not be found or $a was empty.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>binary-doc-available</xqdoc:name>
<xqdoc:signature>util:binary-doc-available($a as xs:string?) xs:boolean</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Checks if the binary resource identified by $a is available.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>binary-to-string</xqdoc:name>
<xqdoc:signature>util:binary-to-string($a as xs:base64Binary?) xs:string?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>binary-to-string</xqdoc:name>
<xqdoc:signature>util:binary-to-string($a as xs:base64Binary?, $b as xs:string) xs:string?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>call</xqdoc:name>
<xqdoc:signature>util:call($a as function, $b as item()*, ...) item()*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>catch</xqdoc:name>
<xqdoc:signature>util:catch($a as xs:string+, $b as item()*, $c as item()*) item()*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>collations</xqdoc:name>
<xqdoc:signature>util:collations() xs:string*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns a sequence of strings containing all collation locales that might be specified in the '?lang=' parameter of a collation URI.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>collection-name</xqdoc:name>
<xqdoc:signature>util:collection-name($a as item()?) xs:string?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>compile</xqdoc:name>
<xqdoc:signature>util:compile($a as xs:string) xs:string</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Dynamically evaluates the XPath/XQuery expression specified in $a within the current instance of the query engine.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>declare-namespace</xqdoc:name>
<xqdoc:signature>util:declare-namespace($a as xs:string, $b as xs:anyURI) empty()</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Dynamically declares a namespace/prefix mapping for the current context. The prefix is specified in $a, the namespace URI in $b.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>declare-option</xqdoc:name>
<xqdoc:signature>util:declare-option($a as xs:string, $b as xs:string) empty()</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Dynamically declares a serialization option as with 'declare option'.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>deep-copy</xqdoc:name>
<xqdoc:signature>util:deep-copy($a as item()?) item()?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Performs a Deep Clone of the Parameter $a</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>describe-function</xqdoc:name>
<xqdoc:signature>util:describe-function($a as xs:QName) node()</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Describes a built-in function. Returns an element describing the function signature.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>disable-profiling</xqdoc:name>
<xqdoc:signature>util:disable-profiling() empty()</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Disable profiling output within the query.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>doctype</xqdoc:name>
<xqdoc:signature>util:doctype($a as xs:string+, ...) node()*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the document nodes of the documents whose DOCTYPE is given by $a.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>document-id</xqdoc:name>
<xqdoc:signature>util:document-id($a as item()) xs:int?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>document-name</xqdoc:name>
<xqdoc:signature>util:document-name($a as item()) xs:string?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>eXist-version</xqdoc:name>
<xqdoc:signature>util:eXist-version() xs:string</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the version of eXist running this query.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>enable-profiling</xqdoc:name>
<xqdoc:signature>util:enable-profiling($a as xs:int) empty()</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Enable profiling output within the query. The profiling starts with this function call and will end with a call to 'disable-profiling'. Argument $a specifies the verbosity. All other profiling options can be configured via the 'declare option exist:profiling ...' in the query prolog.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>eval</xqdoc:name>
<xqdoc:signature>util:eval($a as item()) node()*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Dynamically evaluates an XPath/XQuery expression. If the first argument is of type xs:string, the function tries to execute this string as the query. If the first argument is of type 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(xs:anyURI('xmldb:exist:///db/test/test.xq')). The query inherits the current execution context, i.e. all namespace declarations and variable declarations are visible from within the inner expression. The function returns an empty sequence if a whitespace string is passed.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>eval</xqdoc:name>
<xqdoc:signature>util:eval($a as item(), $b as xs:boolean) node()*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Dynamically evaluates an XPath/XQuery expression. If the first argument is of type xs:string, the function tries to execute this string as the query. If the first argument is of type 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(xs:anyURI('xmldb:exist:///db/test/test.xq')). The query inherits the current execution context, i.e. all namespace declarations and variable declarations are visible from within the inner expression. The function returns an empty sequence if a whitespace string is passed. The third argument specifies if the compiled query expression should be cached. The cached query will be globally available within the db instance.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>eval-inline</xqdoc:name>
<xqdoc:signature>util:eval-inline($a as item()*, $b as item()) item()*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Dynamically evaluates an XPath/XQuery expression. If the first argument is of type xs:string, the function tries to execute this string as the query. If the first argument is of type 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(xs:anyURI('xmldb:exist:///db/test/test.xq')). The query inherits the first argument's context, i.e. all namespace declarations and variable declarations are visible from within the inner expression. The function returns an empty sequence if a whitespace string is passed.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>eval-with-context</xqdoc:name>
<xqdoc:signature>util:eval-with-context($a as item(), $b as node()?, $c as xs:boolean) node()*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Dynamically evaluates an XPath/XQuery expression. If the first argument is of type xs:string, the function tries to execute this string as the query. If the first argument is of type 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(xs:anyURI('xmldb:exist:///db/test/test.xq')). The query inherits the context described by the XML fragment in the second parameter. It should have the format: <static-context> <output-size-limit value="-1"> <unbind-namespace uri="http://exist.sourceforge.net/NS/exist"/> <current-dateTime value="dateTime"/> <implicit-timezone value="duration"/> <variable name="qname">variable value</variable> </static-context>. The third argument specifies if the compiled query expression should be cached. The cached query will be globally available within the db instance.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>eval-with-context</xqdoc:name>
<xqdoc:signature>util:eval-with-context($a as item(), $b as node()?, $c as xs:boolean, $d as item()?) node()*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Dynamically evaluates an XPath/XQuery expression. If the first argument is of type xs:string, the function tries to execute this string as the query. If the first argument is of type 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(xs:anyURI('xmldb:exist:///db/test/test.xq')). The query inherits the context described by the XML fragment in the second parameter. It should have the format: <static-context> <output-size-limit value="-1"> <unbind-namespace uri="http://exist.sourceforge.net/NS/exist"/> <current-dateTime value="dateTime"/> <implicit-timezone value="duration"/> <variable name="qname">variable value</variable> </static-context>. The third argument specifies if the compiled query expression should be cached. The cached query will be globally available within the db instance.The fourth argument specifies the context item against which the expression will be evaluated.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>exclusive-lock</xqdoc:name>
<xqdoc:signature>util:exclusive-lock($a as node()*, $b as item()*) item()*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Puts an exclusive lock on the owner documents of all nodes in the first argument $a. Then evaluates the expressions in the second argument $b and releases the acquired locks aftertheir completion.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>extract-docs</xqdoc:name>
<xqdoc:signature>util:extract-docs($a as xs:string) node()?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>file-read</xqdoc:name>
<xqdoc:signature>util:file-read($a as item()) xs:string?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Read content of file $a</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>file-read</xqdoc:name>
<xqdoc:signature>util:file-read($a as item(), $b as xs:string) xs:string?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Read content of file $a with the encoding specified in $b.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>function</xqdoc:name>
<xqdoc:signature>util:function($a as xs:string, $b as xs:integer) function</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-module-description</xqdoc:name>
<xqdoc:signature>util:get-module-description($a as xs:string) xs:string</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns a short description of the module identified by the namespace URI.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-sequence-type</xqdoc:name>
<xqdoc:signature>util:get-sequence-type($a as xs:anyType*) xs:string</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the string representation of the type of sequence $a.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>import-module</xqdoc:name>
<xqdoc:signature>util:import-module($a as xs:anyURI, $b as xs:string, $c as xs:anyURI) empty()</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>index-key-documents</xqdoc:name>
<xqdoc:signature>util:index-key-documents($a as node()*, $b as xdt:anyAtomicType) xs:integer?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Return the number of documents for an indexed value. The first argument specifies the nodes whose content is indexed. The second argument specifies the value. </xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>index-key-documents</xqdoc:name>
<xqdoc:signature>util:index-key-documents($a as node()*, $b as xdt:anyAtomicType, $c as xs:string) xs:integer?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Return the number of documents for an indexed value. The first argument specifies the nodes whose content is indexed. The second argument specifies the value. The third argument specifies the index in which the search is made</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>index-key-occurrences</xqdoc:name>
<xqdoc:signature>util:index-key-occurrences($a as node()*, $b as xdt:anyAtomicType) xs:integer?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Return the number of occurrences for an indexed value. The first argument specifies the nodes whose content is indexed. The second argument specifies the value. </xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>index-key-occurrences</xqdoc:name>
<xqdoc:signature>util:index-key-occurrences($a as node()*, $b as xdt:anyAtomicType, $c as xs:string) xs:integer?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Return the number of occurrences for an indexed value. The first argument specifies the nodes whose content is indexed. The second argument specifies the value. The third argument specifies the index in which the search is made</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>index-keys</xqdoc:name>
<xqdoc:signature>util:index-keys($a as node()*, $b as xdt:anyAtomicType, $c as function, $d as xs:int) item()*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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. 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. The fourth argument is the maximum number of returned keys</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>index-keys</xqdoc:name>
<xqdoc:signature>util:index-keys($a as node()*, $b as xdt:anyAtomicType, $c as function, $d as xs:int, $e as xs:string) item()*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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. 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. The fourth argument is the maximum number of returned keysThe fifth argument specifies the index in which the search is made</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>index-type</xqdoc:name>
<xqdoc:signature>util:index-type($a as node()*) xs:string?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the range index type for a set of nodes or an empty sequence if no index is defined. </xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>log</xqdoc:name>
<xqdoc:signature>util:log($a as xs:string, $b as item()*) empty()</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Logs the message specified in $b to the current logger. $a indicates the log priority, e.g. 'debug' or 'warn'.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>log-system-err</xqdoc:name>
<xqdoc:signature>util:log-system-err($a as item()*) empty()</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Logs the message specified in $b to System.err.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>log-system-out</xqdoc:name>
<xqdoc:signature>util:log-system-out($a as item()*) empty()</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Logs the message specified in $b to System.out.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>md5</xqdoc:name>
<xqdoc:signature>util:md5($a as item()) xs:string</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Generates an MD5 key from a string.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>node-by-id</xqdoc:name>
<xqdoc:signature>util:node-by-id($a as node(), $b as xs:string) node()</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>node-id</xqdoc:name>
<xqdoc:signature>util:node-id($a as node()) xs:string</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>node-xpath</xqdoc:name>
<xqdoc:signature>util:node-xpath($a as node()) xs:string?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the XPath for a Node.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>parse</xqdoc:name>
<xqdoc:signature>util:parse($a as xs:string?) node()*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>parse-html</xqdoc:name>
<xqdoc:signature>util:parse-html($a as xs:string?) node()*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>qname-index-lookup</xqdoc:name>
<xqdoc:signature>util:qname-index-lookup($a as xs:QName, $b as xdt:anyAtomicType) node()*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Can be used to query existing qname indexes defined on a set of nodes. The qname is specified in the first argument. The second argument specifies a comparison value. </xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>random</xqdoc:name>
<xqdoc:signature>util:random() xs:double</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns a random number between 0.0 and 1.0</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>random</xqdoc:name>
<xqdoc:signature>util:random($a as xs:integer) xs:integer</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns a random number between 0 and $a</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>registered-functions</xqdoc:name>
<xqdoc:signature>util:registered-functions() xs:string+</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns a sequence containing the QNames of all functions currently known to the system, including functions in imported and built-in modules.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>registered-functions</xqdoc:name>
<xqdoc:signature>util:registered-functions($a as xs:string) xs:string+</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>registered-modules</xqdoc:name>
<xqdoc:signature>util:registered-modules() xs:string+</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns a sequence containing the namespace URIs of all modules currently known to the system, including built in and imported modules.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>serialize</xqdoc:name>
<xqdoc:signature>util:serialize($a as node()*, $b as xs:string*) xs:string?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>serialize</xqdoc:name>
<xqdoc:signature>util:serialize($a as node()*, $b as xs:string, $c as xs:string*) xs:boolean?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>shared-lock</xqdoc:name>
<xqdoc:signature>util:shared-lock($a as node()*, $b as item()*) item()*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Puts a shared lock on the owner documents of all nodes in the first argument $a. Then evaluates the expressions in the second argument $b and releases the acquired locks aftertheir completion.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>string-to-binary</xqdoc:name>
<xqdoc:signature>util:string-to-binary($a as xs:string?) xs:base64Binary?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>string-to-binary</xqdoc:name>
<xqdoc:signature>util:string-to-binary($a as xs:string?, $b as xs:string) xs:base64Binary?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>system-property</xqdoc:name>
<xqdoc:signature>util:system-property($a as xs:string) xs:string?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>system-time</xqdoc:name>
<xqdoc:signature>util:system-time() xs:time</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the 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.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>unescape-uri</xqdoc:name>
<xqdoc:signature>util:unescape-uri($a as xs:string, $b as xs:string) xs:string</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns an un-escaped URL escaped string identified by $a with the encoding scheme indicated by the string $b (e.g. "UTF-8"). Decodes encoded sensitive characters from a URL, for example "%2F" becomes "/", i.e. does the oposite to escape-uri()</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>uuid</xqdoc:name>
<xqdoc:signature>util:uuid() xs:string</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Generate a Universally Unique Identifier string.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
</xqdoc:functions>
</xqdoc:xqdoc>