From 8098aeacd93a41b696fbf6dd7048df2a337d5e15 Mon Sep 17 00:00:00 2001 From: Mikolaj Widla Date: Tue, 18 Apr 2023 10:05:44 +0200 Subject: [PATCH] Added new tooltips for XPath 3.0 and 3.1 Co-authored-by: widlam Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/139 Reviewed-by: Adam Bem Reviewed-by: Dariusz Augustyniak Co-authored-by: Mikolaj Widla Co-committed-by: Mikolaj Widla --- Frontend/assets/css/tools/r11form.css | 3 +- Frontend/tools/xpath.html | 14087 ++++++++++++++++++++++-- 2 files changed, 12875 insertions(+), 1215 deletions(-) diff --git a/Frontend/assets/css/tools/r11form.css b/Frontend/assets/css/tools/r11form.css index 2c70e8c..4430b85 100644 --- a/Frontend/assets/css/tools/r11form.css +++ b/Frontend/assets/css/tools/r11form.css @@ -440,12 +440,11 @@ body { .content { padding: 0px 15px 0px 15px ; - text-align: justify; + text-align: left; overflow: hidden; transition: max-height .2s ease-out; max-height: 0px; border-left: #c0c2c3 2px solid; - } .collapsibleMini::before{ diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index 999cb7c..7f82f5d 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -29,7 +29,7 @@

+

XPath 2.0 introduced many new features XQuery-cośtam:
@@ -120,42 +135,42 @@ fn:position()

- Returns the position of the current context node
-
- W3C Documentation reference: Node-Set-Functions + Returns the position of the current context node
+
+ W3C Documentation reference: Node-Set-Functions
fn:count()
- Returns the number of nodes in the node-set
- Arguments: - - - - - - - - - -
TypeDescription
node-setNode-set to count nodes in
Examples:
- - - - - - - - - - - - - -
ExpressionResult
count(//b:book)5
count(//person[@id>5])17

- W3C Documentation reference: Node-Set-Functions + Returns the number of nodes in the node-set
+ Arguments: + + + + + + + + + +
TypeDescription
node-setNode-set to count nodes in
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
count(//b:book)5
count(//person[@id>5])17

+ W3C Documentation reference: Node-Set-Functions
@@ -163,9 +178,9 @@ fn:id()
- Returns the element specified by it's unique id, requires DTD
-
- W3C Documentation reference: Node-Set-Functions + Returns the element specified by it's unique id, requires DTD
+
+ W3C Documentation reference: Node-Set-Functions
@@ -173,33 +188,33 @@ fn:local-name()
- Returns the local-name for the first node in the node-set
- Arguments: - - - - - - - - - -
TypeDescription
node-setExtract first node and return its local name
Examples:
- - - - - - - - - - - - - -
ExpressionResult
local-name(//b:books)b:book
local-name(//b:book)b:title

- W3C Documentation reference: Node-Set-Functions + Returns the local-name for the first node in the node-set
+ Arguments: + + + + + + + + + +
TypeDescription
node-setExtract first node and return its local name
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
local-name(//b:books)b:book
local-name(//b:book)b:title

+ W3C Documentation reference: Node-Set-Functions
@@ -207,9 +222,9 @@ fn:local-name()
- Returns the local-name for the context node
-
- W3C Documentation reference: Node-Set-Functions + Returns the local-name for the context node
+
+ W3C Documentation reference: Node-Set-Functions
@@ -217,29 +232,29 @@ fn:namespace-uri()
- Returns the namespace-uri for the first node in the node-set
- Arguments: - - - - - - - - - -
TypeDescription
node-setExtract first node and return the namespace URI
Examples:
- - - - - - - - - -
ExpressionResult
namespace-uri(//b:book)http://www.book.com

- W3C Documentation reference: Node-Set-Functions + Returns the namespace-uri for the first node in the node-set
+ Arguments: + + + + + + + + + +
TypeDescription
node-setExtract first node and return the namespace URI
Examples:
+ + + + + + + + + +
ExpressionResult
namespace-uri(//b:book)http://www.book.com

+ W3C Documentation reference: Node-Set-Functions
@@ -247,9 +262,9 @@ fn:namespace-uri()
- Returns the namespace-uri for the context node
-
- W3C Documentation reference: Node-Set-Functions + Returns the namespace-uri for the context node
+
+ W3C Documentation reference: Node-Set-Functions
@@ -257,37 +272,37 @@ fn:name()
- Returns the name for the first node in the node-set
- Arguments: - - - - - - - - - -
TypeDescription
node-set (Optional)Extract first node and return QName
Examples:
- - - - - - - - - - - - - -
ExpressionResult
name(//b:books/*)b:book
name(//b:book/*)b:title

- W3C Documentation reference: Node-Set-Functions + Returns the name for the first node in the node-set
+ Arguments: + + + + + + + + + +
TypeDescription
node-set (Optional)Extract first node and return QName
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
name(//b:books/*)b:book
name(//b:book/*)b:title

+ W3C Documentation reference: Node-Set-Functions
- +
- +
@@ -298,95 +313,101 @@ fn:boolean()
- The boolean function converts its argument to a boolean as follows: -
    -
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • -
  • a node-set is true if and only if it is non-empty
  • -
  • a string is true if and only if its length is non-zero
  • -
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • -
+ The boolean function converts its argument to a boolean as follows: +
    +
  • a number is true if and only if it is neither positive or negative zero nor NaN +
  • +
  • a node-set is true if and only if it is non-empty
  • +
  • a string is true if and only if its length is non-zero
  • +
  • an object of a type other than the four basic types is converted to a boolean in + a way that is dependent on that type
  • +
- Arguments: - - - - - - - - - -
TypeDescription
objectThe object to convert to a boolean
Examples:
- - - - - - - - - - - - - -
ExpressionResult
boolean("Release11")true
boolean("")false

- W3C Documentation reference: Boolean-Functions + Arguments: + + + + + + + + + +
TypeDescription
objectThe object to convert to a boolean
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
boolean("Release11")true
boolean("")false

+ W3C Documentation reference: Boolean-Functions
- - fn:not()
- The not function returns true if its argument is false, and false otherwise.
-
- W3C Documentation reference: Boolean-Functions + The not function returns true if its argument is false, and false otherwise.
+
+ W3C Documentation reference: Boolean-Functions
fn:true()
- The true function returns true.
-
- W3C Documentation reference: Boolean-Functions + The true function returns true.
+
+ W3C Documentation reference: Boolean-Functions
fn:false()
- The true function returns false.
-
- W3C Documentation reference: Boolean-Functions + The true function returns false.
+
+ W3C Documentation reference: Boolean-Functions
fn:lang()
- The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then lang returns false. If there is such an attribute, then lang returns true if the attribute value is equal to the argument ignoring case, or if there is some suffix starting with - such that the attribute value is equal to the argument ignoring that suffix of the attribute value and ignoring case.
- Arguments: - - - - - - - - - -
TypeDescription
stringLanguage that will be looked for in context node
Examples: Look W3C documentation
+ The lang function returns true or false depending on whether the language of the context + node as specified by xml:lang attributes is the same as or is a sublanguage of the + language specified by the argument string. The language of the context node is + determined by the value of the xml:lang attribute on the context node, or, if the + context node has no xml:lang attribute, by the value of the xml:lang attribute on the + nearest ancestor of the context node that has an xml:lang attribute. If there is no such + attribute, then lang returns false. If there is such an attribute, then lang returns + true if the attribute value is equal to the argument ignoring case, or if there is some + suffix starting with - such that the attribute value is equal to the argument ignoring + that suffix of the attribute value and ignoring case.
+ Arguments: + + + + + + + + + +
TypeDescription
stringLanguage that will be looked for in context node
Examples: Look W3C documentation

- W3C Documentation reference: Boolean-Functions + W3C Documentation reference: Boolean-Functions
- - -
@@ -396,99 +417,100 @@ fn:string()
- The string function converts an object to a string as follows: A node-set is converted to a string by returning the string-value of the node in the node-set that is first in document order. If the node-set is empty, an empty string is returned.
+ The string function converts an object to a string as follows: A node-set is converted + to a string by returning the string-value of the node in the node-set that is first in + document order. If the node-set is empty, an empty string is returned.
- Arguments: - - - - - - - - - -
TypeDescription
objectThe object to convert to a string
Examples:
- - - - - - - - - -
ExpressionResult
string(10)true

- W3C Documentation reference: String-Functions + Arguments: + + + + + + + + + +
TypeDescription
objectThe object to convert to a string
Examples:
+ + + + + + + + + +
ExpressionResult
string(10)true

+ W3C Documentation reference: String-Functions
fn:concat()
- The concat function returns the concatenation of its arguments.
+ The concat function returns the concatenation of its arguments.
- Arguments: - - - - - - - - - -
TypeDescription
string*Strings to concatenate
Examples:
- - - - - - - - - -
ExpressionResult
concat("Release", 11)Release11

- W3C Documentation reference: String-Functions + Arguments: + + + + + + + + + +
TypeDescription
string*Strings to concatenate
Examples:
+ + + + + + + + + +
ExpressionResult
concat("Release", 11)Release11

+ W3C Documentation reference: String-Functions
fn:starts-with()
- The concat function returns the concatenation of its arguments.
+ The concat function returns the concatenation of its arguments.
- Arguments: - - - - - - - - - - - - - -
TypeDescription
string
stringThe object to convert to a string
Examples:
- - - - - - - - - -
ExpressionResult
concat("Release", 11)Release11

- W3C Documentation reference: String-Functions + Arguments: + + + + + + + + + + + + + +
TypeDescription
string
stringThe object to convert to a string
Examples:
+ + + + + + + + + +
ExpressionResult
concat("Release", 11)Release11

+ W3C Documentation reference: String-Functions
-
@@ -499,211 +521,233 @@ fn:number()
- The number function converts its argument to a number as follows: -
    -
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • -
  • boolean true is converted to 1; boolean false is converted to 0
  • -
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • -
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • -
+ The number function converts its argument to a number as follows: +
    +
  • a string that consists of optional whitespace followed by an optional minus sign + followed by a Number followed by whitespace is converted to the IEEE 754 number + that is nearest (according to the IEEE 754 round-to-nearest rule) to the + mathematical value represented by the string; any other string is converted to + NaN
  • +
  • boolean true is converted to 1; boolean false is converted to 0
  • +
  • a node-set is first converted to a string as if by a call to the string function + and then converted in the same way as a string argument
  • +
  • an object of a type other than the four basic types is converted to a number in + a way that is dependent on that type
  • +
- Arguments: - - - - - - - - - -
TypeDescription
objectThe object to convert to a number
Examples:
- - - - - - - - - - - - - -
ExpressionResult
number(10)10
number("")NaN

- W3C Documentation reference + Arguments: + + + + + + + + + +
TypeDescription
objectThe object to convert to a number
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
number(10)10
number("")NaN

+ W3C Documentation reference
fn:sum()
- The sum function returns the sum, for each node in the argument node-set, of the result of converting the string-values of the node to a number.
+ The sum function returns the sum, for each node in the argument node-set, of the result + of converting the string-values of the node to a number.
- Arguments: - - - - - - - - - -
TypeDescription
node-setNode set to sum
Examples:
- - - - - - - - - -
ExpressionResult
sum(/l:library/l:readerList/p:person/p:readerID)12444

- W3C Documentation reference + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + +
ExpressionResult
sum(/l:library/l:readerList/p:person/p:readerID)12444

+ W3C Documentation reference
fn:floor()
- The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.
+ The floor function returns the largest (closest to positive infinity) number that is not + greater than the argument and that is an integer.
- Arguments: - - - - - - - - - -
TypeDescription
node-setNode set to sum
Examples:
- - - - - - - - - - - - - - - - - -
ExpressionResult
floor(3.1)4
floor(3.9)4
floor(3.5)4

- W3C Documentation reference + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
floor(3.1)4
floor(3.9)4
floor(3.5)4

+ W3C Documentation reference
fn:ceiling()
- The ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer.
+ The ceiling function returns the smallest (closest to negative infinity) number that is + not less than the argument and that is an integer.
- Arguments: - - - - - - - - - -
TypeDescription
node-setNode set to sum
Examples:
- - - - - - - - - - - - - - - - - -
ExpressionResult
floor(3.1)3
floor(3.9)3
floor(3.5)3

- W3C Documentation reference + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
floor(3.1)3
floor(3.9)3
floor(3.5)3

+ W3C Documentation reference
fn:round()
- The round function returns the number that is closest to the argument and that is an integer. If there are two such numbers, then the one that is closest to positive infinity is returned. If the argument is NaN, then NaN is returned. 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. + The round function returns the number that is closest to the argument and that is an + integer. If there are two such numbers, then the one that is closest to positive + infinity is returned. If the argument is NaN, then NaN is returned. 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. -

NOTE

- For these last two cases, the result of calling the round function is not the same as the result of adding 0.5 and then calling the floor function.
+

NOTE

+ For these last two cases, the result of calling the round function is not the same as + the result of adding 0.5 and then calling the floor function.
- Arguments: - - - - - - - - - -
TypeDescription
node-setNode set to sum
Examples:
- - - - - - - - - - - - - - - - - -
ExpressionResult
floor(3.1)3
floor(3.9)4
floor(3.5)3

- W3C Documentation reference + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
floor(3.1)3
floor(3.9)4
floor(3.5)3

+ W3C Documentation reference
- -
- - + + fn:name() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:name()
- Returns the name of a node, as an xs:string that is either the zero-length string, or has the lexical form of an xs:QName.
+ Returns the name of a node, as an xs:string that is either the zero-length string, or + has the lexical form of an xs:QName.
- 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.
+ 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.
+ 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 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.
+ 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)).

@@ -731,23 +775,32 @@ l:library
- W3C Documentation reference + W3C Documentation reference
fn:local-name() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:local-name()
- 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.
+ 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.
+ 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.
+ 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 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.
+ 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 Accessor). This will be an xs:string whose lexical form is an xs:NCName.
+ 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 Accessor). + This will be an xs:string whose lexical form is an xs:NCName.

Arguments: @@ -774,13 +827,16 @@
- W3C Documentation reference + W3C Documentation reference
fn:nilled() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:nilled()
- 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.
+ 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.

Arguments: @@ -807,17 +863,28 @@
- W3C Documentation reference + W3C Documentation reference
fn:base-uri() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:base-uri()
- Returns the value of the base-uri URI property for $arg as defined by the accessor function dm:base-uri() for that kind of node in Section 5.2 base-uri AccessorDM. If $arg is not specified, the behavior is identical to calling the function with the context item (.) as 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.
+ Returns the value of the base-uri URI property for $arg as defined by the accessor + function dm:base-uri() for that kind of node in Section 5.2 base-uri AccessorDM. If $arg + is not specified, the behavior is identical to calling the function with the context + item (.) as 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 the empty sequence, the empty sequence is returned.
- - Document, element and processing-instruction nodes have a base-uri property which may be empty. The base-uri property of all other node types is the empty sequence. The value of the base-uri property is returned if it exists and is not empty. Otherwise, if the node has a parent, the value of dm:base-uri() applied to its parent is returned, recursively. If the node does not have a parent, or if the recursive ascent up the ancestor chain encounters a node whose base-uri property is empty and it does not have a parent, the empty sequence is returned.
+ + Document, element and processing-instruction nodes have a base-uri property which may be + empty. The base-uri property of all other node types is the empty sequence. The value of + the base-uri property is returned if it exists and is not empty. Otherwise, if the node + has a parent, the value of dm:base-uri() applied to its parent is returned, recursively. + If the node does not have a parent, or if the recursive ascent up the ancestor chain + encounters a node whose base-uri property is empty and it does not have a parent, the + empty sequence is returned.

Arguments: @@ -844,19 +911,28 @@
- W3C Documentation reference + W3C Documentation reference
fn:document-uri() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:document-uri()
- Returns the value of the document-uri property for $arg as defined by the dm:document-uri accessor function defined in Section 6.1.2 AccessorsDM.
+ Returns the value of the document-uri property for $arg as defined by the + dm:document-uri accessor function defined in Section 6.1.2 AccessorsDM.
If $arg is the empty sequence, the empty sequence is returned.
- Returns the empty sequence if the node is not a document node. Otherwise, returns the value of the dm:document-uri accessor of the document node.
+ Returns the empty sequence if the node is not a document node. Otherwise, returns the + value of the dm:document-uri accessor of the document node.
- In the case of a document node $D returned by the fn:doc function, or a document node at the root of a tree containing a node returned by the fn:collection function, it will always be true that either fn:document-uri($D) returns the empty sequence, or that the following expression is true: fn:doc(fn:document-uri($D)) is $D. It is implementation-defined whether this guarantee also holds for document nodes obtained by other means, for example a document node passed as the initial context node of a query or transformation.
+ In the case of a document node $D returned by the fn:doc function, or a document node at + the root of a tree containing a node returned by the fn:collection function, it will + always be true that either fn:document-uri($D) returns the empty sequence, or that the + following expression is true: fn:doc(fn:document-uri($D)) is $D. It is + implementation-defined whether this guarantee also holds for document nodes obtained by + other means, for example a document node passed as the initial context node of a query + or transformation.

Arguments: @@ -883,21 +959,32 @@ document-uri(/library/fiction:book[1]) - http://example.com/library.xml (assuming the document URI of the first fiction:book element is "http://example.com/library.xml") + http://example.com/library.xml (assuming the document URI of the first + fiction:book element is "http://example.com/library.xml") document-uri(/library) - http://example.com/library.xml (assuming the document URI of the library element is "http://example.com/library.xml") + http://example.com/library.xml (assuming the document URI of the library + element is "http://example.com/library.xml")
- W3C Documentation reference + W3C Documentation reference
fn:lang() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:lang()
- This function tests whether the language of $node, or the context item if the second argument is omitted, as specified by xml:lang attributes is the same as, or is a sublanguage of, the language specified by $testlang. 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

+ This function tests whether the language of $node, or the context item if the second + argument is omitted, as specified by xml:lang attributes is the same as, or is a + sublanguage of, the language specified by $testlang. 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

Arguments: @@ -918,21 +1005,26 @@ Examples: Look W3C documentation below.
- W3C Documentation reference + W3C Documentation referencefn:root() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:root()
- Returns the root of the tree to which $arg belongs. This will usually, but not necessarily, be a document 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.
- If the function is called without an argument, the context item (.) is used as the default argument. 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.
+ If the function is called without an argument, the context item (.) is used as the + default argument. 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]; if the context item is not a node [err:XPTY0004].

+ The following errors may be raised: if the context item is undefined [err:XPDY0002]; if + the context item is not a node [err:XPTY0004].

Arguments:
@@ -958,13 +1050,15 @@

- W3C Documentation reference + W3C Documentation reference
fn:count() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:count()
- Returns the number of items in the value of $arg. Returns 0 if $arg is the empty sequence.

+ Returns the number of items in the value of $arg. Returns 0 if $arg is the empty + sequence.

Arguments: @@ -994,14 +1088,16 @@

- W3C Documentation reference + W3C Documentation reference
fn:avg() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:avg()
- Returns the number of items in the value of $arg. Returns 0 if $arg is the empty sequence.

+ Returns the number of items in the value of $arg. Returns 0 if $arg is the empty + sequence.

Arguments: @@ -1027,14 +1123,17 @@

- W3C Documentation reference + W3C Documentation reference
fn:max() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:max()
- 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·.

+ 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·.

Arguments: @@ -1068,13 +1167,16 @@

- W3C Documentation reference + W3C Documentation reference
fn:min() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:min()
- 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·.

+ 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·.

Arguments: @@ -1108,16 +1210,21 @@

- W3C Documentation reference + W3C Documentation reference
fn:sum() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:sum()
- Returns a value obtained by adding together the values in $arg. If $zero is not specified, then the value returned for an empty sequence is the xs:integer value 0. If $zero is specified, then the value returned for an empty sequence is $zero.
+ Returns a value obtained by adding together the values in $arg. If $zero is not + specified, then the value returned for an empty sequence is the xs:integer value 0. If + $zero is specified, then the value returned for an empty sequence is $zero.
- Any values of type xs:untypedAtomic in $arg are cast to xs:double. The items in the resulting sequence may be reordered in an arbitrary order. The resulting sequence is referred to below as the converted sequence.

+ Any values of type xs:untypedAtomic in $arg are cast to xs:double. The items in the + resulting sequence may be reordered in an arbitrary order. The resulting sequence is + referred to below as the converted sequence.

Arguments: @@ -1147,9 +1254,10 @@

- W3C Documentation reference + W3C Documentation reference
- +
@@ -1157,26 +1265,33 @@
- - + + fn:boolean() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:boolean()
- Computes the effective boolean value of the sequence $arg. See Section 2.4.3 Effective Boolean ValueXP
+ Computes the effective boolean value of the sequence $arg. See Section 2.4.3 Effective + Boolean ValueXP
If $arg is the empty sequence, fn:boolean returns false.
If $arg is a sequence whose first item is a node, fn:boolean returns true.
- If $arg is a singleton value of type xs:boolean or a derived from xs:boolean, fn:boolean returns $arg.
+ If $arg is a singleton value of type xs:boolean or a derived from xs:boolean, fn:boolean + returns $arg.
- If $arg is a singleton value of type xs:string or a type derived from xs:string, xs:anyURI or a type derived from xs:anyURI or xs:untypedAtomic, fn:boolean returns false if the operand value has zero length; otherwise it returns true.
+ If $arg is a singleton value of type xs:string or a type derived from xs:string, + xs:anyURI or a type derived from xs:anyURI or xs:untypedAtomic, fn:boolean returns false + if the operand value has zero length; otherwise it returns true.
- If $arg is a singleton value of any numeric type or a type derived from a numeric type, fn:boolean returns false if the operand value is NaN or is numerically equal to zero; otherwise it returns true. + If $arg is a singleton value of any numeric type or a type derived from a numeric type, + fn:boolean returns false if the operand value is NaN or is numerically equal to zero; + otherwise it returns true. In all other cases, fn:boolean raises a type error [err:FORG0006].
- The static semantics of this function are described in Section 7.2.4 The fn:boolean and fn:not functionsFS.

+ The static semantics of this function are described in Section 7.2.4 The fn:boolean and + fn:not functionsFS.

Arguments: @@ -1210,15 +1325,16 @@

- W3C Documentation reference + W3C Documentation reference
- + fn:true()
Returns the xs:boolean value true. Equivalent to xs:boolean("1").

- + Return type: xs:boolean

Examples:
@@ -1231,7 +1347,8 @@
true

- W3C Documentation reference + W3C Documentation reference
false
-
W3C Documentation reference + W3C Documentation reference
fn:not()
- $arg is first reduced to an effective boolean value by applying the fn:boolean() function. Returns true if the effective boolean value is false, and false if the effective boolean value is true.

- + $arg is first reduced to an effective boolean value by applying the fn:boolean() + function. Returns true if the effective boolean value is false, and false if the + effective boolean value is true.

+ Arguments and return type: @@ -1286,10 +1406,11 @@
false

- W3C Documentation reference + W3C Documentation reference
- - + +
@@ -1297,123 +1418,140 @@
- + fn:string(object)
- Returns the value of $arg represented as a xs:string. If no argument is supplied, the context item (.) is used as the default argument. 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.
+ Returns the value of $arg represented as a xs:string. If no argument is supplied, the + context item (.) is used as the default argument. 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.
- If the context item is undefined, error [err:XPDY0002]XP is raised.
- - If $arg is the empty sequence, the zero-length string is returned.
- - If $arg is a node, the function returns the string-value of the node, as obtained using the dm:string-value accessor defined in the Section 5.13 string-value AccessorDM.
- - If $arg is an atomic value, then the function returns the same string as is returned by the expression " $arg cast as xs:string " (see 17 Casting).
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringThe object to convert to a string
- Return type: xs:string

- Examples:
- - - - - - - - - - - - - -
ExpressionResult
string((1<0))false
string(.11)0.11

- W3C Documentation reference + If the context item is undefined, error [err:XPDY0002]XP is raised.
+ + If $arg is the empty sequence, the zero-length string is returned.
+ + If $arg is a node, the function returns the string-value of the node, as obtained using + the dm:string-value accessor defined in the Section 5.13 string-value AccessorDM.
+ + If $arg is an atomic value, then the function returns the same string as is returned by + the expression " $arg cast as xs:string " (see 17 Casting).
+ Arguments and return type: + + + + + + + + + +
TypeDescription
stringThe object to convert to a string
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
string((1<0))false
string(.11)0.11

+ W3C Documentation reference
- + fn:codepoints-to-string()
- Creates an xs:string from a sequence of The Unicode Standard code points. Returns the zero-length string if $arg is the empty sequence. If any of the code points in $arg is not a legal XML character, an error is raised [err:FOCH0001].
- Arguments and return type: - - - - - - - - - -
TypeDescription
xs:integer*$arg
- Return type: xs:string

- Examples:
- - - - - - - - - - - - - -
ExpressionResult
codepoints-to-string((2309, 2358, 2378, 2325))अशॊक
codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41))( ͡° ͜ʖ ͡°)

- W3C Documentation reference + Creates an xs:string from a sequence of The Unicode Standard code points. Returns the + zero-length string if $arg is the empty sequence. If any of the code points in $arg is + not a legal XML character, an error is raised [err:FOCH0001].
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:integer*$arg
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
codepoints-to-string((2309, 2358, 2378, 2325))अशॊक
codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41)) + ( ͡° ͜ʖ ͡°)

+ W3C Documentation reference
fn:string-to-codepoints()
- Returns the sequence of The Unicode Standard code points that constitute an xs:string. If $arg is a zero-length string or the empty sequence, the empty sequence is returned.
- Arguments and return type: - - - - - - - - - -
TypeDescription
xs:string*$arg
- Return type: xs:integer*

- Examples:
- - - - - - - - - -
ExpressionResult
string-to-codepoints("Thérèse")(84, 104, 233, 114, 232, 115, 101)

- W3C Documentation reference + Returns the sequence of The Unicode Standard code points that constitute an xs:string. + If $arg is a zero-length string or the empty sequence, the empty sequence is + returned.
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string*$arg
+ Return type: xs:integer*

+ Examples:
+ + + + + + + + + +
ExpressionResult
string-to-codepoints("Thérèse")(84, 104, 233, 114, 232, 115, 101)

+ W3C Documentation reference
fn:compare()
- Returns -1, 0, or 1, depending on whether the value of the $comparand1 is respectively less than, equal to, or greater than the value of $comparand2, according to the rules of the collation that is used.
+ Returns -1, 0, or 1, depending on whether the value of the $comparand1 is respectively + less than, equal to, or greater than the value of $comparand2, according to the rules of + 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.
- The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations.
- If either argument is the empty sequence, the result is the empty sequence.
- - This function, invoked with the first signature, backs up the "eq", "ne", "gt", "lt", "le" and "ge" operators on string values.
+ + This function, invoked with the first signature, backs up the "eq", "ne", "gt", "lt", + "le" and "ge" operators on string values.
Arguments and return type: @@ -1453,13 +1591,17 @@
1

- W3C Documentation reference + W3C Documentation reference
fn:codepoint-equal()
- Returns true or false depending on whether the value of $comparand1 is equal to the value of $comparand2, according to the Unicode code point collation.
+ Returns true or false depending on whether the value of $comparand1 is equal to the + value of $comparand2, according to the Unicode code + point collation.
If either argument is the empty sequence, the result is the empty sequence.
Arguments and return type: @@ -1493,15 +1635,22 @@ false
- W3C Documentation reference + W3C Documentation reference
fn:concat()
- Accepts two or more xs:anyAtomicType arguments and casts 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.
+ Accepts two or more xs:anyAtomicType arguments and casts 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.
- The fn:concat function is specified to allow two or more arguments, which are concatenated together. This is the only function specified in this document that allows a variable number of arguments. This capability is retained for compatibility with [XML Path Language (XPath) Version 1.0].
+ The fn:concat function is specified to allow two or more arguments, which are + concatenated together. This is the only function specified in this document that allows + a variable number of arguments. This capability is retained for compatibility with [XML + Path Language (XPath) Version 1.0].
Arguments and return type: @@ -1533,7 +1682,8 @@ - + @@ -1541,13 +1691,16 @@
ungrateful
concat('Thy ', (), 'old ', "groans", "", ' ring', ' yet', ' in', ' my', ' ancient',' ears.')concat('Thy ', (), 'old ', "groans", "", ' ring', ' yet', ' in', ' my', ' + ancient',' ears.') Thy old groans ring yet in my ancient ears.
Ciao!

- W3C Documentation reference + W3C Documentation reference
fn:string-join()
- Returns a xs:string created by concatenating the members of the $arg1 sequence using $arg2 as a separator. If the value of $arg2 is the zero-length string, then the members of $arg1 are concatenated without a separator.
+ Returns a xs:string created by concatenating the members of the $arg1 sequence using + $arg2 as a separator. If the value of $arg2 is the zero-length string, then the members + of $arg1 are concatenated without a separator.
If the value of $arg1 is the empty sequence, the zero-length string is returned.
Arguments and return type: @@ -1581,19 +1734,28 @@ Blow, blow, thou winter wind!
- W3C Documentation reference + W3C Documentation reference
- + fn:substring()
- Returns the portion of the value of $sourceString beginning at the position indicated by the value of $startingLoc and continuing for the number of characters indicated by the value of $length. The characters returned do not extend beyond $sourceString. If $startingLoc is zero or negative, only those characters in positions greater than zero are returned.
- More specifically, the three argument version of the function returns the characters in $sourceString whose position $p obeys:
+ Returns the portion of the value of $sourceString beginning at the position indicated by + the value of $startingLoc and continuing for the number of characters indicated by the + value of $length. The characters returned do not extend beyond $sourceString. If + $startingLoc is zero or negative, only those characters in positions greater than zero + are returned.
+ More specifically, the three argument version of the function returns the characters in + $sourceString whose position $p obeys:
fn:round($startingLoc) <= $p < fn:round($startingLoc) + fn:round($length)
- The two argument version of the function assumes that $length is infinite and returns the characters in $sourceString whose position $p obeys:
+ The two argument version of the function assumes that $length is infinite and returns + the characters in $sourceString whose position $p obeys:
fn:round($startingLoc) <= $p < fn:round(INF)
- In the above computations, the rules for op:numeric-less-than() and op:numeric-greater-than() apply.
- If the value of $sourceString is the empty sequence, the zero-length string is returned.
+ In the above computations, the rules for op:numeric-less-than() and + op:numeric-greater-than() apply.
+ If the value of $sourceString is the empty sequence, the zero-length string is + returned.
Note:
The first character of a string is located at position 1, not position 0.
@@ -1633,7 +1795,8 @@ ada
- W3C Documentation reference + W3C Documentation reference
- If no argument is supplied, $arg defaults to the string value (calculated using fn:string()) of the context item (.). If no argument is supplied and the context item is undefined an error is raised: [err:XPDY0002].
+ If no argument is supplied, $arg defaults to the string value (calculated using + fn:string()) of the context item (.). If no argument is supplied and the context item is + undefined an error is raised: [err:XPDY0002].
Arguments and return type: @@ -1672,17 +1837,22 @@
0

-
W3C Documentation reference + W3C Documentation reference
fn:normalize-space()
- 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.
+ 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.
If the value of $arg is the empty sequence, returns the zero-length string.
- If no argument is supplied, then $arg defaults to the string value (calculated using fn:string()) of the context item (.). If no argument is supplied and the context item is undefined an error is raised: [err:XPDY0002].
+ If no argument is supplied, then $arg defaults to the string value (calculated using + fn:string()) of the context item (.). If no argument is supplied and the context item is + undefined an error is raised: [err:XPDY0002].
Arguments and return type: @@ -1703,7 +1873,7 @@ - + @@ -1711,13 +1881,17 @@
Result
normalize-space(" The wealthy curled darlings of our nation. ")normalize-space(" The wealthy curled darlings of our nation. ") The wealthy curled darlings of our nation.
""

- W3C Documentation reference + W3C Documentation reference
fn:normalize-unicode()
- Returns the value of $arg normalized according to the normalization criteria for a normalization form identified by the value of $normalizationForm. The effective value of the $normalizationForm is computed by removing leading and trailing blanks, if present, and converting to upper case.
+ Returns the value of $arg normalized according to the normalization criteria for a + normalization form identified by the value of $normalizationForm. The effective value of + the $normalizationForm 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.
@@ -1744,17 +1918,26 @@ Result - normalize-unicode("test ") + normalize-unicode("test ") test
- W3C Documentation reference + W3C Documentation reference
fn:upper-case()
- 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 [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.
+ 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 [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.
If the value of $arg is the empty sequence, the zero-length string is returned.
@@ -1781,13 +1964,22 @@ ABCD0
- W3C Documentation reference + W3C Documentation reference
fn:lower-case()
- 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 [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.
+ 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 [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.
If the value of $arg is the empty sequence, the zero-length string is returned.
@@ -1814,21 +2006,30 @@ abcd0
- W3C Documentation reference + W3C Documentation reference
fn:translate()
- 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 $mapString has been replaced by the character that occurs at position N in the value of $transString.
+ 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 $mapString has been replaced by the character + that occurs at position N in the value of $transString.
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 $mapString is unchanged.
+ Every character in the value of $arg that does not appear in the value of $mapString is + unchanged.
- Every character in the value of $arg that appears at some position M in the value of $mapString, where the value of $transString is less than M characters in length, is omitted from the returned value. If $mapString is the zero-length string $arg is returned.
+ Every character in the value of $arg that appears at some position M in the value of + $mapString, where the value of $transString is less than M characters in length, is + omitted from the returned value. If $mapString is the zero-length string $arg is + returned.
- If a character occurs more than once in $mapString, then the first occurrence determines the replacement character. If $transString is longer than $mapString, the excess characters are ignored.
+ If a character occurs more than once in $mapString, then the first occurrence determines + the replacement character. If $transString is longer than $mapString, the excess + characters are ignored.
Arguments and return type: @@ -1869,21 +2070,32 @@
ABdAB

- W3C Documentation reference + W3C Documentation reference
fn:encode-for-uri()
- This function encodes reserved characters in an xs:string that is intended to be used in the path segment of a URI. It is invertible but not idempotent. This function applies the URI escaping rules defined in section 2 of [RFC 3986] to the xs:string supplied as $uri-part. The effect of the function is to escape reserved characters. Each such character in the string is replaced with its percent-encoded form as described in [RFC 3986].
+ This function encodes reserved characters in an xs:string that is intended to be used in + the path segment of a URI. It is invertible but not idempotent. This function applies + the URI escaping rules defined in section 2 of [RFC 3986] to the xs:string supplied as + $uri-part. The effect of the function is to escape reserved characters. Each such + character in the string is replaced with its percent-encoded form as described in [RFC + 3986].
If $uri-part is the empty sequence, returns the zero-length string.
- All characters are escaped except those identified as "unreserved" by [RFC 3986], that is the upper- and lower-case letters A-Z, the digits 0-9, HYPHEN-MINUS ("-"), LOW LINE ("_"), FULL STOP ".", and TILDE "~".
+ All characters are escaped except those identified as "unreserved" by [RFC 3986], that + is the upper- and lower-case letters A-Z, the digits 0-9, HYPHEN-MINUS ("-"), LOW LINE + ("_"), FULL STOP ".", and TILDE "~".
- Note that this function escapes URI delimiters and therefore cannot be used indiscriminately to encode "invalid" characters in a path segment.
+ Note that this function escapes URI delimiters and therefore cannot be used + indiscriminately to encode "invalid" characters in a path segment.
- 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.
+ 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.
Arguments and return type: @@ -1916,16 +2128,20 @@
http://www.example.com/
100%25%20organic

- W3C Documentation reference + W3C Documentation reference
fn:iri-to-uri()
- 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.
+ 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 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.
Arguments and return type: @@ -1955,17 +2171,26 @@ http://www.example.com/
~b%C3%A9b%C3%A9
- W3C Documentation reference + W3C Documentation reference
fn:escape-html-uri()
- This function escapes all characters except printable characters of the US-ASCII coded character set, specifically the octets ranging from 32 to 126 (decimal). The effect of the function is to escape a URI in the manner html user agents handle attribute values that expect URIs. Each character in $uri to be escaped is replaced 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. This function must always generate hexadecimal values using the upper-case letters A-F.
+ This function escapes all characters except printable characters of the US-ASCII coded + character set, specifically the octets ranging from 32 to 126 (decimal). The effect of + the function is to escape a URI in the manner html user agents handle attribute values + that expect URIs. Each character in $uri to be escaped is replaced 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. This function must always generate hexadecimal values using + the upper-case letters A-F.
If $uri is the empty sequence, returns the zero-length string.

Note:

- The behavior of this function corresponds to the recommended handling of non-ASCII characters in URI attribute values as described in [HTML 4.0] Appendix B.2.1.

+ The behavior of this function corresponds to the recommended handling of non-ASCII + characters in URI attribute values as described in [HTML 4.0] Appendix B.2.1.

Arguments and return type: @@ -1987,25 +2212,33 @@ Result - escape-html-uri("http://www.example.com/00/Weather/CA/Los Angeles#ocean") + escape-html-uri("http://www.example.com/00/Weather/CA/Los Angeles#ocean") + http://www.example.com/00/Weather/CA/Los Angeles#ocean
- W3C Documentation reference + W3C Documentation reference
fn:contains()
- Returns an xs:boolean indicating whether or not the value of $arg1 contains (at the beginning, at the end, or anywhere within) at least one sequence of collation units that provides a minimal match to the collation units in the value of $arg2, according to the collation that is used. + Returns an xs:boolean indicating whether or not the value of $arg1 contains (at the + beginning, at the end, or anywhere within) at least one sequence of collation units that + provides a minimal match to the collation units in the value of $arg2, according to the + collation that is used. - If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable + collation units, it is interpreted as the zero-length string.
If the value of $arg2 is the zero-length string, then the function returns true.
If the value of $arg1 is the zero-length string, 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 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].

Arguments and return type: @@ -2047,19 +2280,27 @@ true
- W3C Documentation reference + W3C Documentation reference
fn:starts-with()
- Returns an xs:boolean indicating whether or not the value of $arg1 starts with a sequence of collation units that provides a match to the collation units of $arg2 according to the collation that is used. + Returns an xs:boolean indicating whether or not the value of $arg1 starts with a + sequence of collation units that provides a match to the collation units of $arg2 + according to the collation that is used. - If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable + collation units, it is interpreted as the zero-length string.
- If the value of $arg2 is the zero-length string, then the function returns true. If the value of $arg1 is the zero-length string and the value of $arg2 is not the zero-length string, then the function returns false.
+ If the value of $arg2 is the zero-length string, then the function returns true. If the + value of $arg1 is the zero-length string and the value of $arg2 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 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].

Arguments and return type: @@ -2101,19 +2342,27 @@ true
- W3C Documentation reference + W3C Documentation reference
fn:ends-with()
- Returns an xs:boolean indicating whether or not the value of $arg1 starts with a sequence of collation units that provides a match to the collation units of $arg2 according to the collation that is used.
+ Returns an xs:boolean indicating whether or not the value of $arg1 starts with a + sequence of collation units that provides a match to the collation units of $arg2 + according to the collation that is used.
- If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable + collation units, it is interpreted as the zero-length string.
- If the value of $arg2 is the zero-length string, then the function returns true. If the value of $arg1 is the zero-length string and the value of $arg2 is not the zero-length string, then the function returns false.
+ If the value of $arg2 is the zero-length string, then the function returns true. If the + value of $arg1 is the zero-length string and the value of $arg2 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 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].

Arguments and return type: @@ -2155,21 +2404,29 @@ true
- W3C Documentation reference + W3C Documentation reference
fn:substring-before()
- Returns the substring of the value of $arg1 that precedes in the value of $arg1 the first occurrence of a sequence of collation units that provides a minimal match to the collation units of $arg2 according to the collation that is used.
+ Returns the substring of the value of $arg1 that precedes in the value of $arg1 the + first occurrence of a sequence of collation units that provides a minimal match to the + collation units of $arg2 according to the collation that is used.
- If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable + collation units, it is interpreted as the zero-length string.
- If the value of $arg2 is the zero-length string, then the function returns the zero-length string.
+ If the value of $arg2 is the zero-length string, then the function returns the + zero-length string.
- If the value of $arg1 does not contain a string that is equal to the value of $arg2, then the function returns the zero-length string.
+ If the value of $arg1 does not contain a string that is equal to the value of $arg2, + then the function returns the zero-length string.
- 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 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].

Arguments and return type: @@ -2207,21 +2464,29 @@ <empty string>
- W3C Documentation reference + W3C Documentation reference
fn:substring-after()
- Returns the substring of the value of $arg1 that follows in the value of $arg1 the first occurrence of a sequence of collation units that provides a minimal match to the collation units of $arg2 according to the collation that is used.
+ Returns the substring of the value of $arg1 that follows in the value of $arg1 the first + occurrence of a sequence of collation units that provides a minimal match to the + collation units of $arg2 according to the collation that is used.
- If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable + collation units, it is interpreted as the zero-length string.
- If the value of $arg2 is the zero-length string, then the function returns the value of $arg1.
+ If the value of $arg2 is the zero-length string, then the function returns the value of + $arg1.
- If the value of $arg1 does not contain a string that is equal to the value of $arg2, then the function returns the zero-length string.
+ If the value of $arg1 does not contain a string that is equal to the value of $arg2, + then the function returns the zero-length string.
- 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 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].

Arguments and return type: @@ -2259,23 +2524,32 @@ too
- W3C Documentation reference + W3C Documentation reference
fn:matches()
- 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 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 the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.
+ The effect of calling the first version of this function (omitting the argument $flags) + is the same as the effect of calling the second version with the $flags argument set to + a zero-length string. 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).
+ 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).
- 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: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.

+ 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.

Arguments and return type: @@ -2313,23 +2587,36 @@ false
- W3C Documentation reference + W3C Documentation reference
fn:replace()
- 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 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 effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.
+ The effect of calling the first version of this function (omitting the argument $flags) + is the same as the effect of calling the second version with the $flags argument set to + a zero-length string. Flags are defined in 7.6.1.1 Flags.
- The $flags argument is interpreted in the same manner as for the fn:matches() function.
+ The $flags argument is interpreted in the same manner as for the fn:matches() + function.
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. + 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.

+ 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.

Arguments and return type: @@ -2375,23 +2662,33 @@ b
- W3C Documentation reference + W3C Documentation reference
fn:tokenize()
- This function breaks the $input string into a sequence of strings, treating any substring that matches $pattern as a separator. The separators themselves are not returned.
+ This function breaks the $input string into a sequence of strings, treating any + substring that matches $pattern as a separator. The separators themselves are not + returned.
- The effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.
+ The effect of calling the first version of this function (omitting the argument $flags) + is the same as the effect of calling the second version with the $flags argument set to + a zero-length string. Flags are defined in 7.6.1.1 Flags.
The $flags argument is interpreted in the same way as for the fn:matches() function.
- If $input is the empty sequence, or if $input is the zero-length string, the result is the empty sequence.
+ If $input is the empty sequence, or if $input is the zero-length string, the result is + the empty sequence.
- If the supplied $pattern matches a zero-length string, that is, if fn:matches("", $pattern, $flags) returns true, then an error is raised: [err:FORX0003].
+ If the supplied $pattern matches a zero-length string, that is, if fn:matches("", + $pattern, $flags) returns true, then an error is raised: [err:FORX0003].
- If a separator occurs at the start of the $input string, the result sequence will start with a zero-length string. Zero-length strings will also occur in the result sequence if a separator occurs at the end of the $input string, or if two adjacent substrings match the supplied $pattern.

+ If a separator occurs at the start of the $input string, the result sequence will start + with a zero-length string. Zero-length strings will also occur in the result sequence if + a separator occurs at the end of the $input string, or if two adjacent substrings match + the supplied $pattern.

Arguments and return type: @@ -2433,7 +2730,8 @@ ("1", "15", "", "24", "50", "")
- W3C Documentation reference + W3C Documentation reference
@@ -2443,18 +2741,25 @@
- - + fn:number() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:number()
- Returns the value indicated by $arg or, if $arg is not specified, the context item after atomization, converted to an 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(.).
+ 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 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.
+ 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.

Arguments: @@ -2469,17 +2774,25 @@ Return type: xs:double

- W3C Documentation reference + W3C Documentation reference
- + fn:abs() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:abs()
- Returns the absolute value of $arg. If $arg is negative returns -$arg otherwise returns $arg. 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.
+ Returns the absolute value of $arg. If $arg is negative returns -$arg otherwise returns + $arg. 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 zero or negative zero, then positive zero is returned. If the argument is positive or negative infinity, positive infinity is returned.
+ For xs:float and xs:double arguments, if the argument is positive zero or negative zero, + then positive zero is returned. If the argument is positive or negative infinity, + positive infinity is returned.
- For detailed type semantics, see Section 7.2.3 The fn:abs, fn:ceiling, fn:floor, fn:round, and fn:round-half-to-even functions.
+ For detailed type semantics, see Section 7.2.3 The fn:abs, fn:ceiling, fn:floor, + fn:round, and fn:round-half-to-even functions.

Arguments: @@ -2509,15 +2822,22 @@
2137

- W3C Documentation reference + W3C Documentation reference
fn:ceiling() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:ceiling()
- Returns the smallest (closest to negative infinity) number with no fractional part that is not less than the value of $arg. 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.
+ Returns the smallest (closest to negative infinity) number with no fractional part that + is not less than the value of $arg. 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 zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero and greater than -1, negative zero is returned.
+ For xs:float and xs:double arguments, 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 and greater than -1, negative zero is returned.

Arguments: @@ -2551,15 +2871,21 @@
11

- W3C Documentation reference + W3C Documentation reference
fn:floor() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:floor()
- Returns the largest (closest to positive infinity) number with no fractional part that is not greater than the value of $arg. 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.
+ Returns the largest (closest to positive infinity) number with no fractional part that + is not greater than the value of $arg. 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 float and double arguments, if the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned.
+ For float and double arguments, if the argument is positive zero, then positive zero is + returned. If the argument is negative zero, then negative zero is returned.

Arguments: @@ -2593,15 +2919,28 @@
10

- W3C Documentation reference + W3C Documentation reference
fn:round() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:round()
- Returns the number with no fractional part that is closest to the argument. 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.
+ Returns the number with no fractional part that is closest to the argument. 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.
+ 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.
For the last two cases, note that the result is not the same as fn:floor(x+0.5).

@@ -2637,23 +2976,39 @@ -10
- W3C Documentation reference + W3C Documentation reference
fn:round-half-to-even() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:round-half-to-even()
- 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.
+ 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.
+ 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 first signature of this function produces the same result as the second signature with $precision=0.
+ The first signature of this function produces the same result as the second signature + with $precision=0.
- 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.
+ 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].
+ 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.
+ If $arg is of type xs:float or xs:double, rounding occurs on the value of the mantissa + computed with exponent = 0.

Arguments: @@ -2695,30 +3050,35 @@
3

- W3C Documentation reference + W3C Documentation reference
- +
- +
- + fn:data() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:data()
fn:data takes a sequence of items and returns a sequence of atomic values.
- The result of fn:data is the sequence of atomic values produced by applying the following rules to each item in $arg:
+ The result of fn:data is the sequence of atomic values produced by applying the + following rules to each item in $arg:
  • If the item is an atomic value, it is returned.
  • If the item is a node:
      -
    • If the node does not have a typed value an error is raised [err:FOTY0012].
    • -
    • Otherwise, fn:data() returns the typed value of the node as defined by the accessor function dm:typed-value in Section 5.15 typed-value AccessorDM.
    • +
    • If the node does not have a typed value an error is raised + [err:FOTY0012].
    • +
    • Otherwise, fn:data() returns the typed value of the node as defined by + the accessor function dm:typed-value in Section 5.15 typed-value + AccessorDM.
@@ -2747,21 +3107,26 @@
- W3C Documentation reference + W3C Documentation reference
fn:index-of() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:index-of()
- Returns the root of the tree to which $arg belongs. This will usually, but not necessarily, be a document 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.
- If the function is called without an argument, the context item (.) is used as the default argument. 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.
+ If the function is called without an argument, the context item (.) is used as the + default argument. 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]; if the context item is not a node [err:XPTY0004].

+ The following errors may be raised: if the context item is undefined [err:XPDY0002]; if + the context item is not a node [err:XPTY0004].

Arguments: @@ -2803,14 +3168,16 @@

- W3C Documentation reference + W3C Documentation reference
fn:empty() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:empty()
- If the value of $arg is the empty sequence, the function returns true; otherwise, the function returns false.

+ If the value of $arg is the empty sequence, the function returns true; otherwise, the + function returns false.

Arguments: @@ -2836,14 +3203,16 @@

- W3C Documentation reference + W3C Documentation reference
fn:exists() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:exists()
- If the value of $arg is not the empty sequence, the function returns true; otherwise, the function returns false.

+ If the value of $arg is not the empty sequence, the function returns true; otherwise, + the function returns false.

Arguments: @@ -2869,14 +3238,19 @@

- W3C Documentation reference + W3C Documentation reference
fn:distinct-values() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:distinct-values()
- Returns the sequence that results from removing from $arg all but one of a set of values that are eq to one other. 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. The order in which the sequence of values is returned is ·implementation dependent·.

+ Returns the sequence that results from removing from $arg all but one of a set of values + that are eq to one other. 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. The order in which the sequence of + values is returned is ·implementation dependent·.

Arguments: @@ -2906,19 +3280,27 @@

- W3C Documentation reference + W3C Documentation reference
fn:insert-before() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:insert-before()
- 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.)
+ 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.
+ 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.
+ 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.

+ 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.

Arguments: @@ -2961,15 +3343,21 @@

- W3C Documentation reference + W3C Documentation reference
fn:remove() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:remove()
- Returns a new sequence constructed from the value of $target with the item at the position specified by the value of $position removed.
+ Returns a new sequence constructed from the value of $target with the item at the + position specified by the value of $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.

+ 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.

Arguments: @@ -3008,14 +3396,16 @@

- W3C Documentation reference + W3C Documentation reference
fn:reverse() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:reverse()
- Reverses the order of items in a sequence. If $arg is the empty sequence, the empty sequence is returned.

+ Reverses the order of items in a sequence. If $arg is the empty sequence, the empty + sequence is returned.

Arguments: @@ -3050,21 +3440,27 @@

- W3C Documentation reference + W3C Documentation reference
fn:subsequence() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:subsequence()
- Returns the contiguous sequence of items in the value of $sourceSeq beginning at the position indicated by the value of $startingLoc and continuing for the number of items indicated by the value of $length. + Returns the contiguous sequence of items in the value of $sourceSeq beginning at the + position indicated by the value of $startingLoc and continuing for the number of items + indicated by the value of $length. If $sourceSeq is the empty sequence, the empty sequence is returned.
- If $startingLoc is zero or negative, the subsequence includes items from the beginning of the $sourceSeq.
+ If $startingLoc is zero or negative, the subsequence includes items from the beginning + of the $sourceSeq.
- If $length is not specified, the subsequence includes items to the end of $sourceSeq.
+ If $length is not specified, the subsequence includes items to the end of + $sourceSeq.
- If $length is greater than the number of items in the value of $sourceSeq following $startingLoc, the subsequence includes items to the end of $sourceSeq.
+ If $length is greater than the number of items in the value of $sourceSeq following + $startingLoc, the subsequence includes items to the end of $sourceSeq.
The first item of a sequence is located at position 1, not position 0.

@@ -3105,12 +3501,13 @@
- W3C Documentation reference + W3C Documentation reference
fn:unordered() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:unordered()
Returns the items of $sourceSeq in an implementation dependent order.

@@ -3127,13 +3524,15 @@ Return type: item()*

- W3C Documentation reference + W3C Documentation reference
fn:zero-or-one() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:zero-or-one()
- Returns $arg if it contains zero or one items. Otherwise, raises an error [err:FORG0003].

+ Returns $arg if it contains zero or one items. Otherwise, raises an error + [err:FORG0003].

Arguments: @@ -3159,18 +3558,21 @@ - +
zero-or-one(("a", "b"))A sequence of more than one item is not allowed as the first argument of fn:zero-or-one() ("a", "b") A sequence of more than one item is not allowed as the first argument of + fn:zero-or-one() ("a", "b")

- W3C Documentation reference + W3C Documentation reference
fn:one-or-more() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:one-or-more()
- Returns $arg if it contains one or more items. Otherwise, raises an error [err:FORG0004].

+ Returns $arg if it contains one or more items. Otherwise, raises an error + [err:FORG0004].

Arguments: @@ -3200,14 +3602,16 @@

- W3C Documentation reference + W3C Documentation reference
fn:exactly-one() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:exactly-one()
- Returns $arg if it contains exactly one item. Otherwise, raises an error [err:FORG0005].

+ Returns $arg if it contains exactly one item. Otherwise, raises an error + [err:FORG0005].

Arguments: @@ -3233,25 +3637,36 @@ - +
exactly-one(("a", "b"))A sequence of more than one item is not allowed as the first argument of fn:exactly-one() ("a", "b") A sequence of more than one item is not allowed as the first argument of + fn:exactly-one() ("a", "b")

- W3C Documentation reference + W3C Documentation reference
fn:deep-equal() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:deep-equal()
- This function assesses whether two sequences are deep-equal to each other. To be deep-equal, they must contain items that are pairwise deep-equal; and for two items to be deep-equal, they must either be atomic values that compare equal, or nodes of the same kind, with the same name, whose children are deep-equal. This is defined in more detail below. The $collation argument identifies a collation which is used at all levels of recursion when strings are compared (but not when names are compared), according to the rules in 7.3.1 Collations.
+ This function assesses whether two sequences are deep-equal to each other. To be + deep-equal, they must contain items that are pairwise deep-equal; and for two items to + be deep-equal, they must either be atomic values that compare equal, or nodes of the + same kind, with the same name, whose children are deep-equal. This is defined in more + detail below. The $collation argument identifies a collation which is used at all levels + of recursion when strings are compared (but not when names are compared), according to + the rules in 7.3.1 Collations.
If the two sequences are both empty, the function returns true.
- + If the two sequences are of different lengths, the function returns false.
- - If the two sequences are of the same length, the function returns true if and only if every item in the sequence $parameter1 is deep-equal to the item at the same position in the sequence $parameter2. The rules for deciding whether two items are deep-equal follow. - + + If the two sequences are of the same length, the function returns true if and only if + every item in the sequence $parameter1 is deep-equal to the item at the same position in + the sequence $parameter2. The rules for deciding whether two items are deep-equal + follow. + For more in-depth description look into W3C Documentation

Arguments: @@ -3290,18 +3705,23 @@
- W3C Documentation reference + W3C Documentation reference
fn:id() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:id()
- Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $arg. + Returns the sequence of element nodes that have an ID value matching the value of one or + more of the IDREF values supplied in $arg.

Note:

- This function does not have the desired effect when searching a document in which elements of type xs:ID are used as identifiers. To preserve backwards compatibility, a new function fn:element-with-id is therefore being introduced; it behaves the same way as fn:id in the case of ID-valued attributes. + This function does not have the desired effect when searching a document in which + elements of type xs:ID are used as identifiers. To preserve backwards compatibility, a + new function fn:element-with-id is therefore being introduced; it behaves the same way + as fn:id in the case of ID-valued attributes.

Arguments: @@ -3325,13 +3745,15 @@ Return type: element()*

- W3C Documentation reference + W3C Documentation reference
fn:idref() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:idref()
- Returns the sequence of element or attribute nodes with an IDREF value matching the value of one or more of the ID values supplied in $arg.

+ Returns the sequence of element or attribute nodes with an IDREF value matching the + value of one or more of the ID values supplied in $arg.

Arguments: @@ -3354,14 +3776,16 @@
Return type: node()*

- W3C Documentation reference + W3C Documentation reference
fn:doc() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:doc()
- Returns the sequence of element or attribute nodes with an IDREF value matching the value of one or more of the ID values supplied in $arg.

+ Returns the sequence of element or attribute nodes with an IDREF value matching the + value of one or more of the ID values supplied in $arg.

Arguments: @@ -3387,20 +3811,24 @@

- W3C Documentation reference + W3C Documentation reference
fn:doc-available() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:doc-available()
- Retrieves a document using a URI supplied as an xs:string, and returns the corresponding document node.
+ Retrieves a document using a URI supplied as an xs:string, and returns the corresponding + document node.
If $uri is the empty sequence, the result is an empty sequence.
- + If $uri is not a valid URI, an error may be raised [err:FODC0005].
- - If $uri is a relative URI reference, it is resolved relative to the value of the base URI property from the static context. The resulting absolute URI is promoted to an xs:string.

+ + If $uri is a relative URI reference, it is resolved relative to the value of the base + URI property from the static context. The resulting absolute URI is promoted to an + xs:string.

Arguments: @@ -3426,15 +3854,24 @@

- W3C Documentation reference + W3C Documentation reference
fn:collection() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:collection()
- This function takes an xs:string as argument and returns a sequence of nodes obtained by interpreting $arg as an xs:anyURI and resolving it according to the mapping specified in Available collections described in Section C.2 Dynamic Context ComponentsXP. If Available collections provides a mapping from this string to a sequence of nodes, the function returns that sequence. If Available collections maps the string to an empty sequence, then the function returns an empty sequence. If Available collections provides no mapping for the string, an error is raised [err:FODC0004].
- If $arg is not specified, the function returns the sequence of the nodes in the default collection in the dynamic context. See Section C.2 Dynamic Context ComponentsXP. If the value of the default collection is undefined an error is raised [err:FODC0002].

+ This function takes an xs:string as argument and returns a sequence of nodes obtained by + interpreting $arg as an xs:anyURI and resolving it according to the mapping specified in + Available collections described in Section C.2 Dynamic Context ComponentsXP. If + Available collections provides a mapping from this string to a sequence of nodes, the + function returns that sequence. If Available collections maps the string to an empty + sequence, then the function returns an empty sequence. If Available collections provides + no mapping for the string, an error is raised [err:FODC0004].
+ If $arg is not specified, the function returns the sequence of the nodes in the default + collection in the dynamic context. See Section C.2 Dynamic Context ComponentsXP. If the + value of the default collection is undefined an error is raised [err:FODC0002].

Arguments: @@ -3460,13 +3897,15 @@

- W3C Documentation reference + W3C Documentation reference
fn:element-with-id() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:element-with-id()
- Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $arg.

+ Returns the sequence of element nodes that have an ID value matching the value of one or + more of the IDREF values supplied in $arg.

Arguments: @@ -3481,13 +3920,16 @@
Return type: node()*

- W3C Documentation reference + W3C Documentation reference
fn:position() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:position()
- Returns the context position from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) If the context item is undefined, an error is raised: [err:XPDY0002]XP.

