2783 lines
		
	
	
		
			171 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			2783 lines
		
	
	
		
			171 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:name()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns the name of a node, as an xs:string that is either the zero-length string, or has the lexical form of an xs:QName.<br>
 | |
| 
 | |
|                                 If the argument is omitted, it defaults to the context item (.). The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.<br>
 | |
| 
 | |
|                                 The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.<br>
 | |
| 
 | |
|                                 If the argument is supplied and is the empty sequence, the function returns the zero-length string.<br>
 | |
| 
 | |
|                                 If the target node has no name (that is, if it is a document node, a comment, a text node, or a namespace binding having no name), the function returns the zero-length string.<br>
 | |
| 
 | |
|                                 Otherwise, the value returned is fn:string(fn:node-name($arg)).<br>
 | |
|                                 <br>
 | |
|                                 <b>Arguments:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>node?</td>
 | |
|                                         <td>Node to display name.</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:string<br><br>
 | |
| 
 | |
|                                 <b>Examples:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Query</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>name(/l:library)</td>
 | |
|                                         <td>l:library</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-name" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                             class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:local-name()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns the local part of the name of $arg as an xs:string that will either be the zero-length string or will have the lexical form of an xs:NCName.<br>
 | |
| 
 | |
|                                 If the argument is omitted, it defaults to the context item (.). The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.<br>
 | |
| 
 | |
|                                 The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.<br>
 | |
| 
 | |
|                                 If the argument is supplied and is the empty sequence, the function returns the zero-length string.<br>
 | |
| 
 | |
|                                 If the target node has no name (that is, if it is a document node, a comment, or a text node), the function returns the zero-length string.<br>
 | |
| 
 | |
|                                 Otherwise, the value returned will be the local part of the expanded-QName of the target node (as determined by the dm:node-name accessor in Section 5.11 node-name Accessor). This will be an xs:string whose lexical form is an xs:NCName.<br>
 | |
| 
 | |
|                                 <br>
 | |
|                                 <b>Arguments:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>node?</td>
 | |
|                                         <td>Node to display local-name.</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:string<br><br>
 | |
|                                 <b>Examples:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Query</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>name(/l:library)</td>
 | |
|                                         <td>library</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
| 
 | |
|                                 <a href=https://www.w3.org/TR/xquery-operators/#func-local-name" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                             class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:nilled()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns an xs:boolean indicating whether the argument node is "nilled". If the argument is not an element node, returns the empty sequence. If the argument is the empty sequence, returns the empty sequence.<br>
 | |
| 
 | |
|                                 <br>
 | |
|                                 <b>Arguments:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>node?</td>
 | |
|                                         <td>Node to test.</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:boolean?<br><br>
 | |
|                                 <b>Examples:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Query</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>nilled(/l:library)</td>
 | |
|                                         <td>false</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
| 
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-nilled" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                             class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:base-uri()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns the value of the base-uri URI property for $arg as defined by the accessor function dm:base-uri() for that kind of node in Section 5.2 base-uri AccessorDM. If $arg is not specified, the behavior is identical to calling the function with the context item (.) as argument. The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.<br>
 | |
| 
 | |
|                                 If $arg is the empty sequence, the empty sequence is returned.<br>
 | |
|                                 
 | |
|                                 Document, element and processing-instruction nodes have a base-uri property which may be empty. The base-uri property of all other node types is the empty sequence. The value of the base-uri property is returned if it exists and is not empty. Otherwise, if the node has a parent, the value of dm:base-uri() applied to its parent is returned, recursively. If the node does not have a parent, or if the recursive ascent up the ancestor chain encounters a node whose base-uri property is empty and it does not have a parent, the empty sequence is returned.<br>
 | |
| 
 | |
|                                 <br>
 | |
|                                 <b>Arguments:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>node?</td>
 | |
|                                         <td>Node to find base URI of.</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:anyURI?<br><br>
 | |
|                                 <b>Examples:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Query</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>base-uri(/l:library/l:libraryName)</td>
 | |
|                                         <td><empty sequence></td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
| 
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-base-uri" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                             class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:document-uri()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns the value of the document-uri property for $arg as defined by the dm:document-uri accessor function defined in Section 6.1.2 AccessorsDM.<br>
 | |
| 
 | |
|                                 If $arg is the empty sequence, the empty sequence is returned.<br>
 | |
| 
 | |
|                                 Returns the empty sequence if the node is not a document node. Otherwise, returns the value of the dm:document-uri accessor of the document node.<br>
 | |
| 
 | |
|                                 In the case of a document node $D returned by the fn:doc function, or a document node at the root of a tree containing a node returned by the fn:collection function, it will always be true that either fn:document-uri($D) returns the empty sequence, or that the following expression is true: fn:doc(fn:document-uri($D)) is $D. It is implementation-defined whether this guarantee also holds for document nodes obtained by other means, for example a document node passed as the initial context node of a query or transformation.<br>
 | |
| 
 | |
|                                 <br>
 | |
|                                 <b>Arguments:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>node?</td>
 | |
|                                         <td>Node which document-uri value needs to be returned.</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:anyURI?<br><br>
 | |
|                                 <b>Examples:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Query</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>document-uri(/l:library/l:libraryName)</td>
 | |
|                                         <td><empty sequence></td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
| 
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-document-uri" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn: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/xquery-operators/#func-local-name" 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:true()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns the xs:boolean value true. Equivalent to xs:boolean("1").<br><br>
 | |
|                                 
 | |
|                                 <b>Return type:</b> xs:boolean<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>true()</td>
 | |
|                                         <td>true</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-true" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:false()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns the xs:boolean value false. Equivalent to xs:boolean("0").<br><br>
 | |
| 
 | |
|                                 <b>Return type:</b> xs:boolean<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>false()</td>
 | |
|                                         <td>false</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-false" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:not()</code></a>
 | |
|                             <div class="content">
 | |
