diff --git a/specifications/xpath-functions-40/src/function-catalog.xml b/specifications/xpath-functions-40/src/function-catalog.xml index a7fa79cf4..178e0c5f7 100644 --- a/specifications/xpath-functions-40/src/function-catalog.xml +++ b/specifications/xpath-functions-40/src/function-catalog.xml @@ -699,6 +699,19 @@ $node ! (

In general, an item matches more than one type, and there are cases where there is no single matching type that is more specific than all the others. This is especially true with functions, maps, and arrays. This function therefore selects one of the types that matches the item, which is not necessarily the most specific type.

+ +

This function should not be used as a substitute for an instance of test. The precise type annotation + of the result of an expression is not always predictable, because processors are free to deliver a more specific type + than is mandated by the specification. For example, if $n is of type xs:positiveInteger, + then the result of abs($n) is guaranteed to be an instance of xs:integer, but an + implementation might reasonably return the supplied value unchanged: that is, a value whose actual type + annotation is xs:positiveInteger. Similarly the type annotation of the value returned by + position() might be xs:long rather than xs:integer.

+ +

Implementations should, however, refrain from exposing types that are purely internal. + For example, an implementation might have an optimized internal representation for strings consisting entirely + of ASCII characters, or for single-character strings; if this is the case then the type annotation returned by this function + should be a user-visible supertype such as xs:string.

@@ -22368,7 +22381,7 @@ declare function transitive-closure ( then the result of abs($n) is guaranteed to be an instance of xs:integer, but an implementation might reasonably return the supplied value unchanged: that is, a value whose actual type annotation is xs:positiveInteger. Similarly the type annotation of the value returned by - position() might have a type annotation of xs:long rather than xs:integer.

+ position() might be xs:long rather than xs:integer.

Implementations should, however, refrain from exposing types that are purely internal. For example, an implementation might have an optimized internal representation for strings consisting entirely