XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition (533 page)

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
5.8Mb size Format: txt, pdf, ePub
ads

This doesn't mean that each character must be considered in isolation. The collation can still consider characters in groups, as with the traditional rule in Spanish that
ch
collates as if it were a single character following
c
, and
ll
as a single letter after
l
. But where characters are grouped in this way, it is likely to affect the way substrings are matched, as we will see.

The XPath specification isn't completely prescriptive about how substring matching using a collation should work, and there are several possible approaches that an implementation could use. I'll describe the way the Saxon processor does it, which makes heavy use of the collation support in Java: other Java-based processors are therefore quite likely to be similar.

Firstly, let's look at a case where Java treats one character as two collation units. With a primary strength collation for German, the string
Straße
generates a sequence of seven collation units, which are exactly the same as the collation units generated for the string
strasse
. This means that
contains(“Straße”, $t)
returns true when
$t
is any one of
ß
,

,
ße
,
ss
,
as

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
5.8Mb size Format: txt, pdf, ePub
ads

Other books

My Three Masters by Juniper Bell
A Matter of Breeding by J Sydney Jones
Xombies: Apocalypse Blues by Greatshell, Walter
Butcher Bird by Richard Kadrey
A Taste of Heaven by Alexis Harrington
The Early Pohl by Frederik Pohl
The Broken (The Apostles) by Shelley Coriell