|                                 $arg is first reduced to an effective boolean value by applying the fn:boolean() function. Returns true if the effective boolean value is false, and false if the effective boolean value is true.<br><br>
 | |
|                                 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>item</td>
 | |
|                                         <td>$arg</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:boolean<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>not(false())</td>
 | |
|                                         <td>true</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>not(true())</td>
 | |
|                                         <td>false</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-false" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
|     
 | |
|     
 | |
|                         </div>
 | |
|                     </div>
 | |
|                     <div class="collapsible">
 | |
|                         <span>
 | |
|                             <button class="section-button collapseTrigger" style="border: none">String</button>
 | |
|                         </span>
 | |
|                         <div class="content">
 | |
|     
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:string(object)</code></a>
 | |
|                             <div class="content">
 | |
|                                     Returns the value of $arg represented as a xs:string. If no argument is supplied, the context item (.) is used as the default argument. The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.<br>
 | |
| 
 | |
|                                     If the context item is undefined, error [err:XPDY0002]XP is raised.<br>
 | |
|                                     
 | |
|                                     If $arg is the empty sequence, the zero-length string is returned.<br>
 | |
|                                     
 | |
|                                     If $arg is a node, the function returns the string-value of the node, as obtained using the dm:string-value accessor defined in the Section 5.13 string-value AccessorDM.<br>
 | |
|                                     
 | |
|                                     If $arg is an atomic value, then the function returns the same string as is returned by the expression " $arg cast as xs:string " (see 17 Casting).<br>
 | |
|                                     <b>Arguments and return type:</b>
 | |
|                                     <table class="table-doc">
 | |
|                                         <tr>
 | |
|                                             <th>Type</th>
 | |
|                                             <th>Description</th>
 | |
|                                         </tr>
 | |
|                                         <tr>
 | |
|                                             <td>string</td>
 | |
|                                             <td>The object to convert to a string</td>
 | |
|                                         </tr>
 | |
|                                     </table>
 | |
|                                     <b>Return type:</b> xs:string<br><br>
 | |
|                                     <b>Examples: </b><br>
 | |
|                                     <table class="table-doc">
 | |
|                                         <tr>
 | |
|                                             <th>Expression</th>
 | |
|                                             <th>Result</th>
 | |
|                                         </tr>
 | |
|                                         <tr>
 | |
|                                             <td>string((1<0))</td>
 | |
|                                             <td>false</td>
 | |
|                                         </tr>
 | |
|                                         <tr>
 | |
|                                             <td>string(.11)</td>
 | |
|                                             <td>0.11</td>
 | |
|                                         </tr>
 | |
|                                     </table><br>
 | |
|                                     <a href="https://www.w3.org/TR/xquery-operators/#func-string" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
|     
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:codepoints-to-string()</code></a>
 | |
|                             <div class="content">
 | |
|                                     Creates an xs:string from a sequence of The Unicode Standard code points. Returns the zero-length string if $arg is the empty sequence. If any of the code points in $arg is not a legal XML character, an error is raised [err:FOCH0001].<br>
 | |
|                                     <b>Arguments and return type:</b>
 | |
|                                     <table class="table-doc">
 | |
|                                         <tr>
 | |
|                                             <th>Type</th>
 | |
|                                             <th>Description</th>
 | |
|                                         </tr>
 | |
|                                         <tr>
 | |
|                                             <td>xs:integer*</td>
 | |
|                                             <td>$arg</td>
 | |
|                                         </tr>
 | |
|                                     </table>
 | |
|                                     <b>Return type:</b> xs:string<br><br>
 | |
|                                     <b>Examples: </b><br>
 | |
|                                     <table class="table-doc">
 | |
|                                         <tr>
 | |
|                                             <th>Expression</th>
 | |
|                                             <th>Result</th>
 | |
|                                         </tr>
 | |
|                                         <tr>
 | |
|                                             <td>codepoints-to-string((2309, 2358, 2378, 2325))</td>
 | |
|                                             <td>अशॊक</td>
 | |
|                                         </tr>
 | |
|                                         <tr>
 | |
|                                             <td>codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41))</td>
 | |
|                                             <td>( ͡° ͜ʖ ͡°)</td>
 | |
|                                         </tr>
 | |
|                                     </table><br>
 | |
|                                     <a href="https://www.w3.org/TR/xquery-operators/#func-codepoints-to-string" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:string-to-codepoints()</code></a>
 | |
|                             <div class="content">
 | |
|                                     Returns the sequence of The Unicode Standard code points that constitute an xs:string. If $arg is a zero-length string or the empty sequence, the empty sequence is returned.<br>
 | |
|                                     <b>Arguments and return type:</b>
 | |
|                                     <table class="table-doc">
 | |
|                                         <tr>
 | |
|                                             <th>Type</th>
 | |
|                                             <th>Description</th>
 | |
|                                         </tr>
 | |
|                                         <tr>
 | |
|                                             <td>xs:string*</td>
 | |
|                                             <td>$arg</td>
 | |
|                                         </tr>
 | |
|                                     </table>
 | |
|                                     <b>Return type:</b> xs:integer*<br><br>
 | |
|                                     <b>Examples: </b><br>
 | |
|                                     <table class="table-doc">
 | |
|                                         <tr>
 | |
|                                             <th>Expression</th>
 | |
|                                             <th>Result</th>
 | |
|                                         </tr>
 | |
|                                         <tr>
 | |
|                                             <td>string-to-codepoints("Thérèse")</td>
 | |
|                                             <td>(84, 104, 233, 114, 232, 115, 101)</td>
 | |
|                                         </tr>
 | |
|                                     </table><br>
 | |
|                                     <a href="https://www.w3.org/TR/xquery-operators/#func-string-to-codepoints" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:compare()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns -1, 0, or 1, depending on whether the value of the $comparand1 is respectively less than, equal to, or greater than the value of $comparand2, according to the rules of the collation that is used.<br>
 | |
