Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
50
Task/Roman-numerals-Encode/XSLT/roman-numerals-encode.xslt
Normal file
50
Task/Roman-numerals-Encode/XSLT/roman-numerals-encode.xslt
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:template match="/data/number">
|
||||
<xsl:call-template name="for">
|
||||
<xsl:with-param name="stop">13</xsl:with-param>
|
||||
<xsl:with-param name="value"><xsl:value-of select="@value"></xsl:value-of></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="for">
|
||||
<xsl:param name="start">1</xsl:param>
|
||||
<xsl:param name="stop">1</xsl:param>
|
||||
<xsl:param name="step">1</xsl:param>
|
||||
<xsl:param name="value">1</xsl:param>
|
||||
<xsl:text/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="($value > /data/roman
|
||||
/numeral[@pos=$start]/@value or $value = /data/roman
|
||||
/numeral[@pos=$start]/@value) ">
|
||||
<xsl:value-of select="/data/roman
|
||||
/numeral[@pos=$start]/@letter"/>
|
||||
<xsl:call-template name="for">
|
||||
<xsl:with-param name="stop">
|
||||
<xsl:value-of select="$stop"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="start">
|
||||
<xsl:value-of select="$start"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="value">
|
||||
<xsl:value-of select="$value - /data/roman/numeral[@pos=$start]/@value"/>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:if test="$start < $stop">
|
||||
<xsl:call-template name="for">
|
||||
<xsl:with-param name="stop">
|
||||
<xsl:value-of select="$stop"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="start">
|
||||
<xsl:value-of select="$start + $step"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="value">
|
||||
<xsl:value-of select="$value"/>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
Loading…
Add table
Add a link
Reference in a new issue