XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 8th, 2002, 03:59 AM
sunnychan's Avatar
sunnychan sunnychan is offline
a lazy guy
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Location: Hong Kong
Posts: 99 sunnychan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
XSLT problem: numeric comparison

Hello,

I got a problem on getting the numeric comparison work in my XSL.

here is my code:
Code:
<xsl:variable name="FirstRec">
 <xsl:for-each select="./Results/Result">
    <xsl:if test="position() = 1">
       <xsl:value-of select="./RecNo"/>
    </xsl:if>
   </xsl:for-each>
</xsl:variable>
<xsl:if test="$FirstRec > ./RecPerPage">
  ... do something here ...
</xsl:if>


when $FirstRec is 50, and ./RecPerPage is 10, its work.
but when $FirstRec is 101, and ./RecPerPage is 50, the 'test' "$FirstRec > ./RecPerPage" doesnt work.

Any idea?

Thanks

Reply With Quote
  #2  
Old August 11th, 2002, 07:08 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
Your variable is being evaluated as a string, and "5" is bigger than "1", just like "b" is bigger than "a". Try number($FirstRec) > number(./RecPerPage)

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XSLT problem: numeric comparison


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway