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 <!-- textdecoration_1 applies the style to the text to highlight an region
20 of the documentation refers to a lustre specific version.
22 template_{1,2,3} all use the 'condition="{l23,l24}" attributes and add
23 decoration to the rendered version of the manual to show lustre version
24 specific features. -->
26 <!-- textdecoration_1: a template to highlight regions of text. -->
27 <xsl:template name='textdecoration_1'>
28 <xsl:param name='version'/>
29 <xsl:param name='chunkid'/>
30 <fo:block-container id="{$chunkid}"
35 <fo:block-container float='left' text-indent='3px' start-indent='-20px'>
36 <fo:block background-color="gray">
37 <xsl:value-of select='$version'/>
40 <fo:block text-indent='0px' start-indent='0px'>
41 <xsl:apply-templates/>
47 <!-- mychapter definition This has been copied from xsl-ns-stylesheets/fo/component.xsl
48 and modified to provide highlight regions of text for an entire chapter.
49 This is consistent with the high-lighting provided by textdecoration_1 !-->
50 <xsl:template name="mychapter">
51 <xsl:param name='version'/>
52 <xsl:param name='chunkid'/>
53 <xsl:variable name="id">
54 <xsl:call-template name="object.id"/>
57 <xsl:variable name="master-reference">
58 <xsl:call-template name="select.pagemaster"/>
61 <fo:page-sequence hyphenate="{$hyphenate}"
62 master-reference="{$master-reference}">
63 <xsl:attribute name="language">
64 <xsl:call-template name="l10n.language"/>
66 <xsl:attribute name="format">
67 <xsl:call-template name="page.number.format">
68 <xsl:with-param name="master-reference" select="$master-reference"/>
71 <xsl:attribute name="initial-page-number">
72 <xsl:call-template name="initial.page.number">
73 <xsl:with-param name="master-reference" select="$master-reference"/>
77 <xsl:attribute name="force-page-count">
78 <xsl:call-template name="force.page.count">
79 <xsl:with-param name="master-reference" select="$master-reference"/>
83 <xsl:attribute name="hyphenation-character">
84 <xsl:call-template name="gentext">
85 <xsl:with-param name="key" select="'hyphenation-character'"/>
88 <xsl:attribute name="hyphenation-push-character-count">
89 <xsl:call-template name="gentext">
90 <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
93 <xsl:attribute name="hyphenation-remain-character-count">
94 <xsl:call-template name="gentext">
95 <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
99 <xsl:apply-templates select="." mode="running.head.mode">
100 <xsl:with-param name="master-reference" select="$master-reference"/>
101 </xsl:apply-templates>
103 <xsl:apply-templates select="." mode="running.foot.mode">
104 <xsl:with-param name="master-reference" select="$master-reference"/>
105 </xsl:apply-templates>
107 <fo:flow flow-name="xsl-region-body">
108 <xsl:call-template name="set.flow.properties">
109 <xsl:with-param name="element" select="local-name(.)"/>
110 <xsl:with-param name="master-reference" select="$master-reference"/>
113 <fo:block-container id='${chunkid}'
118 <fo:block-container float='left' text-indent='3px' start-indent='-20px'>
119 <fo:block background-color="gray">
120 <xsl:value-of select='$version'/>
122 </fo:block-container>
124 xsl:use-attribute-sets="component.titlepage.properties">
125 <xsl:call-template name="chapter.titlepage"/>
128 <!-- RHEL and SLES versions have an older docbook xsl install
129 that fails on this call:
130 xsl:call-template name="make.component.tocs"/-->
132 <xsl:apply-templates/>
133 </fo:block-container>
139 <!-- conditional matching template: this calls text decoration
140 template with the correct variables. -->
141 <xsl:template match="*[@condition]">
142 <xsl:variable name="id">
143 <xsl:call-template name="object.id"/>
145 <xsl:variable name="versionstr">
147 <xsl:when test="@condition = 'l21'">Introduced in Lustre 2.1</xsl:when>
148 <xsl:when test="@condition = 'l22'">Introduced in Lustre 2.2</xsl:when>
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:otherwise>Documentation Error: unrecognised condition attribute</xsl:otherwise>
160 <xsl:when test="name(..) = 'part'">
161 <xsl:call-template name='mychapter'>
162 <xsl:with-param name='version' select="$versionstr"/>
163 <xsl:with-param name='chunkid' select="$id"/>
167 <xsl:call-template name='textdecoration_1'>
168 <xsl:with-param name='version' select="$versionstr"/>
169 <xsl:with-param name='chunkid' select="$id"/>
175 <!-- toc.line template: This template over loads the behavior of creating the table of contents. It
176 adds in a small entry to identify lustre version specific features.
177 for more information, see this page:
178 http://xml.web.cern.ch/XML/www.sagehill.net/xml/docbookxsl/PrintCustomEx.html#PrintTocEntries -->
179 <xsl:template name="toc.line">
180 <xsl:variable name="id">
181 <xsl:call-template name="object.id"/>
183 <xsl:variable name="lustrecond">
185 <xsl:when test="@condition='l21'">L 2.1</xsl:when>
186 <xsl:when test="@condition='l22'">L 2.2</xsl:when>
187 <xsl:when test="@condition='l23'">L 2.3</xsl:when>
188 <xsl:when test="@condition='l24'">L 2.4</xsl:when>
189 <xsl:when test="@condition='l25'">L 2.5</xsl:when>
190 <xsl:when test="@condition='l26'">L 2.6</xsl:when>
191 <xsl:when test="@condition='l27'">L 2.7</xsl:when>
192 <xsl:when test="@condition='l28'">L 2.8</xsl:when>
193 <xsl:when test="@condition='l29'">L 2.9</xsl:when>
194 <xsl:otherwise></xsl:otherwise>
198 <xsl:variable name="label">
199 <xsl:apply-templates select="." mode="label.markup"/>
201 <fo:block text-align-last="justify"
202 end-indent="{$toc.indent.width}pt"
203 last-line-end-indent="-{$toc.indent.width}pt">
204 <fo:inline keep-with-next.within-line="always">
206 <xsl:when test="local-name(.) = 'chapter'">
207 <xsl:attribute name="font-weight">bold</xsl:attribute>
210 <fo:basic-link internal-destination="{$id}">
211 <xsl:if test="$label != ''">
212 <xsl:copy-of select="$label"/>
213 <xsl:value-of select="$autotoc.label.separator"/>
215 <xsl:apply-templates select="." mode="title.markup"/>
218 <fo:inline keep-together.within-line="always">
219 <xsl:text> </xsl:text>
220 <fo:leader leader-pattern="dots"
221 leader-pattern-width="3pt"
222 leader-alignment="reference-area"
223 keep-with-next.within-line="always"/>
224 <xsl:text> </xsl:text>
225 <xsl:value-of select='$lustrecond'/>
226 <xsl:text> </xsl:text>
227 <fo:basic-link internal-destination="{$id}">
228 <fo:page-number-citation ref-id="{$id}"/>