|
Home > Online Product Documentation > Table of Contents > Specifying Number Operations and Functions Specifying Number Operations and FunctionsThis section includes the following topics: Performing Arithmetic OperationsIn queries, a number represents a floating-point number. A number can have any double-precision 64-bit format IEEE 754 value. This includes
The numeric operators convert their operands to numbers as if by calling the
You can use the following arithmetic operators in queries:
XML allows hyphens (
Calling Number FunctionsThis section describes the number functions that you can call in a query. The operations you can perform are Converting an Object to a Number
In some situations, you might want to force a numeric comparison. The XPath processor performs a numeric comparison if either operand is numeric and neither is Boolean. (If one operand is Boolean, the XPath processor converts the other to Boolean and performs a Boolean comparison.) However, if neither operand is a numeric or Boolean value, you can call the
To perform a numeric comparison, you must call the
The format of the
If you omit the argument, the value of the argument defaults to a node set with the context node as its only member.
Table 62 shows how the
Obtaining the Sum of the Values in a Node Set
To obtain the sum of the values of the nodes in a set, call the
For each node in the argument node-set, the XPath processor converts the string value of the node to a number. The
Obtaining the Largest, Smallest, or Closest Number
To obtain the largest integer that is not greater than a particular number, call the
The
To obtain the smallest integer that is not less than a particular number, call the
The
To obtain the closest integer to a particular number, call the
The
|
XSV - The XML Schema Validator
XSV is the official reference implementation for the XML Schema language and Stylus Studio is the only XML IDE to provide seamless integration with XSV - the W3C XML Schema Validator. Download Stylus Studio and XSV today.
XML Editor
Stylus Studio XML editor includes many XML editing utilities and features to simplify XML development, including intuitive XML editing views, integrated XML validation and troubleshooting utilities, XML formatting tools, XML generation tools, etc.
XML Schema Designer
The XML Schema Designer is a tool for accelerating advanced XML Schema development through an intuitive visual interface for modeling any XML data structures.
XSL and XSLT Tools
XSLT tools in Stylus Studio let you easily edit, debug, design and profile XSLT stylesheets using a powerful and intuitive graphical user interface.