XML information pipe

Ihre Spezialisten für XML

Banner Werbung

XPath 2.0 reference

XPaths  |  functions

abs | adjust-date-to-timezone | adjust-dateTime-to-timezone | attribute | avg | base-uri | boolean | ceiling | codepoint-equal | codepoints-to-string | collection | comment& | compare | concat | contains | count | current-date | current-dateTime | current-time | data | day-from-date | day-from-dateTime | days-from-duration | deep-equal | default-collation | distinct-values | doc | doc-available | document-node | document-uri | element | empty | empty-sequence | encode-for-uri | ends-with | error | escape-html-uri | exactly-one | exists | false | floor | hours-from-dateTime | hours-from-duration | hours-from-time | id | idref | implicit-timezone | in-scope-prefixes | index-of | insert-before | iri-to-uri | item | lang | last | local-name | local-name-from-QName | lower-case | matches | max | min | minutes-from-dateTime | minutes-from-duration | minutes-from-time | month-from-date | month-from-dateTime | months-from-duration | name | namespace-uri | namespace-uri-for-prefix | namespace-uri-from-QName | nilled | node | node-name | normalize-space | normalize-unicode | not | number | one-or-more | position | prefix-from-QName | processing-instruction | QName | remove | replace | resolve-QName | reverse | round | round-half-to-even | schema-attribute | schema-element | seconds-from-dateTime | seconds-from-duration | seconds-from-time | starts-with | static-base-uri | string | string-join | string-length | string-to-codepoints | subsequence | substring | substring-after | substring-before | sum | text | timezone-from-date | timezone-from-dateTime | timezone-from-time | tokenize | trace | translate | true | unordered | upper-case | year-from-date | year-from-dateTime | years-from-duration | zero-or-one |


abs

abs($arg)
     $arg: numeric
     returns: numeric


Returns the absolute value of $arg. If $arg is negative returns -$arg otherwise returns $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.


Example 1:
Input: abs(10.5)
Output: 10.5

Example 2:
Input: abs(-10.5)
Output: 10.5
Locate in the official documentation

XPath 2.0 reference