Skip to content

Commit 9acf277

Browse files
Merge pull request #92 from AntennaHouse/develop
Merge Develop for Version 1.0.5
2 parents 09a2b47 + 4d32569 commit 9acf277

8 files changed

+124
-58
lines changed

com.antennahouse.pdf5.ml/config/default_style.xml

+2-9
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,6 @@ URL : http://www.antennahouse.com/
291291
<!-- Right page thumbnail max count -->
292292
<variable name="Thumbnail_Index_Max">10</variable>
293293

294-
<!-- Table/Figure/Footnote numbering level
295-
Changed from 3 ⇒ 2 except footnote. 2011-09-09 t.makita
296-
-->
297-
<variable name="Table_Grouping_Level_Max">2</variable>
298-
<variable name="Figure_Grouping_Level_Max">2</variable>
299-
<variable name="Footnote_Grouping_Level_Max">3</variable>
300-
301294
<!-- Publish date format string -->
302295
<variable name="Publish_Date_Picture">[MNn].[D1],[Y1,4]</variable>
303296

@@ -1815,7 +1808,7 @@ URL : http://www.antennahouse.com/
18151808
<attribute name="keep-with-next.within-page">always</attribute>
18161809
</attribute-set>
18171810

1818-
<attribute-set name="atsFigTitle">
1811+
<attribute-set name="atsFigTitle" use-attribute-sets="atsTitle">
18191812
<attribute name="font-size">$Little_Title_Font_Size</attribute>
18201813
<attribute name="start-indent">inherited-property-value(start-indent)</attribute>
18211814
<attribute name="space-before">1.5mm</attribute>
@@ -2029,7 +2022,7 @@ URL : http://www.antennahouse.com/
20292022
<attribute name="start-indent">0mm</attribute>
20302023
</attribute-set>
20312024

2032-
<attribute-set name="atsTableTitle">
2025+
<attribute-set name="atsTableTitle" use-attribute-sets="atsTitle">
20332026
<attribute name="font-size">$Little_Title_Font_Size</attribute>
20342027
<attribute name="space-before">$Para_Space_Before</attribute>
20352028
<attribute name="space-after">1.5mm</attribute>

com.antennahouse.pdf5.ml/pdf5.ml.xpr

+21-6
Original file line numberDiff line numberDiff line change
@@ -5222,7 +5222,7 @@
52225222
<scenarioAssociation-array>
52235223
<scenarioAssociation>
52245224
<field name="url">
5225-
<String>xsl/dita2fo_change_bar.xsl</String>
5225+
<String>xsl/dita2fo_tableelements.xsl</String>
52265226
</field>
52275227
<field name="scenarioIds">
52285228
<list>
@@ -5237,11 +5237,11 @@
52375237
</scenarioAssociation>
52385238
<scenarioAssociation>
52395239
<field name="url">
5240-
<String>xsl/dita2fo_flag_ditaval.xsl</String>
5240+
<String>xsl/dita2fo_title.xsl</String>
52415241
</field>
52425242
<field name="scenarioIds">
52435243
<list>
5244-
<String>dita2fo_convmerged</String>
5244+
<String>PDF5-ML</String>
52455245
</list>
52465246
</field>
52475247
<field name="scenarioTypes">
@@ -5252,7 +5252,22 @@
52525252
</scenarioAssociation>
52535253
<scenarioAssociation>
52545254
<field name="url">
5255-
<String>xsl/dita2fo_convmerged.xsl</String>
5255+
<String>xsl/dita2fo_change_bar.xsl</String>
5256+
</field>
5257+
<field name="scenarioIds">
5258+
<list>
5259+
<String>PDF5-ML</String>
5260+
</list>
5261+
</field>
5262+
<field name="scenarioTypes">
5263+
<list>
5264+
<String>Validation_scenario</String>
5265+
</list>
5266+
</field>
5267+
</scenarioAssociation>
5268+
<scenarioAssociation>
5269+
<field name="url">
5270+
<String>xsl/dita2fo_flag_ditaval.xsl</String>
52565271
</field>
52575272
<field name="scenarioIds">
52585273
<list>
@@ -5267,11 +5282,11 @@
52675282
</scenarioAssociation>
52685283
<scenarioAssociation>
52695284
<field name="url">
5270-
<String>xsl/dita2fo_title.xsl</String>
5285+
<String>xsl/dita2fo_convmerged.xsl</String>
52715286
</field>
52725287
<field name="scenarioIds">
52735288
<list>
5274-
<String>PDF5-ML</String>
5289+
<String>dita2fo_convmerged</String>
52755290
</list>
52765291
</field>
52775292
<field name="scenarioTypes">

