1 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
3 <!-- This stylesheet driver imports my common stylesheet that makes some
4 changes that are wanted for all forms of output. Then it makes changes that are
5 specific to HTML output. -->
7 <xsl:import href="MyStyle.xsl"/>
10 <!-- This removes the title of the current page from the top of the page -
11 redundant because each page is a chapter, whose title shows just below. It also
12 removes the titles of the next/prev at the bottom of the page, but I don't
13 think that matters too much. -->
15 <xsl:param name="navig.showtitles" select="'0'"/>
18 <!-- This allows for the setting of RevisionFlag on elements. -->
20 <xsl:param name="show.revisionflag" select="'1'"/>
22 <!-- This adds an in-line style to the generated HTML. We need this for the
23 RevisionFlag stuff. While we are at it, we also set the style for
24 <literallayout> blocks. -->
26 <xsl:template name="system.head.content">
27 <style type="text/css">
29 div.added { background-color: #ffff99; }
30 div.deleted { text-decoration: line-through;
31 background-color: #FF7F7F; }
32 div.changed { background-color: #99ff99; }
35 span.added { background-color: #ffff99; }
36 span.deleted { text-decoration: line-through;
37 background-color: #FF7F7F; }
38 span.changed { background-color: #99ff99; }
41 <!-- Styles for <literallayout> -->
44 background-color: #E8E8D0;
50 div[class=changed] pre.literallayout {
51 background-color: #99ff99;
58 background-color: #E8E8D0;
64 div[class=changed] div.literallayout {
65 background-color: #99ff99;
75 <!-- Here's the template for the actual revision flag thingy. -->
77 <xsl:template match="*[@revisionflag]">
79 <xsl:when test="local-name(.) = 'para' or local-name(.) = 'simpara' or local-name(.) = 'formalpara' or local-name(.) = 'section' or local-name(.) = 'sect1' or local-name(.) = 'sect2' or local-name(.) = 'sect3' or local-name(.) = 'sect4' or local-name(.) = 'sect5' or local-name(.) = 'chapter' or local-name(.) = 'preface' or local-name(.) = 'itemizedlist' or local-name(.) = 'varlistentry' or local-name(.) = 'glossary' or local-name(.) = 'bibliography' or local-name(.) = 'index' or local-name(.) = 'appendix'">
80 <div class="{@revisionflag}">
84 <xsl:when test="local-name(.) = 'phrase' or local-name(.) = 'ulink' or local-name(.) = 'link' or local-name(.) = 'filename' or local-name(.) = 'literal' or local-name(.) = 'member' or local-name(.) = 'glossterm' or local-name(.) = 'sgmltag' or local-name(.) = 'quote' or local-name(.) = 'emphasis' or local-name(.) = 'command' or local-name(.) = 'xref'">
85 <span class="{@revisionflag}">
89 <xsl:when test="local-name(.) = 'listitem' or local-name(.) = 'entry' or local-name(.) = 'title'">
90 <!-- nop; these are handled directly in the stylesheet -->
95 <xsl:text>Revisionflag on unexpected element: </xsl:text>
96 <xsl:value-of select="local-name(.)"/>
97 <xsl:text> (Assuming block)</xsl:text>
99 <div class="{@revisionflag}">
107 <!-- The default uses short chapter titles in the TOC! I want them only for
108 use in footer lines in printed output. So we have to modify this template. I
109 changed "titleabbrev.markup" to "title.markup". -->
111 <xsl:template name="toc.line">
112 <xsl:param name="toc-context" select="."/>
113 <xsl:param name="depth" select="1"/>
114 <xsl:param name="depth.from.context" select="8"/>
117 <xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute>
119 <xsl:attribute name="href">
120 <xsl:call-template name="href.target">
121 <xsl:with-param name="context" select="$toc-context"/>
125 <xsl:variable name="label">
126 <xsl:apply-templates select="." mode="label.markup"/>
128 <xsl:copy-of select="$label"/>
129 <xsl:if test="$label != ''">
130 <xsl:value-of select="$autotoc.label.separator"/>
133 <xsl:apply-templates select="." mode="title.markup"/>
139 <!-- The default stylesheets generate both chapters and sections with <h2>
140 headings in the HTML. The argument is that the HTML headings don't go deep
141 enough to match the DocBook levels. But surely it would be better to stop them
142 at the bottom end? Anyway, the Exim documents have only one level of section
143 within chapters, and even if they went to two, it wouldn't exhaust HTML's
144 capabilities. So I have copied the style stuff here, making a 1-character
145 change from "+ 1" to "+ 2" in roughly the middle. -->
147 <xsl:template name="section.heading">
148 <xsl:param name="section" select="."/>
149 <xsl:param name="level" select="1"/>
150 <xsl:param name="allow-anchors" select="1"/>
151 <xsl:param name="title"/>
152 <xsl:param name="class" select="'title'"/>
154 <xsl:variable name="id">
156 <!-- if title is in an *info wrapper, get the grandparent -->
157 <xsl:when test="contains(local-name(..), 'info')">
158 <xsl:call-template name="object.id">
159 <xsl:with-param name="object" select="../.."/>
163 <xsl:call-template name="object.id">
164 <xsl:with-param name="object" select=".."/>
170 <!-- HTML H level is two higher than section level -->
171 <xsl:variable name="hlevel" select="$level + 2"/>
172 <xsl:element name="h{$hlevel}">
173 <xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>
174 <xsl:if test="$css.decoration != '0'">
175 <xsl:if test="$hlevel<3">
176 <xsl:attribute name="style">clear: both</xsl:attribute>
179 <xsl:if test="$allow-anchors != 0">
180 <xsl:call-template name="anchor">
181 <xsl:with-param name="node" select="$section"/>
182 <xsl:with-param name="conditional" select="0"/>
185 <xsl:copy-of select="$title"/>