This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: XSLT number() problem
- From: "Thomas B. Passin" <tpassin at mitretek dot org>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Wed, 19 Jun 2002 10:20:22 -0400
- Subject: Re: [xsl] XSLT number() problem
- References: <OF7F6171E8.835C9EA3-ON85256BDD.00499440@dtcc.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
[Alex Genis]
> Maybe somebody knows why
> <xsl:if test="string(number(@FieldA)) = 'NaN'">
> returns true in both cases:
> when FieldA = 987876765654ABCDEF and
> when FieldA = 111122223333444456 ?
> Is it any other way to figure out : "Is FiledA numeric or not?"
Your example worked fine for me. You can also simplify the test like this:
<xsl:if test='number(@FieldA)'>
Perhaps you are not actually selecting @FieldA because the context is not
what you expect of you have a type somewhere. Try displaying the value and
see if it is what you expect:
<xsl:value-of select='@FieldA'/>
Cheers,
Tom P
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list