| 
 | |
|                                 The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations.<br>
 | |
|                                 
 | |
|                                 If either argument is the empty sequence, the result is the empty sequence.<br>
 | |
|                                 
 | |
|                                 This function, invoked with the first signature, backs up the "eq", "ne", "gt", "lt", "le" and "ge" operators on string values.<br>
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$comparand1</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$comparand2</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string</td>
 | |
|                                         <td>$collation (Optional)</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:integer*<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>compare('abc', 'abc')</td>
 | |
|                                         <td>0</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>compare('abc', 'acc')</td>
 | |
|                                         <td>-1</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>compare('abc', 'acc')</td>
 | |
|                                         <td>1</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-compare" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:codepoint-equal()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns true or false depending on whether the value of $comparand1 is equal to the value of $comparand2, according to the <a href="http://www.w3.org/2005/xpath-functions/collation/codepoint)">Unicode code point collation</a>.<br>
 | |
| 
 | |
|                                 If either argument is the empty sequence, the result is the empty sequence.<br>
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$comparand1</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$comparand2</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:boolean?<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>codepoint-equal("asdf", "asdf")</td>
 | |
|                                         <td>true</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>codepoint-equal("asdf", "asdf ")</td>
 | |
|                                         <td>false</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-codepoint-equal" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:codepoint-equal()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Accepts two or more xs:anyAtomicType arguments and casts them to xs:string. Returns the xs:string that is the concatenation of the values of its arguments after conversion. If any of the arguments is the empty sequence, the argument is treated as the zero-length string.<br>
 | |
| 
 | |
|                                 The fn:concat function is specified to allow two or more arguments, which are concatenated together. This is the only function specified in this document that allows a variable number of arguments. This capability is retained for compatibility with [XML Path Language (XPath) Version 1.0].<br>
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:anyAtomicType?</td>
 | |
|                                         <td>$arg1</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:anyAtomicType?</td>
 | |
|                                         <td>$arg2</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:anyAtomicType?</td>
 | |
|                                         <td>$arg... (Optional)</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:string<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>concat('un', 'grateful')</td>
 | |
|                                         <td>ungrateful</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>concat('Thy ', (), 'old ', "groans", "", ' ring', ' yet', ' in', ' my', ' ancient',' ears.')</td>
 | |
|                                         <td>Thy old groans ring yet in my ancient ears.</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>fn:concat('Ciao!',())</td>
 | |
|                                         <td>Ciao!</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-concat" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:string-join()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns a xs:string created by concatenating the members of the $arg1 sequence using $arg2 as a separator. If the value of $arg2 is the zero-length string, then the members of $arg1 are concatenated without a separator.<br>
 | |
| 
 | |
|                                 If the value of $arg1 is the empty sequence, the zero-length string is returned.<br>
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string*</td>
 | |
|                                         <td>$arg1</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string</td>
 | |
|                                         <td>$arg2</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:string<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>string-join(('Now', 'is', 'the', 'time', '...'), ' ')</td>
 | |
|                                         <td>Now is the time ...</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>string-join(('Blow, ', 'blow, ', 'thou ', 'winter ', 'wind!'), '')</td>
 | |
|                                         <td>Blow, blow, thou winter wind!</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-string-join" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
|     
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:substring()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns the portion of the value of $sourceString beginning at the position indicated by the value of $startingLoc and continuing for the number of characters indicated by the value of $length. The characters returned do not extend beyond $sourceString. If $startingLoc is zero or negative, only those characters in positions greater than zero are returned.<br>
 | |
|                                 More specifically, the three argument version of the function returns the characters in $sourceString whose position $p obeys:<br>
 | |
|                                 <code>fn:round($startingLoc) <= $p < fn:round($startingLoc) + fn:round($length)</code><br>
 | |
|                                 The two argument version of the function assumes that $length is infinite and returns the characters in $sourceString whose position $p obeys:<br>
 | |
|                                 <code>fn:round($startingLoc) <= $p < fn:round(INF)</code><br>
 | |
|                                 In the above computations, the rules for op:numeric-less-than() and op:numeric-greater-than() apply.<br>
 | |
|                                 If the value of $sourceString is the empty sequence, the zero-length string is returned.<br>
 | |
| 
 | |
|                                 <strong>Note:</strong><br>
 | |
|                                 The first character of a string is located at position 1, not position 0.<br>
 | |
| 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$sourceString</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:double</td>
 | |
|                                         <td>$startingLoc</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:double</td>
 | |
|                                         <td>$length (Optional)</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:string<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>substring("motor car", 6)</td>
 | |
|                                         <td>" car"</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>substring("metadata", 4, 3)</td>
 | |
|                                         <td>ada</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-substring" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:string-length()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns an xs:integer equal to the length in characters of the value of $arg.<br>
 | |
| 
 | |
|                                 If the value of $arg is the empty sequence, the xs:integer 0 is returned.<br>
 | |
| 
 | |
|                                 If no argument is supplied, $arg defaults to the string value (calculated using fn:string()) of the context item (.). If no argument is supplied and the context item is undefined an error is raised: [err:XPDY0002].<br>
 | |
| 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$arg (Optional)</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:integer<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>string-length("Harp not on that string, madam; that is past.")</td>
 | |
|                                         <td>45</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>string-length(())</td>
 | |
|                                         <td>0</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-string-length" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:normalize-space()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns the value of $arg with whitespace normalized by stripping leading and trailing whitespace and replacing sequences of one or more than one whitespace character with a single space, #x20.<br>
 | |
| 
 | |
|                                 If the value of $arg is the empty sequence, returns the zero-length string.<br>
 | |
| 
 | |
|                                 If no argument is supplied, then $arg defaults to the string value (calculated using fn:string()) of the context item (.). If no argument is supplied and the context item is undefined an error is raised: [err:XPDY0002].<br>
 | |
