Description
The fn:exists function returns true if the sequence contains one or more items; it is the opposite of the fn:empty function. It is often unnecessary to call the fn:exists function because sequences are automatically converted to the effective boolean value where a boolean value is expected.
This description is © Copyright 2007, Priscilla Walmsley. It is excerpted from the book XQuery by Priscilla Walmsley, O'Reilly, 2007. For a complete explanation of this function, please refer to Appendix A of the book. Arguments and Return TypeName | Type |
$arg |
item()* |
return value |
xs:boolean |
ExamplesXPath Example | Results |
---|
exists( ('a', 'b', 'c') ) |
true |
exists( '' ) |
true |
exists( () ) |
false |
exists( false() ) |
true |
See Alsofn:empty | Whether a value is the empty sequence | fn:boolean | The effective boolean value of a sequence |
History |
Recommended Reading:
|