2 <axsl:stylesheet xmlns:axsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:dbk="http://docbook.org/ns/docbook"
4 xmlns:rnd="http://docbook.org/ns/docbook/roundtrip"
6 <!--====================================-->
8 <!--= DO NOT EDIT THIS STYLESHEET =-->
10 <!--= This stylesheet is generated =-->
11 <!--= by makeSubsections.xsl and a =-->
12 <!--= mapping specification. =-->
14 <!--====================================-->
15 <axsl:output indent="yes"/>
16 <axsl:strip-space elements="*"/>
17 <axsl:preserve-space elements="dbk:para dbk:emphasis"/>
18 <axsl:template match="dbk:appendix | dbk:article | dbk:book | dbk:chapter | dbk:part | dbk:preface | dbk:section | dbk:sect1 | dbk:sect2 | dbk:sect3 | dbk:sect4 | dbk:sect5">
19 <axsl:variable name="subsections" select="dbk:para[@rnd:style = "d:bibliography" or @rnd:style = "bibliography-title" or @rnd:style = "d:glossary" or @rnd:style = "glossary-title" or @rnd:style = "d:qandaset" or @rnd:style = "qandaset-title"]"/>
21 <axsl:apply-templates select="@*"/>
23 <axsl:when test="$subsections">
24 <axsl:apply-templates select="$subsections[1]/preceding-sibling::node()"/>
25 <axsl:apply-templates select="$subsections[1]" mode="subsections">
26 <axsl:with-param name="subsections" select="$subsections[position() != 1]"/>
27 </axsl:apply-templates>
29 <axsl:when test="dbk:appendix | dbk:article | dbk:book | dbk:chapter | dbk:part | dbk:preface | dbk:section | dbk:sect1 | dbk:sect2 | dbk:sect3 | dbk:sect4 | dbk:sect5">
30 <axsl:apply-templates select="*[self::dbk:appendix | self::dbk:article | self::dbk:book | self::dbk:chapter | self::dbk:part | self::dbk:preface | self::dbk:section | self::dbk:sect1 | self::dbk:sect2 | self::dbk:sect3 | self::dbk:sect4 | self::dbk:sect5][1]/preceding-sibling::node()"/>
31 <axsl:apply-templates select="dbk:appendix | dbk:article | dbk:book | dbk:chapter | dbk:part | dbk:preface | dbk:section | dbk:sect1 | dbk:sect2 | dbk:sect3 | dbk:sect4 | dbk:sect5"/>
34 <axsl:apply-templates/>
39 <axsl:when test="following-sibling::*[self::dbk:appendix | self::dbk:article | self::dbk:book | self::dbk:chapter | self::dbk:part | self::dbk:preface | self::dbk:section | self::dbk:sect1 | self::dbk:sect2 | self::dbk:sect3 | self::dbk:sect4 | self::dbk:sect5] | following-sibling::dbk:para[@rnd:style = "d:bibliography" or @rnd:style = "bibliography-title" or @rnd:style = "d:glossary" or @rnd:style = "glossary-title" or @rnd:style = "d:qandaset" or @rnd:style = "qandaset-title"]">
40 <axsl:variable name="nextComponent" select="following-sibling::*[self::dbk:appendix | self::dbk:article | self::dbk:book | self::dbk:chapter | self::dbk:part | self::dbk:preface | self::dbk:section | self::dbk:sect1 | self::dbk:sect2 | self::dbk:sect3 | self::dbk:sect4 | self::dbk:sect5|self::dbk:para[@rnd:style = "d:bibliography" or @rnd:style = "bibliography-title" or @rnd:style = "d:glossary" or @rnd:style = "glossary-title" or @rnd:style = "d:qandaset" or @rnd:style = "qandaset-title"]][1]"/>
41 <axsl:apply-templates select="following-sibling::*[generate-id(following-sibling::*[self::dbk:appendix | self::dbk:article | self::dbk:book | self::dbk:chapter | self::dbk:part | self::dbk:preface | self::dbk:section | self::dbk:sect1 | self::dbk:sect2 | self::dbk:sect3 | self::dbk:sect4 | self::dbk:sect5|self::dbk:para[@rnd:style = "d:bibliography" or @rnd:style = "bibliography-title" or @rnd:style = "d:glossary" or @rnd:style = "glossary-title" or @rnd:style = "d:qandaset" or @rnd:style = "qandaset-title"]][1]) = generate-id($nextComponent)]"/>
44 <axsl:apply-templates select="following-sibling::*"/>
48 <axsl:template match="dbk:para" mode="subsections">
49 <axsl:param name="subsections" select="/.."/>
51 <axsl:when test="@rnd:style = "d:bibliography" or @rnd:style = "bibliography-title"">
52 <bibliography xmlns="http://docbook.org/ns/docbook">
53 <axsl:call-template name="copy"/>
54 <axsl:variable name="bibliodivs" select="following-sibling::dbk:para[@rnd:style = "d:bibliodiv" or @rnd:style = "bibliodiv-title"]"/>
56 <axsl:when test="$bibliodivs">
57 <axsl:apply-templates select="following-sibling::*[1]" mode="bibliodivs">
58 <axsl:with-param name="nextSubsection" select="$subsections[1]"/>
59 <axsl:with-param name="bibliodivs" select="$bibliodivs[position() != 1]"/>
60 </axsl:apply-templates>
63 <axsl:apply-templates select="following-sibling::*[1]" mode="terminal">
64 <axsl:with-param name="nextSubsection" select="$subsections[1]"/>
65 </axsl:apply-templates>
70 <axsl:when test="@rnd:style = "d:glossary" or @rnd:style = "glossary-title"">
71 <glossary xmlns="http://docbook.org/ns/docbook">
72 <axsl:call-template name="copy"/>
73 <axsl:variable name="glossdivs" select="following-sibling::dbk:para[@rnd:style = "d:glossdiv" or @rnd:style = "glossdiv-title"]"/>
75 <axsl:when test="$glossdivs">
76 <axsl:apply-templates select="following-sibling::*[1]" mode="glossdivs">
77 <axsl:with-param name="nextSubsection" select="$subsections[1]"/>
78 <axsl:with-param name="glossdivs" select="$glossdivs[position() != 1]"/>
79 </axsl:apply-templates>
82 <axsl:apply-templates select="following-sibling::*[1]" mode="terminal">
83 <axsl:with-param name="nextSubsection" select="$subsections[1]"/>
84 </axsl:apply-templates>
89 <axsl:when test="@rnd:style = "d:qandaset" or @rnd:style = "qandaset-title"">
90 <qandaset xmlns="http://docbook.org/ns/docbook">
91 <axsl:call-template name="copy"/>
92 <axsl:variable name="qandadivs" select="following-sibling::dbk:para[@rnd:style = "d:qandadiv" or @rnd:style = "qandadiv-title"]"/>
94 <axsl:when test="$qandadivs">
95 <axsl:apply-templates select="following-sibling::*[1]" mode="qandadivs">
96 <axsl:with-param name="nextSubsection" select="$subsections[1]"/>
97 <axsl:with-param name="qandadivs" select="$qandadivs[position() != 1]"/>
98 </axsl:apply-templates>
101 <axsl:apply-templates select="following-sibling::*[1]" mode="terminal">
102 <axsl:with-param name="nextSubsection" select="$subsections[1]"/>
103 </axsl:apply-templates>
110 <axsl:template match="*" mode="subsections">
111 <axsl:param name="subsections" select="/.."/>
113 <axsl:apply-templates select="@*"/>
114 <axsl:apply-templates mode="subsections"/>
117 <axsl:template match="dbk:para" mode="bibliodivs">
118 <axsl:param name="nextSubsection" select="/.."/>
119 <axsl:param name="bibliodivs" select="/.."/>
121 <axsl:when test="generate-id() = generate-id($nextSubsection)"/>
122 <axsl:when test="@rnd:style = "d:bibliodiv" or @rnd:style = "bibliodiv-title"">
123 <bibliodiv xmlns="http://docbook.org/ns/docbook">
124 <axsl:call-template name="copy"/>
125 <axsl:apply-templates select="following-sibling::*[1]" mode="terminal">
126 <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
127 <axsl:with-param name="nextbibliodiv" select="$bibliodivs[1]"/>
128 </axsl:apply-templates>
131 <axsl:when test="$nextSubsection and $bibliodivs and count($nextSubsection/preceding-sibling::* | $bibliodivs[1]) = count($nextSubsection/preceding-sibling::*)">
132 <axsl:apply-templates select="$bibliodivs[1]" mode="bibliodivs">
133 <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
134 <axsl:with-param name="bibliodivs" select="$bibliodivs[position() != 1]"/>
135 </axsl:apply-templates>
137 <axsl:when test="$bibliodivs">
138 <axsl:apply-templates select="$bibliodivs[1]" mode="bibliodivs">
139 <axsl:with-param name="bibliodivs" select="$bibliodivs[position() != 1]"/>
140 </axsl:apply-templates>
145 <axsl:call-template name="copy"/>
146 <axsl:apply-templates select="following-sibling::*[1]" mode="bibliodivs">
147 <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
148 </axsl:apply-templates>
152 <axsl:template match="dbk:para" mode="glossdivs">
153 <axsl:param name="nextSubsection" select="/.."/>
154 <axsl:param name="glossdivs" select="/.."/>
156 <axsl:when test="generate-id() = generate-id($nextSubsection)"/>
157 <axsl:when test="@rnd:style = "d:glossdiv" or @rnd:style = "glossdiv-title"">
158 <glossdiv xmlns="http://docbook.org/ns/docbook">
159 <axsl:call-template name="copy"/>
160 <axsl:apply-templates select="following-sibling::*[1]" mode="terminal">
161 <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
162 <axsl:with-param name="nextglossdiv" select="$glossdivs[1]"/>
163 </axsl:apply-templates>
166 <axsl:when test="$nextSubsection and $glossdivs and count($nextSubsection/preceding-sibling::* | $glossdivs[1]) = count($nextSubsection/preceding-sibling::*)">
167 <axsl:apply-templates select="$glossdivs[1]" mode="glossdivs">
168 <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
169 <axsl:with-param name="glossdivs" select="$glossdivs[position() != 1]"/>
170 </axsl:apply-templates>
172 <axsl:when test="$glossdivs">
173 <axsl:apply-templates select="$glossdivs[1]" mode="glossdivs">
174 <axsl:with-param name="glossdivs" select="$glossdivs[position() != 1]"/>
175 </axsl:apply-templates>
180 <axsl:call-template name="copy"/>
181 <axsl:apply-templates select="following-sibling::*[1]" mode="glossdivs">
182 <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
183 </axsl:apply-templates>
187 <axsl:template match="dbk:para" mode="qandadivs">
188 <axsl:param name="nextSubsection" select="/.."/>
189 <axsl:param name="qandadivs" select="/.."/>
191 <axsl:when test="generate-id() = generate-id($nextSubsection)"/>
192 <axsl:when test="@rnd:style = "d:qandadiv" or @rnd:style = "qandadiv-title"">
193 <qandadiv xmlns="http://docbook.org/ns/docbook">
194 <axsl:call-template name="copy"/>
195 <axsl:apply-templates select="following-sibling::*[1]" mode="terminal">
196 <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
197 <axsl:with-param name="nextqandadiv" select="$qandadivs[1]"/>
198 </axsl:apply-templates>
201 <axsl:when test="$nextSubsection and $qandadivs and count($nextSubsection/preceding-sibling::* | $qandadivs[1]) = count($nextSubsection/preceding-sibling::*)">
202 <axsl:apply-templates select="$qandadivs[1]" mode="qandadivs">
203 <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
204 <axsl:with-param name="qandadivs" select="$qandadivs[position() != 1]"/>
205 </axsl:apply-templates>
207 <axsl:when test="$qandadivs">
208 <axsl:apply-templates select="$qandadivs[1]" mode="qandadivs">
209 <axsl:with-param name="qandadivs" select="$qandadivs[position() != 1]"/>
210 </axsl:apply-templates>
215 <axsl:call-template name="copy"/>
216 <axsl:apply-templates select="following-sibling::*[1]" mode="qandadivs">
217 <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
218 </axsl:apply-templates>
222 <axsl:template match="*" mode="terminal">
223 <axsl:param name="nextSubsection" select="/.."/>
224 <axsl:param name="nextbibliodiv" select="/.."/>
225 <axsl:param name="nextglossdiv" select="/.."/>
226 <axsl:param name="nextqandadiv" select="/.."/>
228 <axsl:when test="generate-id() = generate-id($nextSubsection)"/>
229 <axsl:when test="generate-id() = generate-id($nextbibliodiv)"/>
230 <axsl:when test="generate-id() = generate-id($nextglossdiv)"/>
231 <axsl:when test="generate-id() = generate-id($nextqandadiv)"/>
233 <axsl:call-template name="copy"/>
234 <axsl:apply-templates select="following-sibling::*[1]" mode="terminal">
235 <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
236 <axsl:with-param name="nextbibliodiv" select="$nextbibliodiv"/>
237 <axsl:with-param name="nextglossdiv" select="$nextglossdiv"/>
238 <axsl:with-param name="nextqandadiv" select="$nextqandadiv"/>
239 </axsl:apply-templates>
243 <axsl:template match="*">
245 <axsl:apply-templates select="@*"/>
246 <axsl:apply-templates/>
249 <axsl:template name="copy">
251 <axsl:apply-templates select="@*"/>
252 <axsl:apply-templates/>
255 <axsl:template match="@*">