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

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

So, these examples show some of the surprises in store:

  • You can't assume that
    $X=$X
    is true. It usually will be, but if
    $X
    is an empty sequence, it will be false, because there is no item in the first sequence that is equal to an item from the second.
  • You can't assume that
    $X!=3
    means the same as
    not($X=3)
    . When
    $X
    is a sequence, the first expression is true if any item in the sequence is not equal to 3, while the second is true if no item in the sequence is equal to 3. Generally speaking, it is best to steer clear of the
    !=
    operator unless you know exactly what you are doing. Use
    not(x=y)
    instead; it is more likely to match the intuitive meaning.
BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
2Mb size Format: txt, pdf, ePub
ads

Other books

The Pearl Locket by Kathleen McGurl
Letters to Zell by Camille Griep
If I Fall by Kate Noble
Mothman's Curse by Christine Hayes
Tenderness by Dorothy Garlock
Sizzle in the City by Wendy Etherington