Skip to content

Commit 3c2cc07

Browse files
committed
rename to toc-block
1 parent 26fc7e5 commit 3c2cc07

1 file changed

Lines changed: 32 additions & 32 deletions

File tree

src/org/daisy/dotify/tasks/impl/input/xml/resource-files/common/xslt-files/dtbook2obfl_braille.xsl

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- komplexa sub, sup
66
- länkar, e-postadresser
77
-->
8-
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
8+
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
99
xmlns:dtb="http://www.daisy.org/z3986/2005/dtbook/"
1010
xmlns:xs="http://www.w3.org/2001/XMLSchema"
1111
exclude-result-prefixes="dtb xs obfl dotify xtd"
@@ -40,7 +40,7 @@
4040
<xsl:param name="l10nEndnotesPageHeader" select="'Footnotes'"/>
4141
<xsl:param name="l10ntable" select="'Table'"/>
4242
<xsl:param name="l10ntablepart" select="'Table part'"/>
43-
43+
4444
<xsl:key name="noterefs" match="dtb:noteref" use="substring-after(@idref, '#')"/>
4545

4646
<xsl:template match="/">
@@ -54,13 +54,13 @@
5454
<xsl:apply-templates/>
5555
</obfl>
5656
</xsl:template>
57-
57+
5858
<xsl:template name="insertLayoutMaster">
5959
<xsl:copy-of select="obfl:insertLayoutMaster(
6060
count(//dtb:note[key('noterefs', @id)[ancestor::dtb:frontmatter]]),
6161
count(//dtb:note[key('noterefs', @id)[not(ancestor::dtb:frontmatter)]]))"/>
6262
</xsl:template>
63-
63+
6464
<xsl:template name="insertTOCVolumeTemplate">
6565
<xsl:variable name="insertToc" select="$toc-depth > 0 and (//dtb:level1[@class='toc'] or //dtb:level1[dtb:list[@class='toc']])" as="xs:boolean"/>
6666
<xsl:if test="$insertToc">
@@ -106,14 +106,14 @@
106106
</xsl:template>
107107

108108
<xsl:template name="insertNoteCollection">
109-
<xsl:param name="footnotesInFrontMatter" select="//dtb:note[key('noterefs', @id)[ancestor::dtb:frontmatter]]"/>
109+
<xsl:param name="footnotesInFrontMatter" select="//dtb:note[key('noterefs', @id)[ancestor::dtb:frontmatter]]"/>
110110
<xsl:param name="footnotesNotInFrontMatter" select="//dtb:note[key('noterefs', @id)[not(ancestor::dtb:frontmatter)]]"/>
111111
<xsl:if test="count($footnotesInFrontMatter)>0">
112112
<collection name="footnotes-front">
113113
<xsl:apply-templates select="$footnotesInFrontMatter" mode="collectNotes">
114114
<xsl:with-param name="afix">.A</xsl:with-param>
115115
</xsl:apply-templates>
116-
<!--
116+
<!--
117117
<item id="note1" text-indent="4">1).</item> -->
118118
</collection>
119119
</xsl:if>
@@ -122,12 +122,12 @@
122122
<xsl:apply-templates select="$footnotesNotInFrontMatter" mode="collectNotes">
123123
<xsl:with-param name="afix">.B</xsl:with-param>
124124
</xsl:apply-templates>
125-
<!--
125+
<!--
126126
<item id="note1" text-indent="4">1).</item> -->
127127
</collection>
128128
</xsl:if>
129129
</xsl:template>
130-
130+
131131
<xsl:template match="dtb:noteref" priority="10">
132132
<xsl:apply-templates select="." mode="inline-mode"/>
133133
<xsl:variable name="afix">
@@ -141,7 +141,7 @@
141141
<xsl:otherwise><xsl:message terminate="no">Only fragment identifier supported: <xsl:value-of select="@idref"/></xsl:message></xsl:otherwise>
142142
</xsl:choose>
143143
</xsl:template>
144-
144+
145145
<xsl:template match="dtb:note" mode="collectNotes">
146146
<xsl:param name="afix"/>
147147
<item id="{concat(@id, $afix)}">
@@ -152,7 +152,7 @@
152152
<xsl:choose>
153153
<xsl:when test="self::text()">
154154
<xsl:message terminate="yes">Unexpected text contents in "note" element.</xsl:message>
155-
</xsl:when>
155+
</xsl:when>
156156
<xsl:when test="position()=1 and count(text())>0"> <!-- and an element -->
157157
<xsl:copy>
158158
<xsl:copy-of select="@*[not(local-name()='first-line-indent' or local-name()='text-indent' or local-name()='block-indent')]"/>
@@ -181,7 +181,7 @@
181181
</sequence>
182182
</xsl:if>
183183
</xsl:template>
184-
184+
185185
<!-- Don't output a sequence if there is nothing left when level1@class='backCoverText', level1@class='rearjacketcopy' and level1@class='colophon' has been moved -->
186186
<xsl:template match="dtb:rearmatter" mode="sequence-mode">
187187
<xsl:if test="*[not(self::dtb:level1[@class='backCoverText' or @class='rearjacketcopy' or @class='colophon' or @class='toc' or dtb:list[@class='toc']
@@ -193,14 +193,14 @@
193193
</sequence>
194194
</xsl:if>
195195
</xsl:template>
196-
196+
197197
<!-- Don't output a sequence if there is nothing left when doctitle, docauthor and level1@class='backCoverText', level1@class='rearjacketcopy' and level1@class='colophon' has been moved -->
198198
<xsl:template match="dtb:frontmatter" mode="pre-volume-mode">
199199
<xsl:if test="*[not(self::dtb:doctitle or self::dtb:docauthor or self::dtb:level1[@class='backCoverText' or @class='rearjacketcopy' or @class='colophon' or @class='toc' or dtb:list[@class='toc']])]">
200200
<sequence master="front">
201201
<block break-before="page">
202202
<xsl:apply-templates/>
203-
<!--
203+
<!--
204204
<xsl:variable name="tree">
205205
<xsl:apply-templates/>
206206
</xsl:variable>
@@ -213,19 +213,19 @@
213213
<xsl:template match="*|comment()|processing-instruction()" mode="strip-id">
214214
<xsl:call-template name="copy-without-id"/>
215215
</xsl:template>
216-
216+
217217
<xsl:template name="copy-without-id">
218218
<xsl:copy>
219219
<xsl:copy-of select="@*[name()!='id']"/>
220220
<xsl:apply-templates mode="strip-id"/>
221221
</xsl:copy>
222222
</xsl:template>
223-
223+
224224
<xsl:template match="dtb:level1[@class='toc' or dtb:list[@class='toc']]"></xsl:template>
225225
<xsl:template match="dtb:level1[@class='toc' or dtb:list[@class='toc']]" mode="toc"></xsl:template>
226226

