trying to get HEAD building again. If you want the code
[ira/wip.git] / docs / docbook / xslt / db2latex / sections.mod.xsl
1 <?xml version='1.0'?>
2 <!--############################################################################# 
3 |- #############################################################################
4 |                                                                                                               
5 |   PURPOSE: sections.
6 |   PENDING:
7 |       - Nested section|simplesect > 3 mapped to subsubsection*
8 |    - No sectinfo (!)
9 + ############################################################################## -->
10
11 <xsl:stylesheet 
12     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
13     xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
14     exclude-result-prefixes="doc" version='1.0'>
15
16
17
18     <!--############################################################################# -->
19     <!-- DOCUMENTATION                                                                -->
20     <doc:reference id="sections" xmlns="">
21         <referenceinfo>
22             <releaseinfo role="meta">
23             </releaseinfo>
24         <authogroup>
25             <author> <firstname>Ramon</firstname> <surname>Casellas</surname> </author>
26             <author> <firstname>James</firstname> <surname>Devenish</surname> </author>
27         </authogroup>
28             <copyright>
29                 <year>2000</year> <year>2001</year> <year>2002</year> <year>2003</year>
30                 <holder>Ramon Casellas</holder>
31             </copyright>
32         </referenceinfo>
33
34         <title>Sections <filename>sections.mod.xsl</filename></title>
35         <partintro>
36             <section><title>Introduction</title>
37                 <para></para>
38             </section>
39         </partintro>
40     </doc:reference>
41
42
43
44
45
46     <xsl:template match="sect1|sect2|sect3|sect4|sect5">
47         <xsl:call-template name="map.begin"/>
48         <xsl:apply-templates/>
49     </xsl:template>
50
51     <xsl:template match="sect1/title"/>
52     <xsl:template match="sect2/title"/>
53     <xsl:template match="sect3/title"/>
54     <xsl:template match="sect4/title"/>
55     <xsl:template match="sect5/title"/>
56
57
58     <xsl:template match="section">
59         <xsl:text>&#10;</xsl:text>
60         <xsl:variable name="level" select="count(ancestor::section)+1"/>
61         <xsl:choose>
62             <xsl:when test='$level=1'>
63                 <xsl:call-template name="map.begin">
64                     <xsl:with-param name="keyword" select="'sect1'"/>
65                 </xsl:call-template>
66             </xsl:when>
67             <xsl:when test='$level=2'>
68                 <xsl:call-template name="map.begin">
69                     <xsl:with-param name="keyword" select="'sect2'"/>
70                 </xsl:call-template>
71             </xsl:when>
72             <xsl:when test='$level=3'>
73                 <xsl:call-template name="map.begin">
74                     <xsl:with-param name="keyword" select="'sect3'"/>
75                 </xsl:call-template>
76             </xsl:when>
77             <xsl:when test='$level=4'>
78                 <xsl:call-template name="map.begin">
79                     <xsl:with-param name="keyword" select="'sect4'"/>
80                 </xsl:call-template>
81             </xsl:when>
82             <xsl:when test='$level=5'>
83                 <xsl:call-template name="map.begin">
84                     <xsl:with-param name="keyword" select="'sect5'"/>
85                 </xsl:call-template>
86             </xsl:when>
87             <xsl:otherwise> 
88                 <xsl:message>DB2LaTeX: recursive section|simplesect &gt; 5 Not  well Supported</xsl:message> 
89                 <xsl:call-template name="map.begin">
90                     <xsl:with-param name="keyword" select="'sect6'"/>
91                 </xsl:call-template>
92             </xsl:otherwise>
93         </xsl:choose>
94         <xsl:apply-templates/>
95     </xsl:template>
96
97
98     <xsl:template match="simplesect">
99         <xsl:text>&#10;</xsl:text>
100         <xsl:variable name="level" select="count(ancestor::section) + 1"/>
101         <xsl:choose>
102             <xsl:when test='$level=1'>
103                 <xsl:call-template name="map.begin">
104                     <xsl:with-param name="keyword" select="'sect1'"/>
105                 </xsl:call-template>
106             </xsl:when>
107             <xsl:when test='$level=2'>
108                 <xsl:call-template name="map.begin">
109                     <xsl:with-param name="keyword" select="'sect2'"/>
110                 </xsl:call-template>
111             </xsl:when>
112             <xsl:when test='$level=3'>
113                 <xsl:call-template name="map.begin">
114                     <xsl:with-param name="keyword" select="'sect3'"/>
115                 </xsl:call-template>
116             </xsl:when>
117             <xsl:when test='$level=4'>
118                 <xsl:call-template name="map.begin">
119                     <xsl:with-param name="keyword" select="'sect4'"/>
120                 </xsl:call-template>
121             </xsl:when>
122             <xsl:when test='$level=5'>
123                 <xsl:call-template name="map.begin">
124                     <xsl:with-param name="keyword" select="'sect5'"/>
125                 </xsl:call-template>
126             </xsl:when>
127             <xsl:otherwise> 
128                 <xsl:message>DB2LaTeX: recursive section|simplesect &gt; 5 Not  well Supported</xsl:message> 
129                 <xsl:call-template name="map.begin">
130                     <xsl:with-param name="keyword" select="'sect6'"/>
131                 </xsl:call-template>
132             </xsl:otherwise>
133         </xsl:choose>
134         <xsl:apply-templates/>
135     </xsl:template>
136
137     <xsl:template match="section/title"/>
138     <xsl:template match="simplesect/title"/>
139
140     <xsl:template match="sectioninfo"/>
141     <xsl:template match="sect1info"/>
142     <xsl:template match="sect2info"/>
143     <xsl:template match="sect3info"/>
144     <xsl:template match="sect4info"/>
145     <xsl:template match="sect5info"/>
146
147 </xsl:stylesheet>