github.com/matislovas/ratago@v0.0.0-20240408115641-cc0857415a7a/xslt/testdata/general/bug-94.xsl (about)

     1  <xsl:stylesheet version = '1.0'
     2       xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
     3  <!-- borrowed from http://www.zvon.org/xxl/XSLTutorial/Output/example35_ch9.html -->
     4  
     5  <xsl:template match="/">
     6       <TABLE>
     7            <xsl:for-each select="//number">
     8                 <TR>
     9                      <TH>
    10                           <xsl:choose>
    11                                <xsl:when test="text() mod 2">
    12                                     <xsl:apply-templates select=".">
    13                                          <xsl:with-param name="type">odd</xsl:with-param>
    14                                     </xsl:apply-templates>
    15                                </xsl:when>
    16                                <xsl:otherwise>
    17                                     <xsl:apply-templates select="."/>
    18                                </xsl:otherwise>
    19                           </xsl:choose>
    20                      </TH>
    21                 </TR>
    22            </xsl:for-each>
    23       </TABLE>
    24  </xsl:template>
    25  
    26  <xsl:template match="number">
    27       <xsl:variable name="type">even</xsl:variable>
    28       <xsl:value-of select="."/>
    29       <xsl:text> (</xsl:text>
    30       <xsl:value-of select="$type"/>
    31       <xsl:text>)</xsl:text>
    32  </xsl:template>
    33  
    34  
    35  </xsl:stylesheet>