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.

DTD vs. Schema

Stylus Studio provides tools for working with both W3C XML Schema and DTD's - this tutorial explains what the differences are between the two, providing a technical comparison of DTD vs Schema.

Introduction to the XQuery Mapper

This free online video demonstration covers Stylus Studio's synchronized XQuery editing and mapping tool which allows you to create any XQuery expression, either manually using Stylus Studio's XQuery editor.

Stylesheet Design - How to Publish your Data Using a Stylesheet Designer

Simplify Stylesheet Design with Stylus Studio's XML Publisher, a visual stylesheet designer and code generator to help you create XSLT or XQuery to publish your data to HTML+CSS or XSL:FO.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member