Why on earth would you want to write something as convoluted as index-of($tokenizedVal,$tokenizedVal[last()]) in place of count($tokenizedVal)? It's not even correct, except in the special case where all the tokens are different.
as="xs:float" asserts that the value is a float, it does not convert it to a float. To convert the sequence of strings to a sequence of floats, use
for $x in tokenize(...) return xs:float($x)
Do you really want float? It loses an awful lot of precision. Using xs:double is almost certainly a better choice.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
|