1 <xsl:stylesheet version="1.0"
2 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3 <xsl:output method="text"/>
5 <xsl:variable name="total" select="count(//reg)"/>
7 <xsl:template name="pad">
8 <xsl:param name="count" select="0"/>
11 <xsl:if test="$count > 1">
12 <xsl:call-template name="pad">
13 <xsl:with-param name="count" select="$count - 1"/>
18 <xsl:template name="reg">
19 <xsl:param name="which" select="1"/>
20 <xsl:param name="nextnum" select="0"/>
21 <xsl:variable name="thisnum" select="@regnum"/>
22 <xsl:if test="$nextnum < number(@regnum)">
23 <xsl:call-template name="pad">
24 <xsl:with-param name="count" select="@regnum - $nextnum"/>
27 <xsl:value-of select="@bitsize"/>
28 <xsl:text>:</xsl:text>
29 <xsl:value-of select="@name"/>
32 <xsl:if test="$which < $total">
33 <xsl:for-each select="/descendant::reg[$which + 1]">
34 <xsl:call-template name="reg">
35 <xsl:with-param name="which" select="$which + 1"/>
36 <xsl:with-param name="nextnum" select="$thisnum + 1"/>
42 <xsl:template match="/">
43 <xsl:for-each select="/descendant::reg[1]">
44 <xsl:call-template name="reg"/>