From bf11e2334efba66e23e9fd382edbc8403fcaf713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gr=C3=BCn?= Date: Tue, 1 Oct 2024 21:31:52 +0200 Subject: [PATCH] =?UTF-8?q?1323b=20Function=20parameters=20names:=20$uri?= =?UTF-8?q?=20=E2=86=92=20$source=20(#1460)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Function parameters names: $href → $uri. Closes #1323 * Function parameters names: $uri → $source * unparsed-text-lines, unparsed-text-available * function-lookup, example * Minor edit --- .../src/function-catalog.xml | 70 +++++++++---------- .../src/xpath-functions.xml | 2 +- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/specifications/xpath-functions-40/src/function-catalog.xml b/specifications/xpath-functions-40/src/function-catalog.xml index 7b6873465..38d79fa86 100644 --- a/specifications/xpath-functions-40/src/function-catalog.xml +++ b/specifications/xpath-functions-40/src/function-catalog.xml @@ -5955,7 +5955,7 @@ return normalize-unicode(concat($v1, $v2)) printable characters of the US-ASCII coded character set, specifically the codepoints between 32 and 126 (decimal) inclusive. Each - character in $uri to be escaped is replaced by an escape sequence, which is + character in $value 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 @@ -17456,7 +17456,7 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF] - + @@ -17469,8 +17469,8 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF] corresponding document node.

-

If $href is the empty sequence, the result is an empty sequence.

-

If $href is a relative URI reference, it is resolved relative to the value +

If $source is the empty sequence, the result is an empty sequence.

+

If $source is a relative URI reference, it is resolved relative to the value of the static base URI property from the static context. The resulting absolute URI is promoted to an xs:string.

If the available documents described in class="DC" code="0003"/>.

-

If $href is read from a source document, it is generally appropriate to +

If $source is read from a source document, it is generally appropriate to resolve it relative to the base URI property of the relevant node in the source document. This can be achieved by calling the fn:resolve-uri function, and passing the resulting absolute URI as an argument to the fn:doc @@ -17580,7 +17580,7 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF]

A dynamic error may be raised if - $href is not a valid URI reference.

+ $source is not a valid URI reference.

A dynamic error is raised if a relative URI reference is supplied, and the base-URI property in the static context is absent.

@@ -17599,7 +17599,7 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF] - + @@ -17608,18 +17608,18 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF] focus-independent -

The function returns true if and only if the function call fn:doc($href) +

The function returns true if and only if the function call fn:doc($source) would return a document node.

-

If $href is an empty sequence, this function returns false.

-

If a call on fn:doc($href) would return a document node, this function +

If $source is an empty sequence, this function returns false.

+

If a call on fn:doc($source) would return a document node, this function returns true.

In all other cases this function returns false. This includes the case where an invalid URI is supplied, and also the case where a valid relative URI reference is supplied, and cannot be resolved, for example because the static base URI is absent.

-

If this function returns true, then calling fn:doc($href) +

If this function returns true, then calling fn:doc($source) within the same must return a document node. However, @@ -17630,7 +17630,7 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF] - + @@ -17644,7 +17644,7 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF]

This function takes an xs:string as argument and returns a sequence of - items obtained by interpreting $uri as an xs:anyURI and + items obtained by interpreting $source as an xs:anyURI and resolving it according to the mapping specified in available collections described in .

@@ -17652,12 +17652,12 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF] sequence of items, the function returns that sequence. If available collections maps the string to an empty sequence, then the function returns an empty sequence.

-

If $uri is not specified, the function returns the sequence of items in +

If $source is not specified, the function returns the sequence of items in the default collection in the dynamic context. See .

-

If $uri is a relative xs:anyURI, it is resolved +

If $source is a relative xs:anyURI, it is resolved against the value of the base-URI property from the static context.

-

If $uri is the empty sequence, the function behaves as if it had been +

If $source is the empty sequence, the function behaves as if it had been called without an argument. See above.

By default, this function is deterministic. This @@ -17687,7 +17687,7 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF] /> if available node collections provides no mapping for the absolutized URI.

A dynamic error may be raised if $uri is not + code="0004"/> if $source is not a valid xs:anyURI.

@@ -17707,7 +17707,7 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF] - + @@ -17723,9 +17723,9 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF]