| 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$arg (Optional)</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:string<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>normalize-space(" The  wealthy curled darlings of   our  nation. ")</td>
 | |
|                                         <td>The wealthy curled darlings of our nation.</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>normalize-space(())</td>
 | |
|                                         <td>""</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-normalize-space" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:normalize-unicode()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns the value of $arg normalized according to the normalization criteria for a normalization form identified by the value of $normalizationForm. The effective value of the $normalizationForm is computed by removing leading and trailing blanks, if present, and converting to upper case.<br>
 | |
| 
 | |
|                                 If the value of $arg is the empty sequence, returns the zero-length string.<br>
 | |
| 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$arg</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string</td>
 | |
|                                         <td>$normalizationForm (Optional)</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:string<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>normalize-unicode("test       ")</td>
 | |
|                                         <td>test</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-normalize-unicode" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:upper-case()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns the value of $arg after translating every character to its upper-case correspondent as defined in the appropriate case mappings section in the Unicode standard [The Unicode Standard]. For versions of Unicode beginning with the 2.1.8 update, only locale-insensitive case mappings should be applied. Beginning with version 3.2.0 (and likely future versions) of Unicode, precise mappings are described in default case operations, which are full case mappings in the absence of tailoring for particular languages and environments. Every lower-case character that does not have an upper-case correspondent, as well as every upper-case character, is included in the returned value in its original form.<br>
 | |
| 
 | |
|                                 If the value of $arg is the empty sequence, the zero-length string is returned.<br>
 | |
| 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$arg</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:string<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>upper-case("abCd0")</td>
 | |
|                                         <td>ABCD0</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-upper-case" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:lower-case()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns the value of $arg after translating every character to its lower-case correspondent as defined in the appropriate case mappings section in the Unicode standard [The Unicode Standard]. For versions of Unicode beginning with the 2.1.8 update, only locale-insensitive case mappings should be applied. Beginning with version 3.2.0 (and likely future versions) of Unicode, precise mappings are described in default case operations, which are full case mappings in the absence of tailoring for particular languages and environments. Every upper-case character that does not have a lower-case correspondent, as well as every lower-case character, is included in the returned value in its original form.<br>
 | |
| 
 | |
|                                 If the value of $arg is the empty sequence, the zero-length string is returned.<br>
 | |
| 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$arg</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:string<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>lower-case("abCd0")</td>
 | |
|                                         <td>abcd0</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-lower-case" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:lower-case()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns the value of $arg modified so that every character in the value of $arg that occurs at some position N in the value of $mapString has been replaced by the character that occurs at position N in the value of $transString.<br>
 | |
| 
 | |
|                                 If the value of $arg is the empty sequence, the zero-length string is returned.<br>
 | |
| 
 | |
|                                 Every character in the value of $arg that does not appear in the value of $mapString is unchanged.<br>
 | |
| 
 | |
|                                 Every character in the value of $arg that appears at some position M in the value of $mapString, where the value of $transString is less than M characters in length, is omitted from the returned value. If $mapString is the zero-length string $arg is returned.<br>
 | |
| 
 | |
|                                 If a character occurs more than once in $mapString, then the first occurrence determines the replacement character. If $transString is longer than $mapString, the excess characters are ignored.<br>
 | |
| 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$arg</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string</td>
 | |
|                                         <td>$mapString</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string</td>
 | |
|                                         <td>$mapString</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:string<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>translate("bar","abc","ABC")</td>
 | |
|                                         <td>BAr</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>translate("--aaa--","abc-","ABC")</td>
 | |
|                                         <td>AAA</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>translate("abcdabc", "abc", "AB")</td>
 | |
|                                         <td>ABdAB</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-translate" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:encode-for-uri()</code></a>
 | |
|                             <div class="content">
 | |
|                                 This function encodes reserved characters in an xs:string that is intended to be used in the path segment of a URI. It is invertible but not idempotent. This function applies the URI escaping rules defined in section 2 of [RFC 3986] to the xs:string supplied as $uri-part. The effect of the function is to escape reserved characters. Each such character in the string is replaced with its percent-encoded form as described in [RFC 3986].<br>
 | |
| 
 | |
|                                 If $uri-part is the empty sequence, returns the zero-length string.<br>
 | |
| 
 | |
|                                 All characters are escaped except those identified as "unreserved" by [RFC 3986], that is the upper- and lower-case letters A-Z, the digits 0-9, HYPHEN-MINUS ("-"), LOW LINE ("_"), FULL STOP ".", and TILDE "~".<br>
 | |
| 
 | |
|                                 Note that this function escapes URI delimiters and therefore cannot be used indiscriminately to encode "invalid" characters in a path segment.<br>
 | |
| 
 | |
|                                 Since [RFC 3986] recommends that, for consistency, URI producers and normalizers should use uppercase hexadecimal digits for all percent-encodings, this function must always generate hexadecimal values using the upper-case letters A-F.<br>
 | |
| 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$uri-part</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:string<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>encode-for-uri("https://www.google.com")</td>
 | |
|                                         <td>"https%3A%2F%2Fwww.<br>google.com"</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>concat("http://www.example.com/", encode-for-uri("~bébé"))</td>
 | |
|                                         <td>http://www.example.com/<br>~b%C3%A9b%C3%A9</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>concat("http://www.example.com/", encode-for-uri("100% organic"))</td>
 | |
|                                         <td>http://www.example.com/<br>100%25%20organic</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-encode-for-uri" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:iri-to-uri()</code></a>
 | |
|                             <div class="content">
 | |
|                                 This function converts an xs:string containing an IRI into a URI according to the rules spelled out in Section 3.1 of [RFC 3987]. It is idempotent but not invertible.<br>
 | |
| 
 | |
|                                 If $iri contains a character that is invalid in an IRI, such as the space character (see note below), the invalid character is replaced by its percent-encoded form as described in [RFC 3986] before the conversion is performed.<br>
 | |
