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

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

is false.

But although these operators were introduced specifically to enable XQuery optimization, I think it's a good idea to get into the habit of using them for most routine comparisons. You probably won't see any very visible performance benefit for the average XSLT stylesheet, but you may find that you make fewer errors because the behavior of the operators is simpler and more predictable. As a bonus, it's easier to write
le
than
<=
.

In the XPath syntax, the two kinds of comparison operator, as well as the three operators
is
,
<<
, and
>>
, which we will meet later in this chapter (see page 594), are presented like this:

Expression
Syntax
ComparisonExpr
RangeExpr ( (ValueComp | GeneralComp |NodeComp ) RangeExpr )?
ValueComp
eq
|
ne
|
lt
|
le
|
gt
|
ge
GeneralComp
=
|
!=
|
<
|
<=
|
>
|
>=

Other books

Pinstripe Empire by Appel, Marty
Colors of a Lady by Chelsea Roston
A Beautiful Lie (The Camaraes) by Sterling, Stephanie
Bull Street by Lender, David
The Prodigal Son by Kate Sedley
Darkness Bound by Stella Cameron
Granite Man by Lowell, Elizabeth
Morning Sea by Margaret Mazzantini
Dark Desires: Deliverance by Kourtney King