xsl-list
[Top] [All Lists]

RE: testing for string and number in XSLT 2.0 was Re: [xsl] Test For Numeric Values?

2005-04-09 15:15:39
        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/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--