+ Returns the context position from the dynamic context. (See Section C.2 Dynamic Context + ComponentsXP.) If the context item is undefined, an error is raised: + [err:XPDY0002]XP.

Return type: xs:integer

Examples: @@ -3502,14 +3944,17 @@
- W3C Documentation reference + W3C Documentation reference
fn:last() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:last()
- Returns the context size from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) If the context item is undefined, an error is raised: [err:XPDY0002]XP.

+ Returns the context size from the dynamic context. (See Section C.2 Dynamic Context + ComponentsXP.) If the context item is undefined, an error is raised: + [err:XPDY0002]XP.

Return type: xs:integer

Examples: @@ -3524,27 +3969,30 @@
- W3C Documentation reference + W3C Documentation reference
-
- +
- + fn:years-from-duration()
- Returns an xs:integer representing the years component in the value of $arg. The result is obtained by casting $arg to an xs:yearMonthDuration (see 17.1.4 Casting to duration types) and then computing the years component as described in 10.3.1.3 Canonical representation.
+ Returns an xs:integer representing the years component in the value of $arg. The result + is obtained by casting $arg to an xs:yearMonthDuration (see 17.1.4 Casting to duration + types) and then computing the years component as described in 10.3.1.3 Canonical + representation.
The result may be negative.
- + If $arg is an xs:dayTimeDuration returns 0.
- + If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -3577,18 +4025,22 @@
0

