2 <!DOCTYPE xsl:stylesheet [
<!ENTITY % xsldoc.ent SYSTEM
"./xsldoc.ent"> %xsldoc.ent; ]
>
3 <!--#############################################################################
4 | $Id: sections.mod.xsl,v 1.8 2004/01/03 12:19:15 j-devenish Exp $
5 |- #############################################################################
6 | $Author: j-devenish $
7 + ############################################################################## -->
10 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
11 xmlns:
doc=
"http://nwalsh.com/xsl/documentation/1.0"
12 exclude-result-prefixes=
"doc" version='
1.0'
>
14 <doc:reference id=
"sections" xmlns=
"">
16 <releaseinfo role=
"meta">
17 $Id: sections.mod.xsl,v
1.8 2004/
01/
03 12:
19:
15 j-devenish Exp $
24 <year>2000</year><year>2001</year><year>2002</year><year>2003</year><year>2004</year>
25 <holder>Ramon Casellas
</holder>
28 <doc:revision rcasver=
"1.6">&rev_2003_05;</doc:revision>
31 <title>Sections
<filename>sections.mod.xsl
</filename></title>
33 <para>The file
<filename>sections.mod.xsl
</filename> contains the
34 XSL templates for
<doc:db>section
</doc:db>,
<doc:db>simplesect
</doc:db>,
35 and
<doc:db>sect1
</doc:db>, etc.
</para>
39 <doc:template xmlns=
"">
40 <refpurpose>Process explicitly-nested sections
</refpurpose>
43 Formats a section's title (including numbering, if applicable)
44 then allows all child elements to be processed. The title
45 is formatted the using
&LaTeX; mapping identified by the
46 element name (e.g.
<doc:db>sect1
</doc:db>, etc.).
52 <term>bridgehead
</term>
56 If
<literal>true()
</literal>, the title is
57 processed like a
<doc:db>bridgehead
</doc:db> (that
58 is, the section is unnumbered and does not appear
59 in the
<doc:db>toc
</doc:db>). This parameter
60 defaults to
<literal>false()
</literal> unless the
61 section appears within a preface.
73 <para>Currently,
<quote>info
</quote> elements (e.g.
74 <doc:db>sect1info
</doc:db>),
<doc:db>subtitle
</doc:db> and
75 <doc:db>titleabbrev
</doc:db> are not honoured.
</para>
77 <para>The use of special components such as
<doc:db>toc
</doc:db>,
78 <doc:db>lot
</doc:db>,
<doc:db>index
</doc:db> and
79 <doc:db>glossary
</doc:db> is unlikely to be successful.
</para>
83 <simplelist type='inline'
>
90 <listitem><para>&mapping;</para></listitem>
95 <xsl:template match=
"sect1|sect2|sect3|sect4|sect5">
96 <xsl:param name=
"bridgehead" select=
"ancestor::preface|ancestor::colophon|ancestor::dedication|ancestor::partintro"/>
97 <xsl:variable name=
"template">
98 <xsl:value-of select=
"local-name(.)"/>
99 <xsl:if test=
"$bridgehead"><xsl:text>*
</xsl:text></xsl:if>
101 <xsl:call-template name=
"map.begin">
102 <xsl:with-param name=
"keyword" select=
"$template"/>
104 <xsl:call-template name=
"content-templates"/>
105 <xsl:call-template name=
"map.end">
106 <xsl:with-param name=
"keyword" select=
"$template"/>
110 <doc:template xmlns=
"">
111 <refpurpose>Process recursive and leaf sections
</refpurpose>
114 Formats a section's title (including numbering, if applicable)
115 then allows all child elements to be processed. The title
116 is formatted the using
&LaTeX; mapping identified by the
117 equivalent explicit element (e.g.
<doc:db>sect1
</doc:db>, etc.).
123 <term>bridgehead
</term>
127 If
<literal>true()
</literal>, the title is
128 processed like a
<doc:db>bridgehead
</doc:db> (that
129 is, the section is unnumbered and does not appear
130 in the
<doc:db>toc
</doc:db>). This parameter
131 defaults to
<literal>false()
</literal> unless the
132 section appears within a preface.
142 The numeric nesting level of the section. This is
143 automatically calculated as
"one greater than the
144 number of ancestor <doc:db>section</doc:db>s".
156 <para>Titles for sections nested beyond a depth of five are
157 formatted like
<doc:db>sect5
</doc:db>.
</para>
159 <para>Currently,
<quote>info
</quote> elements (e.g.
160 <doc:db>sectioninfo
</doc:db>),
<doc:db>subtitle
</doc:db> and
161 <doc:db>titleabbrev
</doc:db> are not honoured.
</para>
163 <para>The use of special components such as
<doc:db>toc
</doc:db>,
164 <doc:db>lot
</doc:db>,
<doc:db>index
</doc:db> and
165 <doc:db>glossary
</doc:db> is unlikely to be successful.
</para>
167 <para>&LaTeX; makes no semantic distinction between
168 <doc:db>section
</doc:db> and
<doc:db>simplesect
</doc:db>.
</para>
172 <simplelist type='inline'
>
179 <listitem><para>&mapping;</para></listitem>
183 <xsl:template match=
"section|simplesect">
184 <xsl:param name=
"bridgehead" select=
"ancestor::preface|ancestor::colophon|ancestor::dedication"/>
185 <xsl:param name=
"level" select=
"count(ancestor::section)+1"/>
186 <xsl:variable name=
"template">
188 <xsl:when test='$level
<6'
>
189 <xsl:text>sect
</xsl:text>
190 <xsl:value-of select=
"$level"/>
193 <xsl:message>DB2LaTeX: recursive section|simplesect
> 5 not well supported.
</xsl:message>
194 <xsl:text>sect6
</xsl:text>
197 <xsl:if test=
"$bridgehead"><xsl:text>*
</xsl:text></xsl:if>
199 <xsl:text> </xsl:text>
200 <xsl:call-template name=
"map.begin">
201 <xsl:with-param name=
"keyword" select=
"$template"/>
203 <xsl:call-template name=
"content-templates"/>
204 <xsl:call-template name=
"map.end">
205 <xsl:with-param name=
"keyword" select=
"$template"/>