Subject: RE: testing for string and number in XSLT 2.0 was Re: Test For Numeric Values?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 9 Apr 2005 23:15:39 +0100
|
> y variable value(so we know we are selecting it): 3123123
> Test y as string:true
> Test y as integer:true
>
> back to my original question, how can I test if a value is a string or
> integer (with the very real constraint of data not being
> explicitly typed).
>
If the data is untyped then ($x castable as xs:string) will always be true.
If the string consists of digits then ($x castable as xs:integer) will also
be true, as your experiments show.
Michael Kay
http://www.saxonica.com/
| Current Thread |
Michael Kay - 9 Apr 2005 18:30:21 -0000
James Fuller - 9 Apr 2005 18:41:43 -0000
- Michael Kay - 9 Apr 2005 22:16:09 -0000 <=
James Fuller - 9 Apr 2005 18:48:05 -0000
|
|