- W3C Documentation reference + W3C Documentation reference
fn:months-from-duration()
- Returns an xs:integer representing the months component in the value of $arg. The result is obtained by casting $arg to an xs:yearMonthDuration (see 17.1.4 Casting to duration types) and then computing the months component as described in 10.3.1.3 Canonical representation.
+ Returns an xs:integer representing the months component in the value of $arg. The result + is obtained by casting $arg to an xs:yearMonthDuration (see 17.1.4 Casting to duration + types) and then computing the months component as described in 10.3.1.3 Canonical + representation.
The result may be negative.
- + If $arg is an xs:dayTimeDuration returns 0.
- + If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -3621,18 +4073,22 @@
0

- W3C Documentation reference + W3C Documentation reference
fn:days-from-duration()
- Returns an xs:integer representing the days component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the days component as described in 10.3.2.3 Canonical representation.
+ Returns an xs:integer representing the days component in the value of $arg. The result + is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration + types) and then computing the days component as described in 10.3.2.3 Canonical + representation.
The result may be negative.
- + If $arg is an xs:yearMonthDuration returns 0.
- + If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -3665,18 +4121,22 @@
0

- W3C Documentation reference + W3C Documentation reference
fn:hours-from-duration()
- Returns an xs:integer representing the hours component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the hours component as described in 10.3.2.3 Canonical representation.
+ Returns an xs:integer representing the hours component in the value of $arg. The result + is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration + types) and then computing the hours component as described in 10.3.2.3 Canonical + representation.
The result may be negative.
- + If $arg is an xs:yearMonthDuration returns 0.
- + If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -3709,14 +4169,18 @@
0

- W3C Documentation reference + W3C Documentation reference
fn:minutes-from-duration()
- Returns an xs:integer representing the minutes component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the minutes component as described in 10.3.2.3 Canonical representation. + Returns an xs:integer representing the minutes component in the value of $arg. The + result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to + duration types) and then computing the minutes component as described in 10.3.2.3 + Canonical representation. The result may be negative. @@ -3750,14 +4214,18 @@ -30
- W3C Documentation reference + W3C Documentation reference
- + fn:seconds-from-duration()
- Returns an xs:decimal representing the seconds component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the seconds component as described in 10.3.2.3 Canonical representation.
+ Returns an xs:decimal representing the seconds component in the value of $arg. The + result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to + duration types) and then computing the seconds component as described in 10.3.2.3 + Canonical representation.
The result may be negative.
@@ -3791,14 +4259,16 @@ -16.0
- W3C Documentation reference + W3C Documentation reference
fn:year-from-dateTime()
- Returns an xs:integer representing the year component in the localized value of $arg. The result may be negative.
+ Returns an xs:integer representing the year component in the localized value of $arg. + The result may be negative.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -3832,14 +4302,16 @@ 2000
- W3C Documentation reference + W3C Documentation reference
fn:month-from-dateTime()
- Returns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of $arg.
+ Returns an xs:integer between 1 and 12, both inclusive, representing the month component + in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -3873,13 +4345,15 @@ 1
- W3C Documentation reference + W3C Documentation reference
fn:day-from-dateTime()
- Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of $arg.
+ Returns an xs:integer between 1 and 31, both inclusive, representing the day component + in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -3913,14 +4387,16 @@ 1
- W3C Documentation reference + W3C Documentation reference
fn:hours-from-dateTime() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:hours-from-dateTime()
- Returns an xs:integer between 0 and 23, both inclusive, representing the hours component in the localized value of $arg.
+ Returns an xs:integer between 0 and 23, both inclusive, representing the hours component + in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -3954,14 +4430,16 @@ 0
- W3C Documentation reference + W3C Documentation reference
fn:minutes-from-dateTime() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:minutes-from-dateTime()
- Returns an xs:integer value between 0 and 59, both inclusive, representing the minute component in the localized value of $arg.
+ Returns an xs:integer value between 0 and 59, both inclusive, representing the minute + component in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -3991,13 +4469,15 @@ 30
- W3C Documentation reference + W3C Documentation reference
fn:seconds-from-dateTime() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:seconds-from-dateTime()
- Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing + the seconds and fractional seconds in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4023,13 +4503,15 @@ 0
- W3C Documentation reference + W3C Documentation reference
fn:timezone-from-dateTime() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:timezone-from-dateTime()
- Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing + the seconds and fractional seconds in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4063,14 +4545,16 @@ ()
- W3C Documentation reference + W3C Documentation reference
fn:year-from-date() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:year-from-date()
- Returns an xs:integer representing the year in the localized value of $arg. The value may be negative.
+ Returns an xs:integer representing the year in the localized value of $arg. The value + may be negative.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4100,13 +4584,15 @@ 2000
- W3C Documentation reference + W3C Documentation reference
fn:month-from-date() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:month-from-date()
- Returns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of $arg.
+ Returns an xs:integer between 1 and 12, both inclusive, representing the month component + in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4136,13 +4622,15 @@ 1
- W3C Documentation reference + W3C Documentation reference
fn:day-from-date() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:day-from-date()
- Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of $arg.
+ Returns an xs:integer between 1 and 31, both inclusive, representing the day component + in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4172,14 +4660,18 @@ 1
- W3C Documentation reference + W3C Documentation reference
fn:timezone-from-date() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:timezone-from-date()
- Returns the timezone component of $arg if any. If $arg 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.
+ Returns the timezone component of $arg if any. If $arg 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 $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4209,14 +4701,16 @@ PT0S
- W3C Documentation reference + W3C Documentation reference
fn:hours-from-time() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:hours-from-time()
- Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of $arg.
+ Returns an xs:integer between 0 and 23, both inclusive, representing the value of the + hours component in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4246,14 +4740,16 @@ 0
- W3C Documentation reference + W3C Documentation reference
fn:minutes-from-time() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:minutes-from-time()
- Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of $arg.
+ Returns an xs:integer between 0 and 23, both inclusive, representing the value of the + hours component in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4283,13 +4779,15 @@ 0
- W3C Documentation reference + W3C Documentation reference
fn:seconds-from-time() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:seconds-from-time()
- Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing + the seconds and fractional seconds in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4316,14 +4814,16 @@
- W3C Documentation reference + W3C Documentation reference
fn:timezone-from-time() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:timezone-from-time()
- Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing + the seconds and fractional seconds in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4354,35 +4854,48 @@
- W3C Documentation reference + W3C Documentation reference
fn:adjust-date-to-timezone() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:adjust-date-to-timezone()
- Adjusts an xs:date value to a specific timezone, or to no timezone at all. If $timezone is the empty sequence, returns an xs:date without a timezone. Otherwise, returns an xs:date with a timezone. For purposes of timezone adjustment, an xs:date is treated as an xs:dateTime with time 00:00:00.
+ Adjusts an xs:date value to a specific timezone, or to no timezone at all. If $timezone + is the empty sequence, returns an xs:date without a timezone. Otherwise, returns an + xs:date with a timezone. For purposes of timezone adjustment, an xs:date is treated as + an xs:dateTime with time 00:00:00.
+ + If $timezone is not specified, then $timezone is the value of the implicit timezone in + the dynamic context.
- If $timezone is not specified, then $timezone is the value of the implicit timezone in the dynamic context.
- If $arg is the empty sequence, then the result is the empty sequence.
- - A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or greater than PT14H or if does not contain an integral number of minutes.
- - If $arg does not have a timezone component and $timezone is the empty sequence, then the result is the value of $arg.
- - If $arg does not have a timezone component and $timezone is not the empty sequence, then the result is $arg with $timezone as the timezone component.
- - If $arg has a timezone component and $timezone is the empty sequence, then the result is the localized value of $arg without its timezone component.
- + + A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or greater + than PT14H or if does not contain an integral number of minutes.
+ + If $arg does not have a timezone component and $timezone is the empty sequence, then the + result is the value of $arg.
+ + If $arg does not have a timezone component and $timezone is not the empty sequence, then + the result is $arg with $timezone as the timezone component.
+ + If $arg has a timezone component and $timezone is the empty sequence, then the result is + the localized value of $arg without its timezone component.
+ If $arg has a timezone component and $timezone is not the empty sequence, then:
    -
  • Let $srcdt be an xs:dateTime value, with 00:00:00 for the time component and date and timezone components that are the same as the date and timezone components of $arg.
  • -
  • Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt, $timezone)
  • -
  • The result of this function will be a date value that has date and timezone components that are the same as the date and timezone components of $r.
  • +
  • Let $srcdt be an xs:dateTime value, with 00:00:00 for the time component and + date and timezone components that are the same as the date and timezone + components of $arg.
  • +
  • Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt, + $timezone)
  • +
  • The result of this function will be a date value that has date and timezone + components that are the same as the date and timezone components of $r.


- + Arguments and return type: @@ -4410,39 +4923,52 @@ - +
2002-03-07-05:00
adjust-date-to-timezone(xs:date("2002-03-07"), xs:dayTimeDuration("-PT10H"))adjust-date-to-timezone(xs:date("2002-03-07"), xs:dayTimeDuration("-PT10H")) + 2002-03-07-10:00

- W3C Documentation reference + W3C Documentation reference
fn:adjust-time-to-timezone() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:adjust-time-to-timezone()
- Adjusts an xs:time value to a specific timezone, or to no timezone at all. If $timezone is the empty sequence, returns an xs:time without a timezone. Otherwise, returns an xs:time with a timezone.
+ Adjusts an xs:time value to a specific timezone, or to no timezone at all. If $timezone + is the empty sequence, returns an xs:time without a timezone. Otherwise, returns an + xs:time with a timezone.
- If $timezone is not specified, then $timezone is the value of the implicit timezone in the dynamic context.
+ If $timezone is not specified, then $timezone is the value of the implicit timezone in + the dynamic context.
If $arg is the empty sequence, then the result is the empty sequence.
- A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or greater than PT14H or if does not contain an integral number of minutes.
+ A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or greater + than PT14H or if does not contain an integral number of minutes.
- If $arg does not have a timezone component and $timezone is the empty sequence, then the result is $arg.
+ If $arg does not have a timezone component and $timezone is the empty sequence, then the + result is $arg.
- If $arg does not have a timezone component and $timezone is not the empty sequence, then the result is $arg with $timezone as the timezone component.
+ If $arg does not have a timezone component and $timezone is not the empty sequence, then + the result is $arg with $timezone as the timezone component.
- If $arg has a timezone component and $timezone is the empty sequence, then the result is the localized value of $arg without its timezone component.
+ If $arg has a timezone component and $timezone is the empty sequence, then the result is + the localized value of $arg without its timezone component.
If $arg has a timezone component and $timezone is not the empty sequence, then:
    -
  • Let $srcdt be an xs:dateTime value, with an arbitrary date for the date component and time and timezone components that are the same as the time and timezone components of $arg.
  • -
  • Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt, $timezone)
  • -
  • The result of this function will be a time value that has time and timezone components that are the same as the time and timezone components of $r.
  • +
  • Let $srcdt be an xs:dateTime value, with an arbitrary date for the date + component and time and timezone components that are the same as the time and + timezone components of $arg.
  • +
  • Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt, + $timezone)
  • +
  • The result of this function will be a time value that has time and timezone + components that are the same as the time and timezone components of $r.


- + Arguments and return type: @@ -4470,19 +4996,26 @@ - +
10:00:00-05:00
adjust-time-to-timezone(xs:time("10:00:00"), xs:dayTimeDuration("-PT10H"))adjust-time-to-timezone(xs:time("10:00:00"), xs:dayTimeDuration("-PT10H")) + 10:00:00-10:00

- W3C Documentation reference + W3C Documentation reference
fn:current-dateTime() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:current-dateTime()
- Returns the current dateTime (with timezone) from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) This is an xs:dateTime that is current at some time during the evaluation of a query or transformation in which fn:current-dateTime() is executed. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-dateTime() is ·implementation dependent·.

- + Returns the current dateTime (with timezone) from the dynamic context. (See Section C.2 + Dynamic Context ComponentsXP.) This is an xs:dateTime that is current at some time + during the evaluation of a query or transformation in which fn:current-dateTime() is + executed. This function is ·stable·. The precise instant during the query or + transformation represented by the value of fn:current-dateTime() is ·implementation + dependent·.

+ Return type: xs:dateTime

Examples:
@@ -4496,14 +5029,19 @@

- W3C Documentation reference + W3C Documentation reference
fn:current-date() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:current-date()
- Returns xs:date(fn:current-dateTime()). This is an 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. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-date() is ·implementation dependent·.

- + Returns xs:date(fn:current-dateTime()). This is an 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. This function is ·stable·. The precise instant during the + query or transformation represented by the value of fn:current-date() is ·implementation + dependent·.

+ Return type: xs:date

Examples:
@@ -4517,15 +5055,20 @@

- W3C Documentation reference + W3C Documentation reference
fn:current-time() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:current-time()
- Returns xs:date(fn:current-dateTime()). This is an 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. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-date() is ·implementation dependent·.

- + Returns xs:date(fn:current-dateTime()). This is an 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. This function is ·stable·. The precise instant during the + query or transformation represented by the value of fn:current-date() is ·implementation + dependent·.

+ Return type: xs:time

Examples:
@@ -4539,14 +5082,17 @@

- W3C Documentation reference + W3C Documentation reference
fn:implicit-timezone() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:implicit-timezone()
- Returns the value of the implicit timezone property from the dynamic context. Components of the dynamic context are discussed in Section C.2 Dynamic Context ComponentsXP.

- + Returns the value of the implicit timezone property from the dynamic context. Components + of the dynamic context are discussed in Section C.2 Dynamic Context + ComponentsXP.

+ Return type: xs:string

Examples:
@@ -4560,83 +5106,102 @@

- W3C Documentation reference + W3C Documentation reference
- +
- fn:error() -
- The fn:error function is a general function that may be invoked as above but may also be invoked from [XQuery 1.0: An XML Query Language] or [XML Path Language (XPath) 2.0] applications with, for example, an xs:QName argument. -
- W3C Documentation reference -
+ fn:error() +
+ The fn:error function is a general function that may be invoked as above but may also be + invoked from [XQuery 1.0: An XML Query Language] or [XML Path Language (XPath) 2.0] + applications with, for example, an xs:QName argument. +
+ W3C Documentation reference +
- fn:trace() -
- Provides an execution trace intended to be used in debugging queries.
+ fn:trace() +
+ Provides an execution trace intended to be used in debugging queries.
+ + The input $value is returned, unchanged, as the result of the function. In addition, the + inputs $value, converted to an xs:string, and $label may be directed to a trace data + set. The destination of the trace output is ·implementation-defined·. The format of the + trace output is ·implementation dependent·. The ordering of output from invocations of + the fn:trace() function is ·implementation dependent·.
+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
item*$value
xs:string$label
+ Return type: item

