Name
is_before — Returns true if the given entity is before the second given entity in document order, otherwise returns false.
Synopsis
boolean
is_before
(
|
ent1 entity , |
ent2
entity
) ; |
Description
The function ensures that both ent1
and ent2
are XML entities
and the returns true if ent1
and ent2
are both in the same XML
document and ent1
is strictly before ent2
in document order.
It returns false
if one of them is not an entity but an empty node-set or
if their documents differ or
or if they're equal
or if one of them is an ancestor of other
or if ent1
is simply after ent2
in document order.
Parameters
ent1
An XML entity or an node-set whose first node is compared.
ent2
An XML entity or an node-set whose first node is compared.
Return Types
Boolean
Errors
Table 24.145. Errors signalled by is_before()
SQLState | Error Code | Error Text | Description |
---|---|---|---|
XP001 | XPFB0 | First argument of XPATH function is-after() or is-before() must be XML entity | The value that is neither an XML entity nor an empty node-set may not be compared using document order. |
XP001 | XPFB1 | Second argument of XPATH function is-after() or is-before() must be XML entity | The value that is neither an XML entity nor an empty node-set may not be compared using document order. |
Examples
Example 24.595.
Find all chapters that have table of content before title
/book/chapter[is-before(title,toc)]