# 22. Virtuoso Functions Guide - is_before()

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
Virtuoso Functions Guide
Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
XML
XPATH & XQUERY
and
append
assign
avg
boolean
ceiling
concat
contains
count
create-attribute
create-comment
create-element
create-pi
current
distinct
doc
document
document-literal
empty
ends-with
every
except
false
filter
floor
fn:collection
for
format-number
function-available
generate-id
id
if
intersect
is_after()
is_before()
key
lang
last
let
list()
local-name
max
min
name
namespace-uri
normalize-space
not
number
or
position
processxquery
processxslt
processxsql
progn()
replace()
round
serialize
shallow
some
starts-with
string
string-length
substring
substring-after
substring-before
sum
system-property
text_contains()
translate
true
tuple()
union
unordered
unparsed-entity-uri
urlify
xmlview
Functions Index

## is_before()

Returns true if the given entity is before the second given entity in document order, otherwise returns false.
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

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

Find all chapters that have table of content before title

    /book/chapter[is-before(title,toc)]

See Also

is_after()