Files
release11-tools/Frontend/tools/xpath.html
Adam Bem c55942c24a Added syntax highlighting for XML Tools (#156)
Syntax highlight now should work on all tools apart from Mock Services.

Co-authored-by: Adam Bem <adam.bem@zoho.eu>
Reviewed-on: #156
Reviewed-by: Mikolaj Widla <widlam@noreply.example.com>
2023-05-08 11:11:16 +02:00

17270 lines
996 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="../assets/css/tools/r11form.css">
<link rel="stylesheet" href="../assets/css/highlight.css">
<script src="../assets/scripts/common/hljs.min.js"></script>
<script src="../assets/scripts/tools/scripts.js"></script>
<script src="../assets/scripts/tools/highlight.js"></script>
<script>hljs.highlightAll();</script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8" />
</head>
<body onload="init();">
<div class="container">
<div id="tool" class="tool rwd-expandable">
<div class="tool-context">
<div class="headline">
<h1>Online XPath tester</h1>
</div>
<div class="display-space-between">
<div>
<label for="processors">Select XPath processor:</label>
<select name="processors" id="processors">
<option value="saxon">Saxon</option>
<option value="xalan">Xalan</option>
<option value="libxml">libXML</option>
</select><br>
<label for="versions">XPath version:</label>
<select name="versions" id="versions">
<option class="hideable libxml xalan" value="1.0">1.0</option>
<option class="hideable saxon" value="2.0">2.0</option>
<option class="hideable saxon" value="3.0">3.0</option>
<option class="hideable saxon" value="3.1">3.1</option>
</select>
</div>
<div>
<button class="action-button active" id="clearXMLButton" style="padding: 3px 10px;"
onclick="clearDataField()">Clear</button>
<button class="action-button active" id="prettyXMLButton" style="padding: 3px 10px;"
onclick="performFormatRequest('prettify', true, 'xmlArea', 'xmlArea')">Format XML</button>
<button class="action-button active" id="defaultXMLButton" style="padding: 3px 10px;"
onclick="fillDefaultXML(this)">Insert default XML</button>
</div>
</div>
<br>
<label for="xmlArea"><b>Insert your XML:</b></label>
<pre><code class="language-xml bordered-field textarea-300" id="xmlArea" contenteditable="True"></code></pre>
<br>
<label for="transformArea"><b>Insert your XPath:</b></label>
<pre><code class="language-xml bordered-field" id="transformArea" contenteditable="True"></code></pre>
<br>
<button id="requestButton" class="max-width block-label action-button active"
onclick="performRequest('xpath', false, true)">Execute XPath
expression</button>
<br>
<label for="resultArea"><b>Transform result:<span id="procinfo"></span></b></label>
<pre><code class="language-xml bordered-field textarea-300" id="resultArea"></code></pre>
</div>
</div>
<div class="tooltip tooltip-window rwd-hideable">
<h2>What is XPath?</h2>
<p>
XPath is a query language used for selecting nodes from XML and processing them.<br>
It may perform operations on strings, numbers and boolean values.<br>
</p>
<p>
<h2>Semantics legend:</h2>
<p>
"+" - 1 or more elements
</p>
<p>
"*" - 0 or more elements
</p>
<p>
"?" - optional element
</p>
</p>
<span id="collapsible-lists">
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">
XPath 1.0 vs 2.0 vs 3.0 vs 3.1
</button>
</span>
<div class="content">
<p><b>XPath 2.0 introduced many new features XQuery-cośtam:</b><br>
- Added support for all XML simple types<br>
- Many new functions (tripled instruction count)<br>
- All expressions evaluate to sequence<br>
- Introduces conditional expressions and for-loops<br>
</p>
<p><b>XPath 3.0</b><br>
- Dynamic function calls (function may be called without being referenced by name (find
function in collection and call)<br>
- Inline functions<br>
- Namespace literals - Namespace may be embedded into function name<br>
- Support for union types - collections containing elements of different types<br>
- Mapping operator - '!' performs evaluation for each element in sequence and
concatenates results<br>
- Introduced maps <br>
</p>
<p><b>XPath 3.1</b><br>
- New operator for function chaining '=>' <br>
- Introduced maps that store data in pair 'key:value' - 'map{ key : value, key : value
}'<br>
- Introduced arrays - they differ from sequences in that they can be nested 'array{1, 5, 7,
(10 to 20)}'<br>
</p>
</div>
</div>
<h2><span id="tooltipFunctionInfo">XPath 1.0 & 2.0 functions</span></h2>
<!-- Cut here -->
<span name="collapse10">
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Node-Set</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:position()</code></a>
<div class="content">
Returns the position of the current context node.<br>
<br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions" class="hyperlink" target="_blank">Node-Set-Functions</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:last()</code></a>
<div class="content">
The last function returns a number equal to the context size from the expression evaluation context.<br>
<br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions" class="hyperlink" target="_blank">Node-Set-Functions</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:count()</code></a>
<div class="content">
Returns the number of nodes in the node-set <br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node-set</td>
<td>Node-set to count nodes in</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>count(//b:book)</td>
<td>5</td>
</tr>
<tr>
<td>count(//person[@id>5])</td>
<td>17</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions" class="hyperlink" target="_blank">Node-Set-Functions</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:id()</code></a>
<div class="content">
Returns the element specified by it's unique id, requires DTD <br>
<br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions" class="hyperlink" target="_blank">Node-Set-Functions</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:local-name()</code></a>
<div class="content">
Returns the local-name for the first node in the node-set <br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node-set</td>
<td>Extract first node and return its local name</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>local-name(//b:books)</td>
<td>b:book</td>
</tr>
<tr>
<td>local-name(//b:book)</td>
<td>b:title</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions" class="hyperlink" target="_blank">Node-Set-Functions</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:namespace-uri()</code></a>
<div class="content">
Returns the namespace-uri for the first node in the node-set <br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node-set</td>
<td>Extract first node and return the namespace URI</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>namespace-uri(//b:book)</td>
<td>http://www.book.com</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions" class="hyperlink" target="_blank">Node-Set-Functions</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:name()</code></a>
<div class="content">
Returns the name for the first node in the node-set <br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node-set (Optional)</td>
<td>Extract first node and return QName</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>name(//b:books/*)</td>
<td>b:book</td>
</tr>
<tr>
<td>name(//b:book/*)</td>
<td>b:title</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions" class="hyperlink" target="_blank">Node-Set-Functions</code></a>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Boolean</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:boolean()</code></a>
<div class="content">
The boolean function converts its argument to a boolean as follows:
<ul>
<li>a number is true if and only if it is neither positive or negative zero nor NaN</li>
<li>a node-set is true if and only if it is non-empty</li>
<li>a string is true if and only if its length is non-zero</li>
<li>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</li>
</ul>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>object</td>
<td>The object to convert to a boolean</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>boolean("Release11")</td>
<td>true</td>
</tr>
<tr>
<td>boolean("")</td>
<td>false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions" class="hyperlink" target="_blank">Boolean-Functions</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:not()</code></a>
<div class="content">
The not function returns true if its argument is false, and false otherwise. <br>
<br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#function-not" class="hyperlink" target="_blank">Boolean-Functions</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:true()</code></a>
<div class="content">
The true function returns true. <br>
<br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions" class="hyperlink" target="_blank">Boolean-Functions</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:false()</code></a>
<div class="content">
The true function returns false. <br>
<br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions" class="hyperlink" target="_blank">Boolean-Functions</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:lang()</code></a>
<div class="content">
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. <br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>string</td>
<td>Language that will be looked for in context node</td>
</tr>
</table><b>Examples: </b> Look W3C documentation<br>
<br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions" class="hyperlink" target="_blank">Boolean-Functions</code></a>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">String</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:string()</code></a>
<div class="content">
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.<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>object</td>
<td>The object to convert to a string</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>string(10)</td>
<td>true</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" class="hyperlink" target="_blank">String-Functions</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:concat()</code></a>
<div class="content">
The concat function returns the concatenation of its arguments.<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>string*</td>
<td>Strings to concatenate</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>concat("Release", 11)</td>
<td>Release11</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" class="hyperlink" target="_blank">String-Functions</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:starts-with()</code></a>
<div class="content">
Returns true if the first argument string starts with the second argument string, and otherwise returns false.<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>string</td>
<td>String to test</td>
</tr>
<tr>
<td>string</td>
<td>String that first string has to start from</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>starts-with("Release11", "Rel")</td>
<td>true</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" class="hyperlink" target="_blank">String-Functions</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:contains()</code></a>
<div class="content">
The contains function returns true if the first argument string contains the second argument string, and otherwise returns false.<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>string</td>
<td>String to test</td>
</tr>
<tr>
<td>string</td>
<td>String that first string has to contain</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>contains("Release11", "eas")</td>
<td>true</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" class="hyperlink" target="_blank">String-Functions</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:substring-before()</code></a>
<div class="content">
The substring-before function returns the substring of the first argument string that precedes the first occurrence of the second argument string in the first argument string, or the empty string if the first argument string does not contain the second argument string.<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>string</td>
<td>String to test</td>
</tr>
<tr>
<td>string</td>
<td>String that first string has to contain</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>substring-before("1999/04/01","/")</td>
<td>1999</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" class="hyperlink" target="_blank">String-Functions</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:substring-after()</code></a>
<div class="content">
The substring-after function returns the substring of the first argument string that follows the first occurrence of the second argument string in the first argument string, or the empty string if the first argument string does not contain the second argument string.<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>string</td>
<td>String to test</td>
</tr>
<tr>
<td>string</td>
<td>String that first string has to contain</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>substring-after("1999/04/01","/")</td>
<td>04/01</td>
</tr>
<tr>
<td>substring-after("1999/04/01","19")</td>
<td>99/04/01</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" class="hyperlink" target="_blank">String-Functions</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:substring()</code></a>
<div class="content">
The substring function returns the substring of the first argument starting at the position specified in the second argument with length specified in the third argument.<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>string</td>
<td>String to test</td>
</tr>
<tr>
<td>number</td>
<td>Starting index</td>
</tr>
<tr>
<td>number?</td>
<td>Length of target substring</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>substring("12345",2)</td>
<td>2345</td>
</tr>
<tr>
<td>substring("12345",2,3)</td>
<td>234</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" class="hyperlink" target="_blank">String-Functions</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:string-length()</code></a>
<div class="content">
The string-length returns the number of characters in the string. If the argument is omitted, it defaults to the context node converted to a string, in other words the string-value of the context node.<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>string?</td>
<td>String to test</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>string-length("abcdef")</td>
<td>6</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" class="hyperlink" target="_blank">String-Functions</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:normalize-space()</code></a>
<div class="content">
The normalize-space function returns the argument string with whitespace normalized by stripping leading and trailing whitespace and replacing sequences of whitespace characters by a single space. Whitespace characters are the same as those allowed by the S production in XML. If the argument is omitted, it defaults to the context node converted to a string, in other words the string-value of the context node.<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>string?</td>
<td>String to test</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>normalize-space(" abc def ")</td>
<td>abc def</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" class="hyperlink" target="_blank">String-Functions</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:translate()</code></a>
<div class="content">
The translate function returns the first argument string with occurrences of characters in the second argument string replaced by the character at the corresponding position in the third argument string. If there is a character in the second argument string with no character at a corresponding position in the third argument string (because the second argument string is longer than the third argument string), then occurrences of that character in the first argument string are removed.<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>string</td>
<td>String to translate</td>
</tr>
<tr>
<td>string</td>
<td>Characters to remove</td>
</tr>
<tr>
<td>string</td>
<td>String to insert characters from second argument</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>translate("bar","abc","ABC")</td>
<td>BAr</td>
</tr>
<tr>
<td>translate("--aaa--","abc-","ABC")</td>
<td>AAA</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" class="hyperlink" target="_blank">String-Functions</code></a>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Numeric</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:number()</code></a>
<div class="content">
The number function converts its argument to a number as follows:
<ul>
<li>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</li>
<li>boolean true is converted to 1; boolean false is converted to 0</li>
<li>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</li>
<li>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</li>
</ul>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>object</td>
<td>The object to convert to a number</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>number(10)</td>
<td>10</td>
</tr>
<tr>
<td>number("")</td>
<td>NaN</td>
</tr>
</table><br>
<code><a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions" class="hyperlink" target="_blank">W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:sum()</code></a>
<div class="content">
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.<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node-set</td>
<td>Node set to sum</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>sum(/l:library/l:readerList/p:person/p:readerID)</td>
<td>12444</td>
</tr>
</table><br>
<code><a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions" class="hyperlink" target="_blank">W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:floor()</code></a>
<div class="content">
The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node-set</td>
<td>Node set to sum</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>floor(3.1)</td>
<td>4</td>
</tr>
<tr>
<td>floor(3.9)</td>
<td>4</td>
</tr>
<tr>
<td>floor(3.5)</td>
<td>4</td>
</tr>
</table><br>
<code><a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions" class="hyperlink" target="_blank">W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:ceiling()</code></a>
<div class="content">
The ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer.<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node-set</td>
<td>Node set to sum</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>floor(3.1)</td>
<td>3</td>
</tr>
<tr>
<td>floor(3.9)</td>
<td>3</td>
</tr>
<tr>
<td>floor(3.5)</td>
<td>3</td>
</tr>
</table><br>
<code><a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions" class="hyperlink" target="_blank">W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:round()</code></a>
<div class="content">
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.
<h4>NOTE</h4>
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.<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node-set</td>
<td>Node set to sum</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>floor(3.1)</td>
<td>3</td>
</tr>
<tr>
<td>floor(3.9)</td>
<td>4</td>
</tr>
<tr>
<td>floor(3.5)</td>
<td>3</td>
</tr>
</table><br>
<code><a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions" class="hyperlink" target="_blank">W3C Documentation reference</code></a>
</div>
</div>
</div>
</span>
<span name="collapse20">
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Node-Set</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:name()</code></a>
<div class="content">
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.<br>
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.<br>
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.<br>
If the argument is supplied and is the empty sequence, the function returns the
zero-length string.<br>
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.<br>
Otherwise, the value returned is fn:string(fn:node-name($arg)).<br>
<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node?</td>
<td>Node to display name.</td>
</tr>
</table>
<b>Return type:</b> xs:string<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>name(/l:library)</td>
<td>l:library</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-name" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:local-name()</code></a>
<div class="content">
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.<br>
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.<br>
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.<br>
If the argument is supplied and is the empty sequence, the function returns the
zero-length string.<br>
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.<br>
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.<br>
<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node?</td>
<td>Node to display local-name.</td>
</tr>
</table>
<b>Return type:</b> xs:string<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>name(/l:library)</td>
<td>library</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-local-name" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:nilled()</code></a>
<div class="content">
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.<br>
<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node?</td>
<td>Node to test.</td>
</tr>
</table>
<b>Return type:</b> xs:boolean?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>nilled(/l:library)</td>
<td>false</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-nilled" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:base-uri()</code></a>
<div class="content">
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.<br>
If $arg is the empty sequence, the empty sequence is returned.<br>
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.<br>
<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node?</td>
<td>Node to find base URI of.</td>
</tr>
</table>
<b>Return type:</b> xs:anyURI?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>base-uri(/l:library/l:libraryName)</td>
<td>&lt;empty sequence&gt;</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-base-uri" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:document-uri()</code></a>
<div class="content">
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.<br>
If $arg is the empty sequence, the empty sequence is returned.<br>
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.<br>
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.<br>
<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node?</td>
<td>Node which document-uri value needs to be returned.</td>
</tr>
</table>
<b>Return type:</b> xs:anyURI?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>document-uri(/l:library/l:libraryName)</td>
<td>&lt;empty sequence&gt;</td>
</tr>
<tr>
<td>document-uri(/library/fiction:book[1])</td>
<td>http://example.com/library.xml (assuming the document URI of the first
fiction:book element is "http://example.com/library.xml")</td>
</tr>
<tr>
<td>document-uri(/library)</td>
<td>http://example.com/library.xml (assuming the document URI of the library
element is "http://example.com/library.xml")</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-document-uri" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:lang()</code></a>
<div class="content">
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<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$testlang</td>
</tr>
<tr>
<td>node()</td>
<td>$node (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:boolean?<br><br>
<b>Examples:</b> Look W3C documentation below.
<br>
<a href="https://www.w3.org/TR/xquery-operators/#func-lang" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:root()</code></a>
<div class="content">
Returns the root of the tree to which $arg belongs. This will usually, but not
necessarily, be a document node.<br>
If $arg is the empty sequence, the empty sequence is returned.<br>
If $arg is a document node, $arg is returned.<br>
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.<br>
The following errors may be raised: if the context item is undefined [err:XPDY0002]; if
the context item is not a node [err:XPTY0004].<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()</td>
<td>$arg (Optional)</td>
</tr>
</table>
<b>Return type:</b> node()?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>root()</td>
<td>&lt;l:library&gt;[...]&lt;/l:library&gt;</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-root" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:count()</code></a>
<div class="content">
Returns the number of items in the value of $arg. Returns 0 if $arg is the empty
sequence.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:integer<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>count(/l:library/l:readerList/p:person)</td>
<td>2</td>
</tr>
<tr>
<td>count(/l:library/l:writers)</td>
<td>0</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-count" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:avg()</code></a>
<div class="content">
Returns the number of items in the value of $arg. Returns 0 if $arg is the empty
sequence.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:anyAtomicType<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>avg(/l:library/l:readerList/p:person/p:readerID)</td>
<td>6222</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-avg" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:max()</code></a>
<div class="content">
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·.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>$arg</td>
</tr>
<tr>
<td>xs:string</td>
<td>$collation (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:anyAtomicType?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>max((3,4,5))</td>
<td>5</td>
</tr>
<tr>
<td>max((5, 5.0e0))</td>
<td>5.0e0</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-max" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:min()</code></a>
<div class="content">
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·.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>$arg</td>
</tr>
<tr>
<td>xs:string</td>
<td>$collation (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:anyAtomicType?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>min((3,4,5))</td>
<td>3</td>
</tr>
<tr>
<td>min((5, 5.0e0))</td>
<td>5.0e0</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-min" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:sum()</code></a>
<div class="content">
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.<br>
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.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>$arg</td>
</tr>
<tr>
<td>xs:anyAtomicType?</td>
<td>$zero (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:anyAtomicType?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>sum(/l:library/l:readerList/p:person/p:readerID)</td>
<td>12444</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-sum" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Boolean</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:boolean()</code></a>
<div class="content">
Computes the effective boolean value of the sequence $arg. See Section 2.4.3 Effective
Boolean ValueXP<br>
If $arg is the empty sequence, fn:boolean returns false.<br>
If $arg is a sequence whose first item is a node, fn:boolean returns true.<br>
If $arg is a singleton value of type xs:boolean or a derived from xs:boolean, fn:boolean
returns $arg.<br>
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.<br>
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].<br>
The static semantics of this function are described in Section 7.2.4 The fn:boolean and
fn:not functionsFS.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:boolean?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>boolean("/l:library")</td>
<td>true</td>
</tr>
<tr>
<td>boolean(0)</td>
<td>false</td>
</tr>
<tr>
<td>boolean(())</td>
<td>false</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-boolean" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:true()</code></a>
<div class="content">
Returns the xs:boolean value true. Equivalent to xs:boolean("1").<br><br>
<b>Return type:</b> xs:boolean<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>true()</td>
<td>true</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-true" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:false()</code></a>
<div class="content">
Returns the xs:boolean value false. Equivalent to xs:boolean("0").<br><br>
<b>Return type:</b> xs:boolean<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>false()</td>
<td>false</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-false" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:not()</code></a>
<div class="content">
$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.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:boolean<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>not(false())</td>
<td>true</td>
</tr>
<tr>
<td>not(true())</td>
<td>false</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-not" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">String</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:string(object)</code></a>
<div class="content">
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.<br>
If the context item is undefined, error [err:XPDY0002]XP is raised.<br>
If $arg is the empty sequence, the zero-length string is returned.<br>
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.<br>
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).<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>string</td>
<td>The object to convert to a string</td>
</tr>
</table>
<b>Return type:</b> xs:string<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>string((1&lt;0))</td>
<td>false</td>
</tr>
<tr>
<td>string(.11)</td>
<td>0.11</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-string" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:codepoints-to-string()</code></a>
<div class="content">
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].<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:integer*</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:string<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>codepoints-to-string((2309, 2358, 2378, 2325))</td>
<td>अशॊक</td>
</tr>
<tr>
<td>codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41))
</td>
<td>( ͡° ͜ʖ ͡°)</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-codepoints-to-string"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:string-to-codepoints()</code></a>
<div class="content">
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.<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string*</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:integer*<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>string-to-codepoints("Thérèse")</td>
<td>(84, 104, 233, 114, 232, 115, 101)</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-string-to-codepoints"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:compare()</code></a>
<div class="content">
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.<br>
The collation used by the invocation of this function is determined according to the
rules in 7.3.1 Collations.<br>
If either argument is the empty sequence, the result is the empty sequence.<br>
This function, invoked with the first signature, backs up the "eq", "ne", "gt", "lt",
"le" and "ge" operators on string values.<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$comparand1</td>
</tr>
<tr>
<td>xs:string?</td>
<td>$comparand2</td>
</tr>
<tr>
<td>xs:string</td>
<td>$collation (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:integer*<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>compare('abc', 'abc')</td>
<td>0</td>
</tr>
<tr>
<td>compare('abc', 'acc')</td>
<td>-1</td>
</tr>
<tr>
<td>compare('abc', 'acc')</td>
<td>1</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-compare" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:codepoint-equal()</code></a>
<div class="content">
Returns true or false depending on whether the value of $comparand1 is equal to the
value of $comparand2, according to the <a
href="http://www.w3.org/2005/xpath-functions/collation/codepoint)">Unicode code
point collation</a>.<br>
If either argument is the empty sequence, the result is the empty sequence.<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$comparand1</td>
</tr>
<tr>
<td>xs:string?</td>
<td>$comparand2</td>
</tr>
</table>
<b>Return type:</b> xs:boolean?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>codepoint-equal("asdf", "asdf")</td>
<td>true</td>
</tr>
<tr>
<td>codepoint-equal("asdf", "asdf ")</td>
<td>false</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-codepoint-equal" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:concat()</code></a>
<div class="content">
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.<br>
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].<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType?</td>
<td>$arg1</td>
</tr>
<tr>
<td>xs:anyAtomicType?</td>
<td>$arg2</td>
</tr>
<tr>
<td>xs:anyAtomicType?</td>
<td>$arg... (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:string<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>concat('un', 'grateful')</td>
<td>ungrateful</td>
</tr>
<tr>
<td>concat('Thy ', (), 'old ', "groans", "", ' ring', ' yet', ' in', ' my', '
ancient',' ears.')</td>
<td>Thy old groans ring yet in my ancient ears.</td>
</tr>
<tr>
<td>fn:concat('Ciao!',())</td>
<td>Ciao!</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-concat" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:string-join()</code></a>
<div class="content">
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.<br>
If the value of $arg1 is the empty sequence, the zero-length string is returned.<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string*</td>
<td>$arg1</td>
</tr>
<tr>
<td>xs:string</td>
<td>$arg2</td>
</tr>
</table>
<b>Return type:</b> xs:string<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>string-join(('Now', 'is', 'the', 'time', '...'), ' ')</td>
<td>Now is the time ...</td>
</tr>
<tr>
<td>string-join(('Blow, ', 'blow, ', 'thou ', 'winter ', 'wind!'), '')</td>
<td>Blow, blow, thou winter wind!</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-string-join" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:substring()</code></a>
<div class="content">
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.<br>
More specifically, the three argument version of the function returns the characters in
$sourceString whose position $p obeys:<br>
<code>fn:round($startingLoc) &lt;= $p &lt; fn:round($startingLoc) + fn:round($length)</code><br>
The two argument version of the function assumes that $length is infinite and returns
the characters in $sourceString whose position $p obeys:<br>
<code>fn:round($startingLoc) &lt;= $p &lt; fn:round(INF)</code><br>
In the above computations, the rules for op:numeric-less-than() and
op:numeric-greater-than() apply.<br>
If the value of $sourceString is the empty sequence, the zero-length string is
returned.<br>
<strong>Note:</strong><br>
The first character of a string is located at position 1, not position 0.<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$sourceString</td>
</tr>
<tr>
<td>xs:double</td>
<td>$startingLoc</td>
</tr>
<tr>
<td>xs:double</td>
<td>$length (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:string<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>substring("motor car", 6)</td>
<td>" car"</td>
</tr>
<tr>
<td>substring("metadata", 4, 3)</td>
<td>ada</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-substring" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:string-length()</code></a>
<div class="content">
Returns an xs:integer equal to the length in characters of the value of $arg.<br>
If the value of $arg is the empty sequence, the xs:integer 0 is returned.<br>
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].<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:integer<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>string-length("Harp not on that string, madam; that is past.")</td>
<td>45</td>
</tr>
<tr>
<td>string-length(())</td>
<td>0</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-string-length" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:normalize-space()</code></a>
<div class="content">
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.<br>
If the value of $arg is the empty sequence, returns the zero-length string.<br>
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].<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:string<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>normalize-space(" The wealthy curled darlings of our nation. ")</td>
<td>The wealthy curled darlings of our nation.</td>
</tr>
<tr>
<td>normalize-space(())</td>
<td>""</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-normalize-space" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:normalize-unicode()</code></a>
<div class="content">
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.<br>
If the value of $arg is the empty sequence, returns the zero-length string.<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg</td>
</tr>
<tr>
<td>xs:string</td>
<td>$normalizationForm (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:string<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>normalize-unicode("test ")</td>
<td>test</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-normalize-unicode"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:upper-case()</code></a>
<div class="content">
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.<br>
If the value of $arg is the empty sequence, the zero-length string is returned.<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:string<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>upper-case("abCd0")</td>
<td>ABCD0</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-upper-case" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:lower-case()</code></a>
<div class="content">
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.<br>
If the value of $arg is the empty sequence, the zero-length string is returned.<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:string<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>lower-case("abCd0")</td>
<td>abcd0</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-lower-case" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:translate()</code></a>
<div class="content">
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.<br>
If the value of $arg is the empty sequence, the zero-length string is returned.<br>
Every character in the value of $arg that does not appear in the value of $mapString is
unchanged.<br>
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.<br>
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.<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg</td>
</tr>
<tr>
<td>xs:string</td>
<td>$mapString</td>
</tr>
<tr>
<td>xs:string</td>
<td>$mapString</td>
</tr>
</table>
<b>Return type:</b> xs:string<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>translate("bar","abc","ABC")</td>
<td>BAr</td>
</tr>
<tr>
<td>translate("--aaa--","abc-","ABC")</td>
<td>AAA</td>
</tr>
<tr>
<td>translate("abcdabc", "abc", "AB")</td>
<td>ABdAB</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-translate" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:encode-for-uri()</code></a>
<div class="content">
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].<br>
If $uri-part is the empty sequence, returns the zero-length string.<br>
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 "~".<br>
Note that this function escapes URI delimiters and therefore cannot be used
indiscriminately to encode "invalid" characters in a path segment.<br>
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.<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$uri-part</td>
</tr>
</table>
<b>Return type:</b> xs:string<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>encode-for-uri("https://www.google.com")</td>
<td>"https%3A%2F%2Fwww.<br>google.com"</td>
</tr>
<tr>
<td>concat("http://www.example.com/", encode-for-uri("~bébé"))</td>
<td>http://www.example.com/<br>~b%C3%A9b%C3%A9</td>
</tr>
<tr>
<td>concat("http://www.example.com/", encode-for-uri("100% organic"))</td>
<td>http://www.example.com/<br>100%25%20organic</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-encode-for-uri" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:iri-to-uri()</code></a>
<div class="content">
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.<br>
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.<br>
If $iri is the empty sequence, returns the zero-length string.<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$iri</td>
</tr>
</table>
<b>Return type:</b> xs:string<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>iri-to-uri ("http://www.example.com/00/Weather/CA/Los%20Angeles#ocean")</td>
<td>"http://www.example.com/00/<br>Weather/CA/Los%20Angeles#ocean"</td>
</tr>
<tr>
<td>iri-to-uri ("http://www.example.com/~bébé")</td>
<td>http://www.example.com/<br>~b%C3%A9b%C3%A9</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-iri-to-uri" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:escape-html-uri()</code></a>
<div class="content">
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.<br>
If $uri is the empty sequence, returns the zero-length string.
<h4>Note:</h4>
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.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$uri</td>
</tr>
</table>
<b>Return type:</b> xs:string<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>escape-html-uri("http://www.example.com/00/Weather/CA/Los Angeles#ocean")
</td>
<td>http://www.example.com/00/Weather/CA/Los Angeles#ocean</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-escape-html-uri" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:contains()</code></a>
<div class="content">
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.<br>
If the value of $arg2 is the zero-length string, then the function returns true.<br>
If the value of $arg1 is the zero-length string, the function returns false.<br>
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].<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg1</td>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg2</td>
</tr>
<tr>
<td>xs:string?</td>
<td>$collation (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:boolean<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>contains( "tattoo", "tat")</td>
<td>true</td>
</tr>
<tr>
<td>contains( "tattoo", "ttt")</td>
<td>false</td>
</tr>
<tr>
<td>contains ( "", ())</td>
<td>true</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-contains" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:starts-with()</code></a>
<div class="content">
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.<br>
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.<br>
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].<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg1</td>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg2</td>
</tr>
<tr>
<td>xs:string?</td>
<td>$collation (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:boolean<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>starts-with( "tattoo", "tat")</td>
<td>true</td>
</tr>
<tr>
<td>starts-with( "tattoo", "ttt")</td>
<td>false</td>
</tr>
<tr>
<td>starts-with ( "", ())</td>
<td>true</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-starts-with" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:ends-with()</code></a>
<div class="content">
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.<br>
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.<br>
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.<br>
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].<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg1</td>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg2</td>
</tr>
<tr>
<td>xs:string?</td>
<td>$collation (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:boolean<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>ends-with( "tattoo", "too")</td>
<td>true</td>
</tr>
<tr>
<td>ends-with( "tattoo", "tatoo")</td>
<td>false</td>
</tr>
<tr>
<td>ends-with ((), ())</td>
<td>true</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-ends-with" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:substring-before()</code></a>
<div class="content">
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.<br>
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.<br>
If the value of $arg2 is the zero-length string, then the function returns the
zero-length string.<br>
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.<br>
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].<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg1</td>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg2</td>
</tr>
<tr>
<td>xs:string?</td>
<td>$collation (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:string<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>substring-before( "tattoo", "too")</td>
<td>tat</td>
</tr>
<tr>
<td>substring-before( "tattoo", "tat")</td>
<td>&lt;empty string&gt;</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-substring-before"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:substring-after()</code></a>
<div class="content">
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.<br>
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.<br>
If the value of $arg2 is the zero-length string, then the function returns the value of
$arg1.<br>
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.<br>
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].<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg1</td>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg2</td>
</tr>
<tr>
<td>xs:string?</td>
<td>$collation (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:string<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>substring-after( "tattoo", "too")</td>
<td>&lt;empty string&gt;</td>
</tr>
<tr>
<td>substring-after( "tattoo", "tat")</td>
<td>too</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-substring-after" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:matches()</code></a>
<div class="content">
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.<br>
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.<br>
If $input is the empty sequence, it is interpreted as the zero-length string.<br>
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).<br>
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.<br>
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.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$input</td>
</tr>
<tr>
<td>xs:string</td>
<td>$pattern</td>
</tr>
<tr>
<td>xs:string</td>
<td>$flags (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:boolean<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>matches("abracadabra", "bra")</td>
<td>true</td>
</tr>
<tr>
<td>matches("abracadabra", "^a.*a$")</td>
<td>false</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-matches" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:replace()</code></a>
<div class="content">
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.<br>
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.<br>
The $flags argument is interpreted in the same manner as for the fn:matches()
function.<br>
If $input is the empty sequence, it is interpreted as the zero-length string.<br>
If two overlapping substrings of $input both match the $pattern, then only the<br> 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.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$input</td>
</tr>
<tr>
<td>xs:string</td>
<td>$pattern</td>
</tr>
<tr>
<td>xs:string</td>
<td>$replacement</td>
</tr>
<tr>
<td>xs:string</td>
<td>$flags (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:string<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>replace("abracadabra", "bra", "*")</td>
<td>a*cada*</td>
</tr>
<tr>
<td>replace("abracadabra", "a.*a", "*")</td>
<td>*</td>
</tr>
<tr>
<td>replace("AAAA", "A+", "b")</td>
<td>b</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-replace" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:tokenize()</code></a>
<div class="content">
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.<br>
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.<br>
The $flags argument is interpreted in the same way as for the fn:matches() function.<br>
If $input is the empty sequence, or if $input is the zero-length string, the result is
the empty sequence.<br>
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].<br>
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.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$input</td>
</tr>
<tr>
<td>xs:string</td>
<td>$pattern</td>
</tr>
<tr>
<td>xs:string</td>
<td>$flags (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:string*<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>tokenize("The cat sat on the mat", "\s+")</td>
<td>("The", "cat", "sat", "on", "the", "mat")</td>
</tr>
<tr>
<td>tokenize("1, 15, 24, 50", ",\s*")</td>
<td>("1", "15", "24", "50")</td>
</tr>
<tr>
<td>tokenize("1,15,,24,50,", ",")</td>
<td>("1", "15", "", "24", "50", "")</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-tokenize" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Numeric</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:number()</code></a>
<div class="content">
Returns the value indicated by $arg or, if $arg is not specified, the context item after
atomization, converted to an xs:double<br>
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(.).<br>
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.<br>
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.<br>
<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType?</td>
<td>Value to convert to number</td>
</tr>
</table>
<b>Return type:</b> xs:double<br><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-number" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:abs()</code></a>
<div class="content">
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.<br>
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.<br>
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.<br>
<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>numeric?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> numeric?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>abs(-2)</td>
<td>2</td>
</tr>
<tr>
<td>abs(2137)</td>
<td>2137</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-abs" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:ceiling()</code></a>
<div class="content">
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.<br>
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.<br>
<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>numeric?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> numeric?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>ceiling(10.5)</td>
<td>11</td>
</tr>
<tr>
<td>ceiling(-10.5)</td>
<td>-10</td>
</tr>
<tr>
<td>ceiling(10.1)</td>
<td>11</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-ceiling" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:floor()</code></a>
<div class="content">
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.<br>
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.<br>
<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>numeric?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> numeric?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>floor(10.5)</td>
<td>10</td>
</tr>
<tr>
<td>floor(-10.5)</td>
<td>-11</td>
</tr>
<tr>
<td>floor(10.8)</td>
<td>10</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-floor" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:round()</code></a>
<div class="content">
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.<br>
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.<br>
For the last two cases, note that the result is not the same as fn:floor(x+0.5).<br>
<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>numeric?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> numeric?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>round(10.5)</td>
<td>11</td>
</tr>
<tr>
<td>round(10.4999)</td>
<td>10</td>
</tr>
<tr>
<td>round(-10.5)</td>
<td>-10</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-round" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:round-half-to-even()</code></a>
<div class="content">
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.<br>
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.<br>
The first signature of this function produces the same result as the second signature
with $precision=0.<br>
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.<br>
Note that the process of casting to xs:decimal may result in an error
[err:FOCA0001].<br>
If $arg is of type xs:float or xs:double, rounding occurs on the value of the mantissa
computed with exponent = 0.<br>
<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>numeric?</td>
<td>$arg</td>
</tr>
<tr>
<td>numeric?</td>
<td>$precision (Optional)</td>
</tr>
</table>
<b>Return type:</b> numeric?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>round-half-to-even(0.5)</td>
<td>0</td>
</tr>
<tr>
<td>round-half-to-even(1.5)</td>
<td>2</td>
</tr>
<tr>
<td>round-half-to-even(2.5)</td>
<td>2</td>
</tr>
<tr>
<td>round-half-to-even(2.6)</td>
<td>3</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-round-half-to-even"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Collections</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:data()</code></a>
<div class="content">
fn:data takes a sequence of items and returns a sequence of atomic values.<br>
The result of fn:data is the sequence of atomic values produced by applying the
following rules to each item in $arg:<br>
<ul>
<li>If the item is an atomic value, it is returned.</li>
<li>
If the item is a node:
<ul>
<li>If the node does not have a typed value an error is raised
[err:FOTY0012].</li>
<li>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.</li>
</ul>
</li>
</ul>
<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item*</td>
<td>Items to convert.</td>
</tr>
</table>
<b>Return type:</b> xs:anyAtomicType*<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>data(/l:library/l:readerList/p:person[1])</td>
<td>7321<br>Adam<br>Choke</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-data" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:index-of()</code></a>
<div class="content">
Returns the root of the tree to which $arg belongs. This will usually, but not
necessarily, be a document node.<br>
If $arg is the empty sequence, the empty sequence is returned.<br>
If $arg is a document node, $arg is returned.<br>
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.<br>
The following errors may be raised: if the context item is undefined [err:XPDY0002]; if
the context item is not a node [err:XPTY0004].<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType</td>
<td>$seqParam</td>
</tr>
<tr>
<td>xs:anyAtomicType</td>
<td>$srchParam</td>
</tr>
<tr>
<td>xs:string</td>
<td>$collation (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:integer*<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>index-of((10, 20, 30, 40), 35)</td>
<td>()</td>
</tr>
<tr>
<td>index-of((10, 20, 30, 30, 20, 10), 20)</td>
<td>(2, 5)</td>
</tr>
<tr>
<td>index-of(("a", "sport", "and", "a", "pastime"), "a")</td>
<td>(1, 4)</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-index-of" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:empty()</code></a>
<div class="content">
If the value of $arg is the empty sequence, the function returns true; otherwise, the
function returns false.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:boolean<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>empty(fn:remove(("hello", "world"), 1))</td>
<td>false</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-empty" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:exists()</code></a>
<div class="content">
If the value of $arg is not the empty sequence, the function returns true; otherwise,
the function returns false.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:boolean<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>exists(fn:remove(("hello"), 1))</td>
<td>true</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-exists" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:distinct-values()</code></a>
<div class="content">
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·.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>$arg</td>
</tr>
<tr>
<td>xs:string</td>
<td>$collation (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:anyAtomicType*<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>distinct-values((1, 2.0, 3, 2))</td>
<td>(1, 3, 2.0)</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-distinct-values" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:insert-before()</code></a>
<div class="content">
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.)<br>
If $target is the empty sequence, $inserts is returned. If $inserts is the empty
sequence, $target is returned.<br>
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.<br>
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.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>$target</td>
</tr>
<tr>
<td>xs:integer</td>
<td>$position</td>
</tr>
<tr>
<td>item()*</td>
<td>$inserts</td>
</tr>
</table>
<b>Return type:</b> item()*<br><br>
<b>Examples:</b><br>
<code>let $x := ("a", "b", "c")</code>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>insert-before($x, 0, "z")</td>
<td>("z", "a", "b", "c")</td>
</tr>
<tr>
<td>insert-before($x, 1, "z")</td>
<td>("z", "a", "b", "c")</td>
</tr>
<tr>
<td>insert-before($x, 2, "z")</td>
<td>("a", "z", "b", "c")</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-insert-before" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:remove()</code></a>
<div class="content">
Returns a new sequence constructed from the value of $target with the item at the
position specified by the value of $position removed.<br>
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.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>$target</td>
</tr>
<tr>
<td>xs:integer</td>
<td>$position</td>
</tr>
</table>
<b>Return type:</b> item()*<br><br>
<b>Examples:</b><br>
<code>let $x := ("a", "b", "c")</code>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>remove($x, 0)</td>
<td> ("a", "b", "c")</td>
</tr>
<tr>
<td>remove($x, 1)</td>
<td>("b", "c")</td>
</tr>
<tr>
<td>remove($x, 6)</td>
<td>("a", "b", "c")</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-remove" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:reverse()</code></a>
<div class="content">
Reverses the order of items in a sequence. If $arg is the empty sequence, the empty
sequence is returned.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> item()*<br><br>
<b>Examples:</b><br>
<code>let $x := ("a", "b", "c")</code>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>reverse($x)</td>
<td>("c", "b", "a")</td>
</tr>
<tr>
<td>reverse(("hello"))</td>
<td> ("hello")</td>
</tr>
<tr>
<td>reverse(())</td>
<td>()</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-reverse" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:subsequence()</code></a>
<div class="content">
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.<br>
If $startingLoc is zero or negative, the subsequence includes items from the beginning
of the $sourceSeq.<br>
If $length is not specified, the subsequence includes items to the end of
$sourceSeq.<br>
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.<br>
The first item of a sequence is located at position 1, not position 0.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>$sourceSeq</td>
</tr>
<tr>
<td>xs:double</td>
<td>$startingLoc (Optional)</td>
</tr>
<tr>
<td>xs:double</td>
<td>$length (Optional)</td>
</tr>
</table>
<b>Return type:</b> item()*<br><br>
<b>Examples:</b><br>
<code>let $seq = ($item1, $item2, $item3, $item4, ...)</code>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>subsequence($seq, 4)</td>
<td>($item4, ...)</td>
</tr>
<tr>
<td>subsequence($seq, 3, 2)</td>
<td>($item3, $item4)</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-subsequence" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:unordered()</code></a>
<div class="content">
Returns the items of $sourceSeq in an implementation dependent order.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>$sourceSeq</td>
</tr>
</table>
<b>Return type:</b> item()*<br><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-unordered" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:zero-or-one()</code></a>
<div class="content">
Returns $arg if it contains zero or one items. Otherwise, raises an error
[err:FORG0003].<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> item()?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>zero-or-one(("a"))</td>
<td>a</td>
</tr>
<tr>
<td>zero-or-one(("a", "b"))</td>
<td>A sequence of more than one item is not allowed as the first argument of
fn:zero-or-one() ("a", "b") </td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-zero-or-one" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:one-or-more()</code></a>
<div class="content">
Returns $arg if it contains one or more items. Otherwise, raises an error
[err:FORG0004].<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> item()?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>one-or-more(("a"))</td>
<td>a</td>
</tr>
<tr>
<td>one-or-more(("a", "b"))</td>
<td>a<br>b</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-one-or-more" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:exactly-one()</code></a>
<div class="content">
Returns $arg if it contains exactly one item. Otherwise, raises an error
[err:FORG0005].<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> item()?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>exactly-one(("a"))</td>
<td>a</td>
</tr>
<tr>
<td>exactly-one(("a", "b"))</td>
<td>A sequence of more than one item is not allowed as the first argument of
fn:exactly-one() ("a", "b") </td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-exactly-one" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:deep-equal()</code></a>
<div class="content">
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.<br>
If the two sequences are both empty, the function returns true.<br>
If the two sequences are of different lengths, the function returns false.<br>
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<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>$parameter1</td>
</tr>
<tr>
<td>item()*</td>
<td>$parameter2</td>
</tr>
<tr>
<td>xs:string</td>
<td>$collation (Optional)</td>
</tr>
</table>
<b>Return type:</b> xs:boolean<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>deep-equal(/l:library/p:person[0], /l:library/p:person[1])</td>
<td>true</td>
</tr>
<tr>
<td>deep-equal(/l:library/p:person[0], /l:library)</td>
<td>false</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-deep-equal" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:id()</code></a>
<div class="content">
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.
<h4>Note:</h4>
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.
<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string*</td>
<td>$arg</td>
</tr>
<tr>
<td>node()*</td>
<td>$node</td>
</tr>
<tr>
<td>xs:string</td>
<td>$collation (Optional)</td>
</tr>
</table>
<b>Return type:</b> element()*<br><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-id" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:idref()</code></a>
<div class="content">
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.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string*</td>
<td>$arg</td>
</tr>
<tr>
<td>node()*</td>
<td>$node</td>
</tr>
<tr>
<td>xs:string</td>
<td>$collation (Optional)</td>
</tr>
</table>
<b>Return type:</b> node()*<br><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-idref" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:doc()</code></a>
<div class="content">
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.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string</td>
<td>$uri</td>
</tr>
</table>
<b>Return type:</b> document-node()?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>doc("test.xml")</td>
<td>Contents of test.xml file returned as node</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-doc" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:doc-available()</code></a>
<div class="content">
Retrieves a document using a URI supplied as an xs:string, and returns the corresponding
document node.<br>
If $uri is the empty sequence, the result is an empty sequence.<br>
If $uri is not a valid URI, an error may be raised [err:FODC0005].<br>
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.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string</td>
<td>$uri</td>
</tr>
</table>
<b>Return type:</b> xs:boolean<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>doc("test.xml")</td>
<td>true (If document is available)</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-doc-available" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:collection()</code></a>
<div class="content">
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]. <br>
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].<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg (Optional)</td>
</tr>
</table>
<b>Return type:</b> node()*<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>collection("")</td>
<td>&lt;empty sequence&gt;</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-collection" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:element-with-id()</code></a>
<div class="content">
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.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg (Optional)</td>
</tr>
</table>
<b>Return type:</b> node()*<br><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-element-with-id" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:position()</code></a>
<div class="content">
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.<br><br>
<b>Return type:</b> xs:integer<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>/l:library/l:readerList/position()</td>
<td>1</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-position" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:last()</code></a>
<div class="content">
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.<br><br>
<b>Return type:</b> xs:integer<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>/l:library/l:readerList/p:person/last()</td>
<td>2<br>2</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-last" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Date / Time</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:years-from-duration()</code></a>
<div class="content">
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.<br>
The result may be negative.<br>
If $arg is an xs:dayTimeDuration returns 0.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:duration?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:integer?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>years-from-duration(xs:yearMonthDuration("P20Y15M"))</td>
<td>21</td>
</tr>
<tr>
<td>years-from-duration(xs:yearMonthDuration("-P15M"))</td>
<td>-1</td>
</tr>
<tr>
<td>years-from-duration(xs:dayTimeDuration("-P2DT15H"))</td>
<td>0</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-years-from-duration"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:months-from-duration()</code></a>
<div class="content">
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.<br>
The result may be negative.<br>
If $arg is an xs:dayTimeDuration returns 0.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:duration?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:integer?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>months-from-duration(xs:yearMonthDuration("P20Y15M"))</td>
<td>3</td>
</tr>
<tr>
<td>months-from-duration(xs:yearMonthDuration("-P20Y18M"))</td>
<td>-6</td>
</tr>
<tr>
<td>months-from-duration(xs:dayTimeDuration("-P2DT15H0M0S"))</td>
<td>0</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-months-from-duration"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:days-from-duration()</code></a>
<div class="content">
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.<br>
The result may be negative.<br>
If $arg is an xs:yearMonthDuration returns 0.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:duration?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:integer?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>days-from-duration(xs:dayTimeDuration("P3DT10H"))</td>
<td>3</td>
</tr>
<tr>
<td>days-from-duration(xs:dayTimeDuration("P3DT55H"))</td>
<td>5</td>
</tr>
<tr>
<td>days-from-duration(xs:yearMonthDuration("P3Y5M"))</td>
<td>0</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-days-from-duration"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:hours-from-duration()</code></a>
<div class="content">
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.<br>
The result may be negative.<br>
If $arg is an xs:yearMonthDuration returns 0.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:duration?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:integer?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>hours-from-duration(xs:dayTimeDuration("P3DT10H"))</td>
<td>10</td>
</tr>
<tr>
<td>hours-from-duration(xs:dayTimeDuration("P3DT12H32M12S"))</td>
<td>12</td>
</tr>
<tr>
<td>hours-from-duration(xs:dayTimeDuration("PT123H"))</td>
<td>0</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-hours-from-duration"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:minutes-from-duration()</code></a>
<div class="content">
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.
If $arg is an xs:yearMonthDuration returns 0.
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:duration?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:integer?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>minutes-from-duration(xs:dayTimeDuration("P3DT10H"))</td>
<td>0</td>
</tr>
<tr>
<td>minutes-from-duration(xs:dayTimeDuration("-P5DT12H30M"))</td>
<td>-30</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-minutes-from-duration"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:seconds-from-duration()</code></a>
<div class="content">
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.<br>
The result may be negative.<br>
If $arg is an xs:yearMonthDuration returns 0.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:duration?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:decimal?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>seconds-from-duration(xs:dayTimeDuration("P3DT10H12.5S"))</td>
<td>12.5</td>
</tr>
<tr>
<td>seconds-from-duration(xs:dayTimeDuration("-PT256S"))</td>
<td>-16.0</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-seconds-from-duration"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:year-from-dateTime()</code></a>
<div class="content">
Returns an xs:integer representing the year component in the localized value of $arg.
The result may be negative.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:integer?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>year-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))</td>
<td>1999</td>
</tr>
<tr>
<td>year-from-dateTime(xs:dateTime("1999-12-31T19:20:00"))</td>
<td>1999</td>
</tr>
<tr>
<td>year-from-dateTime(xs:dateTime("1999-12-31T24:00:00"))</td>
<td>2000</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-year-from-dateTime"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:month-from-dateTime()</code></a>
<div class="content">
Returns an xs:integer between 1 and 12, both inclusive, representing the month component
in the localized value of $arg.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:integer?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>month-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))</td>
<td>5</td>
</tr>
<tr>
<td>month-from-dateTime(xs:dateTime("1999-12-31T19:20:00"))</td>
<td>12</td>
</tr>
<tr>
<td>month-from-dateTime(xs:dateTime("1999-12-31T24:00:00"))</td>
<td>1</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-month-from-dateTime"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:day-from-dateTime()</code></a>
<div class="content">
Returns an xs:integer between 1 and 31, both inclusive, representing the day component
in the localized value of $arg.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:integer?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>day-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))</td>
<td>31</td>
</tr>
<tr>
<td>day-from-dateTime(xs:dateTime("1999-12-31T19:20:00"))</td>
<td>31</td>
</tr>
<tr>
<td>day-from-dateTime(xs:dateTime("1999-12-31T24:00:00"))</td>
<td>1</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-day-from-dateTime"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:hours-from-dateTime()</code></a>
<div class="content">
Returns an xs:integer between 0 and 23, both inclusive, representing the hours component
in the localized value of $arg.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:integer?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>hours-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))</td>
<td>13</td>
</tr>
<tr>
<td>hours-from-dateTime(xs:dateTime("1999-12-31T19:20:00"))</td>
<td>19</td>
</tr>
<tr>
<td>hours-from-dateTime(xs:dateTime("1999-12-31T24:00:00"))</td>
<td>0</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-hours-from-dateTime"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:minutes-from-dateTime()</code></a>
<div class="content">
Returns an xs:integer value between 0 and 59, both inclusive, representing the minute
component in the localized value of $arg.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:integer?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>minutes-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))</td>
<td>20</td>
</tr>
<tr>
<td>minutes-from-dateTime(xs:dateTime("1999-05-31T13:30:00+05:30"))</td>
<td>30</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-minutes-from-dateTime"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:seconds-from-dateTime()</code></a>
<div class="content">
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.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:decimal?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>seconds-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))</td>
<td>0</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-seconds-from-dateTime"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:timezone-from-dateTime()</code></a>
<div class="content">
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.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:dayTimeDuration?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>timezone-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))</td>
<td>-PT5H</td>
</tr>
<tr>
<td>timezone-from-dateTime(xs:dateTime("2000-06-12T13:20:00Z")) </td>
<td>PT0S</td>
</tr>
<tr>
<td>timezone-from-dateTime(xs:dateTime("2004-08-27T00:00:00"))</td>
<td>()</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-timezone-from-dateTime"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:year-from-date()</code></a>
<div class="content">
Returns an xs:integer representing the year in the localized value of $arg. The value
may be negative.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:date?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:integer?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>year-from-date(xs:date("1999-05-31"))</td>
<td>1999</td>
</tr>
<tr>
<td>year-from-date(xs:date("2000-01-01+05:00"))</td>
<td>2000</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-year-from-date" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:month-from-date()</code></a>
<div class="content">
Returns an xs:integer between 1 and 12, both inclusive, representing the month component
in the localized value of $arg.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:date?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:integer?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>month-from-date(xs:date("1999-05-31-05:00"))</td>
<td>5</td>
</tr>
<tr>
<td>month-from-date(xs:date("2000-01-01+05:00"))</td>
<td>1</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-month-from-date" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:day-from-date()</code></a>
<div class="content">
Returns an xs:integer between 1 and 31, both inclusive, representing the day component
in the localized value of $arg.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:date?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:integer?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>day-from-date(xs:date("1999-05-31-05:00"))</td>
<td>31</td>
</tr>
<tr>
<td>day-from-date(xs:date("2000-01-01+05:00"))</td>
<td>1</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-day-from-date" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:timezone-from-date()</code></a>
<div class="content">
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.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:date?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:dayTimeDuration?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>timezone-from-date(xs:date("1999-05-31-05:00"))</td>
<td>-PT5H</td>
</tr>
<tr>
<td>timezone-from-date(xs:date("2000-06-12Z"))</td>
<td>PT0S</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-timezone-from-date"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:hours-from-time()</code></a>
<div class="content">
Returns an xs:integer between 0 and 23, both inclusive, representing the value of the
hours component in the localized value of $arg.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:time?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:integer?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>hours-from-time(xs:time("11:23:00"))</td>
<td>11</td>
</tr>
<tr>
<td>hours-from-time(xs:time("24:00:00"))</td>
<td>0</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-hours-from-time" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:minutes-from-time()</code></a>
<div class="content">
Returns an xs:integer between 0 and 23, both inclusive, representing the value of the
hours component in the localized value of $arg.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:time?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:integer?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>hours-from-time(xs:time("11:23:00"))</td>
<td>11</td>
</tr>
<tr>
<td>hours-from-time(xs:time("24:00:00"))</td>
<td>0</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-minutes-from-time"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:seconds-from-time()</code></a>
<div class="content">
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.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:time?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:decimal?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>seconds-from-time(xs:time("13:20:10.5"))</td>
<td>10.5</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-seconds-from-time"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:timezone-from-time()</code></a>
<div class="content">
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.<br>
If $arg is the empty sequence, returns the empty sequence.<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:time?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:dayTimeDuration?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>timezone-from-time(xs:time("13:20:00-05:00"))</td>
<td>-PT5H</td>
</tr>
<tr>
<td>timezone-from-time(xs:time("13:20:00"))</td>
<td>()</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-timezone-from-time"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:adjust-date-to-timezone()</code></a>
<div class="content">
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.<br>
If $timezone is not specified, then $timezone is the value of the implicit timezone in
the dynamic context.<br>
If $arg is the empty sequence, then the result is the empty sequence.<br>
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.<br>
If $arg does not have a timezone component and $timezone is the empty sequence, then the
result is the value of $arg.<br>
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.<br>
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.<br>
If $arg has a timezone component and $timezone is not the empty sequence, then:
<ul>
<li>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.</li>
<li>Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt,
$timezone)</li>
<li>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.</li>
</ul>
<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:date?</td>
<td>$arg</td>
</tr>
<tr>
<td>xs:dayTimeDuration?</td>
<td>$timezone</td>
</tr>
</table>
<b>Return type:</b> xs:date?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>adjust-date-to-timezone(xs:date("2002-03-07"))</td>
<td>2002-03-07-05:00</td>
</tr>
<tr>
<td>adjust-date-to-timezone(xs:date("2002-03-07"), xs:dayTimeDuration("-PT10H"))
</td>
<td>2002-03-07-10:00</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-adjust-date-to-timezone"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:adjust-time-to-timezone()</code></a>
<div class="content">
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.<br>
If $timezone is not specified, then $timezone is the value of the implicit timezone in
the dynamic context.<br>
If $arg is the empty sequence, then the result is the empty sequence.<br>
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.<br>
If $arg does not have a timezone component and $timezone is the empty sequence, then the
result is $arg.<br>
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.<br>
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.<br>
If $arg has a timezone component and $timezone is not the empty sequence, then:
<ul>
<li>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.</li>
<li>Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt,
$timezone)</li>
<li>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.</li>
</ul>
<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:time?</td>
<td>$arg</td>
</tr>
<tr>
<td>xs:dayTimeDuration?</td>
<td>$timezone</td>
</tr>
</table>
<b>Return type:</b> xs:time?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>adjust-time-to-timezone(xs:time("10:00:00"))</td>
<td>10:00:00-05:00</td>
</tr>
<tr>
<td>adjust-time-to-timezone(xs:time("10:00:00"), xs:dayTimeDuration("-PT10H"))
</td>
<td>10:00:00-10:00</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-adjust-time-to-timezone"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:current-dateTime()</code></a>
<div class="content">
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·.<br><br>
<b>Return type:</b> xs:dateTime<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>current-dateTime()</td>
<td>xs:dateTime corresponding to the current date and time</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-current-dateTime"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:current-date()</code></a>
<div class="content">
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·.<br><br>
<b>Return type:</b> xs:date<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>current-date()</td>
<td>xs:date corresponding to the current date</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-current-date" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:current-time()</code></a>
<div class="content">
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·.<br><br>
<b>Return type:</b> xs:time<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>current-time()</td>
<td>xs:date corresponding to the current time</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-current-time" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:implicit-timezone()</code></a>
<div class="content">
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.<br><br>
<b>Return type:</b> xs:string<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>implicit-timezone()</td>
<td>PT0S</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-implicit-timezone"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Error</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:error()</code></a>
<div class="content">
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.
<br>
<a href="https://www.w3.org/TR/xquery-operators/#func-error" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:trace()</code></a>
<div class="content">
Provides an execution trace intended to be used in debugging queries.<br>
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·.<br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item*</td>
<td>$value</td>
</tr>
<tr>
<td>xs:string</td>
<td>$label</td>
</tr>
</table>
<b>Return type:</b> item<br><br>
<br>
<a href="https://www.w3.org/TR/xquery-operators/#func-trace" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Misc</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:resolve-uri()</code></a>
<div class="content">
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].<br>
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.<br>
If $relative is an absolute URI reference, it is returned unchanged.<br>
If $relative is the empty sequence, the empty sequence is returned.<br>
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].<br>
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].<br>
If the chosen resolution algorithm fails for any other reason then an error is raised
[err:FORG0009].<br>
<h4>Note:</h4>
Resolving a URI does not dereference it. This is merely a syntactic operation on two
character strings.
<br><br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$relative</td>
</tr>
<tr>
<td>xs:string</td>
<td>$base</td>
</tr>
</table>
<b>Return type:</b> xs:anyURI?<br><br>
<br>
<a href="https://www.w3.org/TR/xquery-operators/#func-resolve-uri" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:resolve-QName()</code></a>
<div class="content">
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.<br>
If $qname does not have the correct lexical form for xs:QName an error is raised
[err:FOCA0002].<br>
If $qname is the empty sequence, returns the empty sequence.<br>
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.<br>
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].<br>
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.<br>
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.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$qname</td>
</tr>
<tr>
<td>element</td>
<td>$element</td>
</tr>
</table>
<b>Return type:</b> xs:QName?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>resolve-QName("hello", /l:library/l:libraryName)</td>
<td>hello</td>
</tr>
<tr>
<td>resolve-QName("l:libraryID", /l:library/l:libraryName)</td>
<td>l:libraryID</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-resolve-QName" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:QName()</code></a>
<div class="content">
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.<br>
If $paramQName does not have the correct lexical form for xs:QName an error is raised
[err:FOCA0002].<br>
Note that unlike xs:QName this function does not require a xs:string literal as the
argument.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$paramURI</td>
</tr>
<tr>
<td>xs:string</td>
<td>$paramQName</td>
</tr>
</table>
<b>Return type:</b> xs:QName<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>QName("http://www.release11.com/library", "l:libraryName")</td>
<td>l:libraryName</td>
</tr>
</table>
For more extensive examples see W3C documentation below.<br>
<a href="https://www.w3.org/TR/xquery-operators/#func-QName" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:prefix-from-QName()</code></a>
<div class="content">
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.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:QName?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:NCName?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>prefix-from-QName(resolve-QName("l:library", /l:library))</td>
<td>l</td>
</tr>
</table>
<a href="https://www.w3.org/TR/xquery-operators/#func-prefix-from-QName"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:local-name-from-QName()</code></a>
<div class="content">
Returns an xs:NCName representing the local part of $arg. If $arg is the empty sequence,
returns the empty sequence.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:QName?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:NCName?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>prefix-from-QName(resolve-QName("l:library", /l:library))</td>
<td>library</td>
</tr>
</table>
<a href="https://www.w3.org/TR/xquery-operators/#func-local-name-from-QName"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:prefix-from-QName()</code></a>
<div class="content">
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.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:QName?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:NCName?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>prefix-from-QName(resolve-QName("l:library", /l:library))</td>
<td>l</td>
</tr>
</table>
<a href="https://www.w3.org/TR/xquery-operators/#func-prefix-from-QName"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:namespace-uri-from-QName()</code></a>
<div class="content">
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.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:QName?</td>
<td>$arg</td>
</tr>
</table>
<b>Return type:</b> xs:anyURI?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>prefix-from-QName(resolve-QName("l:library", /l:library))</td>
<td>http://www.release11.com/library</td>
</tr>
</table>
<a href="https://www.w3.org/TR/xquery-operators/#func-namespace-uri-from-QName"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:namespace-uri-for-prefix()</code></a>
<div class="content">
Returns the namespace URI of one of the in-scope namespaces for $element, identified by
its namespace prefix.<br>
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.<br>
Prefixes are equal only if their Unicode code points match exactly.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$prefix</td>
</tr>
<tr>
<td>element()</td>
<td>$element</td>
</tr>
</table>
<b>Return type:</b> xs:anyURI?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>namespace-uri-for-prefix("l", /l:library)</td>
<td>http://www.release11.com/library</td>
</tr>
</table>
<a href="https://www.w3.org/TR/xquery-operators/#func-namespace-uri-for-prefix"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:in-scope-prefixes()</code></a>
<div class="content">
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.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>element()</td>
<td>$element</td>
</tr>
</table>
<b>Return type:</b> xs:string*<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>in-scope-prefixes(/l:library)</td>
<td>b<br>l<br>p<br>xsi<br>xml</td>
</tr>
</table>
<a href="https://www.w3.org/TR/xquery-operators/#func-in-scope-prefixes"
class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:static-base-uri()</code></a>
<div class="content">
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.<br><br>
<b>Return type:</b> xs:anyURI?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>static-base-uri()()</td>
<td>&lt;empty sequence&gt;</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-static-base-uri" class="hyperlink"
target="_blank"><code>W3C Documentation reference</code></a>
</div>
</div>
</div>
</span>
<span name="collapse30">
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Node-Set</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:outermost(node()*)</code></a>
<div class="content">
Returns the outermost nodes of the input sequence that are not ancestors of any other
node in the input sequence<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()*</td>
<td>Sequence of nodes</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:outermost(//chapter)</td>
<td>Sequence of outermost chapter nodes</td>
</tr>
<tr>
<td>fn:outermost(/book//*)</td>
<td>Sequence of outermost nodes in the book</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-outermost" class="hyperlink" target="_blank">outermost</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:innermost(node()*)</code></a>
<div class="content">
Returns the innermost nodes of the input sequence that are not descendants of any other
node in the input sequence<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()*</td>
<td>Sequence of nodes</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:innermost(//chapter)</td>
<td>Sequence of innermost chapter nodes</td>
</tr>
<tr>
<td>fn:innermost(/book//*)</td>
<td>Sequence of innermost nodes in the book</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-innermost" class="hyperlink" target="_blank">innermost</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:has-children(node()?)</code></a>
<div class="content">
Returns true if the specified node has one or more children, otherwise returns false<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()?</td>
<td>Optional node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:has-children(/book/chapter[1])</td>
<td>true</td>
</tr>
<tr>
<td>fn:has-children(/book/chapter[1]/title)</td>
<td>false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-has-children" class="hyperlink" target="_blank">has-children</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:path(node()?)</code></a>
<div class="content">
Returns a string that represents the path of the specified node within the XML
document<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()?</td>
<td>Optional node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:path(/book/chapter[1])</td>
<td>/book/chapter[1]</td>
</tr>
<tr>
<td>fn:path(/book/chapter[2]/title)</td>
<td>/book/chapter[2]/title</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-path" class="hyperlink" target="_blank">path</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:root(node()?)</code></a>
<div class="content">
Returns the root node of the tree that contains the specified node<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()?</td>
<td>Optional node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:root(/book/chapter)</td>
<td>&lt;book&gt; element (root node)</td>
</tr>
<tr>
<td>fn:root(/book/chapter[1])</td>
<td>&lt;book&gt; element (root node)</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-root" class="hyperlink" target="_blank">root</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:namespace-uri(node()?)</code></a>
<div class="content">
Returns the namespace URI of the specified node<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()?</td>
<td>Optional node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:namespace-uri(/example:root)</td>
<td>"http://www.example.com/ns"</td>
</tr>
<tr>
<td>fn:namespace-uri(/a/b)</td>
<td>""</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-namespace-uri" class="hyperlink" target="_blank">namespace-uri</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:local-name(node()?)</code></a>
<div class="content">
Returns the local part of the name of the specified node<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()?</td>
<td>Optional node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:local-name(/a/b)</td>
<td>"b"</td>
</tr>
<tr>
<td>fn:local-name(/example:root)</td>
<td>"root"</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-local-name" class="hyperlink" target="_blank">local-name</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:name(node()?)</code></a>
<div class="content">
Returns the expanded QName of the specified node as a string<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()?</td>
<td>Optional node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:name(/a/b)</td>
<td>"b"</td>
</tr>
<tr>
<td>fn:name(/example:root)</td>
<td>"example:root"</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-name" class="hyperlink" target="_blank">name</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:document-uri(node?)</code></a>
<div class="content">
Returns the document URI of the given node or the context item <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node?</td>
<td>Returns the document URI of the specified node or the context item (if no
argument is provided)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:document-uri(/library/fiction:book[1])</td>
<td>http://example.com/library.xml (assuming the document URI of the first
fiction:book element is "http://example.com/library.xml")</td>
</tr>
<tr>
<td>fn:document-uri(/library)</td>
<td>http://example.com/library.xml (assuming the document URI of the library
element is "http://example.com/library.xml")</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-document-uri" class="hyperlink" target="_blank">Document-URI</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:base-uri(node?)</code></a>
<div class="content">
Returns the base URI of the node or the context item <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node?</td>
<td>Returns the base URI of the specified node or the context item (if no
argument is provided)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:base-uri(/library/fiction:book[1])</td>
<td>http://example.com/library.xml (assuming the base URI of the first
fiction:book element is "http://example.com/library.xml")</td>
</tr>
<tr>
<td>fn:base-uri(/library)</td>
<td>http://example.com/library.xml (assuming the base URI of the library element
is "http://example.com/library.xml")</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-base-uri" class="hyperlink" target="_blank">Base-URI</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:node-name(node?)</code></a>
<div class="content">
Returns the name of a node as an xs:QName <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node?</td>
<td>Returns the name of the specified node or the context item if the argument
is omitted</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:node-name(/library/*[1])</td>
<td>fiction:book</td>
</tr>
<tr>
<td>fn:node-name(/library/fiction:book[1]/title)</td>
<td>title</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-node-name" class="hyperlink" target="_blank">Node-Name</a></code>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Boolean</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:not(item()*)</code></a>
<div class="content">
Returns the negation of the effective boolean value of the argument <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Argument whose effective boolean value is to be negated</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:not(1)</td>
<td>false</td>
</tr>
<tr>
<td>fn:not(0)</td>
<td>true</td>
</tr>
<tr>
<td>fn:not('')</td>
<td>true</td>
</tr>
<tr>
<td>fn:not('true')</td>
<td>false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-not" class="hyperlink" target="_blank">Not</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:false()</code></a>
<div class="content">
Returns the boolean value false <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Returns the boolean value false</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:false()</td>
<td>false</td>
</tr>
<tr>
<td>//item[fn:false()]</td>
<td>Returns an empty node-set</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-false" class="hyperlink" target="_blank">False</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:true()</code></a>
<div class="content">
Returns the boolean value true <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Returns the boolean value true</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:true()</td>
<td>true</td>
</tr>
<tr>
<td>//item[fn:true()]</td>
<td>Returns all &lt;item&gt; elements</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-true" class="hyperlink" target="_blank">True</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:boolean(item()*)</code></a>
<div class="content">
Converts the argument to a boolean value <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Argument to be converted to a boolean value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:boolean(1)</td>
<td>true</td>
</tr>
<tr>
<td>fn:boolean(0)</td>
<td>false</td>
</tr>
<tr>
<td>fn:boolean('')</td>
<td>false</td>
</tr>
<tr>
<td>fn:boolean('true')</td>
<td>true</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-boolean" class="hyperlink" target="_blank">Boolean</a></code>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">String</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:unparsed-text-available(xs:string?, xs:string?)</code></a>
<div class="content">
Determines if an unparsed text resource identified by a URI can be read using the given
encoding<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>The URI identifying the unparsed text resource</td>
</tr>
<tr>
<td>xs:string?</td>
<td>The encoding to be used for reading the resource</td>
</tr>
<tr>
<td>xs:boolean</td>
<td>Indicates if the resource can be read using the given encoding</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:unparsed-text-available("http://www.example.com/text.txt", "UTF-8")</td>
<td>Returns true if the text resource identified by the specified URI can be
read using the specified encoding, otherwise false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-unparsed-text-available" class="hyperlink" target="_blank">unparsed-text-available</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:unparsed-text-lines(xs:string?, xs:string?)</code></a>
<div class="content">
Returns the contents of an unparsed text resource identified by a URI, split into
lines<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>The URI identifying the unparsed text resource</td>
</tr>
<tr>
<td>xs:string?</td>
<td>The encoding to be used for reading the resource</td>
</tr>
<tr>
<td>xs:string*</td>
<td>The lines of the unparsed text resource</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:unparsed-text-lines("http://www.example.com/text.txt", "UTF-8")</td>
<td>Returns the lines of the text resource identified by the specified URI,
using the specified encoding</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-unparsed-text-lines" class="hyperlink" target="_blank">unparsed-text-lines</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:unparsed-text(xs:string?, xs:string?)</code></a>
<div class="content">
Returns the contents of an unparsed text resource identified by a URI<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>The URI identifying the unparsed text resource</td>
</tr>
<tr>
<td>xs:string?</td>
<td>The encoding to be used for reading the resource</td>
</tr>
<tr>
<td>xs:string?</td>
<td>The contents of the unparsed text resource</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:unparsed-text("http://www.example.com/text.txt", "UTF-8")</td>
<td>Returns the contents of the text resource identified by the specified URI,
using the specified encoding</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-unparsed-text" class="hyperlink" target="_blank">unparsed-text</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:escape-html-uri(xs:string?)</code></a>
<div class="content">
Escapes special characters in a URI to be used in HTML <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>URI to be escaped for use in HTML</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:escape-html-uri('https://example.com/search?q=test&lang=en')</td>
<td>https://example.com/search?q=test&amp;lang=en</td>
</tr>
<tr>
<td>fn:escape-html-uri('https://example.com/page?id=1&section=2')</td>
<td>https://example.com/page?id=1&amp;section=2</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-escape-html-uri" class="hyperlink" target="_blank">Escape-HTML-URI</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:iri-to-uri(xs:string?)</code></a>
<div class="content">
Converts an IRI to a URI by escaping non-ASCII characters <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>IRI to be converted to a URI</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:iri-to-uri('https://example.com/ümlaut')</td>
<td>https://example.com/%C3%BCmlaut</td>
</tr>
<tr>
<td>fn:iri-to-uri('https://example.com/日本語')</td>
<td>https://example.com/%E6%97%A5%E6%9C%AC%E8%AA%9E</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-iri-to-uri" class="hyperlink" target="_blank">IRI-to-URI</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:encode-for-uri(xs:string?)</code></a>
<div class="content">
Encodes a string for use in a URI by escaping special characters <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>String to be encoded for use in a URI</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:encode-for-uri('hello world')</td>
<td>hello%20world</td>
</tr>
<tr>
<td>fn:encode-for-uri('example?query=value&param=value2')</td>
<td>example%3Fquery%3Dvalue%26param%3Dvalue2</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-encode-for-uri" class="hyperlink" target="_blank">Encode-for-URI</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:resolve-uri(xs:string?, xs:string?)</code></a>
<div class="content">
Resolves a relative URI using a base URI <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Relative URI to resolve</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Base URI to use for resolving (optional)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:resolve-uri('example.html', 'https://www.example.com/folder/')</td>
<td>https://www.example.com/folder/example.html</td>
</tr>
<tr>
<td>fn:resolve-uri('../images/pic.jpg',
'https://www.example.com/folder/page.html')</td>
<td>https://www.example.com/images/pic.jpg</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-resolve-uri" class="hyperlink" target="_blank">Resolve-URI</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:analyze-string(xs:string?, xs:string, xs:string?)</code></a>
<div class="content">
Analyzes the input string and returns an XML fragment containing match and non-match
elements <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to analyze</td>
</tr>
<tr>
<td>xs:string</td>
<td>Regular expression pattern to match</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Flags to control the regular expression matching (optional)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:analyze-string('red,green,blue', ',')</td>
<td>
&lt;fn:analyze-string-result>&lt;fn:non-match>red&lt;/fn:non-match>&lt;fn:match>,
</fn:match>&lt;fn:non-match>green&lt;/fn:non-match>&lt;fn:match>,</fn:match>
&lt;fn:non-match>blue&lt;/fn:non-match>&lt;/fn:analyze-string-result>
</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-analyze-string" class="hyperlink" target="_blank">Analyze-String</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:tokenize(xs:string?, xs:string, xs:string?)</code></a>
<div class="content">
Splits the input string into a sequence of substrings using the pattern as a delimiter
<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to tokenize</td>
</tr>
<tr>
<td>xs:string</td>
<td>Regular expression pattern to use as delimiter</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Flags to control the regular expression matching (optional)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:tokenize('XPath 3.0, XQuery 3.0, XSLT 3.0', ',\\s*')</td>
<td>('XPath 3.0', 'XQuery 3.0', 'XSLT 3.0')</td>
</tr>
<tr>
<td>fn:tokenize('apple,orange,banana', ',')</td>
<td>('apple', 'orange', 'banana')</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-tokenize" class="hyperlink" target="_blank">Tokenize</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:replace(xs:string?, xs:string, xs:string, xs:string?)</code></a>
<div class="content">
Replaces occurrences of the pattern in the input string with the replacement string <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to search within</td>
</tr>
<tr>
<td>xs:string</td>
<td>Regular expression pattern to match</td>
</tr>
<tr>
<td>xs:string</td>
<td>Replacement string</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Flags to control the regular expression matching (optional)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:replace('XPath 3.0 is great', '3.0', '3.1')</td>
<td>'XPath 3.1 is great'</td>
</tr>
<tr>
<td>fn:replace('Hello, World!', 'World', 'XPath')</td>
<td>'Hello, XPath!'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-replace" class="hyperlink" target="_blank">Replace</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:matches(xs:string?, xs:string, xs:string?)</code></a>
<div class="content">
Returns true if the input string matches the regular expression pattern, otherwise false
<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to search within</td>
</tr>
<tr>
<td>xs:string</td>
<td>Regular expression pattern to match</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Flags to control the regular expression matching (optional)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:matches('XPath 3.0', '\\d\\.\\d')</td>
<td>true</td>
</tr>
<tr>
<td>fn:matches('Hello, World!', '[A-Z][a-z]*')</td>
<td>true</td>
</tr>
<tr>
<td>fn:matches('example123', '\\d+', 'q')</td>
<td>false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-matches" class="hyperlink" target="_blank">Matches</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:substring-after(xs:string?, xs:string?)</code></a>
<div class="content">
Returns the part of the first string that follows the first occurrence of the second
string <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to search within</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Substring to search for</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:substring-after('Hello, World!', ',')</td>
<td>' World!'</td>
</tr>
<tr>
<td>fn:substring-after('XPath 3.0 is awesome!', '3.0')</td>
<td>' is awesome!'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-substring-after" class="hyperlink" target="_blank">Substring-After</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:substring-before(xs:string?, xs:string?)</code></a>
<div class="content">
Returns the part of the first string that precedes the first occurrence of the second
string <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to search within</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Substring to search for</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:substring-before('Hello, World!', ',')</td>
<td>'Hello'</td>
</tr>
<tr>
<td>fn:substring-before('XPath 3.0 is awesome!', '3.0')</td>
<td>'XPath '</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-substring-before" class="hyperlink" target="_blank">Substring-Before</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:ends-with(xs:string?, xs:string?)</code></a>
<div class="content">
Returns true if the first string ends with the second string, otherwise false <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to check</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Substring to check for at the end of the first string</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:ends-with('Hello, World!', 'World!')</td>
<td>true</td>
</tr>
<tr>
<td>fn:ends-with('Hello, World!', 'Hello')</td>
<td>false</td>
</tr>
<tr>
<td>fn:ends-with('XPath 3.0', '3.0')</td>
<td>true</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-ends-with" class="hyperlink" target="_blank">Ends-With</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:starts-with(xs:string?, xs:string?)</code></a>
<div class="content">
Returns true if the first string starts with the second string, otherwise false <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to check</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Substring to check for at the beginning of the first string</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:starts-with('Hello, World!', 'Hello')</td>
<td>true</td>
</tr>
<tr>
<td>fn:starts-with('Hello, World!', 'World')</td>
<td>false</td>
</tr>
<tr>
<td>fn:starts-with('XPath 3.0', 'XPath')</td>
<td>true</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-starts-with" class="hyperlink" target="_blank">Starts-With</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:contains(xs:string?, xs:string?)</code></a>
<div class="content">
Returns true if the first string contains the second string, otherwise false <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to search within</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Substring to search for</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:contains('Hello, World!', 'World')</td>
<td>true</td>
</tr>
<tr>
<td>fn:contains('Hello, World!', 'world')</td>
<td>false</td>
</tr>
<tr>
<td>fn:contains('XPath 3.0', '3.0')</td>
<td>true</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-contains" class="hyperlink" target="_blank">Contains</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:translate(xs:string?, xs:string, xs:string)</code></a>
<div class="content">
Returns the input string with specified characters replaced <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to be translated</td>
</tr>
<tr>
<td>xs:string</td>
<td>Map string with characters to replace</td>
</tr>
<tr>
<td>xs:string</td>
<td>Translate string with replacement characters</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:translate('apple', 'aeiou', '12345')</td>
<td>'1ppl2'</td>
</tr>
<tr>
<td>fn:translate('Hello, World!', 'HW', 'hw')</td>
<td>'hello, world!'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-translate" class="hyperlink" target="_blank">Translate</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:lower-case(xs:string?)</code></a>
<div class="content">
Returns the input string with all characters converted to lowercase <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to convert to lowercase</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:lower-case('HELLO, WORLD!')</td>
<td>'hello, world!'</td>
</tr>
<tr>
<td>fn:lower-case('XPath 3.0')</td>
<td>'xpath 3.0'</td>
</tr>
<tr>
<td>fn:lower-case('BANANA')</td>
<td>'banana'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-lower-case" class="hyperlink" target="_blank">Lower-Case</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:upper-case(xs:string?)</code></a>
<div class="content">
Returns the input string with all characters converted to uppercase <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to convert to uppercase</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:upper-case('Hello, World!')</td>
<td>'HELLO, WORLD!'</td>
</tr>
<tr>
<td>fn:upper-case('XPath 3.0')</td>
<td>'XPATH 3.0'</td>
</tr>
<tr>
<td>fn:upper-case('banana')</td>
<td>'BANANA'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-upper-case" class="hyperlink" target="_blank">Upper-Case</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:normalize-unicode(xs:string?, xs:string)</code></a>
<div class="content">
Returns the input string with Unicode normalization applied <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to normalize</td>
</tr>
<tr>
<td>xs:string</td>
<td>Normalization form to apply (NFC, NFD, NFKC, NFKD)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:normalize-unicode('Café', 'NFC')</td>
<td>'Café'</td>
</tr>
<tr>
<td>fn:normalize-unicode('Café', 'NFD')</td>
<td>'Café'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-normalize-unicode" class="hyperlink" target="_blank">Normalize-Unicode</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:normalize-space(xs:string?)</code></a>
<div class="content">
Returns the input string with whitespace normalized <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to normalize whitespace</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:normalize-space(' Hello, World! ')</td>
<td>'Hello, World!'</td>
</tr>
<tr>
<td>fn:normalize-space(' XPath 3.0 ')</td>
<td>'XPath 3.0'</td>
</tr>
<tr>
<td>fn:normalize-space('\tbanana\t')</td>
<td>'banana'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-normalize-space" class="hyperlink" target="_blank">Normalize-Space</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:string-length(xs:string?)</code></a>
<div class="content">
Returns the length of the input string <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to calculate length</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:string-length('Hello, World!')</td>
<td>13</td>
</tr>
<tr>
<td>fn:string-length('XPath 3.0')</td>
<td>8</td>
</tr>
<tr>
<td>fn:string-length('banana')</td>
<td>6</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-string-length" class="hyperlink" target="_blank">String-Length</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:substring(xs:string?, xs:double)</code></a>
<div class="content">
Returns a substring of the source string, starting from a specific location <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input source string</td>
</tr>
<tr>
<td>xs:double</td>
<td>Starting location to extract the substring</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:substring('Hello, World!', 1, 5)</td>
<td>'Hello'</td>
</tr>
<tr>
<td>fn:substring('XPath 3.0', 7)</td>
<td>'3.0'</td>
</tr>
<tr>
<td>fn:substring('banana', 2, 3)</td>
<td>'ana'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-substring" class="hyperlink" target="_blank">Substring</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:string-join(xs:string*, xs:string)</code></a>
<div class="content">
Joins a sequence of strings with a specified separator, returning a single string <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string*</td>
<td>Input sequence of strings to join</td>
</tr>
<tr>
<td>xs:string</td>
<td>Separator string to insert between joined strings</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:string-join(('apple', 'banana', 'orange'), ', ')</td>
<td>'apple, banana, orange'</td>
</tr>
<tr>
<td>fn:string-join(('XPath', '3.0', 'Functions'), ' - ')</td>
<td>'XPath - 3.0 - Functions'</td>
</tr>
<tr>
<td>fn:string-join(('A', 'B', 'C'), '')</td>
<td>'ABC'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-string-join" class="hyperlink" target="_blank">String-Join</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:concat(xs:anyAtomicType?, xs:anyAtomicType?, ...)</code></a>
<div class="content">
Concatenates two or more strings or atomic values, returning a single string <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType?</td>
<td>Input strings or atomic values to concatenate</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:concat('Hello', ' ', 'World')</td>
<td>'Hello World'</td>
</tr>
<tr>
<td>fn:concat('I have ', 3, ' apples')</td>
<td>'I have 3 apples'</td>
</tr>
<tr>
<td>fn:concat('XPath ', '3.0')</td>
<td>'XPath 3.0'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-concat" class="hyperlink" target="_blank">Concat</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:codepoint-equal(xs:string?, xs:string?)</code></a>
<div class="content">
Compares two strings on a codepoint-by-codepoint basis and returns true if they are
equal, false otherwise <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>First string to compare</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Second string to compare</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:codepoint-equal('Hello', 'Hello')</td>
<td>true</td>
</tr>
<tr>
<td>fn:codepoint-equal('Hello', 'hello')</td>
<td>false</td>
</tr>
<tr>
<td>fn:codepoint-equal('apple', 'banana')</td>
<td>false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-codepoint-equal" class="hyperlink" target="_blank">Codepoint-Equal</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:compare(xs:string?, xs:string?)</code></a>
<div class="content">
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 <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>First string to compare</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Second string to compare</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:compare('apple', 'banana')</td>
<td>-1</td>
</tr>
<tr>
<td>fn:compare('apple', 'apple')</td>
<td>0</td>
</tr>
<tr>
<td>fn:compare('banana', 'apple')</td>
<td>1</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-compare" class="hyperlink" target="_blank">Compare</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:string-to-codepoints(xs:string?)</code></a>
<div class="content">
Returns a sequence of Unicode code points for a given string <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:string-to-codepoints('Hello')</td>
<td>(72, 101, 108, 108, 111)</td>
</tr>
<tr>
<td>fn:string-to-codepoints('( ͡° ͜ʖ ͡°)')</td>
<td>(40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41)</td>
</tr>
<tr>
<td>fn:string-to-codepoints('😊')</td>
<td>(128522)</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-string-to-codepoints" class="hyperlink" target="_blank">String-To-Codepoints</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:codepoints-to-string(xs:integer*)</code></a>
<div class="content">
Constructs a string from a sequence of Unicode code points <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:integer*</td>
<td>Sequence of Unicode code points</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:codepoints-to-string((72, 101, 108, 108, 111))</td>
<td>Hello</td>
</tr>
<tr>
<td>codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41))
</td>
<td>( ͡° ͜ʖ ͡°)</td>
</tr>
<tr>
<td>fn:codepoints-to-string((128522))</td>
<td>😊</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-codepoints-to-string" class="hyperlink" target="_blank">Codepoints-To-String</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:string(object)</code></a>
<div class="content">
Returns the string representation of the object argument <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>string</td>
<td>The object to convert to a string</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>string((1&lt;0))</td>
<td>false</td>
</tr>
<tr>
<td>string(.11)</td>
<td>0.11</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" class="hyperlink" target="_blank">String-Functions</code></a>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Numeric</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:format-number(numeric?, xs:string, $decimal-format-name)</code></a>
<div class="content">
Formats a numeric value according to the supplied picture string and optional decimal
format name <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>numeric?</td>
<td>Numeric value to be formatted</td>
</tr>
<tr>
<td>xs:string</td>
<td>Picture string defining the format</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Optional decimal format name</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:format-number(1234.567, '0.00')</td>
<td>1,234.57</td>
</tr>
<tr>
<td>fn:format-number(-1234.567, '0.00')</td>
<td>-1,234.57</td>
</tr>
<tr>
<td>fn:format-number(0.12345, '0.00%')</td>
<td>12.35%</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-format-number" class="hyperlink" target="_blank">Format-Number</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:format-integer(xs:integer?, xs:string)</code></a>
<div class="content">
Formats an integer value according to the supplied picture string <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:integer?</td>
<td>Integer value to be formatted</td>
</tr>
<tr>
<td>xs:string</td>
<td>Picture string defining the format</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:format-integer(12345, '0,0')</td>
<td>12,345</td>
</tr>
<tr>
<td>fn:format-integer(-1234, '0,0')</td>
<td>-1,234</td>
</tr>
<tr>
<td>fn:format-integer(1234, '00-00-00')</td>
<td>01-23-45</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-format-integer" class="hyperlink" target="_blank">Format-Integer</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:round-half-to-even(numeric?)</code></a>
<div class="content">
Returns the closest integer to the given numeric value, rounding half-way cases to the
nearest even integer (also known as "bankers' rounding") <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>numeric?</td>
<td>Numeric value for which the rounded value will be calculated</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:round-half-to-even(3.5)</td>
<td>4</td>
</tr>
<tr>
<td>fn:round-half-to-even(2.5)</td>
<td>2</td>
</tr>
<tr>
<td>fn:round-half-to-even(-1.5)</td>
<td>-2</td>
</tr>
<tr>
<td>fn:round-half-to-even(xs:decimal('1.25'), 1)</td>
<td>1.2</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-round-half-to-even" class="hyperlink" target="_blank">Round-Half-To-Even</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:round(numeric?)</code></a>
<div class="content">
Returns the closest integer to the given numeric value, rounding half-way cases away
from zero <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>numeric?</td>
<td>Numeric value for which the rounded value will be calculated</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:round(3.14)</td>
<td>3</td>
</tr>
<tr>
<td>fn:round(-4.7)</td>
<td>-5</td>
</tr>
<tr>
<td>fn:round(xs:decimal('2.5'))</td>
<td>3</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-round" class="hyperlink" target="_blank">Round</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:floor(numeric?)</code></a>
<div class="content">
Returns the largest integer less than or equal to the given numeric value <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>numeric?</td>
<td>Numeric value for which the floor value will be calculated</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:floor(3.14)</td>
<td>3</td>
</tr>
<tr>
<td>fn:floor(-4.7)</td>
<td>-5</td>
</tr>
<tr>
<td>fn:floor(xs:decimal('2.5'))</td>
<td>2</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-floor" class="hyperlink" target="_blank">Floor</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:ceiling(numeric?)</code></a>
<div class="content">
Returns the smallest integer greater than or equal to the given numeric value <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>numeric?</td>
<td>Numeric value for which the ceiling value will be calculated</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:ceiling(3.14)</td>
<td>4</td>
</tr>
<tr>
<td>fn:ceiling(-4.7)</td>
<td>-4</td>
</tr>
<tr>
<td>fn:ceiling(xs:decimal('2.5'))</td>
<td>3</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-ceiling" class="hyperlink" target="_blank">Ceiling</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:abs(numeric?)</code></a>
<div class="content">
Returns the absolute value of the given numeric value <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>numeric?</td>
<td>Numeric value for which the absolute value will be calculated</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:abs(-42)</td>
<td>42</td>
</tr>
<tr>
<td>fn:abs(3.14)</td>
<td>3.14</td>
</tr>
<tr>
<td>fn:abs(xs:decimal('-5.5'))</td>
<td>5.5</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-abs" class="hyperlink" target="_blank">Abs</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:number(item?)</code></a>
<div class="content">
Converts the given value to a number <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item?</td>
<td>Returns the numeric value of the specified expression or the context item
(if no argument is provided)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:number(/library/fiction:book[1]/@id)</td>
<td>1 (if the first fiction:book element's id attribute is "1")</td>
</tr>
<tr>
<td>fn:number(/library/fiction:book[1]/price)</td>
<td>19.99 (if the first fiction:book element's price element contains "19.99")
</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-number" class="hyperlink" target="_blank">Number</a></code>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Collections</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:fold-right(item()*, item()*, function(item(), item()*))</code></a>
<div class="content">
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<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>The input sequence of items</td>
</tr>
<tr>
<td>item()*</td>
<td>The initial value, also known as the zero value</td>
</tr>
<tr>
<td>function(item(), item()*)</td>
<td>The processing function used to accumulate the items</td>
</tr>
<tr>
<td>item()*</td>
<td>The resulting single value after applying the processing function</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fold-right((1, 2, 3, 4), 0, function($current, $accumulator) { $accumulator
- $current })</td>
<td>Returns the result of subtracting each number in the input sequence from
right to left: <code>-2</code></td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-fold-right" class="hyperlink" target="_blank">fold-right</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:fold-left(item()*, item()*, function(item()*, item()))</code></a>
<div class="content">
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<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>The input sequence of items</td>
</tr>
<tr>
<td>item()*</td>
<td>The initial value, also known as the zero value</td>
</tr>
<tr>
<td>function(item()*, item())</td>
<td>The processing function used to accumulate the items</td>
</tr>
<tr>
<td>item()*</td>
<td>The resulting single value after applying the processing function</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fold-left((1, 2, 3, 4), 0, function($accumulator, $current) { $accumulator +
$current })</td>
<td>Returns the sum of the numbers in the input sequence: <code>10</code></td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-fold-left" class="hyperlink" target="_blank">fold-left</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:last()</code></a>
<div class="content">
Returns the position of the last item in the current context sequence <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Returns the position of the last item in the current context sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>/library/fiction:book[position() = last()]</td>
<td>Returns the last fiction:book element in the library</td>
</tr>
<tr>
<td>/library/fiction:book[last()]</td>
<td>Returns the last fiction:book element in the library</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-30/#func-last" class="hyperlink" target="_blank">Last</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:position()</code></a>
<div class="content">
Returns the context position of the context item in the sequence currently being
processed<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Function takes no arguments</td>
</tr>
<tr>
<td>xs:integer</td>
<td>The position of the context item in the sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>&lt;items>&lt;item>Item 1&lt;/item>&lt;item>Item
2&lt;/item>&lt;/items>/item[position()=2]</td>
<td>Returns '&lt;item>Item 2&lt;/item>'</td>
</tr>
<tr>
<td>&lt;items>&lt;item>Item 1&lt;/item>&lt;item>Item
2&lt;/item>&lt;/items>/item[position()=1]</td>
<td>Returns '&lt;item>Item 1&lt;/item>'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-position" class="hyperlink" target="_blank">position</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:collection(xs:string?)</code></a>
<div class="content">
Returns a sequence of documents in a collection identified by a URI<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>The URI identifying the collection of documents</td>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>A sequence of documents in the collection</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:collection("http://www.example.com/collection/")</td>
<td>Returns a sequence of documents in the collection identified by the
specified URI</td>
</tr>
<tr>
<td>fn:collection()</td>
<td>Returns a sequence of documents in the default collection, if one is defined
</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-collection" class="hyperlink" target="_blank">collection</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:sum(xs:anyAtomicType*, xs:anyAtomicType?)</code></a>
<div class="content">
Returns the sum of a sequence of numeric values<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>Input sequence of numeric values</td>
</tr>
<tr>
<td>xs:anyAtomicType?</td>
<td>Value to return if the sequence is empty (optional)</td>
</tr>
<tr>
<td>xs:anyAtomicType?</td>
<td>Sum of the input sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:sum((10, 20, 30, 40, 50))</td>
<td>150</td>
</tr>
<tr>
<td>fn:sum((), 0)</td>
<td>0</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-sum" class="hyperlink" target="_blank">sum</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:min(xs:anyAtomicType*, xs:string)</code></a>
<div class="content">
Returns the minimum value from a sequence of values<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>Input sequence of values</td>
</tr>
<tr>
<td>xs:string</td>
<td>Collation to use when comparing strings</td>
</tr>
<tr>
<td>xs:anyAtomicType?</td>
<td>Minimum value in the input sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:min((10, 20, 30, 40, 50))</td>
<td>10</td>
</tr>
<tr>
<td>fn:min(("apple", "banana", "cherry"),
"http://www.w3.org/2005/xpath-functions/collation/codepoint")</td>
<td>"apple"</td>
</tr>
<tr>
<td>fn:min(())</td>
<td>empty sequence</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-min" class="hyperlink" target="_blank">min</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:max(xs:anyAtomicType*, xs:string)</code></a>
<div class="content">
Returns the maximum value from a sequence of values<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>Input sequence of values</td>
</tr>
<tr>
<td>xs:string</td>
<td>Collation to use when comparing strings</td>
</tr>
<tr>
<td>xs:anyAtomicType?</td>
<td>Maximum value in the input sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:max((10, 20, 30, 40, 50))</td>
<td>50</td>
</tr>
<tr>
<td>fn:max(("apple", "banana", "cherry"),
"http://www.w3.org/2005/xpath-functions/collation/codepoint")</td>
<td>"cherry"</td>
</tr>
<tr>
<td>fn:max(())</td>
<td>empty sequence</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-max" class="hyperlink" target="_blank">max</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:avg(xs:anyAtomicType*)</code></a>
<div class="content">
Computes the average of the numeric values in the input sequence<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>Input sequence of numeric values</td>
</tr>
<tr>
<td>xs:anyAtomicType?</td>
<td>Average of the numeric values in the input sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:avg((10, 20, 30, 40, 50))</td>
<td>30</td>
</tr>
<tr>
<td>fn:avg((2.5, 3.5, 4.5))</td>
<td>3.5</td>
</tr>
<tr>
<td>fn:avg(())</td>
<td>empty sequence</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-avg" class="hyperlink" target="_blank">avg</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:count(item()*)</code></a>
<div class="content">
Returns the number of items in the input sequence<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Input sequence</td>
</tr>
<tr>
<td>xs:integer</td>
<td>Number of items in the input sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:count(('apple', 'banana', 'orange'))</td>
<td>3</td>
</tr>
<tr>
<td>fn:count(())</td>
<td>0</td>
</tr>
<tr>
<td>fn:count((1, 2, 3, 4, 5))</td>
<td>5</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-count" class="hyperlink" target="_blank">count</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:exactly-one(item()*)</code></a>
<div class="content">
Returns the single item in the input sequence or raises an error if the sequence is
empty or contains more than one item<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Input sequence</td>
</tr>
<tr>
<td>item()</td>
<td>Single item from the input sequence, otherwise an error is raised</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:exactly-one(('apple'))</td>
<td>'apple'</td>
</tr>
<tr>
<td>fn:exactly-one(('apple', 'banana'))</td>
<td>Error (more than one item)</td>
</tr>
<tr>
<td>fn:exactly-one(())</td>
<td>Error (empty sequence)</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-exactly-one" class="hyperlink" target="_blank">exactly-one</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:one-or-more(item()*)+</code></a>
<div class="content">
Returns the input sequence if it contains one or more items, otherwise raises an
error<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Input sequence</td>
</tr>
<tr>
<td>item()+</td>
<td>Sequence containing one or more items, otherwise an error is raised</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:one-or-more(('apple', 'banana'))</td>
<td>('apple', 'banana')</td>
</tr>
<tr>
<td>fn:one-or-more(('pear'))</td>
<td>('pear')</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-one-or-more" class="hyperlink" target="_blank">one-or-more</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:zero-or-one(item()*)</code></a>
<div class="content">
Returns the input sequence if it contains zero or one items, otherwise raises an
error<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Input sequence</td>
</tr>
<tr>
<td>item()?</td>
<td>Sequence containing zero or one item, otherwise an error is raised</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:zero-or-one(('apple'))</td>
<td>('apple')</td>
</tr>
<tr>
<td>fn:zero-or-one(())</td>
<td>()</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-zero-or-one" class="hyperlink" target="_blank">zero-or-one</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:deep-equal(item()* , item()*)</code></a>
<div class="content">
Returns true if the two input sequences are deep-equal, meaning that they have the same
structure and atomic values<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>First input sequence</td>
</tr>
<tr>
<td>item()*</td>
<td>Second input sequence</td>
</tr>
<tr>
<td>xs:boolean</td>
<td>True if the input sequences are deep-equal, otherwise false</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:deep-equal((1, 2, 3), (1, 2, 3))</td>
<td>true</td>
</tr>
<tr>
<td>fn:deep-equal((1, 2, 3), (1, 2, 4))</td>
<td>false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-deep-equal" class="hyperlink" target="_blank">deep-equal</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:index-of(xs:anyAtomicType*, xs:anyAtomicType)</code></a>
<div class="content">
Returns a sequence of integers indicating the positions of items in the input sequence
that are equal to the search item<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>Input sequence of atomic values</td>
</tr>
<tr>
<td>xs:anyAtomicType</td>
<td>Search item to find in the input sequence</td>
</tr>
<tr>
<td>xs:integer*</td>
<td>Sequence of integers representing the positions of the search item in the
input sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:index-of((3, 1, 4, 1, 5, 9, 2, 2, 3), 1)</td>
<td>(2, 4)</td>
</tr>
<tr>
<td>fn:index-of(('apple', 'banana', 'orange', 'apple', 'grape', 'orange'),
'apple')</td>
<td>(1, 4)</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-index-of" class="hyperlink" target="_blank">index-of</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:distinct-values(xs:anyAtomicType*)</code></a>
<div class="content">
Returns a sequence of distinct atomic values from the input sequence<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>Input sequence of atomic values</td>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>Distinct sequence of atomic values</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:distinct-values((3, 1, 4, 1, 5, 9, 2, 2, 3))</td>
<td>(3, 1, 4, 5, 9, 2)</td>
</tr>
<tr>
<td>fn:distinct-values(('apple', 'banana', 'orange', 'apple', 'grape',
'orange'))</td>
<td>('apple', 'banana', 'orange', 'grape')</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-distinct-values" class="hyperlink" target="_blank">distinct-values</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:unordered(item()*)</code></a>
<div class="content">
Returns the items of a sequence in an implementation-dependent order<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Input sequence</td>
</tr>
<tr>
<td>item()*</td>
<td>Unordered sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:unordered((3, 1, 4, 1, 5, 9, 2))</td>
<td>(1, 2, 3, 4, 5, 9, 1) (example result; actual order may vary)</td>
</tr>
<tr>
<td>fn:unordered(('apple', 'banana', 'orange', 'grape'))</td>
<td>('banana', 'apple', 'orange', 'grape') (example result; actual order may
vary)</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-unordered" class="hyperlink" target="_blank">unordered</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:subsequence(item()*, xs:double, xs:double)</code></a>
<div class="content">
Returns a subsequence of a given sequence starting at a specified position with a
specified length<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Input sequence</td>
</tr>
<tr>
<td>xs:double</td>
<td>Starting position</td>
</tr>
<tr>
<td>xs:double</td>
<td>Length of subsequence</td>
</tr>
<tr>
<td>item()*</td>
<td>Subsequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:subsequence((1, 2, 3, 4, 5), 2, 3)</td>
<td>(2, 3, 4)</td>
</tr>
<tr>
<td>fn:subsequence(('apple', 'banana', 'orange', 'grape'), 1, 2)</td>
<td>('apple', 'banana')</td>
</tr>
<tr>
<td>fn:subsequence(('red', 'blue', 'green', 'yellow'), 3)</td>
<td>('green', 'yellow')</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-subsequence" class="hyperlink" target="_blank">subsequence</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:reverse(item()*)</code></a>
<div class="content">
Reverses the order of items in a sequence<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Input sequence</td>
</tr>
<tr>
<td>item()*</td>
<td>Reversed sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:reverse((1, 2, 3, 4))</td>
<td>(4, 3, 2, 1)</td>
</tr>
<tr>
<td>fn:reverse(('apple', 'banana', 'orange'))</td>
<td>('orange', 'banana', 'apple')</td>
</tr>
<tr>
<td>fn:reverse(('red', 'blue', 'green'))</td>
<td>('green', 'blue', 'red')</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-reverse" class="hyperlink" target="_blank">reverse</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:remove(item()*, xs:integer)</code></a>
<div class="content">
Removes an item from a sequence at the specified position<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Target sequence</td>
</tr>
<tr>
<td>xs:integer</td>
<td>Position of the item to remove</td>
</tr>
<tr>
<td>item()*</td>
<td>New sequence with the item removed</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:remove((1, 2, 3, 4), 2)</td>
<td>(1, 3, 4)</td>
</tr>
<tr>
<td>fn:remove(('apple', 'banana', 'orange'), 3)</td>
<td>('apple', 'banana')</td>
</tr>
<tr>
<td>fn:remove((10, 20, 30), 1)</td>
<td>(20, 30)</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-remove" class="hyperlink" target="_blank">remove</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:insert-before(item()*, xs:integer, item()*)</code></a>
<div class="content">
Inserts items from the specified sequence into another sequence at a given position<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Target sequence</td>
</tr>
<tr>
<td>xs:integer</td>
<td>Position at which to insert the items</td>
</tr>
<tr>
<td>item()*</td>
<td>Sequence of items to insert</td>
</tr>
<tr>
<td>item()*</td>
<td>New sequence with items inserted</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:insert-before((1, 3, 4), 2, (2))</td>
<td>(1, 2, 3, 4)</td>
</tr>
<tr>
<td>fn:insert-before(('apple', 'orange'), 1, ('banana'))</td>
<td>('banana', 'apple', 'orange')</td>
</tr>
<tr>
<td>fn:insert-before((10, 20, 30), 4, (40))</td>
<td>(10, 20, 30, 40)</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-insert-before" class="hyperlink" target="_blank">insert-before</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:tail(item()*)</code></a>
<div class="content">
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<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Sequence of items</td>
</tr>
<tr>
<td>item()*</td>
<td>All items except the first one, or an empty sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:tail((1, 2, 3))</td>
<td>(2, 3)</td>
</tr>
<tr>
<td>fn:tail((1))</td>
<td>()</td>
</tr>
<tr>
<td>fn:tail(/books/book/author)</td>
<td>All authors in the "books" element except the first one</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-tail" class="hyperlink" target="_blank">tail</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:head(item()*)</code></a>
<div class="content">
Returns the first item of the input sequence, or an empty sequence if the input is
empty<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Sequence of items</td>
</tr>
<tr>
<td>item()?</td>
<td>The first item of the sequence, or an empty sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:head((1, 2, 3))</td>
<td>1</td>
</tr>
<tr>
<td>fn:head(())</td>
<td>()</td>
</tr>
<tr>
<td>fn:head(/books/book[1]/author)</td>
<td>The first author of the first book in the "books" element</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-head" class="hyperlink" target="_blank">head</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:exists(item()*)</code></a>
<div class="content">
Returns true if the input sequence is not empty, otherwise returns false<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Sequence of items</td>
</tr>
<tr>
<td>xs:boolean</td>
<td>Result of the test (true or false)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:exists((1, 2, 3))</td>
<td>true</td>
</tr>
<tr>
<td>fn:exists(())</td>
<td>false</td>
</tr>
<tr>
<td>fn:exists(//chapter[5])</td>
<td>true if there are at least 5 chapters, otherwise false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-exists" class="hyperlink" target="_blank">exists</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:empty(item()*)</code></a>
<div class="content">
Returns true if the input sequence is empty, otherwise returns false<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Sequence of items</td>
</tr>
<tr>
<td>xs:boolean</td>
<td>Result of the test (true or false)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:empty((1, 2, 3))</td>
<td>false</td>
</tr>
<tr>
<td>fn:empty(())</td>
<td>true</td>
</tr>
<tr>
<td>fn:empty(//chapter[100])</td>
<td>true if there are less than 100 chapters, otherwise false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-empty" class="hyperlink" target="_blank">empty</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:data(item*)</code></a>
<div class="content">
Returns the simple value of an item or a sequence of items <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item?</td>
<td>Returns the simple value of the specified item or the context item (if no
argument is provided)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:data(/library/fiction:book[1]/title)</td>
<td>The Catcher in the Rye</td>
</tr>
<tr>
<td>fn:data(/library/fiction:book[2]/author)</td>
<td>Harper Lee</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-data" class="hyperlink" target="_blank">Data</a></code>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Date / Time</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:implicit-timezone()</code></a>
<div class="content">
Returns the implicit timezone as an xs:dayTimeDuration<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Function takes no arguments</td>
</tr>
<tr>
<td>xs:dayTimeDuration</td>
<td>The implicit timezone as a dayTimeDuration</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>implicit-timezone()</td>
<td>Returns the implicit timezone as an xs:dayTimeDuration, e.g., '-PT7H'
</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-implicit-timezone" class="hyperlink" target="_blank">implicit-timezone</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:current-time()</code></a>
<div class="content">
Returns the current time with timezone<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Function takes no arguments</td>
</tr>
<tr>
<td>xs:time</td>
<td>The current time with timezone</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>current-time()</td>
<td>Returns the current time with timezone, e.g., '13:45:30.123-07:00'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-current-time" class="hyperlink" target="_blank">current-time</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:current-date()</code></a>
<div class="content">
Returns the current date with timezone<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Function takes no arguments</td>
</tr>
<tr>
<td>xs:date</td>
<td>The current date with timezone</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>current-date()</td>
<td>Returns the current date with timezone, e.g., '2023-03-29-07:00'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-current-date" class="hyperlink" target="_blank">current-date</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:current-dateTime()</code></a>
<div class="content">
Returns the current date and time with timezone<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Function takes no arguments</td>
</tr>
<tr>
<td>xs:dateTime</td>
<td>The current date and time with timezone</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>current-dateTime()</td>
<td>Returns the current date and time with timezone, e.g.,
'2023-03-29T12:34:56.789-07:00'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-current-dateTime" class="hyperlink" target="_blank">current-dateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:format-time(xs:time?, xs:string, xs:string?, xs:string?, xs:string?)</code></a>
<div class="content">
Formats a time value using the provided picture string and optional language,
calendar, and country settings<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:time?</td>
<td>Time value</td>
</tr>
<tr>
<td>xs:string</td>
<td>Picture string</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Language</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Calendar</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Country</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:format-time(xs:time('14:30:15'), '[H01]:[m01]:[s01]')</td>
<td>14:30:15</td>
</tr>
<tr>
<td>fn:format-time(xs:time('14:30:15'), '[h01] [P] [ZN,*-3]')</td>
<td>02 PM UTC</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-format-time" class="hyperlink" target="_blank">Format-Time</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:format-date(xs:date?, xs:string, xs:string?, xs:string?, xs:string?)</code></a>
<div class="content">
Formats a date value using the provided picture string and optional language,
calendar, and country settings<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:date?</td>
<td>Date value</td>
</tr>
<tr>
<td>xs:string</td>
<td>Picture string</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Language</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Calendar</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Country</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:format-date(xs:date('2023-04-01'), '[Y0001]-[M01]-[D01]')</td>
<td>2023-04-01</td>
</tr>
<tr>
<td>fn:format-date(xs:date('2023-04-01'), '[MNn,*-3] [D], [Y]')</td>
<td>Apr 1, 2023</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-format-date" class="hyperlink" target="_blank">Format-Date</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:format-dateTime(xs:dateTime?, xs:string, xs:string?, xs:string?, xs:string?)</code></a>
<div class="content">
Formats a dateTime value using the provided picture string and optional language,
calendar, and country settings<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>DateTime value</td>
</tr>
<tr>
<td>xs:string</td>
<td>Picture string</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Language</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Calendar</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Country</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:format-dateTime(xs:dateTime('2023-04-01T12:00:00'),
'[Y0001]-[M01]-[D01] [H01]:[m01]:[s01]')</td>
<td>2023-04-01 12:00:00</td>
</tr>
<tr>
<td>fn:format-dateTime(xs:dateTime('2023-04-01T12:00:00'), '[MNn,*-3], [D],
[Y]')</td>
<td>Apr, 1, 2023</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-format-dateTime" class="hyperlink" target="_blank">Format-DateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:adjust-time-to-timezone(xs:time?, xs:dayTimeDuration?)</code></a>
<div class="content">
Adjusts the timezone of a time value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:time?</td>
<td>Time value</td>
</tr>
<tr>
<td>xs:dayTimeDuration?</td>
<td>Timezone adjustment</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:adjust-time-to-timezone(xs:time('10:00:00-07:00'),
xs:dayTimeDuration('PT2H'))</td>
<td>12:00:00-05:00</td>
</tr>
<tr>
<td>fn:adjust-time-to-timezone(xs:time('10:00:00Z'),
xs:dayTimeDuration('-PT3H'))</td>
<td>07:00:00-03:00</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-adjust-time-to-timezone" class="hyperlink" target="_blank">Adjust-Time-To-Timezone</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:adjust-date-to-timezone(xs:date?, xs:dayTimeDuration?)</code></a>
<div class="content">
Adjusts the timezone of a date value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:date?</td>
<td>Date value</td>
</tr>
<tr>
<td>xs:dayTimeDuration?</td>
<td>Timezone adjustment</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:adjust-date-to-timezone(xs:date('2023-01-01-07:00'),
xs:dayTimeDuration('PT2H'))</td>
<td>2023-01-01-05:00</td>
</tr>
<tr>
<td>fn:adjust-date-to-timezone(xs:date('2023-01-01Z'),
xs:dayTimeDuration('-PT3H'))</td>
<td>2022-12-31-03:00</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-adjust-date-to-timezone" class="hyperlink" target="_blank">Adjust-Date-To-Timezone</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:adjust-dateTime-to-timezone(xs:dateTime?, xs:dayTimeDuration?)</code></a>
<div class="content">
Adjusts the timezone of a dateTime value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>DateTime value</td>
</tr>
<tr>
<td>xs:dayTimeDuration?</td>
<td>Timezone adjustment</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:adjust-dateTime-to-timezone(xs:dateTime('2023-01-01T12:00:00-07:00'),
xs:dayTimeDuration('PT2H'))</td>
<td>2023-01-01T17:00:00-05:00</td>
</tr>
<tr>
<td>fn:adjust-dateTime-to-timezone(xs:dateTime('2023-01-01T12:00:00Z'),
xs:dayTimeDuration('-PT3H'))</td>
<td>2023-01-01T09:00:00-03:00</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-adjust-dateTime-to-timezone" class="hyperlink" target="_blank">Adjust-DateTime-To-Timezone</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:timezone-from-time(xs:time?)</code></a>
<div class="content">
Extracts the timezone component from an xs:time value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:time?</td>
<td>Time value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:timezone-from-time(xs:time('12:00:00-07:00'))</td>
<td>-PT7H</td>
</tr>
<tr>
<td>fn:timezone-from-time(xs:time('14:30:00+02:30'))</td>
<td>PT2H30M</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-timezone-from-time" class="hyperlink" target="_blank">Timezone-From-Time</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:seconds-from-time(xs:time?)</code></a>
<div class="content">
Extracts the seconds component from an xs:time value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:time?</td>
<td>Time value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:seconds-from-time(xs:time('21:45:30.5'))</td>
<td>30.5</td>
</tr>
<tr>
<td>fn:seconds-from-time(xs:time('04:15:12.1'))</td>
<td>12.1</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-seconds-from-time" class="hyperlink" target="_blank">Seconds-From-Time</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:minutes-from-time(xs:time?)</code></a>
<div class="content">
Extracts the minutes component from an xs:time value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:time?</td>
<td>Time value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:minutes-from-time(xs:time('21:45:30'))</td>
<td>45</td>
</tr>
<tr>
<td>fn:minutes-from-time(xs:time('04:15:12'))</td>
<td>15</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-minutes-from-time" class="hyperlink" target="_blank">Minutes-From-Time</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:hours-from-time(xs:time?)</code></a>
<div class="content">
Extracts the hours component from an xs:time value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:time?</td>
<td>Time value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:hours-from-time(xs:time('21:45:30'))</td>
<td>21</td>
</tr>
<tr>
<td>fn:hours-from-time(xs:time('04:15:12'))</td>
<td>4</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-hours-from-time" class="hyperlink" target="_blank">Hours-From-Time</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:timezone-from-date(xs:date?)</code></a>
<div class="content">
Extracts the timezone component from an xs:date value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:date?</td>
<td>Date value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:timezone-from-date(xs:date('2023-03-29+02:00'))</td>
<td>PT2H</td>
</tr>
<tr>
<td>fn:timezone-from-date(xs:date('1980-12-15-05:00'))</td>
<td>-PT5H</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-timezone-from-date" class="hyperlink" target="_blank">Timezone-From-Date</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:day-from-date(xs:date?)</code></a>
<div class="content">
Extracts the day component from an xs:date value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:date?</td>
<td>Date value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:day-from-date(xs:date('2023-03-29'))</td>
<td>29</td>
</tr>
<tr>
<td>fn:day-from-date(xs:date('1980-12-15'))</td>
<td>15</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-day-from-date" class="hyperlink" target="_blank">Day-From-Date</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:month-from-date(xs:date?)</code></a>
<div class="content">
Extracts the month component from an xs:date value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:date?</td>
<td>Date value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:month-from-date(xs:date('2023-03-29'))</td>
<td>3</td>
</tr>
<tr>
<td>fn:month-from-date(xs:date('1980-12-15'))</td>
<td>12</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-month-from-date" class="hyperlink" target="_blank">Month-From-Date</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:year-from-date(xs:date?)</code></a>
<div class="content">
Extracts the year component from an xs:date value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:date?</td>
<td>Date value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:year-from-date(xs:date('2023-03-29'))</td>
<td>2023</td>
</tr>
<tr>
<td>fn:year-from-date(xs:date('1980-12-15'))</td>
<td>1980</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-year-from-date" class="hyperlink" target="_blank">Year-From-Date</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:timezone-from-dateTime(xs:dateTime?)</code></a>
<div class="content">
Extracts the timezone component from an xs:dateTime value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>DateTime value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:timezone-from-dateTime(xs:dateTime('2023-03-29T12:30:45-07:00'))</td>
<td>-PT7H</td>
</tr>
<tr>
<td>fn:timezone-from-dateTime(xs:dateTime('2023-12-15T18:45:30+03:30'))</td>
<td>PT3H30M</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-timezone-from-dateTime" class="hyperlink" target="_blank">Timezone-From-DateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:seconds-from-dateTime(xs:dateTime?)</code></a>
<div class="content">
Extracts the seconds component from an xs:dateTime value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>DateTime value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:seconds-from-dateTime(xs:dateTime('2023-03-29T12:30:45'))</td>
<td>45</td>
</tr>
<tr>
<td>fn:seconds-from-dateTime(xs:dateTime('2023-12-15T18:45:30.5-08:00'))
</td>
<td>30.5</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-seconds-from-dateTime" class="hyperlink" target="_blank">Seconds-From-DateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:minutes-from-dateTime(xs:dateTime?)</code></a>
<div class="content">
Extracts the minutes component from an xs:dateTime value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>DateTime value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:minutes-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))</td>
<td>30</td>
</tr>
<tr>
<td>fn:minutes-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))</td>
<td>45</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-minutes-from-dateTime" class="hyperlink" target="_blank">Minutes-From-DateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:hours-from-dateTime(xs:dateTime?)</code></a>
<div class="content">
Extracts the hours component from an xs:dateTime value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>DateTime value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:hours-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))</td>
<td>12</td>
</tr>
<tr>
<td>fn:hours-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))</td>
<td>18</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-hours-from-dateTime" class="hyperlink" target="_blank">Hours-From-DateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:day-from-dateTime(xs:dateTime?)</code></a>
<div class="content">
Extracts the day component from an xs:dateTime value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>DateTime value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:day-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))</td>
<td>29</td>
</tr>
<tr>
<td>fn:day-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))</td>
<td>15</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-day-from-dateTime" class="hyperlink" target="_blank">Day-From-DateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:month-from-dateTime(xs:dateTime?)</code></a>
<div class="content">
Extracts the month component from an xs:dateTime value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>DateTime value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:month-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))</td>
<td>3</td>
</tr>
<tr>
<td>fn:month-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))</td>
<td>12</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-month-from-dateTime" class="hyperlink" target="_blank">Month-From-DateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:year-from-dateTime(xs:dateTime?)</code></a>
<div class="content">
Extracts the year component from an xs:dateTime value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>DateTime value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:year-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))</td>
<td>2023</td>
</tr>
<tr>
<td>fn:year-from-dateTime(xs:dateTime('2023-03-29T12:30:00-08:00'))</td>
<td>2023</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-year-from-dateTime" class="hyperlink" target="_blank">Year-From-DateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:dateTime(xs:date?, xs:time?)</code></a>
<div class="content">
Constructs an xs:dateTime value from an xs:date and an xs:time value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:date?</td>
<td>Date value</td>
</tr>
<tr>
<td>xs:time?</td>
<td>Time value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:dateTime(xs:date('2023-03-29'), xs:time('12:30:00'))</td>
<td>2023-03-29T12:30:00</td>
</tr>
<tr>
<td>fn:dateTime(xs:date('2023-03-29+05:00'), xs:time('12:30:00-08:00'))</td>
<td>2023-03-29T12:30:00-08:00</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-dateTime" class="hyperlink" target="_blank">DateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:seconds-from-duration(xs:duration?)</code></a>
<div class="content">
Returns the seconds component of the duration <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:duration?</td>
<td>Duration from which to extract the seconds component</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:seconds-from-duration(xs:dayTimeDuration('PT1H30M15.5S'))</td>
<td>15.5</td>
</tr>
<tr>
<td>fn:seconds-from-duration(xs:dayTimeDuration('-PT2M10.3S'))</td>
<td>-10.3</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-seconds-from-duration" class="hyperlink" target="_blank">Seconds-From-Duration</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:minutes-from-duration(xs:duration?)</code></a>
<div class="content">
Returns the minutes component of the duration <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:duration?</td>
<td>Duration from which to extract the minutes component</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:minutes-from-duration(xs:dayTimeDuration('PT2H30M'))</td>
<td>30</td>
</tr>
<tr>
<td>fn:minutes-from-duration(xs:dayTimeDuration('-PT1H45M'))</td>
<td>-45</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-minutes-from-duration" class="hyperlink" target="_blank">Minutes-From-Duration</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:hours-from-duration(xs:duration?)</code></a>
<div class="content">
Returns the hours component of the duration <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:duration?</td>
<td>Duration from which to extract the hours component</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:hours-from-duration(xs:dayTimeDuration('PT36H'))</td>
<td>36</td>
</tr>
<tr>
<td>fn:hours-from-duration(xs:dayTimeDuration('-PT12H30M'))</td>
<td>-12</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-hours-from-duration" class="hyperlink" target="_blank">Hours-From-Duration</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:days-from-duration(xs:duration?)</code></a>
<div class="content">
Returns the days component of the duration <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:duration?</td>
<td>Duration from which to extract the days component</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:days-from-duration(xs:dayTimeDuration('P5DT12H30M'))</td>
<td>5</td>
</tr>
<tr>
<td>fn:days-from-duration(xs:dayTimeDuration('-P2DT6H'))</td>
<td>-2</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-days-from-duration" class="hyperlink" target="_blank">Days-From-Duration</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:months-from-duration(xs:duration?)</code></a>
<div class="content">
Returns the months component of the duration <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:duration?</td>
<td>Duration from which to extract the months component</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:months-from-duration(xs:duration('P2Y3M4DT5H6M7S'))</td>
<td>3</td>
</tr>
<tr>
<td>fn:months-from-duration(xs:duration('-P2Y3M4DT5H6M7S'))</td>
<td>-3</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-months-from-duration" class="hyperlink" target="_blank">Months-From-Duration</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:years-from-duration(xs:duration?)</code></a>
<div class="content">
Returns the years component of the duration <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:duration?</td>
<td>Duration from which to extract the years component</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:years-from-duration(xs:duration('P2Y3M4DT5H6M7S'))</td>
<td>2</td>
</tr>
<tr>
<td>fn:years-from-duration(xs:duration('-P2Y3M4DT5H6M7S'))</td>
<td>-2</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-years-from-duration" class="hyperlink" target="_blank">Years-From-Duration</a></code>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Error</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:trace(item()*, xs:string)</code></a>
<div class="content">
Outputs the provided label and value for diagnostic purposes and returns the value
unchanged <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Value to be traced</td>
</tr>
<tr>
<td>xs:string</td>
<td>Label to be output along with the value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:trace(42, 'The value is:')</td>
<td>Outputs "The value is: 42" for diagnostic purposes and returns 42</td>
</tr>
<tr>
<td>fn:trace(/library/book/title, 'Book title:')</td>
<td>Outputs "Book title: [book title]" for diagnostic purposes and returns
the book title</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-trace" class="hyperlink" target="_blank">Trace</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:error(xs:QName?, xs:string?, $error-object)</code></a>
<div class="content">
Raises an error with the specified error code, description, and error object <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:QName?</td>
<td>Error code (optional)</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Description of the error (optional)</td>
</tr>
<tr>
<td>item()*</td>
<td>Error object (optional)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:error(xs:QName('err:FOER0000'))</td>
<td>Raise error with the code err:FOER0000</td>
</tr>
<tr>
<td>fn:error(xs:QName('err:FOER0000'), 'Invalid value')</td>
<td>Raise error with the code err:FOER0000 and description "Invalid value"
</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-error" class="hyperlink" target="_blank">Error</a></code>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Misc</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:function-arity(function(*))</code></a>
<div class="content">
Returns the arity (number of arguments) of the specified function<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>function(*)</td>
<td>The function to obtain the arity for</td>
</tr>
<tr>
<td>xs:integer</td>
<td>The arity (number of arguments) of the specified function</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>function-arity(fn:substring)</td>
<td>Returns the arity of the substring function: <code>2</code> (since
substring accepts two required arguments: the input string and the
starting index)</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-function-arity" class="hyperlink" target="_blank">function-arity</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:function-name(function(*))</code></a>
<div class="content">
Returns the QName of the specified function<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>function(*)</td>
<td>The function to obtain the QName for</td>
</tr>
<tr>
<td>xs:QName?</td>
<td>The QName of the specified function, or an empty sequence if the
function is anonymous</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>function-name(fn:substring)</td>
<td>Returns the QName of the substring function:
<code>QName("http://www.w3.org/2005/xpath-functions", "substring")</code>
</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-function-name" class="hyperlink" target="_blank">function-name</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:function-lookup(xs:QName, xs:integer)</code></a>
<div class="content">
Returns a function with the specified QName and arity if available, otherwise
returns an empty sequence<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:QName</td>
<td>Function name as QName</td>
</tr>
<tr>
<td>xs:integer</td>
<td>Arity of the function</td>
</tr>
<tr>
<td>function(*)?</td>
<td>A function with the specified QName and arity if available, otherwise an
empty sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>function-lookup(QName('http://www.w3.org/2005/xpath-functions',
'substring'), 2)</td>
<td>Returns the substring function with arity 2, if available</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-function-lookup" class="hyperlink" target="_blank">function-lookup</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:static-base-uri()</code></a>
<div class="content">
Returns the static base URI as an xs:anyURI, if available<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Function takes no arguments</td>
</tr>
<tr>
<td>xs:anyURI?</td>
<td>The static base URI, if available; otherwise, an empty sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>static-base-uri()</td>
<td>Returns the static base URI as an xs:anyURI, if available, e.g.,
'https://www.example.com/base/'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-static-base-uri" class="hyperlink" target="_blank">static-base-uri</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:default-collation()</code></a>
<div class="content">
Returns the default collation URI as an xs:string<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Function takes no arguments</td>
</tr>
<tr>
<td>xs:string</td>
<td>The default collation URI as a string</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>default-collation()</td>
<td>Returns the default collation URI as an xs:string, e.g.,
'http://www.w3.org/2005/xpath-functions/collation/codepoint'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-default-collation" class="hyperlink" target="_blank">default-collation</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:serialize(item()?, item()?)</code></a>
<div class="content">
Serializes an XML node, producing a string representation of the node<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()?</td>
<td>An XML node to serialize</td>
</tr>
<tr>
<td>item()?</td>
<td>Serialization options as a map, with key-value pairs defining the
serialization parameters (optional)</td>
</tr>
<tr>
<td>xs:string?</td>
<td>A string representation of the serialized XML node or an empty sequence
if the input is an empty sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:serialize(&lt;item>Item 1&lt;/item>)</td>
<td>Returns '&lt;item>Item 1&lt;/item>'</td>
</tr>
<tr>
<td>fn:serialize(&lt;item>Item 1&lt;/item>, map{'method': 'xml', 'indent':
'yes'})</td>
<td>Returns an indented XML string representation of the input node</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-serialize" class="hyperlink" target="_blank">serialize</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:parse-xml-fragment(xs:string?)</code></a>
<div class="content">
Parses a string containing an XML fragment and returns a corresponding document
node<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>A string containing an XML fragment</td>
</tr>
<tr>
<td>document-node(element(*))?</td>
<td>A document node containing the parsed XML fragment or an empty sequence
if the input is an empty sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:parse-xml-fragment('&lt;item>Item 1&lt;/item>&lt;item>Item
2&lt;/item>')</td>
<td>Returns a document node containing the parsed XML fragment</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-parse-xml-fragment" class="hyperlink" target="_blank">parse-xml-fragment</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:parse-xml(xs:string?)</code></a>
<div class="content">
Parses a string containing an XML document and returns a corresponding document
node<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>A string containing an XML document</td>
</tr>
<tr>
<td>document-node(element(*))?</td>
<td>A document node containing the parsed XML content or an empty sequence
if the input is an empty sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:parse-xml('&lt;root>&lt;item>Item 1&lt;/item>&lt;/root>')</td>
<td>Returns a document node containing the parsed XML content</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-parse-xml" class="hyperlink" target="_blank">parse-xml</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:available-environment-variables()</code></a>
<div class="content">
Retrieves a sequence of the names of all available environment variables<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>No argument is required</td>
</tr>
<tr>
<td>xs:string*</td>
<td>A sequence of the names of all available environment variables</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:available-environment-variables()</td>
<td>Returns a sequence of the names of all available environment variables
</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-available-environment-variables" class="hyperlink" target="_blank">available-environment-variables</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:environment-variable(xs:string)</code></a>
<div class="content">
Retrieves the value of an environment variable<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string</td>
<td>The name of the environment variable</td>
</tr>
<tr>
<td>xs:string?</td>
<td>The value of the environment variable, or an empty sequence if the
variable is not set</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:environment-variable("PATH")</td>
<td>Returns the value of the PATH environment variable, or an empty sequence
if the variable is not set</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-environment-variable" class="hyperlink" target="_blank">environment-variable</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:uri-collection(xs:string?)</code></a>
<div class="content">
Returns a sequence of URIs in a collection identified by a URI<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>The URI identifying the collection of URIs</td>
</tr>
<tr>
<td>xs:anyURI*</td>
<td>A sequence of URIs in the collection</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:uri-collection("http://www.example.com/collection/")</td>
<td>Returns a sequence of URIs in the collection identified by the specified
URI
</td>
</tr>
<tr>
<td>fn:uri-collection()</td>
<td>Returns a sequence of URIs in the default collection, if one is defined
</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-uri-collection" class="hyperlink" target="_blank">uri-collection</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:doc-available(xs:string?)</code></a>
<div class="content">
Tests whether an XML document is available at a given URI<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>The URI of the XML document to be tested</td>
</tr>
<tr>
<td>xs:boolean</td>
<td>True if the XML document is available, otherwise false</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:doc-available("http://www.example.com/books.xml")</td>
<td>Returns true if the XML document located at the specified URI is
available, otherwise false</td>
</tr>
<tr>
<td>fn:doc-available("")</td>
<td>Returns true if the XML document containing the context item is
available, otherwise false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-doc-available" class="hyperlink" target="_blank">doc-available</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:doc(xs:string?)</code></a>
<div class="content">
Loads an XML document from a URI and returns the document node<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>The URI of the XML document to be loaded</td>
</tr>
<tr>
<td>document-node()?</td>
<td>The document node of the loaded XML document</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:doc("http://www.example.com/books.xml")</td>
<td>Loads the XML document located at the specified URI and returns its
document node</td>
</tr>
<tr>
<td>fn:doc("")</td>
<td>Returns the document node of the XML document containing the context
item</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-doc" class="hyperlink" target="_blank">doc</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:generate-id(node()?)</code></a>
<div class="content">
Returns a unique identifier for the specified node<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()?</td>
<td>Input node for which the unique identifier is to be generated</td>
</tr>
<tr>
<td>xs:string</td>
<td>Unique identifier for the specified node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:generate-id(/bookstore/book[1])</td>
<td>A unique identifier for the first &lt;book&gt; element in the
&lt;bookstore&gt;</td>
</tr>
<tr>
<td>fn:generate-id(.)</td>
<td>A unique identifier for the context node</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-generate-id" class="hyperlink" target="_blank">generate-id</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:idref(xs:string*)</code></a>
<div class="content">
Returns a sequence of nodes that are referenced by the specified IDREF attribute
values<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string*</td>
<td>Input sequence of IDREF attribute values</td>
</tr>
<tr>
<td>node()*</td>
<td>Sequence of nodes referenced by the specified IDREF attribute values
</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:idref("reference42")</td>
<td>Nodes referenced by the IDREF attribute value "reference42"</td>
</tr>
<tr>
<td>fn:idref(("ref1", "ref2", "ref3"))</td>
<td>Nodes referenced by the IDREF attribute values "ref1", "ref2", and
"ref3"</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-idref" class="hyperlink" target="_blank">idref</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:id(xs:string*)</code></a>
<div class="content">
Returns a sequence of elements with the specified ID attribute values<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string*</td>
<td>Input sequence of ID attribute values</td>
</tr>
<tr>
<td>element()*</td>
<td>Sequence of elements with the specified ID attribute values</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:id("item42")</td>
<td>Element with the ID attribute value "item42"</td>
</tr>
<tr>
<td>fn:id(("item1", "item2", "item3"))</td>
<td>Elements with the ID attribute values "item1", "item2", and "item3"</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-id" class="hyperlink" target="_blank">id</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:lang(xs:string, node()?)</code></a>
<div class="content">
Returns true if the language of the specified node or its nearest ancestor matches
the given language code<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string</td>
<td>Language code to test</td>
</tr>
<tr>
<td>node()?</td>
<td>Optional node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:lang("en", /book/title)</td>
<td>true</td>
</tr>
<tr>
<td>fn:lang("fr", /book/title)</td>
<td>false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-lang" class="hyperlink" target="_blank">lang</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:in-scope-prefixes(element())</code></a>
<div class="content">
Returns a sequence of strings representing the prefixes of the in-scope namespaces
for the specified element<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>element()</td>
<td>Element node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:in-scope-prefixes(/*)</td>
<td>("xml", "x")</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-in-scope-prefixes" class="hyperlink" target="_blank">in-scope-prefixes</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:namespace-uri-for-prefix(xs:string?, element())</code></a>
<div class="content">
Returns the namespace URI associated with the given prefix, using the in-scope
namespaces for the specified element<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Prefix</td>
</tr>
<tr>
<td>element()</td>
<td>Element node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:namespace-uri-for-prefix('x', /*)</td>
<td>"http://www.example.com/ns"</td>
</tr>
<tr>
<td>fn:namespace-uri-for-prefix('', /*)</td>
<td>""</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-namespace-uri-for-prefix" class="hyperlink" target="_blank">namespace-uri-for-prefix</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:namespace-uri-from-QName(xs:QName?)</code></a>
<div class="content">
Returns the namespace URI of the given QName value, or an empty sequence if there's
no namespace URI<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:QName?</td>
<td>QName value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:namespace-uri-from-QName(fn:QName('http://www.example.com/ns',
'x:local'))</td>
<td>"http://www.example.com/ns"</td>
</tr>
<tr>
<td>fn:namespace-uri-from-QName(fn:QName('', 'local'))</td>
<td>""</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-namespace-uri-from-QName" class="hyperlink" target="_blank">namespace-uri-from-QName</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:local-name-from-QName(xs:QName?)</code></a>
<div class="content">
Returns the local name of the given QName value, or an empty sequence if there's no
local name<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:QName?</td>
<td>QName value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:local-name-from-QName(fn:QName('http://www.example.com/ns',
'x:local'))</td>
<td>"local"</td>
</tr>
<tr>
<td>fn:local-name-from-QName(fn:QName('', 'local'))</td>
<td>"local"</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-local-name-from-QName" class="hyperlink" target="_blank">local-name-from-QName</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:prefix-from-QName(xs:QName?)</code></a>
<div class="content">
Returns the prefix of the given QName value, or an empty sequence if there's no
prefix<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:QName?</td>
<td>QName value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:prefix-from-QName(fn:QName('http://www.example.com/ns', 'x:local'))
</td>
<td>"x"</td>
</tr>
<tr>
<td>fn:prefix-from-QName(fn:QName('', 'local'))</td>
<td>()</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-prefix-from-QName" class="hyperlink" target="_blank">prefix-from-QName</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:QName(xs:string?, xs:string)</code></a>
<div class="content">
Constructs an xs:QName value from a namespace URI and a lexical QName<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Namespace URI</td>
</tr>
<tr>
<td>xs:string</td>
<td>Lexical QName</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:QName('http://www.example.com/ns', 'x:local')</td>
<td>QName("http://www.example.com/ns", "x:local")</td>
</tr>
<tr>
<td>fn:QName('', 'local')</td>
<td>QName("", "local")</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-QName" class="hyperlink" target="_blank">QName</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:resolve-QName(xs:string?, element())</code></a>
<div class="content">
Resolves a QName by expanding a prefix using the in-scope namespaces of a given
element<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>QName to resolve</td>
</tr>
<tr>
<td>element()</td>
<td>Element with in-scope namespaces</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:resolve-QName('x:local', $element)</td>
<td>QName("http://www.example.com/ns", "local")</td>
</tr>
<tr>
<td>fn:resolve-QName('local', $element)</td>
<td>QName("", "local")</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-resolve-QName" class="hyperlink" target="_blank">Resolve-QName</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:nilled(node)</code></a>
<div class="content">
Returns a Boolean value indicating whether the argument node is nilled <br>
<br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions/#func-nilled" class="hyperlink" target="_blank">#func-nilled</code></a>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Loop /
Conditional</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:for-each-pair(item()*, item()*, function(item(), item()))</code></a>
<div class="content">
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<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>The first input sequence of items</td>
</tr>
<tr>
<td>item()*</td>
<td>The second input sequence of items</td>
</tr>
<tr>
<td>function(item(), item())</td>
<td>The processing function used to process pairs of items from the input
sequences</td>
</tr>
<tr>
<td>item()*</td>
<td>The resulting sequence after applying the processing function to pairs
of items</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>for-each-pair((1, 2, 3), ("a", "b"), function($item1, $item2) {
concat($item1, $item2) })</td>
<td>Returns a sequence with the concatenated pairs of items:
<code>("1a", "2b")</code>
</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-for-each-pair" class="hyperlink" target="_blank">for-each-pair</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:filter(item()*, function(item())</code></a>
<div class="content">
Filters a sequence of items based on a given predicate function<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>The input sequence of items</td>
</tr>
<tr>
<td>function(item())</td>
<td>The predicate function used to filter the items</td>
</tr>
<tr>
<td>item()*</td>
<td>The resulting sequence after applying the predicate function</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>filter((1, 2, 3, 4), function($x) { $x mod 2 = 0 })</td>
<td>Returns a new sequence containing only the even numbers from the input
sequence: <code>(2, 4)</code></td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-filter" class="hyperlink" target="_blank">filter</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:for-each(item()*, function(item()))</code></a>
<div class="content">
Applies a specified function to each item in a sequence, returning a new
sequence<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>The input sequence of items</td>
</tr>
<tr>
<td>function(item())</td>
<td>The function to apply to each item in the sequence</td>
</tr>
<tr>
<td>item()*</td>
<td>The new sequence created by applying the function to each item in the
input sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>for-each((1, 2, 3, 4), function($x) { $x * 2 })</td>
<td>Returns a new sequence with the result of doubling each number in the
input sequence: <code>(2, 4, 6, 8)</code></td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-for-each" class="hyperlink" target="_blank">for-each</a></code>
</div>
</div>
</div>
</span>
<span name="collapse31">
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Node-Set</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:apply(function(item()*), array(*))</code></a>
<div class="content">
Applies a function to a sequence of arguments<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>function(item()*) as item()*</td>
<td>The function to be applied</td>
</tr>
<tr>
<td>Sequence</td>
<td>Sequence of arguments to pass to the function</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:apply(fn:concat#2, ('Hello', ' World'))</td>
<td>'Hello World'</td>
</tr>
<tr>
<td>fn:apply(fn:substring#2, ('Hello World', 7))</td>
<td>'World'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-apply" class="hyperlink" target="_blank">Apply</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:outermost(node()*)</code></a>
<div class="content">
Returns the outermost nodes of the input sequence that are not ancestors of any other
node in the input sequence<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()*</td>
<td>Sequence of nodes</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:outermost(//chapter)</td>
<td>Sequence of outermost chapter nodes</td>
</tr>
<tr>
<td>fn:outermost(/book//*)</td>
<td>Sequence of outermost nodes in the book</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-outermost" class="hyperlink" target="_blank">outermost</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:innermost(node()*)</code></a>
<div class="content">
Returns the innermost nodes of the input sequence that are not descendants of any other
node in the input sequence<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()*</td>
<td>Sequence of nodes</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:innermost(//chapter)</td>
<td>Sequence of innermost chapter nodes</td>
</tr>
<tr>
<td>fn:innermost(/book//*)</td>
<td>Sequence of innermost nodes in the book</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-innermost" class="hyperlink" target="_blank">innermost</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:has-children(node()?)</code></a>
<div class="content">
Returns true if the specified node has one or more children, otherwise returns false<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()?</td>
<td>Optional node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:has-children(/book/chapter[1])</td>
<td>true</td>
</tr>
<tr>
<td>fn:has-children(/book/chapter[1]/title)</td>
<td>false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-has-children" class="hyperlink" target="_blank">has-children</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:path(node()?)</code></a>
<div class="content">
Returns a string that represents the path of the specified node within the XML
document<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()?</td>
<td>Optional node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:path(/book/chapter[1])</td>
<td>/book/chapter[1]</td>
</tr>
<tr>
<td>fn:path(/book/chapter[2]/title)</td>
<td>/book/chapter[2]/title</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-path" class="hyperlink" target="_blank">path</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:root(node()?)</code></a>
<div class="content">
Returns the root node of the tree that contains the specified node<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()?</td>
<td>Optional node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:root(/book/chapter)</td>
<td>&lt;book&gt; element (root node)</td>
</tr>
<tr>
<td>fn:root(/book/chapter[1])</td>
<td>&lt;book&gt; element (root node)</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-root" class="hyperlink" target="_blank">root</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:namespace-uri(node()?)</code></a>
<div class="content">
Returns the namespace URI of the specified node<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()?</td>
<td>Optional node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:namespace-uri(/example:root)</td>
<td>"http://www.example.com/ns"</td>
</tr>
<tr>
<td>fn:namespace-uri(/a/b)</td>
<td>""</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-namespace-uri" class="hyperlink" target="_blank">namespace-uri</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:local-name(node()?)</code></a>
<div class="content">
Returns the local part of the name of the specified node<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()?</td>
<td>Optional node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:local-name(/a/b)</td>
<td>"b"</td>
</tr>
<tr>
<td>fn:local-name(/example:root)</td>
<td>"root"</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-local-name" class="hyperlink" target="_blank">local-name</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:name(node()?)</code></a>
<div class="content">
Returns the expanded QName of the specified node as a string<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()?</td>
<td>Optional node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:name(/a/b)</td>
<td>"b"</td>
</tr>
<tr>
<td>fn:name(/example:root)</td>
<td>"example:root"</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-name" class="hyperlink" target="_blank">name</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:document-uri(node?)</code></a>
<div class="content">
Returns the document URI of the given node or the context item <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node?</td>
<td>Returns the document URI of the specified node or the context item (if no
argument is provided)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:document-uri(/library/fiction:book[1])</td>
<td>http://example.com/library.xml (assuming the document URI of the first
fiction:book element is "http://example.com/library.xml")</td>
</tr>
<tr>
<td>fn:document-uri(/library)</td>
<td>http://example.com/library.xml (assuming the document URI of the library
element is "http://example.com/library.xml")</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-document-uri" class="hyperlink" target="_blank">Document-URI</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:base-uri(node?)</code></a>
<div class="content">
Returns the base URI of the node or the context item <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node?</td>
<td>Returns the base URI of the specified node or the context item (if no
argument is provided)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:base-uri(/library/fiction:book[1])</td>
<td>http://example.com/library.xml (assuming the base URI of the first
fiction:book element is "http://example.com/library.xml")</td>
</tr>
<tr>
<td>fn:base-uri(/library)</td>
<td>http://example.com/library.xml (assuming the base URI of the library element
is "http://example.com/library.xml")</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-base-uri" class="hyperlink" target="_blank">Base-URI</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:node-name(node?)</code></a>
<div class="content">
Returns the name of a node as an xs:QName <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node?</td>
<td>Returns the name of the specified node or the context item if the argument
is omitted</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:node-name(/library/*[1])</td>
<td>fiction:book</td>
</tr>
<tr>
<td>fn:node-name(/library/fiction:book[1]/title)</td>
<td>title</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-node-name" class="hyperlink" target="_blank">Node-Name</a></code>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Boolean</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:not(item()*)</code></a>
<div class="content">
Returns the negation of the effective boolean value of the argument <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Argument whose effective boolean value is to be negated</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:not(1)</td>
<td>false</td>
</tr>
<tr>
<td>fn:not(0)</td>
<td>true</td>
</tr>
<tr>
<td>fn:not('')</td>
<td>true</td>
</tr>
<tr>
<td>fn:not('true')</td>
<td>false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-not" class="hyperlink" target="_blank">Not</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:false()</code></a>
<div class="content">
Returns the boolean value false <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Returns the boolean value false</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:false()</td>
<td>false</td>
</tr>
<tr>
<td>//item[fn:false()]</td>
<td>Returns an empty node-set</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-false" class="hyperlink" target="_blank">False</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:true()</code></a>
<div class="content">
Returns the boolean value true <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Returns the boolean value true</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:true()</td>
<td>true</td>
</tr>
<tr>
<td>//item[fn:true()]</td>
<td>Returns all &lt;item&gt; elements</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-true" class="hyperlink" target="_blank">True</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:boolean(item()*)</code></a>
<div class="content">
Converts the argument to a boolean value <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Argument to be converted to a boolean value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:boolean(1)</td>
<td>true</td>
</tr>
<tr>
<td>fn:boolean(0)</td>
<td>false</td>
</tr>
<tr>
<td>fn:boolean('')</td>
<td>false</td>
</tr>
<tr>
<td>fn:boolean('true')</td>
<td>true</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-boolean" class="hyperlink" target="_blank">Boolean</a></code>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">String</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:unparsed-text-available(xs:string?, xs:string?)</code></a>
<div class="content">
Determines if an unparsed text resource identified by a URI can be read using the given
encoding<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>The URI identifying the unparsed text resource</td>
</tr>
<tr>
<td>xs:string?</td>
<td>The encoding to be used for reading the resource</td>
</tr>
<tr>
<td>xs:boolean</td>
<td>Indicates if the resource can be read using the given encoding</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:unparsed-text-available("http://www.example.com/text.txt", "UTF-8")</td>
<td>Returns true if the text resource identified by the specified URI can be
read using the specified encoding, otherwise false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-unparsed-text-available" class="hyperlink" target="_blank">unparsed-text-available</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:unparsed-text-lines(xs:string?, xs:string?)</code></a>
<div class="content">
Returns the contents of an unparsed text resource identified by a URI, split into
lines<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>The URI identifying the unparsed text resource</td>
</tr>
<tr>
<td>xs:string?</td>
<td>The encoding to be used for reading the resource</td>
</tr>
<tr>
<td>xs:string*</td>
<td>The lines of the unparsed text resource</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:unparsed-text-lines("http://www.example.com/text.txt", "UTF-8")</td>
<td>Returns the lines of the text resource identified by the specified URI,
using the specified encoding</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-unparsed-text-lines" class="hyperlink" target="_blank">unparsed-text-lines</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:unparsed-text(xs:string?, xs:string?)</code></a>
<div class="content">
Returns the contents of an unparsed text resource identified by a URI<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>The URI identifying the unparsed text resource</td>
</tr>
<tr>
<td>xs:string?</td>
<td>The encoding to be used for reading the resource</td>
</tr>
<tr>
<td>xs:string?</td>
<td>The contents of the unparsed text resource</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:unparsed-text("http://www.example.com/text.txt", "UTF-8")</td>
<td>Returns the contents of the text resource identified by the specified URI,
using the specified encoding</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-unparsed-text" class="hyperlink" target="_blank">unparsed-text</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:escape-html-uri(xs:string?)</code></a>
<div class="content">
Escapes special characters in a URI to be used in HTML <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>URI to be escaped for use in HTML</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:escape-html-uri('https://example.com/search?q=test&lang=en')</td>
<td>https://example.com/search?q=test&amp;lang=en</td>
</tr>
<tr>
<td>fn:escape-html-uri('https://example.com/page?id=1&section=2')</td>
<td>https://example.com/page?id=1&amp;section=2</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-escape-html-uri" class="hyperlink" target="_blank">Escape-HTML-URI</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:iri-to-uri(xs:string?)</code></a>
<div class="content">
Converts an IRI to a URI by escaping non-ASCII characters <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>IRI to be converted to a URI</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:iri-to-uri('https://example.com/ümlaut')</td>
<td>https://example.com/%C3%BCmlaut</td>
</tr>
<tr>
<td>fn:iri-to-uri('https://example.com/日本語')</td>
<td>https://example.com/%E6%97%A5%E6%9C%AC%E8%AA%9E</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-iri-to-uri" class="hyperlink" target="_blank">IRI-to-URI</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:encode-for-uri(xs:string?)</code></a>
<div class="content">
Encodes a string for use in a URI by escaping special characters <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>String to be encoded for use in a URI</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:encode-for-uri('hello world')</td>
<td>hello%20world</td>
</tr>
<tr>
<td>fn:encode-for-uri('example?query=value&param=value2')</td>
<td>example%3Fquery%3Dvalue%26param%3Dvalue2</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-encode-for-uri" class="hyperlink" target="_blank">Encode-for-URI</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:resolve-uri(xs:string?, xs:string?)</code></a>
<div class="content">
Resolves a relative URI using a base URI <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Relative URI to resolve</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Base URI to use for resolving (optional)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:resolve-uri('example.html', 'https://www.example.com/folder/')</td>
<td>https://www.example.com/folder/example.html</td>
</tr>
<tr>
<td>fn:resolve-uri('../images/pic.jpg',
'https://www.example.com/folder/page.html')</td>
<td>https://www.example.com/images/pic.jpg</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-resolve-uri" class="hyperlink" target="_blank">Resolve-URI</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:analyze-string(xs:string?, xs:string, xs:string?)</code></a>
<div class="content">
Analyzes the input string and returns an XML fragment containing match and non-match
elements <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to analyze</td>
</tr>
<tr>
<td>xs:string</td>
<td>Regular expression pattern to match</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Flags to control the regular expression matching (optional)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:analyze-string('red,green,blue', ',')</td>
<td>
&lt;fn:analyze-string-result>&lt;fn:non-match>red&lt;/fn:non-match>&lt;fn:match>,
</fn:match>&lt;fn:non-match>green&lt;/fn:non-match>&lt;fn:match>,</fn:match>
&lt;fn:non-match>blue&lt;/fn:non-match>&lt;/fn:analyze-string-result>
</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-analyze-string" class="hyperlink" target="_blank">Analyze-String</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:tokenize(xs:string?, xs:string, xs:string?)</code></a>
<div class="content">
Splits the input string into a sequence of substrings using the pattern as a delimiter
<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to tokenize</td>
</tr>
<tr>
<td>xs:string</td>
<td>Regular expression pattern to use as delimiter</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Flags to control the regular expression matching (optional)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:tokenize('XPath 3.0, XQuery 3.0, XSLT 3.0', ',\\s*')</td>
<td>('XPath 3.0', 'XQuery 3.0', 'XSLT 3.0')</td>
</tr>
<tr>
<td>fn:tokenize('apple,orange,banana', ',')</td>
<td>('apple', 'orange', 'banana')</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-tokenize" class="hyperlink" target="_blank">Tokenize</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:replace(xs:string?, xs:string, xs:string, xs:string?)</code></a>
<div class="content">
Replaces occurrences of the pattern in the input string with the replacement string <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to search within</td>
</tr>
<tr>
<td>xs:string</td>
<td>Regular expression pattern to match</td>
</tr>
<tr>
<td>xs:string</td>
<td>Replacement string</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Flags to control the regular expression matching (optional)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:replace('XPath 3.0 is great', '3.0', '3.1')</td>
<td>'XPath 3.1 is great'</td>
</tr>
<tr>
<td>fn:replace('Hello, World!', 'World', 'XPath')</td>
<td>'Hello, XPath!'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-replace" class="hyperlink" target="_blank">Replace</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:matches(xs:string?, xs:string, xs:string?)</code></a>
<div class="content">
Returns true if the input string matches the regular expression pattern, otherwise false
<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to search within</td>
</tr>
<tr>
<td>xs:string</td>
<td>Regular expression pattern to match</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Flags to control the regular expression matching (optional)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:matches('XPath 3.0', '\\d\\.\\d')</td>
<td>true</td>
</tr>
<tr>
<td>fn:matches('Hello, World!', '[A-Z][a-z]*')</td>
<td>true</td>
</tr>
<tr>
<td>fn:matches('example123', '\\d+', 'q')</td>
<td>false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-matches" class="hyperlink" target="_blank">Matches</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:substring-after(xs:string?, xs:string?)</code></a>
<div class="content">
Returns the part of the first string that follows the first occurrence of the second
string <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to search within</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Substring to search for</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:substring-after('Hello, World!', ',')</td>
<td>' World!'</td>
</tr>
<tr>
<td>fn:substring-after('XPath 3.0 is awesome!', '3.0')</td>
<td>' is awesome!'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-substring-after" class="hyperlink" target="_blank">Substring-After</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:substring-before(xs:string?, xs:string?)</code></a>
<div class="content">
Returns the part of the first string that precedes the first occurrence of the second
string <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to search within</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Substring to search for</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:substring-before('Hello, World!', ',')</td>
<td>'Hello'</td>
</tr>
<tr>
<td>fn:substring-before('XPath 3.0 is awesome!', '3.0')</td>
<td>'XPath '</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-substring-before" class="hyperlink" target="_blank">Substring-Before</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:ends-with(xs:string?, xs:string?)</code></a>
<div class="content">
Returns true if the first string ends with the second string, otherwise false <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to check</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Substring to check for at the end of the first string</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:ends-with('Hello, World!', 'World!')</td>
<td>true</td>
</tr>
<tr>
<td>fn:ends-with('Hello, World!', 'Hello')</td>
<td>false</td>
</tr>
<tr>
<td>fn:ends-with('XPath 3.0', '3.0')</td>
<td>true</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-ends-with" class="hyperlink" target="_blank">Ends-With</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:starts-with(xs:string?, xs:string?)</code></a>
<div class="content">
Returns true if the first string starts with the second string, otherwise false <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to check</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Substring to check for at the beginning of the first string</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:starts-with('Hello, World!', 'Hello')</td>
<td>true</td>
</tr>
<tr>
<td>fn:starts-with('Hello, World!', 'World')</td>
<td>false</td>
</tr>
<tr>
<td>fn:starts-with('XPath 3.0', 'XPath')</td>
<td>true</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-starts-with" class="hyperlink" target="_blank">Starts-With</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:contains(xs:string?, xs:string?)</code></a>
<div class="content">
Returns true if the first string contains the second string, otherwise false <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to search within</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Substring to search for</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:contains('Hello, World!', 'World')</td>
<td>true</td>
</tr>
<tr>
<td>fn:contains('Hello, World!', 'world')</td>
<td>false</td>
</tr>
<tr>
<td>fn:contains('XPath 3.0', '3.0')</td>
<td>true</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-contains" class="hyperlink" target="_blank">Contains</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:translate(xs:string?, xs:string, xs:string)</code></a>
<div class="content">
Returns the input string with specified characters replaced <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to be translated</td>
</tr>
<tr>
<td>xs:string</td>
<td>Map string with characters to replace</td>
</tr>
<tr>
<td>xs:string</td>
<td>Translate string with replacement characters</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:translate('apple', 'aeiou', '12345')</td>
<td>'1ppl2'</td>
</tr>
<tr>
<td>fn:translate('Hello, World!', 'HW', 'hw')</td>
<td>'hello, world!'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-translate" class="hyperlink" target="_blank">Translate</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:lower-case(xs:string?)</code></a>
<div class="content">
Returns the input string with all characters converted to lowercase <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to convert to lowercase</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:lower-case('HELLO, WORLD!')</td>
<td>'hello, world!'</td>
</tr>
<tr>
<td>fn:lower-case('XPath 3.0')</td>
<td>'xpath 3.0'</td>
</tr>
<tr>
<td>fn:lower-case('BANANA')</td>
<td>'banana'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-lower-case" class="hyperlink" target="_blank">Lower-Case</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:upper-case(xs:string?)</code></a>
<div class="content">
Returns the input string with all characters converted to uppercase <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to convert to uppercase</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:upper-case('Hello, World!')</td>
<td>'HELLO, WORLD!'</td>
</tr>
<tr>
<td>fn:upper-case('XPath 3.0')</td>
<td>'XPATH 3.0'</td>
</tr>
<tr>
<td>fn:upper-case('banana')</td>
<td>'BANANA'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-upper-case" class="hyperlink" target="_blank">Upper-Case</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:normalize-unicode(xs:string?, xs:string)</code></a>
<div class="content">
Returns the input string with Unicode normalization applied <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to normalize</td>
</tr>
<tr>
<td>xs:string</td>
<td>Normalization form to apply (NFC, NFD, NFKC, NFKD)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:normalize-unicode('Café', 'NFC')</td>
<td>'Café'</td>
</tr>
<tr>
<td>fn:normalize-unicode('Café', 'NFD')</td>
<td>'Café'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-normalize-unicode" class="hyperlink" target="_blank">Normalize-Unicode</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:normalize-space(xs:string?)</code></a>
<div class="content">
Returns the input string with whitespace normalized <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to normalize whitespace</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:normalize-space(' Hello, World! ')</td>
<td>'Hello, World!'</td>
</tr>
<tr>
<td>fn:normalize-space(' XPath 3.0 ')</td>
<td>'XPath 3.0'</td>
</tr>
<tr>
<td>fn:normalize-space('\tbanana\t')</td>
<td>'banana'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-normalize-space" class="hyperlink" target="_blank">Normalize-Space</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:string-length(xs:string?)</code></a>
<div class="content">
Returns the length of the input string <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string to calculate length</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:string-length('Hello, World!')</td>
<td>13</td>
</tr>
<tr>
<td>fn:string-length('XPath 3.0')</td>
<td>8</td>
</tr>
<tr>
<td>fn:string-length('banana')</td>
<td>6</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-string-length" class="hyperlink" target="_blank">String-Length</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:substring(xs:string?, xs:double)</code></a>
<div class="content">
Returns a substring of the source string, starting from a specific location <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input source string</td>
</tr>
<tr>
<td>xs:double</td>
<td>Starting location to extract the substring</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:substring('Hello, World!', 1, 5)</td>
<td>'Hello'</td>
</tr>
<tr>
<td>fn:substring('XPath 3.0', 7)</td>
<td>'3.0'</td>
</tr>
<tr>
<td>fn:substring('banana', 2, 3)</td>
<td>'ana'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-substring" class="hyperlink" target="_blank">Substring</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:string-join(xs:string*, xs:string)</code></a>
<div class="content">
Joins a sequence of strings with a specified separator, returning a single string <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string*</td>
<td>Input sequence of strings to join</td>
</tr>
<tr>
<td>xs:string</td>
<td>Separator string to insert between joined strings</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:string-join(('apple', 'banana', 'orange'), ', ')</td>
<td>'apple, banana, orange'</td>
</tr>
<tr>
<td>fn:string-join(('XPath', '3.0', 'Functions'), ' - ')</td>
<td>'XPath - 3.0 - Functions'</td>
</tr>
<tr>
<td>fn:string-join(('A', 'B', 'C'), '')</td>
<td>'ABC'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-string-join" class="hyperlink" target="_blank">String-Join</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:concat(xs:anyAtomicType?, xs:anyAtomicType?, ...)</code></a>
<div class="content">
Concatenates two or more strings or atomic values, returning a single string <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType?</td>
<td>Input strings or atomic values to concatenate</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:concat('Hello', ' ', 'World')</td>
<td>'Hello World'</td>
</tr>
<tr>
<td>fn:concat('I have ', 3, ' apples')</td>
<td>'I have 3 apples'</td>
</tr>
<tr>
<td>fn:concat('XPath ', '3.0')</td>
<td>'XPath 3.0'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-concat" class="hyperlink" target="_blank">Concat</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:codepoint-equal(xs:string?, xs:string?)</code></a>
<div class="content">
Compares two strings on a codepoint-by-codepoint basis and returns true if they are
equal, false otherwise <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>First string to compare</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Second string to compare</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:codepoint-equal('Hello', 'Hello')</td>
<td>true</td>
</tr>
<tr>
<td>fn:codepoint-equal('Hello', 'hello')</td>
<td>false</td>
</tr>
<tr>
<td>fn:codepoint-equal('apple', 'banana')</td>
<td>false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-codepoint-equal" class="hyperlink" target="_blank">Codepoint-Equal</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:compare(xs:string?, xs:string?)</code></a>
<div class="content">
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 <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>First string to compare</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Second string to compare</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:compare('apple', 'banana')</td>
<td>-1</td>
</tr>
<tr>
<td>fn:compare('apple', 'apple')</td>
<td>0</td>
</tr>
<tr>
<td>fn:compare('banana', 'apple')</td>
<td>1</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-compare" class="hyperlink" target="_blank">Compare</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:string-to-codepoints(xs:string?)</code></a>
<div class="content">
Returns a sequence of Unicode code points for a given string <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Input string</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:string-to-codepoints('Hello')</td>
<td>(72, 101, 108, 108, 111)</td>
</tr>
<tr>
<td>fn:string-to-codepoints('( ͡° ͜ʖ ͡°)')</td>
<td>(40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41)</td>
</tr>
<tr>
<td>fn:string-to-codepoints('😊')</td>
<td>(128522)</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-string-to-codepoints" class="hyperlink" target="_blank">String-To-Codepoints</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:codepoints-to-string(xs:integer*)</code></a>
<div class="content">
Constructs a string from a sequence of Unicode code points <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:integer*</td>
<td>Sequence of Unicode code points</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:codepoints-to-string((72, 101, 108, 108, 111))</td>
<td>Hello</td>
</tr>
<tr>
<td>codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41))
</td>
<td>( ͡° ͜ʖ ͡°)</td>
</tr>
<tr>
<td>fn:codepoints-to-string((128522))</td>
<td>😊</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-codepoints-to-string" class="hyperlink" target="_blank">Codepoints-To-String</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:string(object)</code></a>
<div class="content">
Returns the string representation of the object argument <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>string</td>
<td>The object to convert to a string</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>string((1&lt;0))</td>
<td>false</td>
</tr>
<tr>
<td>string(.11)</td>
<td>0.11</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" class="hyperlink" target="_blank">String-Functions</code></a>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Numeric</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:format-number(numeric?, xs:string, item()?)</code></a>
<div class="content">
Returns a string that represents a formatted version of a number using a formatting
pattern and an optional
set of properties<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>numeric?</td>
<td>The number to format</td>
</tr>
<tr>
<td>xs:string</td>
<td>The formatting pattern</td>
</tr>
<tr>
<td>item()?</td>
<td>Optional: the set of properties for formatting the number</td>
</tr>
<tr>
<td>xs:string</td>
<td>The formatted number as a string</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>format-number(12345.678, "#,##0.00")</td>
<td>Returns the formatted number: <code>"12,345.68"</code></td>
</tr>
<tr>
<td>format-number(12345.678, "#,##0")</td>
<td>Returns the formatted number: <code>"12,346"</code></td>
</tr>
<tr>
<td>format-number(12345.678, "0.000")</td>
<td>Returns the formatted number: <code>"12345.678"</code></td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-format-number" class="hyperlink" target="_blank">format-number</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:format-integer(xs:integer?, xs:string)</code></a>
<div class="content">
Formats an integer value according to the supplied picture string <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:integer?</td>
<td>Integer value to be formatted</td>
</tr>
<tr>
<td>xs:string</td>
<td>Picture string defining the format</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:format-integer(12345, '0,0')</td>
<td>12,345</td>
</tr>
<tr>
<td>fn:format-integer(-1234, '0,0')</td>
<td>-1,234</td>
</tr>
<tr>
<td>fn:format-integer(1234, '00-00-00')</td>
<td>01-23-45</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-format-integer" class="hyperlink" target="_blank">Format-Integer</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:round-half-to-even(numeric?)</code></a>
<div class="content">
Returns the closest integer to the given numeric value, rounding half-way cases to the
nearest even integer (also known as "bankers' rounding") <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>numeric?</td>
<td>Numeric value for which the rounded value will be calculated</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:round-half-to-even(3.5)</td>
<td>4</td>
</tr>
<tr>
<td>fn:round-half-to-even(2.5)</td>
<td>2</td>
</tr>
<tr>
<td>fn:round-half-to-even(-1.5)</td>
<td>-2</td>
</tr>
<tr>
<td>fn:round-half-to-even(xs:decimal('1.25'), 1)</td>
<td>1.2</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-round-half-to-even" class="hyperlink" target="_blank">Round-Half-To-Even</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:round(numeric?)</code></a>
<div class="content">
Returns the closest integer to the given numeric value, rounding half-way cases away
from zero <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>numeric?</td>
<td>Numeric value for which the rounded value will be calculated</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:round(3.14)</td>
<td>3</td>
</tr>
<tr>
<td>fn:round(-4.7)</td>
<td>-5</td>
</tr>
<tr>
<td>fn:round(xs:decimal('2.5'))</td>
<td>3</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-round" class="hyperlink" target="_blank">Round</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:floor(numeric?)</code></a>
<div class="content">
Returns the largest integer less than or equal to the given numeric value <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>numeric?</td>
<td>Numeric value for which the floor value will be calculated</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:floor(3.14)</td>
<td>3</td>
</tr>
<tr>
<td>fn:floor(-4.7)</td>
<td>-5</td>
</tr>
<tr>
<td>fn:floor(xs:decimal('2.5'))</td>
<td>2</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-floor" class="hyperlink" target="_blank">Floor</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:ceiling(numeric?)</code></a>
<div class="content">
Returns the smallest integer greater than or equal to the given numeric value <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>numeric?</td>
<td>Numeric value for which the ceiling value will be calculated</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:ceiling(3.14)</td>
<td>4</td>
</tr>
<tr>
<td>fn:ceiling(-4.7)</td>
<td>-4</td>
</tr>
<tr>
<td>fn:ceiling(xs:decimal('2.5'))</td>
<td>3</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-ceiling" class="hyperlink" target="_blank">Ceiling</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:abs(numeric?)</code></a>
<div class="content">
Returns the absolute value of the given numeric value <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>numeric?</td>
<td>Numeric value for which the absolute value will be calculated</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:abs(-42)</td>
<td>42</td>
</tr>
<tr>
<td>fn:abs(3.14)</td>
<td>3.14</td>
</tr>
<tr>
<td>fn:abs(xs:decimal('-5.5'))</td>
<td>5.5</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-abs" class="hyperlink" target="_blank">Abs</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:number(item?)</code></a>
<div class="content">
Converts the given value to a number <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item?</td>
<td>Returns the numeric value of the specified expression or the context item
(if no argument is provided)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:number(/library/fiction:book[1]/@id)</td>
<td>1 (if the first fiction:book element's id attribute is "1")</td>
</tr>
<tr>
<td>fn:number(/library/fiction:book[1]/price)</td>
<td>19.99 (if the first fiction:book element's price element contains "19.99")
</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-number" class="hyperlink" target="_blank">Number</a></code>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Collections</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:sort(item()*)</code></a>
<div class="content">
Sorts an array of items based on their atomic values<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>Array</td>
<td>The array of items to be sorted</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:sort([10, 5, 20])</td>
<td>[5, 10, 20]</td>
</tr>
<tr>
<td>fn:sort(['banana', 'apple', 'cherry'])</td>
<td>['apple', 'banana', 'cherry']</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-sort" class="hyperlink" target="_blank">Sort</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:fold-right(item()*, item()*, function(item(), item()*))</code></a>
<div class="content">
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<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>The input sequence of items</td>
</tr>
<tr>
<td>item()*</td>
<td>The initial value, also known as the zero value</td>
</tr>
<tr>
<td>function(item(), item()*)</td>
<td>The processing function used to accumulate the items</td>
</tr>
<tr>
<td>item()*</td>
<td>The resulting single value after applying the processing function</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fold-right((1, 2, 3, 4), 0, function($current, $accumulator) { $accumulator
- $current })</td>
<td>Returns the result of subtracting each number in the input sequence from
right to left: <code>-2</code></td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-fold-right" class="hyperlink" target="_blank">fold-right</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:fold-left(item()*, item()*, function(item()*, item()))</code></a>
<div class="content">
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<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>The input sequence of items</td>
</tr>
<tr>
<td>item()*</td>
<td>The initial value, also known as the zero value</td>
</tr>
<tr>
<td>function(item()*, item())</td>
<td>The processing function used to accumulate the items</td>
</tr>
<tr>
<td>item()*</td>
<td>The resulting single value after applying the processing function</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fold-left((1, 2, 3, 4), 0, function($accumulator, $current) { $accumulator +
$current })</td>
<td>Returns the sum of the numbers in the input sequence: <code>10</code></td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-fold-left" class="hyperlink" target="_blank">fold-left</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:last()</code></a>
<div class="content">
Returns the position of the last item in the current context sequence <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Returns the position of the last item in the current context sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>/library/fiction:book[position() = last()]</td>
<td>Returns the last fiction:book element in the library</td>
</tr>
<tr>
<td>/library/fiction:book[last()]</td>
<td>Returns the last fiction:book element in the library</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-30/#func-last" class="hyperlink" target="_blank">Last</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:position()</code></a>
<div class="content">
Returns the context position of the context item in the sequence currently being
processed<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Function takes no arguments</td>
</tr>
<tr>
<td>xs:integer</td>
<td>The position of the context item in the sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>&lt;items>&lt;item>Item 1&lt;/item>&lt;item>Item
2&lt;/item>&lt;/items>/item[position()=2]</td>
<td>Returns '&lt;item>Item 2&lt;/item>'</td>
</tr>
<tr>
<td>&lt;items>&lt;item>Item 1&lt;/item>&lt;item>Item
2&lt;/item>&lt;/items>/item[position()=1]</td>
<td>Returns '&lt;item>Item 1&lt;/item>'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-position" class="hyperlink" target="_blank">position</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:collection(xs:string?)</code></a>
<div class="content">
Returns a sequence of document nodes obtained from the collection identified by the
argument URI, or the
default collection if no argument is supplied.<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>The URI of the collection to retrieve (Optional)</td>
</tr>
<tr>
<td>document-node()*</td>
<td>A sequence of document nodes obtained from the collection</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>collection()</td>
<td>Returns the sequence of document nodes from the default collection</td>
</tr>
<tr>
<td>collection("http://example.com/collection")</td>
<td>Returns the sequence of document nodes from the collection identified by the
specified URI</td>
</tr>
<tr>
<td>count(collection())</td>
<td>Returns the number of document nodes in the default collection</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-collection" class="hyperlink" target="_blank">collection</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:sum(xs:anyAtomicType*, xs:anyAtomicType?)</code></a>
<div class="content">
Returns the sum of a sequence of numeric values<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>Input sequence of numeric values</td>
</tr>
<tr>
<td>xs:anyAtomicType?</td>
<td>Value to return if the sequence is empty (optional)</td>
</tr>
<tr>
<td>xs:anyAtomicType?</td>
<td>Sum of the input sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:sum((10, 20, 30, 40, 50))</td>
<td>150</td>
</tr>
<tr>
<td>fn:sum((), 0)</td>
<td>0</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-sum" class="hyperlink" target="_blank">sum</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:min(xs:anyAtomicType*)</code></a>
<div class="content">
Returns the minimum value of a sequence of atomic values, according to the ordering
rules for the value's
type<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>The input sequence of atomic values</td>
</tr>
<tr>
<td>xs:anyAtomicType?</td>
<td>The minimum value of the input sequence, or the empty sequence if the input
sequence is empty
</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>min((5, 1, 9, 3))</td>
<td>Returns the minimum value: <code>1</code></td>
</tr>
<tr>
<td>min(())</td>
<td>Returns the empty sequence: <code>()</code></td>
</tr>
<tr>
<td>min(("apple", "banana", "cherry"))</td>
<td>Returns the minimum value (alphabetical order): <code>"apple"</code></td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-min" class="hyperlink" target="_blank">min</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:max(xs:anyAtomicType*)</code></a>
<div class="content">
Returns the maximum value of a sequence of atomic values, according to the ordering
rules for the value's
type<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>The input sequence of atomic values</td>
</tr>
<tr>
<td>xs:anyAtomicType?</td>
<td>The maximum value of the input sequence, or the empty sequence if the input
sequence is empty
</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>max((5, 1, 9, 3))</td>
<td>Returns the maximum value: <code>9</code></td>
</tr>
<tr>
<td>max(())</td>
<td>Returns the empty sequence: <code>()</code></td>
</tr>
<tr>
<td>max(("apple", "banana", "cherry"))</td>
<td>Returns the maximum value (alphabetical order): <code>"cherry"</code></td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-max" class="hyperlink" target="_blank">max</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:avg(xs:anyAtomicType*)</code></a>
<div class="content">
Computes the average of the numeric values in the input sequence<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>Input sequence of numeric values</td>
</tr>
<tr>
<td>xs:anyAtomicType?</td>
<td>Average of the numeric values in the input sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:avg((10, 20, 30, 40, 50))</td>
<td>30</td>
</tr>
<tr>
<td>fn:avg((2.5, 3.5, 4.5))</td>
<td>3.5</td>
</tr>
<tr>
<td>fn:avg(())</td>
<td>empty sequence</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-avg" class="hyperlink" target="_blank">avg</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:count(item()*)</code></a>
<div class="content">
Returns the number of items in the input sequence<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Input sequence</td>
</tr>
<tr>
<td>xs:integer</td>
<td>Number of items in the input sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:count(('apple', 'banana', 'orange'))</td>
<td>3</td>
</tr>
<tr>
<td>fn:count(())</td>
<td>0</td>
</tr>
<tr>
<td>fn:count((1, 2, 3, 4, 5))</td>
<td>5</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-count" class="hyperlink" target="_blank">count</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:exactly-one(item()*)</code></a>
<div class="content">
Returns the single item in the input sequence or raises an error if the sequence is
empty or contains more than one item<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Input sequence</td>
</tr>
<tr>
<td>item()</td>
<td>Single item from the input sequence, otherwise an error is raised</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:exactly-one(('apple'))</td>
<td>'apple'</td>
</tr>
<tr>
<td>fn:exactly-one(('apple', 'banana'))</td>
<td>Error (more than one item)</td>
</tr>
<tr>
<td>fn:exactly-one(())</td>
<td>Error (empty sequence)</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-exactly-one" class="hyperlink" target="_blank">exactly-one</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:one-or-more(item()*)+</code></a>
<div class="content">
Returns the input sequence if it contains one or more items, otherwise raises an
error<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Input sequence</td>
</tr>
<tr>
<td>item()+</td>
<td>Sequence containing one or more items, otherwise an error is raised</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:one-or-more(('apple', 'banana'))</td>
<td>('apple', 'banana')</td>
</tr>
<tr>
<td>fn:one-or-more(('pear'))</td>
<td>('pear')</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-one-or-more" class="hyperlink" target="_blank">one-or-more</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:zero-or-one(item()*)</code></a>
<div class="content">
Returns the input sequence if it contains zero or one items, otherwise raises an
error<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Input sequence</td>
</tr>
<tr>
<td>item()?</td>
<td>Sequence containing zero or one item, otherwise an error is raised</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:zero-or-one(('apple'))</td>
<td>('apple')</td>
</tr>
<tr>
<td>fn:zero-or-one(())</td>
<td>()</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-zero-or-one" class="hyperlink" target="_blank">zero-or-one</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:deep-equal(item()* , item()*)</code></a>
<div class="content">
Returns true if the two input sequences are deep-equal, meaning that they have the same
structure and atomic values<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>First input sequence</td>
</tr>
<tr>
<td>item()*</td>
<td>Second input sequence</td>
</tr>
<tr>
<td>xs:boolean</td>
<td>True if the input sequences are deep-equal, otherwise false</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:deep-equal((1, 2, 3), (1, 2, 3))</td>
<td>true</td>
</tr>
<tr>
<td>fn:deep-equal((1, 2, 3), (1, 2, 4))</td>
<td>false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-deep-equal" class="hyperlink" target="_blank">deep-equal</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:index-of(xs:anyAtomicType*, xs:anyAtomicType)</code></a>
<div class="content">
Returns a sequence of integers indicating the positions of items in the input sequence
that are equal to the search item<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>Input sequence of atomic values</td>
</tr>
<tr>
<td>xs:anyAtomicType</td>
<td>Search item to find in the input sequence</td>
</tr>
<tr>
<td>xs:integer*</td>
<td>Sequence of integers representing the positions of the search item in the
input sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:index-of((3, 1, 4, 1, 5, 9, 2, 2, 3), 1)</td>
<td>(2, 4)</td>
</tr>
<tr>
<td>fn:index-of(('apple', 'banana', 'orange', 'apple', 'grape', 'orange'),
'apple')</td>
<td>(1, 4)</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-index-of" class="hyperlink" target="_blank">index-of</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:distinct-values(xs:anyAtomicType*)</code></a>
<div class="content">
Returns a sequence of distinct atomic values from the input sequence<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>Input sequence of atomic values</td>
</tr>
<tr>
<td>xs:anyAtomicType*</td>
<td>Distinct sequence of atomic values</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:distinct-values((3, 1, 4, 1, 5, 9, 2, 2, 3))</td>
<td>(3, 1, 4, 5, 9, 2)</td>
</tr>
<tr>
<td>fn:distinct-values(('apple', 'banana', 'orange', 'apple', 'grape',
'orange'))</td>
<td>('apple', 'banana', 'orange', 'grape')</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-distinct-values" class="hyperlink" target="_blank">distinct-values</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:unordered(item()*)</code></a>
<div class="content">
Returns the items of a sequence in an implementation-dependent order<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Input sequence</td>
</tr>
<tr>
<td>item()*</td>
<td>Unordered sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:unordered((3, 1, 4, 1, 5, 9, 2))</td>
<td>(1, 2, 3, 4, 5, 9, 1) (example result; actual order may vary)</td>
</tr>
<tr>
<td>fn:unordered(('apple', 'banana', 'orange', 'grape'))</td>
<td>('banana', 'apple', 'orange', 'grape') (example result; actual order may
vary)</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-unordered" class="hyperlink" target="_blank">unordered</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:subsequence(item()*, xs:double, xs:double)</code></a>
<div class="content">
Returns a subsequence of a given sequence starting at a specified position with a
specified length<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Input sequence</td>
</tr>
<tr>
<td>xs:double</td>
<td>Starting position</td>
</tr>
<tr>
<td>xs:double</td>
<td>Length of subsequence</td>
</tr>
<tr>
<td>item()*</td>
<td>Subsequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:subsequence((1, 2, 3, 4, 5), 2, 3)</td>
<td>(2, 3, 4)</td>
</tr>
<tr>
<td>fn:subsequence(('apple', 'banana', 'orange', 'grape'), 1, 2)</td>
<td>('apple', 'banana')</td>
</tr>
<tr>
<td>fn:subsequence(('red', 'blue', 'green', 'yellow'), 3)</td>
<td>('green', 'yellow')</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-subsequence" class="hyperlink" target="_blank">subsequence</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:reverse(item()*)</code></a>
<div class="content">
Reverses the order of items in a sequence<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Input sequence</td>
</tr>
<tr>
<td>item()*</td>
<td>Reversed sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:reverse((1, 2, 3, 4))</td>
<td>(4, 3, 2, 1)</td>
</tr>
<tr>
<td>fn:reverse(('apple', 'banana', 'orange'))</td>
<td>('orange', 'banana', 'apple')</td>
</tr>
<tr>
<td>fn:reverse(('red', 'blue', 'green'))</td>
<td>('green', 'blue', 'red')</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-reverse" class="hyperlink" target="_blank">reverse</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:remove(item()*, xs:integer)</code></a>
<div class="content">
Removes an item from a sequence at the specified position<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Target sequence</td>
</tr>
<tr>
<td>xs:integer</td>
<td>Position of the item to remove</td>
</tr>
<tr>
<td>item()*</td>
<td>New sequence with the item removed</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:remove((1, 2, 3, 4), 2)</td>
<td>(1, 3, 4)</td>
</tr>
<tr>
<td>fn:remove(('apple', 'banana', 'orange'), 3)</td>
<td>('apple', 'banana')</td>
</tr>
<tr>
<td>fn:remove((10, 20, 30), 1)</td>
<td>(20, 30)</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-remove" class="hyperlink" target="_blank">remove</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:insert-before(item()*, xs:integer, item()*)</code></a>
<div class="content">
Inserts items from the specified sequence into another sequence at a given position<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Target sequence</td>
</tr>
<tr>
<td>xs:integer</td>
<td>Position at which to insert the items</td>
</tr>
<tr>
<td>item()*</td>
<td>Sequence of items to insert</td>
</tr>
<tr>
<td>item()*</td>
<td>New sequence with items inserted</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:insert-before((1, 3, 4), 2, (2))</td>
<td>(1, 2, 3, 4)</td>
</tr>
<tr>
<td>fn:insert-before(('apple', 'orange'), 1, ('banana'))</td>
<td>('banana', 'apple', 'orange')</td>
</tr>
<tr>
<td>fn:insert-before((10, 20, 30), 4, (40))</td>
<td>(10, 20, 30, 40)</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-insert-before" class="hyperlink" target="_blank">insert-before</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:tail(item()*)</code></a>
<div class="content">
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<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Sequence of items</td>
</tr>
<tr>
<td>item()*</td>
<td>All items except the first one, or an empty sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:tail((1, 2, 3))</td>
<td>(2, 3)</td>
</tr>
<tr>
<td>fn:tail((1))</td>
<td>()</td>
</tr>
<tr>
<td>fn:tail(/books/book/author)</td>
<td>All authors in the "books" element except the first one</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-tail" class="hyperlink" target="_blank">tail</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:head(item()*)</code></a>
<div class="content">
Returns the first item of the input sequence, or an empty sequence if the input is
empty<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Sequence of items</td>
</tr>
<tr>
<td>item()?</td>
<td>The first item of the sequence, or an empty sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:head((1, 2, 3))</td>
<td>1</td>
</tr>
<tr>
<td>fn:head(())</td>
<td>()</td>
</tr>
<tr>
<td>fn:head(/books/book[1]/author)</td>
<td>The first author of the first book in the "books" element</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-head" class="hyperlink" target="_blank">head</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:exists(item()*)</code></a>
<div class="content">
Returns true if the input sequence is not empty, otherwise returns false<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Sequence of items</td>
</tr>
<tr>
<td>xs:boolean</td>
<td>Result of the test (true or false)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:exists((1, 2, 3))</td>
<td>true</td>
</tr>
<tr>
<td>fn:exists(())</td>
<td>false</td>
</tr>
<tr>
<td>fn:exists(//chapter[5])</td>
<td>true if there are at least 5 chapters, otherwise false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-exists" class="hyperlink" target="_blank">exists</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:empty(item()*)</code></a>
<div class="content">
Returns true if the input sequence is empty, otherwise returns false<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Sequence of items</td>
</tr>
<tr>
<td>xs:boolean</td>
<td>Result of the test (true or false)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:empty((1, 2, 3))</td>
<td>false</td>
</tr>
<tr>
<td>fn:empty(())</td>
<td>true</td>
</tr>
<tr>
<td>fn:empty(//chapter[100])</td>
<td>true if there are less than 100 chapters, otherwise false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-empty" class="hyperlink" target="_blank">empty</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:data(item*)</code></a>
<div class="content">
Returns the simple value of an item or a sequence of items <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item?</td>
<td>Returns the simple value of the specified item or the context item (if no
argument is provided)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:data(/library/fiction:book[1]/title)</td>
<td>The Catcher in the Rye</td>
</tr>
<tr>
<td>fn:data(/library/fiction:book[2]/author)</td>
<td>Harper Lee</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-data" class="hyperlink" target="_blank">Data</a></code>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Date / Time</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:implicit-timezone()</code></a>
<div class="content">
Returns the implicit timezone as an xs:dayTimeDuration<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Function takes no arguments</td>
</tr>
<tr>
<td>xs:dayTimeDuration</td>
<td>The implicit timezone as a dayTimeDuration</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>implicit-timezone()</td>
<td>Returns the implicit timezone as an xs:dayTimeDuration, e.g., '-PT7H'
</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-implicit-timezone" class="hyperlink" target="_blank">implicit-timezone</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:current-time()</code></a>
<div class="content">
Returns the current time with timezone<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Function takes no arguments</td>
</tr>
<tr>
<td>xs:time</td>
<td>The current time with timezone</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>current-time()</td>
<td>Returns the current time with timezone, e.g., '13:45:30.123-07:00'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-current-time" class="hyperlink" target="_blank">current-time</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:current-date()</code></a>
<div class="content">
Returns the current date with timezone<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Function takes no arguments</td>
</tr>
<tr>
<td>xs:date</td>
<td>The current date with timezone</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>current-date()</td>
<td>Returns the current date with timezone, e.g., '2023-03-29-07:00'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-current-date" class="hyperlink" target="_blank">current-date</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:current-dateTime()</code></a>
<div class="content">
Returns the current date and time with timezone<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Function takes no arguments</td>
</tr>
<tr>
<td>xs:dateTime</td>
<td>The current date and time with timezone</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>current-dateTime()</td>
<td>Returns the current date and time with timezone, e.g.,
'2023-03-29T12:34:56.789-07:00'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-current-dateTime" class="hyperlink" target="_blank">current-dateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:format-time(xs:time?, xs:string, xs:string?, xs:string?, xs:string?)</code></a>
<div class="content">
Formats a time value according to a formatting picture string, with optional language,
calendar, and
country parameters.<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:time?</td>
<td>The time value to be formatted (Optional)</td>
</tr>
<tr>
<td>xs:string</td>
<td>The formatting picture string</td>
</tr>
<tr>
<td>xs:string?</td>
<td>The language for formatting (Optional)</td>
</tr>
<tr>
<td>xs:string?</td>
<td>The calendar for formatting (Optional)</td>
</tr>
<tr>
<td>xs:string?</td>
<td>The country for formatting (Optional)</td>
</tr>
<tr>
<td>xs:string</td>
<td>The formatted time value as a string</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>format-time(xs:time("14:30:00"), "[H]:[m]")</td>
<td>"14:30"</td>
</tr>
<tr>
<td>format-time(xs:time("14:30:00"), "[H]:[m]:[s]")</td>
<td>"14:30:00"</td>
</tr>
<tr>
<td>format-time(xs:time("14:30:00.456"), "[H]:[m]:[s].[f]")</td>
<td>"14:30:00.456"</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-format-time" class="hyperlink" target="_blank">format-time</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:format-date(xs:date?, xs:string, xs:string?, xs:string?, xs:string?)</code></a>
<div class="content">
Formats a date value using the provided picture string and optional language,
calendar, and country settings<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:date?</td>
<td>Date value</td>
</tr>
<tr>
<td>xs:string</td>
<td>Picture string</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Language</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Calendar</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Country</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:format-date(xs:date('2023-04-01'), '[Y0001]-[M01]-[D01]')</td>
<td>2023-04-01</td>
</tr>
<tr>
<td>fn:format-date(xs:date('2023-04-01'), '[MNn,*-3] [D], [Y]')</td>
<td>Apr 1, 2023</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-format-date" class="hyperlink" target="_blank">Format-Date</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:format-dateTime(xs:dateTime?, xs:string, xs:string?, xs:string?, xs:string?)</code></a>
<div class="content">
Formats a dateTime value according to a formatting picture string, with optional
language, calendar, and
country parameters.<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>The dateTime value to be formatted (Optional)</td>
</tr>
<tr>
<td>xs:string</td>
<td>The formatting picture string</td>
</tr>
<tr>
<td>xs:string?</td>
<td>The language for formatting (Optional)</td>
</tr>
<tr>
<td>xs:string?</td>
<td>The calendar for formatting (Optional)</td>
</tr>
<tr>
<td>xs:string?</td>
<td>The country for formatting (Optional)</td>
</tr>
<tr>
<td>xs:string</td>
<td>The formatted dateTime value as a string</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>format-dateTime(xs:dateTime("2023-04-12T14:30:00"), "[Y]-[M]-[D]T[H]:[m]")
</td>
<td>"2023-04-12T14:30"</td>
</tr>
<tr>
<td>format-dateTime(xs:dateTime("2023-04-12T14:30:00"), "[FNn, Nn] [D] [MNn]
[Y]")</td>
<td>"Wednesday, 12 April 2023"</td>
</tr>
<tr>
<td>format-dateTime(xs:dateTime("2023-04-12T14:30:00.123"),
"[Y]-[M]-[D]T[H]:[m]:[s].[f]")</td>
<td>"2023-04-12T14:30:00.123"</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-format-dateTime" class="hyperlink" target="_blank">format-dateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:adjust-time-to-timezone(xs:time?, xs:dayTimeDuration?)</code></a>
<div class="content">
Adjusts the timezone of a time value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:time?</td>
<td>Time value</td>
</tr>
<tr>
<td>xs:dayTimeDuration?</td>
<td>Timezone adjustment</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:adjust-time-to-timezone(xs:time('10:00:00-07:00'),
xs:dayTimeDuration('PT2H'))</td>
<td>12:00:00-05:00</td>
</tr>
<tr>
<td>fn:adjust-time-to-timezone(xs:time('10:00:00Z'),
xs:dayTimeDuration('-PT3H'))</td>
<td>07:00:00-03:00</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-adjust-time-to-timezone" class="hyperlink" target="_blank">Adjust-Time-To-Timezone</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:adjust-date-to-timezone(xs:date?, xs:dayTimeDuration?)</code></a>
<div class="content">
Adjusts the timezone of a date value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:date?</td>
<td>Date value</td>
</tr>
<tr>
<td>xs:dayTimeDuration?</td>
<td>Timezone adjustment</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:adjust-date-to-timezone(xs:date('2023-01-01-07:00'),
xs:dayTimeDuration('PT2H'))</td>
<td>2023-01-01-05:00</td>
</tr>
<tr>
<td>fn:adjust-date-to-timezone(xs:date('2023-01-01Z'),
xs:dayTimeDuration('-PT3H'))</td>
<td>2022-12-31-03:00</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-adjust-date-to-timezone" class="hyperlink" target="_blank">Adjust-Date-To-Timezone</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:adjust-dateTime-to-timezone(xs:dateTime?, xs:dayTimeDuration?)</code></a>
<div class="content">
Adjusts the timezone of a dateTime value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>DateTime value</td>
</tr>
<tr>
<td>xs:dayTimeDuration?</td>
<td>Timezone adjustment</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:adjust-dateTime-to-timezone(xs:dateTime('2023-01-01T12:00:00-07:00'),
xs:dayTimeDuration('PT2H'))</td>
<td>2023-01-01T17:00:00-05:00</td>
</tr>
<tr>
<td>fn:adjust-dateTime-to-timezone(xs:dateTime('2023-01-01T12:00:00Z'),
xs:dayTimeDuration('-PT3H'))</td>
<td>2023-01-01T09:00:00-03:00</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-adjust-dateTime-to-timezone" class="hyperlink" target="_blank">Adjust-DateTime-To-Timezone</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:timezone-from-time(xs:time?)</code></a>
<div class="content">
Extracts the timezone component from an xs:time value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:time?</td>
<td>Time value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:timezone-from-time(xs:time('12:00:00-07:00'))</td>
<td>-PT7H</td>
</tr>
<tr>
<td>fn:timezone-from-time(xs:time('14:30:00+02:30'))</td>
<td>PT2H30M</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-timezone-from-time" class="hyperlink" target="_blank">Timezone-From-Time</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:seconds-from-time(xs:time?)</code></a>
<div class="content">
Extracts the seconds component from an xs:time value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:time?</td>
<td>Time value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:seconds-from-time(xs:time('21:45:30.5'))</td>
<td>30.5</td>
</tr>
<tr>
<td>fn:seconds-from-time(xs:time('04:15:12.1'))</td>
<td>12.1</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-seconds-from-time" class="hyperlink" target="_blank">Seconds-From-Time</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:minutes-from-time(xs:time?)</code></a>
<div class="content">
Extracts the minutes component from an xs:time value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:time?</td>
<td>Time value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:minutes-from-time(xs:time('21:45:30'))</td>
<td>45</td>
</tr>
<tr>
<td>fn:minutes-from-time(xs:time('04:15:12'))</td>
<td>15</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-minutes-from-time" class="hyperlink" target="_blank">Minutes-From-Time</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:hours-from-time(xs:time?)</code></a>
<div class="content">
Extracts the hours component from an xs:time value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:time?</td>
<td>Time value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:hours-from-time(xs:time('21:45:30'))</td>
<td>21</td>
</tr>
<tr>
<td>fn:hours-from-time(xs:time('04:15:12'))</td>
<td>4</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-hours-from-time" class="hyperlink" target="_blank">Hours-From-Time</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:timezone-from-date(xs:date?)</code></a>
<div class="content">
Extracts the timezone component from an xs:date value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:date?</td>
<td>Date value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:timezone-from-date(xs:date('2023-03-29+02:00'))</td>
<td>PT2H</td>
</tr>
<tr>
<td>fn:timezone-from-date(xs:date('1980-12-15-05:00'))</td>
<td>-PT5H</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-timezone-from-date" class="hyperlink" target="_blank">Timezone-From-Date</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:day-from-date(xs:date?)</code></a>
<div class="content">
Extracts the day component from an xs:date value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:date?</td>
<td>Date value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:day-from-date(xs:date('2023-03-29'))</td>
<td>29</td>
</tr>
<tr>
<td>fn:day-from-date(xs:date('1980-12-15'))</td>
<td>15</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-day-from-date" class="hyperlink" target="_blank">Day-From-Date</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:month-from-date(xs:date?)</code></a>
<div class="content">
Extracts the month component from an xs:date value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:date?</td>
<td>Date value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:month-from-date(xs:date('2023-03-29'))</td>
<td>3</td>
</tr>
<tr>
<td>fn:month-from-date(xs:date('1980-12-15'))</td>
<td>12</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-month-from-date" class="hyperlink" target="_blank">Month-From-Date</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:year-from-date(xs:date?)</code></a>
<div class="content">
Extracts the year component from an xs:date value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:date?</td>
<td>Date value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:year-from-date(xs:date('2023-03-29'))</td>
<td>2023</td>
</tr>
<tr>
<td>fn:year-from-date(xs:date('1980-12-15'))</td>
<td>1980</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-year-from-date" class="hyperlink" target="_blank">Year-From-Date</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:timezone-from-dateTime(xs:dateTime?)</code></a>
<div class="content">
Extracts the timezone component from an xs:dateTime value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>DateTime value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:timezone-from-dateTime(xs:dateTime('2023-03-29T12:30:45-07:00'))</td>
<td>-PT7H</td>
</tr>
<tr>
<td>fn:timezone-from-dateTime(xs:dateTime('2023-12-15T18:45:30+03:30'))</td>
<td>PT3H30M</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-timezone-from-dateTime" class="hyperlink" target="_blank">Timezone-From-DateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:seconds-from-dateTime(xs:dateTime?)</code></a>
<div class="content">
Extracts the seconds component from an xs:dateTime value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>DateTime value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:seconds-from-dateTime(xs:dateTime('2023-03-29T12:30:45'))</td>
<td>45</td>
</tr>
<tr>
<td>fn:seconds-from-dateTime(xs:dateTime('2023-12-15T18:45:30.5-08:00'))
</td>
<td>30.5</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-seconds-from-dateTime" class="hyperlink" target="_blank">Seconds-From-DateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:minutes-from-dateTime(xs:dateTime?)</code></a>
<div class="content">
Extracts the minutes component from an xs:dateTime value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>DateTime value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:minutes-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))</td>
<td>30</td>
</tr>
<tr>
<td>fn:minutes-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))</td>
<td>45</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-minutes-from-dateTime" class="hyperlink" target="_blank">Minutes-From-DateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:hours-from-dateTime(xs:dateTime?)</code></a>
<div class="content">
Extracts the hours component from an xs:dateTime value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>DateTime value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:hours-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))</td>
<td>12</td>
</tr>
<tr>
<td>fn:hours-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))</td>
<td>18</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-hours-from-dateTime" class="hyperlink" target="_blank">Hours-From-DateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:day-from-dateTime(xs:dateTime?)</code></a>
<div class="content">
Extracts the day component from an xs:dateTime value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>DateTime value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:day-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))</td>
<td>29</td>
</tr>
<tr>
<td>fn:day-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))</td>
<td>15</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-day-from-dateTime" class="hyperlink" target="_blank">Day-From-DateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:month-from-dateTime(xs:dateTime?)</code></a>
<div class="content">
Extracts the month component from an xs:dateTime value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>DateTime value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:month-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))</td>
<td>3</td>
</tr>
<tr>
<td>fn:month-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))</td>
<td>12</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-month-from-dateTime" class="hyperlink" target="_blank">Month-From-DateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:year-from-dateTime(xs:dateTime?)</code></a>
<div class="content">
Extracts the year component from an xs:dateTime value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:dateTime?</td>
<td>DateTime value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:year-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))</td>
<td>2023</td>
</tr>
<tr>
<td>fn:year-from-dateTime(xs:dateTime('2023-03-29T12:30:00-08:00'))</td>
<td>2023</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-year-from-dateTime" class="hyperlink" target="_blank">Year-From-DateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:dateTime(xs:date?, xs:time?)</code></a>
<div class="content">
Constructs an xs:dateTime value from an xs:date and an xs:time value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:date?</td>
<td>Date value</td>
</tr>
<tr>
<td>xs:time?</td>
<td>Time value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:dateTime(xs:date('2023-03-29'), xs:time('12:30:00'))</td>
<td>2023-03-29T12:30:00</td>
</tr>
<tr>
<td>fn:dateTime(xs:date('2023-03-29+05:00'), xs:time('12:30:00-08:00'))</td>
<td>2023-03-29T12:30:00-08:00</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-dateTime" class="hyperlink" target="_blank">DateTime</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:seconds-from-duration(xs:duration?)</code></a>
<div class="content">
Returns the seconds component of the duration <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:duration?</td>
<td>Duration from which to extract the seconds component</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:seconds-from-duration(xs:dayTimeDuration('PT1H30M15.5S'))</td>
<td>15.5</td>
</tr>
<tr>
<td>fn:seconds-from-duration(xs:dayTimeDuration('-PT2M10.3S'))</td>
<td>-10.3</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-seconds-from-duration" class="hyperlink" target="_blank">Seconds-From-Duration</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:minutes-from-duration(xs:duration?)</code></a>
<div class="content">
Returns the minutes component of the duration <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:duration?</td>
<td>Duration from which to extract the minutes component</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:minutes-from-duration(xs:dayTimeDuration('PT2H30M'))</td>
<td>30</td>
</tr>
<tr>
<td>fn:minutes-from-duration(xs:dayTimeDuration('-PT1H45M'))</td>
<td>-45</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-minutes-from-duration" class="hyperlink" target="_blank">Minutes-From-Duration</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:hours-from-duration(xs:duration?)</code></a>
<div class="content">
Returns the hours component of the duration <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:duration?</td>
<td>Duration from which to extract the hours component</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:hours-from-duration(xs:dayTimeDuration('PT36H'))</td>
<td>36</td>
</tr>
<tr>
<td>fn:hours-from-duration(xs:dayTimeDuration('-PT12H30M'))</td>
<td>-12</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-hours-from-duration" class="hyperlink" target="_blank">Hours-From-Duration</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:days-from-duration(xs:duration?)</code></a>
<div class="content">
Returns the days component of the duration <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:duration?</td>
<td>Duration from which to extract the days component</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:days-from-duration(xs:dayTimeDuration('P5DT12H30M'))</td>
<td>5</td>
</tr>
<tr>
<td>fn:days-from-duration(xs:dayTimeDuration('-P2DT6H'))</td>
<td>-2</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-days-from-duration" class="hyperlink" target="_blank">Days-From-Duration</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:months-from-duration(xs:duration?)</code></a>
<div class="content">
Returns the months component of the duration <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:duration?</td>
<td>Duration from which to extract the months component</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:months-from-duration(xs:duration('P2Y3M4DT5H6M7S'))</td>
<td>3</td>
</tr>
<tr>
<td>fn:months-from-duration(xs:duration('-P2Y3M4DT5H6M7S'))</td>
<td>-3</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-months-from-duration" class="hyperlink" target="_blank">Months-From-Duration</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:years-from-duration(xs:duration?)</code></a>
<div class="content">
Returns the years component of the duration <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:duration?</td>
<td>Duration from which to extract the years component</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:years-from-duration(xs:duration('P2Y3M4DT5H6M7S'))</td>
<td>2</td>
</tr>
<tr>
<td>fn:years-from-duration(xs:duration('-P2Y3M4DT5H6M7S'))</td>
<td>-2</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-years-from-duration" class="hyperlink" target="_blank">Years-From-Duration</a></code>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Error</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:trace(item()*, xs:string)</code></a>
<div class="content">
Outputs the provided label and value for diagnostic purposes and returns the value
unchanged <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>Value to be traced</td>
</tr>
<tr>
<td>xs:string</td>
<td>Label to be output along with the value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:trace(42, 'The value is:')</td>
<td>Outputs "The value is: 42" for diagnostic purposes and returns 42</td>
</tr>
<tr>
<td>fn:trace(/library/book/title, 'Book title:')</td>
<td>Outputs "Book title: [book title]" for diagnostic purposes and returns
the book title</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-trace" class="hyperlink" target="_blank">Trace</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:error(xs:QName?, xs:string?, $error-object)</code></a>
<div class="content">
Raises an error with the specified error code, description, and error object <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:QName?</td>
<td>Error code (optional)</td>
</tr>
<tr>
<td>xs:string?</td>
<td>Description of the error (optional)</td>
</tr>
<tr>
<td>item()*</td>
<td>Error object (optional)</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:error(xs:QName('err:FOER0000'))</td>
<td>Raise error with the code err:FOER0000</td>
</tr>
<tr>
<td>fn:error(xs:QName('err:FOER0000'), 'Invalid value')</td>
<td>Raise error with the code err:FOER0000 and description "Invalid value"
</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-error" class="hyperlink" target="_blank">Error</a></code>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Misc</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:xml-to-json(node(), map(*))</code></a>
<div class="content">
Converts an XML representation of a JSON value to its JSON serialization<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()</td>
<td>XML representation of a JSON value</td>
</tr>
<tr>
<td>map(*)</td>
<td>Options for the JSON serialization</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:xml-to-json('&lt;map&gt;&lt;string
key="name"&gt;John&lt;/string&gt;&lt;number
key="age"&gt;30&lt;/number&gt;&lt;/map&gt;')</td>
<td>'{"name": "John", "age": 30}'</td>
</tr>
<tr>
<td>fn:xml-to-json('&lt;array&gt;&lt;number&gt;1&lt;/number&gt;&lt;number&gt;2&lt;/number&gt;&lt;number&gt;3&lt;/number&gt;&lt;/array&gt;')
</td>
<td>'[1, 2, 3]'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-xml-to-json" class="hyperlink" target="_blank">XML-to-JSON</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:json-to-xml(item())</code></a>
<div class="content">
Converts a JSON value to its XML representation<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()</td>
<td>JSON value to be converted</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:json-to-xml(map{"name": "John", "age": 30})</td>
<td>
&lt;map&gt;
&lt;string key="name"&gt;John&lt;/string&gt;
&lt;number key="age"&gt;30&lt;/number&gt;
&lt;/map&gt;
</td>
</tr>
<tr>
<td>fn:json-to-xml([1, 2, 3])</td>
<td>
&lt;array&gt;
&lt;number&gt;1&lt;/number&gt;
&lt;number&gt;2&lt;/number&gt;
&lt;number&gt;3&lt;/number&gt;
&lt;/array&gt;
</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-json-to-xml" class="hyperlink" target="_blank">JSON-to-XML</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:json-doc(xs:string)</code></a>
<div class="content">
Parses a JSON document from a URI and returns the corresponding value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string</td>
<td>URI of the JSON document to be parsed</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:json-doc('https://example.com/data.json')</td>
<td>Parsed JSON value from the specified URI</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-json-doc" class="hyperlink" target="_blank">JSON-Doc</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:parse-json(xs:string?)</code></a>
<div class="content">
Parses a JSON string and returns the corresponding value<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>JSON string to be parsed</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:parse-json('{"name": "John", "age": 30}')</td>
<td>map{"name": "John", "age": 30}</td>
</tr>
<tr>
<td>fn:parse-json('[1, 2, 3]')</td>
<td>[1, 2, 3]</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-parse-json" class="hyperlink" target="_blank">Parse-JSON</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:function-arity(function(*))</code></a>
<div class="content">
Returns the arity (number of arguments) of the specified function<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>function(*)</td>
<td>The function to obtain the arity for</td>
</tr>
<tr>
<td>xs:integer</td>
<td>The arity (number of arguments) of the specified function</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>function-arity(fn:substring)</td>
<td>Returns the arity of the substring function: <code>2</code> (since
substring accepts two required arguments: the input string and the
starting index)</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-function-arity" class="hyperlink" target="_blank">function-arity</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:function-name(function(*))</code></a>
<div class="content">
Returns the QName of the specified function<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>function(*)</td>
<td>The function to obtain the QName for</td>
</tr>
<tr>
<td>xs:QName?</td>
<td>The QName of the specified function, or an empty sequence if the
function is anonymous</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>function-name(fn:substring)</td>
<td>Returns the QName of the substring function:
<code>QName("http://www.w3.org/2005/xpath-functions", "substring")</code>
</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-function-name" class="hyperlink" target="_blank">function-name</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:function-lookup(xs:QName, xs:integer)</code></a>
<div class="content">
Returns a function with the specified QName and arity if available, otherwise
returns an empty sequence<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:QName</td>
<td>Function name as QName</td>
</tr>
<tr>
<td>xs:integer</td>
<td>Arity of the function</td>
</tr>
<tr>
<td>function(*)?</td>
<td>A function with the specified QName and arity if available, otherwise an
empty sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>function-lookup(QName('http://www.w3.org/2005/xpath-functions',
'substring'), 2)</td>
<td>Returns the substring function with arity 2, if available</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-function-lookup" class="hyperlink" target="_blank">function-lookup</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:static-base-uri()</code></a>
<div class="content">
Returns the static base URI as an xs:anyURI, if available<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Function takes no arguments</td>
</tr>
<tr>
<td>xs:anyURI?</td>
<td>The static base URI, if available; otherwise, an empty sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>static-base-uri()</td>
<td>Returns the static base URI as an xs:anyURI, if available, e.g.,
'https://www.example.com/base/'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-static-base-uri" class="hyperlink" target="_blank">static-base-uri</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:default-collation()</code></a>
<div class="content">
Returns the default collation URI as an xs:string<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>Function takes no arguments</td>
</tr>
<tr>
<td>xs:string</td>
<td>The default collation URI as a string</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>default-collation()</td>
<td>Returns the default collation URI as an xs:string, e.g.,
'http://www.w3.org/2005/xpath-functions/collation/codepoint'</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-default-collation" class="hyperlink" target="_blank">default-collation</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:serialize(item()?, item()?)</code></a>
<div class="content">
Serializes an XML node, producing a string representation of the node<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()?</td>
<td>An XML node to serialize</td>
</tr>
<tr>
<td>item()?</td>
<td>Serialization options as a map, with key-value pairs defining the
serialization parameters (optional)</td>
</tr>
<tr>
<td>xs:string?</td>
<td>A string representation of the serialized XML node or an empty sequence
if the input is an empty sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:serialize(&lt;item>Item 1&lt;/item>)</td>
<td>Returns '&lt;item>Item 1&lt;/item>'</td>
</tr>
<tr>
<td>fn:serialize(&lt;item>Item 1&lt;/item>, map{'method': 'xml', 'indent':
'yes'})</td>
<td>Returns an indented XML string representation of the input node</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-serialize" class="hyperlink" target="_blank">serialize</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:parse-xml-fragment(xs:string?)</code></a>
<div class="content">
Parses a string containing an XML fragment and returns a corresponding document
node<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>A string containing an XML fragment</td>
</tr>
<tr>
<td>document-node(element(*))?</td>
<td>A document node containing the parsed XML fragment or an empty sequence
if the input is an empty sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:parse-xml-fragment('&lt;item>Item 1&lt;/item>&lt;item>Item
2&lt;/item>')</td>
<td>Returns a document node containing the parsed XML fragment</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-parse-xml-fragment" class="hyperlink" target="_blank">parse-xml-fragment</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:parse-xml(xs:string?)</code></a>
<div class="content">
Parses a string containing an XML document and returns a corresponding document
node<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>A string containing an XML document</td>
</tr>
<tr>
<td>document-node(element(*))?</td>
<td>A document node containing the parsed XML content or an empty sequence
if the input is an empty sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:parse-xml('&lt;root>&lt;item>Item 1&lt;/item>&lt;/root>')</td>
<td>Returns a document node containing the parsed XML content</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-parse-xml" class="hyperlink" target="_blank">parse-xml</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:available-environment-variables()</code></a>
<div class="content">
Retrieves a sequence of the names of all available environment variables<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>None</td>
<td>No argument is required</td>
</tr>
<tr>
<td>xs:string*</td>
<td>A sequence of the names of all available environment variables</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:available-environment-variables()</td>
<td>Returns a sequence of the names of all available environment variables
</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-available-environment-variables" class="hyperlink" target="_blank">available-environment-variables</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:environment-variable(xs:string)</code></a>
<div class="content">
Retrieves the value of an environment variable<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string</td>
<td>The name of the environment variable</td>
</tr>
<tr>
<td>xs:string?</td>
<td>The value of the environment variable, or an empty sequence if the
variable is not set</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:environment-variable("PATH")</td>
<td>Returns the value of the PATH environment variable, or an empty sequence
if the variable is not set</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-environment-variable" class="hyperlink" target="_blank">environment-variable</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:uri-collection(xs:string?)</code></a>
<div class="content">
Returns a sequence of URIs in a collection identified by a URI<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>The URI identifying the collection of URIs</td>
</tr>
<tr>
<td>xs:anyURI*</td>
<td>A sequence of URIs in the collection</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:uri-collection("http://www.example.com/collection/")</td>
<td>Returns a sequence of URIs in the collection identified by the specified
URI
</td>
</tr>
<tr>
<td>fn:uri-collection()</td>
<td>Returns a sequence of URIs in the default collection, if one is defined
</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-uri-collection" class="hyperlink" target="_blank">uri-collection</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:doc-available(xs:string?)</code></a>
<div class="content">
Tests whether an XML document is available at a given URI<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>The URI of the XML document to be tested</td>
</tr>
<tr>
<td>xs:boolean</td>
<td>True if the XML document is available, otherwise false</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:doc-available("http://www.example.com/books.xml")</td>
<td>Returns true if the XML document located at the specified URI is
available, otherwise false</td>
</tr>
<tr>
<td>fn:doc-available("")</td>
<td>Returns true if the XML document containing the context item is
available, otherwise false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-doc-available" class="hyperlink" target="_blank">doc-available</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:doc(xs:string?)</code></a>
<div class="content">
Loads an XML document from a URI and returns the document node<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>The URI of the XML document to be loaded</td>
</tr>
<tr>
<td>document-node()?</td>
<td>The document node of the loaded XML document</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:doc("http://www.example.com/books.xml")</td>
<td>Loads the XML document located at the specified URI and returns its
document node</td>
</tr>
<tr>
<td>fn:doc("")</td>
<td>Returns the document node of the XML document containing the context
item</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-doc" class="hyperlink" target="_blank">doc</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:generate-id(node()?)</code></a>
<div class="content">
Returns a unique identifier for the specified node<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node()?</td>
<td>Input node for which the unique identifier is to be generated</td>
</tr>
<tr>
<td>xs:string</td>
<td>Unique identifier for the specified node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:generate-id(/bookstore/book[1])</td>
<td>A unique identifier for the first &lt;book&gt; element in the
&lt;bookstore&gt;</td>
</tr>
<tr>
<td>fn:generate-id(.)</td>
<td>A unique identifier for the context node</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-generate-id" class="hyperlink" target="_blank">generate-id</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:idref(xs:string*)</code></a>
<div class="content">
Returns a sequence of nodes that are referenced by the specified IDREF attribute
values<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string*</td>
<td>Input sequence of IDREF attribute values</td>
</tr>
<tr>
<td>node()*</td>
<td>Sequence of nodes referenced by the specified IDREF attribute values
</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:idref("reference42")</td>
<td>Nodes referenced by the IDREF attribute value "reference42"</td>
</tr>
<tr>
<td>fn:idref(("ref1", "ref2", "ref3"))</td>
<td>Nodes referenced by the IDREF attribute values "ref1", "ref2", and
"ref3"</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-idref" class="hyperlink" target="_blank">idref</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:id(xs:string*)</code></a>
<div class="content">
Returns a sequence of elements with the specified ID attribute values<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string*</td>
<td>Input sequence of ID attribute values</td>
</tr>
<tr>
<td>element()*</td>
<td>Sequence of elements with the specified ID attribute values</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:id("item42")</td>
<td>Element with the ID attribute value "item42"</td>
</tr>
<tr>
<td>fn:id(("item1", "item2", "item3"))</td>
<td>Elements with the ID attribute values "item1", "item2", and "item3"</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-id" class="hyperlink" target="_blank">id</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:lang(xs:string, node()?)</code></a>
<div class="content">
Returns true if the language of the specified node or its nearest ancestor matches
the given language code<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string</td>
<td>Language code to test</td>
</tr>
<tr>
<td>node()?</td>
<td>Optional node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:lang("en", /book/title)</td>
<td>true</td>
</tr>
<tr>
<td>fn:lang("fr", /book/title)</td>
<td>false</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-lang" class="hyperlink" target="_blank">lang</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:in-scope-prefixes(element())</code></a>
<div class="content">
Returns a sequence of strings representing the prefixes of the in-scope namespaces
for the specified element<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>element()</td>
<td>Element node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:in-scope-prefixes(/*)</td>
<td>("xml", "x")</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-in-scope-prefixes" class="hyperlink" target="_blank">in-scope-prefixes</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:namespace-uri-for-prefix(xs:string?, element())</code></a>
<div class="content">
Returns the namespace URI associated with the given prefix, using the in-scope
namespaces for the specified element<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Prefix</td>
</tr>
<tr>
<td>element()</td>
<td>Element node</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:namespace-uri-for-prefix('x', /*)</td>
<td>"http://www.example.com/ns"</td>
</tr>
<tr>
<td>fn:namespace-uri-for-prefix('', /*)</td>
<td>""</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-namespace-uri-for-prefix" class="hyperlink" target="_blank">namespace-uri-for-prefix</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:namespace-uri-from-QName(xs:QName?)</code></a>
<div class="content">
Returns the namespace URI of the given QName value, or an empty sequence if there's
no namespace URI<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:QName?</td>
<td>QName value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:namespace-uri-from-QName(fn:QName('http://www.example.com/ns',
'x:local'))</td>
<td>"http://www.example.com/ns"</td>
</tr>
<tr>
<td>fn:namespace-uri-from-QName(fn:QName('', 'local'))</td>
<td>""</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-namespace-uri-from-QName" class="hyperlink" target="_blank">namespace-uri-from-QName</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:local-name-from-QName(xs:QName?)</code></a>
<div class="content">
Returns the local name of the given QName value, or an empty sequence if there's no
local name<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:QName?</td>
<td>QName value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:local-name-from-QName(fn:QName('http://www.example.com/ns',
'x:local'))</td>
<td>"local"</td>
</tr>
<tr>
<td>fn:local-name-from-QName(fn:QName('', 'local'))</td>
<td>"local"</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-local-name-from-QName" class="hyperlink" target="_blank">local-name-from-QName</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:prefix-from-QName(xs:QName?)</code></a>
<div class="content">
Returns the prefix of the given QName value, or an empty sequence if there's no
prefix<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:QName?</td>
<td>QName value</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:prefix-from-QName(fn:QName('http://www.example.com/ns', 'x:local'))
</td>
<td>"x"</td>
</tr>
<tr>
<td>fn:prefix-from-QName(fn:QName('', 'local'))</td>
<td>()</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-prefix-from-QName" class="hyperlink" target="_blank">prefix-from-QName</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:QName(xs:string?, xs:string)</code></a>
<div class="content">
Constructs an xs:QName value from a namespace URI and a lexical QName<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>Namespace URI</td>
</tr>
<tr>
<td>xs:string</td>
<td>Lexical QName</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:QName('http://www.example.com/ns', 'x:local')</td>
<td>QName("http://www.example.com/ns", "x:local")</td>
</tr>
<tr>
<td>fn:QName('', 'local')</td>
<td>QName("", "local")</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-QName" class="hyperlink" target="_blank">QName</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:resolve-QName(xs:string?, element())</code></a>
<div class="content">
Resolves a QName by expanding a prefix using the in-scope namespaces of a given
element<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>QName to resolve</td>
</tr>
<tr>
<td>element()</td>
<td>Element with in-scope namespaces</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>fn:resolve-QName('x:local', $element)</td>
<td>QName("http://www.example.com/ns", "local")</td>
</tr>
<tr>
<td>fn:resolve-QName('local', $element)</td>
<td>QName("", "local")</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-resolve-QName" class="hyperlink" target="_blank">Resolve-QName</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:nilled(node)</code></a>
<div class="content">
Returns a Boolean value indicating whether the argument node is nilled <br>
<br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions/#func-nilled" class="hyperlink" target="_blank">#func-nilled</code></a>
</div>
</div>
</div>
<div class="collapsible">
<span>
<button class="section-button collapseTrigger" style="border: none">Loop /
Conditional</button>
</span>
<div class="content">
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:for-each-pair(item()*, item()*, function(item(), item()))</code></a>
<div class="content">
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<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>The first input sequence of items</td>
</tr>
<tr>
<td>item()*</td>
<td>The second input sequence of items</td>
</tr>
<tr>
<td>function(item(), item())</td>
<td>The processing function used to process pairs of items from the input
sequences</td>
</tr>
<tr>
<td>item()*</td>
<td>The resulting sequence after applying the processing function to pairs
of items</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>for-each-pair((1, 2, 3), ("a", "b"), function($item1, $item2) {
concat($item1, $item2) })</td>
<td>Returns a sequence with the concatenated pairs of items:
<code>("1a", "2b")</code>
</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-for-each-pair" class="hyperlink" target="_blank">for-each-pair</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:filter(item()*, function(item())</code></a>
<div class="content">
Filters a sequence of items based on a given predicate function<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>The input sequence of items</td>
</tr>
<tr>
<td>function(item())</td>
<td>The predicate function used to filter the items</td>
</tr>
<tr>
<td>item()*</td>
<td>The resulting sequence after applying the predicate function</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>filter((1, 2, 3, 4), function($x) { $x mod 2 = 0 })</td>
<td>Returns a new sequence containing only the even numbers from the input
sequence: <code>(2, 4)</code></td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-filter" class="hyperlink" target="_blank">filter</a></code>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:for-each(item()*, function(item()))</code></a>
<div class="content">
Applies a specified function to each item in a sequence, returning a new
sequence<br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>item()*</td>
<td>The input sequence of items</td>
</tr>
<tr>
<td>function(item())</td>
<td>The function to apply to each item in the sequence</td>
</tr>
<tr>
<td>item()*</td>
<td>The new sequence created by applying the function to each item in the
input sequence</td>
</tr>
</table>
<b>Examples:</b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>for-each((1, 2, 3, 4), function($x) { $x * 2 })</td>
<td>Returns a new sequence with the result of doubling each number in the
input sequence: <code>(2, 4, 6, 8)</code></td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-31/#func-for-each" class="hyperlink" target="_blank">for-each</a></code>
</div>
</div>
</div>
</span>
</div>
<!-- Cut here -->
</span>
</div>
</div>
<script>
function processVersionSelector() {
var processor = getProcessor();
var hideableOptions = document.getElementsByClassName("hideable");
for (let i = 0; i < hideableOptions.length; i++) {
hideableOptions[i].style = "display: none;";
}
if (processor == "xalan" || processor == "libxml") {
var xalanOptions = document.getElementsByClassName("xalan");
for (let i = 0; i < xalanOptions.length; i++) {
xalanOptions[i].style = "";
}
document.getElementById("versions").selectedIndex = 0;
}
else {
var saxonOptions = document.getElementsByClassName("saxon");
for (let i = 0; i < saxonOptions.length; i++) {
saxonOptions[i].style = "";
}
document.getElementById("versions").selectedIndex = 3;
}
processTooltip();
}
function processTooltip() {
var filter = "collapse" + getVersion();
var collList;
if (filter == "collapse3.0") {
document.getElementById("tooltipFunctionInfo").innerText = "XPath 3.0 functions";
hideList(document.getElementsByName("collapse10"));
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") {
document.getElementById("tooltipFunctionInfo").innerText = "XPath 2.0 functions";
hideList(document.getElementsByName("collapse10"));
showList(document.getElementsByName("collapse20"));
hideList(document.getElementsByName("collapse30"));
hideList(document.getElementsByName("collapse31"));
} else {
document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0 functions";
showList(document.getElementsByName("collapse10"));
hideList(document.getElementsByName("collapse20"));
hideList(document.getElementsByName("collapse30"));
hideList(document.getElementsByName("collapse31"));
}
}
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") {
var collapsibleData = this.nextElementSibling;
} else {
var collapsibleData = this.parentElement.nextElementSibling;
}
if (collapsibleData.style.maxHeight > "0px") {
collapsibleData.style.maxHeight = "0px";
this.classList.toggle("active", false);
if (!this.classList.contains("collapsibleMini")) {
collapsible.classList.toggle("active", false);
}
var subLists1 = collapsibleData.getElementsByClassName("content");
var subLists2 = collapsibleData.getElementsByClassName("active");
for (j = 0; j < subLists1.length; j++) {
subLists1[j].style.maxHeight = "0px";
}
for (j = 0; j < subLists2.length; j++) {
subLists2[j].classList.toggle("active", false);
}
} else {
collapsibleData.style.maxHeight = (collapsibleData.scrollHeight) + "px";
this.classList.toggle("active", true);
if (!this.classList.contains("collapsibleMini")) {
collapsible.classList.toggle("active", true);
} else {
var parentContent = this.closest(".content");
parentContent.style.maxHeight = (parentContent.scrollHeight + collapsibleData.scrollHeight) + "px";
}
}
});
}
function init() {
// Make sure that only plain text is pasted
configurePastingInElement("xmlArea");
configurePastingInElement("transformArea");
//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 => {
//Check if script was called from textarea or selector
var targetID = event.target.getAttribute('id');
if (targetID == "processors") {
processVersionSelector();
processTooltip();
}
else if (targetID == "versions") {
processTooltip();
}
})
tool.addEventListener('click', event => {
//Check if script was called from textarea or selector
var targetID = event.target.getAttribute('id');
if (targetID !== "xmlArea" && targetID !== "transformArea") {
return;
}
processTooltip();
})
tool.addEventListener('change', event => {
//Check if script was called from textarea or selector
var targetID = event.target.getAttribute('id');
if (targetID !== "xmlArea" && targetID !== "transformArea") {
return;
}
processTooltip();
})
}
</script>
</body>
</html>