home contribute faq download

FunctX XQuery Functions

functx:exclusive-or

Whether one (and only one) of two boolean values is true

Google
Webxqueryfunctions.com

Description

The functx:exclusive-or function returns true if one (and only one) of two boolean values is true. If either value is the empty sequence, the empty sequence is returned.

Arguments and Return Type

NameTypeDescription
$arg1 xs:boolean? the first boolean value
$arg2 xs:boolean? the second boolean value
return value xs:boolean?

XQuery Function Declaration

See XSLT definition.
XQuery Syntax for July 2004 - January 2007 (1.0):
declare namespace functx = "http://www.functx.com"; 
declare function functx:exclusive-or 
  ( $arg1 as xs:boolean? ,
    $arg2 as xs:boolean? )  as xs:boolean? {
       
   $arg1 != $arg2
 } ;
XQuery Syntax for May 2003:
declare namespace functx = "http://www.functx.com" 
define function exclusive-or 
  ( $arg1 as xs:boolean? ,
    $arg2 as xs:boolean? )  as xs:boolean? {
       
   $arg1 != $arg2
 }

Examples

XQuery ExampleResults
functx:exclusive-or(true(),false())
true
functx:exclusive-or(true(),true())
false
functx:exclusive-or(4 > 3,1 > 2)
true

History

Published OnLast UpdatedContributor(s)
2006-06-272007-02-26Priscilla Walmsley, Datypic, pwalmsley@datypic.com, http://www.datypic.com
Need XQuery Help?
D A T Y P I C
Training | Consulting | Development

XQuery by Priscilla WalmsleyGet the book!
XQuery by Priscilla Walmsley