+
+ W3C Documentation reference +
- The input $value is returned, unchanged, as the result of the function. In addition, the inputs $value, converted to an xs:string, and $label may be directed to a trace data set. The destination of the trace output is ·implementation-defined·. The format of the trace output is ·implementation dependent·. The ordering of output from invocations of the fn:trace() function is ·implementation dependent·.
- Arguments: - - - - - - - - - - - - - -
TypeDescription
item*$value
xs:string$label
- Return type: item

-
- W3C Documentation reference -
- -
- +
- fn:resolve-uri()
This function enables a relative URI reference to be resolved against an absolute URI. - The first form of this function resolves $relative against the value of the base-uri property from the static context. If the base-uri property is not initialized in the static context an error is raised [err:FONS0005].
- - If $relative is a relative URI reference, it is resolved against $base, or against the base-uri property from the static context, using an algorithm such as those described in [RFC 2396] or [RFC 3986], and the resulting absolute URI reference is returned.
+ The first form of this function resolves $relative against the value of the base-uri + property from the static context. If the base-uri property is not initialized in the + static context an error is raised [err:FONS0005].
+ + If $relative is a relative URI reference, it is resolved against $base, or against the + base-uri property from the static context, using an algorithm such as those described in + [RFC 2396] or [RFC 3986], and the resulting absolute URI reference is returned.
If $relative is an absolute URI reference, it is returned unchanged.
- + If $relative is the empty sequence, the empty sequence is returned.
- - If $relative is not a valid URI according to the rules of the xs:anyURI data type, or if it is not a suitable relative reference to use as input to the chosen resolution algorithm, then an error is raised [err:FORG0002].
- - If $base is not a valid URI according to the rules of the xs:anyURI data type, if it is not a suitable URI to use as input to the chosen resolution algorithm (for example, if it is a relative URI reference, if it is a non-hierarchic URI, or if it contains a fragment identifier), then an error is raised [err:FORG0002].
- - If the chosen resolution algorithm fails for any other reason then an error is raised [err:FORG0009].
- + + If $relative is not a valid URI according to the rules of the xs:anyURI data type, or if + it is not a suitable relative reference to use as input to the chosen resolution + algorithm, then an error is raised [err:FORG0002].
+ + If $base is not a valid URI according to the rules of the xs:anyURI data type, if it is + not a suitable URI to use as input to the chosen resolution algorithm (for example, if + it is a relative URI reference, if it is a non-hierarchic URI, or if it contains a + fragment identifier), then an error is raised [err:FORG0002].
+ + If the chosen resolution algorithm fails for any other reason then an error is raised + [err:FORG0009].
+

Note:

- - Resolving a URI does not dereference it. This is merely a syntactic operation on two character strings. + + Resolving a URI does not dereference it. This is merely a syntactic operation on two + character strings.

Arguments and return type: @@ -4655,25 +5220,37 @@
Return type: xs:anyURI?


- W3C Documentation reference + W3C Documentation reference
- - fn:resolve-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].
+ fn:resolve-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.
+ 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 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.
+ 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, as discussed in Section 2.1 TerminologyDM.

+ The prefix (or absence of a prefix) in the supplied $qname argument is retained in the + returned expanded-QName, as discussed in Section 2.1 TerminologyDM.

Arguments: @@ -4707,17 +5284,24 @@

- W3C Documentation reference + W3C Documentation reference
fn:QName() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:QName()
- Returns an xs:QName with the namespace URI given in $paramURI. If $paramURI is the zero-length string or the empty sequence, it represents "no namespace"; in this case, if the value of $paramQName contains a colon (:), an error is raised [err:FOCA0002]. The prefix (or absence of a prefix) in $paramQName is retained in the returned xs:QName value. The local name in the result is taken from the local part of $paramQName.
+ Returns an xs:QName with the namespace URI given in $paramURI. If $paramURI is the + zero-length string or the empty sequence, it represents "no namespace"; in this case, if + the value of $paramQName contains a colon (:), an error is raised [err:FOCA0002]. The + prefix (or absence of a prefix) in $paramQName is retained in the returned xs:QName + value. The local name in the result is taken from the local part of $paramQName.
- If $paramQName 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.

+ If $paramQName 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.

Arguments: @@ -4747,13 +5331,15 @@
For more extensive examples see W3C documentation below.
- W3C Documentation reference + W3C Documentation reference
fn:prefix-from-QName() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:prefix-from-QName()
- Returns an xs:NCName representing the prefix of $arg. The empty sequence is returned if $arg is the empty sequence or if the value of $arg contains no prefix.

+ Returns an xs:NCName representing the prefix of $arg. The empty sequence is returned if + $arg is the empty sequence or if the value of $arg contains no prefix.

Arguments: @@ -4779,13 +5365,15 @@
- W3C Documentation reference + W3C Documentation reference
fn:local-name-from-QName() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:local-name-from-QName()
- Returns an xs:NCName representing the local part of $arg. If $arg is the empty sequence, returns the empty sequence.

+ Returns an xs:NCName representing the local part of $arg. If $arg is the empty sequence, + returns the empty sequence.

Arguments: @@ -4811,14 +5399,16 @@
- W3C Documentation reference + W3C Documentation reference
fn:prefix-from-QName() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:prefix-from-QName()
- Returns an xs:NCName representing the prefix of $arg. The empty sequence is returned if $arg is the empty sequence or if the value of $arg contains no prefix.

+ Returns an xs:NCName representing the prefix of $arg. The empty sequence is returned if + $arg is the empty sequence or if the value of $arg contains no prefix.

Arguments: @@ -4844,13 +5434,16 @@
- W3C Documentation reference + W3C Documentation reference
fn:namespace-uri-from-QName() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:namespace-uri-from-QName()
- Returns the namespace URI for $arg as an xs:anyURI. If $arg is the empty sequence, the empty sequence is returned. If $arg is in no namespace, the zero-length xs:anyURI is returned.

+ Returns the namespace URI for $arg as an xs:anyURI. If $arg is the empty sequence, the + empty sequence is returned. If $arg is in no namespace, the zero-length xs:anyURI is + returned.

Arguments: @@ -4876,16 +5469,21 @@
- W3C Documentation reference + W3C Documentation reference
fn:namespace-uri-for-prefix() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:namespace-uri-for-prefix()
- Returns the namespace URI of one of the in-scope namespaces for $element, identified by its namespace prefix.
+ 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.
+ 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.

@@ -4917,14 +5515,17 @@ - W3C Documentation reference + W3C Documentation reference
fn:in-scope-prefixes() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:in-scope-prefixes()
- 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.

+ 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.

Arguments: @@ -4950,14 +5551,17 @@
- W3C Documentation reference + W3C Documentation reference
fn:static-base-uri() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:static-base-uri()
- Returns the value of the Base URI property from the static context. If the Base URI property is undefined, the empty sequence is returned. Components of the static context are discussed in Section C.1 Static Context ComponentsXP.

- + Returns the value of the Base URI property from the static context. If the Base URI + property is undefined, the empty sequence is returned. Components of the static context + are discussed in Section C.1 Static Context ComponentsXP.

+ Return type: xs:anyURI?

Examples:
@@ -4971,31 +5575,404 @@

