xsl-list
[Top] [All Lists]

RE: [xsl] Is there a way to tell if a node is an integer?

2006-04-24 13:30:27
At 2006-04-24 13:03 -0700, Allison Bloodworth wrote:
I'm using
an XSL 1.0 stylesheet so that must have been the problem.

Searching for more info on NaN, I also found this post from Ken Holman which
showed another way to do this:
http://www.xslt.com/html/xsl-list/2002-02/msg01214.html

From the post:
The following will be true if the value is a number:
  test="@value <= 0 or @value > 0"

That is an old post ... lately I've been using:

   test="number(@value)=number(@value)"

which will be true only if @value is a number. This is based on the principle that NaN is not equal to NaN.

I hope this helps.

. . . . . . . . . . . Ken

--
Registration open for XSLT/XSL-FO training: Wash.,DC 2006-06-12/16
Also for XSLT/XSL-FO training:    Minneapolis, MN 2006-07-31/08-04
Also for XML/XSLT/XSL-FO training:Birmingham,England 2006-05-22/25
Also for XSLT/XSL-FO training:    Copenhagen,Denmark 2006-05-08/11
World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman                 mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
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>
--~--