SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
Conditions of Use
Using XSLT 2.0
Using XQuery
Handling Source Documents
XML Schema Processing
The XPath API
Standards Conformance
Extensibility
Saxon Extensions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
XPath 2.0 Expression Syntax
| Introduction
| Constants
| Variable References
| Function Calls
| Axis steps
| Parentheses and operator precedence
| Filter expressions
| Path expressions
| Cast as, Treat as
| Set difference and intersection
| Union
» | Arithmetic expressions
| Range expressions
| Comparisons
| Instance of and Castable as
| Conditional Expressions
| Quantified Expressions
| For Expressions
| Boolean expressions: AND and OR
| Sequence expressions
Function Library
XSLT Patterns

# Unary plus and minus

The unary minus operator changes the sign of a number. For example `-1` is minus one, and `-0e0` is the double value negative zero.

Unary plus has very little effect: the value of `+1` is the same as the value of `1`. It does, however, provide a quick way of forcing untyped values to be numeric, for example you can write `<xsl:sort select="+@price"/>` to force a numeric sort, if you find `<xsl:sort select="number(@price)"/>` too verbose for your tastes.

Next