2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:fo="http://www.w3.org/1999/XSL/Format"
4 xmlns:d="http://docbook.org/ns/docbook"
5 exclude-result-prefixes="d"
7 <!-- xsl:import takes place at compile time. For this reason, I sed in the correct
8 primary xsl pdf, and then run xsltproc -->
9 <xsl:import href="PRIMARYXSL"/>
10 <xsl:output method='xml'/>
12 <xsl:param name="fop1.extensions" select="1"></xsl:param>
13 <xsl:param name="chapter.autolabel" select="1"></xsl:param>
14 <xsl:param name="section.autolabel" select="1"></xsl:param>
15 <xsl:param name="appendix.autolabel" select="1"></xsl:param>
16 <xsl:param name="autotoc.label.in.hyperlink" select="1"></xsl:param>
17 <xsl:param name="section.label.includes.component.label" select="1"></xsl:param>
19 <!-- TODO: ideally generalize customstyle_common.xsl suffeciently
20 so that is can be included in this file. Currently, this file
21 duplicates customerstyle_common.xsl with some minor differences. -->
23 <!-- textdecoration_1: a template to highlight regions of text.-->
24 <xsl:template name='textdecoration_1'>
25 <xsl:param name='version'/>
26 <xsl:param name='content'/>
27 <xsl:param name='id'/>
34 <fo:block-container float='left' text-indent='3px' start-indent='-20px'>
35 <fo:block background-color="gray">
36 <xsl:value-of select='$version'/>
39 <fo:block text-indent='0px' start-indent='0px'>
40 <xsl:copy-of select="$content"/>
46 <!-- mychapter definition This has been copied from xsl-ns-stylesheets/fo/component.xsl
47 and modified to provide highlight regions of text for an entire chapter.
48 This is consistent with the high-lighting provided by textdecoration_1 !-->
49 <xsl:template name="mychapter">
50 <xsl:param name='version'/>
51 <xsl:param name='chunkid'/>
52 <xsl:variable name="id">
53 <xsl:call-template name="object.id"/>
56 <xsl:variable name="master-reference">
57 <xsl:call-template name="select.pagemaster"/>
60 <fo:page-sequence hyphenate="{$hyphenate}"
61 master-reference="{$master-reference}">
62 <xsl:attribute name="language">
63 <xsl:call-template name="l10n.language"/>
65 <xsl:attribute name="format">
66 <xsl:call-template name="page.number.format">
67 <xsl:with-param name="master-reference" select="$master-reference"/>
70 <xsl:attribute name="initial-page-number">
71 <xsl:call-template name="initial.page.number">
72 <xsl:with-param name="master-reference" select="$master-reference"/>
76 <xsl:attribute name="force-page-count">
77 <xsl:call-template name="force.page.count">
78 <xsl:with-param name="master-reference" select="$master-reference"/>
82 <xsl:attribute name="hyphenation-character">
83 <xsl:call-template name="gentext">
84 <xsl:with-param name="key" select="'hyphenation-character'"/>
87 <xsl:attribute name="hyphenation-push-character-count">
88 <xsl:call-template name="gentext">
89 <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
92 <xsl:attribute name="hyphenation-remain-character-count">
93 <xsl:call-template name="gentext">
94 <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
98 <xsl:apply-templates select="." mode="running.head.mode">
99 <xsl:with-param name="master-reference" select="$master-reference"/>
100 </xsl:apply-templates>
102 <xsl:apply-templates select="." mode="running.foot.mode">
103 <xsl:with-param name="master-reference" select="$master-reference"/>
104 </xsl:apply-templates>
106 <fo:flow flow-name="xsl-region-body">
107 <xsl:call-template name="set.flow.properties">
108 <xsl:with-param name="element" select="local-name(.)"/>
109 <xsl:with-param name="master-reference" select="$master-reference"/>
112 <fo:block-container id='chapterdecoration-{$chunkid}'
117 <fo:block-container float='left' text-indent='3px' start-indent='-20px'>
118 <fo:block background-color="gray">
119 <xsl:value-of select='$version'/>
121 </fo:block-container>
123 xsl:use-attribute-sets="component.titlepage.properties">
124 <xsl:call-template name="chapter.titlepage"/>
127 <!-- RHEL and SLES versions have an older docbook xsl install
128 that fails on this call:
129 xsl:call-template name="make.component.tocs"/-->
131 <xsl:apply-templates/>
132 </fo:block-container>
138 <!-- conditional matching template: this calls text decoration
139 template with the correct variables. -->
140 <xsl:template match="*[@condition]">
141 <xsl:param name="content">
144 <xsl:variable name="id">
145 <xsl:call-template name="object.id"/>
147 <xsl:variable name="versionstr">
149 <xsl:when test="@condition = 'l23'">Introduced in Lustre 2.3</xsl:when>
150 <xsl:when test="@condition = 'l24'">Introduced in Lustre 2.4</xsl:when>
151 <xsl:when test="@condition = 'l25'">Introduced in Lustre 2.5</xsl:when>
152 <xsl:when test="@condition = 'l26'">Introduced in Lustre 2.6</xsl:when>
153 <xsl:when test="@condition = 'l27'">Introduced in Lustre 2.7</xsl:when>
154 <xsl:when test="@condition = 'l28'">Introduced in Lustre 2.8</xsl:when>
155 <xsl:when test="@condition = 'l29'">Introduced in Lustre 2.9</xsl:when>
156 <xsl:when test="@condition = 'l2A'">Introduced in Lustre 2.10</xsl:when>
157 <xsl:when test="@condition = 'l2B'">Introduced in Lustre 2.11</xsl:when>
158 <xsl:otherwise>Documentation Error: unrecognised condition attribute</xsl:otherwise>
162 <xsl:when test="name(..) = 'part'">
163 <xsl:call-template name='mychapter'>
164 <xsl:with-param name='version' select="$versionstr"/>
165 <xsl:with-param name='chunkid' select="$id"/>
169 <xsl:call-template name='textdecoration_1'>
170 <xsl:with-param name='version' select="$versionstr"/>
171 <xsl:with-param name='content' select="$content"/>
172 <xsl:with-param name='chunkid' select="$id"/>
178 <!-- toc.line template: This template over loads the behavior of creating the table of contents. It
179 adds in a small entry to identify lustre version specific features.
180 for more information, see this page:
181 http://xml.web.cern.ch/XML/www.sagehill.net/xml/docbookxsl/PrintCustomEx.html#PrintTocEntries -->
182 <xsl:template name="toc.line">
183 <xsl:variable name="id">
184 <xsl:call-template name="object.id"/>
186 <xsl:variable name="lustrecond">
188 <xsl:when test="@condition='l23'">L 2.3</xsl:when>
189 <xsl:when test="@condition='l24'">L 2.4</xsl:when>
190 <xsl:when test="@condition='l25'">L 2.5</xsl:when>
191 <xsl:when test="@condition='l26'">L 2.6</xsl:when>
192 <xsl:when test="@condition='l27'">L 2.7</xsl:when>
193 <xsl:when test="@condition='l28'">L 2.8</xsl:when>
194 <xsl:when test="@condition='l29'">L 2.9</xsl:when>
195 <xsl:when test="@condition='l2A'">L 2.10</xsl:when>
196 <xsl:when test="@condition='l2B'">L 2.11</xsl:when>
197 <xsl:otherwise></xsl:otherwise>
201 <xsl:variable name="label">
202 <xsl:apply-templates select="." mode="label.markup"/>
204 <fo:block text-align-last="justify"
205 end-indent="{$toc.indent.width}pt"
206 last-line-end-indent="-{$toc.indent.width}pt">
207 <fo:inline keep-with-next.within-line="always">
209 <xsl:when test="local-name(.) = 'chapter'">
210 <xsl:attribute name="font-weight">bold</xsl:attribute>
213 <fo:basic-link internal-destination="{$id}">
214 <xsl:if test="$label != ''">
215 <xsl:copy-of select="$label"/>
216 <xsl:value-of select="$autotoc.label.separator"/>
218 <xsl:apply-templates select="." mode="title.markup"/>
221 <fo:inline keep-together.within-line="always">
222 <xsl:text> </xsl:text>
223 <fo:leader leader-pattern="dots"
224 leader-pattern-width="3pt"
225 leader-alignment="reference-area"
226 keep-with-next.within-line="always"/>
227 <xsl:text> </xsl:text>
228 <xsl:value-of select='$lustrecond'/>
229 <xsl:text> </xsl:text>
230 <fo:basic-link internal-destination="{$id}">
231 <fo:page-number-citation ref-id="{$id}"/>