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


Tom Passin wrote:
> Your example worked fine for me. You can also simplify the test like
> this:
>
> <xsl:if test='number(@FieldA)'>

Note that this test also returns false if the FieldA attribute is 0,
which may or may not be desired. To test whether the numeric value of
the FieldA attribute is NaN, you can alternatively use:

  <xsl:if test="number(@FieldA) = number(@FieldA)">
    ...
  </xsl:if>

This works because NaN is the only number for which $num = $num is
false.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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]