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:

  • If at least one object to be compared is Boolean, the XPath processor converts the other object to Boolean as if by applying the boolean() function.
  • If at least one object to be compared is a number, and neither is Boolean, the XPath processor converts the nonnumber object to a number as if by applying the number() function.

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.

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.

HTML Tidy

HTML Tidy is a program for turning HTML into something that can be parsed as XML, unlocking their data for use in XSLT and XQuery programs. Learn how to use HTML Tidy in Stylus Studio now.

OASIS Catalog Support

Stylus Studio's features for working with OASIS catalogs allow you to incorporate any vendor's catalog - or one of your own - in your XML, making writing correct and robust XML easier than ever.

XSL-List Blog

XSL-List is a discussion forum on the Extensible Stylesheet Language (XSL), covering the XSL specification, XSL processors, tools, user questions, trends and more. Bookmark this RSS or ATOM feed now!

FLWOR - An Introduction to the XQuery FLWOR Expression

An XQuery FLWOR Tutorial, covering an introduction to the main constructs of the XQuery FLWOR expression, including: For, Let, Where, Order By, and Return. Written by the W3C's Dr. Michael Kay.

Stylus Most Wanted

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.