com.antennahouse.pdf5.ml/revision.txt

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
_______________________________________________________________________________
22

3-
Antenna House PDF5-ML Plugin Revision Notes
3+
Antenna House PDF5-ML Plug-in Revision Notes
44

55
Copyright (C) 2009-2019 Antenna House, Inc. All rights reserved.
66
Antenna House is a trademark of Antenna House, Inc.
77
_______________________________________________________________________________
88

9+
Apr. 2019
10+
V1.0.5
11+
- Change fig & table numbering algorithms.
12+
You can customize it by changing ahf:getNumberingGroupLevel in dita2fo_numberingmap.xsl.
13+
- Apply sans-serif font for table & fig title.
14+
- Fix bugs: #89, #86, #83, #78, #75, #72, #69, #58, #57, #47, #46, #33.
15+
916
Feb 2019
1017
V1.0.4
1118
- Adding "Continued" word to table title or footer in a page break by specifying outputclass attribute.(See samples/sample_table-continued)

com.antennahouse.pdf5.ml/xsl/dita2fo_bodyelements.xsl

+2-1
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,8 @@ E-mail : [email protected]
13681368
<xsl:variable name="titlePrefix" as="xs:string">
13691369
<xsl:choose>
13701370
<xsl:when test="$pAddNumberingTitlePrefix">
1371-
<xsl:variable name="titlePrefixPart" select="ahf:genLevelTitlePrefixByCount($prmTopicRef,$cFigureGroupingLevelMax)"/>
1371+
<xsl:variable name="figureGroupingLevelMax" as="xs:integer" select="ahf:getFigureNumberingGroupLevel($prmTopicRef)"/>
1372+
<xsl:variable name="titlePrefixPart" as="xs:string" select="ahf:genLevelTitlePrefixByCount($prmTopicRef,$figureGroupingLevelMax)"/>
13721373
<xsl:choose>
13731374
<xsl:when test="string($titlePrefixPart)">
13741375
<xsl:sequence select="concat($titlePrefixPart,$cTitleSeparator)"/>

com.antennahouse.pdf5.ml/xsl/dita2fo_main.xsl

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ E-mail : [email protected]
2929
<!-- Plug-in name and version -->
3030
<xsl:variable name="pluginAuthor" as="xs:string" select="'Antenna House'"/>
3131
<xsl:variable name="pluginName" as="xs:string" select="'PDF5-ML'"/>
32-
<xsl:variable name="pluginVersion" as="xs:string" select="'1.0.4'"/>
32+
<xsl:variable name="pluginVersion" as="xs:string" select="'1.0.5'"/>
3333
<xsl:message select="concat($pluginAuthor,' ',$pluginName,' plug-in Version: ',$pluginVersion)"/>
3434
<!-- XSLT processor information -->
3535
<xsl:variable name="vendor" as="xs:string" select="system-property('xsl:vendor')"/>
@@ -55,6 +55,8 @@ E-mail : [email protected]
5555
<!--xsl:call-template name="dumpThumbIndexMap"/-->
5656
<!--xsl:call-template name="dumpFootnoteMap"/-->
5757
<!--xsl:call-template name="outputEquationCountMap"/-->
58+
<!--xsl:call-template name="dumpFigureMap"/-->
59+
<!--xsl:call-template name="dumpTableMap"/-->
5860
<xsl:template match="/">
5961
<xsl:if test="$pDebugStyle">
6062
<xsl:call-template name="stlyeDump"/>

com.antennahouse.pdf5.ml/xsl/dita2fo_numberingmap.xsl

