A module with the XQuery/XPath Core Library Functions
QName($uri as xs:string?, $qname as xs:string) as xs:QName
Returns an xs:QName with the namespace URI given in $uri. If $uri is the zero-length string or the empty sequence, it represents "no namespace"; in this case, if the value of $qname contains a colon (:), an error is raised [err:FOCA0002]. The prefix (or absence of a prefix) in $qname is retained in the returned xs:QName value. The local name in the result is taken from the local part of $qname.
If $qname does not have the correct lexical form for xs:QName an error is raised [err:FOCA0002].
Note that unlike xs:QName this function does not require a xs:string literal as the argument.
$uri? | The namespace URI |
$qname | The prefix |
abs($number as xs:numeric?) as xs:numeric?
Returns the absolute value of the argument $number.If the argument is negative returns -$number otherwise returns $number.
$number? | The number |
adjust-date-to-timezone($date as xs:date?) as xs:date?
Adjusts the xs:date value $date to the implicit timezone of the current locale.
$date? | The date |
adjust-date-to-timezone($date as xs:date?, $duration as xs:dayTimeDuration?) as xs:date?
Adjusts the xs:date value $date to a specific timezone, or to no timezone at all. If $duration is the empty sequence, returns an xs:date without a timezone.
$date? | The date |
$duration? | The duration |
adjust-dateTime-to-timezone($date-time as xs:dateTime?) as xs:dateTime?
Adjusts the xs:dateTime value $date-time to the implicit timezone of the current locale.
$date-time? | The date-time |
adjust-dateTime-to-timezone($date-time as xs:dateTime?, $duration as xs:dayTimeDuration?) as xs:dateTime?
Adjusts the xs:dateTime value $date-time to a specific timezone, or to no timezone at all. If $duration is the empty sequence, returns an xs:dateTime without a timezone.
$date-time? | The date-time |
$duration? | The duration |
adjust-time-to-timezone($time as xs:time?) as xs:time?
Adjusts the xs:time value $time to the implicit timezone of the current locale.
$time? | The time |
adjust-time-to-timezone($time as xs:time?, $duration as xs:dayTimeDuration?) as xs:time?
Adjusts the xs:time value $time to a specific timezone, or to no timezone at all. If $duration is the empty sequence, returns an xs:time without a timezone.
$time? | The time |
$duration? | The duration |
analyze-string($input as xs:string?, $pattern as xs:string) as element()
Analyzes a string using a regular expression, returning an XML structure that identifies which parts of the input string matched or failed to match the regular expression, and in the case of matched substrings, which substrings matched each capturing group in the regular expression.
$input? | The input string |
$pattern | The pattern |
analyze-string($input as xs:string?, $pattern as xs:string, $flags as xs:string) as element()
Analyzes a string using a regular expression, returning an XML structure that identifies which parts of the input string matched or failed to match the regular expression, and in the case of matched substrings, which substrings matched each capturing group in the regular expression.
$input? | The input string |
$pattern | The pattern |
$flags | Flags |
apply($function as function(*), $array as array(*)) as item()*
Processes the supplied sequence from right to left, applying the supplied function repeatedly to each item in turn, together with an accumulated result value.
$function | the function to call |
$array | an array containing the arguments to pass to the function |
available-environment-variables() as xs:string*
Returns a list of environment variable names.
avg($values as xs:anyAtomicType*) as xs:anyAtomicType?
Returns the average of the values in the input sequence $values, that is, the sum of the values divided by the number of values.
$values* | The values |
base-uri() as xs:anyURI?
Returns the base URI of the context node. It is equivalent to calling fn:base-uri(.).
base-uri($arg as node()?) as xs:anyURI?
Returns the base URI of a node.If $arg is the empty sequence, the empty sequence is returned.
$arg? | The node. |
boolean($items as item()*) as xs:boolean
Computes the xs:boolean value of the sequence items.
$items* | The items |
ceiling($number as xs:numeric?) as xs:numeric?
Returns a value of the same type as the argument. Specifically, returns the smallest (closest to negative infinity) number with no fractional part that is not less than the value of the argument, $number.
$number? | The number |
codepoint-equal($string-1 as xs:string?, $string-2 as xs:string?) as xs:boolean?
Returns true or false depending on whether the value of $string-1 is equal to the value of $string-2, according to the Unicode code point collation.
$string-1? | The first string |
$string-2? | The second string |
codepoints-to-string($codepoints as xs:integer*) as xs:string
Creates an xs:string from a sequence of code points. Returns the zero-length string if $codepoints is the empty sequence. If any of the code points in $codepoints is not a legal XML character, an error is raised
$codepoints* | The codepoints as a sequence of xs:integer values |
collection($collection-uris as xs:string*) as item()*
Returns the documents contained in the collections specified in the input sequence. Collection URIs can be specified either as a simple collection path or an XMLDB URI. Documents contained in sub-collections are also included. If no value is supplied, the statically know documents are used, for the REST Server this could be the addressed collection.
$collection-uris* | The collection-URIs for which to include the documents |
compare($string-1 as xs:string?, $string-2 as xs:string?) as xs:integer?
Returns the collatable comparison between $string-1 and $string-2, using $collation-uri. -1 if $string-1 is inferior to $string-2, 0 if $string-1 is equal to $string-2, 1 if $string-1 is superior to $string-2. If either comparand is the empty sequence, the empty sequence is returned. Please remember to specify the collation in the context or use, the three argument version if you don't want the system default.
$string-1? | The first string |
$string-2? | The second string |
compare($string-1 as xs:string?, $string-2 as xs:string?, $collation-uri as xs:string) as xs:integer?
Returns the collatable comparison between $string-1 and $string-2, using $collation-uri. -1 if $string-1 is inferior to $string-2, 0 if $string-1 is equal to $string-2, 1 if $string-1 is superior to $string-2. If either comparand is the empty sequence, the empty sequence is returned. The third argument $collation-uri is either: 1) the full URI e.g. "http://www.w3.org/2013/collation/UCA?lang=en;strength=secondary", or 2) relative where you only need to specify the last part of a valid full collation-uri, e.g. "?lang=sv-SE", "lang=sv-SE;strength=primary;decomposition=standard" or "swedish".
$string-1? | The first string |
$string-2? | The second string |
$collation-uri | The relative collation URI |
concat($atomizable-values as xs:anyAtomicType?) as xs:string
Accepts two or more xdt:anyAtomicType arguments, $atomizable-values, and converts them to xs:string. Returns the xs:string that is the concatenation of the values of its arguments after conversion. If any of the arguments is the empty sequence, the argument is treated as the zero-length string.
$atomizable-values? | The atomizable values |
contains($source-string as xs:string?, $substring as xs:string?) as xs:boolean
Returns an xs:boolean indicating whether or not the value of $source-string 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 $substring, according to the default collation.
$source-string? | The source-string |
$substring? | The substring |
contains($source-string as xs:string?, $substring as xs:string?, $collation-uri as xs:string) as xs:boolean
Returns an xs:boolean indicating whether or not the value of $source-string 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 $substring, according to the collation that is specified in $collation-uri.The third argument $collation-uri is either: 1) the full URI e.g. "http://www.w3.org/2013/collation/UCA?lang=en;strength=secondary", or 2) relative where you only need to specify the last part of a valid full collation-uri, e.g. "?lang=sv-SE", "lang=sv-SE;strength=primary;decomposition=standard" or "swedish".
$source-string? | The source-string |
$substring? | The substring |
$collation-uri | The collation URI |
contains-token($input as xs:string*, $token as xs:string) as xs:boolean
Determines whether or not any of the supplied strings, when tokenized at whitespace boundaries, contains the supplied token, under the rules of the supplied collation.
$input* | The input string |
$token | The token to be searched for |
contains-token($input as xs:string*, $token as xs:string, $pattern as xs:string?) as xs:boolean
Determines whether or not any of the supplied strings, when tokenized at whitespace boundaries, contains the supplied token, under the rules of the supplied collation.
$input* | The input string |
$token | The token to be searched for |
$pattern? | Collation to use |
count($items as item()*) as xs:integer
Returns the number of items in the argument sequence, $items.
$items* | The items |
current-date() as xs:date
Returns the xs:date (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-date() is executed.
current-dateTime() as xs:dateTime
Returns the xs:dateTime (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-dateTime() is executed.
current-time() as xs:time
Returns the xs:time (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-time() is executed.
data() as xs:anyAtomicType*
Atomizes the context item, replacing all nodes in the sequence by their typed values.
data($items as item()*) as xs:anyAtomicType*
Atomizes the sequence $items, replacing all nodes in the sequence by their typed values.
$items* | The items |
dateTime($date as xs:date?, $time as xs:time?) as xs:dateTime?
Creates an xs:dateTime from an xs:date, $date, and an xs:time, $time.
$date? | The date as xs:date |
$time? | The time as xs:time |
day-from-date($date as xs:date?) as xs:integer?
Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of $date.
$date? | The date as xs:date |
day-from-dateTime($date-time as xs:dateTime?) as xs:integer?
Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of $date-time.
$date-time? | The date-time as xs:dateTime |
days-from-duration($duration as xs:duration?) as xs:integer?
Returns an xs:integer representing the days component in the canonical lexical representation of the value of $duration. The result may be negative.
$duration? | The duration as xs:duration |
deep-equal($items-1 as item()*, $items-2 as item()*) as xs:boolean
Returns true() iff every item in $items-1 is deep-equal to the item at the same position in $items-2, false() otherwise. If both $items-1 and $items-2 are the empty sequence, returns true().
$items-1* | The first item sequence |
$items-2* | The second item sequence |
deep-equal($items-1 as item()*, $items-2 as item()*, $collation-uri as xs:string) as xs:boolean
Returns true() iff every item in $items-1 is deep-equal to the item at the same position in $items-2, false() otherwise. If both $items-1 and $items-2 are the empty sequence, returns true(). Comparison collation is specified by $collation-uri. The third argument $collation-uri is either: 1) the full URI e.g. "http://www.w3.org/2013/collation/UCA?lang=en;strength=secondary", or 2) relative where you only need to specify the last part of a valid full collation-uri, e.g. "?lang=sv-SE", "lang=sv-SE;strength=primary;decomposition=standard" or "swedish".
$items-1* | The first item sequence |
$items-2* | The second item sequence |
$collation-uri | The collation URI |
default-collation() as xs:string
Returns the context's default collation. E.g. http://www.w3.org/2005/xpath-functions/collation/codepoint.
distinct-values($atomic-values as xs:anyAtomicType*) as xs:anyAtomicType*
Returns a sequence where duplicate values of $atomic-values, based on value equality, have been deleted.
$atomic-values* | The atomic values |
distinct-values($atomic-values as xs:anyAtomicType*, $collation-uri as xs:string) as xs:anyAtomicType*
Returns a sequence where duplicate values of $atomic-values, based on value equality specified by collation $collation-uri, have been deleted.
$atomic-values* | The atomic values |
$collation-uri | The collation URI |
doc($document-uri as xs:string?) as document-node()?
Returns the document node of $document-uri. Resource URIs can be specified either as a simple collection path, an XMLDB URI or any URI.
$document-uri? | The document URI |
doc-available($document-uri as xs:string?) as xs:boolean
Returns whether or not the document, $document-uri, specified in the input sequence is available. Resource URIs can be specified either as a simple collection path, an XMLDB URI or any URI.
$document-uri? | The document URI |
document-uri() as xs:anyURI?
Returns the URI of a resource where a document can be found, if available.
document-uri($value as node()*) as xs:anyURI?
Returns the URI of a resource where a document can be found, if available.
$value* | The document node. |
empty($items as item()*) as xs:boolean
Returns true() if the value of $items is the empty sequence, false() otherwise.
$items* | The item sequence |
encode-for-uri($uri-part as xs:string?) as xs:string
Escapes reserved characters in $uri-part by replacing it with its percent-encoded form as described in [RFC 3986]. If $uri-part is the empty sequence, returns the zero-length string.
$uri-part? | The URI part to encode |
ends-with($source-string as xs:string?, $suffix as xs:string?) as xs:boolean
Returns true() if the string value of $suffix is a suffix of the string value of $source-string, false() otherwise. If either $source-string or $suffix is the empty sequence, the empty sequence is returned.
$source-string? | The source-string |
$suffix? | The suffix |
ends-with($source-string as xs:string?, $suffix as xs:string?, $collation-uri as xs:string) as xs:boolean
Returns true() if the string value of $suffix is a suffix of the string value of $source-string using collation $collation-uri, false() otherwise. If either $source-string or $suffix is the empty sequence, the empty sequence is returned. The third argument $collation-uri is either: 1) the full URI e.g. "http://www.w3.org/2013/collation/UCA?lang=en;strength=secondary", or 2) relative where you only need to specify the last part of a valid full collation-uri, e.g. "?lang=sv-SE", "lang=sv-SE;strength=primary;decomposition=standard" or "swedish".
$source-string? | The source string |
$suffix? | The suffix |
$collation-uri | The collation URI |
environment-variable($name as xs:string) as xs:string?
Returns the value of a system environment variable, if it exists.
$name | Name of environment variable. |
equals($source-string as xs:string?, $substring as xs:string?) as xs:boolean
Returns an xs:boolean indicating whether or not the value of $source-string equals the collation units in the value of $substring, according to the default collation. This function is similar to the '=' expression, except that it uses the default collation for comparisons.
$source-string? | The source-string |
$substring? | The substring |
equals($source-string as xs:string?, $substring as xs:string?, $collation-uri as xs:string) as xs:boolean
Returns an xs:boolean indicating whether or not the value of $source-string equals the collation units in the value of $substring, according to the collation that is specified in $collation-uri. This function is similar to the '=' expression, except that it uses the specified collation for comparisons.The third argument $collation-uri is either: 1) the full URI e.g. "http://www.w3.org/2013/collation/UCA?lang=en;strength=secondary", or 2) relative where you only need to specify the last part of a valid full collation-uri, e.g. "?lang=sv-SE", "lang=sv-SE;strength=primary;decomposition=standard" or "swedish".
$source-string? | The source-string |
$substring? | The substring |
$collation-uri | The collation URI |
error() as empty-sequence()
Indicates that an irrecoverable error has occurred. The script will terminate immediately with an exception using the default qname, 'http://www.w3.org/2004/07/xqt-errors#err:FOER0000', and the default error message, 'An error has been raised by the query'.
error($qname as xs:QName?) as empty-sequence()
Indicates that an irrecoverable error has occurred. The script will terminate immediately with an exception using $qname and the default message, 'An error has been raised by the query'.
$qname? | The qname |
error($qname as xs:QName?, $message as xs:string) as empty-sequence()
Indicates that an irrecoverable error has occurred. The script will terminate immediately with an exception using $qname and $message.
$qname? | The qname |
$message | The message |
error($qname as xs:QName?, $message as xs:string, $error-object as item()*) as empty-sequence()
Indicates that an irrecoverable error has occurred. The script will terminate immediately with an exception using $qname and $message with $error-object appended.
$qname? | The qname |
$message | The message |
$error-object* | The error object |
escape-html-uri($html-uri as xs:string?) as xs:string
Replaces all non-printable ASCII characters in the string value of $html-uri by an escape sequence represented as a hexadecimal octet in the form %XX. If $html-uri is the empty sequence, returns the zero-length string.
$html-uri? | The html URI |
escape-uri($uri as xs:string?, $escape-reserved as xs:boolean) as 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 $uri, 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. $escape-reserved indicates whether to escape reserved characters.
$uri? | The URI |
$escape-reserved | The escaped-reserved |
exactly-one($items as item()*) as item()
Returns the argument sequence, $items, if it contains exactly one item. Otherwise, raises an error.
$items* | The item sequence |
exists($items as item()*) as xs:boolean
Returns true if the argument $items is not the empty sequence, false otherwise.
$items* | The item sequence |
false() as xs:boolean
Always returns the boolean value false
filter($sequence as item()*, $function as function(*)) as item()*
Returns those items from the sequence $sequence for which the supplied function $function returns true.
$sequence* | the sequence to filter |
$function | the function to call |
floor($number as xs:numeric?) as xs:numeric?
Returns the largest number not greater than the value of $number. If $number is the empty sequence, returns the empty sequence.
$number? | The number |
fold-left($sequence as item()*, $zero as item()*, $function as function(*)) as item()*
Processes the supplied sequence from left to right, applying the supplied function repeatedly to each item in turn, together with an accumulated result value.
$sequence* | the sequence to filter |
$zero* | initial value to start with |
$function | the function to call |
fold-right($sequence as item()*, $zero as item()*, $function as function(*)) as item()*
Processes the supplied sequence from right to left, applying the supplied function repeatedly to each item in turn, together with an accumulated result value.
$sequence* | the sequence to filter |
$zero* | initial value to start with |
$function | the function to call |
for-each($sequence as item()*, $function as function(*)) as item()*
Applies the function item $function to every item from the sequence $sequence in turn, returning the concatenation of the resulting sequences in order.
$sequence* | the sequence on which to apply the function |
$function | the function to call |
for-each-pair($seq1 as item()*, $seq2 as item()*, $function as function(*)) as item()*
Applies the function item $f to successive pairs of items taken one from $seq1 and one from $seq2, returning the concatenation of the resulting sequences in order.
$seq1* | first sequence to take items from |
$seq2* | second sequence to take items from |
$function | the function to call |
format-date($value as xs:date?, $picture as xs:string) as xs:string?
Returns a string containing an xs:date value formatted for display.
Read more$value? | The date |
$picture | The picture string |
format-date($value as xs:date?, $picture as xs:string, $language as xs:string?, $calendar as xs:string?, $place as xs:string?) as xs:string?
Returns a string containing an xs:date value formatted for display.
Read more$value? | The date |
$picture | The picture string |
$language? | The language string |
$calendar? | The calendar string |
$place? | The place string |
format-dateTime($value as xs:dateTime?, $picture as xs:string) as xs:string?
Returns a string containing an xs:date value formatted for display.
$value? | The datetime |
$picture | The picture string |
format-dateTime($value as xs:dateTime?, $picture as xs:string, $language as xs:string?, $calendar as xs:string?, $place as xs:string?) as xs:string?
Returns a string containing an xs:date value formatted for display.
$value? | The datetime |
$picture | The picture string |
$language? | The language string |
$calendar? | The calendar string |
$place? | The place string |
format-number($value as xs:numeric?, $picture as xs:string) as xs:string
Returns a string containing a number formatted according to a given picture string, taking account of decimal formats specified in the static context.
$value? | The number to format |
$picture | The picture string to use for formatting. To understand the picture string syntax, see: https://www.w3.org/TR/xpath-functions-31/#func-format-number |
format-number($value as xs:numeric?, $picture as xs:string, $decimal-format-name as xs:string?) as xs:string
Returns a string containing a number formatted according to a given picture string, taking account of decimal formats specified in the static context.
$value? | The number to format |
$picture | The picture string to use for formatting. To understand the picture string syntax, see: https://www.w3.org/TR/xpath-functions-31/#func-format-number |
$decimal-format-name? | The name (as an EQName) of a decimal format to use. |
format-time($value as xs:time?, $picture as xs:string) as xs:string?
Returns a string containing an xs:time value formatted for display.
$value? | The time |
$picture | The picture string |
format-time($value as xs:time?, $picture as xs:string, $language as xs:string?, $calendar as xs:string?, $place as xs:string?) as xs:string?
Returns a string containing an xs:time value formatted for display.
$value? | The time |
$picture | The picture string |
$language? | The language string |
$calendar? | The calendar string |
$place? | The place string |
function-arity($function as function(*)) as xs:integer
Returns the arity of the function identified by a function item.
$function | The function item |
function-lookup($name as xs:QName, $arity as xs:integer) as function(*)?
Returns a reference to the function having a given name and arity, if there is one, the empty sequence otherwise
$name | Qualified name of the function |
$arity | The arity (number of arguments) of the function |
function-name($function as function(*)) as xs:QName?
Returns the name of the function identified by a function item.
$function | The function item |
generate-id() as xs:string
This function returns a string that uniquely identifies a given node. Without an argument, the node to identify is taken from the current context item.
generate-id($node as node()?) as xs:string
This function returns a string that uniquely identifies a given node.
$node? | The node for which an identifier will be generated. If it is the empty sequence, the result will be the empty string |
has-children() as xs:boolean
Returns true if the context item has one or more child nodes
has-children($node as node()?) as xs:boolean
Returns true if the supplied node has one or more child nodes
$node? | The node to test |
head($arg as item()*) as item()?
The function returns the value of the expression $arg[1], i.e. the first item in the passed in sequence.
$arg* | $arg* |
hours-from-dateTime($date-time as xs:dateTime?) as xs:integer?
Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of $date-time.
$date-time? | The date-time as xs:dateTime |
hours-from-duration($duration as xs:duration?) as xs:integer?
Returns an xs:integer representing the hours component in the canonical lexical representation of the value of $duration. The result may be negative.
$duration? | The duration as xs:duration |
hours-from-time($time as xs:time?) as xs:integer?
Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of $time.
$time? | The time as xs:time |
id($idrefs as xs:string*) as 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 $idrefs. If none is matching or $idrefs is the empty sequence, returns the empty sequence.
$idrefs* | The IDREF sequence |
id($idrefs as xs:string*, $node-in-document as node()) as 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 $idrefs and is in the same document as $node-in-document. If none is matching or $idrefs is the empty sequence, returns the empty sequence.
$idrefs* | The IDREF sequence |
$node-in-document | The node in document |
idref($ids as xs:string*) as node()*
Returns the sequence of element or attributes nodes with an IDREF value matching the value of one or more of the ID values supplied in $ids. If none is matching or $ids is the empty sequence, returns the empty sequence.
$ids* | The ID sequence |
idref($ids as xs:string*, $node-in-document as node()) as node()*
Returns the sequence of element or attributes nodes with an IDREF value matching the value of one or more of the ID values supplied in $ids. If none is matching or $ids is the empty sequence, returns the empty sequence.
$ids* | The ID sequence |
$node-in-document | The node in document |
implicit-timezone() as xs:dayTimeDuration
Returns the value of the implicit timezone property from the dynamic context.
in-scope-prefixes($element as element()) as xs:string*
Returns the prefixes of the in-scope namespaces for $element. For namespaces that have a prefix, it returns the prefix as an xs:NCName. For the default namespace, which has no prefix, it returns the zero-length string.
$element | The element |
index-of($source as xs:anyAtomicType*, $search as xs:anyAtomicType) as xs:integer*
Returns a sequence of positive integers giving the positions within the sequence of atomic values $source that are equal to $search.
The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. The collation is used when string comparison is required.
The items in the sequence $source are compared with $search under the rules for the 'eq' operator. Values of type xs:untypedAtomic are compared as if they were of type xs:string. Values that cannot be compared, i.e. the 'eq' operator is not defined for their types, are considered to be distinct. If an item compares equal, then the position of that item in the sequence $source is included in the result.
If the value of $source is the empty sequence, or if no item in $source matches $search, then the empty sequence is returned.
The first item in a sequence is at position 1, not position 0.
The result sequence is in ascending numeric order.
$source* | The source sequence |
$search | The search component |
index-of($source as xs:anyAtomicType*, $search as xs:anyAtomicType, $collation-uri as xs:string) as xs:integer*
Returns a sequence of positive integers giving the positions within the sequence of atomic values $source that are equal to $search.
The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. The collation is used when string comparison is required.
The items in the sequence $source are compared with $search under the rules for the 'eq' operator. Values of type xs:untypedAtomic are compared as if they were of type xs:string. Values that cannot be compared, i.e. the 'eq' operator is not defined for their types, are considered to be distinct. If an item compares equal, then the position of that item in the sequence $source is included in the result.
If the value of $source is the empty sequence, or if no item in $source matches $search, then the empty sequence is returned.
The first item in a sequence is at position 1, not position 0.
The result sequence is in ascending numeric order. The third argument $collation-uri is either: 1) the full URI e.g. "http://www.w3.org/2013/collation/UCA?lang=en;strength=secondary", or 2) relative where you only need to specify the last part of a valid full collation-uri, e.g. "?lang=sv-SE", "lang=sv-SE;strength=primary;decomposition=standard" or "swedish".
$source* | The source sequence |
$search | The search component |
$collation-uri | The collation URI |
innermost($nodes as node()*) as node()*
Returns every node within the input sequence that is not an ancestor of another member of the input sequence; the nodes are returned in document order with duplicates eliminated.
$nodes* | The nodes to test |
insert-before($target as item()*, $position as xs:integer, $inserts as item()*) as item()*
Returns a new sequence constructed from the value of $target with the value of $inserts inserted at the position specified by the value of $position. (The value of $target is not affected by the sequence construction.)
If $target is the empty sequence, $inserts is returned. If $inserts is the empty sequence, $target is returned.
The value returned by the function consists of all items of $target whose index is less than $position, followed by all items of $inserts, followed by the remaining elements of $target, in that sequence.
If $position is less than one (1), the first position, the effective value of $position is one (1). If $position is greater than the number of items in $target, then the effective value of $position is equal to the number of items in $target plus 1.
$target* | The target |
$position | The position to insert before |
$inserts* | The data to insert |
iri-to-uri($iri as xs:string?) as xs:string
This function converts an xs:string containing an IRI into a URI according to the rules spelled out in Section 3.1 of [RFC 3987]. It is idempotent but not invertible. If $iri contains a character that is invalid in an IRI, such as the space character (see note below), the invalid character is replaced by its percent-encoded form as described in [RFC 3986] before the conversion is performed. If $iri is the empty sequence, returns the zero-length string. Since [RFC 3986] recommends that, for consistency, URI producers and normalizers should use uppercase hexadecimal digits for all percent-encodings, this function must always generate hexadecimal values using the upper-case letters A-F. Notes: This function does not check whether $iri is a legal IRI. It treats it as an xs:string and operates on the characters in the xs:string. The following printable ASCII characters are invalid in an IRI: "<", ">", " " " (double quote), space, "{", "}", "|", "\", "^", and "`". Since these characters should not appear in an IRI, if they do appear in $iri they will be percent-encoded. In addition, characters outside the range x20-x126 will be percent-encoded because they are invalid in a URI. Since this function does not escape the PERCENT SIGN "%" and this character is not allowed in data within a URI, users wishing to convert character strings, such as file names, that include "%" to a URI should manually escape "%" by replacing it with "%25".
$iri? | The IRI |
json-doc($href as xs:string?) as item()?
Reads an external (or database) resource containing JSON, and returns the results of parsing the resource as JSON. An URL parameter without scheme or scheme 'xmldb:' is considered to point to a database resource.
$href? | URL pointing to a JSON resource |
json-doc($href as xs:string?, $options as map(*)) as item()?
Reads an external (or database) resource containing JSON, and returns the results of parsing the resource as JSON. An URL parameter without scheme or scheme 'xmldb:' is considered to point to a database resource.
$href? | URL pointing to a JSON resource |
$options | Parsing options |
json-to-xml($json-text as xs:string?) as item()?
Parses a string supplied in the form of a JSON text, returning the results in the form of an XML document node.
$json-text? | JSON text as defined in [RFC 7159]. The function parses this string to return an XDM value |
json-to-xml($json-text as xs:string?, $options as map(*)) as item()?
Parses a string supplied in the form of a JSON text, returning the results in the form of an XML document node.
$json-text? | JSON text as defined in [RFC 7159]. The function parses this string to return an XDM value |
$options | Parsing options |
lang($lang as xs:string?) as xs:boolean
Tests whether the language of the context item as specified by xml:lang attributes is the same as, or is a sublanguage of, the language specified by $lang. The behavior of the function if the second argument is omitted is exactly the same as if the context item (.) had been passed as the second argument. The language of the argument node, or the context item if the second argument is omitted, is determined by the value of the xml:lang attribute on the node, or, if the node has no such attribute, by the value of the xml:lang attribute on the nearest ancestor of the node that has an xml:lang attribute. If there is no such ancestor, then the function returns false().
The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
If $lang is the empty sequence it is interpreted as the zero-length string.
$lang? | The language code |
lang($lang as xs:string?, $node as node()) as xs:boolean
Tests whether the language of $node as specified by xml:lang attributes is the same as, or is a sublanguage of, the language specified by $lang. The behavior of the function if the second argument is omitted is exactly the same as if the context item (.) had been passed as the second argument. The language of the argument node, or the context item if the second argument is omitted, is determined by the value of the xml:lang attribute on the node, or, if the node has no such attribute, by the value of the xml:lang attribute on the nearest ancestor of the node that has an xml:lang attribute. If there is no such ancestor, then the function returns false().
The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
If $lang is the empty sequence it is interpreted as the zero-length string.
$lang? | The language code |
$node | The node |
last() as xs:integer
Returns the context size from the dynamic context. If the context item is undefined, an error is raised.
load-xquery-module($module-uri as xs:string) as map(*)
Provides access to the public functions and global variables of a dynamically-loaded XQuery library module.
$module-uri | The target namespace of the module |
load-xquery-module($module-uri as xs:string, $options as map(*)) as map(*)
Provides access to the public functions and global variables of a dynamically-loaded XQuery library module.
$module-uri | The target namespace of the module |
$options | Options for loading the module |
local-name() as xs:string
Returns the local part of the name of $arg as an xs:string that will either be the zero-length string or will have the lexical form of an xs:NCName.
If the argument is omitted, it defaults to the context item (.). The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
If the argument is supplied and is the empty sequence, the function returns the zero-length string.
If the target node has no name (that is, if it is a document node, a comment, or a text node), the function returns the zero-length string.
Otherwise, the value returned will be the local part of the expanded-QName of the target node (as determined by the dm:node-name accessor in Section 5.11 node-name AccessorDM. This will be an xs:string whose lexical form is an xs:NCName.
local-name($arg as node()?) as xs:string
Returns the local part of the name of $arg as an xs:string that will either be the zero-length string or will have the lexical form of an xs:NCName.
If the argument is omitted, it defaults to the context item (.). The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
If the argument is supplied and is the empty sequence, the function returns the zero-length string.
If the target node has no name (that is, if it is a document node, a comment, or a text node), the function returns the zero-length string.
Otherwise, the value returned will be the local part of the expanded-QName of the target node (as determined by the dm:node-name accessor in Section 5.11 node-name AccessorDM. This will be an xs:string whose lexical form is an xs:NCName.
$arg? | The node to retrieve the local name from |
local-name-from-QName($arg as xs:QName?) as xs:NCName?
Returns an xs:NCName representing the local part of $arg. If $arg is the empty sequence, returns the empty sequence.
$arg? | The QName |
lower-case($arg as xs:string?) as xs:string
Returns the value of $arg after translating every character to its lower-case correspondent as defined in the appropriate case mappings section in the Unicode standard. For versions of Unicode beginning with the 2.1.8 update, only locale-insensitive case mappings should be applied. Beginning with version 3.2.0 (and likely future versions) of Unicode, precise mappings are described in default case operations, which are full case mappings in the absence of tailoring for particular languages and environments. Every upper-case character that does not have a lower-case correspondent, as well as every lower-case character, is included in the returned value in its original form.
$arg? | The text to be converted to all lower-case characters |
matches($input as xs:string?, $pattern as xs:string) as xs:boolean
The function returns true if $input matches the regular expression supplied as $pattern as influenced by the value of $flags, if present; otherwise, it returns false.
The effect of calling this version of the function with the $flags argument set to azero-length string is the same as using the other two argument version. Flags are defined in 7.6.1.1 Flags.
If $input is the empty sequence, it is interpreted as the zero-length string.
Unless the metacharacters ^ and $ are used as anchors, the string is considered to match the pattern if any substring matches the pattern. But if anchors are used, the anchors must match the start/end of the string (in string mode), or the start/end of a line (in multiline mode).
Note:
This is different from the behavior of patterns in [XML Schema Part 2: Datatypes Second Edition], where regular expressions are implicitly anchored.
Please note that - in contrast - with the specification - this method allows zero or more items for the string argument.
An error is raised [err:FORX0002] if the value of $pattern is invalid according to the rules described in section 7.6.1 Regular Expression Syntax.
An error is raised [err:FORX0001] if the value of $flags is invalid according to the rules described in section 7.6.1 Regular Expression Syntax.
$input? | The input string |
$pattern | The pattern |
matches($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:boolean
The function returns true if $input matches the regular expression supplied as $pattern as influenced by the value of $flags, if present; otherwise, it returns false.
The effect of calling this version of the function with the $flags argument set to azero-length string is the same as using the other two argument version. Flags are defined in 7.6.1.1 Flags.
If $input is the empty sequence, it is interpreted as the zero-length string.
Unless the metacharacters ^ and $ are used as anchors, the string is considered to match the pattern if any substring matches the pattern. But if anchors are used, the anchors must match the start/end of the string (in string mode), or the start/end of a line (in multiline mode).
Note:
This is different from the behavior of patterns in [XML Schema Part 2: Datatypes Second Edition], where regular expressions are implicitly anchored.
Please note that - in contrast - with the specification - this method allows zero or more items for the string argument.
An error is raised [err:FORX0002] if the value of $pattern is invalid according to the rules described in section 7.6.1 Regular Expression Syntax.
An error is raised [err:FORX0001] if the value of $flags is invalid according to the rules described in section 7.6.1 Regular Expression Syntax.
$input? | The input string |
$pattern | The pattern |
$flags | The flags |
max($arg as xs:anyAtomicType*) as xs:anyAtomicType?
Selects an item from the input sequence $arg whose value is greater than or equal to the value of every other item in the input sequence. If there are two or more such items, then the specific item whose value is returned is implementation dependent.
The following rules are applied to the input sequence:
- Values of type xs:untypedAtomic in $arg are cast to xs:double.
- Numeric and xs:anyURI values are converted to the least common type that supports the 'ge' operator by a combination of type promotion and subtype substitution. See Section B.1 Type PromotionXP and Section B.2 Operator MappingXP.
The items in the resulting sequence may be reordered in an arbitrary order. The resulting sequence is referred to below as the converted sequence. This function returns an item from the converted sequence rather than the input sequence.
If the converted sequence is empty, the empty sequence is returned.
All items in $arg must be numeric or derived from a single base type for which the 'ge' operator is defined. In addition, the values in the sequence must have a total order. If date/time values do not have a timezone, they are considered to have the implicit timezone provided by the dynamic context for purposes of comparison. Duration values must either all be xs:yearMonthDuration values or must all be xs:dayTimeDuration values.
If any of these conditions is not met, then a type error is raised [err:FORG0006].
If the converted sequence contains the value NaN, the value NaN is returned.
If the items in the value of $arg are of type xs:string or types derived by restriction from xs:string, then the determination of the item with the largest value is made according to the collation that is used.The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations.
$arg* | The input sequence |
max($arg as xs:anyAtomicType*, $collation-uri as xs:string) as xs:anyAtomicType?
Selects an item from the input sequence $arg whose value is greater than or equal to the value of every other item in the input sequence. If there are two or more such items, then the specific item whose value is returned is implementation dependent.
The following rules are applied to the input sequence:
- Values of type xs:untypedAtomic in $arg are cast to xs:double.
- Numeric and xs:anyURI values are converted to the least common type that supports the 'ge' operator by a combination of type promotion and subtype substitution. See Section B.1 Type PromotionXP and Section B.2 Operator MappingXP.
The items in the resulting sequence may be reordered in an arbitrary order. The resulting sequence is referred to below as the converted sequence. This function returns an item from the converted sequence rather than the input sequence.
If the converted sequence is empty, the empty sequence is returned.
All items in $arg must be numeric or derived from a single base type for which the 'ge' operator is defined. In addition, the values in the sequence must have a total order. If date/time values do not have a timezone, they are considered to have the implicit timezone provided by the dynamic context for purposes of comparison. Duration values must either all be xs:yearMonthDuration values or must all be xs:dayTimeDuration values.
If any of these conditions is not met, then a type error is raised [err:FORG0006].
If the converted sequence contains the value NaN, the value NaN is returned.
If the items in the value of $arg are of type xs:string or types derived by restriction from xs:string, then the determination of the item with the largest value is made according to the collation that is used.If the type of the items in $arg is not xs:string and $collation-uri is specified, the collation is ignored.
The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations.
$arg* | The input sequence |
$collation-uri | The collation URI |
min($arg as xs:anyAtomicType*) as xs:anyAtomicType?
Selects an item from the input sequence $arg whose value is less than or equal to the value of every other item in the input sequence. If there are two or more such items, then the specific item whose value is returned is implementation dependent.
The following rules are applied to the input sequence:
- Values of type xs:untypedAtomic in $arg are cast to xs:double.
- Numeric and xs:anyURI values are converted to the least common type that supports the 'le' operator by a combination of type promotion and subtype substitution. See Section B.1 Type PromotionXP and Section B.2 Operator MappingXP.
The items in the resulting sequence may be reordered in an arbitrary order. The resulting sequence is referred to below as the converted sequence. This function returns an item from the converted sequence rather than the input sequence.
If the converted sequence is empty, the empty sequence is returned.
All items in $arg must be numeric or derived from a single base type for which the 'le' operator is defined. In addition, the values in the sequence must have a total order. If date/time values do not have a timezone, they are considered to have the implicit timezone provided by the dynamic context for the purpose of comparison. Duration values must either all be xs:yearMonthDuration values or must all be xs:dayTimeDuration values.
If any of these conditions is not met, a type error is raised [err:FORG0006].
If the converted sequence contains the value NaN, the value NaN is returned.
If the items in the value of $arg are of type xs:string or types derived by restriction from xs:string, then the determination of the item with the smallest value is made according to the collation that is used. The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations.
$arg* | The input sequence |
min($arg as xs:anyAtomicType*, $collation-uri as xs:string) as xs:anyAtomicType?
Selects an item from the input sequence $arg whose value is less than or equal to the value of every other item in the input sequence. If there are two or more such items, then the specific item whose value is returned is implementation dependent.
The following rules are applied to the input sequence:
- Values of type xs:untypedAtomic in $arg are cast to xs:double.
- Numeric and xs:anyURI values are converted to the least common type that supports the 'le' operator by a combination of type promotion and subtype substitution. See Section B.1 Type PromotionXP and Section B.2 Operator MappingXP.
The items in the resulting sequence may be reordered in an arbitrary order. The resulting sequence is referred to below as the converted sequence. This function returns an item from the converted sequence rather than the input sequence.
If the converted sequence is empty, the empty sequence is returned.
All items in $arg must be numeric or derived from a single base type for which the 'le' operator is defined. In addition, the values in the sequence must have a total order. If date/time values do not have a timezone, they are considered to have the implicit timezone provided by the dynamic context for the purpose of comparison. Duration values must either all be xs:yearMonthDuration values or must all be xs:dayTimeDuration values.
If any of these conditions is not met, a type error is raised [err:FORG0006].
If the converted sequence contains the value NaN, the value NaN is returned.
If the items in the value of $arg are of type xs:string or types derived by restriction from xs:string, then the determination of the item with the smallest value is made according to the collation that is used. If the type of the items in $arg is not xs:string and $collation is specified, the collation is ignored.
The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations.
$arg* | The input sequence |
$collation-uri | The collation URI |
minutes-from-dateTime($date-time as xs:dateTime?) as xs:integer?
Returns an xs:integer value between 0 to 59, both inclusive, representing the value of the minutes component in the localized value of $date-time.
$date-time? | The date-time as xs:dateTime |
minutes-from-duration($duration as xs:duration?) as xs:integer?
Returns an xs:integer representing the minutes component in the canonical lexical representation of the value of $duration. The result may be negative.
$duration? | The duration as xs:duration |
minutes-from-time($time as xs:time?) as xs:integer?
Returns an xs:integer value between 0 to 59, both inclusive, representing the value of the minutes component in the localized value of $time.
$time? | The time as xs:time |
month-from-date($date as xs:date?) as xs:integer?
Returns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of $date.
$date? | The date as xs:date |
month-from-dateTime($date-time as xs:dateTime?) as xs:integer?
Returns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of $date-time.
$date-time? | The date-time as xs:dateTime |
months-from-duration($duration as xs:duration?) as xs:integer?
Returns an xs:integer representing the months component in the canonical lexical representation of the value of $duration. The result may be negative.
$duration? | The duration as xs:duration |
name() as xs:string
Returns the name of the context item as an xs:string that is either the zero-length string, or has the lexical form of an xs:QName.
The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
If the argument is supplied and is the empty sequence, the function returns the zero-length string.
If the target node has no name (that is, if it is a document node, a comment, a text node, or a namespace binding having no name), the function returns the zero-length string.
Otherwise, the value returned is fn:string(fn:node-name($arg)).
name($arg as node()?) as xs:string
Returns the name of $arg as an xs:string that is either the zero-length string, or has the lexical form of an xs:QName.
If the argument is omitted, it defaults to the context item (.). The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
If the argument is supplied and is the empty sequence, the function returns the zero-length string.
If the target node has no name (that is, if it is a document node, a comment, a text node, or a namespace binding having no name), the function returns the zero-length string.
Otherwise, the value returned is fn:string(fn:node-name($arg)).
$arg? | The input node |
namespace-uri() as xs:anyURI
Returns the namespace URI of the xs:QName of the context item.
The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
If $arg is neither an element nor an attribute node, or if it is an element or attribute node whose expanded-QName (as determined by the dm:node-name accessor in the Section 5.11 node-name AccessorDM) is in no namespace, then the function returns the xs:anyURI corresponding to the zero-length string.
namespace-uri($arg as node()?) as xs:anyURI
Returns the namespace URI of the xs:QName of $arg.
If the argument is omitted, it defaults to the context node (.). The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
If $arg is neither an element nor an attribute node, or if it is an element or attribute node whose expanded-QName (as determined by the dm:node-name accessor in the Section 5.11 node-name AccessorDM) is in no namespace, then the function returns the xs:anyURI corresponding to the zero-length string.
$arg? | The input node |
namespace-uri-for-prefix($prefix as xs:string?, $element as element()) as xs:anyURI?
Returns the namespace URI of one of the in-scope namespaces for $element, identified by its namespace prefix.
If $element has an in-scope namespace whose namespace prefix is equal to $prefix, it returns the namespace URI of that namespace. If $prefix 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.
Prefixes are equal only if their Unicode code points match exactly.
$prefix? | The namespace prefix |
$element | The element |
namespace-uri-from-QName($arg as xs:QName?) as xs:anyURI?
Returns the namespace URI for $arg. If $arg is the empty sequence, returns the empty sequence.
$arg? | The QName |
nilled($arg as node()?) as xs:boolean?
Returns an xs:boolean indicating whether the argument node is "nilled". If the argument is not an element node, returns the empty sequence. If the argument is the empty sequence, returns the empty sequence.
$arg? | The input node |
node-name() as xs:QName?
Returns an expanded-QName for node kinds that can have names. For other kinds of nodes it returns the empty sequence. If the context item is the empty sequence, the empty sequence is returned.
node-name($arg as node()?) as xs:QName?
Returns an expanded-QName for node kinds that can have names. For other kinds of nodes it returns the empty sequence. If $arg is the empty sequence, the empty sequence is returned.
$arg? | The input node |
normalize-space() as xs:string
Returns the calculated string value of the context item with whitespace normalized by stripping leading and trailing whitespace and replacing sequences of one or more than one whitespace character with a single space, #x20.
The whitespace characters are defined in the metasymbol S (Production 3) of [Extensible Markup Language (XML) 1.0 Recommendation (Third Edition)].
Note:
The definition of the metasymbol S (Production 3), is unchanged in [Extensible Markup Language (XML) 1.1 Recommendation].
If no argument is supplied, $arg defaults to the string value (calculated using fn:string()) of the context item (.). If no argument is supplied or if the argument is the context item and the context item is undefined an error is raised: [err:XPDY0002].
normalize-space($arg as xs:string?) as xs:string
Returns the value of $arg with whitespace normalized by stripping leading and trailing whitespace and replacing sequences of one or more than one whitespace character with a single space, #x20.
The whitespace characters are defined in the metasymbol S (Production 3) of [Extensible Markup Language (XML) 1.0 Recommendation (Third Edition)].
Note:
The definition of the metasymbol S (Production 3), is unchanged in [Extensible Markup Language (XML) 1.1 Recommendation].
If the value of $arg is the empty sequence, returns the zero-length string.
If no argument is supplied, $arg defaults to the string value (calculated using fn:string()) of the context item (.). If no argument is supplied or if the argument is the context item and the context item is undefined an error is raised: [err:XPDY0002].
$arg? | The string to normalize |
normalize-unicode($arg as xs:string?) as xs:string
Returns the value of the context item normalized according to the nomalization form "NFC"
$arg? | The unicode string to normalize |
normalize-unicode($arg as xs:string?, $normalization-form as xs:string) as xs:string
Returns the value of $arg normalized according to the normalization criteria for a normalization form identified by the value of $normalization-form. The effective value of the $normalization-form is computed by removing leading and trailing blanks, if present, and converting to upper case.
If the value of $arg is the empty sequence, returns the zero-length string.
See [Character Model for the World Wide Web 1.0: Normalization] for a description of the normalization forms.
- If the effective value of $normalization-form is "NFC", then the value returned by the function is the value of $arg in Unicode Normalization Form C (NFC).
- If the effective value of $normalization-form is "NFD", then the value returned by the function is the value of $arg in Unicode Normalization Form D (NFD).
- If the effective value of $normalization-form is "NFKC", then the value returned by the function is the value of $arg in Unicode Normalization Form KC (NFKC).
- If the effective value of $normalization-form is "NFKD", then the value returned by the function is the value of $arg in Unicode Normalization Form KD (NFKD).
- If the effective value of $normalization-form is "FULLY-NORMALIZED", then the value returned by the function is the value of $arg in the fully normalized form.
- If the effective value of $normalization-form is the zero-length string, no normalization is performed and $arg is returned.
Conforming implementations must support normalization form "NFC" and may support normalization forms "NFD", "NFKC", "NFKD", "FULLY-NORMALIZED". They may also support other normalization forms with implementation-defined semantics. If the effective value of the $normalization-form is other than one of the values supported by the implementation, then an error is raised [err:FOCH0003].
$arg? | The unicode string to normalize |
$normalization-form | The normalization form |
not($arg as item()*) as xs:boolean
Returns true if the effective boolean value is false, and false if the effective boolean value is true.
$arg is reduced to an effective boolean value by applying the fn:boolean() function.
$arg* | The input items |
number() as xs:double
Returns the value of the context item after atomization, converted to an xs:double.
If the context item cannot be converted to an xs:double, the xs:double value NaN is returned. If the context item is undefined an error is raised: [err:XPDY0002]XP.
number($arg as xs:anyAtomicType?) as xs:double
Returns the value indicated by $arg or, if $arg is not specified, the context item after atomization, converted to an xs:double.
Calling the zero-argument version of the function is defined to give the same result as calling the single-argument version with the context item (.). That is, fn:number() is equivalent to fn:number(.).
If $arg is the empty sequence or if $arg or the context item cannot be converted to an xs:double, the xs:double value NaN is returned. If the context item is undefined an error is raised: [err:XPDY0002]XP.
If $arg is the empty sequence, NaN is returned. Otherwise, $arg, or the context item after atomization, is converted to an xs:double following the rules of 17.1.3.2 Casting to xs:double. If the conversion to xs:double fails, the xs:double value NaN is returned.
$arg? | The input item |
one-or-more($arg as item()*) as item()+
Returns $arg if it contains one or more items. Otherwise, raises an error.
$arg* | The input sequence |
outermost($nodes as node()*) as node()*
Returns every node within the input sequence that has no ancestor that is itself a member of the input sequence; the nodes are returned in document order with duplicates eliminated.
$nodes* | The nodes to test |
parse-ietf-date($value as xs:string?) as xs:dateTime?
Parses a string containing the date and time in IETF format, returning the corresponding xs:dateTime value.
$value? | The IETF-dateTime string |
parse-json($json-text as xs:string?) as item()?
Parses a string supplied in the form of a JSON text, returning the results typically in the form of a map or array.
$json-text? | JSON string |
parse-json($json-text as xs:string?, $options as map(*)) as item()?
Parses a string supplied in the form of a JSON text, returning the results typically in the form of a map or array.
$json-text? | JSON string |
$options | Parsing options |
parse-xml($arg as xs:string?) as document-node()?
This function takes as input an XML document represented as a string, and returns the document node at the root of an XDM tree representing the parsed document.
$arg? | The string to be parsed |
parse-xml-fragment($arg as xs:string?) as document-node()?
This function takes as input an XML external entity represented as a string,and returns the document node at the root of an XDM tree representing the parsed document fragment.
$arg? | The string to be parsed |
position() as xs:integer
Returns the context position from the dynamic context. If the context item is undefined, raises an error.
prefix-from-QName($arg as xs:QName?) as xs:NCName?
Returns an xs:NCName representing the prefix of $arg. If $arg is the empty sequence, returns the empty sequence.
$arg? | The QName |
random-number-generator() as map(*)
Returns a random number generator, which can be used to generate sequences of random numbers.
random-number-generator($seed as xs:anyAtomicType?) as map(*)
Returns a random number generator, which can be used to generate sequences of random numbers.
$seed? | A seed value for the random generator |
remove($target as item()*, $position as xs:integer) as item()*
Returns a new sequence constructed from the value of $target with the item at $position removed.
If $position is less than 1 or greater than the number of items in $target, $target is returned. Otherwise, the value returned by the function consists of all items of $target whose index is less than $position, followed by all items of $target whose index is greater than $position. If $target is the empty sequence, the empty sequence is returned.
$target* | The input sequence |
$position | The position of the value to be removed |
replace($input as xs:string?, $pattern as xs:string, $replacement as xs:string) as xs:string
The function returns the xs:string that is obtained by replacing each non-overlapping substring of $input that matches the given $pattern with an occurrence of the $replacement string. If $input is the empty sequence, it is interpreted as the zero-length string. If two overlapping substrings of $input both match the $pattern, then only the first one (that is, the one whose first character comes first in the $input string) is replaced. Within the $replacement string, a variable $N may be used to refer to the substring captured by the Nth parenthesized sub-expression in the regular expression. For each match of the pattern, these variables are assigned the value of the content matched by the relevant sub-expression, and the modified replacement string is then substituted for the characters in $input that matched the pattern. $0 refers to the substring captured by the regular expression as a whole. More specifically, the rules are as follows, where S is the number of parenthesized sub-expressions in the regular expression, and N is the decimal number formed by taking all the digits that consecutively follow the $ character: 1. If N=0, then the variable is replaced by the substring matched by the regular expression as a whole. 2. If 1<=N<=S, then the variable is replaced by the substring captured by the Nth parenthesized sub-expression. If the Nth parenthesized sub-expression was not matched, then the variable is replaced by the zero-length string. 3. If S<N<=9, then the variable is replaced by the zero-length string. 4. Otherwise (if N>S and N>9), the last digit of N is taken to be a literal character to be included "as is" in the replacement string, and the rules are reapplied using the number N formed by stripping off this last digit.
$input? | The input string |
$pattern | The pattern to match |
$replacement | The string to replace the pattern with |
replace($input as xs:string?, $pattern as xs:string, $replacement as xs:string, $flags as xs:string) as xs:string
The function returns the xs:string that is obtained by replacing each non-overlapping substring of $input that matches the given $pattern with an occurrence of the $replacement string. The $flags argument is interpreted in the same manner as for the fn:matches() function. Calling the four argument version with the $flags argument set to a zero-length string gives the same effect as using the three argument version. If $input is the empty sequence, it is interpreted as the zero-length string. If two overlapping substrings of $input both match the $pattern, then only the first one (that is, the one whose first character comes first in the $input string) is replaced. Within the $replacement string, a variable $N may be used to refer to the substring captured by the Nth parenthesized sub-expression in the regular expression. For each match of the pattern, these variables are assigned the value of the content matched by the relevant sub-expression, and the modified replacement string is then substituted for the characters in $input that matched the pattern. $0 refers to the substring captured by the regular expression as a whole. More specifically, the rules are as follows, where S is the number of parenthesized sub-expressions in the regular expression, and N is the decimal number formed by taking all the digits that consecutively follow the $ character: 1. If N=0, then the variable is replaced by the substring matched by the regular expression as a whole. 2. If 1<=N<=S, then the variable is replaced by the substring captured by the Nth parenthesized sub-expression. If the Nth parenthesized sub-expression was not matched, then the variable is replaced by the zero-length string. 3. If S<N<=9, then the variable is replaced by the zero-length string. 4. Otherwise (if N>S and N>9), the last digit of N is taken to be a literal character to be included "as is" in the replacement string, and the rules are reapplied using the number N formed by stripping off this last digit.
$input? | The input string |
$pattern | The pattern to match |
$replacement | The string to replace the pattern with |
$flags | The flags |
resolve-QName($qname as xs:string?, $element as element()) as xs:QName?
Returns an xs:QName value (that is, an expanded-QName) by taking an xs:string that has the lexical form of an xs:QName (a string in the form "prefix:local-name" or "local-name") and resolving it using the in-scope namespaces for a given element.
If $qname does not have the correct lexical form for xs:QName an error is raised [err:FOCA0002].
If $qname is the empty sequence, returns the empty sequence.
More specifically, the function searches the namespace bindings of $element for a binding whose name matches the prefix of $qname, or the zero-length string if it has no prefix, and constructs an expanded-QName whose local name is taken from the supplied $qname, and whose namespace URI is taken from the string value of the namespace binding.
If the $qname has a prefix and if there is no namespace binding for $element that matches this prefix, then an error is raised [err:FONS0004].
If the $qname has no prefix, and there is no namespace binding for $element corresponding to the default (unnamed) namespace, then the resulting expanded-QName has no namespace part.
The prefix (or absence of a prefix) in the supplied $qname argument is retained in the returned expanded-QName.
$qname? | The QName name |
$element | The element |
resolve-uri($relative as xs:string?) as xs:anyURI?
Resolves $relative against the value of the base-uri property from the static context using an algorithm such as the ones described in [RFC 2396] or [RFC 3986], and the resulting absolute URI reference is returned. An error may be raised [err:FORG0009] in the resolution process.
If $relative is an absolute URI reference, it is returned unchanged.
If $relative or $base is not a valid xs:anyURI an error is raised [err:FORG0002].
If $relative is the empty sequence, the empty sequence is returned.
$relative? | The relative URI |
resolve-uri($relative as xs:string?, $base as xs:string) as xs:anyURI?
Resolves $relative against $base using an algorithm such as the ones described in [RFC 2396] or [RFC 3986], and the resulting absolute URI reference is returned. An error may be raised [err:FORG0009] in the resolution process.
If $relative is an absolute URI reference, it is returned unchanged.
If $relative or $base is not a valid xs:anyURI an error is raised [err:FORG0002].
If $relative is the empty sequence, the empty sequence is returned.
$relative? | The relative URI |
$base | The base URI |
reverse($arg as item()*) as item()*
Reverses the order of items in a sequence. If the argument is an emptysequence, the empty sequence is returned.
$arg* | The sequence to reverse |
root() as node()
Returns the root of the tree to which the context item belongs.
root($arg as node()?) as node()?
Returns the root of the tree to which $arg belongs. This will usually, but not necessarily, be a document node.
If $arg is the empty sequence, the empty sequence is returned.
If $arg is a document node, $arg is returned.
The behavior of the zero argument version of the function is exactly the same as if the context item had been passed in $arg.
$arg? | The input node |
round($arg as xs:numeric?) as xs:numeric?
Returns the number with no fractional part that is closest to the argument $arg. If there are two such numbers, then the one that is closest to positive infinity is returned. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
For xs:float and xs:double arguments, if the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned. In the cases where positive zero or negative zero is returned, negative zero or positive zero may be returned as [XML Schema Part 2: Datatypes Second Edition] does not distinguish between the values positive zero and negative zero.
$arg? | The input number |
round-half-to-even($arg as xs:numeric?) as xs:numeric?
The value returned is the nearest (that is, numerically closest) value to $arg that is a multiple of ten to the power of minus 0. If two such values are equally near (e.g. if the fractional part in $arg is exactly .500...), the function returns the one whose least significant digit is even.
If the type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
The three argument version of the function with $precision = 0 produces the same result as the two argument version.
For arguments of type xs:float and xs:double, if the argument is NaN, positive or negative zero, or positive or negative infinity, then the result is the same as the argument. In all other cases, the argument is cast to xs:decimal, the function is applied to this xs:decimal value, and the resulting xs:decimal is cast back to xs:float or xs:double as appropriate to form the function result. If the resulting xs:decimal value is zero, then positive or negative zero is returned according to the sign of the original argument.
Note that the process of casting to xs:decimal may result in an error [err:FOCA0001].
If $arg is of type xs:float or xs:double, rounding occurs on the value of the mantissa computed with exponent = 0.
$arg? | The input number |
round-half-to-even($arg as xs:numeric?, $precision as xs:integer) as xs:numeric?
The value returned is the nearest (that is, numerically closest) value to $arg that is a multiple of ten to the power of minus $precision. If two such values are equally near (e.g. if the fractional part in $arg is exactly .500...), the function returns the one whose least significant digit is even.
If the type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
The three argument version of the function with $precision = 0 produces the same result as the two argument version.
For arguments of type xs:float and xs:double, if the argument is NaN, positive or negative zero, or positive or negative infinity, then the result is the same as the argument. In all other cases, the argument is cast to xs:decimal, the function is applied to this xs:decimal value, and the resulting xs:decimal is cast back to xs:float or xs:double as appropriate to form the function result. If the resulting xs:decimal value is zero, then positive or negative zero is returned according to the sign of the original argument.
Note that the process of casting to xs:decimal may result in an error [err:FOCA0001].
If $arg is of type xs:float or xs:double, rounding occurs on the value of the mantissa computed with exponent = 0.
$arg? | The input number |
$precision | The precision factor |
seconds-from-dateTime($date-time as xs:dateTime?) as xs:decimal?
Returns an xs:decimal value between 0 and 60.999..., both inclusive, representing the seconds and fractional seconds in the localized value of $date-time. Note that the value can be greater than 60 seconds to accommodate occasional leap seconds used to keep human time synchronized with the rotation of the planet.
$date-time? | The date-time as xs:dateTime |
seconds-from-duration($duration as xs:duration?) as xs:decimal?
Returns an xs:decimal representing the seconds component in the canonical lexical representation of the value of $duration. The result may be negative
$duration? | The duration as xs:duration |
seconds-from-time($time as xs:time?) as xs:decimal?
Returns an xs:decimal value between 0 and 60.999..., both inclusive, representing the seconds and fractional seconds in the localized value of $date. Note that the value can be greater than 60 seconds to accommodate occasional leap seconds used to keep human time synchronized with the rotation of the planet.
$time? | The time as xs:time |
serialize($args as item()*) as xs:string
This function serializes the supplied input sequence $arg as described in XSLT and XQuery Serialization 3.0, returning the serialized representation of the sequence as a string.
$args* | The node set to serialize |
serialize($args as item()*, $parameters as item()?) as xs:string
This function serializes the supplied input sequence $arg as described in XSLT and XQuery Serialization 3.0, returning the serialized representation of the sequence as a string.
$args* | The node set to serialize |
$parameters? | The serialization parameters as either a output:serialization-parameters element or a map |
sort($input as item()*) as item()*
Sorts a supplied sequence.
$input* | $input* |
sort($input as item()*, $collation as xs:string?) as item()*
Sorts a supplied sequence, based on the value of a sort key supplied as a function.
$input* | $input* |
$collation? | $collation? |
sort($input as item()*, $collation as xs:string?, $key as function(*)) as item()*
Sorts a supplied sequence, based on the value of a sort key supplied as a function.
$input* | $input* |
$collation? | $collation? |
$key | $key |
starts-with($source as xs:string?, $prefix as xs:string?) as xs:boolean
Returns an xs:boolean indicating whether or not the value of $source starts with a sequence of collation units that provides a minimal match to the collation units of $prefix according to the collation that is used.
Note:
"Minimal match" is defined in [Unicode Collation Algorithm].
If the value of $source or $prefix is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
If the value of $prefix is the zero-length string, then the function returns true. If the value of $source is the zero-length string and the value of $prefix is not the zero-length string, then the function returns false.
The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error may be raised [err:FOCH0004].
$source? | The source string |
$prefix? | The string to determine if is a prefix of $source |
starts-with($source as xs:string?, $prefix as xs:string?, $collation-uri as xs:string) as xs:boolean
Returns an xs:boolean indicating whether or not the value of $source starts with a sequence of collation units that provides a minimal match to the collation units of $prefix according to the collation that is used.
Note:
"Minimal match" is defined in [Unicode Collation Algorithm].
If the value of $source or $prefix is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
If the value of $prefix is the zero-length string, then the function returns true. If the value of $source is the zero-length string and the value of $prefix is not the zero-length string, then the function returns false.
The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error may be raised [err:FOCH0004]. The third argument $collation-uri is either: 1) the full URI e.g. "http://www.w3.org/2013/collation/UCA?lang=en;strength=secondary", or 2) relative where you only need to specify the last part of a valid full collation-uri, e.g. "?lang=sv-SE", "lang=sv-SE;strength=primary;decomposition=standard" or "swedish".
$source? | The source string |
$prefix? | The string to determine if is a prefix of $source |
$collation-uri | The collation URI |
static-base-uri() as xs:anyURI?
Returns the value of the static base URI property from the static context. If the base-uri property is undefined, the empty sequence is returned.
string() as xs:string
Returns the value of the context item as xs:string. If the context item is undefined, an error is raised.
string($arg as item()?) as xs:string
Returns the value of $arg as xs:string. If the value of $arg is the empty sequence, the zero-length string is returned. If the context item of $arg is undefined, an error is raised.
$arg? | The sequence to get the value of as an xs:string |
string-join($arg as xs:anyAtomicType*) as xs:string
Returns a xs:string created by concatenating the members of the $arg sequence using $separator as a separator. If the value of the separator is the zero-length string, then the members of the sequence are concatenated without a separator. The effect of calling the single-argument version of this function is the same as calling the two-argument version with $separator set to a zero-length string.
$arg* | The sequence to be joined to form the string. If it is empty, a zero-length string is returned. |
string-join($arg as xs:anyAtomicType*, $separator as xs:string) as xs:string
Returns a xs:string created by concatenating the members of the $arg sequence using $separator as a separator. If the value of the separator is the zero-length string, then the members of the sequence are concatenated without a separator.
$arg* | The sequence to be joined to form the string. If it is empty, a zero-length string is returned. |
$separator | The separator to be placed in the string between the items of $arg |
string-length() as xs:integer
Returns an xs:integer equal to the length in characters of the value of the context item. If the context item is undefined an error is raised.
string-length($arg as xs:string?) as xs:integer
Returns an xs:integer equal to the length in characters of the value of $arg. If the value of $arg is the empty sequence, the xs:integer 0 is returned. If no argument is supplied, $arg defaults to the string value (calculated using fn:string()) of the context item (.). If no argument is supplied or if the argument is the context item and the context item is undefined an error is raised
$arg? | The input string |
string-to-codepoints($arg as xs:string?) as xs:integer*
Returns the sequence of unicode code points that constitute an xs:string. If $arg is a zero-length string or the empty sequence, the empty sequence is returned.
$arg? | The input string |
subsequence($source as item()*, $starting-at as xs:double) as item()*
Returns a subsequence of the items in $source-sequence, items starting at the position, $starting-at, up to the end of the sequence are included.
$source* | The source sequence |
$starting-at | The starting position in the $source |
subsequence($source as item()*, $starting-at as xs:double, $length as xs:double) as item()*
Returns a subsequence of the items in $source, starting at the position, $starting-at, including the number of items indicated by $length.
$source* | The source sequence |
$starting-at | The starting position in the $source |
$length | The length of the subsequence |
substring($source as xs:string?, $starting-at as xs:double) as xs:string
Returns the portion of the value of $source beginning at the position indicated by the value of $starting-at and continuing to the end of $source. The characters returned do not extend beyond the end of $source. If $starting-at is zero or negative, only those characters in positions greater than zero are returned.If the value of $source is the empty sequence, the zero-length string is returned.
$source? | The source string |
$starting-at | The starting position |
substring($source as xs:string?, $starting-at as xs:double, $length as xs:double) as xs:string
Returns the portion of the value of $source beginning at the position indicated by the value of $starting-at and continuing for the number of characters indicated by the value of $length. The characters returned do not extend beyond the end of $source. If $starting-at is zero or negative, only those characters in positions greater than zero are returned. If the value of $source is the empty sequence, the zero-length string is returned.
$source? | The source string |
$starting-at | The starting position |
$length | The number of characters in the substring |
substring-after($source as xs:string?, $search as xs:string?) as xs:string
Returns the substring of the value of $source that follows the first occurrence of a sequence of the value of $search. If the value of $source or $search is the empty sequence it is interpreted as the zero-length string. If the value of $search is the zero-length string, the zero-length string is returned. If the value of $source does not contain a string that is equal to the value of $search, the zero-length string is returned.
$source? | The input string |
$search? | The search string |
substring-after($source as xs:string?, $search as xs:string?, $collation-uri as xs:string) as xs:string
Returns the substring of the value of $source that follows the first occurrence of a sequence of the value of $search in the collation $collation-uri. If the value of $source or $search is the empty sequence it is interpreted as the zero-length string. If the value of $search is the zero-length string, the zero-length string is returned. If the value of $source does not contain a string that is equal to the value of $search, the zero-length string is returned. The third argument $collation-uri is either: 1) the full URI e.g. "http://www.w3.org/2013/collation/UCA?lang=en;strength=secondary", or 2) relative where you only need to specify the last part of a valid full collation-uri, e.g. "?lang=sv-SE", "lang=sv-SE;strength=primary;decomposition=standard" or "swedish".
$source? | The input string |
$search? | The search string |
$collation-uri | The collation URI |
substring-before($source as xs:string?, $search as xs:string?) as xs:string
Returns the substring of the value of $source that precedes the first occurrence of a sequence of the value of $search. If the value of $source or $search is the empty sequence it is interpreted as the zero-length string. If the value of $search is the zero-length string, the zero-length string is returned. If the value of $source does not contain a string that is equal to the value of $search, the zero-length string is returned.
$source? | The input string |
$search? | The search string |
substring-before($source as xs:string?, $search as xs:string?, $collation-uri as xs:string) as xs:string
Returns the substring of the value of $source that precedes the first occurrence of a sequence of the value of $search in the collation $collation-uri. If the value of $source or $search is the empty sequence it is interpreted as the zero-length string. If the value of $search is the zero-length string, the zero-length string is returned. If the value of $source does not contain a string that is equal to the value of $search, the zero-length string is returned. The third argument $collation-uri is either: 1) the full URI e.g. "http://www.w3.org/2013/collation/UCA?lang=en;strength=secondary", or 2) relative where you only need to specify the last part of a valid full collation-uri, e.g. "?lang=sv-SE", "lang=sv-SE;strength=primary;decomposition=standard" or "swedish".
$source? | The input string |
$search? | The search string |
$collation-uri | The collation URI |
sum($arg as xs:anyAtomicType*) as xs:anyAtomicType
Returns a value obtained by adding together the values in $arg. If $arg is the the empty sequence the xs:double value 0.0e0 is returned.
$arg* | The sequence of numbers to be summed up |
sum($arg as xs:anyAtomicType*, $default as xs:anyAtomicType?) as xs:anyAtomicType?
Returns a value obtained by adding together the values in $arg. If $arg is the the empty sequence then $default is returned.
$arg* | The sequence of numbers to be summed up |
$default? | The default value if $arg computes to the empty sequence |
tail($sequence as item()*) as item()*
The function returns the value of the expression subsequence($sequence, 2), i.e. a new sequence containing all items of the input sequence except the first.
$sequence* | The source sequence |
timezone-from-date($date as xs:date?) as xs:dayTimeDuration?
Returns the timezone component of $date if any. If $date has a timezone component, then the result is an xs:dayTimeDuration that indicates deviation from UTC; its value may range from +14:00 to -14:00 hours, both inclusive. Otherwise, the result is the empty sequence.If $date is the empty sequence, returns the empty sequence.
$date? | The date as xs:date |
timezone-from-dateTime($date-time as xs:dateTime?) as xs:dayTimeDuration?
Returns the timezone component of $date-time if any. If $date-time has a timezone component, then the result is an xdt:dayTimeDuration that indicates deviation from UTC; its value may range from +14:00 to -14:00 hours, both inclusive. Otherwise, the result is the empty sequence.
$date-time? | The date-time as xs:dateTime |
timezone-from-time($time as xs:time?) as xs:dayTimeDuration?
Returns the timezone component of $time if any. If $time has a timezone component, then the result is an xdt:dayTimeDuration that indicates deviation from UTC; its value may range from +14:00 to -14:00 hours, both inclusive. Otherwise, the result is the empty sequence.
$time? | The time as xs:time |
tokenize($input as xs:string?) as xs:string*
Breaks the input string $input into a sequence of strings,
$input? | The input string |
tokenize($input as xs:string?, $pattern as xs:string) as xs:string*
Breaks the input string $input into a sequence of strings,
$input? | The input string |
$pattern | The tokenization pattern |
tokenize($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:string*
Breaks the input string $input into a sequence of strings,
$input? | The input string |
$pattern | The tokenization pattern |
$flags | The flags |
trace($value as item()*) as item()*
This function is intended to be used in debugging queries by providing a trace of their execution. The input $value is returned, unchanged, as the result of the function. In addition, the inputs $value is serialized with adaptive settings and is written into the eXist log files.
$value* | The values |
trace($value as item()*, $label as xs:string) as item()*
This function is intended to be used in debugging queries by providing a trace of their execution. The input $value is returned, unchanged, as the result of the function. In addition, the inputs $value is serialized with adaptive settings and is written together with $label into the eXist log files.
$value* | The values |
$label | The label in the log file |
translate($arg as xs:string?, $map as xs:string, $trans as xs:string) as xs:string
Returns the value of $arg modified so that every character in the value of $arg that occurs at some position N in the value of $map has been replaced by the character that occurs at position N in the value of $trans.
If the value of $arg is the empty sequence, the zero-length string is returned.
Every character in the value of $arg that does not appear in the value of $map is unchanged.
Every character in the value of $arg that appears at some position M in the value of $map, where the value of $trans is less than M characters in length, is omitted from the returned value. If $map is the zero-length string $arg is returned.
If a character occurs more than once in $map, then the first occurrence determines the replacement character. If $trans is longer than $map, the excess characters are ignored.
i.e. fn:translate("bar","abc","ABC") returns "BAr"
$arg? | The string to be translated |
$map | The map string |
$trans | The translation string |
true() as xs:boolean
Always returns the boolean value true
unordered($arg as item()*) as item()*
Takes a sequence $arg as input and returns an arbitrary implementation dependent permutation of it. Currently, this has no effect in eXist, but it might be used for future optimizations.
$arg* | The input sequence |
unparsed-text($href as xs:string?) as xs:string?
reads an external resource (for example, a file) and returns a string representation of the resource
$href? | the URI to load text from |
unparsed-text($href as xs:string?, $encoding as xs:string) as xs:string?
reads an external resource (for example, a file) and returns a string representation of the resource
$href? | the URI to load text from |
$encoding | character encoding of the resource |
unparsed-text-available($href as xs:string?) as xs:boolean
determines whether a call on the fn:unparsed-text function with identical arguments would return a string
$href? | the URI to load text from |
unparsed-text-available($href as xs:string?, $encoding as xs:string) as xs:boolean
determines whether a call on the fn:unparsed-text function with identical arguments would return a string
$href? | the URI to load text from |
$encoding | character encoding of the resource |
unparsed-text-lines($href as xs:string?) as xs:string*
reads an external resource (for example, a file) and returns its contents as a sequence of strings, one for each line of text in the string representation of the resource
$href? | the URI to load text from |
unparsed-text-lines($href as xs:string?, $encoding as xs:string) as xs:string*
reads an external resource (for example, a file) and returns its contents as a sequence of strings, one for each line of text in the string representation of the resource
$href? | the URI to load text from |
$encoding | character encoding of the resource |
upper-case($arg as xs:string?) as xs:string
Returns the value of $arg after translating every character to its upper-case correspondent as defined in the appropriate case mappings section in the Unicode standard. For versions of Unicode beginning with the 2.1.8 update, only locale-insensitive case mappings should be applied. Beginning with version 3.2.0 (and likely future versions) of Unicode, precise mappings are described in default case operations, which are full case mappings in the absence of tailoring for particular languages and environments. Every lower-case character that does not have an upper-case correspondent, as well as every upper-case character, is included in the returned value in its original form.
$arg? | The text to be converted to all upper-case characters |
xml-to-json($node as node()?) as xs:string?
Converts an XML tree (in w3c 'XML Representation of JSON' format) into a string conforming to the JSON grammar. Basic string (un)escaping.
Read more$node? | The input node |
xml-to-json($node as node()?, $options as map(*)?) as xs:string?
Converts an XML tree (in w3c 'XML Representation of JSON' format) into a string conforming to the JSON grammar. Basic string (un)escaping.
Read more$node? | The input node |
$options? | The options map |
year-from-date($date as xs:date?) as xs:integer?
Returns an xs:integer representing the year in the localized value of $date. The value may be negative.
$date? | The date as xs:date |
year-from-dateTime($date-time as xs:dateTime?) as xs:integer?
Returns an xs:integer representing the year in the localized value of $date-time. The value may be negative.
$date-time? | The date-time as xs:dateTime |
years-from-duration($duration as xs:duration?) as xs:integer?
Returns an xs:integer representing the years component in the canonical lexical representation of the value of $duration. The result may be negative.
$duration? | The duration as xs:duration |
zero-or-one($arg as item()*) as item()?
Returns the argument sequence $arg if it contains zero or one items. Otherwise, raises an error.
$arg* | The sequence to be tested for cardinality |