github.com/matislovas/ratago@v0.0.0-20240408115641-cc0857415a7a/xslt/testdata/general/itemschoose.xsl (about) 1 <xsl:stylesheet version="1.0" 2 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 3 xmlns:fo="http://www.w3.org/1999/XSL/Format"> 4 5 <xsl:strip-space elements="itemlist"/> 6 7 <xsl:template match="doc"> 8 <doc> 9 <xsl:apply-templates/> 10 </doc> 11 </xsl:template> 12 13 <xsl:template match="orderedlist/listitem"> 14 <fo:list-item indent-start='2pi'> 15 <fo:list-item-label> 16 <xsl:variable name="level" 17 select="count(ancestor::orderedlist) mod 3"/> 18 <xsl:choose> 19 <xsl:when test='$level=1'> 20 <number format="i"/> 21 </xsl:when> 22 <xsl:when test='$level=2'> 23 <number format="a"/> 24 </xsl:when> 25 <xsl:otherwise> 26 <number format="1"/> 27 </xsl:otherwise> 28 </xsl:choose> 29 <xsl:text>. </xsl:text> 30 </fo:list-item-label> 31 <fo:list-item-body> 32 <xsl:apply-templates/> 33 </fo:list-item-body> 34 </fo:list-item> 35 </xsl:template> 36 </xsl:stylesheet> 37