|                                 
 | |
|                                 If $iri is the empty sequence, returns the zero-length string.<br>
 | |
| 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$iri</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:string<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>iri-to-uri ("http://www.example.com/00/Weather/CA/Los%20Angeles#ocean")</td>
 | |
|                                         <td>"http://www.example.com/00/<br>Weather/CA/Los%20Angeles#ocean"</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>iri-to-uri ("http://www.example.com/~bébé")</td>
 | |
|                                         <td>http://www.example.com/<br>~b%C3%A9b%C3%A9</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-iri-to-uri" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:escape-html-uri()</code></a>
 | |
|                             <div class="content">
 | |
|                                 This function escapes all characters except printable characters of the US-ASCII coded character set, specifically the octets ranging from 32 to 126 (decimal). The effect of the function is to escape a URI in the manner html user agents handle attribute values that expect URIs. Each character in $uri to be escaped is replaced by an escape sequence, which is formed by encoding the character as a sequence of octets in UTF-8, and then representing each of these octets in the form %HH, where HH is the hexadecimal representation of the octet. This function must always generate hexadecimal values using the upper-case letters A-F.<br>
 | |
|                                 If $uri is the empty sequence, returns the zero-length string.
 | |
| 
 | |
|                                 <h4>Note:</h4>
 | |
|                                 The behavior of this function corresponds to the recommended handling of non-ASCII characters in URI attribute values as described in [HTML 4.0] Appendix B.2.1.<br><br>
 | |
| 
 | |
| 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$uri</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:string<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>escape-html-uri("http://www.example.com/00/Weather/CA/Los Angeles#ocean")</td>
 | |
|                                         <td>http://www.example.com/00/Weather/CA/Los Angeles#ocean</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-escape-html-uri" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:contains()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns an xs:boolean indicating whether or not the value of $arg1 contains (at the beginning, at the end, or anywhere within) at least one sequence of collation units that provides a minimal match to the collation units in the value of $arg2, according to the collation that is used.
 | |
| 
 | |
|                                 If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.<br>
 | |
| 
 | |
|                                 If the value of $arg2 is the zero-length string, then the function returns true.<br>
 | |
| 
 | |
|                                 If the value of $arg1 is the zero-length string, the function returns false.<br>
 | |
| 
 | |
|                                 The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].<br><br>
 | |
| 
 | |
| 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$arg1</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$arg2</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$collation (Optional)</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:boolean<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>contains( "tattoo", "tat")</td>
 | |
|                                         <td>true</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>contains( "tattoo", "ttt")</td>
 | |
|                                         <td>false</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>contains ( "", ())</td>
 | |
|                                         <td>true</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-contains" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:starts-with()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns an xs:boolean indicating whether or not the value of $arg1 starts with a sequence of collation units that provides a match to the collation units of $arg2 according to the collation that is used.
 | |
| 
 | |
|                                 If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.<br>
 | |
| 
 | |
|                                 If the value of $arg2 is the zero-length string, then the function returns true. If the value of $arg1 is the zero-length string and the value of $arg2 is not the zero-length string, then the function returns false.<br>
 | |
| 
 | |
|                                 The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].<br><br>
 | |
| 
 | |
| 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$arg1</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$arg2</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$collation (Optional)</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:boolean<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>starts-with( "tattoo", "tat")</td>
 | |
|                                         <td>true</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>starts-with( "tattoo", "ttt")</td>
 | |
|                                         <td>false</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>starts-with ( "", ())</td>
 | |
|                                         <td>true</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-starts-with" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:ends-with()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns an xs:boolean indicating whether or not the value of $arg1 starts with a sequence of collation units that provides a match to the collation units of $arg2 according to the collation that is used.<br>
 | |
| 
 | |
|                                 If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.<br>
 | |
| 
 | |
|                                 If the value of $arg2 is the zero-length string, then the function returns true. If the value of $arg1 is the zero-length string and the value of $arg2 is not the zero-length string, then the function returns false.<br>
 | |
| 
 | |
|                                 The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].<br><br>
 | |
| 
 | |
| 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$arg1</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$arg2</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$collation (Optional)</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:boolean<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>ends-with( "tattoo", "too")</td>
 | |
|                                         <td>true</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>ends-with( "tattoo", "tatoo")</td>
 | |
|                                         <td>false</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>ends-with ((), ())</td>
 | |
|                                         <td>true</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-ends-with" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:substring-before()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns the substring of the value of $arg1 that precedes in the value of $arg1 the first occurrence of a sequence of collation units that provides a minimal match to the collation units of $arg2 according to the collation that is used.<br>
 | |
| 
 | |
|                                 If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.<br>
 | |
| 
 | |
|                                 If the value of $arg2 is the zero-length string, then the function returns the zero-length string.<br>
 | |
| 
 | |
|                                 If the value of $arg1 does not contain a string that is equal to the value of $arg2, then the function returns the zero-length string.<br>
 | |
| 
 | |
|                                 The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].<br><br>
 | |
| 
 | |
| 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$arg1</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$arg2</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$collation (Optional)</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:string<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>substring-before( "tattoo", "too")</td>
 | |
|                                         <td>tat</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>substring-before( "tattoo", "tat")</td>
 | |
|                                         <td><empty string></td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-substring-before" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:substring-after()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns the substring of the value of $arg1 that follows in the value of $arg1 the first occurrence of a sequence of collation units that provides a minimal match to the collation units of $arg2 according to the collation that is used.<br>
 | |
| 
 | |
|                                 If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.<br>
 | |
| 
 | |
|                                 If the value of $arg2 is the zero-length string, then the function returns the value of $arg1.<br>
 | |
| 
 | |
|                                 If the value of $arg1 does not contain a string that is equal to the value of $arg2, then the function returns the zero-length string.<br>
 | |
| 
 | |
|                                 The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].<br><br>
 | |
| 
 | |
