Performing Arithmetic Operations

In queries, a number represents a floating-point number. A number can have any double-precision 64-bit format IEEE 754 value. This includes

  • A special not-a-number (NaN) value
  • Positive and negative infinity
  • Positive and negative zero

The numeric operators convert their operands to numbers as if by calling the number() function. See Converting an Object to a Number.

You can use the following arithmetic operators in queries:

  • + performs addition
  • - performs subtraction
  • XML allows hyphens ( -) in names. Consequently, the subtraction operator ( -) typically needs to be preceded by white space. For example, foo-bar evaluates to a node set that contains the child elements named foo-bar. However, foo - bar evaluates to the difference between the result of converting the string value of the first foo child element to a number and the result of converting the string value of the first bar child to a number.

  • * performs multiplication
  • mod returns the remainder from a truncating division. For example:
    • 5 mod 2 returns 1.
    • 5 mod -2 returns 1.
    • -5 mod 2 returns -1.
    • -5 mod -2 returns -1.
    • The mod operator is the same as the % operator in Java and ECMAScript. But it does not perform the same operation as the IEEE remainder operation, which returns the remainder from a rounding division.

  • div performs floating-point division according to IEEE 754.

Java XML Parser

Stylus Studio's support for Java XML Parser is able to Validate XML Using any Java XML Parser, Edit, Debug, Profile and Map XSLT using any Java XSLT Processor, Create PDF files Using Apache FOP, hand have Support for Microsoft XML Parsers as well.

Microsoft .NET XML Tools for System.XML 1.0 and System.XML 2.0

Stylus Studio features integrated XML validation, XSLT transformation and XSLT debugging using the official Microsoft .NET XML processing components: System.XML 1.0 and System.XML 2.0.

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.

Oracle XML Tools

Oracle XML tools for working with relational and XML data, including exporting of database tables to XML and importing XML into the Oracle8i, Oracle9i and Oracle10g databases.

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.