Home >Online Product Documentation >Table of Contents >Comparing Single Values With = and !=
When neither object to be compared is a node set and the operator is = or !=, the XPath processor compares the objects by converting them to a common type and then comparing them. The XPath processor converts the objects to a common type as follows:
=
!=
boolean()
number()
If the objects to be compared are neither Boolean nor numeric, the XPath processor compares the string values of the objects as if by applying the string() function to each object.
string()
The = comparison returns true if and only if the objects are equal. The != comparison returns true if and only if the objects are not equal. Numbers are compared for equality according to IEEE 754. Two Boolean values are equal if either both are true or both are false. Two strings are equal if and only if they both consist of the same sequence of Universal Character Set (UCS) characters.
true
false
Use single or double quotes to specify string values being used with a comparison operator.