[Home] [By Thread] [By Date] [Recent Entries]
Costello, Roger L. wrote:
Hi Folks, haha, that was mine. But it is not correct. It supports *only* float/doubles with positive E-notation. For a reason: it was meant to be a float/double that could be parsed as an integer without a loss (remember your flights-altitude?) For a float, it could be the following: ^\s*[+-]?(\d*\.\d+|\d+\.\d*)([eE][+-]?\d+)?\s*$|^\s*([+-]INF|NaN)\s*$ Note this part: (\d*\.\d+|\d+\.\d*) It makes sure both ".1" and "1." (which are valid xs:floats) but not "." are allowed. Note this branch: ^\s*([+-]INF|NaN)\s*$
It is valid to have this in xslt: xs:float('NaN') or xs:float('+INF').PS: i did not test the regex above, it may contain errors or omissions. PS2: this regex also applies to xs:double. -- Abel Braaksma http://www.nuntia.com
|

Cart



