Besides primary expressions, XPath 2.0 also supports arithmetic operators for addition, subtraction, multiplication, division, and modulus . These operators are represented this way (note that instead of using the -
`+`Addition -
`-`Subtraction and Negation -
`*`Multiplication -
`div`Division -
`idiv`Integer division -
`mod`Modulus
USING THE SUBTRACTION OPERATOR In XPath 2.0, you must precede a subtraction operator with a space, because "-" is a legal name character. In other words, The Here are some examples of arithmetic expressions: -
`4 * 2`returns 8 -
`33 + 11`returns 44 -
`-5 div 2`returns 2.5 -
`-5 idiv 2`returns 2 -
`$temp + 12`returns 72 if`$temp`holds 60 -
`-(20 + 6)`returns 26
SUBTRACTING DATE VALUES In XPath 2.0, if you subtract two date values, the result is of the |

XPath Kick Start: Navigating XML with XPath 1.0 and 2.0

ISBN: 0672324113

EAN: 2147483647

EAN: 2147483647

Year: 2002

Pages: 131

Pages: 131

Authors: Steven Holzner

Similar book on Amazon

flylib.com © 2008-2017.

If you may any questions please contact us: flylib@qtcs.net

If you may any questions please contact us: flylib@qtcs.net