- W3C Documentation reference + W3C Documentation reference
- +
-
- - + fn:last() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:outermost(node()*)
- Returns the position of the last node in the context list
-
- W3C Documentation reference: Node-Set-Functions + Returns the outermost nodes of the input sequence that are not ancestors of any other + node in the input sequence
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()*Sequence of nodes
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:outermost(//chapter)Sequence of outermost chapter nodes
fn:outermost(/book//*)Sequence of outermost nodes in the book

+ W3C Documentation reference: outermost
- - - + + + fn:innermost(node()*) +
+ Returns the innermost nodes of the input sequence that are not descendants of any other + node in the input sequence
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()*Sequence of nodes
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:innermost(//chapter)Sequence of innermost chapter nodes
fn:innermost(/book//*)Sequence of innermost nodes in the book

+ W3C Documentation reference: innermost +
+ + + fn:has-children(node()?) +
+ Returns true if the specified node has one or more children, otherwise returns false
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:has-children(/book/chapter[1])true
fn:has-children(/book/chapter[1]/title)false

+ W3C Documentation reference: has-children +
+ + + fn:path(node()?) +
+ Returns a string that represents the path of the specified node within the XML + document
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:path(/book/chapter[1])/book/chapter[1]
fn:path(/book/chapter[2]/title)/book/chapter[2]/title

+ W3C Documentation reference: path +
+ + + fn:root(node()?) +
+ Returns the root node of the tree that contains the specified node
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:root(/book/chapter)<book> element (root node)
fn:root(/book/chapter[1])<book> element (root node)

+ W3C Documentation reference: root +
+ + + fn:namespace-uri(node()?) +
+ Returns the namespace URI of the specified node
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:namespace-uri(/example:root)"http://www.example.com/ns"
fn:namespace-uri(/a/b)""

+ W3C Documentation reference: namespace-uri +
+ + + fn:local-name(node()?) +
+ Returns the local part of the name of the specified node
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:local-name(/a/b)"b"
fn:local-name(/example:root)"root"

+ W3C Documentation reference: local-name +
+ + fn:name(node()?) +
+ Returns the expanded QName of the specified node as a string
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:name(/a/b)"b"
fn:name(/example:root)"example:root"

+ W3C Documentation reference: name +
+ + + + fn:document-uri(node?) +
+ Returns the document URI of the given node or the context item
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node?Returns the document URI of the specified node or the context item (if no + argument is provided)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:document-uri(/library/fiction:book[1])http://example.com/library.xml (assuming the document URI of the first + fiction:book element is "http://example.com/library.xml")
fn:document-uri(/library)http://example.com/library.xml (assuming the document URI of the library + element is "http://example.com/library.xml")

+ W3C Documentation reference: Document-URI +
+ + + fn:base-uri(node?) +
+ Returns the base URI of the node or the context item
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node?Returns the base URI of the specified node or the context item (if no + argument is provided)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:base-uri(/library/fiction:book[1])http://example.com/library.xml (assuming the base URI of the first + fiction:book element is "http://example.com/library.xml")
fn:base-uri(/library)http://example.com/library.xml (assuming the base URI of the library element + is "http://example.com/library.xml")

+ W3C Documentation reference: Base-URI +
+ + + fn:node-name(node?) +
+ + Returns the name of a node as an xs:QName
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node?Returns the name of the specified node or the context item if the argument + is omitted
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:node-name(/library/*[1])fiction:book
fn:node-name(/library/fiction:book[1]/title)title

+ W3C Documentation reference: Node-Name +
+
@@ -5003,48 +5980,159 @@
- - + fn:boolean(object) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:not(item()*)
- The boolean function converts its argument to a boolean as follows: -
    -
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • -
  • a node-set is true if and only if it is non-empty
  • -
  • a string is true if and only if its length is non-zero
  • -
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • -
- - Arguments and return type: - - - - - - - - - -
TypeDescription
objectThe object to convert to a boolean
Examples:
- - - - - - - - - - - - - -
ExpressionResult
boolean("Release11")true
boolean("")false

- W3C Documentation reference: Boolean-Functions + Returns the negation of the effective boolean value of the argument
+ Arguments and return type: + + + + + + + + + +
TypeDescription
item()*Argument whose effective boolean value is to be negated
+ Examples:
+ + + + + + + + + + + + + + + + + + + + + +
ExpressionResult
fn:not(1)false
fn:not(0)true
fn:not('')true
fn:not('true')false

+ W3C Documentation reference: Not
- - + + + fn:false() +
+ Returns the boolean value false
+ Arguments and return type: + + + + + + + + + +
TypeDescription
NoneReturns the boolean value false
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:false()false
//item[fn:false()]Returns an empty node-set

+ W3C Documentation reference: False +
+ + + fn:true() +
+ Returns the boolean value true
+ Arguments and return type: + + + + + + + + + +
TypeDescription
NoneReturns the boolean value true
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:true()true
//item[fn:true()]Returns all <item> elements

+ W3C Documentation reference: True +
+ + + fn:boolean(item()*) +
+ Converts the argument to a boolean value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
item()*Argument to be converted to a boolean value
+ Examples:
+ + + + + + + + + + + + + + + + + + + + + +
ExpressionResult
fn:boolean(1)true
fn:boolean(0)false
fn:boolean('')false
fn:boolean('true')true

+ W3C Documentation reference: Boolean +
+ +
@@ -5052,41 +6140,1199 @@
- - + + fn:unparsed-text-available(xs:string?, xs:string?) +
+ Determines if an unparsed text resource identified by a URI can be read using the given + encoding
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI identifying the unparsed text resource
xs:string?The encoding to be used for reading the resource
xs:booleanIndicates if the resource can be read using the given encoding
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:unparsed-text-available("http://www.example.com/text.txt", "UTF-8")Returns true if the text resource identified by the specified URI can be + read using the specified encoding, otherwise false

+ W3C Documentation reference: unparsed-text-available +
+ + + fn:unparsed-text-lines(xs:string?, xs:string?) +
+ Returns the contents of an unparsed text resource identified by a URI, split into + lines
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI identifying the unparsed text resource
xs:string?The encoding to be used for reading the resource
xs:string*The lines of the unparsed text resource
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:unparsed-text-lines("http://www.example.com/text.txt", "UTF-8")Returns the lines of the text resource identified by the specified URI, + using the specified encoding

+ W3C Documentation reference: unparsed-text-lines +
+ + + fn:unparsed-text(xs:string?, xs:string?) +
+ Returns the contents of an unparsed text resource identified by a URI
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI identifying the unparsed text resource
xs:string?The encoding to be used for reading the resource
xs:string?The contents of the unparsed text resource
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:unparsed-text("http://www.example.com/text.txt", "UTF-8")Returns the contents of the text resource identified by the specified URI, + using the specified encoding

+ W3C Documentation reference: unparsed-text +
+ + + fn:escape-html-uri(xs:string?) +
+ Escapes special characters in a URI to be used in HTML
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?URI to be escaped for use in HTML
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:escape-html-uri('https://example.com/search?q=test&lang=en')https://example.com/search?q=test&lang=en
fn:escape-html-uri('https://example.com/page?id=1§ion=2')https://example.com/page?id=1&section=2

+ W3C Documentation reference: Escape-HTML-URI +
+ + + fn:iri-to-uri(xs:string?) +
+ Converts an IRI to a URI by escaping non-ASCII characters
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?IRI to be converted to a URI
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:iri-to-uri('https://example.com/ümlaut')https://example.com/%C3%BCmlaut
fn:iri-to-uri('https://example.com/日本語')https://example.com/%E6%97%A5%E6%9C%AC%E8%AA%9E

+ W3C Documentation reference: IRI-to-URI +
+ + + fn:encode-for-uri(xs:string?) +
+ Encodes a string for use in a URI by escaping special characters
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?String to be encoded for use in a URI
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:encode-for-uri('hello world')hello%20world
fn:encode-for-uri('example?query=value¶m=value2')example%3Fquery%3Dvalue%26param%3Dvalue2

+ W3C Documentation reference: Encode-for-URI +
+ + + fn:resolve-uri(xs:string?, xs:string?) +
+ Resolves a relative URI using a base URI
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Relative URI to resolve
xs:string?Base URI to use for resolving (optional)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:resolve-uri('example.html', 'https://www.example.com/folder/')https://www.example.com/folder/example.html
fn:resolve-uri('../images/pic.jpg', + 'https://www.example.com/folder/page.html')https://www.example.com/images/pic.jpg

+ W3C Documentation reference: Resolve-URI +
+ + fn:analyze-string(xs:string?, xs:string, xs:string?) +
+ Analyzes the input string and returns an XML fragment containing match and non-match + elements
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to analyze
xs:stringRegular expression pattern to match
xs:string?Flags to control the regular expression matching (optional)
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:analyze-string('red,green,blue', ',') + <fn:analyze-string-result><fn:non-match>red</fn:non-match><fn:match>, + <fn:non-match>green</fn:non-match><fn:match>, + <fn:non-match>blue</fn:non-match></fn:analyze-string-result> +

+ W3C Documentation reference: Analyze-String +
+ + + fn:tokenize(xs:string?, xs:string, xs:string?) +
+ Splits the input string into a sequence of substrings using the pattern as a delimiter +
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to tokenize
xs:stringRegular expression pattern to use as delimiter
xs:string?Flags to control the regular expression matching (optional)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:tokenize('XPath 3.0, XQuery 3.0, XSLT 3.0', ',\\s*')('XPath 3.0', 'XQuery 3.0', 'XSLT 3.0')
fn:tokenize('apple,orange,banana', ',')('apple', 'orange', 'banana')

+ W3C Documentation reference: Tokenize +
+ + + fn:replace(xs:string?, xs:string, xs:string, xs:string?) +
+ Replaces occurrences of the pattern in the input string with the replacement string
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:stringRegular expression pattern to match
xs:stringReplacement string
xs:string?Flags to control the regular expression matching (optional)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:replace('XPath 3.0 is great', '3.0', '3.1')'XPath 3.1 is great'
fn:replace('Hello, World!', 'World', 'XPath')'Hello, XPath!'

+ W3C Documentation reference: Replace +
+ + + fn:matches(xs:string?, xs:string, xs:string?) +
+ Returns true if the input string matches the regular expression pattern, otherwise false +
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:stringRegular expression pattern to match
xs:string?Flags to control the regular expression matching (optional)
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:matches('XPath 3.0', '\\d\\.\\d')true
fn:matches('Hello, World!', '[A-Z][a-z]*')true
fn:matches('example123', '\\d+', 'q')false

+ W3C Documentation reference: Matches +
+ + + fn:substring-after(xs:string?, xs:string?) +
+ Returns the part of the first string that follows the first occurrence of the second + string
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:string?Substring to search for
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:substring-after('Hello, World!', ',')' World!'
fn:substring-after('XPath 3.0 is awesome!', '3.0')' is awesome!'

+ W3C Documentation reference: Substring-After +
+ + + fn:substring-before(xs:string?, xs:string?) +
+ Returns the part of the first string that precedes the first occurrence of the second + string
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:string?Substring to search for
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:substring-before('Hello, World!', ',')'Hello'
fn:substring-before('XPath 3.0 is awesome!', '3.0')'XPath '

+ W3C Documentation reference: Substring-Before +
+ + + fn:ends-with(xs:string?, xs:string?) +
+ Returns true if the first string ends with the second string, otherwise false
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to check
xs:string?Substring to check for at the end of the first string
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:ends-with('Hello, World!', 'World!')true
fn:ends-with('Hello, World!', 'Hello')false
fn:ends-with('XPath 3.0', '3.0')true

+ W3C Documentation reference: Ends-With +
+ + + fn:starts-with(xs:string?, xs:string?) +
+ Returns true if the first string starts with the second string, otherwise false
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to check
xs:string?Substring to check for at the beginning of the first string
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:starts-with('Hello, World!', 'Hello')true
fn:starts-with('Hello, World!', 'World')false
fn:starts-with('XPath 3.0', 'XPath')true

+ W3C Documentation reference: Starts-With +
+ + + fn:contains(xs:string?, xs:string?) +
+ Returns true if the first string contains the second string, otherwise false
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:string?Substring to search for
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:contains('Hello, World!', 'World')true
fn:contains('Hello, World!', 'world')false
fn:contains('XPath 3.0', '3.0')true

+ W3C Documentation reference: Contains +
+ + + fn:translate(xs:string?, xs:string, xs:string) +
+ Returns the input string with specified characters replaced
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to be translated
xs:stringMap string with characters to replace
xs:stringTranslate string with replacement characters
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:translate('apple', 'aeiou', '12345')'1ppl2'
fn:translate('Hello, World!', 'HW', 'hw')'hello, world!'

+ W3C Documentation reference: Translate +
+ + + fn:lower-case(xs:string?) +
+ Returns the input string with all characters converted to lowercase
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string to convert to lowercase
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:lower-case('HELLO, WORLD!')'hello, world!'
fn:lower-case('XPath 3.0')'xpath 3.0'
fn:lower-case('BANANA')'banana'

+ W3C Documentation reference: Lower-Case +
+ + + fn:upper-case(xs:string?) +
+ Returns the input string with all characters converted to uppercase
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string to convert to uppercase
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:upper-case('Hello, World!')'HELLO, WORLD!'
fn:upper-case('XPath 3.0')'XPATH 3.0'
fn:upper-case('banana')'BANANA'

+ W3C Documentation reference: Upper-Case +
+ + + fn:normalize-unicode(xs:string?, xs:string) +
+ Returns the input string with Unicode normalization applied
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to normalize
xs:stringNormalization form to apply (NFC, NFD, NFKC, NFKD)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:normalize-unicode('Café', 'NFC')'Café'
fn:normalize-unicode('Café', 'NFD')'Café'

+ W3C Documentation reference: Normalize-Unicode +
+ + + fn:normalize-space(xs:string?) +
+ Returns the input string with whitespace normalized
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string to normalize whitespace
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:normalize-space(' Hello, World! ')'Hello, World!'
fn:normalize-space(' XPath 3.0 ')'XPath 3.0'
fn:normalize-space('\tbanana\t')'banana'

+ W3C Documentation reference: Normalize-Space +
+ + + fn:string-length(xs:string?) +
+ Returns the length of the input string
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string to calculate length
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:string-length('Hello, World!')13
fn:string-length('XPath 3.0')8
fn:string-length('banana')6

+ W3C Documentation reference: String-Length +
+ + + fn:substring(xs:string?, xs:double) +
+ Returns a substring of the source string, starting from a specific location
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input source string
xs:doubleStarting location to extract the substring
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:substring('Hello, World!', 1, 5)'Hello'
fn:substring('XPath 3.0', 7)'3.0'
fn:substring('banana', 2, 3)'ana'

+ W3C Documentation reference: Substring +
+ + fn:string-join(xs:string*, xs:string) +
+ Joins a sequence of strings with a specified separator, returning a single string
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string*Input sequence of strings to join
xs:stringSeparator string to insert between joined strings
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:string-join(('apple', 'banana', 'orange'), ', ')'apple, banana, orange'
fn:string-join(('XPath', '3.0', 'Functions'), ' - ')'XPath - 3.0 - Functions'
fn:string-join(('A', 'B', 'C'), '')'ABC'

+ W3C Documentation reference: String-Join +
+ + + fn:concat(xs:anyAtomicType?, xs:anyAtomicType?, ...) +
+ Concatenates two or more strings or atomic values, returning a single string
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:anyAtomicType?Input strings or atomic values to concatenate
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:concat('Hello', ' ', 'World')'Hello World'
fn:concat('I have ', 3, ' apples')'I have 3 apples'
fn:concat('XPath ', '3.0')'XPath 3.0'

+ W3C Documentation reference: Concat +
+ + + fn:codepoint-equal(xs:string?, xs:string?) +
+ Compares two strings on a codepoint-by-codepoint basis and returns true if they are + equal, false otherwise
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?First string to compare
xs:string?Second string to compare
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:codepoint-equal('Hello', 'Hello')true
fn:codepoint-equal('Hello', 'hello')false
fn:codepoint-equal('apple', 'banana')false

+ W3C Documentation reference: Codepoint-Equal +
+ + + fn:compare(xs:string?, xs:string?) +
+ Compares two strings and returns -1, 0, or 1 if the first string is less than, equal to, + or greater than the second string, respectively
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?First string to compare
xs:string?Second string to compare
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:compare('apple', 'banana')-1
fn:compare('apple', 'apple')0
fn:compare('banana', 'apple')1

+ W3C Documentation reference: Compare +
+ + + fn:string-to-codepoints(xs:string?) +
+ Returns a sequence of Unicode code points for a given string
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:string-to-codepoints('Hello')(72, 101, 108, 108, 111)
fn:string-to-codepoints('( ͡° ͜ʖ ͡°)')(40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41)
fn:string-to-codepoints('😊')(128522)

+ W3C Documentation reference: String-To-Codepoints +
+ + + fn:codepoints-to-string(xs:integer*) +
+ Constructs a string from a sequence of Unicode code points
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:integer*Sequence of Unicode code points
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:codepoints-to-string((72, 101, 108, 108, 111))Hello
codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41)) + ( ͡° ͜ʖ ͡°)
fn:codepoints-to-string((128522))😊

+ W3C Documentation reference: Codepoints-To-String +
+ + + fn:string(object)
- Returns the string representation of the object argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringThe object to convert to a string
Examples:
- - - - - - - - - - - - - -
ExpressionResult
string((1<0))false
string(.11)0.11

- W3C Documentation reference: String-Functions + Returns the string representation of the object argument
+ Arguments and return type: + + + + + + + + + +
TypeDescription
stringThe object to convert to a string
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
string((1<0))false
string(.11)0.11

+ W3C Documentation reference: String-Functions
- - + +
@@ -5094,49 +7340,1447 @@
- - + + fn:number(object) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:format-number(numeric?, xs:string, $decimal-format-name)
- The number function converts its argument to a number as follows: -
    -
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • -
  • boolean true is converted to 1; boolean false is converted to 0
  • -
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • -
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • -
- - Arguments and return type: - - - - - - - - - -
TypeDescription
objectThe object to convert to a number
- Examples:
- - - - - - - - - - - - - -
ExpressionResult
boolean("Release11")true
boolean("")false

- W3C Documentation reference: Numeric-Functions + Formats a numeric value according to the supplied picture string and optional decimal + format name
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
numeric?Numeric value to be formatted
xs:stringPicture string defining the format
xs:string?Optional decimal format name
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:format-number(1234.567, '0.00')1,234.57
fn:format-number(-1234.567, '0.00')-1,234.57
fn:format-number(0.12345, '0.00%')12.35%

+ W3C Documentation reference: Format-Number
- - + + + fn:format-integer(xs:integer?, xs:string) +
+ Formats an integer value according to the supplied picture string
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:integer?Integer value to be formatted
xs:stringPicture string defining the format
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:format-integer(12345, '0,0')12,345
fn:format-integer(-1234, '0,0')-1,234
fn:format-integer(1234, '00-00-00')01-23-45

+ W3C Documentation reference: Format-Integer +
+ + + fn:round-half-to-even(numeric?) +
+ Returns the closest integer to the given numeric value, rounding half-way cases to the + nearest even integer (also known as "bankers' rounding")
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the rounded value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + + + + + +
ExpressionResult
fn:round-half-to-even(3.5)4
fn:round-half-to-even(2.5)2
fn:round-half-to-even(-1.5)-2
fn:round-half-to-even(xs:decimal('1.25'), 1)1.2

+ W3C Documentation reference: Round-Half-To-Even +
+ + + fn:round(numeric?) +
+ Returns the closest integer to the given numeric value, rounding half-way cases away + from zero
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the rounded value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:round(3.14)3
fn:round(-4.7)-5
fn:round(xs:decimal('2.5'))3

+ W3C Documentation reference: Round +
+ + + fn:floor(numeric?) +
+ Returns the largest integer less than or equal to the given numeric value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the floor value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:floor(3.14)3
fn:floor(-4.7)-5
fn:floor(xs:decimal('2.5'))2

+ W3C Documentation reference: Floor +
+ + + + fn:ceiling(numeric?) +
+ Returns the smallest integer greater than or equal to the given numeric value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the ceiling value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:ceiling(3.14)4
fn:ceiling(-4.7)-4
fn:ceiling(xs:decimal('2.5'))3

+ W3C Documentation reference: Ceiling +
+ + + fn:abs(numeric?) +
+ Returns the absolute value of the given numeric value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the absolute value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:abs(-42)42
fn:abs(3.14)3.14
fn:abs(xs:decimal('-5.5'))5.5

+ W3C Documentation reference: Abs +
+ + fn:number(item?) +
+ Converts the given value to a number
+ Arguments and return type: + + + + + + + + + +
TypeDescription
item?Returns the numeric value of the specified expression or the context item + (if no argument is provided)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:number(/library/fiction:book[1]/@id)1 (if the first fiction:book element's id attribute is "1")
fn:number(/library/fiction:book[1]/price)19.99 (if the first fiction:book element's price element contains "19.99") +

+ W3C Documentation reference: Number +
+ + + + +
+
+
+ + + +
+ + fn:fold-right(item()*, item()*, function(item(), item()*)) +
+ Applies a processing function cumulatively to the items of a sequence from right to + left, so as to reduce the sequence to a single value
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
item()*The input sequence of items
item()*The initial value, also known as the zero value
function(item(), item()*)The processing function used to accumulate the items
item()*The resulting single value after applying the processing function
+ Examples:
+ + + + + + + + + +
ExpressionResult
fold-right((1, 2, 3, 4), 0, function($current, $accumulator) { $accumulator + - $current })Returns the result of subtracting each number in the input sequence from + right to left: -2

+ W3C Documentation reference: fold-right +
+ + + fn:fold-left(item()*, item()*, function(item()*, item())) +
+ Applies a processing function cumulatively to the items of a sequence from left to + right, so as to reduce the sequence to a single value
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
item()*The input sequence of items
item()*The initial value, also known as the zero value
function(item()*, item())The processing function used to accumulate the items
item()*The resulting single value after applying the processing function
+ Examples:
+ + + + + + + + + +
ExpressionResult
fold-left((1, 2, 3, 4), 0, function($accumulator, $current) { $accumulator + + $current })Returns the sum of the numbers in the input sequence: 10

+ W3C Documentation reference: fold-left +
+ + + + + fn:last() +
+ Returns the position of the last item in the current context sequence
+ Arguments and return type: + + + + + + + + + +
TypeDescription
NoneReturns the position of the last item in the current context sequence
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
/library/fiction:book[position() = last()]Returns the last fiction:book element in the library
/library/fiction:book[last()]Returns the last fiction:book element in the library

+ W3C Documentation reference: Last +
+ + fn:position() +
+ Returns the context position of the context item in the sequence currently being + processed
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:integerThe position of the context item in the sequence
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
<items><item>Item 1</item><item>Item + 2</item></items>/item[position()=2]Returns '<item>Item 2</item>'
<items><item>Item 1</item><item>Item + 2</item></items>/item[position()=1]Returns '<item>Item 1</item>'

+ W3C Documentation reference: position +
+ + + fn:collection(xs:string?) +
+ Returns a sequence of documents in a collection identified by a URI
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI identifying the collection of documents
xs:anyAtomicType*A sequence of documents in the collection
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:collection("http://www.example.com/collection/")Returns a sequence of documents in the collection identified by the + specified URI
fn:collection()Returns a sequence of documents in the default collection, if one is defined +

+ W3C Documentation reference: collection +
+ + + fn:sum(xs:anyAtomicType*, xs:anyAtomicType?) +
+ Returns the sum of a sequence of numeric values
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*Input sequence of numeric values
xs:anyAtomicType?Value to return if the sequence is empty (optional)
xs:anyAtomicType?Sum of the input sequence
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:sum((10, 20, 30, 40, 50))150
fn:sum((), 0)0

+ W3C Documentation reference: sum +
+ + + fn:min(xs:anyAtomicType*, xs:string) +
+ Returns the minimum value from a sequence of values
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*Input sequence of values
xs:stringCollation to use when comparing strings
xs:anyAtomicType?Minimum value in the input sequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:min((10, 20, 30, 40, 50))10
fn:min(("apple", "banana", "cherry"), + "http://www.w3.org/2005/xpath-functions/collation/codepoint")"apple"
fn:min(())empty sequence

+ W3C Documentation reference: min +
+ + + fn:max(xs:anyAtomicType*, xs:string) +
+ Returns the maximum value from a sequence of values
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*Input sequence of values
xs:stringCollation to use when comparing strings
xs:anyAtomicType?Maximum value in the input sequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:max((10, 20, 30, 40, 50))50
fn:max(("apple", "banana", "cherry"), + "http://www.w3.org/2005/xpath-functions/collation/codepoint")"cherry"
fn:max(())empty sequence

+ W3C Documentation reference: max +
+ + + fn:avg(xs:anyAtomicType*) +
+ Computes the average of the numeric values in the input sequence
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*Input sequence of numeric values
xs:anyAtomicType?Average of the numeric values in the input sequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:avg((10, 20, 30, 40, 50))30
fn:avg((2.5, 3.5, 4.5))3.5
fn:avg(())empty sequence

+ W3C Documentation reference: avg +
+ + + fn:count(item()*) +
+ Returns the number of items in the input sequence
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
xs:integerNumber of items in the input sequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:count(('apple', 'banana', 'orange'))3
fn:count(())0
fn:count((1, 2, 3, 4, 5))5

+ W3C Documentation reference: count +
+ + + fn:exactly-one(item()*) +
+ Returns the single item in the input sequence or raises an error if the sequence is + empty or contains more than one item
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
item()Single item from the input sequence, otherwise an error is raised
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:exactly-one(('apple'))'apple'
fn:exactly-one(('apple', 'banana'))Error (more than one item)
fn:exactly-one(())Error (empty sequence)

+ W3C Documentation reference: exactly-one +
+ + + fn:one-or-more(item()*)+ +
+ Returns the input sequence if it contains one or more items, otherwise raises an + error
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
item()+Sequence containing one or more items, otherwise an error is raised
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:one-or-more(('apple', 'banana'))('apple', 'banana')
fn:one-or-more(('pear'))('pear')

+ W3C Documentation reference: one-or-more +
+ + + fn:zero-or-one(item()*) +
+ Returns the input sequence if it contains zero or one items, otherwise raises an + error
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
item()?Sequence containing zero or one item, otherwise an error is raised
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:zero-or-one(('apple'))('apple')
fn:zero-or-one(())()

+ W3C Documentation reference: zero-or-one +
+ + + fn:deep-equal(item()* , item()*) +
+ Returns true if the two input sequences are deep-equal, meaning that they have the same + structure and atomic values
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*First input sequence
item()*Second input sequence
xs:booleanTrue if the input sequences are deep-equal, otherwise false
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:deep-equal((1, 2, 3), (1, 2, 3))true
fn:deep-equal((1, 2, 3), (1, 2, 4))false

+ W3C Documentation reference: deep-equal +
+ + + fn:index-of(xs:anyAtomicType*, xs:anyAtomicType) +
+ Returns a sequence of integers indicating the positions of items in the input sequence + that are equal to the search item
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*Input sequence of atomic values
xs:anyAtomicTypeSearch item to find in the input sequence
xs:integer*Sequence of integers representing the positions of the search item in the + input sequence
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:index-of((3, 1, 4, 1, 5, 9, 2, 2, 3), 1)(2, 4)
fn:index-of(('apple', 'banana', 'orange', 'apple', 'grape', 'orange'), + 'apple')(1, 4)

+ W3C Documentation reference: index-of +
+ + + fn:distinct-values(xs:anyAtomicType*) +
+ Returns a sequence of distinct atomic values from the input sequence
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*Input sequence of atomic values
xs:anyAtomicType*Distinct sequence of atomic values
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:distinct-values((3, 1, 4, 1, 5, 9, 2, 2, 3))(3, 1, 4, 5, 9, 2)
fn:distinct-values(('apple', 'banana', 'orange', 'apple', 'grape', + 'orange'))('apple', 'banana', 'orange', 'grape')

+ W3C Documentation reference: distinct-values +
+ + + fn:unordered(item()*) +
+ Returns the items of a sequence in an implementation-dependent order
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
item()*Unordered sequence
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:unordered((3, 1, 4, 1, 5, 9, 2))(1, 2, 3, 4, 5, 9, 1) (example result; actual order may vary)
fn:unordered(('apple', 'banana', 'orange', 'grape'))('banana', 'apple', 'orange', 'grape') (example result; actual order may + vary)

+ W3C Documentation reference: unordered +
+ + + fn:subsequence(item()*, xs:double, xs:double) +
+ Returns a subsequence of a given sequence starting at a specified position with a + specified length
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
xs:doubleStarting position
xs:doubleLength of subsequence
item()*Subsequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:subsequence((1, 2, 3, 4, 5), 2, 3)(2, 3, 4)
fn:subsequence(('apple', 'banana', 'orange', 'grape'), 1, 2)('apple', 'banana')
fn:subsequence(('red', 'blue', 'green', 'yellow'), 3)('green', 'yellow')

+ W3C Documentation reference: subsequence +
+ + + fn:reverse(item()*) +
+ Reverses the order of items in a sequence
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
item()*Reversed sequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:reverse((1, 2, 3, 4))(4, 3, 2, 1)
fn:reverse(('apple', 'banana', 'orange'))('orange', 'banana', 'apple')
fn:reverse(('red', 'blue', 'green'))('green', 'blue', 'red')

+ W3C Documentation reference: reverse +
+ + + fn:remove(item()*, xs:integer) +
+ Removes an item from a sequence at the specified position
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*Target sequence
xs:integerPosition of the item to remove
item()*New sequence with the item removed
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:remove((1, 2, 3, 4), 2)(1, 3, 4)
fn:remove(('apple', 'banana', 'orange'), 3)('apple', 'banana')
fn:remove((10, 20, 30), 1)(20, 30)

+ W3C Documentation reference: remove +
+ + + fn:insert-before(item()*, xs:integer, item()*) +
+ Inserts items from the specified sequence into another sequence at a given position
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
item()*Target sequence
xs:integerPosition at which to insert the items
item()*Sequence of items to insert
item()*New sequence with items inserted
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:insert-before((1, 3, 4), 2, (2))(1, 2, 3, 4)
fn:insert-before(('apple', 'orange'), 1, ('banana'))('banana', 'apple', 'orange')
fn:insert-before((10, 20, 30), 4, (40))(10, 20, 30, 40)

+ W3C Documentation reference: insert-before +
+ + + fn:tail(item()*) +
+ Returns all items of the input sequence except the first one, or an empty sequence if + the input is empty or contains only one item
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Sequence of items
item()*All items except the first one, or an empty sequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:tail((1, 2, 3))(2, 3)
fn:tail((1))()
fn:tail(/books/book/author)All authors in the "books" element except the first one

+ W3C Documentation reference: tail +
+ + + fn:head(item()*) +
+ Returns the first item of the input sequence, or an empty sequence if the input is + empty
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Sequence of items
item()?The first item of the sequence, or an empty sequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:head((1, 2, 3))1
fn:head(())()
fn:head(/books/book[1]/author)The first author of the first book in the "books" element

+ W3C Documentation reference: head +
+ + + fn:exists(item()*) +
+ Returns true if the input sequence is not empty, otherwise returns false
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Sequence of items
xs:booleanResult of the test (true or false)
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:exists((1, 2, 3))true
fn:exists(())false
fn:exists(//chapter[5])true if there are at least 5 chapters, otherwise false

+ W3C Documentation reference: exists +
+ + + fn:empty(item()*) +
+ Returns true if the input sequence is empty, otherwise returns false
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Sequence of items
xs:booleanResult of the test (true or false)
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:empty((1, 2, 3))false
fn:empty(())true
fn:empty(//chapter[100])true if there are less than 100 chapters, otherwise false

+ W3C Documentation reference: empty +
+ + + + + fn:data(item*) +
+ Returns the simple value of an item or a sequence of items
+ Arguments and return type: + + + + + + + + + +
TypeDescription
item?Returns the simple value of the specified item or the context item (if no + argument is provided)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:data(/library/fiction:book[1]/title)The Catcher in the Rye
fn:data(/library/fiction:book[2]/author)Harper Lee

+ W3C Documentation reference: Data +
+ +
@@ -5144,46 +8788,1175 @@
- - - fn:adjust-date-to-timezone(date,timezone) -
- If the timezone argument is empty, it returns a date without a timezone. Otherwise, - it returns a date with a timezone
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
datedate to be adjusted
timezonetimezone to be imposed into date
Examples:
- - - - - - - - - -
ExpressionResult
adjust-date-to-timezone(xs:date('2011-11-15'), - xs:dayTimeDuration("PT10H"))2011-11-15+10:00

- W3C Documentation reference: #func-adjust-date-to-timezone -
- - - - - + fn:implicit-timezone() +
+ Returns the implicit timezone as an xs:dayTimeDuration
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:dayTimeDurationThe implicit timezone as a dayTimeDuration
+ Examples:
+ + + + + + + + + +
ExpressionResult
implicit-timezone()Returns the implicit timezone as an xs:dayTimeDuration, e.g., '-PT7H' +

+ W3C Documentation reference: implicit-timezone +
+ + + fn:current-time() +
+ Returns the current time with timezone
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:timeThe current time with timezone
+ Examples:
+ + + + + + + + + +
ExpressionResult
current-time()Returns the current time with timezone, e.g., '13:45:30.123-07:00'

+ W3C Documentation reference: current-time +
+ + + fn:current-date() +
+ Returns the current date with timezone
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:dateThe current date with timezone
+ Examples:
+ + + + + + + + + +
ExpressionResult
current-date()Returns the current date with timezone, e.g., '2023-03-29-07:00'

+ W3C Documentation reference: current-date +
+ + + fn:current-dateTime() +
+ Returns the current date and time with timezone
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:dateTimeThe current date and time with timezone
+ Examples:
+ + + + + + + + + +
ExpressionResult
current-dateTime()Returns the current date and time with timezone, e.g., + '2023-03-29T12:34:56.789-07:00'

+ W3C Documentation reference: current-dateTime +
+ + + fn:format-time(xs:time?, xs:string, xs:string?, xs:string?, xs:string?) +
+ Formats a time value using the provided picture string and optional language, + calendar, and country settings
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
xs:time?Time value
xs:stringPicture string
xs:string?Language
xs:string?Calendar
xs:string?Country
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:format-time(xs:time('14:30:15'), '[H01]:[m01]:[s01]')14:30:15
fn:format-time(xs:time('14:30:15'), '[h01] [P] [ZN,*-3]')02 PM UTC

+ W3C Documentation reference: Format-Time +
+ + + fn:format-date(xs:date?, xs:string, xs:string?, xs:string?, xs:string?) +
+ Formats a date value using the provided picture string and optional language, + calendar, and country settings
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
xs:date?Date value
xs:stringPicture string
xs:string?Language
xs:string?Calendar
xs:string?Country
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:format-date(xs:date('2023-04-01'), '[Y0001]-[M01]-[D01]')2023-04-01
fn:format-date(xs:date('2023-04-01'), '[MNn,*-3] [D], [Y]')Apr 1, 2023

+ W3C Documentation reference: Format-Date +
+ + + fn:format-dateTime(xs:dateTime?, xs:string, xs:string?, xs:string?, xs:string?) +
+ Formats a dateTime value using the provided picture string and optional language, + calendar, and country settings
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
xs:stringPicture string
xs:string?Language
xs:string?Calendar
xs:string?Country
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:format-dateTime(xs:dateTime('2023-04-01T12:00:00'), + '[Y0001]-[M01]-[D01] [H01]:[m01]:[s01]')2023-04-01 12:00:00
fn:format-dateTime(xs:dateTime('2023-04-01T12:00:00'), '[MNn,*-3], [D], + [Y]')Apr, 1, 2023

+ W3C Documentation reference: Format-DateTime +
+ + + fn:adjust-time-to-timezone(xs:time?, xs:dayTimeDuration?) +
+ Adjusts the timezone of a time value
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:time?Time value
xs:dayTimeDuration?Timezone adjustment
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:adjust-time-to-timezone(xs:time('10:00:00-07:00'), + xs:dayTimeDuration('PT2H'))12:00:00-05:00
fn:adjust-time-to-timezone(xs:time('10:00:00Z'), + xs:dayTimeDuration('-PT3H'))07:00:00-03:00

+ W3C Documentation reference: Adjust-Time-To-Timezone +
+ + + + + fn:adjust-date-to-timezone(xs:date?, xs:dayTimeDuration?) +
+ Adjusts the timezone of a date value
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:date?Date value
xs:dayTimeDuration?Timezone adjustment
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:adjust-date-to-timezone(xs:date('2023-01-01-07:00'), + xs:dayTimeDuration('PT2H'))2023-01-01-05:00
fn:adjust-date-to-timezone(xs:date('2023-01-01Z'), + xs:dayTimeDuration('-PT3H'))2022-12-31-03:00

+ W3C Documentation reference: Adjust-Date-To-Timezone +
+ + + fn:adjust-dateTime-to-timezone(xs:dateTime?, xs:dayTimeDuration?) +
+ Adjusts the timezone of a dateTime value
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
xs:dayTimeDuration?Timezone adjustment
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:adjust-dateTime-to-timezone(xs:dateTime('2023-01-01T12:00:00-07:00'), + xs:dayTimeDuration('PT2H'))2023-01-01T17:00:00-05:00
fn:adjust-dateTime-to-timezone(xs:dateTime('2023-01-01T12:00:00Z'), + xs:dayTimeDuration('-PT3H'))2023-01-01T09:00:00-03:00

+ W3C Documentation reference: Adjust-DateTime-To-Timezone +
+ + + fn:timezone-from-time(xs:time?) +
+ Extracts the timezone component from an xs:time value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?Time value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:timezone-from-time(xs:time('12:00:00-07:00'))-PT7H
fn:timezone-from-time(xs:time('14:30:00+02:30'))PT2H30M

+ W3C Documentation reference: Timezone-From-Time +
+ + + fn:seconds-from-time(xs:time?) +
+ Extracts the seconds component from an xs:time value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?Time value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:seconds-from-time(xs:time('21:45:30.5'))30.5
fn:seconds-from-time(xs:time('04:15:12.1'))12.1

+ W3C Documentation reference: Seconds-From-Time +
+ + + fn:minutes-from-time(xs:time?) +
+ Extracts the minutes component from an xs:time value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?Time value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:minutes-from-time(xs:time('21:45:30'))45
fn:minutes-from-time(xs:time('04:15:12'))15

+ W3C Documentation reference: Minutes-From-Time +
+ + + fn:hours-from-time(xs:time?) +
+ Extracts the hours component from an xs:time value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?Time value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:hours-from-time(xs:time('21:45:30'))21
fn:hours-from-time(xs:time('04:15:12'))4

+ W3C Documentation reference: Hours-From-Time +
+ + + fn:timezone-from-date(xs:date?) +
+ Extracts the timezone component from an xs:date value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?Date value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:timezone-from-date(xs:date('2023-03-29+02:00'))PT2H
fn:timezone-from-date(xs:date('1980-12-15-05:00'))-PT5H

+ W3C Documentation reference: Timezone-From-Date +
+ + + fn:day-from-date(xs:date?) +
+ Extracts the day component from an xs:date value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?Date value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:day-from-date(xs:date('2023-03-29'))29
fn:day-from-date(xs:date('1980-12-15'))15

+ W3C Documentation reference: Day-From-Date +
+ + + fn:month-from-date(xs:date?) +
+ Extracts the month component from an xs:date value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?Date value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:month-from-date(xs:date('2023-03-29'))3
fn:month-from-date(xs:date('1980-12-15'))12

+ W3C Documentation reference: Month-From-Date +
+ + + fn:year-from-date(xs:date?) +
+ Extracts the year component from an xs:date value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?Date value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:year-from-date(xs:date('2023-03-29'))2023
fn:year-from-date(xs:date('1980-12-15'))1980

+ W3C Documentation reference: Year-From-Date +
+ + + fn:timezone-from-dateTime(xs:dateTime?) +
+ Extracts the timezone component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:timezone-from-dateTime(xs:dateTime('2023-03-29T12:30:45-07:00'))-PT7H
fn:timezone-from-dateTime(xs:dateTime('2023-12-15T18:45:30+03:30'))PT3H30M

+ W3C Documentation reference: Timezone-From-DateTime +
+ + + fn:seconds-from-dateTime(xs:dateTime?) +
+ Extracts the seconds component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:seconds-from-dateTime(xs:dateTime('2023-03-29T12:30:45'))45
fn:seconds-from-dateTime(xs:dateTime('2023-12-15T18:45:30.5-08:00')) + 30.5

+ W3C Documentation reference: Seconds-From-DateTime +
+ + + fn:minutes-from-dateTime(xs:dateTime?) +
+ Extracts the minutes component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:minutes-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))30
fn:minutes-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))45

+ W3C Documentation reference: Minutes-From-DateTime +
+ + + fn:hours-from-dateTime(xs:dateTime?) +
+ Extracts the hours component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:hours-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))12
fn:hours-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))18

+ W3C Documentation reference: Hours-From-DateTime +
+ + + fn:day-from-dateTime(xs:dateTime?) +
+ Extracts the day component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:day-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))29
fn:day-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))15

+ W3C Documentation reference: Day-From-DateTime +
+ + + fn:month-from-dateTime(xs:dateTime?) +
+ Extracts the month component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:month-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))3
fn:month-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))12

+ W3C Documentation reference: Month-From-DateTime +
+ + + fn:year-from-dateTime(xs:dateTime?) +
+ Extracts the year component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:year-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))2023
fn:year-from-dateTime(xs:dateTime('2023-03-29T12:30:00-08:00'))2023

+ W3C Documentation reference: Year-From-DateTime +
+ + + + + fn:dateTime(xs:date?, xs:time?) +
+ Constructs an xs:dateTime value from an xs:date and an xs:time value
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:date?Date value
xs:time?Time value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:dateTime(xs:date('2023-03-29'), xs:time('12:30:00'))2023-03-29T12:30:00
fn:dateTime(xs:date('2023-03-29+05:00'), xs:time('12:30:00-08:00'))2023-03-29T12:30:00-08:00

+ W3C Documentation reference: DateTime +
+ + + fn:seconds-from-duration(xs:duration?) +
+ Returns the seconds component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the seconds component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:seconds-from-duration(xs:dayTimeDuration('PT1H30M15.5S'))15.5
fn:seconds-from-duration(xs:dayTimeDuration('-PT2M10.3S'))-10.3

+ W3C Documentation reference: Seconds-From-Duration +
+ + + fn:minutes-from-duration(xs:duration?) +
+ Returns the minutes component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the minutes component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:minutes-from-duration(xs:dayTimeDuration('PT2H30M'))30
fn:minutes-from-duration(xs:dayTimeDuration('-PT1H45M'))-45

+ W3C Documentation reference: Minutes-From-Duration +
+ + + fn:hours-from-duration(xs:duration?) +
+ Returns the hours component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the hours component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:hours-from-duration(xs:dayTimeDuration('PT36H'))36
fn:hours-from-duration(xs:dayTimeDuration('-PT12H30M'))-12

+ W3C Documentation reference: Hours-From-Duration +
+ + + fn:days-from-duration(xs:duration?) +
+ Returns the days component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the days component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:days-from-duration(xs:dayTimeDuration('P5DT12H30M'))5
fn:days-from-duration(xs:dayTimeDuration('-P2DT6H'))-2

+ W3C Documentation reference: Days-From-Duration +
+ + + + fn:months-from-duration(xs:duration?) +
+ Returns the months component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the months component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:months-from-duration(xs:duration('P2Y3M4DT5H6M7S'))3
fn:months-from-duration(xs:duration('-P2Y3M4DT5H6M7S'))-3

+ W3C Documentation reference: Months-From-Duration +
+ + + fn:years-from-duration(xs:duration?) +
+ Returns the years component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the years component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:years-from-duration(xs:duration('P2Y3M4DT5H6M7S'))2
fn:years-from-duration(xs:duration('-P2Y3M4DT5H6M7S'))-2

+ W3C Documentation reference: Years-From-Duration +
@@ -5191,20 +9964,89 @@
- - - fn:error() -
- https://www.w3.org/TR/xpath-functions/#func-error
-
- W3C Documentation reference: #func-error -
- - - - - + + fn:trace(item()*, xs:string) +
+ Outputs the provided label and value for diagnostic purposes and returns the value + unchanged
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Value to be traced
xs:stringLabel to be output along with the value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:trace(42, 'The value is:')Outputs "The value is: 42" for diagnostic purposes and returns 42
fn:trace(/library/book/title, 'Book title:')Outputs "Book title: [book title]" for diagnostic purposes and returns + the book title

+ W3C Documentation reference: Trace +
+ + + fn:error(xs:QName?, xs:string?, $error-object) +
+ Raises an error with the specified error code, description, and error object
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:QName?Error code (optional)
xs:string?Description of the error (optional)
item()*Error object (optional)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:error(xs:QName('err:FOER0000'))Raise error with the code err:FOER0000
fn:error(xs:QName('err:FOER0000'), 'Invalid value')Raise error with the code err:FOER0000 and description "Invalid value" +

+ W3C Documentation reference: Error +
+
@@ -5212,44 +10054,6863 @@
- - - fn:nilled(node) -
- Returns a Boolean value indicating whether the argument node is nilled
-
- W3C Documentation reference: #func-nilled - -
- - - - - + + fn:function-arity(function(*)) +
+ Returns the arity (number of arguments) of the specified function
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
function(*)The function to obtain the arity for
xs:integerThe arity (number of arguments) of the specified function
+ Examples:
+ + + + + + + + + +
ExpressionResult
function-arity(fn:substring)Returns the arity of the substring function: 2 (since + substring accepts two required arguments: the input string and the + starting index)

+ W3C Documentation reference: function-arity +
+ + + fn:function-name(function(*)) +
+ Returns the QName of the specified function
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
function(*)The function to obtain the QName for
xs:QName?The QName of the specified function, or an empty sequence if the + function is anonymous
+ Examples:
+ + + + + + + + + +
ExpressionResult
function-name(fn:substring)Returns the QName of the substring function: + QName("http://www.w3.org/2005/xpath-functions", "substring") +

+ W3C Documentation reference: function-name +
+ + + fn:function-lookup(xs:QName, xs:integer) +
+ Returns a function with the specified QName and arity if available, otherwise + returns an empty sequence
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:QNameFunction name as QName
xs:integerArity of the function
function(*)?A function with the specified QName and arity if available, otherwise an + empty sequence
+ Examples:
+ + + + + + + + + +
ExpressionResult
function-lookup(QName('http://www.w3.org/2005/xpath-functions', + 'substring'), 2)Returns the substring function with arity 2, if available

+ W3C Documentation reference: function-lookup +
+ + + fn:static-base-uri() +
+ Returns the static base URI as an xs:anyURI, if available
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:anyURI?The static base URI, if available; otherwise, an empty sequence
+ Examples:
+ + + + + + + + + +
ExpressionResult
static-base-uri()Returns the static base URI as an xs:anyURI, if available, e.g., + 'https://www.example.com/base/'

+ W3C Documentation reference: static-base-uri +
+ + + fn:default-collation() +
+ Returns the default collation URI as an xs:string
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:stringThe default collation URI as a string
+ Examples:
+ + + + + + + + + +
ExpressionResult
default-collation()Returns the default collation URI as an xs:string, e.g., + 'http://www.w3.org/2005/xpath-functions/collation/codepoint'

+ W3C Documentation reference: default-collation +
+ + + fn:serialize(item()?, item()?) +
+ Serializes an XML node, producing a string representation of the node
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
item()?An XML node to serialize
item()?Serialization options as a map, with key-value pairs defining the + serialization parameters (optional)
xs:string?A string representation of the serialized XML node or an empty sequence + if the input is an empty sequence
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:serialize(<item>Item 1</item>)Returns '<item>Item 1</item>'
fn:serialize(<item>Item 1</item>, map{'method': 'xml', 'indent': + 'yes'})Returns an indented XML string representation of the input node

+ W3C Documentation reference: serialize +
+ + + fn:parse-xml-fragment(xs:string?) +
+ Parses a string containing an XML fragment and returns a corresponding document + node
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?A string containing an XML fragment
document-node(element(*))?A document node containing the parsed XML fragment or an empty sequence + if the input is an empty sequence
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:parse-xml-fragment('<item>Item 1</item><item>Item + 2</item>')Returns a document node containing the parsed XML fragment

+ W3C Documentation reference: parse-xml-fragment +
+ + + fn:parse-xml(xs:string?) +
+ Parses a string containing an XML document and returns a corresponding document + node
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?A string containing an XML document
document-node(element(*))?A document node containing the parsed XML content or an empty sequence + if the input is an empty sequence
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:parse-xml('<root><item>Item 1</item></root>')Returns a document node containing the parsed XML content

+ W3C Documentation reference: parse-xml +
+ + + fn:available-environment-variables() +
+ Retrieves a sequence of the names of all available environment variables
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneNo argument is required
xs:string*A sequence of the names of all available environment variables
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:available-environment-variables()Returns a sequence of the names of all available environment variables +

+ W3C Documentation reference: available-environment-variables +
+ + + fn:environment-variable(xs:string) +
+ Retrieves the value of an environment variable
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:stringThe name of the environment variable
xs:string?The value of the environment variable, or an empty sequence if the + variable is not set
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:environment-variable("PATH")Returns the value of the PATH environment variable, or an empty sequence + if the variable is not set

+ W3C Documentation reference: environment-variable +
+ + + fn:uri-collection(xs:string?) +
+ Returns a sequence of URIs in a collection identified by a URI
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI identifying the collection of URIs
xs:anyURI*A sequence of URIs in the collection
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:uri-collection("http://www.example.com/collection/")Returns a sequence of URIs in the collection identified by the specified + URI +
fn:uri-collection()Returns a sequence of URIs in the default collection, if one is defined +

+ W3C Documentation reference: uri-collection +
+ + fn:doc-available(xs:string?) +
+ Tests whether an XML document is available at a given URI
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI of the XML document to be tested
xs:booleanTrue if the XML document is available, otherwise false
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:doc-available("http://www.example.com/books.xml")Returns true if the XML document located at the specified URI is + available, otherwise false
fn:doc-available("")Returns true if the XML document containing the context item is + available, otherwise false

+ W3C Documentation reference: doc-available +
+ + + fn:doc(xs:string?) +
+ Loads an XML document from a URI and returns the document node
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI of the XML document to be loaded
document-node()?The document node of the loaded XML document
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:doc("http://www.example.com/books.xml")Loads the XML document located at the specified URI and returns its + document node
fn:doc("")Returns the document node of the XML document containing the context + item

+ W3C Documentation reference: doc +
+ + + fn:generate-id(node()?) +
+ Returns a unique identifier for the specified node
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
node()?Input node for which the unique identifier is to be generated
xs:stringUnique identifier for the specified node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:generate-id(/bookstore/book[1])A unique identifier for the first <book> element in the + <bookstore>
fn:generate-id(.)A unique identifier for the context node

+ W3C Documentation reference: generate-id +
+ + + fn:idref(xs:string*) +
+ Returns a sequence of nodes that are referenced by the specified IDREF attribute + values
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string*Input sequence of IDREF attribute values
node()*Sequence of nodes referenced by the specified IDREF attribute values +
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:idref("reference42")Nodes referenced by the IDREF attribute value "reference42"
fn:idref(("ref1", "ref2", "ref3"))Nodes referenced by the IDREF attribute values "ref1", "ref2", and + "ref3"

+ W3C Documentation reference: idref +
+ + + fn:id(xs:string*) +
+ Returns a sequence of elements with the specified ID attribute values
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string*Input sequence of ID attribute values
element()*Sequence of elements with the specified ID attribute values
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:id("item42")Element with the ID attribute value "item42"
fn:id(("item1", "item2", "item3"))Elements with the ID attribute values "item1", "item2", and "item3"

+ W3C Documentation reference: id +
+ + + fn:lang(xs:string, node()?) +
+ Returns true if the language of the specified node or its nearest ancestor matches + the given language code
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:stringLanguage code to test
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:lang("en", /book/title)true
fn:lang("fr", /book/title)false

+ W3C Documentation reference: lang +
+ + + + fn:in-scope-prefixes(element()) +
+ Returns a sequence of strings representing the prefixes of the in-scope namespaces + for the specified element
+ Arguments and return type: + + + + + + + + + +
TypeDescription
element()Element node
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:in-scope-prefixes(/*)("xml", "x")

+ W3C Documentation reference: in-scope-prefixes +
+ + + fn:namespace-uri-for-prefix(xs:string?, element()) +
+ Returns the namespace URI associated with the given prefix, using the in-scope + namespaces for the specified element
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Prefix
element()Element node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:namespace-uri-for-prefix('x', /*)"http://www.example.com/ns"
fn:namespace-uri-for-prefix('', /*)""

+ W3C Documentation reference: namespace-uri-for-prefix +
+ + + fn:namespace-uri-from-QName(xs:QName?) +
+ Returns the namespace URI of the given QName value, or an empty sequence if there's + no namespace URI
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:QName?QName value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:namespace-uri-from-QName(fn:QName('http://www.example.com/ns', + 'x:local'))"http://www.example.com/ns"
fn:namespace-uri-from-QName(fn:QName('', 'local'))""

+ W3C Documentation reference: namespace-uri-from-QName +
+ + + fn:local-name-from-QName(xs:QName?) +
+ Returns the local name of the given QName value, or an empty sequence if there's no + local name
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:QName?QName value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:local-name-from-QName(fn:QName('http://www.example.com/ns', + 'x:local'))"local"
fn:local-name-from-QName(fn:QName('', 'local'))"local"

+ W3C Documentation reference: local-name-from-QName +
+ + + fn:prefix-from-QName(xs:QName?) +
+ Returns the prefix of the given QName value, or an empty sequence if there's no + prefix
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:QName?QName value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:prefix-from-QName(fn:QName('http://www.example.com/ns', 'x:local')) + "x"
fn:prefix-from-QName(fn:QName('', 'local'))()

+ W3C Documentation reference: prefix-from-QName +
+ + + fn:QName(xs:string?, xs:string) +
+ Constructs an xs:QName value from a namespace URI and a lexical QName
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Namespace URI
xs:stringLexical QName
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:QName('http://www.example.com/ns', 'x:local')QName("http://www.example.com/ns", "x:local")
fn:QName('', 'local')QName("", "local")

+ W3C Documentation reference: QName +
+ + + fn:resolve-QName(xs:string?, element()) +
+ Resolves a QName by expanding a prefix using the in-scope namespaces of a given + element
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?QName to resolve
element()Element with in-scope namespaces
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:resolve-QName('x:local', $element)QName("http://www.example.com/ns", "local")
fn:resolve-QName('local', $element)QName("", "local")

+ W3C Documentation reference: Resolve-QName +
+ + + + fn:nilled(node) +
+ Returns a Boolean value indicating whether the argument node is nilled
+
+ W3C Documentation reference: #func-nilled + +
+ + + + +
-
- - fn:for-each(sequence*, function) -
- Applies function item to every element in sequence
-
- W3C Documentation reference: #func-for-each -
- - - + + fn:for-each-pair(item()*, item()*, function(item(), item())) +
+ Applies a processing function to pairs of items from two input sequences in a + pairwise fashion, resulting in a sequence of the same length as the shorter input + sequence
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
item()*The first input sequence of items
item()*The second input sequence of items
function(item(), item())The processing function used to process pairs of items from the input + sequences
item()*The resulting sequence after applying the processing function to pairs + of items
+ Examples:
+ + + + + + + + + +
ExpressionResult
for-each-pair((1, 2, 3), ("a", "b"), function($item1, $item2) { + concat($item1, $item2) })Returns a sequence with the concatenated pairs of items: + ("1a", "2b") +

+ W3C Documentation reference: for-each-pair +
+ + + + + fn:filter(item()*, function(item()) +
+ Filters a sequence of items based on a given predicate function
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*The input sequence of items
function(item())The predicate function used to filter the items
item()*The resulting sequence after applying the predicate function
+ Examples:
+ + + + + + + + + +
ExpressionResult
filter((1, 2, 3, 4), function($x) { $x mod 2 = 0 })Returns a new sequence containing only the even numbers from the input + sequence: (2, 4)

+ W3C Documentation reference: filter +
+ + + fn:for-each(item()*, function(item())) +
+ Applies a specified function to each item in a sequence, returning a new + sequence
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*The input sequence of items
function(item())The function to apply to each item in the sequence
item()*The new sequence created by applying the function to each item in the + input sequence
+ Examples:
+ + + + + + + + + +
ExpressionResult
for-each((1, 2, 3, 4), function($x) { $x * 2 })Returns a new sequence with the result of doubling each number in the + input sequence: (2, 4, 6, 8)

+ W3C Documentation reference: for-each +
+
+ +
+ + + +
+ + fn:apply(function(item()*), array(*)) +
+ Applies a function to a sequence of arguments
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
function(item()*) as item()*The function to be applied
SequenceSequence of arguments to pass to the function
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:apply(fn:concat#2, ('Hello', ' World'))'Hello World'
fn:apply(fn:substring#2, ('Hello World', 7))'World'

+ W3C Documentation reference: Apply +
+ + + fn:outermost(node()*) +
+ Returns the outermost nodes of the input sequence that are not ancestors of any other + node in the input sequence
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()*Sequence of nodes
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:outermost(//chapter)Sequence of outermost chapter nodes
fn:outermost(/book//*)Sequence of outermost nodes in the book

+ W3C Documentation reference: outermost +
+ + + fn:innermost(node()*) +
+ Returns the innermost nodes of the input sequence that are not descendants of any other + node in the input sequence
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()*Sequence of nodes
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:innermost(//chapter)Sequence of innermost chapter nodes
fn:innermost(/book//*)Sequence of innermost nodes in the book

+ W3C Documentation reference: innermost +
+ + + fn:has-children(node()?) +
+ Returns true if the specified node has one or more children, otherwise returns false
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:has-children(/book/chapter[1])true
fn:has-children(/book/chapter[1]/title)false

+ W3C Documentation reference: has-children +
+ + + fn:path(node()?) +
+ Returns a string that represents the path of the specified node within the XML + document
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:path(/book/chapter[1])/book/chapter[1]
fn:path(/book/chapter[2]/title)/book/chapter[2]/title

+ W3C Documentation reference: path +
+ + + fn:root(node()?) +
+ Returns the root node of the tree that contains the specified node
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:root(/book/chapter)<book> element (root node)
fn:root(/book/chapter[1])<book> element (root node)

+ W3C Documentation reference: root +
+ + + fn:namespace-uri(node()?) +
+ Returns the namespace URI of the specified node
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:namespace-uri(/example:root)"http://www.example.com/ns"
fn:namespace-uri(/a/b)""

+ W3C Documentation reference: namespace-uri +
+ + + fn:local-name(node()?) +
+ Returns the local part of the name of the specified node
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:local-name(/a/b)"b"
fn:local-name(/example:root)"root"

+ W3C Documentation reference: local-name +
+ + fn:name(node()?) +
+ Returns the expanded QName of the specified node as a string
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:name(/a/b)"b"
fn:name(/example:root)"example:root"

+ W3C Documentation reference: name +
+ + + + fn:document-uri(node?) +
+ Returns the document URI of the given node or the context item
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node?Returns the document URI of the specified node or the context item (if no + argument is provided)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:document-uri(/library/fiction:book[1])http://example.com/library.xml (assuming the document URI of the first + fiction:book element is "http://example.com/library.xml")
fn:document-uri(/library)http://example.com/library.xml (assuming the document URI of the library + element is "http://example.com/library.xml")

+ W3C Documentation reference: Document-URI +
+ + + fn:base-uri(node?) +
+ Returns the base URI of the node or the context item
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node?Returns the base URI of the specified node or the context item (if no + argument is provided)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:base-uri(/library/fiction:book[1])http://example.com/library.xml (assuming the base URI of the first + fiction:book element is "http://example.com/library.xml")
fn:base-uri(/library)http://example.com/library.xml (assuming the base URI of the library element + is "http://example.com/library.xml")

+ W3C Documentation reference: Base-URI +
+ + + fn:node-name(node?) +
+ + Returns the name of a node as an xs:QName
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node?Returns the name of the specified node or the context item if the argument + is omitted
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:node-name(/library/*[1])fiction:book
fn:node-name(/library/fiction:book[1]/title)title

+ W3C Documentation reference: Node-Name +
+ +
+
+
+ + + +
+ + fn:not(item()*) +
+ Returns the negation of the effective boolean value of the argument
+ Arguments and return type: + + + + + + + + + +
TypeDescription
item()*Argument whose effective boolean value is to be negated
+ Examples:
+ + + + + + + + + + + + + + + + + + + + + +
ExpressionResult
fn:not(1)false
fn:not(0)true
fn:not('')true
fn:not('true')false

+ W3C Documentation reference: Not +
+ + + fn:false() +
+ Returns the boolean value false
+ Arguments and return type: + + + + + + + + + +
TypeDescription
NoneReturns the boolean value false
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:false()false
//item[fn:false()]Returns an empty node-set

+ W3C Documentation reference: False +
+ + + fn:true() +
+ Returns the boolean value true
+ Arguments and return type: + + + + + + + + + +
TypeDescription
NoneReturns the boolean value true
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:true()true
//item[fn:true()]Returns all <item> elements

+ W3C Documentation reference: True +
+ + + fn:boolean(item()*) +
+ Converts the argument to a boolean value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
item()*Argument to be converted to a boolean value
+ Examples:
+ + + + + + + + + + + + + + + + + + + + + +
ExpressionResult
fn:boolean(1)true
fn:boolean(0)false
fn:boolean('')false
fn:boolean('true')true

+ W3C Documentation reference: Boolean +
+ + +
+
+
+ + + +
+ + fn:unparsed-text-available(xs:string?, xs:string?) +
+ Determines if an unparsed text resource identified by a URI can be read using the given + encoding
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI identifying the unparsed text resource
xs:string?The encoding to be used for reading the resource
xs:booleanIndicates if the resource can be read using the given encoding
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:unparsed-text-available("http://www.example.com/text.txt", "UTF-8")Returns true if the text resource identified by the specified URI can be + read using the specified encoding, otherwise false

+ W3C Documentation reference: unparsed-text-available +
+ + + fn:unparsed-text-lines(xs:string?, xs:string?) +
+ Returns the contents of an unparsed text resource identified by a URI, split into + lines
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI identifying the unparsed text resource
xs:string?The encoding to be used for reading the resource
xs:string*The lines of the unparsed text resource
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:unparsed-text-lines("http://www.example.com/text.txt", "UTF-8")Returns the lines of the text resource identified by the specified URI, + using the specified encoding

+ W3C Documentation reference: unparsed-text-lines +
+ + + fn:unparsed-text(xs:string?, xs:string?) +
+ Returns the contents of an unparsed text resource identified by a URI
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI identifying the unparsed text resource
xs:string?The encoding to be used for reading the resource
xs:string?The contents of the unparsed text resource
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:unparsed-text("http://www.example.com/text.txt", "UTF-8")Returns the contents of the text resource identified by the specified URI, + using the specified encoding

+ W3C Documentation reference: unparsed-text +
+ + + fn:escape-html-uri(xs:string?) +
+ Escapes special characters in a URI to be used in HTML
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?URI to be escaped for use in HTML
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:escape-html-uri('https://example.com/search?q=test&lang=en')https://example.com/search?q=test&lang=en
fn:escape-html-uri('https://example.com/page?id=1§ion=2')https://example.com/page?id=1&section=2

+ W3C Documentation reference: Escape-HTML-URI +
+ + + fn:iri-to-uri(xs:string?) +
+ Converts an IRI to a URI by escaping non-ASCII characters
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?IRI to be converted to a URI
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:iri-to-uri('https://example.com/ümlaut')https://example.com/%C3%BCmlaut
fn:iri-to-uri('https://example.com/日本語')https://example.com/%E6%97%A5%E6%9C%AC%E8%AA%9E

+ W3C Documentation reference: IRI-to-URI +
+ + + fn:encode-for-uri(xs:string?) +
+ Encodes a string for use in a URI by escaping special characters
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?String to be encoded for use in a URI
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:encode-for-uri('hello world')hello%20world
fn:encode-for-uri('example?query=value¶m=value2')example%3Fquery%3Dvalue%26param%3Dvalue2

+ W3C Documentation reference: Encode-for-URI +
+ + + fn:resolve-uri(xs:string?, xs:string?) +
+ Resolves a relative URI using a base URI
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Relative URI to resolve
xs:string?Base URI to use for resolving (optional)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:resolve-uri('example.html', 'https://www.example.com/folder/')https://www.example.com/folder/example.html
fn:resolve-uri('../images/pic.jpg', + 'https://www.example.com/folder/page.html')https://www.example.com/images/pic.jpg

+ W3C Documentation reference: Resolve-URI +
+ + + + fn:analyze-string(xs:string?, xs:string, xs:string?) +
+ Analyzes the input string and returns an XML fragment containing match and non-match + elements
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to analyze
xs:stringRegular expression pattern to match
xs:string?Flags to control the regular expression matching (optional)
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:analyze-string('red,green,blue', ',') + <fn:analyze-string-result><fn:non-match>red</fn:non-match><fn:match>, + <fn:non-match>green</fn:non-match><fn:match>, + <fn:non-match>blue</fn:non-match></fn:analyze-string-result> +

+ W3C Documentation reference: Analyze-String +
+ + + fn:tokenize(xs:string?, xs:string, xs:string?) +
+ Splits the input string into a sequence of substrings using the pattern as a delimiter +
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to tokenize
xs:stringRegular expression pattern to use as delimiter
xs:string?Flags to control the regular expression matching (optional)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:tokenize('XPath 3.0, XQuery 3.0, XSLT 3.0', ',\\s*')('XPath 3.0', 'XQuery 3.0', 'XSLT 3.0')
fn:tokenize('apple,orange,banana', ',')('apple', 'orange', 'banana')

+ W3C Documentation reference: Tokenize +
+ + + fn:replace(xs:string?, xs:string, xs:string, xs:string?) +
+ Replaces occurrences of the pattern in the input string with the replacement string
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:stringRegular expression pattern to match
xs:stringReplacement string
xs:string?Flags to control the regular expression matching (optional)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:replace('XPath 3.0 is great', '3.0', '3.1')'XPath 3.1 is great'
fn:replace('Hello, World!', 'World', 'XPath')'Hello, XPath!'

+ W3C Documentation reference: Replace +
+ + + fn:matches(xs:string?, xs:string, xs:string?) +
+ Returns true if the input string matches the regular expression pattern, otherwise false +
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:stringRegular expression pattern to match
xs:string?Flags to control the regular expression matching (optional)
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:matches('XPath 3.0', '\\d\\.\\d')true
fn:matches('Hello, World!', '[A-Z][a-z]*')true
fn:matches('example123', '\\d+', 'q')false

+ W3C Documentation reference: Matches +
+ + + fn:substring-after(xs:string?, xs:string?) +
+ Returns the part of the first string that follows the first occurrence of the second + string
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:string?Substring to search for
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:substring-after('Hello, World!', ',')' World!'
fn:substring-after('XPath 3.0 is awesome!', '3.0')' is awesome!'

+ W3C Documentation reference: Substring-After +
+ + + fn:substring-before(xs:string?, xs:string?) +
+ Returns the part of the first string that precedes the first occurrence of the second + string
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:string?Substring to search for
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:substring-before('Hello, World!', ',')'Hello'
fn:substring-before('XPath 3.0 is awesome!', '3.0')'XPath '

+ W3C Documentation reference: Substring-Before +
+ + + fn:ends-with(xs:string?, xs:string?) +
+ Returns true if the first string ends with the second string, otherwise false
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to check
xs:string?Substring to check for at the end of the first string
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:ends-with('Hello, World!', 'World!')true
fn:ends-with('Hello, World!', 'Hello')false
fn:ends-with('XPath 3.0', '3.0')true

+ W3C Documentation reference: Ends-With +
+ + + fn:starts-with(xs:string?, xs:string?) +
+ Returns true if the first string starts with the second string, otherwise false
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to check
xs:string?Substring to check for at the beginning of the first string
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:starts-with('Hello, World!', 'Hello')true
fn:starts-with('Hello, World!', 'World')false
fn:starts-with('XPath 3.0', 'XPath')true

+ W3C Documentation reference: Starts-With +
+ + + fn:contains(xs:string?, xs:string?) +
+ Returns true if the first string contains the second string, otherwise false
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:string?Substring to search for
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:contains('Hello, World!', 'World')true
fn:contains('Hello, World!', 'world')false
fn:contains('XPath 3.0', '3.0')true

+ W3C Documentation reference: Contains +
+ + + fn:translate(xs:string?, xs:string, xs:string) +
+ Returns the input string with specified characters replaced
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to be translated
xs:stringMap string with characters to replace
xs:stringTranslate string with replacement characters
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:translate('apple', 'aeiou', '12345')'1ppl2'
fn:translate('Hello, World!', 'HW', 'hw')'hello, world!'

+ W3C Documentation reference: Translate +
+ + + fn:lower-case(xs:string?) +
+ Returns the input string with all characters converted to lowercase
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string to convert to lowercase
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:lower-case('HELLO, WORLD!')'hello, world!'
fn:lower-case('XPath 3.0')'xpath 3.0'
fn:lower-case('BANANA')'banana'

+ W3C Documentation reference: Lower-Case +
+ + + fn:upper-case(xs:string?) +
+ Returns the input string with all characters converted to uppercase
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string to convert to uppercase
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:upper-case('Hello, World!')'HELLO, WORLD!'
fn:upper-case('XPath 3.0')'XPATH 3.0'
fn:upper-case('banana')'BANANA'

+ W3C Documentation reference: Upper-Case +
+ + + fn:normalize-unicode(xs:string?, xs:string) +
+ Returns the input string with Unicode normalization applied
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to normalize
xs:stringNormalization form to apply (NFC, NFD, NFKC, NFKD)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:normalize-unicode('Café', 'NFC')'Café'
fn:normalize-unicode('Café', 'NFD')'Café'

+ W3C Documentation reference: Normalize-Unicode +
+ + + fn:normalize-space(xs:string?) +
+ Returns the input string with whitespace normalized
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string to normalize whitespace
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:normalize-space(' Hello, World! ')'Hello, World!'
fn:normalize-space(' XPath 3.0 ')'XPath 3.0'
fn:normalize-space('\tbanana\t')'banana'

+ W3C Documentation reference: Normalize-Space +
+ + + fn:string-length(xs:string?) +
+ Returns the length of the input string
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string to calculate length
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:string-length('Hello, World!')13
fn:string-length('XPath 3.0')8
fn:string-length('banana')6

+ W3C Documentation reference: String-Length +
+ + + fn:substring(xs:string?, xs:double) +
+ Returns a substring of the source string, starting from a specific location
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input source string
xs:doubleStarting location to extract the substring
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:substring('Hello, World!', 1, 5)'Hello'
fn:substring('XPath 3.0', 7)'3.0'
fn:substring('banana', 2, 3)'ana'

+ W3C Documentation reference: Substring +
+ + fn:string-join(xs:string*, xs:string) +
+ Joins a sequence of strings with a specified separator, returning a single string
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string*Input sequence of strings to join
xs:stringSeparator string to insert between joined strings
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:string-join(('apple', 'banana', 'orange'), ', ')'apple, banana, orange'
fn:string-join(('XPath', '3.0', 'Functions'), ' - ')'XPath - 3.0 - Functions'
fn:string-join(('A', 'B', 'C'), '')'ABC'

+ W3C Documentation reference: String-Join +
+ + + fn:concat(xs:anyAtomicType?, xs:anyAtomicType?, ...) +
+ Concatenates two or more strings or atomic values, returning a single string
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:anyAtomicType?Input strings or atomic values to concatenate
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:concat('Hello', ' ', 'World')'Hello World'
fn:concat('I have ', 3, ' apples')'I have 3 apples'
fn:concat('XPath ', '3.0')'XPath 3.0'

+ W3C Documentation reference: Concat +
+ + + fn:codepoint-equal(xs:string?, xs:string?) +
+ Compares two strings on a codepoint-by-codepoint basis and returns true if they are + equal, false otherwise
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?First string to compare
xs:string?Second string to compare
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:codepoint-equal('Hello', 'Hello')true
fn:codepoint-equal('Hello', 'hello')false
fn:codepoint-equal('apple', 'banana')false

+ W3C Documentation reference: Codepoint-Equal +
+ + + fn:compare(xs:string?, xs:string?) +
+ Compares two strings and returns -1, 0, or 1 if the first string is less than, equal to, + or greater than the second string, respectively
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?First string to compare
xs:string?Second string to compare
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:compare('apple', 'banana')-1
fn:compare('apple', 'apple')0
fn:compare('banana', 'apple')1

+ W3C Documentation reference: Compare +
+ + + fn:string-to-codepoints(xs:string?) +
+ Returns a sequence of Unicode code points for a given string
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:string-to-codepoints('Hello')(72, 101, 108, 108, 111)
fn:string-to-codepoints('( ͡° ͜ʖ ͡°)')(40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41)
fn:string-to-codepoints('😊')(128522)

+ W3C Documentation reference: String-To-Codepoints +
+ + + fn:codepoints-to-string(xs:integer*) +
+ Constructs a string from a sequence of Unicode code points
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:integer*Sequence of Unicode code points
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:codepoints-to-string((72, 101, 108, 108, 111))Hello
codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41)) + ( ͡° ͜ʖ ͡°)
fn:codepoints-to-string((128522))😊

+ W3C Documentation reference: Codepoints-To-String +
+ + + + fn:string(object) +
+ Returns the string representation of the object argument
+ Arguments and return type: + + + + + + + + + +
TypeDescription
stringThe object to convert to a string
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
string((1<0))false
string(.11)0.11

+ W3C Documentation reference: String-Functions +
+ + +
+
+
+ + + +
+ + + fn:format-number(numeric?, xs:string, item()?) +
+ Returns a string that represents a formatted version of a number using a formatting + pattern and an optional + set of properties
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
numeric?The number to format
xs:stringThe formatting pattern
item()?Optional: the set of properties for formatting the number
xs:stringThe formatted number as a string
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
format-number(12345.678, "#,##0.00")Returns the formatted number: "12,345.68"
format-number(12345.678, "#,##0")Returns the formatted number: "12,346"
format-number(12345.678, "0.000")Returns the formatted number: "12345.678"

+ W3C Documentation reference: format-number +
+ + + + fn:format-integer(xs:integer?, xs:string) +
+ Formats an integer value according to the supplied picture string
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:integer?Integer value to be formatted
xs:stringPicture string defining the format
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:format-integer(12345, '0,0')12,345
fn:format-integer(-1234, '0,0')-1,234
fn:format-integer(1234, '00-00-00')01-23-45

+ W3C Documentation reference: Format-Integer +
+ + + fn:round-half-to-even(numeric?) +
+ Returns the closest integer to the given numeric value, rounding half-way cases to the + nearest even integer (also known as "bankers' rounding")
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the rounded value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + + + + + +
ExpressionResult
fn:round-half-to-even(3.5)4
fn:round-half-to-even(2.5)2
fn:round-half-to-even(-1.5)-2
fn:round-half-to-even(xs:decimal('1.25'), 1)1.2

+ W3C Documentation reference: Round-Half-To-Even +
+ + + fn:round(numeric?) +
+ Returns the closest integer to the given numeric value, rounding half-way cases away + from zero
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the rounded value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:round(3.14)3
fn:round(-4.7)-5
fn:round(xs:decimal('2.5'))3

+ W3C Documentation reference: Round +
+ + + fn:floor(numeric?) +
+ Returns the largest integer less than or equal to the given numeric value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the floor value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:floor(3.14)3
fn:floor(-4.7)-5
fn:floor(xs:decimal('2.5'))2

+ W3C Documentation reference: Floor +
+ + + + fn:ceiling(numeric?) +
+ Returns the smallest integer greater than or equal to the given numeric value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the ceiling value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:ceiling(3.14)4
fn:ceiling(-4.7)-4
fn:ceiling(xs:decimal('2.5'))3

+ W3C Documentation reference: Ceiling +
+ + + fn:abs(numeric?) +
+ Returns the absolute value of the given numeric value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the absolute value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:abs(-42)42
fn:abs(3.14)3.14
fn:abs(xs:decimal('-5.5'))5.5

+ W3C Documentation reference: Abs +
+ + fn:number(item?) +
+ Converts the given value to a number
+ Arguments and return type: + + + + + + + + + +
TypeDescription
item?Returns the numeric value of the specified expression or the context item + (if no argument is provided)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:number(/library/fiction:book[1]/@id)1 (if the first fiction:book element's id attribute is "1")
fn:number(/library/fiction:book[1]/price)19.99 (if the first fiction:book element's price element contains "19.99") +

+ W3C Documentation reference: Number +
+ + + + +
+
+
+ + + +
+ + fn:sort(item()*) +
+ Sorts an array of items based on their atomic values
+ Arguments and return type: + + + + + + + + + +
TypeDescription
ArrayThe array of items to be sorted
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:sort([10, 5, 20])[5, 10, 20]
fn:sort(['banana', 'apple', 'cherry'])['apple', 'banana', 'cherry']

+ W3C Documentation reference: Sort +
+ + + fn:fold-right(item()*, item()*, function(item(), item()*)) +
+ Applies a processing function cumulatively to the items of a sequence from right to + left, so as to reduce the sequence to a single value
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
item()*The input sequence of items
item()*The initial value, also known as the zero value
function(item(), item()*)The processing function used to accumulate the items
item()*The resulting single value after applying the processing function
+ Examples:
+ + + + + + + + + +
ExpressionResult
fold-right((1, 2, 3, 4), 0, function($current, $accumulator) { $accumulator + - $current })Returns the result of subtracting each number in the input sequence from + right to left: -2

+ W3C Documentation reference: fold-right +
+ + + fn:fold-left(item()*, item()*, function(item()*, item())) +
+ Applies a processing function cumulatively to the items of a sequence from left to + right, so as to reduce the sequence to a single value
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
item()*The input sequence of items
item()*The initial value, also known as the zero value
function(item()*, item())The processing function used to accumulate the items
item()*The resulting single value after applying the processing function
+ Examples:
+ + + + + + + + + +
ExpressionResult
fold-left((1, 2, 3, 4), 0, function($accumulator, $current) { $accumulator + + $current })Returns the sum of the numbers in the input sequence: 10

+ W3C Documentation reference: fold-left +
+ + + + + fn:last() +
+ Returns the position of the last item in the current context sequence
+ Arguments and return type: + + + + + + + + + +
TypeDescription
NoneReturns the position of the last item in the current context sequence
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
/library/fiction:book[position() = last()]Returns the last fiction:book element in the library
/library/fiction:book[last()]Returns the last fiction:book element in the library

+ W3C Documentation reference: Last +
+ + fn:position() +
+ Returns the context position of the context item in the sequence currently being + processed
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:integerThe position of the context item in the sequence
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
<items><item>Item 1</item><item>Item + 2</item></items>/item[position()=2]Returns '<item>Item 2</item>'
<items><item>Item 1</item><item>Item + 2</item></items>/item[position()=1]Returns '<item>Item 1</item>'

+ W3C Documentation reference: position +
+ + + fn:collection(xs:string?) +
+ Returns a sequence of document nodes obtained from the collection identified by the + argument URI, or the + default collection if no argument is supplied.
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI of the collection to retrieve (Optional)
document-node()*A sequence of document nodes obtained from the collection
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
collection()Returns the sequence of document nodes from the default collection
collection("http://example.com/collection")Returns the sequence of document nodes from the collection identified by the + specified URI
count(collection())Returns the number of document nodes in the default collection

+ W3C Documentation reference: collection +
+ + + fn:sum(xs:anyAtomicType*, xs:anyAtomicType?) +
+ Returns the sum of a sequence of numeric values
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*Input sequence of numeric values
xs:anyAtomicType?Value to return if the sequence is empty (optional)
xs:anyAtomicType?Sum of the input sequence
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:sum((10, 20, 30, 40, 50))150
fn:sum((), 0)0

+ W3C Documentation reference: sum +
+ + + fn:min(xs:anyAtomicType*) +
+ Returns the minimum value of a sequence of atomic values, according to the ordering + rules for the value's + type
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*The input sequence of atomic values
xs:anyAtomicType?The minimum value of the input sequence, or the empty sequence if the input + sequence is empty +
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
min((5, 1, 9, 3))Returns the minimum value: 1
min(())Returns the empty sequence: ()
min(("apple", "banana", "cherry"))Returns the minimum value (alphabetical order): "apple"

+ W3C Documentation reference: min +
+ + + fn:max(xs:anyAtomicType*) +
+ Returns the maximum value of a sequence of atomic values, according to the ordering + rules for the value's + type
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*The input sequence of atomic values
xs:anyAtomicType?The maximum value of the input sequence, or the empty sequence if the input + sequence is empty +
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
max((5, 1, 9, 3))Returns the maximum value: 9
max(())Returns the empty sequence: ()
max(("apple", "banana", "cherry"))Returns the maximum value (alphabetical order): "cherry"

+ W3C Documentation reference: max +
+ + + + fn:avg(xs:anyAtomicType*) +
+ Computes the average of the numeric values in the input sequence
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*Input sequence of numeric values
xs:anyAtomicType?Average of the numeric values in the input sequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:avg((10, 20, 30, 40, 50))30
fn:avg((2.5, 3.5, 4.5))3.5
fn:avg(())empty sequence

+ W3C Documentation reference: avg +
+ + + fn:count(item()*) +
+ Returns the number of items in the input sequence
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
xs:integerNumber of items in the input sequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:count(('apple', 'banana', 'orange'))3
fn:count(())0
fn:count((1, 2, 3, 4, 5))5

+ W3C Documentation reference: count +
+ + + fn:exactly-one(item()*) +
+ Returns the single item in the input sequence or raises an error if the sequence is + empty or contains more than one item
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
item()Single item from the input sequence, otherwise an error is raised
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:exactly-one(('apple'))'apple'
fn:exactly-one(('apple', 'banana'))Error (more than one item)
fn:exactly-one(())Error (empty sequence)

+ W3C Documentation reference: exactly-one +
+ + + fn:one-or-more(item()*)+ +
+ Returns the input sequence if it contains one or more items, otherwise raises an + error
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
item()+Sequence containing one or more items, otherwise an error is raised
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:one-or-more(('apple', 'banana'))('apple', 'banana')
fn:one-or-more(('pear'))('pear')

+ W3C Documentation reference: one-or-more +
+ + + fn:zero-or-one(item()*) +
+ Returns the input sequence if it contains zero or one items, otherwise raises an + error
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
item()?Sequence containing zero or one item, otherwise an error is raised
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:zero-or-one(('apple'))('apple')
fn:zero-or-one(())()

+ W3C Documentation reference: zero-or-one +
+ + + fn:deep-equal(item()* , item()*) +
+ Returns true if the two input sequences are deep-equal, meaning that they have the same + structure and atomic values
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*First input sequence
item()*Second input sequence
xs:booleanTrue if the input sequences are deep-equal, otherwise false
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:deep-equal((1, 2, 3), (1, 2, 3))true
fn:deep-equal((1, 2, 3), (1, 2, 4))false

+ W3C Documentation reference: deep-equal +
+ + + fn:index-of(xs:anyAtomicType*, xs:anyAtomicType) +
+ Returns a sequence of integers indicating the positions of items in the input sequence + that are equal to the search item
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*Input sequence of atomic values
xs:anyAtomicTypeSearch item to find in the input sequence
xs:integer*Sequence of integers representing the positions of the search item in the + input sequence
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:index-of((3, 1, 4, 1, 5, 9, 2, 2, 3), 1)(2, 4)
fn:index-of(('apple', 'banana', 'orange', 'apple', 'grape', 'orange'), + 'apple')(1, 4)

+ W3C Documentation reference: index-of +
+ + + fn:distinct-values(xs:anyAtomicType*) +
+ Returns a sequence of distinct atomic values from the input sequence
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*Input sequence of atomic values
xs:anyAtomicType*Distinct sequence of atomic values
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:distinct-values((3, 1, 4, 1, 5, 9, 2, 2, 3))(3, 1, 4, 5, 9, 2)
fn:distinct-values(('apple', 'banana', 'orange', 'apple', 'grape', + 'orange'))('apple', 'banana', 'orange', 'grape')

+ W3C Documentation reference: distinct-values +
+ + + fn:unordered(item()*) +
+ Returns the items of a sequence in an implementation-dependent order
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
item()*Unordered sequence
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:unordered((3, 1, 4, 1, 5, 9, 2))(1, 2, 3, 4, 5, 9, 1) (example result; actual order may vary)
fn:unordered(('apple', 'banana', 'orange', 'grape'))('banana', 'apple', 'orange', 'grape') (example result; actual order may + vary)

+ W3C Documentation reference: unordered +
+ + + fn:subsequence(item()*, xs:double, xs:double) +
+ Returns a subsequence of a given sequence starting at a specified position with a + specified length
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
xs:doubleStarting position
xs:doubleLength of subsequence
item()*Subsequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:subsequence((1, 2, 3, 4, 5), 2, 3)(2, 3, 4)
fn:subsequence(('apple', 'banana', 'orange', 'grape'), 1, 2)('apple', 'banana')
fn:subsequence(('red', 'blue', 'green', 'yellow'), 3)('green', 'yellow')

+ W3C Documentation reference: subsequence +
+ + + fn:reverse(item()*) +
+ Reverses the order of items in a sequence
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
item()*Reversed sequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:reverse((1, 2, 3, 4))(4, 3, 2, 1)
fn:reverse(('apple', 'banana', 'orange'))('orange', 'banana', 'apple')
fn:reverse(('red', 'blue', 'green'))('green', 'blue', 'red')

+ W3C Documentation reference: reverse +
+ + + fn:remove(item()*, xs:integer) +
+ Removes an item from a sequence at the specified position
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*Target sequence
xs:integerPosition of the item to remove
item()*New sequence with the item removed
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:remove((1, 2, 3, 4), 2)(1, 3, 4)
fn:remove(('apple', 'banana', 'orange'), 3)('apple', 'banana')
fn:remove((10, 20, 30), 1)(20, 30)

+ W3C Documentation reference: remove +
+ + + fn:insert-before(item()*, xs:integer, item()*) +
+ Inserts items from the specified sequence into another sequence at a given position
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
item()*Target sequence
xs:integerPosition at which to insert the items
item()*Sequence of items to insert
item()*New sequence with items inserted
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:insert-before((1, 3, 4), 2, (2))(1, 2, 3, 4)
fn:insert-before(('apple', 'orange'), 1, ('banana'))('banana', 'apple', 'orange')
fn:insert-before((10, 20, 30), 4, (40))(10, 20, 30, 40)

+ W3C Documentation reference: insert-before +
+ + + fn:tail(item()*) +
+ Returns all items of the input sequence except the first one, or an empty sequence if + the input is empty or contains only one item
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Sequence of items
item()*All items except the first one, or an empty sequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:tail((1, 2, 3))(2, 3)
fn:tail((1))()
fn:tail(/books/book/author)All authors in the "books" element except the first one

+ W3C Documentation reference: tail +
+ + + fn:head(item()*) +
+ Returns the first item of the input sequence, or an empty sequence if the input is + empty
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Sequence of items
item()?The first item of the sequence, or an empty sequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:head((1, 2, 3))1
fn:head(())()
fn:head(/books/book[1]/author)The first author of the first book in the "books" element

+ W3C Documentation reference: head +
+ + + fn:exists(item()*) +
+ Returns true if the input sequence is not empty, otherwise returns false
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Sequence of items
xs:booleanResult of the test (true or false)
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:exists((1, 2, 3))true
fn:exists(())false
fn:exists(//chapter[5])true if there are at least 5 chapters, otherwise false

+ W3C Documentation reference: exists +
+ + + fn:empty(item()*) +
+ Returns true if the input sequence is empty, otherwise returns false
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Sequence of items
xs:booleanResult of the test (true or false)
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:empty((1, 2, 3))false
fn:empty(())true
fn:empty(//chapter[100])true if there are less than 100 chapters, otherwise false

+ W3C Documentation reference: empty +
+ + + + + fn:data(item*) +
+ Returns the simple value of an item or a sequence of items
+ Arguments and return type: + + + + + + + + + +
TypeDescription
item?Returns the simple value of the specified item or the context item (if no + argument is provided)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:data(/library/fiction:book[1]/title)The Catcher in the Rye
fn:data(/library/fiction:book[2]/author)Harper Lee

+ W3C Documentation reference: Data +
+ + +
+
+
+ + + +
+ + + + fn:implicit-timezone() +
+ Returns the implicit timezone as an xs:dayTimeDuration
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:dayTimeDurationThe implicit timezone as a dayTimeDuration
+ Examples:
+ + + + + + + + + +
ExpressionResult
implicit-timezone()Returns the implicit timezone as an xs:dayTimeDuration, e.g., '-PT7H' +

+ W3C Documentation reference: implicit-timezone +
+ + + fn:current-time() +
+ Returns the current time with timezone
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:timeThe current time with timezone
+ Examples:
+ + + + + + + + + +
ExpressionResult
current-time()Returns the current time with timezone, e.g., '13:45:30.123-07:00'

+ W3C Documentation reference: current-time +
+ + + fn:current-date() +
+ Returns the current date with timezone
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:dateThe current date with timezone
+ Examples:
+ + + + + + + + + +
ExpressionResult
current-date()Returns the current date with timezone, e.g., '2023-03-29-07:00'

+ W3C Documentation reference: current-date +
+ + + fn:current-dateTime() +
+ Returns the current date and time with timezone
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:dateTimeThe current date and time with timezone
+ Examples:
+ + + + + + + + + +
ExpressionResult
current-dateTime()Returns the current date and time with timezone, e.g., + '2023-03-29T12:34:56.789-07:00'

+ W3C Documentation reference: current-dateTime +
+ + + fn:format-time(xs:time?, xs:string, xs:string?, xs:string?, xs:string?) +
+ Formats a time value according to a formatting picture string, with optional language, + calendar, and + country parameters.
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
xs:time?The time value to be formatted (Optional)
xs:stringThe formatting picture string
xs:string?The language for formatting (Optional)
xs:string?The calendar for formatting (Optional)
xs:string?The country for formatting (Optional)
xs:stringThe formatted time value as a string
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
format-time(xs:time("14:30:00"), "[H]:[m]")"14:30"
format-time(xs:time("14:30:00"), "[H]:[m]:[s]")"14:30:00"
format-time(xs:time("14:30:00.456"), "[H]:[m]:[s].[f]")"14:30:00.456"

+ W3C Documentation reference: format-time +
+ + + + fn:format-date(xs:date?, xs:string, xs:string?, xs:string?, xs:string?) +
+ Formats a date value using the provided picture string and optional language, + calendar, and country settings
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
xs:date?Date value
xs:stringPicture string
xs:string?Language
xs:string?Calendar
xs:string?Country
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:format-date(xs:date('2023-04-01'), '[Y0001]-[M01]-[D01]')2023-04-01
fn:format-date(xs:date('2023-04-01'), '[MNn,*-3] [D], [Y]')Apr 1, 2023

+ W3C Documentation reference: Format-Date +
+ + + fn:format-dateTime(xs:dateTime?, xs:string, xs:string?, xs:string?, xs:string?) +
+ Formats a dateTime value according to a formatting picture string, with optional + language, calendar, and + country parameters.
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
xs:dateTime?The dateTime value to be formatted (Optional)
xs:stringThe formatting picture string
xs:string?The language for formatting (Optional)
xs:string?The calendar for formatting (Optional)
xs:string?The country for formatting (Optional)
xs:stringThe formatted dateTime value as a string
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
format-dateTime(xs:dateTime("2023-04-12T14:30:00"), "[Y]-[M]-[D]T[H]:[m]") + "2023-04-12T14:30"
format-dateTime(xs:dateTime("2023-04-12T14:30:00"), "[FNn, Nn] [D] [MNn] + [Y]")"Wednesday, 12 April 2023"
format-dateTime(xs:dateTime("2023-04-12T14:30:00.123"), + "[Y]-[M]-[D]T[H]:[m]:[s].[f]")"2023-04-12T14:30:00.123"

+ W3C Documentation reference: format-dateTime +
+ + + + fn:adjust-time-to-timezone(xs:time?, xs:dayTimeDuration?) +
+ Adjusts the timezone of a time value
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:time?Time value
xs:dayTimeDuration?Timezone adjustment
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:adjust-time-to-timezone(xs:time('10:00:00-07:00'), + xs:dayTimeDuration('PT2H'))12:00:00-05:00
fn:adjust-time-to-timezone(xs:time('10:00:00Z'), + xs:dayTimeDuration('-PT3H'))07:00:00-03:00

+ W3C Documentation reference: Adjust-Time-To-Timezone +
+ + + + + fn:adjust-date-to-timezone(xs:date?, xs:dayTimeDuration?) +
+ Adjusts the timezone of a date value
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:date?Date value
xs:dayTimeDuration?Timezone adjustment
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:adjust-date-to-timezone(xs:date('2023-01-01-07:00'), + xs:dayTimeDuration('PT2H'))2023-01-01-05:00
fn:adjust-date-to-timezone(xs:date('2023-01-01Z'), + xs:dayTimeDuration('-PT3H'))2022-12-31-03:00

+ W3C Documentation reference: Adjust-Date-To-Timezone +
+ + + fn:adjust-dateTime-to-timezone(xs:dateTime?, xs:dayTimeDuration?) +
+ Adjusts the timezone of a dateTime value
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
xs:dayTimeDuration?Timezone adjustment
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:adjust-dateTime-to-timezone(xs:dateTime('2023-01-01T12:00:00-07:00'), + xs:dayTimeDuration('PT2H'))2023-01-01T17:00:00-05:00
fn:adjust-dateTime-to-timezone(xs:dateTime('2023-01-01T12:00:00Z'), + xs:dayTimeDuration('-PT3H'))2023-01-01T09:00:00-03:00

+ W3C Documentation reference: Adjust-DateTime-To-Timezone +
+ + + fn:timezone-from-time(xs:time?) +
+ Extracts the timezone component from an xs:time value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?Time value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:timezone-from-time(xs:time('12:00:00-07:00'))-PT7H
fn:timezone-from-time(xs:time('14:30:00+02:30'))PT2H30M

+ W3C Documentation reference: Timezone-From-Time +
+ + + fn:seconds-from-time(xs:time?) +
+ Extracts the seconds component from an xs:time value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?Time value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:seconds-from-time(xs:time('21:45:30.5'))30.5
fn:seconds-from-time(xs:time('04:15:12.1'))12.1

+ W3C Documentation reference: Seconds-From-Time +
+ + + fn:minutes-from-time(xs:time?) +
+ Extracts the minutes component from an xs:time value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?Time value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:minutes-from-time(xs:time('21:45:30'))45
fn:minutes-from-time(xs:time('04:15:12'))15

+ W3C Documentation reference: Minutes-From-Time +
+ + + fn:hours-from-time(xs:time?) +
+ Extracts the hours component from an xs:time value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?Time value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:hours-from-time(xs:time('21:45:30'))21
fn:hours-from-time(xs:time('04:15:12'))4

+ W3C Documentation reference: Hours-From-Time +
+ + + fn:timezone-from-date(xs:date?) +
+ Extracts the timezone component from an xs:date value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?Date value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:timezone-from-date(xs:date('2023-03-29+02:00'))PT2H
fn:timezone-from-date(xs:date('1980-12-15-05:00'))-PT5H

+ W3C Documentation reference: Timezone-From-Date +
+ + + fn:day-from-date(xs:date?) +
+ Extracts the day component from an xs:date value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?Date value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:day-from-date(xs:date('2023-03-29'))29
fn:day-from-date(xs:date('1980-12-15'))15

+ W3C Documentation reference: Day-From-Date +
+ + + fn:month-from-date(xs:date?) +
+ Extracts the month component from an xs:date value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?Date value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:month-from-date(xs:date('2023-03-29'))3
fn:month-from-date(xs:date('1980-12-15'))12

+ W3C Documentation reference: Month-From-Date +
+ + + fn:year-from-date(xs:date?) +
+ Extracts the year component from an xs:date value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?Date value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:year-from-date(xs:date('2023-03-29'))2023
fn:year-from-date(xs:date('1980-12-15'))1980

+ W3C Documentation reference: Year-From-Date +
+ + + fn:timezone-from-dateTime(xs:dateTime?) +
+ Extracts the timezone component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:timezone-from-dateTime(xs:dateTime('2023-03-29T12:30:45-07:00'))-PT7H
fn:timezone-from-dateTime(xs:dateTime('2023-12-15T18:45:30+03:30'))PT3H30M

+ W3C Documentation reference: Timezone-From-DateTime +
+ + + fn:seconds-from-dateTime(xs:dateTime?) +
+ Extracts the seconds component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:seconds-from-dateTime(xs:dateTime('2023-03-29T12:30:45'))45
fn:seconds-from-dateTime(xs:dateTime('2023-12-15T18:45:30.5-08:00')) + 30.5

+ W3C Documentation reference: Seconds-From-DateTime +
+ + + fn:minutes-from-dateTime(xs:dateTime?) +
+ Extracts the minutes component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:minutes-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))30
fn:minutes-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))45

+ W3C Documentation reference: Minutes-From-DateTime +
+ + + fn:hours-from-dateTime(xs:dateTime?) +
+ Extracts the hours component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:hours-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))12
fn:hours-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))18

+ W3C Documentation reference: Hours-From-DateTime +
+ + + fn:day-from-dateTime(xs:dateTime?) +
+ Extracts the day component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:day-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))29
fn:day-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))15

+ W3C Documentation reference: Day-From-DateTime +
+ + + fn:month-from-dateTime(xs:dateTime?) +
+ Extracts the month component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:month-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))3
fn:month-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))12

+ W3C Documentation reference: Month-From-DateTime +
+ + + fn:year-from-dateTime(xs:dateTime?) +
+ Extracts the year component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:year-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))2023
fn:year-from-dateTime(xs:dateTime('2023-03-29T12:30:00-08:00'))2023

+ W3C Documentation reference: Year-From-DateTime +
+ + + + + fn:dateTime(xs:date?, xs:time?) +
+ Constructs an xs:dateTime value from an xs:date and an xs:time value
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:date?Date value
xs:time?Time value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:dateTime(xs:date('2023-03-29'), xs:time('12:30:00'))2023-03-29T12:30:00
fn:dateTime(xs:date('2023-03-29+05:00'), xs:time('12:30:00-08:00'))2023-03-29T12:30:00-08:00

+ W3C Documentation reference: DateTime +
+ + + fn:seconds-from-duration(xs:duration?) +
+ Returns the seconds component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the seconds component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:seconds-from-duration(xs:dayTimeDuration('PT1H30M15.5S'))15.5
fn:seconds-from-duration(xs:dayTimeDuration('-PT2M10.3S'))-10.3

+ W3C Documentation reference: Seconds-From-Duration +
+ + + fn:minutes-from-duration(xs:duration?) +
+ Returns the minutes component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the minutes component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:minutes-from-duration(xs:dayTimeDuration('PT2H30M'))30
fn:minutes-from-duration(xs:dayTimeDuration('-PT1H45M'))-45

+ W3C Documentation reference: Minutes-From-Duration +
+ + + fn:hours-from-duration(xs:duration?) +
+ Returns the hours component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the hours component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:hours-from-duration(xs:dayTimeDuration('PT36H'))36
fn:hours-from-duration(xs:dayTimeDuration('-PT12H30M'))-12

+ W3C Documentation reference: Hours-From-Duration +
+ + + fn:days-from-duration(xs:duration?) +
+ Returns the days component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the days component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:days-from-duration(xs:dayTimeDuration('P5DT12H30M'))5
fn:days-from-duration(xs:dayTimeDuration('-P2DT6H'))-2

+ W3C Documentation reference: Days-From-Duration +
+ + + + fn:months-from-duration(xs:duration?) +
+ Returns the months component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the months component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:months-from-duration(xs:duration('P2Y3M4DT5H6M7S'))3
fn:months-from-duration(xs:duration('-P2Y3M4DT5H6M7S'))-3

+ W3C Documentation reference: Months-From-Duration +
+ + + fn:years-from-duration(xs:duration?) +
+ Returns the years component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the years component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:years-from-duration(xs:duration('P2Y3M4DT5H6M7S'))2
fn:years-from-duration(xs:duration('-P2Y3M4DT5H6M7S'))-2

+ W3C Documentation reference: Years-From-Duration +
+
+
+
+ + + +
+ + fn:trace(item()*, xs:string) +
+ Outputs the provided label and value for diagnostic purposes and returns the value + unchanged
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Value to be traced
xs:stringLabel to be output along with the value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:trace(42, 'The value is:')Outputs "The value is: 42" for diagnostic purposes and returns 42
fn:trace(/library/book/title, 'Book title:')Outputs "Book title: [book title]" for diagnostic purposes and returns + the book title

+ W3C Documentation reference: Trace +
+ + + fn:error(xs:QName?, xs:string?, $error-object) +
+ Raises an error with the specified error code, description, and error object
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:QName?Error code (optional)
xs:string?Description of the error (optional)
item()*Error object (optional)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:error(xs:QName('err:FOER0000'))Raise error with the code err:FOER0000
fn:error(xs:QName('err:FOER0000'), 'Invalid value')Raise error with the code err:FOER0000 and description "Invalid value" +

+ W3C Documentation reference: Error +
+ +
+
+
+ + + +
+ + fn:xml-to-json(node(), map(*)) +
+ Converts an XML representation of a JSON value to its JSON serialization
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
node()XML representation of a JSON value
map(*)Options for the JSON serialization
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:xml-to-json('<map><string + key="name">John</string><number + key="age">30</number></map>')'{"name": "John", "age": 30}'
fn:xml-to-json('<array><number>1</number><number>2</number><number>3</number></array>') + '[1, 2, 3]'

+ W3C Documentation reference: XML-to-JSON +
+ + + fn:json-to-xml(item()) +
+ Converts a JSON value to its XML representation
+ Arguments and return type: + + + + + + + + + +
TypeDescription
item()JSON value to be converted
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:json-to-xml(map{"name": "John", "age": 30}) + <map> + <string key="name">John</string> + <number key="age">30</number> + </map> +
fn:json-to-xml([1, 2, 3]) + <array> + <number>1</number> + <number>2</number> + <number>3</number> + </array> +

+ W3C Documentation reference: JSON-to-XML +
+ + + fn:json-doc(xs:string) +
+ Parses a JSON document from a URI and returns the corresponding value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:stringURI of the JSON document to be parsed
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:json-doc('https://example.com/data.json')Parsed JSON value from the specified URI

+ W3C Documentation reference: JSON-Doc +
+ + + fn:parse-json(xs:string?) +
+ Parses a JSON string and returns the corresponding value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?JSON string to be parsed
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:parse-json('{"name": "John", "age": 30}')map{"name": "John", "age": 30}
fn:parse-json('[1, 2, 3]')[1, 2, 3]

+ W3C Documentation reference: Parse-JSON +
+ + + fn:function-arity(function(*)) +
+ Returns the arity (number of arguments) of the specified function
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
function(*)The function to obtain the arity for
xs:integerThe arity (number of arguments) of the specified function
+ Examples:
+ + + + + + + + + +
ExpressionResult
function-arity(fn:substring)Returns the arity of the substring function: 2 (since + substring accepts two required arguments: the input string and the + starting index)

+ W3C Documentation reference: function-arity +
+ + + fn:function-name(function(*)) +
+ Returns the QName of the specified function
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
function(*)The function to obtain the QName for
xs:QName?The QName of the specified function, or an empty sequence if the + function is anonymous
+ Examples:
+ + + + + + + + + +
ExpressionResult
function-name(fn:substring)Returns the QName of the substring function: + QName("http://www.w3.org/2005/xpath-functions", "substring") +

+ W3C Documentation reference: function-name +
+ + + fn:function-lookup(xs:QName, xs:integer) +
+ Returns a function with the specified QName and arity if available, otherwise + returns an empty sequence
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:QNameFunction name as QName
xs:integerArity of the function
function(*)?A function with the specified QName and arity if available, otherwise an + empty sequence
+ Examples:
+ + + + + + + + + +
ExpressionResult
function-lookup(QName('http://www.w3.org/2005/xpath-functions', + 'substring'), 2)Returns the substring function with arity 2, if available

+ W3C Documentation reference: function-lookup +
+ + + fn:static-base-uri() +
+ Returns the static base URI as an xs:anyURI, if available
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:anyURI?The static base URI, if available; otherwise, an empty sequence
+ Examples:
+ + + + + + + + + +
ExpressionResult
static-base-uri()Returns the static base URI as an xs:anyURI, if available, e.g., + 'https://www.example.com/base/'

+ W3C Documentation reference: static-base-uri +
+ + + fn:default-collation() +
+ Returns the default collation URI as an xs:string
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:stringThe default collation URI as a string
+ Examples:
+ + + + + + + + + +
ExpressionResult
default-collation()Returns the default collation URI as an xs:string, e.g., + 'http://www.w3.org/2005/xpath-functions/collation/codepoint'

+ W3C Documentation reference: default-collation +
+ + + fn:serialize(item()?, item()?) +
+ Serializes an XML node, producing a string representation of the node
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
item()?An XML node to serialize
item()?Serialization options as a map, with key-value pairs defining the + serialization parameters (optional)
xs:string?A string representation of the serialized XML node or an empty sequence + if the input is an empty sequence
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:serialize(<item>Item 1</item>)Returns '<item>Item 1</item>'
fn:serialize(<item>Item 1</item>, map{'method': 'xml', 'indent': + 'yes'})Returns an indented XML string representation of the input node

+ W3C Documentation reference: serialize +
+ + + fn:parse-xml-fragment(xs:string?) +
+ Parses a string containing an XML fragment and returns a corresponding document + node
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?A string containing an XML fragment
document-node(element(*))?A document node containing the parsed XML fragment or an empty sequence + if the input is an empty sequence
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:parse-xml-fragment('<item>Item 1</item><item>Item + 2</item>')Returns a document node containing the parsed XML fragment

+ W3C Documentation reference: parse-xml-fragment +
+ + + fn:parse-xml(xs:string?) +
+ Parses a string containing an XML document and returns a corresponding document + node
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?A string containing an XML document
document-node(element(*))?A document node containing the parsed XML content or an empty sequence + if the input is an empty sequence
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:parse-xml('<root><item>Item 1</item></root>')Returns a document node containing the parsed XML content

+ W3C Documentation reference: parse-xml +
+ + + fn:available-environment-variables() +
+ Retrieves a sequence of the names of all available environment variables
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneNo argument is required
xs:string*A sequence of the names of all available environment variables
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:available-environment-variables()Returns a sequence of the names of all available environment variables +

+ W3C Documentation reference: available-environment-variables +
+ + + fn:environment-variable(xs:string) +
+ Retrieves the value of an environment variable
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:stringThe name of the environment variable
xs:string?The value of the environment variable, or an empty sequence if the + variable is not set
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:environment-variable("PATH")Returns the value of the PATH environment variable, or an empty sequence + if the variable is not set

+ W3C Documentation reference: environment-variable +
+ + + fn:uri-collection(xs:string?) +
+ Returns a sequence of URIs in a collection identified by a URI
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI identifying the collection of URIs
xs:anyURI*A sequence of URIs in the collection
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:uri-collection("http://www.example.com/collection/")Returns a sequence of URIs in the collection identified by the specified + URI +
fn:uri-collection()Returns a sequence of URIs in the default collection, if one is defined +

+ W3C Documentation reference: uri-collection +
+ + fn:doc-available(xs:string?) +
+ Tests whether an XML document is available at a given URI
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI of the XML document to be tested
xs:booleanTrue if the XML document is available, otherwise false
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:doc-available("http://www.example.com/books.xml")Returns true if the XML document located at the specified URI is + available, otherwise false
fn:doc-available("")Returns true if the XML document containing the context item is + available, otherwise false

+ W3C Documentation reference: doc-available +
+ + + fn:doc(xs:string?) +
+ Loads an XML document from a URI and returns the document node
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI of the XML document to be loaded
document-node()?The document node of the loaded XML document
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:doc("http://www.example.com/books.xml")Loads the XML document located at the specified URI and returns its + document node
fn:doc("")Returns the document node of the XML document containing the context + item

+ W3C Documentation reference: doc +
+ + + fn:generate-id(node()?) +
+ Returns a unique identifier for the specified node
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
node()?Input node for which the unique identifier is to be generated
xs:stringUnique identifier for the specified node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:generate-id(/bookstore/book[1])A unique identifier for the first <book> element in the + <bookstore>
fn:generate-id(.)A unique identifier for the context node

+ W3C Documentation reference: generate-id +
+ + + fn:idref(xs:string*) +
+ Returns a sequence of nodes that are referenced by the specified IDREF attribute + values
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string*Input sequence of IDREF attribute values
node()*Sequence of nodes referenced by the specified IDREF attribute values +
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:idref("reference42")Nodes referenced by the IDREF attribute value "reference42"
fn:idref(("ref1", "ref2", "ref3"))Nodes referenced by the IDREF attribute values "ref1", "ref2", and + "ref3"

+ W3C Documentation reference: idref +
+ + + fn:id(xs:string*) +
+ Returns a sequence of elements with the specified ID attribute values
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string*Input sequence of ID attribute values
element()*Sequence of elements with the specified ID attribute values
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:id("item42")Element with the ID attribute value "item42"
fn:id(("item1", "item2", "item3"))Elements with the ID attribute values "item1", "item2", and "item3"

+ W3C Documentation reference: id +
+ + + fn:lang(xs:string, node()?) +
+ Returns true if the language of the specified node or its nearest ancestor matches + the given language code
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:stringLanguage code to test
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:lang("en", /book/title)true
fn:lang("fr", /book/title)false

+ W3C Documentation reference: lang +
+ + + + fn:in-scope-prefixes(element()) +
+ Returns a sequence of strings representing the prefixes of the in-scope namespaces + for the specified element
+ Arguments and return type: + + + + + + + + + +
TypeDescription
element()Element node
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:in-scope-prefixes(/*)("xml", "x")

+ W3C Documentation reference: in-scope-prefixes +
+ + + fn:namespace-uri-for-prefix(xs:string?, element()) +
+ Returns the namespace URI associated with the given prefix, using the in-scope + namespaces for the specified element
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Prefix
element()Element node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:namespace-uri-for-prefix('x', /*)"http://www.example.com/ns"
fn:namespace-uri-for-prefix('', /*)""

+ W3C Documentation reference: namespace-uri-for-prefix +
+ + + fn:namespace-uri-from-QName(xs:QName?) +
+ Returns the namespace URI of the given QName value, or an empty sequence if there's + no namespace URI
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:QName?QName value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:namespace-uri-from-QName(fn:QName('http://www.example.com/ns', + 'x:local'))"http://www.example.com/ns"
fn:namespace-uri-from-QName(fn:QName('', 'local'))""

+ W3C Documentation reference: namespace-uri-from-QName +
+ + + fn:local-name-from-QName(xs:QName?) +
+ Returns the local name of the given QName value, or an empty sequence if there's no + local name
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:QName?QName value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:local-name-from-QName(fn:QName('http://www.example.com/ns', + 'x:local'))"local"
fn:local-name-from-QName(fn:QName('', 'local'))"local"

+ W3C Documentation reference: local-name-from-QName +
+ + + fn:prefix-from-QName(xs:QName?) +
+ Returns the prefix of the given QName value, or an empty sequence if there's no + prefix
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:QName?QName value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:prefix-from-QName(fn:QName('http://www.example.com/ns', 'x:local')) + "x"
fn:prefix-from-QName(fn:QName('', 'local'))()

+ W3C Documentation reference: prefix-from-QName +
+ + + fn:QName(xs:string?, xs:string) +
+ Constructs an xs:QName value from a namespace URI and a lexical QName
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Namespace URI
xs:stringLexical QName
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:QName('http://www.example.com/ns', 'x:local')QName("http://www.example.com/ns", "x:local")
fn:QName('', 'local')QName("", "local")

+ W3C Documentation reference: QName +
+ + + fn:resolve-QName(xs:string?, element()) +
+ Resolves a QName by expanding a prefix using the in-scope namespaces of a given + element
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?QName to resolve
element()Element with in-scope namespaces
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:resolve-QName('x:local', $element)QName("http://www.example.com/ns", "local")
fn:resolve-QName('local', $element)QName("", "local")

+ W3C Documentation reference: Resolve-QName +
+ + + + fn:nilled(node) +
+ Returns a Boolean value indicating whether the argument node is nilled
+
+ W3C Documentation reference: #func-nilled + +
+ + + + + +
+
+
+ + + +
+ + fn:for-each-pair(item()*, item()*, function(item(), item())) +
+ Applies a processing function to pairs of items from two input sequences in a + pairwise fashion, resulting in a sequence of the same length as the shorter input + sequence
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
item()*The first input sequence of items
item()*The second input sequence of items
function(item(), item())The processing function used to process pairs of items from the input + sequences
item()*The resulting sequence after applying the processing function to pairs + of items
+ Examples:
+ + + + + + + + + +
ExpressionResult
for-each-pair((1, 2, 3), ("a", "b"), function($item1, $item2) { + concat($item1, $item2) })Returns a sequence with the concatenated pairs of items: + ("1a", "2b") +

+ W3C Documentation reference: for-each-pair +
+ + + + + fn:filter(item()*, function(item()) +
+ Filters a sequence of items based on a given predicate function
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*The input sequence of items
function(item())The predicate function used to filter the items
item()*The resulting sequence after applying the predicate function
+ Examples:
+ + + + + + + + + +
ExpressionResult
filter((1, 2, 3, 4), function($x) { $x mod 2 = 0 })Returns a new sequence containing only the even numbers from the input + sequence: (2, 4)

+ W3C Documentation reference: filter +
+ + + fn:for-each(item()*, function(item())) +
+ Applies a specified function to each item in a sequence, returning a new + sequence
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*The input sequence of items
function(item())The function to apply to each item in the sequence
item()*The new sequence created by applying the function to each item in the + input sequence
+ Examples:
+ + + + + + + + + +
ExpressionResult
for-each((1, 2, 3, 4), function($x) { $x * 2 })Returns a new sequence with the result of doubling each number in the + input sequence: (2, 4, 6, 8)

+ W3C Documentation reference: for-each +
+ +
+
+
+
@@ -5295,14 +16956,14 @@ hideList(document.getElementsByName("collapse20")); showList(document.getElementsByName("collapse30")); hideList(document.getElementsByName("collapse31")); - + } else if (filter == "collapse3.1") { document.getElementById("tooltipFunctionInfo").innerText = "XPath 3.1 functions"; hideList(document.getElementsByName("collapse10")); hideList(document.getElementsByName("collapse20")); hideList(document.getElementsByName("collapse30")); showList(document.getElementsByName("collapse31")); - } else if (filter == "collapse2.0"){ + } else if (filter == "collapse2.0") { document.getElementById("tooltipFunctionInfo").innerText = "XPath 2.0 functions"; hideList(document.getElementsByName("collapse10")); showList(document.getElementsByName("collapse20")); @@ -5320,7 +16981,7 @@ var triggerList = document.getElementsByClassName("collapseTrigger"); for (i = 0; i < triggerList.length; i++) { - + triggerList[i].addEventListener("click", function () { var collapsible = this.parentElement; if (this.tagName == "A") { @@ -5330,7 +16991,7 @@ } - + if (collapsibleData.style.maxHeight > "0px") { collapsibleData.style.maxHeight = "0px"; @@ -5365,7 +17026,7 @@ //Handle clicks in whole form and set info in tooltip setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here'); setDefaultContent(document.getElementById("transformArea"), 'Insert XPath expression here'); - + processVersionSelector(); processTooltip(); tool.addEventListener('change', event => { @@ -5404,4 +17065,4 @@ - + \ No newline at end of file