home contribute faq download

FunctX XSLT Functions

fn:not

Negates a boolean value

Google
Webxsltfunctions.com

Description

The fn:not function accepts a sequence of items, from which it calculates the effective boolean value of the sequence as a whole before negating it. This means that when $arg is either a single boolean value false, a zero-length string, the number 0 or NaN, or the empty sequence, it returns true. Otherwise, it returns false.

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 Type

NameType
$arg item()*
return value xs:boolean

Examples

XPath ExampleResultsExplanation
not(32 > 20)
false
not(doc(
   'http://www.functx.com/input/catalog.xml')
   //product)
false there is at least one product element in catalog.xml
not(true())
false
not(())
true
not('')
true
not(0)
true
not(<e>false</e>)
false

See Also

fn:booleanThe effective boolean value of a sequence
fn:trueThe boolean value true
fn:falseThe boolean value false

History

Published OnLast UpdatedContributor(s)
2006-06-272007-02-26W3C, XQuery 1.0 and XPath 2.0 Functions and Operators, http://www.w3.org/TR/xpath-functions/
Datypic XSLT Services

Recommended Reading:

XQuery