functx:max-determine-type
The maximum value in a sequence, figuring out its type (numeric or string)
Description
The functx:max-determine-type function returns the maximum of the values in $seq. The built-in fn:max function treats all untyped data as numeric and raises an error if a value cannot be cast to xs:double. This function, by contrast, tests whether values are numeric, and if so, sorts them as numbers. If values are not numeric, it sorts them like strings. If your values are definitely numeric, there is no need to use this function instead of the built-in fn:max function.
Parameters |
Description |
---|---|
seq:string() |
the sequence of values to test |
Examples
XPath |
Results |
---|---|
functx:max-determine-type($in-xml//num) |
115 |
functx:max-determine-type($in-xml//string) |
def |
functx:max-determine-type($in-xml//(num|string)) |
def |