Boolean Functions

boolean boolean(object)

Converts the argument to a boolean in a mostly sensible way. NaN and 0 are false. All other numbers are true. Empty strings are false. All other strings are true. Empty node-sets are false. All other node-sets are true.

boolean not(boolean)

This function turns true into false and false into true.

boolean true()

This function always returns true. It’s necessary because XPath does not have any boolean literals.

boolean false()

This function always returns false. It’s necessary because XPath does not have any boolean literals.

boolean lang(string)

This function returns true if the context node is written in the language specified by the argument. The language of the context node is determined by the currently in-scope xml:lang attribute. If there is no such attribute, this function returns false.


Previous | Next | Top | Cafe con Leche

Copyright 2002, 2003 Elliotte Rusty Harold
Elliotte Rusty Harold
Last Modified October 15, 2002