Added accessors
This commit is contained in:
@@ -415,13 +415,210 @@
|
||||
<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/1999/REC-xpath-19991116/#section-Node-Set-Functions" class="hyperlink" target="_blank">Node-Set-Functions</code></a>
|
||||
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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -487,7 +684,15 @@
|
||||
<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>
|
||||
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>
|
||||
@@ -513,7 +718,7 @@
|
||||
<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>
|
||||
<a href="https://www.w3.org/TR/xquery-operators/#func-string" class="hyperlink" target="_blank"><code>W3C Documentation reference</code></a>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -528,43 +733,30 @@
|
||||
|
||||
|
||||
<a href="#" onClick="return false;"
|
||||
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:number(object)</code></a>
|
||||
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:number()</code></a>
|
||||
<div class="content">
|
||||
The number function converts its argument to a number as follows:
|
||||
<ul>
|
||||
<li>a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN</li>
|
||||
<li>boolean true is converted to 1; boolean false is converted to 0</li>
|
||||
<li>a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument</li>
|
||||
<li>an object of a type other than the four basic types is converted to a number in a way that is dependent on that type</li>
|
||||
</ul>
|
||||
|
||||
<b>Arguments 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>
|
||||
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>
|
||||
|
||||
|
||||
@@ -577,31 +769,47 @@
|
||||
<div class="content">
|
||||
|
||||
<a href="#" onClick="return false;"
|
||||
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:avg((arg,arg,...))</code></a>
|
||||
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:data()</code></a>
|
||||
<div class="content">
|
||||
Returns the average of the argument values <br>
|
||||
<b>Arguments and return type:</b>
|
||||
<table class="table-doc">
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>sequence*</td>
|
||||
<td>returns average value of provided elements</td>
|
||||
</tr>
|
||||
</table><b>Examples: </b><br>
|
||||
<table class="table-doc">
|
||||
<tr>
|
||||
<th>Expression</th>
|
||||
<th>Result</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>avg((1,2,3))</td>
|
||||
<td>2</td>
|
||||
</tr>
|
||||
</table><br>
|
||||
<code>W3C Documentation reference: <a href="https://www.w3.org/TR/xpath-functions/#func-avg" class="hyperlink" target="_blank">#func-avg</code></a>
|
||||
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>
|
||||
@@ -658,9 +866,37 @@
|
||||
<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>
|
||||
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>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user