| 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$arg1</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$arg2</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$collation (Optional)</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:string<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>substring-after( "tattoo", "too")</td>
 | |
|                                         <td><empty string></td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>substring-after( "tattoo", "tat")</td>
 | |
|                                         <td>too</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-substring-after" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:matches()</code></a>
 | |
|                             <div class="content">
 | |
|                                 The function returns true if $input matches the regular expression supplied as $pattern as influenced by the value of $flags, if present; otherwise, it returns false.<br>
 | |
| 
 | |
|                                 The effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.<br>
 | |
| 
 | |
|                                 If $input is the empty sequence, it is interpreted as the zero-length string.<br>
 | |
|                                 Unless the metacharacters ^ and $ are used as anchors, the string is considered to match the pattern if any substring matches the pattern. But if anchors are used, the anchors must match the start/end of the string (in string mode), or the start/end of a line (in multiline mode).<br>
 | |
| 
 | |
|                                 An error is raised [err:FORX0002] if the value of $pattern is invalid according to the rules described in section 7.6.1 Regular Expression Syntax.<br>
 | |
| 
 | |
|                                 An error is raised [err:FORX0001] if the value of $flags is invalid according to the rules described in section 7.6.1 Regular Expression Syntax.<br><br>
 | |
| 
 | |
| 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$input</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string</td>
 | |
|                                         <td>$pattern</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string</td>
 | |
|                                         <td>$flags (Optional)</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:boolean<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>matches("abracadabra", "bra")</td>
 | |
|                                         <td>true</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>matches("abracadabra", "^a.*a$")</td>
 | |
|                                         <td>false</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-matches" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:replace()</code></a>
 | |
|                             <div class="content">
 | |
|                                 The function returns the xs:string that is obtained by replacing each non-overlapping substring of $input that matches the given $pattern with an occurrence of the $replacement string.<br>
 | |
| 
 | |
|                                 The effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.<br>
 | |
| 
 | |
|                                 The $flags argument is interpreted in the same manner as for the fn:matches() function.<br>
 | |
| 
 | |
|                                 If $input is the empty sequence, it is interpreted as the zero-length string.<br>
 | |
| 
 | |
|                                 If two overlapping substrings of $input both match the $pattern, then only the<br> first one (that is, the one whose first character comes first in the $input string) is replaced.
 | |
| 
 | |
|                                 Within the $replacement string, a variable $N may be used to refer to the substring captured by the Nth parenthesized sub-expression in the regular expression. For each match of the pattern, these variables are assigned the value of the content matched by the relevant sub-expression, and the modified replacement string is then substituted for the characters in $input that matched the pattern. $0 refers to the substring captured by the regular expression as a whole.<br><br>
 | |
| 
 | |
| 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$input</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string</td>
 | |
|                                         <td>$pattern</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string</td>
 | |
|                                         <td>$replacement</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string</td>
 | |
|                                         <td>$flags (Optional)</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:string<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>replace("abracadabra", "bra", "*")</td>
 | |
|                                         <td>a*cada*</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>replace("abracadabra", "a.*a", "*")</td>
 | |
|                                         <td>*</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>replace("AAAA", "A+", "b")</td>
 | |
|                                         <td>b</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-replace" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                                 class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:tokenize()</code></a>
 | |
|                             <div class="content">
 | |
|                                 This function breaks the $input string into a sequence of strings, treating any substring that matches $pattern as a separator. The separators themselves are not returned.<br>
 | |
| 
 | |
|                                 The effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.<br>
 | |
| 
 | |
|                                 The $flags argument is interpreted in the same way as for the fn:matches() function.<br>
 | |
| 
 | |
|                                 If $input is the empty sequence, or if $input is the zero-length string, the result is the empty sequence.<br>
 | |
| 
 | |
|                                 If the supplied $pattern matches a zero-length string, that is, if fn:matches("", $pattern, $flags) returns true, then an error is raised: [err:FORX0003].<br>
 | |
| 
 | |
|                                 If a separator occurs at the start of the $input string, the result sequence will start with a zero-length string. Zero-length strings will also occur in the result sequence if a separator occurs at the end of the $input string, or if two adjacent substrings match the supplied $pattern.<br><br>
 | |
| 
 | |
| 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$input</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string</td>
 | |
|                                         <td>$pattern</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string</td>
 | |
|                                         <td>$flags (Optional)</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:string*<br><br>
 | |
|                                 <b>Examples: </b><br>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Expression</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>tokenize("The cat sat on the mat", "\s+")</td>
 | |
|                                         <td>("The", "cat", "sat", "on", "the", "mat")</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>tokenize("1, 15, 24, 50", ",\s*")</td>
 | |
|                                         <td>("1", "15", "24", "50")</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>tokenize("1,15,,24,50,", ",")</td>
 | |
|                                         <td>("1", "15", "", "24", "50", "")</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-tokenize" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                         </div>
 | |
|                     </div>
 | |
|                     <div class="collapsible">
 | |
|                         <span>
 | |
|                             <button class="section-button collapseTrigger" style="border: none">Numeric</button>
 | |
|                         </span>
 | |
|                         <div class="content">
 | |
|     
 | |
|     
 | |
|                             <a href="#" onClick="return false;"
 | |
|                             class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:number()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns the value indicated by $arg or, if $arg is not specified, the context item after atomization, converted to an xs:double<br>
 | |
| 
 | |
|                                 Calling the zero-argument version of the function is defined to give the same result as calling the single-argument version with the context item (.). That is, fn:number() is equivalent to fn:number(.).<br>
 | |
| 
 | |
|                                 If $arg is the empty sequence or if $arg or the context item cannot be converted to an xs:double, the xs:double value NaN is returned. If the context item is undefined an error is raised: [err:XPDY0002]XP.<br>
 | |
| 
 | |
