functx:is-a-number

Whether a value is a numeric

Description

The functx:is-a-number function returns true if the value is number(can be cast to a numeric type) and its not the value NaN. If the argument is the empty sequence or a zero-length string, it returns false.

Parameters

Description

value:numeric()

the value to test

Examples

XPath

Results

functx:is-a-number(‘123’)

true

functx:is-a-number(123)

true

functx:is-a-number(’ 123 ‘)

true

functx:is-a-number(‘’)

false

functx:is-a-number(‘123abc’)

false

functx:is-a-number(‘NaN’)

false

functx:is-a-number($in-xml/a)

true

functx:is-a-number($in-xml/b)

false

See Also