+83-36
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,10 @@ E-mail : [email protected]
1616
xmlns:ahf="http://www.antennahouse.com/names/XSLT/Functions/Document"
1717
exclude-result-prefixes="xs ahf"
1818
>
19-
<xsl:variable name="cTableGroupingLevelMax" as="xs:integer">
20-
<xsl:choose>
21-
<xsl:when test="$pAddNumberingTitlePrefix">
22-
<xsl:sequence select="xs:integer(ahf:getVarValue('Table_Grouping_Level_Max'))"/>
23-
</xsl:when>
24-
<xsl:otherwise>
25-
<!-- if user selects not to add title prefix, the table number will not be grouped. -->
26-
<xsl:sequence select="0"/>
27-
</xsl:otherwise>
28-
</xsl:choose>
29-
</xsl:variable>
30-
31-
<xsl:variable name="cFigureGroupingLevelMax" as="xs:integer">
32-
<xsl:choose>
33-
<xsl:when test="$pAddNumberingTitlePrefix">
34-
<xsl:sequence select="xs:integer(ahf:getVarValue('Figure_Grouping_Level_Max'))"/>
35-
</xsl:when>
36-
<xsl:otherwise>
37-
<!-- if user selects not to add title prefix, the figure number will not be grouped. -->
38-
<xsl:sequence select="0"/>
39-
</xsl:otherwise>
40-
</xsl:choose>
41-
</xsl:variable>
42-
43-
<xsl:variable name="cFootnoteGroupingLevelMax" as="xs:integer">
44-
<xsl:sequence select="xs:integer(ahf:getVarValue('Footnote_Grouping_Level_Max'))"/>
45-
</xsl:variable>
19+
<!-- This module defines table/fig/fn numbering map.
20+
Ususally numbering depends on bookmap hierarchy.
21+
The ahf:getNumberingGroupLevel function enables customization for many situations.
22+
-->
4623

4724
<!-- Table Numbering Map -->
4825
<xsl:variable name="tableCountMap" as="document-node()">
@@ -86,7 +63,66 @@ E-mail : [email protected]
8663
<xsl:call-template name="makeFootnoteStartCount"/>
8764
</xsl:document>
8865
</xsl:variable>
66+
67+
<!--
68+
function: Define the grouping level accoring to the map hierarchy.
69+
param: prmElem(table-count, figure-count, footnote-count)
70+
return: Grouping level
71+
note: To customize the grouping, override this function.
72+
$prmElem varies by caller:
73+
- table-count and figure-count in numbering temporary tree
74+
- topicref of map
75+
-->
8976

77+
<xsl:function name="ahf:getFigureNumberingGroupLevel" as="xs:integer">
78+
<xsl:param name="prmElem" as="element()"/>
79+
<xsl:sequence select="ahf:getNumberingGroupLevel($prmElem)"/>
80+
</xsl:function>
81+
82+
<xsl:function name="ahf:getTableNumberingGroupLevel" as="xs:integer">
83+
<xsl:param name="prmElem" as="element()"/>
84+
<xsl:sequence select="ahf:getNumberingGroupLevel($prmElem)"/>
85+
</xsl:function>
86+
87+
<xsl:function name="ahf:getFootnoteNumberingGroupLevel" as="xs:integer">
88+
<xsl:param name="prmElem" as="element()"/>
89+
<xsl:sequence select="ahf:getNumberingGroupLevel($prmElem)"/>
90+
</xsl:function>
91+
92+
<xsl:function name="ahf:getNumberingGroupLevel" as="xs:integer">
93+
<xsl:param name="prmElem" as="element()"/>
94+
<xsl:variable name="topElem" as="element()" select="if (root($prmElem)/*[1] is $root) then ($prmElem/ancestor-or-self::* except ($root|$map))[1] else $prmElem/ancestor-or-self::*[position() eq last()]"/>
95+
<xsl:choose>
96+
<xsl:when test="not($pAddNumberingTitlePrefix)">
97+
<xsl:sequence select="0"/>
98+
</xsl:when>
99+
<xsl:when test="$isMap">
100+
<xsl:sequence select="1"/>
101+
</xsl:when>
102+
<xsl:when test="$topElem[contains(@class,' bookmap/part ')]">
103+
<xsl:sequence select="2"/>
104+
</xsl:when>
105+
<xsl:when test="$topElem[contains(@class,' bookmap/chapter ')]">
106+
<xsl:sequence select="1"/>
107+
</xsl:when>
108+
<xsl:when test="$topElem[contains(@class,' bookmap/appendix ')]">
109+
<xsl:sequence select="1"/>
110+
</xsl:when>
111+
<xsl:when test="$topElem[contains(@class,' bookmap/appendices ')]">
112+
<xsl:sequence select="2"/>
113+
</xsl:when>
114+
<xsl:when test="$topElem[contains(@class,' bookmap/frontmatter ')]">
115+
<xsl:sequence select="1"/>
116+
</xsl:when>
117+
<xsl:when test="$topElem[contains(@class,' bookmap/backmatter ')]">
118+
<xsl:sequence select="1"/>
119+
</xsl:when>
120+
<xsl:otherwise>
121+
<xsl:sequence select="0"/>
122+
</xsl:otherwise>
123+
</xsl:choose>
124+
</xsl:function>
125+
90126
<!--
91127
function: make table count map template
92128
param: none
@@ -147,14 +183,15 @@ E-mail : [email protected]
147183