|                                 If $arg is the empty sequence, NaN is returned. Otherwise, $arg, or the context item after atomization, is converted to an xs:double following the rules of 17.1.3.2 Casting to xs:double. If the conversion to xs:double fails, the xs:double value NaN is returned.<br>
 | |
| 
 | |
|                                 <br>
 | |
|                                 <b>Arguments:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:anyAtomicType?</td>
 | |
|                                         <td>Value to convert to number</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:double<br><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-number" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
|     
 | |
|                             <a href="#" onClick="return false;"
 | |
|                             class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:abs()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns the absolute value of $arg. If $arg is negative returns -$arg otherwise returns $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.<br>
 | |
| 
 | |
|                                 For xs:float and xs:double arguments, if the argument is positive zero or negative zero, then positive zero is returned. If the argument is positive or negative infinity, positive infinity is returned.<br>
 | |
| 
 | |
|                                 For detailed type semantics, see Section 7.2.3 The fn:abs, fn:ceiling, fn:floor, fn:round, and fn:round-half-to-even functions.<br>
 | |
|                                 <br>
 | |
|                                 <b>Arguments:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>numeric?</td>
 | |
|                                         <td>$arg</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> numeric?<br><br>
 | |
| 
 | |
|                                 <b>Examples:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Query</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>abs(-2)</td>
 | |
|                                         <td>2</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>abs(2137)</td>
 | |
|                                         <td>2137</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-abs" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                             class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:ceiling()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns the smallest (closest to negative infinity) number with no fractional part that is not less than the value of $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.<br>
 | |
| 
 | |
|                                 For xs:float and xs:double arguments, if the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero and greater than -1, negative zero is returned.<br>
 | |
|                                 <br>
 | |
|                                 <b>Arguments:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>numeric?</td>
 | |
|                                         <td>$arg</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> numeric?<br><br>
 | |
| 
 | |
|                                 <b>Examples:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Query</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>ceiling(10.5)</td>
 | |
|                                         <td>11</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>ceiling(-10.5)</td>
 | |
|                                         <td>-10</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>ceiling(10.1)</td>
 | |
|                                         <td>11</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-ceiling" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                             class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:floor()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns the largest (closest to positive infinity) number with no fractional part that is not greater than the value of $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.<br>
 | |
| 
 | |
|                                 For float and double arguments, if the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned.<br>
 | |
|                                 <br>
 | |
|                                 <b>Arguments:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>numeric?</td>
 | |
|                                         <td>$arg</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> numeric?<br><br>
 | |
| 
 | |
|                                 <b>Examples:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Query</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>floor(10.5)</td>
 | |
|                                         <td>10</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>floor(-10.5)</td>
 | |
|                                         <td>-11</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>floor(10.8)</td>
 | |
|                                         <td>10</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-floor" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                             class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:round()</code></a>
 | |
|                             <div class="content">
 | |
|                                 Returns the number with no fractional part that is closest to the argument. If there are two such numbers, then the one that is closest to positive infinity is returned. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.<br>
 | |
| 
 | |
|                                 For xs:float and xs:double arguments, if the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned. In the cases where positive zero or negative zero is returned, negative zero or positive zero may be returned as [XML Schema Part 2: Datatypes Second Edition] does not distinguish between the values positive zero and negative zero.<br>
 | |
| 
 | |
|                                 For the last two cases, note that the result is not the same as fn:floor(x+0.5).<br>
 | |
|                                 <br>
 | |
|                                 <b>Arguments:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>numeric?</td>
 | |
|                                         <td>$arg</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> numeric?<br><br>
 | |
| 
 | |
|                                 <b>Examples:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Query</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>round(10.5)</td>
 | |
|                                         <td>11</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>round(10.4999)</td>
 | |
|                                         <td>10</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>round(-10.5)</td>
 | |
|                                         <td>-10</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-round" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
| 
 | |
|                             <a href="#" onClick="return false;"
 | |
|                             class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:round-half-to-even()</code></a>
 | |
|                             <div class="content">
 | |
|                                 The value returned is the nearest (that is, numerically closest) value to $arg that is a multiple of ten to the power of minus $precision. If two such values are equally near (e.g. if the fractional part in $arg is exactly .500...), the function returns the one whose least significant digit is even.<br>
 | |
| 
 | |
|                                 If the type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.<br>
 | |
| 
 | |
|                                 The first signature of this function produces the same result as the second signature with $precision=0.<br>
 | |
| 
 | |
|                                 For arguments of type xs:float and xs:double, if the argument is NaN, positive or negative zero, or positive or negative infinity, then the result is the same as the argument. In all other cases, the argument is cast to xs:decimal, the function is applied to this xs:decimal value, and the resulting xs:decimal is cast back to xs:float or xs:double as appropriate to form the function result. If the resulting xs:decimal value is zero, then positive or negative zero is returned according to the sign of the original argument.<br>
 | |
| 
 | |
|                                 Note that the process of casting to xs:decimal may result in an error [err:FOCA0001].<br>
 | |
| 
 | |
|                                 If $arg is of type xs:float or xs:double, rounding occurs on the value of the mantissa computed with exponent = 0.<br>
 | |
|                                 <br>
 | |
|                                 <b>Arguments:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>numeric?</td>
 | |
|                                         <td>$arg</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>numeric?</td>
 | |
|                                         <td>$precision (Optional)</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> numeric?<br><br>
 | |
| 
 | |
|                                 <b>Examples:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Query</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>round-half-to-even(0.5)</td>
 | |
|                                         <td>0</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>round-half-to-even(1.5)</td>
 | |
|                                         <td>2</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>round-half-to-even(2.5)</td>
 | |
|                                         <td>2</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>round-half-to-even(2.6)</td>
 | |
|                                         <td>3</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-round-half-to-even" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
|     
 | |
|                         </div>
 | |
|                     </div>
 | |
|                     <div class="collapsible">
 | |
|                         <span 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:data()</code></a>
 | |
|                             <div class="content">
 | |
