Files
release11-tools/Frontend/tools/xpath.html
2023-04-14 08:56:01 +02:00

12049 lines
715 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<!-- <link rel="stylesheet" href="../common.css"> -->
<!-- <link rel="stylesheet" href="styles.css"> -->
<link rel="stylesheet" href="../assets/css/tools/r11form.css">
<script src="../assets/scripts/tools/scripts.js"> </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>
<textarea id="xmlArea" name="xmlArea" rows="15"
class="textarea-300 bordered-field vertically-resizeable max-width"
onblur="setDefaultContent(this, 'Insert XML here');"
onfocus="clearDefaultContent(this, 'Insert XML here');"></textarea>
<br><br>
<label for="transformArea"><b>Insert your XPath:</b></label>
<textarea id="transformArea" name="transformArea" class="bordered-field vertically-resizeable max-width"
rows="4" onblur="setDefaultContent(this, 'Insert XPath expression here');"
onfocus="clearDefaultContent(this, 'Insert XPath expression here');"></textarea>
<br>
<button id="requestButton" class="max-width block-label action-button active"
onclick="performRequest('xpath', false, true)">Execute XPath
expression</button>
<br><br>
<label for="resultArea"><b>Transform result:<span id="procinfo"></span></b></label>
<textarea disabled id="resultArea" name="resultArea"
class="textarea-300 bordered-field vertically-resizeable max-width" style="margin-bottom: 50px;"
rows="10" cols="100"></textarea>
</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>
<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:count(node-set)</code></a>
<div class="content">
Returns the number of nodes in the node-set <br>
<b>Arguments and return type:</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(object)</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(node-set)</code></a>
<div class="content">
Returns the local-name for the first node in the node-set <br>
<b>Arguments and return type:</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:local-name()</code></a>
<div class="content">
Returns the local-name for the 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:namespace-uri(node-set)</code></a>
<div class="content">
Returns the namespace-uri for the first node in the node-set <br>
<b>Arguments and return type:</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:namespace-uri()</code></a>
<div class="content">
Returns the namespace-uri for the 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:name(node-set)</code></a>
<div class="content">
Returns the name for the first node in the node-set <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>node-set</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>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:name()</code></a>
<div class="content">
Returns the name for the context node <br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>current context node</td>
<td>Extract first node and return QName</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(object)</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 and return type:</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(string)</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 and return type:</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>
</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:last()</code></a>
<div class="content">
Returns the position of the last node in the context list <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>
</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(object)</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 and return type:</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>
</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 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:number(object)</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 and return type:</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>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-Number-Functions" class="hyperlink" target="_blank">Numeric-Functions</code></a>
</div>
</div>
</div>
<div class="collapsible">
<span name="collapse20">
<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:avg((arg,arg,...))</code></a>
<div class="content">
Returns the average of the argument values <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>sequence*</td>
<td>returns average value of provided elements</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>avg((1,2,3))</td>
<td>2</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions/#func-avg" class="hyperlink" target="_blank">#func-avg</code></a>
</div>
</div>
</div>
<div class="collapsible">
<span name="collapse20">
<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:adjust-date-to-timezone(date,timezone)</code></a>
<div class="content">
If the timezone argument is empty, it returns a date without a timezone. Otherwise,
it returns a date with a timezone <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>date</td>
<td>date to be adjusted</td>
</tr>
<tr>
<td>timezone</td>
<td>timezone to be imposed into date</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>adjust-date-to-timezone(xs:date('2011-11-15'),
xs:dayTimeDuration("PT10H"))</td>
<td>2011-11-15+10:00</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions/#func-adjust-date-to-timezone" class="hyperlink" target="_blank">#func-adjust-date-to-timezone</code></a>
</div>
</div>
</div>
<div class="collapsible">
<span name="collapse20">
<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">
https://www.w3.org/TR/xpath-functions/#func-error <br>
<br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions/#func-error" class="hyperlink" target="_blank">#func-error</code></a>
</div>
</div>
</div>
<div class="collapsible">
<span name="collapse20">
<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: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>
</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()*) as 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()*) as 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()?) as xs:boolean</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()?) as xs:string</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()?) as 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()?) as xs:anyURI</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()?) as xs:string</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()?) as xs:string</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()*) as xs:boolean</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() as xs:boolean</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() as xs:boolean</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()*) as xs:boolean</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?) as xs:boolean</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?) as 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?) as 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?) as 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?) as 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?) as 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?) as xs:anyURI?</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?) as element(fn:analyze-string-result)</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?) as 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?) as 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?) as xs:boolean</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?) as 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?) as 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?) as xs:boolean</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?) as xs:boolean</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?) as xs:boolean</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) as 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?) as 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?) as 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) as 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?) as 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?) as xs:integer</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) as xs:string</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) as 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?, ...) as xs:string</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?) as xs:boolean?</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?) as xs:integer?</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?) as xs:integer*</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*) as xs:string</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 as xs:string?) as xs:string</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) as 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?) as 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?) as 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?) as 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?) as 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?) as 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()*) as item()*) as 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()) as item()*) as 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() as xs:integer</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?) as xs:anyAtomicType*</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?) as 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) as xs:anyAtomicType?</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) as xs:anyAtomicType?</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*) as 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()*) as xs:integer</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()*) as 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()*) as 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()*) as 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()*) as xs:boolean</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) as xs:integer*</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*) as 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()*) as 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) as item()*</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()*) as 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) as item()*</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()*) as 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()*) as 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()*) as 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()*) as xs:boolean</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()*) as xs:boolean</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() as xs:dayTimeDuration</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() as xs: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() as xs: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() as xs: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?) as 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?) as 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?) as 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?) as xs:time?</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?) as xs:date?</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?) as xs:dateTime?</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?) as xs:dayTimeDuration?</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?) as xs:decimal?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:dayTimeDuration?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:dayTimeDuration?</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?) as xs:decimal?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:dateTime?</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?) as xs:decimal?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:integer?</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>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:adjust-date-to-timezone(date,timezone)</code></a>
<div class="content">
If the timezone argument is empty, it returns a date without a timezone. Otherwise,
it returns a date with a timezone <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>date</td>
<td>date to be adjusted</td>
</tr>
<tr>
<td>timezone</td>
<td>timezone to be imposed into date</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>adjust-date-to-timezone(xs:date('2011-11-15'),
xs:dayTimeDuration("PT10H"))</td>
<td>2011-11-15+10:00</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions/#func-adjust-date-to-timezone" class="hyperlink" target="_blank">#func-adjust-date-to-timezone</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:trace(item()*, xs:string) as item()*</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 as item()*)</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(*)) as xs:integer</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(*)) as xs:QName?</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) as function(*)?</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() as xs:anyURI?</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() as xs:string</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()?) as xs:string?</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?) as document-node(element(*))?</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?) as document-node(element(*))?</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() as xs:string*</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) as 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?) as xs:anyURI*</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?) as xs:boolean</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?) as document-node()?</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()?) as xs:string</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*) as node()*</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*) as element()*</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()?) as xs:boolean</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()) as xs:string*</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()) as xs:anyURI?</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?) as xs:anyURI?</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?) as xs:NCName?</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?) as xs:NCName?</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) as xs:QName</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()) as xs:QName?</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()) as item()*) as 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()) as xs:boolean) as 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()) as item()*) as 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:outermost(node()*) as 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()*) as 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()?) as xs:boolean</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()?) as xs:string</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()?) as 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()?) as xs:anyURI</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()?) as xs:string</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()?) as xs:string</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()*) as xs:boolean</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() as xs:boolean</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() as xs:boolean</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()*) as xs:boolean</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?) as xs:boolean</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?) as 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?) as 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?) as 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?) as 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?) as 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?) as xs:anyURI?</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?) as element(fn:analyze-string-result)</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?) as 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?) as 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?) as xs:boolean</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?) as 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?) as 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?) as xs:boolean</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?) as xs:boolean</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?) as xs:boolean</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) as 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?) as 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?) as 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) as 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?) as 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?) as xs:integer</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) as xs:string</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) as 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?, ...) as xs:string</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?) as xs:boolean?</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?) as xs:integer?</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?) as xs:integer*</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*) as xs:string</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()?) as xs:string</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) as 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?) as 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?) as 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?) as 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?) as 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?) as 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:fold-right(item()*, item()*, function(item(), item()*) as item()*) as 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()) as item()*) as 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() as xs:integer</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?) as document-node()*</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?) as 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*) as 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*) as 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*) as 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()*) as xs:integer</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()*) as 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()*) as 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()*) as 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()*) as xs:boolean</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) as xs:integer*</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*) as 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()*) as 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) as item()*</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()*) as 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) as item()*</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()*) as 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()*) as 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()*) as 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()*) as xs:boolean</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()*) as xs:boolean</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() as xs:dayTimeDuration</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() as xs: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() as xs: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() as xs: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?) as 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?) as 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?) as 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?) as xs:time?</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?) as xs:date?</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?) as xs:dateTime?</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?) as xs:dayTimeDuration?</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?) as xs:decimal?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:dayTimeDuration?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:dayTimeDuration?</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?) as xs:decimal?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:dateTime?</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?) as xs:decimal?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:integer?</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?) as xs:integer?</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>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:adjust-date-to-timezone(date,timezone)</code></a>
<div class="content">
If the timezone argument is empty, it returns a date without a timezone. Otherwise,
it returns a date with a timezone <br>
<b>Arguments and return type:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>date</td>
<td>date to be adjusted</td>
</tr>
<tr>
<td>timezone</td>
<td>timezone to be imposed into date</td>
</tr>
</table><b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>adjust-date-to-timezone(xs:date('2011-11-15'),
xs:dayTimeDuration("PT10H"))</td>
<td>2011-11-15+10:00</td>
</tr>
</table><br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions/#func-adjust-date-to-timezone" class="hyperlink" target="_blank">#func-adjust-date-to-timezone</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:trace(item()*, xs:string) as item()*</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 as item()*)</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:function-arity(function(*)) as xs:integer</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(*)) as xs:QName?</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) as function(*)?</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() as xs:anyURI?</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() as xs:string</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()?) as xs:string?</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?) as document-node(element(*))?</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?) as document-node(element(*))?</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() as xs:string*</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) as 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?) as xs:anyURI*</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?) as xs:boolean</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?) as document-node()?</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()?) as xs:string</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*) as node()*</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*) as element()*</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()?) as xs:boolean</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()) as xs:string*</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()) as xs:anyURI?</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?) as xs:anyURI?</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?) as xs:NCName?</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?) as xs:NCName?</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) as xs:QName</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()) as xs:QName?</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()) as item()*) as 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()) as xs:boolean) as 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()) as item()*) as 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() {
//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>