Subject:String in a range Author:roberto azzimonti Date:03 Jun 2008 12:42 PM Originally Posted: 03 Jun 2008 08:58 AM
hi all,
what's the best practice to check if a string is in a given range of possible values (i.e.: nin=10 max=zzzz)?
I'm currently using a series of calls to the following template:
However it doesn't give us the "natural" comparison result i.e. "10" is less than "5", we want "10" greater than "5".
Subject:String in a range Author:roberto azzimonti Date:03 Jun 2008 02:05 PM
I think we need to make them right justified pattern with spaces or some common char.
'000005' and '000010' this will work.
'a5' and 'a10' will give me the same wrong result. 'a10' is still less than 'a5'.
I was hoping to find some already made functions especially using the schemas-microsoft-com estension.
Subject:String in a range Author:James Durning Date:09 Jun 2008 01:33 PM Originally Posted: 09 Jun 2008 01:32 PM
Sorry, I misinterpreted and was solving for the reverse problem.
Have you noticed that your test uses equals, as opposed to <
Otherwise, cast each value to a number.
<xsl:variable name="num1">
<xsl:number value="$str1"/>
</xsl:variable>
<xsl:variable name="num2">
<xsl:number value="msxsl:node-set($sortedPair)/*[1]"/>
</xsl:variable>