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

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

A
category escape
\p{prop}
matches any character with the property
prop
, as defined in the Unicode character database. A
complementary escape
\P{prop}
matches any character that does not have the property
prop
. The
prop
may either represent the block of characters being matched or a character category. The next two sections define the character blocks and categories.

Character Blocks

Character blocks are simply names for ranges of characters in Unicode. For example,
\p{IsHebrew}
matches any character in the range x0590 to x05FF, while
\P{IsHebrew}
matches any character that is not in this range.

The names of the blocks are listed in the table below. The name of the block is preceded by
Is
in the regular expression, which then matches any character in the block. Note that some of the blocks (such as
PrivateUse
) map to several ranges of codes.

The list above corresponds to XML Schema 1.0 second edition. This removed some blocks that were defined in the first edition, notably for characters above xFFFF. XML Schema 1.1 reinstates most of these, sometimes under slightly different names, and also adds additional blocks corresponding to characters in more recent versions of Unicode. The blocks listed in the table should be supported by all XSLT 2.0 and XPath 2.0 processors; other blocks (such as x1D100-x1D1FF, MusicalSymbols) may be supported in some processors and not in others.

Character Categories

Characters in the Unicode character database are assigned to a category and subcategory. For example, category
L
denotes letters, and within this
Lu
denotes upper-case letters. Within a regular expression,
\p{L}
matches any letter, and
\p{Lu}
matches any upper-case letter. The complementary sets can also be selected:
\P{L}
matches any character that is not a letter, and
\P{Lu}
matches any character that is not an upper-case letter.

Other books

Faust Among Equals by Tom Holt
John Saul by Guardian
I Will Send Rain by Rae Meadows
Dust of Eden by Mariko Nagai
The Denniston Rose by Jenny Pattrick
Steam Heat by Elizabeth Darvill