Created
November 6, 2014 09:46
-
-
Save cergey-obr/c04ff4a69eeab7dea136 to your computer and use it in GitHub Desktop.
Склонение после числительных
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:template name="declension"> | |
<xsl:param name="number" /> | |
<xsl:param name="f0" /> | |
<xsl:param name="f1" /> | |
<xsl:param name="f2" /> | |
<xsl:variable name="absnum"> | |
<xsl:choose> | |
<xsl:when test="$number < 0"><xsl:value-of select="0 - $number" /></xsl:when> | |
<xsl:otherwise><xsl:value-of select="$number" /></xsl:otherwise> | |
</xsl:choose> | |
</xsl:variable> | |
<xsl:choose> | |
<xsl:when test="($absnum mod 10) = 1 and ($absnum mod 100) != 11"> | |
<xsl:value-of select="$f0"/> | |
</xsl:when> | |
<xsl:when test="(($absnum mod 10) >= 2) and (($absnum mod 10) <= 4) and (($absnum mod 100 < 10) or ($absnum mod 100 >= 20))"> | |
<xsl:value-of select="$f1"/> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:value-of select="$f2"/> | |
</xsl:otherwise> | |
</xsl:choose> | |
</xsl:template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment