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

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

), which determines whether upper-case letters precede lower-case ones or vice versa, and
alphanumeric
(values
yes
and
no
), which if set causes any sequence of digits to be interpreted as a number, so for example
iso-10646
will sort after
iso-646
.

Generally, if you are matching words in natural language text, you should ignore differences such as case and accents (a low-strength collation), while for sorting, a high-strength collation is appropriate: This will ensure that words that differ only in their accents are sorted in the correct way, even though they might compare as equal in a search.

For other parameters that you can include in a Saxon collation URI, see the product documentation. If you want the ultimate in control, the collation URI can identify a user-written implementation of the
java.lang.Comparator
interface.

Because collation URIs are unlikely to be portable across implementations, it's a good idea to define them as stylesheet parameters. For example, you can define a stylesheet parameter:

  select=“‘http://saxon.sf.net/collation?lang=de;ignore-modifiers=yes’”/>

and then use this in a sort, by specifying:


You could also define the collation using a conditional expression, using the
system-property()
function to determine which vendor's XSLT processor is currently in use.

The
[xsl]:default-collation
attribute, which applies to everything in its scope except

elements, can specify a list of collation URIs, and a processor will use the first one that it recognizes. You can specify
http://www.w3.org/2005/xpath-functions/collation/codepoint
as the last item in the list to provide a fallback that every processor is obliged to recognize.

Extensions

The XSLT specification provides a number of mechanisms allowing extensions to be implemented in a vendor namespace, and Saxon has exploited these to the full. As well as providing extensibility mechanisms allowing you to extend the capabilities of the product, Saxon includes quite a few built-in extensions. These fall into a number of categories, described in the following sections.

Serialization Extensions

Saxon provides a number of extra serialization properties, with names in the Saxon namespace, that you can use on the

declaration and the

instruction. The two most common options are shown below.

Other books

Cuffed for Pleasure by Lacey Thorn
The Mask of Night by Tracy Grant
Pier Lights by Ella M. Kaye
Forever Yours by Nicole Salmond
Vintage Volume One by Suzanne, Lisa
In the Dead of Night by Castillo, Linda
Second Skin by Eric Van Lustbader