Table of Contents

Search

  1. Preface
  2. Introduction to Data Transformation
  3. Data Processor Transformation
  4. Wizard Input and Output Formats
  5. Relational Input and Output
  6. Using the IntelliScript Editor
  7. XMap
  8. Libraries
  9. Schema Object
  10. Command Line Interface
  11. Scripts
  12. Parsers
  13. Script Ports
  14. Document Processors
  15. Formats
  16. Data Holders
  17. Anchors
  18. Transformers
  19. Actions
  20. Serializers
  21. Mappers
  22. Locators, Keys, and Indexing
  23. Streamers
  24. Validators, Notifications, and Failure Handling
  25. Validation Rules
  26. Custom Script Components

Data Transformation User Guide

Data Transformation User Guide

XPath Arithmetic Operators

XPath Arithmetic Operators

To perform calculations, add arithmetic operators that evaluate hierarchical document nodes. You can add arithmetic operators to XPath expressions in the Input, Condition, or Output fields of a mapping statement.
The following table describes XPath arithmetic operators that you can use in XMap expressions:
XPath Expression
Description
|
Selects two node sets in context. For example, the predicate expression "//book | //cd" returns a node set with all book and cd elements.
+
Adds the elements. For example, the predicate expression "1+2" returns 3.
-
Subtracts the elements. For example, the predicate expression "2-1" returns 1.
*
Multiplies the elements. For example, the predicate expression "2*1" returns 2.
div
Divides the elements. For example, the predicate expression "6 div 3" returns 2.
=
Selects the elements that equal the expression. For example, the predicate expression "cost=1.50" returns true if the cost is 1.50, and false if the cost is 1.60.
!=
Selects the elements that are not equal to the expression. For example, the predicate expression "cost!=1.50" returns true if the cost is 1.60, and false if the cost is 1.50.
<
Selects the elements that are less than the expression. For example, the predicate expression "tax<1.50" returns true if the tax is 1.00, and false if the tax is 1.50.
<=
Selects the elements that are equal to or less than the expression. For example, the predicate expression "tax<=1.50" returns true if the tax is 1.50, and false if the tax is 1.80.
>
Selects the elements that are greater than the expression. For example, the predicate expression "tax>1.50" returns true if the tax is 1.90, and false if the tax is 1.50.
>=
Selects the elements that are equal to or greater than the expression. For example, the predicate expression "tax>=1.50" returns true if the tax is 1.50, and false if the tax is 1.00.
or
Selects the elements that can satisfy one or more conditions. For example, the predicate expression "tax=1.50 or tax=1.70" returns true if the tax is 1.50, and false if the tax is 1.00.
and
Selects the elements that can satisfy all the given conditions. For example, the predicate expression "price>1.00 and price<1.90" returns true if the price is 1.50, and false if the price is 1.00.
mode
Performs division and provides the remainder. For example, the predicate expression "3 mod 2" returns 1.