XQuery Reference

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

XQuery Boolean Operators Reference

This chapter provides descriptions of the XQuery boolean operators available in the mapper functionality of WebLogic Workshop. You use the mapper functionality to generate queries and to edit these queries to add invocations to these provided XQuery operators. To learn more, see Invoking Functions or Operators in a Query.

In addition to the XQuery functions and operators available in the mapper functionality, a larger set functions and operators is provided. You can manually add invocations to these functions and operators to queries in the Source View of the mapper functionality. For a list of these additional functions and operators, see the XQuery 1.0 and XPath 2.0 Functions and Operators - W3C Working Draft 16 August 2002 available from the W3C Web site at the following URL:

http://www.w3.org/TR/2002/WD-xquery-operators-20020816

This section lists the boolean operators available from the mapper functionality:

 


op: boolean-equal

If $boolean-var1 has the same boolean value as $boolean-var2, the boolean value: true is returned. If $boolean-var1 does not have the same boolean value as $boolean-var, the boolean value: false is returned. For example: op:boolean-equal(xf:true(), xf:false()) returns the boolean value: false.

This operator is equilavant to the eg operator with boolean values.

Signatures

op:boolean-equal(xs: boolean $boolean-var1, xs:boolean $boolean-var2) —> xs:boolean

Table 11-1 Arguments
Data Type
Argument
Description
xs:boolean
$boolean-var1
Represents a boolean value.
xs:boolean
$boolean-var2
Represents a boolean value.

Returns

Returns the boolean value: true if $boolean-var1 is equal to the boolean value of $boolean-var2.

Returns the boolean value: false if $boolean-var1 is not equal to the boolean value of $boolean-var2.

Examples
Not Equal Returns false

Invoking op:boolean-equal(xf:false(),xf:true()) returns the boolean value: false, as shown in the following example query:

<boolean-equal>{

op:boolean-equal(xf:false(),xf:true())

}</boolean-equal>

The preceding query generates the following result:

<boolean-equal>false</boolean-equal>

Equal Returns true

Invoking op:boolean-equal(xf:false(),xf:false()) returns the boolean value: true, as shown in the following example query:

<boolean-equal>{

op:boolean-equal(xf:false(),xf:false())

}</boolean-equal>

The preceding query generates the following result:

<boolean-equal>true</boolean-equal>

Related Topics

W3C boolean-equal operator description.

W3C boolean function description

xs: boolean

 


op: boolean-less-than

If $boolean-var1 equals the boolean value: false and $boolean-var2 equals the boolean value: true, the boolean value: true is returned. For all other cases, the boolean value: false is returned as shown in the following table.

Table 11-2 boolean values
If boolean-var1 equals ...
And boolean-var2 equals ...
The boolean-less-than Operator Returns ...
false
true
true—The boolean value of $boolean-var1 is less than the boolean value of $boolean-var2. (The boolean value: false is less than the boolean value: true.)
true
false
false—The boolean value of $boolean-var1 is greater than the boolean value of $boolean-var2.
true
true
false—The boolean value of $boolean-var1 is the same as the boolean value of $boolean-var2. $boolean-var1 is not less than $boolean-var2.
false
false
false—The boolean value of $boolean-var1 is the same as the boolean value of $boolean-var2. $boolean-var1 is not less than $boolean-var2.

This operator is equivalent to the lt operator with boolean values.

Signatures

op:boolean-less-than(xs: boolean $boolean-var1, xs:boolean $boolean-var2) —>xs: boolean

Table 11-3 Arguments
Data Type
Argument
Description
xs:boolean
$boolean-var1
Represents a boolean value.
xs:boolean
$boolean-var2
Represents a boolean value.

Returns

Returns the boolean value: true if $boolean-var1 is less than boolean value of $boolean-var2. For example: if $boolean-var1 is equal to false and $boolean-var2 is equal to true, the boolean value true is returned.

Returns the boolean value: false for all other cases.

Examples
boolean-less-than(false, true) Returns true

Invoking op:boolean-less-than(xf:false(),xf:true()) returns the boolean value: true, as shown in the following example query:

<boolean-less-than>{

op:boolean-less-than(xf:false(),xf:true())

}</boolean-less-than>

The preceding query generates the following result:

<boolean-less-than>true</boolean-less-than>

boolean-less-than(true, false) Returns false

Invoking op:boolean-less-than(xf:true(),xf:false()) returns the boolean value: false, as shown in the following example query:

<boolean-less-than>{

op:boolean-less-than(xf:true(),xf:false())

}</boolean-less-than>

The preceding query generates the following result:

<boolean-less-than>false</boolean-less-than>

Related Topics

W3C boolean-less-than operator description.

W3C boolean function description

xs: boolean

 


op: boolean-greater-than

If $boolean-var1 equals the boolean value: true and $boolean-var2 equals the boolean value: false, the boolean value: true is returned. For all other cases, the boolean value: false is returned as shown in the following table.

Table 11-4  
If boolean-var1 equals ...
And boolean-var2 equals ...
The boolean-greater-than Operator Returns ...
true
false
true—The boolean value of $boolean-var1 is greater than the boolean value of $boolean-var2. (The boolean value: true is greater than the boolean value: false.)
false
true
false—The boolean value of $boolean-var1 is less than the boolean value of $boolean-var2.
true
true
false—The boolean value of $boolean-var1 is the same as the boolean value of $boolean-var2. $boolean-var1 is not greater than $boolean-var2.
false
false
false—The boolean value of $boolean-var1 is the same as the boolean value of $boolean-var2. $boolean-var1 is not greater than $boolean-var2.

This operator is equivalent to the lt operator with boolean values.

Signatures

op:boolean-greater-than(xs: boolean $boolean-var1, xs:boolean $boolean-var2) —> xs:boolean

Table 11-5 Arguments
Data Type
Argument
Description
xs:boolean
$boolean-var1
Represents a boolean value.
xs:boolean
$boolean-var2
Represents a boolean value.

Returns

Returns the boolean value: true if $boolean-var1 is greater than boolean value of $boolean-var2. For example: if $boolean-var1 is equal to true and $boolean-var2 is equal to false, the boolean value true is returned.

Returns the boolean value: false for all other cases.

Examples
boolean-greater-than(true, false) Returns true

Invoking op:boolean-greater-than(xf:true(), xf:false()) returns the boolean value: true, as shown in the following example query:

<boolean-greater-than>{

op:boolean-greater-than(xf:true(),xf:false())

}</boolean-greater-than>

The preceding query generates the following result:

<boolean-greater-than>true</boolean-greater-than>

boolean-greater-than(false, true) Returns false

Invoking op:boolean-greater-than(xf:false(),xf:true()) returns the boolean value: false, as shown in the following example query:

<boolean-greater-than>{

op:boolean-greater-than(xf:false(), xf:true())

}</boolean-greater-than>

The preceding query generates the following result:

<boolean-greater-than>false</boolean-greater-than>

Related Topics

W3C boolean-greater-than operator description.

W3C boolean function description

xs: boolean


  Back to Top       Previous  Next