Merge lp:~zorba-coders/zorba/xqdoc-fixes into lp:zorba
- xqdoc-fixes
- Merge into trunk
Proposed by
William Candillon
Status: | Needs review |
---|---|
Proposed branch: | lp:~zorba-coders/zorba/xqdoc-fixes |
Merge into: | lp:zorba |
Diff against target: |
323 lines (+3/-278) 1 file modified
modules/w3c/xpath_functions.xq (+3/-278) |
To merge this branch: | bzr merge lp:~zorba-coders/zorba/xqdoc-fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matthias Brantner | Needs Information | ||
William Candillon | Approve | ||
Review via email: mp+214246@code.launchpad.net |
Commit message
Remove duplication function declaration in the xpath functions module.
Description of the change
Remove duplication function declaration in the xpath functions module.
To post a comment you must log in.
Revision history for this message
Matthias Brantner (matthias-brantner) wrote : | # |
review:
Needs Information
Revision history for this message
William Candillon (wcandillon) wrote : | # |
yes I generated it but as a one time thing.
Revision history for this message
William Candillon (wcandillon) wrote : | # |
superseeded by https:/
Unmerged revisions
- 11711. By William Candillon
-
Remove duplication function declarations.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'modules/w3c/xpath_functions.xq' |
2 | --- modules/w3c/xpath_functions.xq 2013-10-31 19:55:27 +0000 |
3 | +++ modules/w3c/xpath_functions.xq 2014-04-04 13:53:40 +0000 |
4 | @@ -465,16 +465,6 @@ |
5 | declare function fn:codepoint-equal( $comparand1 as xs:string?, $comparand2 as xs:string?) as xs:boolean? external; |
6 | |
7 | (:~ |
8 | - : <div><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">Creates an <code>xs:string</code> from a sequence of <termref def="codepoint">codepoints</termref>.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"><example role="signature"><proto name="codepoints-to-string" return-type="xs:string" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"><arg name="arg" type="xs:integer*"/></proto></example></p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">This function is <termref def="dt-deterministic">deterministic</termref>, <termref def="dt-context-independent">context-independent</termref>, and <termref def="dt-focus-independent">focus-independent</termref>. </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The function returns the string made up from the <termref def="character">characters</termref> whose Unicode <termref def="codepoint">codepoints</termref> are |
9 | - : supplied in <code>$arg</code>. This will be the zero-length string if <code>$arg</code> |
10 | - : is the empty sequence. </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">A <phrase diff="add" at="M">dynamic</phrase> error is raised <errorref class="CH" code="0001"/> if any of the codepoints in |
11 | - : <code>$arg</code> is not a permitted XML character.</p></div> |
12 | - : |
13 | - : @see http://www.w3.org/TR/xpath-functions-30/#func-codepoints-to-string |
14 | - :) |
15 | -declare function fn:codepoints-to-string($arg as xs:integer*) as xs:string external; |
16 | - |
17 | -(:~ |
18 | : <div><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">Returns a sequence of nodes representing a collection of documents indentified |
19 | : by a collection URI; or a default collection if no URI is supplied.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"><example role="signature"><proto name="collection" return-type="node()*" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"/></example><example role="signature"><proto name="collection" return-type="node()*" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"><arg name="arg" type="xs:string?"/></proto></example></p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">This function is <termref def="dt-deterministic">deterministic</termref>, <termref def="dt-context-dependent">context-dependent</termref>, and <termref def="dt-focus-independent">focus-independent</termref>. It depends on |
20 | : available node collections, and static base uri. |
21 | @@ -3658,79 +3648,7 @@ |
22 | : @see http://www.w3.org/TR/xpath-functions-30/#func-unparsed-text |
23 | :) |
24 | declare function fn:unparsed-text($href as xs:string?, $encoding as xs:string) as xs:string? external; |
25 | - |
26 | -(:~ |
27 | - : <div><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">Because errors in evaluating the <function>fn:unparsed-text</function> function are |
28 | - : non-recoverable, these two functions are provided to allow an application to determine |
29 | - : whether a call with particular arguments would succeed.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"><example role="signature"><proto name="unparsed-text-available" return-type="xs:boolean" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"><arg name="href" type="xs:string?"/></proto></example><example role="signature"><proto name="unparsed-text-available" return-type="xs:boolean" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"><arg name="href" type="xs:string?"/><arg name="encoding" type="xs:string"/></proto></example></p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">This function is <termref def="dt-deterministic">deterministic</termref>, <termref def="dt-context-dependent">context-dependent</termref>, and <termref def="dt-focus-independent">focus-independent</termref>. It depends on |
30 | - : static base uri. |
31 | - : </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The <function>fn:unparsed-text-available</function> function determines whether a call |
32 | - : on the <function>fn:unparsed-text</function> function with identical arguments would |
33 | - : return a string.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">If the first argument is an empty sequence, the function returns false. <phrase diff="del" at="L">If the second |
34 | - : argument is an empty sequence, the function behaves as if the second argument were |
35 | - : omitted.</phrase></p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">In other cases, the function returns true if a call on |
36 | - : <function>fn:unparsed-text</function> with the same arguments would succeed, and |
37 | - : false if a call on <function>fn:unparsed-text</function> with the same arguments would |
38 | - : fail with a non-recoverable dynamic error.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The functions <function>fn:unparsed-text</function> and |
39 | - : <function>fn:unparsed-text-available</function> have the same requirement for |
40 | - : <termref def="deterministic">determinism</termref> as the functions |
41 | - : <code>fn:doc</code> and <code>fn:doc-available</code>. This means that unless the |
42 | - : user has explicitly stated a requirement for a reduced level of determinism, either of |
43 | - : these functions if called twice with the same arguments during the course of a |
44 | - : transformation <rfc2119>must</rfc2119> return the same results each time; moreover, the |
45 | - : results of a call on <function>fn:unparsed-text-available</function> |
46 | - : <rfc2119>must</rfc2119> be consistent with the results of a subsequent call on |
47 | - : <function>unparsed-text</function> with the same arguments.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">This requires that the <function>unparsed-text-available</function> function should |
48 | - : actually attempt to read the resource identified by the URI, and check that it is |
49 | - : correctly encoded and contains no characters that are invalid in XML. Implementations |
50 | - : may avoid the cost of repeating these checks for example by caching the validated |
51 | - : contents of the resource, to anticipate a subsequent call on the |
52 | - : <function>unparsed-text</function> |
53 | - : <phrase diff="add" at="A">or <function>unparsed-text-lines</function> |
54 | - : </phrase> function. Alternatively, implementations may be able to rewrite an expression |
55 | - : such as <code>if (unparsed-text-available(A)) then unparsed-text(A) else ...</code> to |
56 | - : generate a single call internally.</p></div> |
57 | - : |
58 | - : @see http://www.w3.org/TR/xpath-functions-30/#func-unparsed-text-available |
59 | - :) |
60 | -declare function fn:unparsed-text-available($href as xs:string?) as xs:boolean external; |
61 | - |
62 | -(:~ |
63 | - : <div><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">Because errors in evaluating the <function>fn:unparsed-text</function> function are |
64 | - : non-recoverable, these two functions are provided to allow an application to determine |
65 | - : whether a call with particular arguments would succeed.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"><example role="signature"><proto name="unparsed-text-available" return-type="xs:boolean" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"><arg name="href" type="xs:string?"/></proto></example><example role="signature"><proto name="unparsed-text-available" return-type="xs:boolean" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"><arg name="href" type="xs:string?"/><arg name="encoding" type="xs:string"/></proto></example></p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">This function is <termref def="dt-deterministic">deterministic</termref>, <termref def="dt-context-dependent">context-dependent</termref>, and <termref def="dt-focus-independent">focus-independent</termref>. It depends on |
66 | - : static base uri. |
67 | - : </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The <function>fn:unparsed-text-available</function> function determines whether a call |
68 | - : on the <function>fn:unparsed-text</function> function with identical arguments would |
69 | - : return a string.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">If the first argument is an empty sequence, the function returns false. <phrase diff="del" at="L">If the second |
70 | - : argument is an empty sequence, the function behaves as if the second argument were |
71 | - : omitted.</phrase></p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">In other cases, the function returns true if a call on |
72 | - : <function>fn:unparsed-text</function> with the same arguments would succeed, and |
73 | - : false if a call on <function>fn:unparsed-text</function> with the same arguments would |
74 | - : fail with a non-recoverable dynamic error.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The functions <function>fn:unparsed-text</function> and |
75 | - : <function>fn:unparsed-text-available</function> have the same requirement for |
76 | - : <termref def="deterministic">determinism</termref> as the functions |
77 | - : <code>fn:doc</code> and <code>fn:doc-available</code>. This means that unless the |
78 | - : user has explicitly stated a requirement for a reduced level of determinism, either of |
79 | - : these functions if called twice with the same arguments during the course of a |
80 | - : transformation <rfc2119>must</rfc2119> return the same results each time; moreover, the |
81 | - : results of a call on <function>fn:unparsed-text-available</function> |
82 | - : <rfc2119>must</rfc2119> be consistent with the results of a subsequent call on |
83 | - : <function>unparsed-text</function> with the same arguments.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">This requires that the <function>unparsed-text-available</function> function should |
84 | - : actually attempt to read the resource identified by the URI, and check that it is |
85 | - : correctly encoded and contains no characters that are invalid in XML. Implementations |
86 | - : may avoid the cost of repeating these checks for example by caching the validated |
87 | - : contents of the resource, to anticipate a subsequent call on the |
88 | - : <function>unparsed-text</function> |
89 | - : <phrase diff="add" at="A">or <function>unparsed-text-lines</function> |
90 | - : </phrase> function. Alternatively, implementations may be able to rewrite an expression |
91 | - : such as <code>if (unparsed-text-available(A)) then unparsed-text(A) else ...</code> to |
92 | - : generate a single call internally.</p></div> |
93 | - : |
94 | - : @see http://www.w3.org/TR/xpath-functions-30/#func-unparsed-text-available |
95 | - :) |
96 | -declare function fn:unparsed-text-available( $href as xs:string?, $encoding as xs:string) as xs:boolean external; |
97 | - |
98 | + |
99 | (:~ |
100 | : <div><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The <code>fn:unparsed-text-lines</code> function reads an external resource (for |
101 | : example, a file) and returns its contents as a sequence of strings, one for each line of |
102 | @@ -3755,29 +3673,6 @@ |
103 | declare function fn:unparsed-text-lines($href as xs:string?) as xs:string* external; |
104 | |
105 | (:~ |
106 | - : <div><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The <code>fn:unparsed-text-lines</code> function reads an external resource (for |
107 | - : example, a file) and returns its contents as a sequence of strings, one for each line of |
108 | - : text in the <phrase diff="chg" at="L">string representation</phrase> of the resource.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"><example role="signature"><proto name="unparsed-text-lines" return-type="xs:string*" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"><arg name="href" type="xs:string?"/></proto></example><example role="signature"><proto name="unparsed-text-lines" return-type="xs:string*" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"><arg name="href" type="xs:string?"/><arg name="encoding" type="xs:string"/></proto></example></p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">This function is <termref def="dt-deterministic">deterministic</termref>, <termref def="dt-context-dependent">context-dependent</termref>, and <termref def="dt-focus-independent">focus-independent</termref>. It depends on |
109 | - : static base uri. |
110 | - : </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The <code>unparsed-text-lines</code> function reads an external resource (for example, a |
111 | - : file) and returns its <phrase diff="chg" at="L">string representation</phrase> as a sequence of strings, separated at newline |
112 | - : boundaries. </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The result of the single-argument function is the same as the result of the expression |
113 | - : <code>fn:tokenize(fn:unparsed-text($href), '\r\n|\r|\n')[not(position()=last() and |
114 | - : .='')]</code>. The result of the two-argument function is the same as the result of |
115 | - : the expression <code>fn:tokenize(fn:unparsed-text($href, $encoding), |
116 | - : '\r\n|\r|\n'))[not(position()=last() and .='')]</code>. </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The result is a thus a sequence of strings containing the text of the resource retrieved |
117 | - : using the URI, each string representing one line of text. Lines are separated by one of |
118 | - : the sequences x0A, x0D, or x0Dx0A. The characters representing the newline are not |
119 | - : included in the returned strings. If there are two adjacent newline sequences, a |
120 | - : zero-length string will be returned to represent the empty line; but if the external |
121 | - : resource ends with a newline sequence, no zero-length string will be returned as the |
122 | - : last item in the result.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">Error conditions are the same as for the <code>fn:unparsed-text</code> function.</p></div> |
123 | - : |
124 | - : @see http://www.w3.org/TR/xpath-functions-30/#func-unparsed-text-lines |
125 | - :) |
126 | -declare function fn:unparsed-text-lines( $href as xs:string?, $encoding as xs:string) as xs:string* external; |
127 | - |
128 | -(:~ |
129 | : <div><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">Converts a string to upper case.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"><example role="signature"><proto name="upper-case" return-type="xs:string" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"><arg name="arg" type="xs:string?"/></proto></example></p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">This function is <termref def="dt-deterministic">deterministic</termref>, <termref def="dt-context-independent">context-independent</termref>, and <termref def="dt-focus-independent">focus-independent</termref>. </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">If the value of <code>$arg</code> is the empty sequence, the zero-length string is |
130 | : returned.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">Otherwise, the function returns the value of <code>$arg</code> after translating every |
131 | : <termref def="character">character</termref> to its upper-case correspondent as |
132 | @@ -3880,15 +3775,6 @@ |
133 | declare function fn:codepoints-to-string($arg as xs:integer*) as xs:string external; |
134 | |
135 | (:~ |
136 | - : <div><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">Returns the sequence of <termref def="codepoint">codepoints</termref> that |
137 | - : constitute an <code>xs:string</code> value. </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"><example role="signature"><proto name="string-to-codepoints" return-type="xs:integer*" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"><arg name="arg" type="xs:string?"/></proto></example></p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">This function is <termref def="dt-deterministic">deterministic</termref>, <termref def="dt-context-independent">context-independent</termref>, and <termref def="dt-focus-independent">focus-independent</termref>. </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The function returns a sequence of integers, each integer being the Unicode <termref def="codepoint">codepoints</termref> of the corresponding <termref def="character">character</termref> in <code>$arg</code>.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">If <code>$arg</code> is a zero-length string or the empty sequence, the function returns |
138 | - : the empty sequence.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The expression <code>fn:string-to-codepoints("Thérèse")</code> returns <code>(84, 104, 233, 114, 232, 115, 101)</code>.</p></div> |
139 | - : |
140 | - : @see http://www.w3.org/TR/xpath-functions-30/#func-string-to-codepoints |
141 | - :) |
142 | -declare function fn:string-to-codepoints($arg as xs:string?) as xs:integer* external; |
143 | - |
144 | -(:~ |
145 | : <div><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">Returns the base URI of a node.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"><example role="signature"><proto name="base-uri" return-type="xs:anyURI?" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"/></example><example role="signature"><proto name="base-uri" return-type="xs:anyURI?" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"><arg name="arg" type="node()?"/></proto></example></p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The zero-argument form of this function is <termref def="dt-deterministic">deterministic</termref>, <termref def="dt-context-dependent">context-dependent</termref>, and <termref def="dt-focus-dependent">focus-dependent</termref>. </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The one-argument form of this function is <termref def="dt-deterministic">deterministic</termref>, <termref def="dt-context-independent">context-independent</termref>, and <termref def="dt-focus-independent">focus-independent</termref>. </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax" diff="add" at="B">The zero-argument version of the function returns the base URI of the |
146 | : context node: it is equivalent to calling <code>fn:base-uri(.)</code>.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax" diff="add" at="B">The single-argument version of the function behaves as follows:</p><olist xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"><item>If <code>$arg</code> is the empty sequence, the function returns the empty |
147 | : sequence.</item><item>Otherwise, the function returns the value of the <code>dm:base-uri</code> accessor |
148 | @@ -4598,133 +4484,7 @@ |
149 | : @see http://www.w3.org/TR/xpath-functions-30/#func-string |
150 | :) |
151 | declare function fn:string($arg as item()?) as xs:string external; |
152 | - |
153 | -(:~ |
154 | - : <div><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">Returns a list of environment variable names that are suitable for passing to |
155 | - : <code>fn:environment-variable</code>, as a (possibly empty) sequence of strings.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"><example role="signature"><proto name="available-environment-variables" return-type="xs:string*" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"/></example></p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">This function is <termref def="dt-deterministic">deterministic</termref>, <termref def="dt-context-dependent">context-dependent</termref>, and <termref def="dt-focus-independent">focus-independent</termref>. It depends on |
156 | - : environment variables. |
157 | - : </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The function returns a sequence of strings, being the names of the environment variables |
158 | - : in the dynamic context in some <termref def="implementation-dependent">implementation-dependent</termref> order.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The function is <termref def="dt-deterministic">deterministic</termref>: that is, the |
159 | - : set of available environment variables does not vary during evaluation.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The function returns a list of strings, containing no duplicates.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">It is intended that the strings in this list should be suitable for passing to |
160 | - : <code>fn:environment-variable</code>.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">See also the note on security under the definition of the |
161 | - : <code>fn:environment-variable</code> function. If access to environment variables has |
162 | - : been disabled, <code>fn:available-environment-variables</code> always returns the empty |
163 | - : sequence.</p></div> |
164 | - : |
165 | - : @see http://www.w3.org/TR/xpath-functions-30/#func-available-environment-variables |
166 | - :) |
167 | -declare function fn:available-environment-variables() as xs:string* external; |
168 | - |
169 | -(:~ |
170 | - : <div><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">Returns the value of a system environment variable, if it exists.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"><example role="signature"><proto name="environment-variable" return-type="xs:string?" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"><arg name="name" type="xs:string"/></proto></example></p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">This function is <termref def="dt-deterministic">deterministic</termref>, <termref def="dt-context-dependent">context-dependent</termref>, and <termref def="dt-focus-independent">focus-independent</termref>. It depends on |
171 | - : environment variables. |
172 | - : </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The set of available <xtermref spec="XP30" ref="dt-environment-variables">environment variables</xtermref> |
173 | - : is a set of (name, value) pairs forming part |
174 | - : of the dynamic context, in which the name is unique within the set of pairs. The name |
175 | - : and value are arbitrary strings.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">If the <code>$name</code> argument matches the name of one of these pairs, the function |
176 | - : returns the corresponding value.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">If there is no environment variable with a matching name, the function returns the empty |
177 | - : sequence.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The collation used for matching names is <termref def="implementation-defined"/>, but |
178 | - : must be the same as the collation used to ensure that the names of all environment |
179 | - : variables are unique.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax" diff="add" at="I">The function is <termref def="dt-deterministic">deterministic</termref>, |
180 | - : which means that if it is called several times |
181 | - : within the same <termref def="dt-execution-scope">execution scope</termref>, with the same arguments, |
182 | - : it must return the same result.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">On many platforms, the term "environment variable" has a natural meaning in terms of |
183 | - : facilities provided by the operating system. This interpretation of the concept does not |
184 | - : exclude other interpretations, such as a mapping to a set of configuration parameters in |
185 | - : a database system.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">Environment variable names are usually case sensitive. Names are usually of the form |
186 | - : <code>(letter|_) (letter|_|digit)*</code>, but this varies by platform.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">On some platforms, there may sometimes be multiple environment variables with the same name; |
187 | - : in this case, it is implementation-dependent as to which is returned; see for example |
188 | - : <bibref ref="POSIX.1-2008"/> (Chapter 8, Environment Variables). |
189 | - : Implementations <rfc2119>may</rfc2119> use prefixes or other naming conventions |
190 | - : to disambiguate the names.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The requirement to ensure that the function is deterministic means in practice that |
191 | - : the implementation must make a snapshot of the environment variables at some time |
192 | - : during execution, and return values obtained from this snapshot, rather than using |
193 | - : live values that are subject to change at any time.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">Operating system environment variables may be associated with a particular process, |
194 | - : while queries and stylesheets may execute across multiple processes (or multiple machines). |
195 | - : In such circumstances implementations <rfc2119>may</rfc2119> choose to provide access |
196 | - : to the environment variables associated with the process in which the query or stylesheet |
197 | - : processing was initiated.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">Security advice: Queries from untrusted sources should not be permitted unrestricted |
198 | - : access to environment variables. For example, the name of the account under which the |
199 | - : query is running may be useful information to a would-be intruder. An implementation may |
200 | - : therefore choose to restrict access to the environment, or may provide a facility to |
201 | - : make <code>fn:environment-variable</code> always return the empty sequence.</p></div> |
202 | - : |
203 | - : @see http://www.w3.org/TR/xpath-functions-30/#func-environment-variable |
204 | - :) |
205 | -declare function fn:environment-variable($arg as xs:string) as xs:string? external; |
206 | - |
207 | -(:~ |
208 | - : <div><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The <code>fn:unparsed-text</code> function reads an external resource (for example, a |
209 | - : file) and returns <phrase diff="chg" at="L">a string representation of the resource</phrase>.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"><example role="signature"><proto name="unparsed-text" return-type="xs:string?" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"><arg name="href" type="xs:string?"/></proto></example><example role="signature"><proto name="unparsed-text" return-type="xs:string?" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"><arg name="href" type="xs:string?"/><arg name="encoding" type="xs:string"/></proto></example></p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">This function is <termref def="dt-deterministic">deterministic</termref>, <termref def="dt-context-dependent">context-dependent</termref>, and <termref def="dt-focus-independent">focus-independent</termref>. It depends on |
210 | - : static base uri. |
211 | - : </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The <code>$href</code> argument <rfc2119>must</rfc2119> be a string in the form of a URI |
212 | - : reference, which <rfc2119>must</rfc2119> contain no fragment identifier, and |
213 | - : <rfc2119>must</rfc2119> identify a resource |
214 | - : <phrase diff="chg" at="L">for which a string representation is available</phrase>. If the URI is a |
215 | - : relative URI reference, then it is resolved relative to the |
216 | - : <phrase diff="chg" at="L">Static Base URI property from the static context</phrase>.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax" diff="add" at="L">The mapping of URIs to the string representation of a resource is the mapping defined |
217 | - : in the <xtermref spec="XP30" ref="dt-available-text-resources">available text resources</xtermref> |
218 | - : component of the dynamic context.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">If the value of the <code>$href</code> argument is an empty sequence, the function |
219 | - : returns an empty sequence.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The <code>$encoding</code> argument, if present, is the name of an encoding. The values |
220 | - : for this attribute follow the same rules as for the <code>encoding</code> attribute in |
221 | - : an XML declaration. The only values which every <termref def="implementation">implementation</termref> is <rfc2119>required</rfc2119> to recognize are |
222 | - : <code>utf-8</code> and <code>utf-16</code>.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The encoding of the external resource is determined as follows:</p><olist xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"><item><p>external encoding information is used if available, otherwise</p></item><item><p>if the media type of the resource is <code>text/xml</code> or |
223 | - : <code>application/xml</code> (see <bibref ref="rfc2376"/>), or if it matches |
224 | - : the conventions <code>text/*+xml</code> or <code>application/*+xml</code> (see |
225 | - : <bibref ref="rfc3023"/> and/or its successors), then the encoding is recognized |
226 | - : as specified in <bibref ref="REC-xml"/>, otherwise</p></item><item><p>the value of the <code>$encoding</code> argument is used if present, otherwise</p></item><item><p>the processor <rfc2119>may</rfc2119> use <termref def="implementation-defined">implementation-defined</termref> heuristics to determine the likely encoding, |
227 | - : otherwise</p></item><item><p>UTF-8 is assumed.</p></item></olist><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The result of the function is a string containing the |
228 | - : <phrase diff="chg" at="L">string representation</phrase> of the resource retrieved |
229 | - : using the URI.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">A <phrase diff="add" at="L">dynamic</phrase> error is raised <errorref class="UT" code="1170"/> if <code>$href</code> |
230 | - : contains a fragment identifier, or if it cannot be used to retrieve the |
231 | - : <phrase diff="chg" at="L">string representation</phrase> of a resource.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">A <phrase diff="add" at="L">dynamic</phrase> error is raised <errorref class="UT" code="1190"/> <phrase diff="add" at="L">if the value |
232 | - : of the <code>$encoding</code> argument is not a valid encoding name, </phrase>if the <termref def="dt-processor">processor</termref> does not support the specified encoding, |
233 | - : if the <phrase diff="chg" at="L">string representation</phrase> of the retrieved |
234 | - : resource contains octets that cannot be decoded into Unicode <termref def="character">characters</termref> using the specified encoding, or if the resulting characters |
235 | - : are not permitted XML characters.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">A <phrase diff="add" at="L">dynamic</phrase> error is raised <errorref class="UT" code="1200"/> if |
236 | - : <code>$encoding</code> is absent and the <termref def="dt-processor">processor</termref> cannot infer the encoding using external information and the |
237 | - : encoding is not UTF-8.</p></div> |
238 | - : |
239 | - : @see http://www.w3.org/TR/xpath-functions-30/#func-unparsed-text |
240 | - :) |
241 | -declare function fn:unparsed-text($href as xs:string?) as xs:string? external; |
242 | - |
243 | -(:~ |
244 | - : <div><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The <code>fn:unparsed-text</code> function reads an external resource (for example, a |
245 | - : file) and returns <phrase diff="chg" at="L">a string representation of the resource</phrase>.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"><example role="signature"><proto name="unparsed-text" return-type="xs:string?" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"><arg name="href" type="xs:string?"/></proto></example><example role="signature"><proto name="unparsed-text" return-type="xs:string?" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"><arg name="href" type="xs:string?"/><arg name="encoding" type="xs:string"/></proto></example></p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">This function is <termref def="dt-deterministic">deterministic</termref>, <termref def="dt-context-dependent">context-dependent</termref>, and <termref def="dt-focus-independent">focus-independent</termref>. It depends on |
246 | - : static base uri. |
247 | - : </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The <code>$href</code> argument <rfc2119>must</rfc2119> be a string in the form of a URI |
248 | - : reference, which <rfc2119>must</rfc2119> contain no fragment identifier, and |
249 | - : <rfc2119>must</rfc2119> identify a resource |
250 | - : <phrase diff="chg" at="L">for which a string representation is available</phrase>. If the URI is a |
251 | - : relative URI reference, then it is resolved relative to the |
252 | - : <phrase diff="chg" at="L">Static Base URI property from the static context</phrase>.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax" diff="add" at="L">The mapping of URIs to the string representation of a resource is the mapping defined |
253 | - : in the <xtermref spec="XP30" ref="dt-available-text-resources">available text resources</xtermref> |
254 | - : component of the dynamic context.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">If the value of the <code>$href</code> argument is an empty sequence, the function |
255 | - : returns an empty sequence.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The <code>$encoding</code> argument, if present, is the name of an encoding. The values |
256 | - : for this attribute follow the same rules as for the <code>encoding</code> attribute in |
257 | - : an XML declaration. The only values which every <termref def="implementation">implementation</termref> is <rfc2119>required</rfc2119> to recognize are |
258 | - : <code>utf-8</code> and <code>utf-16</code>.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The encoding of the external resource is determined as follows:</p><olist xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"><item><p>external encoding information is used if available, otherwise</p></item><item><p>if the media type of the resource is <code>text/xml</code> or |
259 | - : <code>application/xml</code> (see <bibref ref="rfc2376"/>), or if it matches |
260 | - : the conventions <code>text/*+xml</code> or <code>application/*+xml</code> (see |
261 | - : <bibref ref="rfc3023"/> and/or its successors), then the encoding is recognized |
262 | - : as specified in <bibref ref="REC-xml"/>, otherwise</p></item><item><p>the value of the <code>$encoding</code> argument is used if present, otherwise</p></item><item><p>the processor <rfc2119>may</rfc2119> use <termref def="implementation-defined">implementation-defined</termref> heuristics to determine the likely encoding, |
263 | - : otherwise</p></item><item><p>UTF-8 is assumed.</p></item></olist><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The result of the function is a string containing the |
264 | - : <phrase diff="chg" at="L">string representation</phrase> of the resource retrieved |
265 | - : using the URI.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">A <phrase diff="add" at="L">dynamic</phrase> error is raised <errorref class="UT" code="1170"/> if <code>$href</code> |
266 | - : contains a fragment identifier, or if it cannot be used to retrieve the |
267 | - : <phrase diff="chg" at="L">string representation</phrase> of a resource.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">A <phrase diff="add" at="L">dynamic</phrase> error is raised <errorref class="UT" code="1190"/> <phrase diff="add" at="L">if the value |
268 | - : of the <code>$encoding</code> argument is not a valid encoding name, </phrase>if the <termref def="dt-processor">processor</termref> does not support the specified encoding, |
269 | - : if the <phrase diff="chg" at="L">string representation</phrase> of the retrieved |
270 | - : resource contains octets that cannot be decoded into Unicode <termref def="character">characters</termref> using the specified encoding, or if the resulting characters |
271 | - : are not permitted XML characters.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">A <phrase diff="add" at="L">dynamic</phrase> error is raised <errorref class="UT" code="1200"/> if |
272 | - : <code>$encoding</code> is absent and the <termref def="dt-processor">processor</termref> cannot infer the encoding using external information and the |
273 | - : encoding is not UTF-8.</p></div> |
274 | - : |
275 | - : @see http://www.w3.org/TR/xpath-functions-30/#func-unparsed-text |
276 | - :) |
277 | -declare function fn:unparsed-text($href as xs:string?, $encoding as xs:string) as xs:string? external; |
278 | - |
279 | + |
280 | (:~ |
281 | : <div><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">Because errors in evaluating the <function>fn:unparsed-text</function> function are |
282 | : non-recoverable, these two functions are provided to allow an application to determine |
283 | @@ -4819,39 +4579,4 @@ |
284 | : @see http://www.w3.org/TR/xpath-functions-30/#func-unparsed-text-available |
285 | :) |
286 | declare function fn:unparsed-text-available( $href as xs:string?, $encoding as xs:string) as xs:boolean external; |
287 | - |
288 | -(:~ |
289 | - : <div><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">Returns a sequence of <code>xs:anyURI</code> values representing the URIs in a resource collection.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"><example role="signature"><proto name="uri-collection" return-type="xs:anyURI*" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"/></example><example role="signature"><proto name="uri-collection" return-type="xs:anyURI*" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"><arg name="arg" type="xs:string?"/></proto></example></p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">This function is <termref def="dt-deterministic">deterministic</termref>, <termref def="dt-context-dependent">context-dependent</termref>, and <termref def="dt-focus-independent">focus-independent</termref>. It depends on |
290 | - : available resource collections, and static base uri. |
291 | - : </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The zero-argument form of the function returns the URIs in the <term>Default resource collection</term> |
292 | - : described in <xspecref spec="XP30" ref="id-xp-evaluation-context-components"/>.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">If the value of <code>$arg</code> is a relative <code>xs:anyURI</code>, it is resolved |
293 | - : against the value of the base-URI property from the static context. </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">If <code>$arg</code> is the empty sequence, the function behaves as if it had been |
294 | - : called without an argument. See above.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The single-argument form of the function returns the sequence of URIs corresponding to the |
295 | - : supplied URI in the <term>Available resource collections</term> described in |
296 | - : <xspecref spec="XP30" ref="id-xp-evaluation-context-components"/>.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">A <phrase diff="add" at="L">dynamic</phrase> error is raised <errorref class="DC" code="0002"/> if no URI is supplied (that is, if the |
297 | - : the function is called with no arguments, or with a single argument that evaluates to an empty sequence), and the |
298 | - : value of the default resource collection is <xtermref ref="dt-absent" spec="DM30">absent</xtermref>.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax" diff="chg" at="J">A <phrase diff="add" at="L">dynamic</phrase> error is raised <errorref class="DC" code="0002"/> |
299 | - : if <term>available resource collections</term> provides no mapping for the absolutized URI.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">A <phrase diff="add" at="L">dynamic</phrase> error is raised <errorref class="DC" code="0004"/> if <code>$arg</code> is not a |
300 | - : valid <code>xs:anyURI</code>.</p></div> |
301 | - : |
302 | - : @see http://www.w3.org/TR/xpath-functions-30/#func-uri-collection |
303 | - :) |
304 | -declare function fn:uri-collection() as xs:anyURI* external; |
305 | - |
306 | -(:~ |
307 | - : <div><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">Returns a sequence of <code>xs:anyURI</code> values representing the URIs in a resource collection.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"><example role="signature"><proto name="uri-collection" return-type="xs:anyURI*" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"/></example><example role="signature"><proto name="uri-collection" return-type="xs:anyURI*" isOp="no" prefix="fn" returnEmptyOk="no" returnSeq="no" returnVaries="no" isSchema="no" isDatatype="no" isSpecial="no"><arg name="arg" type="xs:string?"/></proto></example></p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">This function is <termref def="dt-deterministic">deterministic</termref>, <termref def="dt-context-dependent">context-dependent</termref>, and <termref def="dt-focus-independent">focus-independent</termref>. It depends on |
308 | - : available resource collections, and static base uri. |
309 | - : </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The zero-argument form of the function returns the URIs in the <term>Default resource collection</term> |
310 | - : described in <xspecref spec="XP30" ref="id-xp-evaluation-context-components"/>.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">If the value of <code>$arg</code> is a relative <code>xs:anyURI</code>, it is resolved |
311 | - : against the value of the base-URI property from the static context. </p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">If <code>$arg</code> is the empty sequence, the function behaves as if it had been |
312 | - : called without an argument. See above.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">The single-argument form of the function returns the sequence of URIs corresponding to the |
313 | - : supplied URI in the <term>Available resource collections</term> described in |
314 | - : <xspecref spec="XP30" ref="id-xp-evaluation-context-components"/>.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">A <phrase diff="add" at="L">dynamic</phrase> error is raised <errorref class="DC" code="0002"/> if no URI is supplied (that is, if the |
315 | - : the function is called with no arguments, or with a single argument that evaluates to an empty sequence), and the |
316 | - : value of the default resource collection is <xtermref ref="dt-absent" spec="DM30">absent</xtermref>.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax" diff="chg" at="J">A <phrase diff="add" at="L">dynamic</phrase> error is raised <errorref class="DC" code="0002"/> |
317 | - : if <term>available resource collections</term> provides no mapping for the absolutized URI.</p><p xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax">A <phrase diff="add" at="L">dynamic</phrase> error is raised <errorref class="DC" code="0004"/> if <code>$arg</code> is not a |
318 | - : valid <code>xs:anyURI</code>.</p></div> |
319 | - : |
320 | - : @see http://www.w3.org/TR/xpath-functions-30/#func-uri-collection |
321 | - :) |
322 | -declare function fn:uri-collection($arg as xs:string?) as xs:anyURI* external; |
323 | + |
Isn't this module generated somehow?