148184
<xsl:template match="table-count" mode="MODE_TABLE_START_COUNT" as="element()">
149185
<xsl:variable name="level" as="xs:integer" select="count(ancestor-or-self::*)"/>
150-
<xsl:variable name="countTopElem" as="element()?" select="(ancestor-or-self::*)[position() eq $cTableGroupingLevelMax]"/>
186+
<xsl:variable name="tableGroupingLevelMax" as="xs:integer" select="ahf:getTableNumberingGroupLevel(.)"/>
187+
<xsl:variable name="countTopElem" as="element()?" select="(ancestor-or-self::*)[position() eq $tableGroupingLevelMax]"/>
151188
<xsl:variable name="prevCount" as="xs:integer">
152189
<xsl:choose>
153-
<xsl:when test="$cTableGroupingLevelMax eq 0">
190+
<xsl:when test="$tableGroupingLevelMax eq 0">
154191
<!-- Table number is not grouped. -->
155192
<xsl:sequence select="xs:integer(sum(root(current())//*[. &lt;&lt; current()]/@count))"/>
156193
</xsl:when>
157-
<xsl:when test="$level le $cTableGroupingLevelMax">
194+
<xsl:when test="$level le $tableGroupingLevelMax">
158195
<!-- Table number always starts from 1. -->
159196
<xsl:sequence select="0"/>
160197
</xsl:when>
@@ -232,17 +269,22 @@ E-mail : [email protected]
232269

233270
<xsl:template match="figure-count" mode="MODE_FIGURE_START_COUNT" as="element()">
234271
<xsl:variable name="level" as="xs:integer" select="count(ancestor-or-self::*)"/>
235-
<xsl:variable name="countTopElem" as="element()?" select="(ancestor-or-self::*)[position() eq $cFigureGroupingLevelMax]"/>
272+
<xsl:variable name="figureGroupingLevelMax" as="xs:integer" select="ahf:getFigureNumberingGroupLevel(.)"/>
273+
<xsl:variable name="countTopElem" as="element()?" select="(ancestor-or-self::*)[position() eq $figureGroupingLevelMax]"/>
236274
<xsl:variable name="prevCount" as="xs:integer">
237275
<xsl:choose>
238-
<xsl:when test="$cFigureGroupingLevelMax eq 0">
276+
<xsl:when test="$figureGroupingLevelMax eq 0">
239277
<!-- Figure number is not grouped. -->
240278
<xsl:sequence select="xs:integer(sum(root(current())//*[. &lt;&lt; current()]/@count))"/>
241279
</xsl:when>
242-
<xsl:when test="$level le $cFigureGroupingLevelMax">
280+
<xsl:when test="$level le $figureGroupingLevelMax">
243281
<!-- Figure number always starts from 1. -->
244282
<xsl:sequence select="0"/>
245283
</xsl:when>
284+
<xsl:when test="$level eq 1">
285+
<!-- Top level always starts from 1. -->
286+
<xsl:sequence select="0"/>
287+
</xsl:when>
246288
<xsl:otherwise>
247289
<!-- Count figure number with grouping topicref considering $cFigureGroupingLevelMax -->
248290
<xsl:variable name="countTragetElem" as="element()*" select="root(current())//*[. &lt;&lt; current()] except root(current())//*[. &lt;&lt; $countTopElem]"/>
@@ -317,17 +359,22 @@ E-mail : [email protected]
317359

318360
<xsl:template match="footnote-count" mode="MODE_FOOTNOTE_START_COUNT" as="element()">
319361
<xsl:variable name="level" as="xs:integer" select="count(ancestor-or-self::*)"/>
320-
<xsl:variable name="countTopElem" as="element()?" select="(ancestor-or-self::*)[position() eq $cFootnoteGroupingLevelMax]"/>
362+
<xsl:variable name="footnoteGroupingLevelMax" as="xs:integer" select="ahf:getFootnoteNumberingGroupLevel(.)"/>
363+
<xsl:variable name="countTopElem" as="element()?" select="(ancestor-or-self::*)[position() eq $footnoteGroupingLevelMax]"/>
321364
<xsl:variable name="prevCount" as="xs:integer">
322365
<xsl:choose>
323-
<xsl:when test="$cFootnoteGroupingLevelMax eq 0">
366+
<xsl:when test="$footnoteGroupingLevelMax eq 0">
324367
<!-- Figure number is not grouped. -->
325368
<xsl:sequence select="xs:integer(sum(root(current())//*[. &lt;&lt; current()]/@count))"/>
326369
</xsl:when>
327-
<xsl:when test="$level le $cFootnoteGroupingLevelMax">
370+
<xsl:when test="$level le $footnoteGroupingLevelMax">
328371
<!-- Figure number always starts from 1. -->
329372
<xsl:sequence select="0"/>
330373
</xsl:when>
374+
<xsl:when test="$level eq 1">
375+
<!-- Top level always starts from 1. -->
376+
<xsl:sequence select="0"/>
377+
</xsl:when>
331378
<xsl:otherwise>
332379
<!-- Count figure number with grouping topicref considering $cFigureGroupingLevelMax -->
333380
<xsl:variable name="countTragetElem" as="element()*" select="root(current())//*[. &lt;&lt; current()] except root(current())//*[. &lt;&lt; $countTopElem]"/>