The zero-argument form of the function returns the URIs in the default URI collection described in .

-

If $uri is a relative xs:anyURI, it is resolved +

If $source is a relative xs:anyURI, it is resolved against the value of the base-URI property from the static context.

-

If $uri is the empty sequence, the function behaves as if it had been +

If $source is the empty sequence, the function behaves as if it had been called without an argument. See above.

The single-argument form of the function returns the sequence of URIs corresponding to the supplied URI in the available URI collections described in @@ -17760,7 +17760,7 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF] /> if available resource collections provides no mapping for the absolutized URI.

A dynamic error may be raised if $uri is not + code="0004"/> if $source is not a valid xs:anyURI.

@@ -17832,7 +17832,7 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF] - + @@ -17846,7 +17846,7 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF] file) and returns a string representation of the resource.

-

The $href argument must be a string in the form of a URI +

The $source argument must be a string in the form of a URI reference, which must contain no fragment identifier, and must identify a resource for which a string representation is available. If the URI is a relative URI reference, then it is resolved relative to the @@ -17886,7 +17886,7 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF] spec="XP31" ref="dt-available-text-resources" >available text resources component of the dynamic context.

-

If the $href argument is an empty sequence, the function +

If the $source argument is an empty sequence, the function returns an empty sequence.

The encoding option, if present and non-empty, is the name of an encoding. The values @@ -17931,7 +17931,7 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF]

A dynamic error is raised if the $href argument + /> if the $source argument contains a fragment identifier, or if it cannot be resolved to an absolute URI (for example, because the base-URI property in the static context is absent), or if it cannot be used to retrieve the string @@ -18048,7 +18048,7 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF] - + @@ -18085,7 +18085,7 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF]

The result of the function is the same as the result of the expression:

- (fn:unparsed-text($href, map:put($options, 'normalize-newlines', true())) + (fn:unparsed-text($source, map:put($options, 'normalize-newlines', true())) => fn:tokenize('\n')) [not(position()=last() and .='')] @@ -18117,7 +18117,7 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF] - + @@ -19877,9 +19877,9 @@ serialize(

The expression let $f := function-lookup(xs:QName('zip:binary-entry'), 2) -return if (exists($f)) then $f($href, $entry) else () +return if (exists($f)) then $f($source, $entry) else () returns the result of - calling zip:binary-entry($href, $entry) if the function is available, or + calling zip:binary-entry($source, $entry) if the function is available, or an empty sequence otherwise.

@@ -26252,7 +26252,7 @@ return { - + @@ -26293,7 +26293,7 @@ return { -

If $href is the empty sequence, the function returns the empty sequence.

+

If $source is the empty sequence, the function returns the empty sequence.

@@ -32501,12 +32501,12 @@ return $result

The effect of calling pin on a map or array is that subsequent retrieval operations within the pinned map or array return labeled results, whose labels contain useful information about - where the results were found. For example, an expression such as json-doc($uri)??name + where the results were found. For example, an expression such as json-doc($source)??name will return the values of all entries in the JSON tree having the key "name"; but very little can be done with this information because the result is simply a sequence of (typically) strings - with no context. By contrast, the result of pin(json-doc($uri))??name is the same set + with no context. By contrast, the result of pin(json-doc($source))??name is the same set of strings, labeled with information about where they were found. For example, if $result - is the result of the expression pin(json-doc($uri))??name, then:

+ is the result of the expression pin(json-doc($source))??name, then:

$result => label()?parent?ssn locates the map that contained each diff --git a/specifications/xpath-functions-40/src/xpath-functions.xml b/specifications/xpath-functions-40/src/xpath-functions.xml index 87b2e6a49..3492d3f5a 100644 --- a/specifications/xpath-functions-40/src/xpath-functions.xml +++ b/specifications/xpath-functions-40/src/xpath-functions.xml @@ -11675,7 +11675,7 @@ ISBN 0 521 77752 6.

Raised by fn:unparsed-text or fn:unparsed-text-lines - if the $href argument contains a fragment identifier, + if the $source argument contains a fragment identifier, or if it cannot be resolved to an absolute URI (for example, because the base-URI property in the static context is absent), or if it cannot be used to retrieve the string representation of a resource.