227227
<xsl:template match="dtb:level1[(@class='backCoverText' or @class='rearjacketcopy' or @class='colophon') and (parent::dtb:frontmatter or parent::dtb:rearmatter)]" mode="toc"></xsl:template>
228-
228+
229229
<xsl:template match="dtb:level1[
230230
count(descendant::dtb:note)>0 and
231231
count(descendant::*[not(ancestor::dtb:note) and (self::dtb:level2 or self::dtb:level3 or self::dtb:level4 or self::dtb:level5 or self::dtb:level6 or self::dtb:h1 or self::dtb:h2 or self::dtb:h3 or self::dtb:h4 or self::dtb:h5 or self::dtb:h6 or self::dtb:note or self::dtb:pagenum)])
@@ -238,7 +238,7 @@
238238
<xsl:next-match />
239239
</xsl:if>
240240
</xsl:template>
241-
241+
242242
<xsl:template match="dtb:level2" mode="toc" priority="0.6">
243243
<xsl:if test="$toc-depth > 1">
244244
<xsl:next-match/>
@@ -264,22 +264,22 @@
264264
<xsl:next-match/>
265265
</xsl:if>
266266
</xsl:template>
267-
267+
268268
<xsl:template match="dtb:level1|dtb:level2" mode="toc">
269269
<xsl:if test="dtb:h1|dtb:h2">
270-
<block>
270+
<toc-block>
271271
<toc-entry ref-id="{generate-id(dtb:h1|dtb:h2)}" block-indent="{$toc-indent-multiplier}"
272272
text-indent="{2*$toc-indent-multiplier}" keep="page">
273273
<xsl:apply-templates select="dtb:h1|dtb:h2" mode="toc-hd"/>
274274
</toc-entry>
275275
<xsl:apply-templates mode="toc"/>
276-
</block>
276+
</toc-block>
277277
</xsl:if>
278278
</xsl:template>
279-
279+
280280
<xsl:template match="dtb:level3|dtb:level4|dtb:level5|dtb:level6" mode="toc">
281281
<xsl:if test="dtb:h3|dtb:h4|dtb:h5|dtb:h6">
282-
<block>
282+
<toc-block>
283283
<toc-entry ref-id="{generate-id(dtb:h3|dtb:h4|dtb:h5|dtb:h6)}" block-indent="{$toc-indent-multiplier}"
284284
text-indent="{$toc-indent-multiplier}" keep="page">
285285
<xsl:apply-templates select="dtb:h3|dtb:h4|dtb:h5|dtb:h6" mode="toc-hd"/>
@@ -290,18 +290,18 @@
290290
<xsl:if test="not(dtb:level3 and ancestor::dtb:level1[@class='part'])">
291291
<xsl:apply-templates mode="toc"/>
292292
</xsl:if>
293-
</block>
293+
</toc-block>
294294
</xsl:if>
295295
</xsl:template>
296296
<!--
297297
<xsl:template name="addBottomMarginIfPart">
298-
298+
299299
<xsl:if test="(following::*[self::dtb:level1|self::dtb:level2|self::dtb:level3|self::dtb:level4|self::dtb:level5|self::dtb:level6][1])[self::dtb:level1[@class='part']]">
300300
<xsl:attribute name="padding-bottom">1</xsl:attribute>
301301
</xsl:if>
302302
</xsl:template>
303303
-->
304-
304+
305305
<xsl:template match="dtb:h1|dtb:h2|dtb:h3|dtb:h4|dtb:h5|dtb:h6" mode="toc-hd">
306306
<!-- <xsl:value-of select="descendant::text()"/>-->
307307
<xsl:apply-templates mode="toc-text"/>
@@ -324,29 +324,29 @@
324324
<xsl:template match="dtb:br" mode="toc-text">
325325
<xsl:text> </xsl:text>
326326
</xsl:template>
327-
327+
328328
<xsl:template match="node()" mode="toc"/>
329-
329+
330330
<xsl:template name="insertProcessorRenderer">
331331
<xsl:copy-of select="obfl:insertProcessorRenderer()"/>
332332
</xsl:template>
333333

