[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] [XSL] How to test "numericity" ?


Subject: [xsl] [XSL] How to test "numericity" ?
From: Alain <alainb06@xxxxxxx>
Date: Mon, 24 Mar 2008 10:44:28 +0100

From: Martin Honnen <Martin.Honnen@xxxxxx>
Subject: Re: [xsl] [XSL] How to test "numericity" ?
Message-ID: <47E6955C.8090603@xxxxxx>

Alain wrote:


> Let's assume variable x contains the string to test.
> We cannot do simply xs:integer($s), or any casting like that, because it > would produce an fatal runtime error when not numeric.


xs:integer sounds as if you use XSLT 2.0 so there you can check
  $s castable as xs:integer

--

Martin Honnen

That's it!


You're right, I just skipped paragraph 3.10.3 of XPath 2.0.
Now I can see it, and it's so much clear like that.

Many thanks.

Alain BENEDETTI


Current Thread
Keywords