From 75c7ec0306bdc554f3d2e21ef90a4cafdc22579c Mon Sep 17 00:00:00 2001 From: Michael Kay Date: Tue, 10 Oct 2023 15:15:10 +0100 Subject: [PATCH] Fix copy and paste errors in describing type patterns --- specifications/xslt-40/src/xslt.xml | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/specifications/xslt-40/src/xslt.xml b/specifications/xslt-40/src/xslt.xml index 3813cba4b..5b43ec0e0 100644 --- a/specifications/xslt-40/src/xslt.xml +++ b/specifications/xslt-40/src/xslt.xml @@ -10280,6 +10280,12 @@ and version="1.0" otherwise.

to true.

A predicate pattern .[P1][P2]... can be regarded as an abbreviation for the type pattern type(item())[P1][P2]....

+

The detailed semantics are given in . This construct can be used to match items of any + kind (nodes, atomic values, and function items). For example, the pattern + .[starts-with(., '$')] matches any string that starts with the + character $, or a node whose atomized value starts with + $. This example shows a predicate pattern with a single + predicate, but the grammar allows any number of predicates (zero or more).

A type pattern can be written as @@ -10287,13 +10293,12 @@ and version="1.0" otherwise.

followed by zero or more predicates in square brackets, and it matches any item of type T which each of the predicates evaluates to true.

-

For convenience, if T takes the form record(F1, F2, ...), then the pattern can be abbrevated.

-

The detailed semantics are given in . This construct can be used to match items of any - kind (nodes, atomic values, and function items). For example, the pattern - .[starts-with(., '$')] matches any string that starts with the - character $, or a node whose atomized value starts with - $. This example shows a predicate pattern with a single - predicate, but the grammar allows any number of predicates (zero or more).

+

The most commonly used type patterns can be abbreviated. For example, match="type(record(F1, F2, *))" + can be abbrevated to match="record(F1, F2, *)", and match="type(array(xs:string))" + can be abbreviated to match="array(xs:string)". The main case where such abbreviation is + not possible is with atomic values: match="type(xs:date)" cannot be abbreviated because + a bare QName is interpreted as a node pattern, matching elements named xs:date.

+

A node pattern uses a subset of @@ -10616,12 +10621,20 @@ and version="1.0" otherwise.

For example, the pattern .[contains(., "XSLT")] - matches any item whose typed value contains "XSLT" as a substring. + matches any item whose atomized value contains "XSLT" as a substring. It matches values such as the string "XSLT Transformations", the xs:anyURI value http://www.w3.org/TR/XSLT, the attribute node class="XSD XSLT XPath", and the singleton array ["XSLT 4.0"].

+

+ Evaluation of this example pattern may fail with a dynamic error if the item in question + has an atomized value that is not a string, or that is a sequence of strings: an example might + be the array ["XSLT", 1999]. It will also fail if the item cannot be atomized, + for example if it is a map. The rules in cause these errors + to be masked: they simply result in the pattern being treated as non-matching. +

+