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