Next / Previous / Contents / NM Tech homepage

7.6.2. The html-lit-block template: Formatting a literate block

This template is a slightly modified version of the programlisting template from the stock version in html/verbatim.xsl. We generate an HTML pre element with a class='executable' attribute, which is styled by the rule in Section 10.4.1, “pre.executable.

<!--Literate code block-->
<xsl:template name="html-lit-block">
  <xsl:param name="suppress-numbers" select="'0'"/>
  <xsl:variable name="id">
    <xsl:call-template name=""/>

  <xsl:call-template name="anchor"/>

    <xsl:when test="$suppress-numbers = '0'
                    and @linenumbering = 'numbered'
                    and $use.extensions != '0'
                    and $linenumbering.extension != '0'">
      <xsl:variable name="rtf">
      <pre class="executable">
        <xsl:call-template name="number.rtf.lines">
          <xsl:with-param name="rtf" select="$rtf"/>
      <pre class="executable">