XSLT and XPath function reference in alphabetical order
(Excerpt from “XSLT 2.0 & XPath 2.0” by Frank Bongers, chapter 5, translated from German)
Functions for sequences
A Boolean value false, in case the input sequence is empty, otherwise always true.
Any input sequence. If the sequence is empty, the function returns the value false, otherwise true.
Purpose of use:
As long as the input sequence passed on is a non-empty sequence, the fn:exists() function always returns true. If the sequence is empty, thus there is no item (the sequence »itself« or an expression generating the sequence indeed exists!), the value false is returned. In principle, fn:exists($value) is equivalent to fn:count($value) = 0 or (provided that $value is not of all things the Boolean value false) also to fn:not($value).
Example 1 – testing a non-empty sequence:
fn:exists((1, 2, 3)) results in true.
Example 2 – testing an empty sequence:
fn:exists(()) results in false.
The function is not available.
fn:exists($arg as item()*) as xs:boolean
|<< back||next >>|
Copyright © Galileo Press, Bonn 2008
Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "XSLT 2.0 & XPath 2.0" is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.
Galileo Press, Rheinwerkallee 4, 53227 Bonn, Germany