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

     1  <?xml version="1.0"?>
     2  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
     3  
     4  <xsl:template match="/"><xsl:apply-templates select="*" /></xsl:template>
     5  <xsl:template match="foo/bar[last()=4]">
     6   4 <xsl:value-of select="." />
     7  </xsl:template>                     
     8  <xsl:template match="foo/bar[last()=3]">
     9   <xsl:message>last() was 3</xsl:message>
    10   3 <xsl:value-of select="." />
    11  </xsl:template>
    12  <xsl:template match="foo/bar[last()=2]">
    13   2 <xsl:value-of select="." />
    14  </xsl:template>
    15  <xsl:template match="foo/bar[last()=1]">
    16   1 <xsl:value-of select="." />
    17  </xsl:template>
    18  
    19  <xsl:template match="foo/bar" priority="-100">
    20    <xsl:message>last() was <xsl:value-of select="last()"/></xsl:message>
    21  </xsl:template>
    22  </xsl:stylesheet>