|                                 fn:data takes a sequence of items and returns a sequence of atomic values.<br>
 | |
| 
 | |
|                                 The result of fn:data is the sequence of atomic values produced by applying the following rules to each item in $arg:<br>
 | |
|                                 <ul>
 | |
|                                     <li>If the item is an atomic value, it is returned.</li>
 | |
|                                     <li>
 | |
|                                         If the item is a node:
 | |
|                                         <ul>
 | |
|                                             <li>If the node does not have a typed value an error is raised [err:FOTY0012].</li>
 | |
|                                             <li>Otherwise, fn:data() returns the typed value of the node as defined by the accessor function dm:typed-value in Section 5.15 typed-value AccessorDM.</li>
 | |
|                                         </ul>
 | |
|                                     </li>
 | |
|                                 </ul>
 | |
|                                 <br>
 | |
|                                 <b>Arguments:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>item*</td>
 | |
|                                         <td>Items to convert.</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:anyAtomicType*<br><br>
 | |
|                                 <b>Examples:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Query</th>
 | |
|                                         <th>Result</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>data(/l:library/l:readerList/p:person[1])</td>
 | |
|                                         <td>7321<br>Adam<br>Choke</td>
 | |
|                                     </tr>
 | |
|                                 </table><br>
 | |
| 
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-data" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
|                         </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">
 | |
|                                     The fn:error function is a general function that may be invoked as above but may also be invoked from [XQuery 1.0: An XML Query Language] or [XML Path Language (XPath) 2.0] applications with, for example, an xs:QName argument.
 | |
|                                     <br>
 | |
|                                     <a href="https://www.w3.org/TR/xquery-operators/#func-error" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                                 </div>
 | |
| 
 | |
| 
 | |
|                                 <a href="#" onClick="return false;"
 | |
|                                     class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:trace()</code></a>
 | |
|                                 <div class="content">
 | |
|                                     Provides an execution trace intended to be used in debugging queries.<br>
 | |
| 
 | |
|                                     The input $value is returned, unchanged, as the result of the function. In addition, the inputs $value, converted to an xs:string, and $label may be directed to a trace data set. The destination of the trace output is ·implementation-defined·. The format of the trace output is ·implementation dependent·. The ordering of output from invocations of the fn:trace() function is ·implementation dependent·.<br>
 | |
| 
 | |
|                                     <b>Arguments:</b>
 | |
|                                     <table class="table-doc">
 | |
|                                         <tr>
 | |
|                                             <th>Type</th>
 | |
|                                             <th>Description</th>
 | |
|                                         </tr>
 | |
|                                         <tr>
 | |
|                                             <td>item*</td>
 | |
|                                             <td>$value</td>
 | |
|                                         </tr>
 | |
|                                         <tr>
 | |
|                                             <td>xs:string</td>
 | |
|                                             <td>$label</td>
 | |
|                                         </tr>
 | |
|                                     </table>
 | |
|                                     <b>Return type:</b> item<br><br>
 | |
|                                     <br>
 | |
|                                     <a href="https://www.w3.org/TR/xquery-operators/#func-trace" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                                 </div>
 | |
|     
 | |
|     
 | |
|                         </div>
 | |
|                     </div>
 | |
|                     <div class="collapsible">
 | |
|                         <span 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:resolve-uri()</code></a>
 | |
|                             <div class="content">
 | |
|                                 This function enables a relative URI reference to be resolved against an absolute URI.
 | |
| 
 | |
|                                 The first form of this function resolves $relative against the value of the base-uri property from the static context. If the base-uri property is not initialized in the static context an error is raised [err:FONS0005].<br>
 | |
|                                 
 | |
|                                 If $relative is a relative URI reference, it is resolved against $base, or against the base-uri property from the static context, using an algorithm such as those described in [RFC 2396] or [RFC 3986], and the resulting absolute URI reference is returned.<br>
 | |
|                                 If $relative is an absolute URI reference, it is returned unchanged.<br>
 | |
|                                 
 | |
|                                 If $relative is the empty sequence, the empty sequence is returned.<br>
 | |
|                                 
 | |
|                                 If $relative is not a valid URI according to the rules of the xs:anyURI data type, or if it is not a suitable relative reference to use as input to the chosen resolution algorithm, then an error is raised [err:FORG0002].<br>
 | |
|                                 
 | |
|                                 If $base is not a valid URI according to the rules of the xs:anyURI data type, if it is not a suitable URI to use as input to the chosen resolution algorithm (for example, if it is a relative URI reference, if it is a non-hierarchic URI, or if it contains a fragment identifier), then an error is raised [err:FORG0002].<br>
 | |
|                                 
 | |
|                                 If the chosen resolution algorithm fails for any other reason then an error is raised [err:FORG0009].<br>
 | |
|                                 
 | |
|                                 <h4>Note:</h4>
 | |
|                                 
 | |
|                                 Resolving a URI does not dereference it. This is merely a syntactic operation on two character strings.
 | |
|                                 <br><br>
 | |
| 
 | |
| 
 | |
|                                 <b>Arguments and return type:</b>
 | |
|                                 <table class="table-doc">
 | |
|                                     <tr>
 | |
|                                         <th>Type</th>
 | |
|                                         <th>Description</th>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string?</td>
 | |
|                                         <td>$relative</td>
 | |
|                                     </tr>
 | |
|                                     <tr>
 | |
|                                         <td>xs:string</td>
 | |
|                                         <td>$base</td>
 | |
|                                     </tr>
 | |
|                                 </table>
 | |
|                                 <b>Return type:</b> xs:anyURI?<br><br>
 | |
|                                 <br>
 | |
|                                 <a href="https://www.w3.org/TR/xquery-operators/#func-resolve-uri" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
 | |
|                             </div>
 | |
|     
 | |
|     
 | |
|                         </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: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<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>
 | |
|                             <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>
 | |
|                             <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>
 | |
|                             <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>
 |