Re: [xsl] collapsing number ranges

Subject: Re: [xsl] collapsing number ranges
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Sun, 29 Aug 2004 09:11:19 -0400
On Aug 29, 2004, at 5:55 AM, Jeni Tennison wrote:

  <xsl:choose>
    <xsl:when test="$begin idiv 100 eq $end idiv 100">
      <xsl:value-of select="$end mod 100" />
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$end" />
    </xsl:otherwise>
  </xsl:choose>

$begin idiv 100 gives you all but the last two digits of $begin. $end
mod 100 gives you the last two digits of $end.

Nice!


Any pointers on where to find out more about how to use idiv, mod, etc.? I'd like to get a better sense of the basics: the logic that explains how the above works (e.g. what's going on with the "div 100" that gives me the last two digits, what does mod do, etc.). The xpath 2.0 spec isn't all that helpful for me.

Bruce

Current Thread