Blob Blame History Raw
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>

  <!-- sysconfdir -->
  <xsl:template match="config.sysconfdir">
    <xsl:text>@SYSCONFDIR@</xsl:text>
  </xsl:template>

  <!-- prefix -->
  <xsl:template match="config.prefix">
    <xsl:text>@PREFIX@</xsl:text>
  </xsl:template>

  <!-- generate URL for citerefentry for firewall* references only -->
  <xsl:template match="citerefentry">
    <xsl:choose>
      <xsl:when test="starts-with(refentrytitle, 'firewall')">
	<a>
	  <xsl:attribute name="href">
	    <xsl:value-of select="refentrytitle"/><xsl:text>.html</xsl:text>
	  </xsl:attribute>
	  <xsl:call-template name="inline.charseq"/>
	</a>
      </xsl:when>
      <xsl:otherwise>
	<xsl:call-template name="inline.charseq"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

  <xsl:template match="refsect1/para|refsect1/variablelist|refsect1/simplelist|refsect1/para|refsect2/para|refsect2/variablelist|refsect3/para|refsect3/variablelist|varlistentry/listitem">
    <blockquote>
      <xsl:apply-templates/>
    </blockquote>
  </xsl:template>

  <xsl:template match="refsect2|refsect3">
    <blockquote>
      <div>
	<xsl:call-template name="common.html.attributes">
	  <xsl:with-param name="inherit" select="1"/>
	</xsl:call-template>
	<xsl:call-template name="id.attribute">
	  <xsl:with-param name="conditional" select="0"/>
	</xsl:call-template>
	<xsl:call-template name="anchor">
	  <xsl:with-param name="conditional" select="0"/>
	</xsl:call-template>
	<!-- pick up info title -->
	<xsl:apply-templates select="(title|info/title)[1]"/>
	<xsl:apply-templates select="node()[not(self::title) and not(self::info)]"/>
      </div>
    </blockquote>
  </xsl:template>

  <xsl:template match="refnamediv">
    <h2>
      <xsl:call-template name="gentext">
        <xsl:with-param name="key" select="'RefName'"/>
      </xsl:call-template>
    </h2>
    <blockquote>
      <xsl:apply-templates/>
    </blockquote>
  </xsl:template>

  <xsl:template match="refsynopsisdiv">
    <h2>
      <xsl:call-template name="gentext">
        <xsl:with-param name="key" select="'RefSynopsisDiv'"/>
      </xsl:call-template>
    </h2>
    <blockquote>
      <xsl:apply-templates/>
    </blockquote>
  </xsl:template>

  <xsl:template match="simplelist/member">
    <xsl:apply-templates/>
    <xsl:choose>
      <xsl:when test="position() = last()"></xsl:when>
      <xsl:otherwise>
	<xsl:text>, </xsl:text>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

  <xsl:output method="html" encoding="UTF-8" indent="no"/>

  <!-- From Bob Stayton, Sagehill Enterprises, bobs@sagehill.net -->
  <!-- selects the programlisting's first node, if it is a text node, and if it has a following sibling (which means it is not the only node) -->
  <xsl:template match="programlisting/node()[1][self::text()][following-sibling::node()]">
    <xsl:call-template name="trim-left">
      <xsl:with-param name="contents" select="."/>
    </xsl:call-template>
  </xsl:template>
  <!-- selects the programlisting's last node, if it is a text node, and if it has a preceding sibling (which means it is not the only node) -->
  <xsl:template match="programlisting/node()[position() = last()][self::text()][preceding-sibling::node()]">
    <xsl:call-template name="trim-right">
      <xsl:with-param name="contents" select="."/>
    </xsl:call-template>
  </xsl:template>
  <!-- selects the programlistings first node that is also the last node, if it is a text node -->
  <xsl:template match="programlisting/node()[position() = 1 and position() = last()][self::text()]" priority="1">
    <xsl:call-template name="trim.text">
      <xsl:with-param name="contents" select="."/>
    </xsl:call-template>
  </xsl:template>

</xsl:stylesheet>