com.antennahouse.pdf5.ml/xsl/dita2fo_tableelements.xsl

+2-1
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,8 @@ E-mail : [email protected]
15171517
<xsl:variable name="titlePrefix" as="xs:string">
15181518
<xsl:choose>
15191519
<xsl:when test="$pAddNumberingTitlePrefix">
1520-
<xsl:variable name="titlePrefixPart" select="ahf:genLevelTitlePrefixByCount($prmTopicRef,$cTableGroupingLevelMax)"/>
1520+
<xsl:variable name="tableGroupingLevelMax" as="xs:integer" select="ahf:getTableNumberingGroupLevel($prmTopicRef)"/>
1521+
<xsl:variable name="titlePrefixPart" select="ahf:genLevelTitlePrefixByCount($prmTopicRef,$tableGroupingLevelMax)"/>
15211522
<xsl:choose>
15221523
<xsl:when test="string($titlePrefixPart)">
15231524
<xsl:sequence select="concat($titlePrefixPart,$cTitleSeparator)"/>

com.antennahouse.pdf5.ml/xsl/dita2fo_title.xsl

+3-3
Original file line numberDiff line numberDiff line change
@@ -935,8 +935,8 @@ E-mail : [email protected]
935935
<xsl:function name="ahf:genLevelTitlePrefixByCount" as="xs:string">
936936
<xsl:param name="prmTopicRef" as="element()"/>
937937
<xsl:param name="prmCutLimit" as="xs:integer"/>
938-
<xsl:variable name="ancestorOrSelfTopicRef" as="element()*" select="($prmTopicRef/ancestor-or-self::*[contains(@class,' map/topicref ')][not(contains(@class,' bookmap/appendices '))])[position() le $prmCutLimit]"/>
939-
<xsl:variable name="levelString" as="xs:string*" select="ahf:getSibilingTopicrefCount($ancestorOrSelfTopicRef)"/>
938+
<xsl:variable name="ancestorOrSelfTopicRef" as="element()*" select="($prmTopicRef/ancestor-or-self::*[contains(@class,' map/topicref ')])[position() le $prmCutLimit]"/>
939+
<xsl:variable name="levelString" as="xs:string*" select="ahf:getSibilingTopicrefCount($ancestorOrSelfTopicRef[not(ahf:seqContains(@class,(' bookmap/appendices ',' bookmap/frontmatter ',' bookmap/backmatter ')))])"/>
940940
<xsl:sequence select="string-join($levelString,'')"/>
941941
</xsl:function>
942942

@@ -960,7 +960,7 @@ E-mail : [email protected]
960960
<xsl:variable name="partCountFormat" as="xs:string" select="ahf:getVarValue('Part_Count_Format')"/>
961961
<xsl:number format="{$partCountFormat}" value="$partCount"/>
962962
</xsl:when>
963-
<xsl:when test="$topicRef[contains(@class, ' bookmap/chapter ')][empty(parent::*[contains(@class, ' bookmap/part ')])]">
963+
<xsl:when test="$topicRef[contains(@class, ' bookmap/chapter ')]">
964964
<xsl:variable name="chapterCount" as="xs:integer" select="count($topicRef/preceding-sibling::*[contains(@class, ' map/topicref ')][contains(@class, ' bookmap/chapter ')][ahf:isToc(.)]|$topicRef)"/>
965965
<xsl:variable name="chapterCountFormat" as="xs:string" select="ahf:getVarValue('Chapter_Count_Format')"/>
966966
<xsl:number format="{$chapterCountFormat}" value="$chapterCount"/>

0 commit comments

Comments
 (0)