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
7.74Mb size Format: txt, pdf, ePub

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

Other books

With a Tangled Skein by Piers Anthony
Worldweavers: Spellspam by Alma Alexander
Hot Spot by Debbi Rawlins
Laura Possessed by Anthea Fraser
Of Light and Darkness by Shayne Leighton
Sorcerer's Legacy by Janny Wurts
The Secrets of a Courtesan by Nicola Cornick
Dog Eat Dog by Chris Lynch
The War Of The Lance by Weis, Margaret, Hickman, Tracy, Williams, Michael, Knaak, Richard A.