Added remaining functions

This commit is contained in:
2023-03-31 14:49:22 +02:00
parent 6e06e2cece
commit 8b2c3c8d92

View File

@@ -3030,6 +3030,240 @@
<a href="https://www.w3.org/TR/xquery-operators/#func-deep-equal" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:id()</code></a>
<div class="content">
Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $arg.
<h4>Note:</h4>
This function does not have the desired effect when searching a document in which elements of type xs:ID are used as identifiers. To preserve backwards compatibility, a new function fn:element-with-id is therefore being introduced; it behaves the same way as fn:id in the case of ID-valued attributes.
<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string*</td>
<td>$arg</td>
</tr>
<tr>
<td>node()*</td>
<td>$node</td>
</tr>
<tr>
<td>xs:string</td>
<td>$collation (Optional)</td>
</tr>
</table>
<b>Return type:</b> element()*<br><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-id" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:idref()</code></a>
<div class="content">
Returns the sequence of element or attribute nodes with an IDREF value matching the value of one or more of the ID values supplied in $arg.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string*</td>
<td>$arg</td>
</tr>
<tr>
<td>node()*</td>
<td>$node</td>
</tr>
<tr>
<td>xs:string</td>
<td>$collation (Optional)</td>
</tr>
</table>
<b>Return type:</b> node()*<br><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-idref" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:doc()</code></a>
<div class="content">
Returns the sequence of element or attribute nodes with an IDREF value matching the value of one or more of the ID values supplied in $arg.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string</td>
<td>$uri</td>
</tr>
</table>
<b>Return type:</b> document-node()?<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>doc("test.xml")</td>
<td>Contents of test.xml file returned as node</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-doc" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:doc-available()</code></a>
<div class="content">
Retrieves a document using a URI supplied as an xs:string, and returns the corresponding document node.<br>
If $uri is the empty sequence, the result is an empty sequence.<br>
If $uri is not a valid URI, an error may be raised [err:FODC0005].<br>
If $uri is a relative URI reference, it is resolved relative to the value of the base URI property from the static context. The resulting absolute URI is promoted to an xs:string.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string</td>
<td>$uri</td>
</tr>
</table>
<b>Return type:</b> xs:boolean<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>doc("test.xml")</td>
<td>true (If document is available)</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-doc-available" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:collection()</code></a>
<div class="content">
This function takes an xs:string as argument and returns a sequence of nodes obtained by interpreting $arg as an xs:anyURI and resolving it according to the mapping specified in Available collections described in Section C.2 Dynamic Context ComponentsXP. If Available collections provides a mapping from this string to a sequence of nodes, the function returns that sequence. If Available collections maps the string to an empty sequence, then the function returns an empty sequence. If Available collections provides no mapping for the string, an error is raised [err:FODC0004]. <br>
If $arg is not specified, the function returns the sequence of the nodes in the default collection in the dynamic context. See Section C.2 Dynamic Context ComponentsXP. If the value of the default collection is undefined an error is raised [err:FODC0002].<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg (Optional)</td>
</tr>
</table>
<b>Return type:</b> node()*<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>collection("")</td>
<td>&lt;empty sequence&gt;</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-collection" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:element-with-id()</code></a>
<div class="content">
Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $arg.<br><br>
<b>Arguments:</b>
<table class="table-doc">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>xs:string?</td>
<td>$arg (Optional)</td>
</tr>
</table>
<b>Return type:</b> node()*<br><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-element-with-id" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:position()</code></a>
<div class="content">
Returns the context position from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) If the context item is undefined, an error is raised: [err:XPDY0002]XP.<br><br>
<b>Return type:</b> xs:integer<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>/l:library/l:readerList/position()</td>
<td>1</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-position" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:last()</code></a>
<div class="content">
Returns the context size from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) If the context item is undefined, an error is raised: [err:XPDY0002]XP.<br><br>
<b>Return type:</b> xs:integer<br><br>
<b>Examples:</b>
<table class="table-doc">
<tr>
<th>Query</th>
<th>Result</th>
</tr>
<tr>
<td>/l:library/l:readerList/p:person/last()</td>
<td>2<br>2</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-last" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
</div>
</div>
@@ -3980,6 +4214,91 @@
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-adjust-time-to-timezone" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:current-dateTime()</code></a>
<div class="content">
Returns the current dateTime (with timezone) from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) This is an xs:dateTime that is current at some time during the evaluation of a query or transformation in which fn:current-dateTime() is executed. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-dateTime() is ·implementation dependent·.<br><br>
<b>Return type:</b> xs:dateTime<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>current-dateTime()</td>
<td>xs:dateTime corresponding to the current date and time</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-current-dateTime" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:current-date()</code></a>
<div class="content">
Returns xs:date(fn:current-dateTime()). This is an xs:date (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-date() is executed. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-date() is ·implementation dependent·.<br><br>
<b>Return type:</b> xs:date<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>current-date()</td>
<td>xs:date corresponding to the current date</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-current-date" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:current-time()</code></a>
<div class="content">
Returns xs:date(fn:current-dateTime()). This is an xs:date (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-date() is executed. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-date() is ·implementation dependent·.<br><br>
<b>Return type:</b> xs:time<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>current-time()</td>
<td>xs:date corresponding to the current time</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-current-time" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:implicit-timezone()</code></a>
<div class="content">
Returns the value of the implicit timezone property from the dynamic context. Components of the dynamic context are discussed in Section C.2 Dynamic Context ComponentsXP.<br><br>
<b>Return type:</b> xs:string<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>implicit-timezone()</td>
<td>PT0S</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-implicit-timezone" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
</div>
</div>
<div class="collapsible">
@@ -4370,6 +4689,27 @@
<a href="https://www.w3.org/TR/xquery-operators/#func-in-scope-prefixes" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
<a href="#" onClick="return false;"
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:static-base-uri()</code></a>
<div class="content">
Returns the value of the Base URI property from the static context. If the Base URI property is undefined, the empty sequence is returned. Components of the static context are discussed in Section C.1 Static Context ComponentsXP.<br><br>
<b>Return type:</b> xs:anyURI?<br><br>
<b>Examples: </b><br>
<table class="table-doc">
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
<tr>
<td>static-base-uri()()</td>
<td>&lt;empty sequence&gt;</td>
</tr>
</table><br>
<a href="https://www.w3.org/TR/xquery-operators/#func-static-base-uri" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
</div>
</div>
</div>