Files
release11-tools/Frontend/tools/xpath.html

3061 lines
173 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: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>
<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>
</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($arg as 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($arg as 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:escape-html-uri($uri as 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($iri as 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($uriPart as 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($relative as xs:string?, $base as 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($input as xs:string?, $pattern as xs:string, $flags as 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($input as xs:string?, $pattern as xs:string, $flags as 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($input as xs:string?, $pattern as xs:string, $replacement as xs:string, $flags as 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($input as xs:string?, $pattern as xs:string, $flags as 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($arg1 as xs:string?, $arg2 as 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($arg1 as xs:string?, $arg2 as 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($arg1 as xs:string?, $arg2 as 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($arg1 as xs:string?, $arg2 as 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($arg1 as xs:string?, $arg2 as 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($arg as xs:string?, $mapString as xs:string, $transString as 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($arg as 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($arg as 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($arg as xs:string?, $normalizationForm as 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($arg as 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($arg as 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($sourceString as xs:string?, $startingLoc as 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($arg1 as xs:string*, $separator as 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($arg1 as xs:anyAtomicType?, $arg2 as 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($comparand1 as xs:string?, $comparand2 as 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($comparand1 as xs:string?, $comparand2 as 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($arg as 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($arg as 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($value as numeric?, $picture as 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($value as xs:integer?, $picture as 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($arg as 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($arg as 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($arg as 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($arg as 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($arg as 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: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 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:dateTime($arg1 as xs:date?, $arg2 as 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($arg as 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($arg as 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($arg as 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($arg as 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($arg as 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($arg as 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($value as item()*, $label as 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($error as xs:QName?, $description as 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: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(sequence*, function)</code></a>
<div class="content">
Applies function item to every element in sequence <br>
<br>
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions-30/#func-for-each" class="hyperlink" target="_blank">#func-for-each</code></a>
</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>