summaryrefslogtreecommitdiffstats
blob: d0fe069a32e20fe6d9d1b143c84d0353fe91849d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<?xml version="1.0"?>
<axsl:stylesheet xmlns:axsl="http://www.w3.org/1999/XSL/Transform" xmlns:dbk="http://docbook.org/ns/docbook" xmlns:rnd="http://docbook.org/ns/docbook/roundtrip" version="1.0">
<!--====================================-->
<!--=                                  =-->
<!--=   DO NOT EDIT THIS STYLESHEET    =-->
<!--=                                  =-->
<!--= This stylesheet is generated     =-->
<!--= by makeSubsections.xsl and a     =-->
<!--= mapping specification.           =-->
<!--=                                  =-->
<!--= Revision history:                =-->
<!--=  1.1 2007-01-10 SRB              =-->
<!--=   Output DocBook 5.0.            =-->
<!--=  1.0 2005-11-08 SRB              =-->
<!--=   Initial version.               =-->
<!--=                                  =-->
<!--= $Id: sections2blocks.xsl 8107 2008-08-17 22:39:58Z balls $ =-->
<!--=                                  =-->
<!--====================================-->
  <axsl:output indent="yes"/>
  <axsl:strip-space elements="*"/>
  <axsl:preserve-space elements="dbk:para dbk:emphasis"/>
  <axsl:template match="dbk:appendix |&#10;  dbk:article |&#10;  dbk:book |&#10;  dbk:chapter |&#10;  dbk:part |&#10;  dbk:preface |&#10;  dbk:section |&#10;  dbk:sect1 |&#10;  dbk:sect2 |&#10;  dbk:sect3 |&#10;  dbk:sect4 |&#10;  dbk:sect5">
    <axsl:variable name="subsections" select="dbk:para[@rnd:style = &quot;bibliography&quot; or @rnd:style = &quot;bibliography-title&quot; or @rnd:style = &quot;glossary&quot; or @rnd:style = &quot;glossary-title&quot; or @rnd:style = &quot;qandaset&quot; or @rnd:style = &quot;qandaset-title&quot;]"/>
    <axsl:copy>
      <axsl:apply-templates select="@*"/>
      <axsl:choose>
        <axsl:when test="$subsections">
          <axsl:apply-templates select="$subsections[1]/preceding-sibling::node()"/>
          <axsl:apply-templates select="$subsections[1]" mode="subsections">
            <axsl:with-param name="subsections" select="$subsections[position() != 1]"/>
          </axsl:apply-templates>
        </axsl:when>
        <axsl:when test="dbk:appendix |&#10;  dbk:article |&#10;  dbk:book |&#10;  dbk:chapter |&#10;  dbk:part |&#10;  dbk:preface |&#10;  dbk:section |&#10;  dbk:sect1 |&#10;  dbk:sect2 |&#10;  dbk:sect3 |&#10;  dbk:sect4 |&#10;  dbk:sect5">
          <axsl:apply-templates select="*[self::dbk:appendix |&#10;  self::dbk:article |&#10;  self::dbk:book |&#10;  self::dbk:chapter |&#10;  self::dbk:part |&#10;  self::dbk:preface |&#10;  self::dbk:section |&#10;  self::dbk:sect1 |&#10;  self::dbk:sect2 |&#10;  self::dbk:sect3 |&#10;  self::dbk:sect4 |&#10;  self::dbk:sect5][1]/preceding-sibling::node()"/>
          <axsl:apply-templates select="dbk:appendix |&#10;  dbk:article |&#10;  dbk:book |&#10;  dbk:chapter |&#10;  dbk:part |&#10;  dbk:preface |&#10;  dbk:section |&#10;  dbk:sect1 |&#10;  dbk:sect2 |&#10;  dbk:sect3 |&#10;  dbk:sect4 |&#10;  dbk:sect5"/>
        </axsl:when>
        <axsl:otherwise>
          <axsl:apply-templates/>
        </axsl:otherwise>
      </axsl:choose>
    </axsl:copy>
    <axsl:choose>
      <axsl:when test="following-sibling::*[self::dbk:appendix |&#10;  self::dbk:article |&#10;  self::dbk:book |&#10;  self::dbk:chapter |&#10;  self::dbk:part |&#10;  self::dbk:preface |&#10;  self::dbk:section |&#10;  self::dbk:sect1 |&#10;  self::dbk:sect2 |&#10;  self::dbk:sect3 |&#10;  self::dbk:sect4 |&#10;  self::dbk:sect5] | following-sibling::dbk:para[@rnd:style = &quot;bibliography&quot; or @rnd:style = &quot;bibliography-title&quot; or @rnd:style = &quot;glossary&quot; or @rnd:style = &quot;glossary-title&quot; or @rnd:style = &quot;qandaset&quot; or @rnd:style = &quot;qandaset-title&quot;]">
        <axsl:variable name="nextComponent" select="following-sibling::*[self::dbk:appendix |&#10;  self::dbk:article |&#10;  self::dbk:book |&#10;  self::dbk:chapter |&#10;  self::dbk:part |&#10;  self::dbk:preface |&#10;  self::dbk:section |&#10;  self::dbk:sect1 |&#10;  self::dbk:sect2 |&#10;  self::dbk:sect3 |&#10;  self::dbk:sect4 |&#10;  self::dbk:sect5|self::dbk:para[@rnd:style = &quot;bibliography&quot; or @rnd:style = &quot;bibliography-title&quot; or @rnd:style = &quot;glossary&quot; or @rnd:style = &quot;glossary-title&quot; or @rnd:style = &quot;qandaset&quot; or @rnd:style = &quot;qandaset-title&quot;]][1]"/>
        <axsl:apply-templates select="following-sibling::*[generate-id(following-sibling::*[self::dbk:appendix |&#10;  self::dbk:article |&#10;  self::dbk:book |&#10;  self::dbk:chapter |&#10;  self::dbk:part |&#10;  self::dbk:preface |&#10;  self::dbk:section |&#10;  self::dbk:sect1 |&#10;  self::dbk:sect2 |&#10;  self::dbk:sect3 |&#10;  self::dbk:sect4 |&#10;  self::dbk:sect5|self::dbk:para[@rnd:style = &quot;bibliography&quot; or @rnd:style = &quot;bibliography-title&quot; or @rnd:style = &quot;glossary&quot; or @rnd:style = &quot;glossary-title&quot; or @rnd:style = &quot;qandaset&quot; or @rnd:style = &quot;qandaset-title&quot;]][1]) = generate-id($nextComponent)]"/>
      </axsl:when>
      <axsl:otherwise>
        <axsl:apply-templates select="following-sibling::*"/>
      </axsl:otherwise>
    </axsl:choose>
  </axsl:template>
  <axsl:template match="dbk:para" mode="subsections">
    <axsl:param name="subsections" select="/.."/>
    <axsl:choose>
      <axsl:when test="@rnd:style = &quot;bibliography&quot; or @rnd:style = &quot;bibliography-title&quot;">
        <bibliography xmlns="http://docbook.org/ns/docbook">
          <axsl:call-template name="copy"/>
          <axsl:variable name="bibliodivs" select="following-sibling::dbk:para[@rnd:style = &quot;bibliodiv&quot; or @rnd:style = &quot;bibliodiv-title&quot;]"/>
          <axsl:choose>
            <axsl:when test="$bibliodivs">
              <axsl:apply-templates select="following-sibling::*[1]" mode="bibliodivs">
                <axsl:with-param name="nextSubsection" select="$subsections[1]"/>
                <axsl:with-param name="bibliodivs" select="$bibliodivs[position() != 1]"/>
              </axsl:apply-templates>
            </axsl:when>
            <axsl:otherwise>
              <axsl:apply-templates select="following-sibling::*[1]" mode="terminal">
                <axsl:with-param name="nextSubsection" select="$subsections[1]"/>
              </axsl:apply-templates>
            </axsl:otherwise>
          </axsl:choose>
        </bibliography>
      </axsl:when>
      <axsl:when test="@rnd:style = &quot;glossary&quot; or @rnd:style = &quot;glossary-title&quot;">
        <glossary xmlns="http://docbook.org/ns/docbook">
          <axsl:call-template name="copy"/>
          <axsl:variable name="glossdivs" select="following-sibling::dbk:para[@rnd:style = &quot;glossdiv&quot; or @rnd:style = &quot;glossdiv-title&quot;]"/>
          <axsl:choose>
            <axsl:when test="$glossdivs">
              <axsl:apply-templates select="following-sibling::*[1]" mode="glossdivs">
                <axsl:with-param name="nextSubsection" select="$subsections[1]"/>
                <axsl:with-param name="glossdivs" select="$glossdivs[position() != 1]"/>
              </axsl:apply-templates>
            </axsl:when>
            <axsl:otherwise>
              <axsl:apply-templates select="following-sibling::*[1]" mode="terminal">
                <axsl:with-param name="nextSubsection" select="$subsections[1]"/>
              </axsl:apply-templates>
            </axsl:otherwise>
          </axsl:choose>
        </glossary>
      </axsl:when>
      <axsl:when test="@rnd:style = &quot;qandaset&quot; or @rnd:style = &quot;qandaset-title&quot;">
        <qandaset xmlns="http://docbook.org/ns/docbook">
          <axsl:call-template name="copy"/>
          <axsl:variable name="qandadivs" select="following-sibling::dbk:para[@rnd:style = &quot;qandadiv&quot; or @rnd:style = &quot;qandadiv-title&quot;]"/>
          <axsl:choose>
            <axsl:when test="$qandadivs">
              <axsl:apply-templates select="following-sibling::*[1]" mode="qandadivs">
                <axsl:with-param name="nextSubsection" select="$subsections[1]"/>
                <axsl:with-param name="qandadivs" select="$qandadivs[position() != 1]"/>
              </axsl:apply-templates>
            </axsl:when>
            <axsl:otherwise>
              <axsl:apply-templates select="following-sibling::*[1]" mode="terminal">
                <axsl:with-param name="nextSubsection" select="$subsections[1]"/>
              </axsl:apply-templates>
            </axsl:otherwise>
          </axsl:choose>
        </qandaset>
      </axsl:when>
    </axsl:choose>
  </axsl:template>
  <axsl:template match="*" mode="subsections">
    <axsl:param name="subsections" select="/.."/>
    <axsl:copy>
      <axsl:apply-templates select="@*"/>
      <axsl:apply-templates mode="subsections"/>
    </axsl:copy>
  </axsl:template>
  <axsl:template match="dbk:para" mode="bibliodivs">
    <axsl:param name="nextSubsection" select="/.."/>
    <axsl:param name="bibliodivs" select="/.."/>
    <axsl:choose>
      <axsl:when test="generate-id() = generate-id($nextSubsection)"/>
      <axsl:when test="@rnd:style = &quot;bibliodiv&quot; or @rnd:style = &quot;bibliodiv-title&quot;">
        <bibliodiv xmlns="http://docbook.org/ns/docbook">
          <axsl:call-template name="copy"/>
          <axsl:apply-templates select="following-sibling::*[1]" mode="terminal">
            <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
            <axsl:with-param name="nextbibliodiv" select="$bibliodivs[1]"/>
          </axsl:apply-templates>
        </bibliodiv>
        <axsl:choose>
          <axsl:when test="$nextSubsection and         $bibliodivs and         count($nextSubsection/preceding-sibling::* | $bibliodivs[1]) = count($nextSubsection/preceding-sibling::*)">
            <axsl:apply-templates select="$bibliodivs[1]" mode="bibliodivs">
              <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
              <axsl:with-param name="bibliodivs" select="$bibliodivs[position() != 1]"/>
            </axsl:apply-templates>
          </axsl:when>
          <axsl:when test="$bibliodivs">
            <axsl:apply-templates select="$bibliodivs[1]" mode="bibliodivs">
              <axsl:with-param name="bibliodivs" select="$bibliodivs[position() != 1]"/>
            </axsl:apply-templates>
          </axsl:when>
        </axsl:choose>
      </axsl:when>
      <axsl:otherwise>
        <axsl:call-template name="copy"/>
        <axsl:apply-templates select="following-sibling::*[1]" mode="bibliodivs">
          <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
        </axsl:apply-templates>
      </axsl:otherwise>
    </axsl:choose>
  </axsl:template>
  <axsl:template match="dbk:para" mode="glossdivs">
    <axsl:param name="nextSubsection" select="/.."/>
    <axsl:param name="glossdivs" select="/.."/>
    <axsl:choose>
      <axsl:when test="generate-id() = generate-id($nextSubsection)"/>
      <axsl:when test="@rnd:style = &quot;glossdiv&quot; or @rnd:style = &quot;glossdiv-title&quot;">
        <glossdiv xmlns="http://docbook.org/ns/docbook">
          <axsl:call-template name="copy"/>
          <axsl:apply-templates select="following-sibling::*[1]" mode="terminal">
            <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
            <axsl:with-param name="nextglossdiv" select="$glossdivs[1]"/>
          </axsl:apply-templates>
        </glossdiv>
        <axsl:choose>
          <axsl:when test="$nextSubsection and         $glossdivs and         count($nextSubsection/preceding-sibling::* | $glossdivs[1]) = count($nextSubsection/preceding-sibling::*)">
            <axsl:apply-templates select="$glossdivs[1]" mode="glossdivs">
              <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
              <axsl:with-param name="glossdivs" select="$glossdivs[position() != 1]"/>
            </axsl:apply-templates>
          </axsl:when>
          <axsl:when test="$glossdivs">
            <axsl:apply-templates select="$glossdivs[1]" mode="glossdivs">
              <axsl:with-param name="glossdivs" select="$glossdivs[position() != 1]"/>
            </axsl:apply-templates>
          </axsl:when>
        </axsl:choose>
      </axsl:when>
      <axsl:otherwise>
        <axsl:call-template name="copy"/>
        <axsl:apply-templates select="following-sibling::*[1]" mode="glossdivs">
          <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
        </axsl:apply-templates>
      </axsl:otherwise>
    </axsl:choose>
  </axsl:template>
  <axsl:template match="dbk:para" mode="qandadivs">
    <axsl:param name="nextSubsection" select="/.."/>
    <axsl:param name="qandadivs" select="/.."/>
    <axsl:choose>
      <axsl:when test="generate-id() = generate-id($nextSubsection)"/>
      <axsl:when test="@rnd:style = &quot;qandadiv&quot; or @rnd:style = &quot;qandadiv-title&quot;">
        <qandadiv xmlns="http://docbook.org/ns/docbook">
          <axsl:call-template name="copy"/>
          <axsl:apply-templates select="following-sibling::*[1]" mode="terminal">
            <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
            <axsl:with-param name="nextqandadiv" select="$qandadivs[1]"/>
          </axsl:apply-templates>
        </qandadiv>
        <axsl:choose>
          <axsl:when test="$nextSubsection and         $qandadivs and         count($nextSubsection/preceding-sibling::* | $qandadivs[1]) = count($nextSubsection/preceding-sibling::*)">
            <axsl:apply-templates select="$qandadivs[1]" mode="qandadivs">
              <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
              <axsl:with-param name="qandadivs" select="$qandadivs[position() != 1]"/>
            </axsl:apply-templates>
          </axsl:when>
          <axsl:when test="$qandadivs">
            <axsl:apply-templates select="$qandadivs[1]" mode="qandadivs">
              <axsl:with-param name="qandadivs" select="$qandadivs[position() != 1]"/>
            </axsl:apply-templates>
          </axsl:when>
        </axsl:choose>
      </axsl:when>
      <axsl:otherwise>
        <axsl:call-template name="copy"/>
        <axsl:apply-templates select="following-sibling::*[1]" mode="qandadivs">
          <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
        </axsl:apply-templates>
      </axsl:otherwise>
    </axsl:choose>
  </axsl:template>
  <axsl:template match="*" mode="terminal">
    <axsl:param name="nextSubsection" select="/.."/>
    <axsl:param name="nextbibliodiv" select="/.."/>
    <axsl:param name="nextglossdiv" select="/.."/>
    <axsl:param name="nextqandadiv" select="/.."/>
    <axsl:choose>
      <axsl:when test="generate-id() = generate-id($nextSubsection)"/>
      <axsl:when test="generate-id() = generate-id($nextbibliodiv)"/>
      <axsl:when test="generate-id() = generate-id($nextglossdiv)"/>
      <axsl:when test="generate-id() = generate-id($nextqandadiv)"/>
      <axsl:otherwise>
        <axsl:call-template name="copy"/>
        <axsl:apply-templates select="following-sibling::*[1]" mode="terminal">
          <axsl:with-param name="nextSubsection" select="$nextSubsection"/>
          <axsl:with-param name="nextbibliodiv" select="$nextbibliodiv"/>
          <axsl:with-param name="nextglossdiv" select="$nextglossdiv"/>
          <axsl:with-param name="nextqandadiv" select="$nextqandadiv"/>
        </axsl:apply-templates>
      </axsl:otherwise>
    </axsl:choose>
  </axsl:template>
  <axsl:template match="*">
    <axsl:copy>
      <axsl:apply-templates select="@*"/>
      <axsl:apply-templates/>
    </axsl:copy>
  </axsl:template>
  <axsl:template name="copy">
    <axsl:copy>
      <axsl:apply-templates select="@*"/>
      <axsl:apply-templates/>
    </axsl:copy>
  </axsl:template>
  <axsl:template match="@*">
    <axsl:copy/>
  </axsl:template>
</axsl:stylesheet>