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

     1  <?xml version="1.0"?>
     2  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     3  <xsl:template match="/">
     4  <xsl:variable name="first" select="/doc/*[1]"/>
     5  <xsl:variable name="last" select="/doc/*[last()]"/>
     6  <xsl:text>Count1 :</xsl:text>
     7  <xsl:value-of select="count($first/ancestor::* | $last/ancestor::*)"/>
     8  <xsl:text>
     9  </xsl:text>
    10  <xsl:variable name="both" select="/doc/child2 | /doc/child1"/>
    11  <xsl:text>Count2 :</xsl:text>
    12  <xsl:value-of select="count($both/ancestor::*)"/>
    13  <xsl:text>
    14  </xsl:text>
    15  </xsl:template>
    16  </xsl:stylesheet>