Comparing Node Sets

You can compare

  • Two node sets
  • A node set and a number
  • A node set and a string
  • A node set and a Boolean value

Two Node Sets

Suppose the objects you want to compare are both node sets. The result is true only in the following case. There is a node in the first node set and a node in the second node set such that the result of performing a comparison on the values of the two nodes is true. For string values, the comparison can be = or !=. For numeric values, the comparison can also be <, >, <=, or >=.

A Node Set and a Number

Now suppose one object to be compared is a node set and the other is a number. The XPath processor searches for a node in the node set that yields a true result when its number value is compared with the number that is not in the node set. If necessary, the XPath processor uses the number() function to convert values to numeric values. If and only if the XPath processor finds such a node, the result is true.

A Node Set and a String

Sometimes you want to compare a node set with a string. The XPath processor searches for a node in the node set that yields a true result when its string value is compared with the string that is not in the node set. If necessary, the XPath processor uses the string() function to convert values to string values. If and only if the XPath processor finds such a node, the result is true.

A Node Set and a Boolean Value

Finally, suppose you want to compare a node set with a Boolean value. This tests true if and only if the result of performing the comparison on the Boolean value and on the result of converting the node set to a Boolean value using the boolean() function is true.

XSL:FO Editor

The XSL-FO editor provides syntax help, code completion integrated PDF preview, and integration with industry-leading XSL-FO processors including RenderX XEP and Apache FOP. Simplify XSL FO development with Stylus Studio.

Convert DTD to XML

Learn how to create a sample XML instance document from a DTD using Stylus Studio DTD to XML conversion tools.

Semiconductors & E-Components

Buuuuuzzzzz, zappp! There sure is a lot of electiricty flying with these semiconductors & c-component producers. It is because these top companies use Stylus Studio 2006 to light up their work day!

Java IDE

Edit, compile and debug and generate Java code with Stylus Studio's Java Integrated Development Environment (IDE). Supports popular Java XML processing components including Apache Xalan, Apache Axis, Apache Xerces, Saxon and more.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member