This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: XSLT number() problem


[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]