334334
<xsl:template match="dtb:table">
335335
<xml-data renderer="table-renderer" xmlns:dotify="http://brailleapps.github.io/ns/dotify">
336336
<dotify:node>
337-
<block keep="page" keep-with-next="1"><xsl:value-of select="concat('== ', $l10ntable, ' ')"/><leader position="100%" pattern="="/></block>
337+
<block keep="page" keep-with-next="1"><xsl:value-of select="concat('== ', $l10ntable, ' ')"/><leader position="100%" pattern="="/></block>
338338
<xsl:apply-templates select="dtb:caption"/>
339339
<xsl:apply-templates select="." mode="matrixTable"/>
340340
<block><leader align="right" position="100%" pattern="="/></block>
341341
<xsl:apply-templates select="descendant::dtb:pagenum"/>
342342
</dotify:node>
343343
</xml-data>
344344
</xsl:template>
345-
345+
346346
<xsl:template match="dtb:table" mode="matrixTable">
347347
<table table-col-spacing="2">
348348
<xsl:choose>
349-
<xsl:when test="dtb:thead">
349+
<xsl:when test="dtb:thead">
350350
<thead>
351351
<xsl:apply-templates select="dtb:thead/dtb:tr" mode="matrixRow"/>
352352
</thead>
@@ -366,13 +366,13 @@
366366
</xsl:choose>
367367
</table>
368368
</xsl:template>
369-
369+
370370
<xsl:template match="dtb:tr" mode="matrixRow">
371371
<tr>
372372
<xsl:apply-templates mode="matrixCell"/>
373373
</tr>
374374
</xsl:template>
375-
375+
376376
<xsl:template match="dtb:td | dtb:th" mode="matrixCell">
377377
<td>
378378
<xsl:if test="@colspan">

0 commit comments

Comments
 (0)