metanorma-ogc 2.3.8 → 2.3.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/ogc/html/html_ogc_intro.html +0 -1
  3. data/lib/isodoc/ogc/html/word_ogc_intro.html +0 -3
  4. data/lib/isodoc/ogc/html/word_ogc_intro_wp.html +0 -3
  5. data/lib/isodoc/ogc/html_convert.rb +1 -11
  6. data/lib/isodoc/ogc/i18n-en.yaml +1 -0
  7. data/lib/isodoc/ogc/metadata.rb +10 -0
  8. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +852 -315
  9. data/lib/isodoc/ogc/ogc.best-practice.xsl +852 -315
  10. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +852 -315
  11. data/lib/isodoc/ogc/ogc.community-practice.xsl +852 -315
  12. data/lib/isodoc/ogc/ogc.community-standard.xsl +852 -315
  13. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +852 -315
  14. data/lib/isodoc/ogc/ogc.draft-standard.xsl +852 -315
  15. data/lib/isodoc/ogc/ogc.engineering-report.xsl +852 -315
  16. data/lib/isodoc/ogc/ogc.other.xsl +852 -315
  17. data/lib/isodoc/ogc/ogc.policy.xsl +852 -315
  18. data/lib/isodoc/ogc/ogc.reference-model.xsl +852 -315
  19. data/lib/isodoc/ogc/ogc.release-notes.xsl +852 -315
  20. data/lib/isodoc/ogc/ogc.standard.xsl +852 -315
  21. data/lib/isodoc/ogc/ogc.test-suite.xsl +852 -315
  22. data/lib/isodoc/ogc/ogc.user-guide.xsl +852 -315
  23. data/lib/isodoc/ogc/ogc.white-paper.xsl +814 -271
  24. data/lib/isodoc/ogc/presentation_xml_convert.rb +9 -6
  25. data/lib/isodoc/ogc/sections.rb +48 -48
  26. data/lib/isodoc/ogc/word_convert.rb +3 -0
  27. data/lib/isodoc/ogc/xref.rb +1 -1
  28. data/lib/metanorma/ogc/boilerplate.xml +1 -1
  29. data/lib/metanorma/ogc/isodoc.rng +16 -7
  30. data/lib/metanorma/ogc/ogc.rng +3 -8
  31. data/lib/metanorma/ogc/validate.rb +18 -11
  32. data/lib/metanorma/ogc/version.rb +1 -1
  33. metadata +2 -2
@@ -85,198 +85,217 @@
85
85
 
86
86
  <xsl:template match="/">
87
87
  <xsl:call-template name="namespaceCheck"/>
88
- <fo:root xml:lang="{$lang}">
89
- <xsl:variable name="root-style">
90
- <root-style xsl:use-attribute-sets="root-style"/>
91
- </xsl:variable>
92
- <xsl:call-template name="insertRootStyle">
93
- <xsl:with-param name="root-style" select="$root-style"/>
94
- </xsl:call-template>
95
- <fo:layout-master-set>
96
88
 
97
- <!-- Document pages -->
98
- <fo:simple-page-master master-name="document" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
99
- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
100
- <fo:region-before region-name="header" extent="{$marginTop}mm" precedence="true"/>
101
- <fo:region-after region-name="footer" extent="{$marginBottom}mm" precedence="true"/>
102
- <fo:region-start region-name="left" extent="{$marginLeftRight1}mm"/>
103
- <fo:region-end region-name="right" extent="{$marginLeftRight2}mm"/>
104
- </fo:simple-page-master>
89
+ <xsl:variable name="updated_xml_step1">
90
+ <xsl:apply-templates mode="update_xml_step1"/>
91
+ </xsl:variable>
105
92
 
106
- </fo:layout-master-set>
93
+ <xsl:for-each select="xalan:nodeset($updated_xml_step1)">
107
94
 
108
- <fo:declarations>
109
- <xsl:call-template name="addPDFUAmeta"/>
110
- </fo:declarations>
95
+ <fo:root xml:lang="{$lang}">
96
+ <xsl:variable name="root-style">
97
+ <root-style xsl:use-attribute-sets="root-style"/>
98
+ </xsl:variable>
99
+ <xsl:call-template name="insertRootStyle">
100
+ <xsl:with-param name="root-style" select="$root-style"/>
101
+ </xsl:call-template>
102
+ <fo:layout-master-set>
111
103
 
112
- <xsl:call-template name="addBookmarks">
113
- <xsl:with-param name="contents" select="$contents"/>
114
- </xsl:call-template>
104
+ <!-- Document pages -->
105
+ <fo:simple-page-master master-name="document" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
106
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
107
+ <fo:region-before region-name="header" extent="{$marginTop}mm" precedence="true"/>
108
+ <fo:region-after region-name="footer" extent="{$marginBottom}mm" precedence="true"/>
109
+ <fo:region-start region-name="left" extent="{$marginLeftRight1}mm"/>
110
+ <fo:region-end region-name="right" extent="{$marginLeftRight2}mm"/>
111
+ </fo:simple-page-master>
115
112
 
116
- <!-- Cover Page -->
117
- <fo:page-sequence master-reference="document" force-page-count="no-force">
118
- <xsl:call-template name="insertHeaderFooter"/>
119
- <fo:flow flow-name="xsl-region-body">
113
+ </fo:layout-master-set>
120
114
 
121
- <fo:block-container margin-left="-12mm" margin-right="-9mm">
122
- <fo:block-container margin-left="0mm" margin-right="0mm">
123
- <fo:block font-size="36pt" background-color="{$color}" color="white" margin-left="2.5mm" padding-top="1mm" padding-left="1mm" role="H1">
124
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:title/node()"/>
125
- </fo:block>
126
- </fo:block-container>
127
- </fo:block-container>
115
+ <fo:declarations>
116
+ <xsl:call-template name="addPDFUAmeta"/>
117
+ </fo:declarations>
128
118
 
129
- <!-- <fo:block font-family="Lato" font-weight="300" font-size="14pt" font-style="italic" margin-top="6pt" color="rgb(21, 43, 77)">
130
- <xsl:text>Additional context, inspirational quote, etc. fits into this subheading area</xsl:text>
131
- </fo:block> -->
119
+ <xsl:call-template name="addBookmarks">
120
+ <xsl:with-param name="contents" select="$contents"/>
121
+ </xsl:call-template>
132
122
 
133
- <fo:block text-align="right" font-size="10pt" margin-top="12pt" margin-bottom="24pt">
134
- <fo:block margin-top="6pt">Submission Date: <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:date[@type = 'received']/ogc:on"/></fo:block>
135
- <fo:block margin-top="6pt">Approval Date: <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:date[@type = 'issued']/ogc:on"/></fo:block>
136
- <fo:block margin-top="6pt">Publication Date: <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:date[@type = 'published']/ogc:on"/></fo:block>
137
- <fo:block margin-top="6pt">External identifier of this OGC® document: <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:docidentifier[@type = 'ogc-external']"/></fo:block>
138
- <fo:block margin-top="6pt">Internal reference number of this OGC® document: <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:docnumber"/></fo:block>
123
+ <!-- Cover Page -->
124
+ <fo:page-sequence master-reference="document" force-page-count="no-force">
125
+ <xsl:call-template name="insertHeaderFooter"/>
126
+ <fo:flow flow-name="xsl-region-body">
139
127
 
140
- <xsl:variable name="url" select="/ogc:ogc-standard/ogc:bibdata/ogc:uri"/>
141
- <xsl:if test="normalize-space($url) != ''">
142
- <fo:block margin-top="6pt">URL for this OGC® document: <xsl:value-of select="$url"/></fo:block>
143
- </xsl:if>
128
+ <fo:block-container margin-left="-12mm" margin-right="-9mm">
129
+ <fo:block-container margin-left="0mm" margin-right="0mm">
130
+ <fo:block font-size="36pt" background-color="{$color}" color="white" margin-left="2.5mm" padding-top="1mm" padding-left="1mm" role="H1">
131
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:title/node()"/>
132
+ </fo:block>
133
+ </fo:block-container>
134
+ </fo:block-container>
144
135
 
145
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:edition[normalize-space(@language) = '']"/>
136
+ <!-- <fo:block font-family="Lato" font-weight="300" font-size="14pt" font-style="italic" margin-top="6pt" color="rgb(21, 43, 77)">
137
+ <xsl:text>Additional context, inspirational quote, etc. fits into this subheading area</xsl:text>
138
+ </fo:block> -->
146
139
 
147
- <fo:block margin-top="6pt"><xsl:text>Category: </xsl:text>
148
- <xsl:call-template name="capitalizeWords">
149
- <xsl:with-param name="str" select="/ogc:ogc-standard/ogc:bibdata/ogc:ext/ogc:doctype"/>
150
- </xsl:call-template>
151
- </fo:block>
140
+ <fo:block text-align="right" font-size="10pt" margin-top="12pt" margin-bottom="24pt">
141
+ <fo:block margin-top="6pt">Submission Date: <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:date[@type = 'received']/ogc:on"/></fo:block>
142
+ <fo:block margin-top="6pt">Approval Date: <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:date[@type = 'issued']/ogc:on"/></fo:block>
143
+ <fo:block margin-top="6pt">Publication Date: <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:date[@type = 'published']/ogc:on"/></fo:block>
144
+ <fo:block margin-top="6pt">External identifier of this OGC® document: <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:docidentifier[@type = 'ogc-external']"/></fo:block>
145
+ <fo:block margin-top="6pt">Internal reference number of this OGC® document: <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:docnumber"/></fo:block>
152
146
 
153
- <xsl:variable name="editors">
154
- <xsl:for-each select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='editor']/ogc:person/ogc:name/ogc:completename">
155
- <xsl:value-of select="."/>
156
- <xsl:if test="position() != last()">, </xsl:if>
157
- </xsl:for-each>
158
- </xsl:variable>
159
- <xsl:if test="normalize-space($editors) != ''">
160
- <fo:block margin-top="6pt">Editor: <xsl:value-of select="$editors"/></fo:block>
161
- </xsl:if>
162
- </fo:block>
147
+ <xsl:variable name="url" select="/ogc:ogc-standard/ogc:bibdata/ogc:uri"/>
148
+ <xsl:if test="normalize-space($url) != ''">
149
+ <fo:block margin-top="6pt">URL for this OGC® document: <xsl:value-of select="$url"/></fo:block>
150
+ </xsl:if>
163
151
 
164
- <!-- absolute-position="fixed" left="20mm" top="91mm" width="175mm" -->
165
- <fo:block-container font-size="9pt" margin-left="-5mm" margin-right="-5mm">
166
- <fo:block-container margin-left="0mm" margin-right="0mm">
167
- <fo:block margin-top="8pt">
168
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:copyright-statement"/>
169
- </fo:block>
170
- <fo:block margin-top="8pt"> </fo:block>
171
- <fo:block margin-top="8pt">
172
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:legal-statement"/>
152
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:edition[normalize-space(@language) = '']"/>
153
+
154
+ <fo:block margin-top="6pt"><xsl:text>Category: </xsl:text>
155
+ <xsl:call-template name="capitalizeWords">
156
+ <xsl:with-param name="str" select="/ogc:ogc-standard/ogc:bibdata/ogc:ext/ogc:doctype"/>
157
+ </xsl:call-template>
173
158
  </fo:block>
174
- </fo:block-container>
175
- </fo:block-container>
176
159
 
177
- <xsl:call-template name="insertLogo"/>
160
+ <xsl:variable name="editors">
161
+ <xsl:for-each select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='editor']/ogc:person/ogc:name/ogc:completename">
162
+ <xsl:value-of select="."/>
163
+ <xsl:if test="position() != last()">, </xsl:if>
164
+ </xsl:for-each>
165
+ </xsl:variable>
166
+ <xsl:if test="normalize-space($editors) != ''">
167
+ <fo:block margin-top="6pt">Editor: <xsl:value-of select="$editors"/></fo:block>
168
+ </xsl:if>
169
+ </fo:block>
178
170
 
179
- </fo:flow>
180
- </fo:page-sequence>
181
- <!-- End Cover Page -->
171
+ <!-- absolute-position="fixed" left="20mm" top="91mm" width="175mm" -->
172
+ <fo:block-container font-size="9pt" margin-left="-5mm" margin-right="-5mm">
173
+ <fo:block-container margin-left="0mm" margin-right="0mm">
174
+ <fo:block margin-top="8pt">
175
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:copyright-statement"/>
176
+ </fo:block>
177
+ <fo:block margin-top="8pt"> </fo:block>
178
+ <fo:block margin-top="8pt">
179
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:legal-statement"/>
180
+ </fo:block>
181
+ </fo:block-container>
182
+ </fo:block-container>
182
183
 
183
- <!-- Copyright, Content, Foreword, etc. pages -->
184
- <fo:page-sequence master-reference="document" force-page-count="no-force"> <!-- -->
184
+ <xsl:call-template name="insertLogo"/>
185
185
 
186
- <xsl:call-template name="insertHeaderFooter"/>
187
- <fo:flow flow-name="xsl-region-body">
186
+ </fo:flow>
187
+ </fo:page-sequence>
188
+ <!-- End Cover Page -->
188
189
 
189
- <xsl:if test="$debug = 'true'">
190
- <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
191
- DEBUG
192
- contents=<!-- <xsl:copy-of select="xalan:nodeset($contents)"/> -->
193
- <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
194
- </xsl:if>
190
+ <!-- Copyright, Content, Foreword, etc. pages -->
191
+ <fo:page-sequence master-reference="document" force-page-count="no-force"> <!-- -->
195
192
 
196
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:license-statement"/>
197
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:feedback-statement"/>
193
+ <xsl:call-template name="insertHeaderFooter"/>
194
+ <fo:flow flow-name="xsl-region-body">
198
195
 
199
- <fo:block break-after="page"/>
196
+ <xsl:if test="$debug = 'true'">
197
+ <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
198
+ DEBUG
199
+ contents=<!-- <xsl:copy-of select="xalan:nodeset($contents)"/> -->
200
+ <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
201
+ </xsl:if>
200
202
 
201
- <fo:block-container line-height="1.08" font-family="Lato">
202
- <fo:block role="TOC">
203
- <fo:block xsl:use-attribute-sets="title-toc-style" role="H1">
204
- <xsl:call-template name="getTitle">
205
- <xsl:with-param name="name" select="'title-toc'"/>
206
- </xsl:call-template>
207
- </fo:block>
208
- <xsl:variable name="margin-left">3.9</xsl:variable>
209
- <xsl:for-each select="$contents//item[@display = 'true']">
210
- <fo:block margin-top="8pt" margin-bottom="5pt" margin-left="{(@level - 1) * $margin-left}mm" text-align-last="justify" role="TOCI">
211
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
212
- <xsl:if test="@section != ''">
213
- <xsl:value-of select="@section"/><xsl:text> </xsl:text>
214
- </xsl:if>
215
- <xsl:apply-templates select="title"/>
216
- <fo:inline keep-together.within-line="always">
217
- <fo:leader leader-pattern="dots"/>
218
- <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
219
- </fo:inline>
220
- </fo:basic-link>
221
- </fo:block>
222
- </xsl:for-each>
203
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:license-statement"/>
204
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:feedback-statement"/>
223
205
 
224
- <xsl:if test="//ogc:figure[@id and ogc:name] or //ogc:table[@id and ogc:name]">
225
- <fo:block font-size="11pt" margin-top="8pt"> </fo:block>
226
- <fo:block font-size="11pt" margin-top="8pt"> </fo:block>
227
- <fo:block xsl:use-attribute-sets="title-toc-style">
228
- <!-- <xsl:text>Table of Figures</xsl:text> -->
229
- <xsl:call-template name="getTitle">
230
- <xsl:with-param name="name" select="'title-table-figures'"/>
231
- </xsl:call-template>
232
- </fo:block>
233
- <xsl:for-each select="//ogc:figure[@id and ogc:name] | //ogc:table[@id and ogc:name]">
234
- <fo:block margin-top="8pt" margin-bottom="5pt" text-align-last="justify" role="TOCI">
235
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}">
236
- <xsl:apply-templates select="ogc:name" mode="contents"/>
237
- <fo:inline keep-together.within-line="always">
238
- <fo:leader leader-pattern="dots"/>
239
- <fo:page-number-citation ref-id="{@id}"/>
240
- </fo:inline>
241
- </fo:basic-link>
242
- </fo:block>
243
- </xsl:for-each>
206
+ <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters -->
207
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
208
+ <xsl:sort select="@displayorder" data-type="number"/>
209
+
210
+ <xsl:if test="local-name() = 'abstract' or local-name() = 'foreword' or local-name() = 'introduction' or (local-name() = 'clause' and @type = 'toc')">
211
+ <fo:block break-after="page"/>
244
212
  </xsl:if>
245
- </fo:block>
246
- </fo:block-container>
247
213
 
248
- <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters -->
249
- <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
250
- <xsl:sort select="@displayorder" data-type="number"/>
214
+ <xsl:apply-templates select="."/>
215
+ </xsl:for-each>
251
216
 
252
- <xsl:if test="local-name() = 'abstract' or local-name() = 'foreword' or local-name() = 'introduction'">
253
- <fo:block break-after="page"/>
254
- </xsl:if>
217
+ </fo:flow>
218
+ </fo:page-sequence>
255
219
 
256
- <xsl:apply-templates select="."/>
257
- </xsl:for-each>
220
+ <!-- Document Pages -->
221
+ <fo:page-sequence master-reference="document" initial-page-number="1" format="1" force-page-count="no-force">
258
222
 
259
- </fo:flow>
260
- </fo:page-sequence>
223
+ <xsl:call-template name="insertHeaderFooter"/>
261
224
 
262
- <!-- Document Pages -->
263
- <fo:page-sequence master-reference="document" initial-page-number="1" format="1" force-page-count="no-force">
225
+ <fo:flow flow-name="xsl-region-body">
264
226
 
265
- <xsl:call-template name="insertHeaderFooter"/>
227
+ <fo:block line-height="125%">
266
228
 
267
- <fo:flow flow-name="xsl-region-body">
229
+ <xsl:call-template name="processMainSectionsDefault"/>
268
230
 
269
- <fo:block line-height="125%">
231
+ </fo:block>
232
+ </fo:flow>
233
+ </fo:page-sequence>
270
234
 
271
- <xsl:call-template name="processMainSectionsDefault"/>
235
+ <!-- End Document Pages -->
272
236
 
273
- </fo:block>
274
- </fo:flow>
275
- </fo:page-sequence>
237
+ </fo:root>
238
+
239
+ </xsl:for-each>
240
+ </xsl:template>
276
241
 
277
- <!-- End Document Pages -->
242
+ <xsl:template match="ogc:preface/ogc:clause[@type = 'toc']" priority="4">
243
+ <fo:block-container line-height="1.08" font-family="Lato">
244
+ <fo:block role="TOC">
245
+
246
+ <xsl:apply-templates/>
247
+
248
+ <xsl:if test="count(*) = 1 and *[local-name() = 'title']"> <!-- if there isn't user ToC -->
249
+
250
+ <xsl:variable name="margin-left">3.9</xsl:variable>
251
+ <xsl:for-each select="$contents//item[@display = 'true']">
252
+ <fo:block margin-top="8pt" margin-bottom="5pt" margin-left="{(@level - 1) * $margin-left}mm" text-align-last="justify" role="TOCI">
253
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
254
+ <xsl:if test="@section != ''">
255
+ <xsl:value-of select="@section"/><xsl:text> </xsl:text>
256
+ </xsl:if>
257
+ <xsl:apply-templates select="title"/>
258
+ <fo:inline keep-together.within-line="always">
259
+ <fo:leader leader-pattern="dots"/>
260
+ <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
261
+ </fo:inline>
262
+ </fo:basic-link>
263
+ </fo:block>
264
+ </xsl:for-each>
278
265
 
279
- </fo:root>
266
+ <xsl:if test="//ogc:figure[@id and ogc:name] or //ogc:table[@id and ogc:name]">
267
+ <fo:block font-size="11pt" margin-top="8pt"> </fo:block>
268
+ <fo:block font-size="11pt" margin-top="8pt"> </fo:block>
269
+ <fo:block xsl:use-attribute-sets="title-toc-style">
270
+ <!-- <xsl:text>Table of Figures</xsl:text> -->
271
+ <xsl:call-template name="getTitle">
272
+ <xsl:with-param name="name" select="'title-table-figures'"/>
273
+ </xsl:call-template>
274
+ </fo:block>
275
+ <xsl:for-each select="//ogc:figure[@id and ogc:name] | //ogc:table[@id and ogc:name]">
276
+ <fo:block margin-top="8pt" margin-bottom="5pt" text-align-last="justify" role="TOCI">
277
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}">
278
+ <xsl:apply-templates select="ogc:name" mode="contents"/>
279
+ <fo:inline keep-together.within-line="always">
280
+ <fo:leader leader-pattern="dots"/>
281
+ <fo:page-number-citation ref-id="{@id}"/>
282
+ </fo:inline>
283
+ </fo:basic-link>
284
+ </fo:block>
285
+ </xsl:for-each>
286
+ </xsl:if>
287
+ </xsl:if>
288
+ </fo:block>
289
+ </fo:block-container>
290
+ </xsl:template>
291
+
292
+ <xsl:template match="ogc:preface/ogc:clause[@type = 'toc']/ogc:title" priority="3">
293
+ <fo:block xsl:use-attribute-sets="title-toc-style" role="H1">
294
+ <!-- <xsl:call-template name="getTitle">
295
+ <xsl:with-param name="name" select="'title-toc'"/>
296
+ </xsl:call-template> -->
297
+ <xsl:apply-templates/>
298
+ </fo:block>
280
299
  </xsl:template>
281
300
 
282
301
  <!-- Lato font doesn't contain 'thin space' glyph -->
@@ -320,6 +339,7 @@
320
339
 
321
340
  <xsl:variable name="skip">
322
341
  <xsl:choose>
342
+ <xsl:when test="@type = 'toc'">true</xsl:when>
323
343
  <xsl:when test="ancestor-or-self::ogc:bibitem">true</xsl:when>
324
344
  <xsl:when test="ancestor-or-self::ogc:term">true</xsl:when>
325
345
  <xsl:otherwise>false</xsl:otherwise>
@@ -1046,6 +1066,10 @@
1046
1066
 
1047
1067
  </xsl:attribute-set>
1048
1068
 
1069
+ <xsl:template name="refine_link-style">
1070
+
1071
+ </xsl:template> <!-- refine_link-style -->
1072
+
1049
1073
  <xsl:attribute-set name="sourcecode-container-style">
1050
1074
 
1051
1075
  </xsl:attribute-set>
@@ -1062,6 +1086,10 @@
1062
1086
 
1063
1087
  </xsl:attribute-set>
1064
1088
 
1089
+ <xsl:template name="refine_sourcecode-style">
1090
+
1091
+ </xsl:template> <!-- refine_sourcecode-style -->
1092
+
1065
1093
  <xsl:attribute-set name="pre-style">
1066
1094
  <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
1067
1095
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -1184,6 +1212,10 @@
1184
1212
 
1185
1213
  </xsl:attribute-set> <!-- example-style -->
1186
1214
 
1215
+ <xsl:template name="refine_example-style">
1216
+
1217
+ </xsl:template> <!-- refine_example-style -->
1218
+
1187
1219
  <xsl:attribute-set name="example-body-style">
1188
1220
 
1189
1221
  </xsl:attribute-set> <!-- example-body-style -->
@@ -1204,6 +1236,10 @@
1204
1236
 
1205
1237
  </xsl:attribute-set> <!-- example-p-style -->
1206
1238
 
1239
+ <xsl:template name="refine_example-p-style">
1240
+
1241
+ </xsl:template> <!-- refine_example-p-style -->
1242
+
1207
1243
  <xsl:attribute-set name="termexample-name-style">
1208
1244
 
1209
1245
  <xsl:attribute name="padding-right">10mm</xsl:attribute>
@@ -1232,12 +1268,25 @@
1232
1268
 
1233
1269
  </xsl:attribute-set> <!-- table-container-style -->
1234
1270
 
1271
+ <xsl:template name="refine_table-container-style">
1272
+ <xsl:param name="margin-side"/>
1273
+
1274
+ <!-- end table block-container attributes -->
1275
+ </xsl:template> <!-- refine_table-container-style -->
1276
+
1235
1277
  <xsl:attribute-set name="table-style">
1236
1278
  <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
1237
1279
  <xsl:attribute name="table-layout">fixed</xsl:attribute>
1238
1280
 
1239
1281
  </xsl:attribute-set><!-- table-style -->
1240
1282
 
1283
+ <xsl:template name="refine_table-style">
1284
+ <xsl:param name="margin-side"/>
1285
+
1286
+ <xsl:call-template name="setBordersTableArray"/>
1287
+
1288
+ </xsl:template> <!-- refine_table-style -->
1289
+
1241
1290
  <xsl:attribute-set name="table-name-style">
1242
1291
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1243
1292
 
@@ -1252,6 +1301,11 @@
1252
1301
 
1253
1302
  </xsl:attribute-set> <!-- table-name-style -->
1254
1303
 
1304
+ <xsl:template name="refine_table-name-style">
1305
+ <xsl:param name="continued"/>
1306
+
1307
+ </xsl:template> <!-- refine_table-name-style -->
1308
+
1255
1309
  <xsl:attribute-set name="table-row-style">
1256
1310
  <xsl:attribute name="min-height">4mm</xsl:attribute>
1257
1311
 
@@ -1262,14 +1316,30 @@
1262
1316
 
1263
1317
  </xsl:attribute-set>
1264
1318
 
1319
+ <xsl:template name="refine_table-header-row-style">
1320
+
1321
+ <xsl:call-template name="setBordersTableArray"/>
1322
+
1323
+ </xsl:template> <!-- refine_table-header-row-style -->
1324
+
1265
1325
  <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
1266
1326
 
1267
1327
  </xsl:attribute-set>
1268
1328
 
1329
+ <xsl:template name="refine_table-footer-row-style">
1330
+
1331
+ </xsl:template> <!-- refine_table-footer-row-style -->
1332
+
1269
1333
  <xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
1270
1334
 
1271
1335
  </xsl:attribute-set>
1272
1336
 
1337
+ <xsl:template name="refine_table-body-row-style">
1338
+
1339
+ <xsl:call-template name="setBordersTableArray"/>
1340
+
1341
+ </xsl:template> <!-- refine_table-body-row-style -->
1342
+
1273
1343
  <xsl:attribute-set name="table-header-cell-style">
1274
1344
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1275
1345
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -1284,6 +1354,18 @@
1284
1354
 
1285
1355
  </xsl:attribute-set> <!-- table-header-cell-style -->
1286
1356
 
1357
+ <xsl:template name="refine_table-header-cell-style">
1358
+
1359
+ <xsl:call-template name="setBordersTableArray"/>
1360
+
1361
+ <xsl:if test="$lang = 'ar'">
1362
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1363
+ </xsl:if>
1364
+
1365
+ <xsl:call-template name="setTableCellAttributes"/>
1366
+
1367
+ </xsl:template> <!-- refine_table-header-cell-style -->
1368
+
1287
1369
  <xsl:attribute-set name="table-cell-style">
1288
1370
  <xsl:attribute name="display-align">center</xsl:attribute>
1289
1371
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -1295,6 +1377,18 @@
1295
1377
 
1296
1378
  </xsl:attribute-set> <!-- table-cell-style -->
1297
1379
 
1380
+ <xsl:template name="refine_table-cell-style">
1381
+
1382
+ <xsl:if test="$lang = 'ar'">
1383
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1384
+ </xsl:if>
1385
+
1386
+ <!-- bsi -->
1387
+
1388
+ <xsl:call-template name="setBordersTableArray"/>
1389
+
1390
+ </xsl:template> <!-- refine_table-cell-style -->
1391
+
1298
1392
  <xsl:attribute-set name="table-footer-cell-style">
1299
1393
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1300
1394
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -1303,12 +1397,20 @@
1303
1397
 
1304
1398
  </xsl:attribute-set> <!-- table-footer-cell-style -->
1305
1399
 
1400
+ <xsl:template name="refine_table-footer-cell-style">
1401
+
1402
+ </xsl:template> <!-- refine_table-footer-cell-style -->
1403
+
1306
1404
  <xsl:attribute-set name="table-note-style">
1307
1405
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1308
1406
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1309
1407
 
1310
1408
  </xsl:attribute-set><!-- table-note-style -->
1311
1409
 
1410
+ <xsl:template name="refine_table-note-style">
1411
+
1412
+ </xsl:template> <!-- refine_table-note-style -->
1413
+
1312
1414
  <xsl:attribute-set name="table-fn-style">
1313
1415
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1314
1416
 
@@ -1364,6 +1466,10 @@
1364
1466
 
1365
1467
  </xsl:attribute-set>
1366
1468
 
1469
+ <xsl:template name="refine_dt-cell-style">
1470
+
1471
+ </xsl:template> <!-- refine_dt-cell-style -->
1472
+
1367
1473
  <xsl:attribute-set name="dt-block-style">
1368
1474
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
1369
1475
 
@@ -1371,6 +1477,10 @@
1371
1477
 
1372
1478
  </xsl:attribute-set>
1373
1479
 
1480
+ <xsl:template name="refine_dt-block-style">
1481
+
1482
+ </xsl:template> <!-- refine_dt-block-style -->
1483
+
1374
1484
  <xsl:attribute-set name="dl-name-style">
1375
1485
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1376
1486
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -1385,6 +1495,10 @@
1385
1495
 
1386
1496
  </xsl:attribute-set>
1387
1497
 
1498
+ <xsl:template name="refine_dd-cell-style">
1499
+
1500
+ </xsl:template> <!-- refine_dd-cell-style -->
1501
+
1388
1502
  <!-- ========================== -->
1389
1503
  <!-- END Definition's list styles -->
1390
1504
  <!-- ========================== -->
@@ -1420,6 +1534,12 @@
1420
1534
 
1421
1535
  </xsl:attribute-set>
1422
1536
 
1537
+ <xsl:template name="refine_eref-style">
1538
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
1539
+ <xsl:variable name="text" select="normalize-space()"/>
1540
+
1541
+ </xsl:template> <!-- refine_eref-style -->
1542
+
1423
1543
  <xsl:attribute-set name="note-style">
1424
1544
 
1425
1545
  <xsl:attribute name="font-size">10pt</xsl:attribute>
@@ -1429,6 +1549,14 @@
1429
1549
 
1430
1550
  </xsl:attribute-set>
1431
1551
 
1552
+ <xsl:template name="refine_note-style">
1553
+
1554
+ <xsl:if test="ancestor::ogc:ul or ancestor::ogc:ol and not(ancestor::ogc:note[1]/following-sibling::*)">
1555
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
1556
+ </xsl:if>
1557
+
1558
+ </xsl:template>
1559
+
1432
1560
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
1433
1561
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
1434
1562
 
@@ -1438,11 +1566,19 @@
1438
1566
 
1439
1567
  </xsl:attribute-set>
1440
1568
 
1569
+ <xsl:template name="refine_note-name-style">
1570
+
1571
+ </xsl:template> <!-- refine_note-name-style -->
1572
+
1441
1573
  <xsl:attribute-set name="table-note-name-style">
1442
1574
  <xsl:attribute name="padding-right">2mm</xsl:attribute>
1443
1575
 
1444
1576
  </xsl:attribute-set>
1445
1577
 
1578
+ <xsl:template name="refine_table-note-name-style">
1579
+
1580
+ </xsl:template> <!-- refine_table-note-name-style -->
1581
+
1446
1582
  <xsl:attribute-set name="note-p-style">
1447
1583
 
1448
1584
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1457,10 +1593,18 @@
1457
1593
 
1458
1594
  </xsl:attribute-set>
1459
1595
 
1596
+ <xsl:template name="refine_termnote-style">
1597
+
1598
+ </xsl:template> <!-- refine_termnote-style -->
1599
+
1460
1600
  <xsl:attribute-set name="termnote-name-style">
1461
1601
 
1462
1602
  </xsl:attribute-set>
1463
1603
 
1604
+ <xsl:template name="refine_termnote-name-style">
1605
+
1606
+ </xsl:template>
1607
+
1464
1608
  <xsl:attribute-set name="termnote-p-style">
1465
1609
 
1466
1610
  <xsl:attribute name="space-before">4pt</xsl:attribute>
@@ -1476,6 +1620,10 @@
1476
1620
 
1477
1621
  </xsl:attribute-set>
1478
1622
 
1623
+ <xsl:template name="refine_quote-style">
1624
+
1625
+ </xsl:template>
1626
+
1479
1627
  <xsl:attribute-set name="quote-source-style">
1480
1628
  <xsl:attribute name="text-align">right</xsl:attribute>
1481
1629
 
@@ -1490,6 +1638,10 @@
1490
1638
 
1491
1639
  </xsl:attribute-set>
1492
1640
 
1641
+ <xsl:template name="refine_termsource-style">
1642
+
1643
+ </xsl:template> <!-- refine_termsource-style -->
1644
+
1493
1645
  <xsl:attribute-set name="termsource-text-style">
1494
1646
 
1495
1647
  </xsl:attribute-set>
@@ -1534,6 +1686,10 @@
1534
1686
 
1535
1687
  </xsl:attribute-set>
1536
1688
 
1689
+ <xsl:template name="refine_figure-name-style">
1690
+
1691
+ </xsl:template> <!-- refine_figure-name-style -->
1692
+
1537
1693
  <xsl:attribute-set name="figure-source-style">
1538
1694
 
1539
1695
  </xsl:attribute-set>
@@ -1553,6 +1709,10 @@
1553
1709
 
1554
1710
  </xsl:attribute-set> <!-- formula-stem-block-style -->
1555
1711
 
1712
+ <xsl:template name="refine_formula-stem-block-style">
1713
+
1714
+ </xsl:template> <!-- refine_formula-stem-block-style -->
1715
+
1556
1716
  <xsl:attribute-set name="formula-stem-number-style">
1557
1717
  <xsl:attribute name="text-align">right</xsl:attribute>
1558
1718
 
@@ -1567,6 +1727,10 @@
1567
1727
 
1568
1728
  </xsl:attribute-set>
1569
1729
 
1730
+ <xsl:template name="refine_image-style">
1731
+
1732
+ </xsl:template>
1733
+
1570
1734
  <xsl:attribute-set name="figure-pseudocode-p-style">
1571
1735
 
1572
1736
  </xsl:attribute-set>
@@ -1661,6 +1825,10 @@
1661
1825
 
1662
1826
  </xsl:attribute-set>
1663
1827
 
1828
+ <xsl:template name="refine_mathml-style">
1829
+
1830
+ </xsl:template>
1831
+
1664
1832
  <xsl:attribute-set name="list-style">
1665
1833
 
1666
1834
  <xsl:attribute name="provisional-distance-between-starts">6.5mm</xsl:attribute>
@@ -1669,6 +1837,10 @@
1669
1837
 
1670
1838
  </xsl:attribute-set> <!-- list-style -->
1671
1839
 
1840
+ <xsl:template name="refine_list-style">
1841
+
1842
+ </xsl:template> <!-- refine_list-style -->
1843
+
1672
1844
  <xsl:attribute-set name="list-name-style">
1673
1845
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1674
1846
 
@@ -1681,16 +1853,28 @@
1681
1853
 
1682
1854
  </xsl:attribute-set>
1683
1855
 
1856
+ <xsl:template name="refine_list-item-style">
1857
+
1858
+ </xsl:template> <!-- refine_list-item-style -->
1859
+
1684
1860
  <xsl:attribute-set name="list-item-label-style">
1685
1861
 
1686
1862
  </xsl:attribute-set>
1687
1863
 
1864
+ <xsl:template name="refine_list-item-label-style">
1865
+
1866
+ </xsl:template> <!-- refine_list-item-label-style -->
1867
+
1688
1868
  <xsl:attribute-set name="list-item-body-style">
1689
1869
 
1690
1870
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
1691
1871
 
1692
1872
  </xsl:attribute-set>
1693
1873
 
1874
+ <xsl:template name="refine_list-item-body-style">
1875
+
1876
+ </xsl:template> <!-- refine_list-item-body-style -->
1877
+
1694
1878
  <xsl:attribute-set name="toc-style">
1695
1879
  <xsl:attribute name="line-height">135%</xsl:attribute>
1696
1880
  </xsl:attribute-set>
@@ -1705,6 +1889,10 @@
1705
1889
 
1706
1890
  </xsl:attribute-set>
1707
1891
 
1892
+ <xsl:template name="refine_fn-reference-style">
1893
+
1894
+ </xsl:template> <!-- refine_fn-reference-style -->
1895
+
1708
1896
  <xsl:attribute-set name="fn-style">
1709
1897
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1710
1898
  </xsl:attribute-set>
@@ -1730,6 +1918,10 @@
1730
1918
 
1731
1919
  </xsl:attribute-set>
1732
1920
 
1921
+ <xsl:template name="refine_fn-body-style">
1922
+
1923
+ </xsl:template> <!-- refine_fn-body-style -->
1924
+
1733
1925
  <xsl:attribute-set name="fn-body-num-style">
1734
1926
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
1735
1927
 
@@ -1738,6 +1930,10 @@
1738
1930
 
1739
1931
  </xsl:attribute-set> <!-- fn-body-num-style -->
1740
1932
 
1933
+ <xsl:template name="refine_fn-body-num-style">
1934
+
1935
+ </xsl:template> <!-- refine_fn-body-num-style -->
1936
+
1741
1937
  <!-- admonition -->
1742
1938
  <xsl:attribute-set name="admonition-style">
1743
1939
 
@@ -2423,7 +2619,9 @@
2423
2619
 
2424
2620
  <fo:block-container xsl:use-attribute-sets="table-container-style">
2425
2621
 
2426
- <!-- end table block-container attributes -->
2622
+ <xsl:call-template name="refine_table-container-style">
2623
+ <xsl:with-param name="margin-side" select="$margin-side"/>
2624
+ </xsl:call-template>
2427
2625
 
2428
2626
  <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
2429
2627
 
@@ -2450,7 +2648,9 @@
2450
2648
 
2451
2649
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
2452
2650
 
2453
- <xsl:call-template name="setBordersTableArray"/>
2651
+ <xsl:call-template name="refine_table-style">
2652
+ <xsl:with-param name="margin-side" select="$margin-side"/>
2653
+ </xsl:call-template>
2454
2654
 
2455
2655
  </xsl:element>
2456
2656
  </xsl:variable>
@@ -2516,7 +2716,7 @@
2516
2716
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2517
2717
  </xsl:when>
2518
2718
  <xsl:otherwise>
2519
- <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
2719
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'p') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
2520
2720
  </xsl:otherwise>
2521
2721
  </xsl:choose>
2522
2722
 
@@ -2605,6 +2805,10 @@
2605
2805
 
2606
2806
  <fo:block xsl:use-attribute-sets="table-name-style">
2607
2807
 
2808
+ <xsl:call-template name="refine_table-name-style">
2809
+ <xsl:with-param name="continued" select="$continued"/>
2810
+ </xsl:call-template>
2811
+
2608
2812
  <xsl:choose>
2609
2813
  <xsl:when test="$continued = 'true'">
2610
2814
 
@@ -2987,6 +3191,8 @@
2987
3191
  <fo:table-row>
2988
3192
  <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
2989
3193
 
3194
+ <xsl:call-template name="refine_table-header-title-style"/>
3195
+
2990
3196
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
2991
3197
  <xsl:with-param name="continued">true</xsl:with-param>
2992
3198
  </xsl:apply-templates>
@@ -2999,6 +3205,10 @@
2999
3205
  </fo:table-row>
3000
3206
  </xsl:template> <!-- table-header-title -->
3001
3207
 
3208
+ <xsl:template name="refine_table-header-title-style">
3209
+
3210
+ </xsl:template> <!-- refine_table-header-title-style -->
3211
+
3002
3212
  <xsl:template match="*[local-name()='thead']" mode="process_tbody">
3003
3213
  <fo:table-body>
3004
3214
  <xsl:apply-templates/>
@@ -3023,7 +3233,7 @@
3023
3233
  <xsl:param name="colwidths"/>
3024
3234
  <xsl:param name="colgroup"/>
3025
3235
 
3026
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source']"/>
3236
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
3027
3237
 
3028
3238
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3029
3239
 
@@ -3083,6 +3293,8 @@
3083
3293
  <fo:table-row>
3084
3294
  <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
3085
3295
 
3296
+ <xsl:call-template name="refine_table-footer-cell-style"/>
3297
+
3086
3298
  <xsl:call-template name="setBordersTableArray"/>
3087
3299
 
3088
3300
  <!-- fn will be processed inside 'note' processing -->
@@ -3091,6 +3303,7 @@
3091
3303
 
3092
3304
  <!-- except gb and bsi -->
3093
3305
 
3306
+ <xsl:apply-templates select="../*[local-name()='p']"/>
3094
3307
  <xsl:apply-templates select="../*[local-name()='dl']"/>
3095
3308
  <xsl:apply-templates select="../*[local-name()='note']"/>
3096
3309
  <xsl:apply-templates select="../*[local-name()='source']"/>
@@ -3222,7 +3435,7 @@
3222
3435
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
3223
3436
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
3224
3437
 
3225
- <xsl:call-template name="setBordersTableArray"/>
3438
+ <xsl:call-template name="refine_table-header-row-style"/>
3226
3439
 
3227
3440
  <xsl:call-template name="setTableRowAttributes"/>
3228
3441
 
@@ -3256,6 +3469,8 @@
3256
3469
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
3257
3470
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
3258
3471
 
3472
+ <xsl:call-template name="refine_table-footer-row-style"/>
3473
+
3259
3474
  <xsl:call-template name="setTableRowAttributes"/>
3260
3475
  <xsl:apply-templates/>
3261
3476
  </fo:table-row>
@@ -3269,9 +3484,10 @@
3269
3484
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3270
3485
  </xsl:if>
3271
3486
 
3272
- <xsl:call-template name="setBordersTableArray"/>
3487
+ <xsl:call-template name="refine_table-body-row-style"/>
3273
3488
 
3274
3489
  <xsl:call-template name="setTableRowAttributes"/>
3490
+
3275
3491
  <xsl:apply-templates/>
3276
3492
  </fo:table-row>
3277
3493
  </xsl:template>
@@ -3290,13 +3506,7 @@
3290
3506
  <xsl:with-param name="default">center</xsl:with-param>
3291
3507
  </xsl:call-template>
3292
3508
 
3293
- <xsl:call-template name="setBordersTableArray"/>
3294
-
3295
- <xsl:if test="$lang = 'ar'">
3296
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
3297
- </xsl:if>
3298
-
3299
- <xsl:call-template name="setTableCellAttributes"/>
3509
+ <xsl:call-template name="refine_table-header-cell-style"/>
3300
3510
 
3301
3511
  <fo:block>
3302
3512
  <xsl:apply-templates/>
@@ -3338,13 +3548,7 @@
3338
3548
  <xsl:with-param name="default">left</xsl:with-param>
3339
3549
  </xsl:call-template>
3340
3550
 
3341
- <xsl:if test="$lang = 'ar'">
3342
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
3343
- </xsl:if>
3344
-
3345
- <!-- bsi -->
3346
-
3347
- <xsl:call-template name="setBordersTableArray"/>
3551
+ <xsl:call-template name="refine_table-cell-style"/>
3348
3552
 
3349
3553
  <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
3350
3554
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -3375,9 +3579,13 @@
3375
3579
 
3376
3580
  <fo:block xsl:use-attribute-sets="table-note-style">
3377
3581
 
3582
+ <xsl:call-template name="refine_table-note-style"/>
3583
+
3378
3584
  <!-- Table's note name (NOTE, for example) -->
3379
3585
  <fo:inline xsl:use-attribute-sets="table-note-name-style">
3380
3586
 
3587
+ <xsl:call-template name="refine_table-note-name-style"/>
3588
+
3381
3589
  <xsl:apply-templates select="*[local-name() = 'name']"/>
3382
3590
 
3383
3591
  </fo:inline>
@@ -3405,6 +3613,14 @@
3405
3613
  <!-- list of footnotes to calculate actual footnotes number -->
3406
3614
  <xsl:variable name="p_fn_">
3407
3615
  <xsl:call-template name="get_fn_list"/>
3616
+ <!-- <xsl:choose>
3617
+ <xsl:when test="$namespace = 'jis'">
3618
+ <xsl:call-template name="get_fn_list_for_element"/>
3619
+ </xsl:when>
3620
+ <xsl:otherwise>
3621
+ <xsl:call-template name="get_fn_list"/>
3622
+ </xsl:otherwise>
3623
+ </xsl:choose> -->
3408
3624
  </xsl:variable>
3409
3625
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
3410
3626
 
@@ -3429,7 +3645,14 @@
3429
3645
 
3430
3646
  </xsl:variable>
3431
3647
 
3432
- <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
3648
+ <xsl:variable name="ref_id">
3649
+ <xsl:choose>
3650
+ <xsl:when test="normalize-space(@ref_id) != ''"><xsl:value-of select="@ref_id"/></xsl:when>
3651
+ <xsl:otherwise>
3652
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
3653
+ </xsl:otherwise>
3654
+ </xsl:choose>
3655
+ </xsl:variable>
3433
3656
  <xsl:variable name="footnote_inline">
3434
3657
  <fo:inline>
3435
3658
 
@@ -3452,9 +3675,13 @@
3452
3675
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
3453
3676
  </xsl:if>
3454
3677
 
3455
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3456
- <xsl:value-of select="$current_fn_number_text"/>
3457
- </fo:basic-link>
3678
+ <xsl:call-template name="insert_basic_link">
3679
+ <xsl:with-param name="element">
3680
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3681
+ <xsl:copy-of select="$current_fn_number_text"/>
3682
+ </fo:basic-link>
3683
+ </xsl:with-param>
3684
+ </xsl:call-template>
3458
3685
  </fo:inline>
3459
3686
  </xsl:variable>
3460
3687
 
@@ -3471,8 +3698,12 @@
3471
3698
 
3472
3699
  <fo:block xsl:use-attribute-sets="fn-body-style">
3473
3700
 
3701
+ <xsl:call-template name="refine_fn-body-style"/>
3702
+
3474
3703
  <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
3475
3704
 
3705
+ <xsl:call-template name="refine_fn-body-num-style"/>
3706
+
3476
3707
  <xsl:value-of select="$current_fn_number_text"/>
3477
3708
  </fo:inline>
3478
3709
  <xsl:apply-templates/>
@@ -3524,6 +3755,28 @@
3524
3755
  </xsl:choose>
3525
3756
  </xsl:template>
3526
3757
 
3758
+ <xsl:template name="get_fn_list_for_element">
3759
+ <xsl:choose>
3760
+ <xsl:when test="@current_fn_number"> <!-- footnote reference number calculated already -->
3761
+ <fn gen_id="{generate-id(.)}">
3762
+ <xsl:copy-of select="@*"/>
3763
+ <xsl:copy-of select="node()"/>
3764
+ </fn>
3765
+ </xsl:when>
3766
+ <xsl:otherwise>
3767
+ <xsl:for-each select="ancestor::*[local-name() = 'ul' or local-name() = 'ol'][1]">
3768
+ <xsl:variable name="element_id" select="@id"/>
3769
+ <xsl:for-each select=".//*[local-name() = 'fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
3770
+ <!-- copy unique fn -->
3771
+ <fn gen_id="{generate-id(.)}">
3772
+ <xsl:copy-of select="@*"/>
3773
+ <xsl:copy-of select="node()"/>
3774
+ </fn>
3775
+ </xsl:for-each>
3776
+ </xsl:for-each>
3777
+ </xsl:otherwise>
3778
+ </xsl:choose>
3779
+ </xsl:template>
3527
3780
  <!-- ============================ -->
3528
3781
  <!-- table's footnotes rendering -->
3529
3782
  <!-- ============================ -->
@@ -3704,6 +3957,8 @@
3704
3957
  <xsl:template match="*[local-name()='fn']">
3705
3958
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
3706
3959
 
3960
+ <xsl:call-template name="refine_fn-reference-style"/>
3961
+
3707
3962
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
3708
3963
 
3709
3964
  <xsl:attribute name="internal-destination">
@@ -3798,14 +4053,18 @@
3798
4053
  <xsl:apply-templates select="preceding-sibling::*[1][local-name() = 'p' and @keep-with-next = 'true']/node()"/>
3799
4054
  <xsl:text> </xsl:text>
3800
4055
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
3801
- <xsl:text/>
3802
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
4056
+ <xsl:if test="*[local-name()='dd']/node()[normalize-space() != ''][1][self::text()]">
4057
+ <xsl:text> </xsl:text>
4058
+ </xsl:if>
4059
+ <xsl:apply-templates select="*[local-name()='dd']/node()" mode="inline"/>
3803
4060
  </fo:block>
3804
4061
 
3805
4062
  </xsl:when> <!-- END: only one component -->
3806
4063
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
3807
4064
  <fo:block margin-bottom="12pt" text-align="left">
3808
4065
 
4066
+ <xsl:call-template name="refine_dl_formula_where_style"/>
4067
+
3809
4068
  <!-- <xsl:variable name="title-where">
3810
4069
  <xsl:call-template name="getLocalizedString">
3811
4070
  <xsl:with-param name="key">where</xsl:with-param>
@@ -3819,6 +4078,8 @@
3819
4078
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
3820
4079
  <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
3821
4080
 
4081
+ <xsl:call-template name="refine_figure_key_style"/>
4082
+
3822
4083
  <xsl:variable name="title-key">
3823
4084
  <xsl:call-template name="getLocalizedString">
3824
4085
  <xsl:with-param name="key">key</xsl:with-param>
@@ -3833,12 +4094,16 @@
3833
4094
  <xsl:if test="$onlyOneComponent = 'false'">
3834
4095
  <fo:block>
3835
4096
 
4097
+ <xsl:call-template name="refine_multicomponent_style"/>
4098
+
3836
4099
  <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
3837
4100
  <xsl:attribute name="margin-top">0</xsl:attribute>
3838
4101
  </xsl:if>
3839
4102
 
3840
4103
  <fo:block>
3841
4104
 
4105
+ <xsl:call-template name="refine_multicomponent_block_style"/>
4106
+
3842
4107
  <xsl:apply-templates select="*[local-name() = 'name']">
3843
4108
  <xsl:with-param name="process">true</xsl:with-param>
3844
4109
  </xsl:apply-templates>
@@ -3996,6 +4261,24 @@
3996
4261
 
3997
4262
  </xsl:template> <!-- END: dl -->
3998
4263
 
4264
+ <xsl:template name="refine_dl_formula_where_style">
4265
+
4266
+ </xsl:template> <!-- refine_dl_formula_where_style -->
4267
+
4268
+ <xsl:template name="refine_figure_key_style">
4269
+
4270
+ </xsl:template> <!-- refine_figure_key_style -->
4271
+
4272
+ <xsl:template name="refine_multicomponent_style">
4273
+ <xsl:variable name="parent" select="local-name(..)"/>
4274
+
4275
+ </xsl:template> <!-- refine_multicomponent_style -->
4276
+
4277
+ <xsl:template name="refine_multicomponent_block_style">
4278
+ <xsl:variable name="parent" select="local-name(..)"/>
4279
+
4280
+ </xsl:template> <!-- refine_multicomponent_block_style -->
4281
+
3999
4282
  <!-- ignore 'p' with 'where' in formula, before 'dl' -->
4000
4283
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/>
4001
4284
 
@@ -4215,6 +4498,8 @@
4215
4498
 
4216
4499
  </xsl:if>
4217
4500
 
4501
+ <xsl:call-template name="refine_dt-cell-style"/>
4502
+
4218
4503
  <fo:block xsl:use-attribute-sets="dt-block-style">
4219
4504
  <xsl:copy-of select="@id"/>
4220
4505
 
@@ -4222,6 +4507,8 @@
4222
4507
  <xsl:attribute name="margin-top">0</xsl:attribute>
4223
4508
  </xsl:if>
4224
4509
 
4510
+ <xsl:call-template name="refine_dt-block-style"/>
4511
+
4225
4512
  <xsl:apply-templates>
4226
4513
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4227
4514
  </xsl:apply-templates>
@@ -4241,6 +4528,8 @@
4241
4528
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
4242
4529
  </xsl:if>
4243
4530
 
4531
+ <xsl:call-template name="refine_dd-cell-style"/>
4532
+
4244
4533
  <fo:block>
4245
4534
 
4246
4535
  <xsl:if test="$isGenerateTableIF = 'true'">
@@ -4286,8 +4575,18 @@
4286
4575
  </xsl:if>
4287
4576
  </xsl:template>
4288
4577
 
4289
- <xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
4290
- <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
4578
+ <xsl:template match="*[local-name()='dd']/*" mode="inline">
4579
+ <xsl:variable name="is_inline_element_after_where">
4580
+ <xsl:if test="(local-name() = 'p') and not(preceding-sibling::node()[normalize-space() != ''])">true</xsl:if>
4581
+ </xsl:variable>
4582
+ <xsl:choose>
4583
+ <xsl:when test="$is_inline_element_after_where = 'true'">
4584
+ <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
4585
+ </xsl:when>
4586
+ <xsl:otherwise>
4587
+ <xsl:apply-templates select="."/>
4588
+ </xsl:otherwise>
4589
+ </xsl:choose>
4291
4590
  </xsl:template>
4292
4591
 
4293
4592
  <!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
@@ -4381,12 +4680,18 @@
4381
4680
  <xsl:param name="split_keep-within-line"/>
4382
4681
  <fo:inline font-weight="bold">
4383
4682
 
4683
+ <xsl:call-template name="refine_strong_style"/>
4684
+
4384
4685
  <xsl:apply-templates>
4385
4686
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4386
4687
  </xsl:apply-templates>
4387
4688
  </fo:inline>
4388
4689
  </xsl:template>
4389
4690
 
4691
+ <xsl:template name="refine_strong_style">
4692
+
4693
+ </xsl:template>
4694
+
4390
4695
  <xsl:template match="*[local-name()='padding']">
4391
4696
  <fo:inline padding-right="{@value}"> </fo:inline>
4392
4697
  </xsl:template>
@@ -5533,6 +5838,11 @@
5533
5838
 
5534
5839
  <fo:inline xsl:use-attribute-sets="mathml-style">
5535
5840
 
5841
+ <!-- DEBUG -->
5842
+ <!-- <xsl:copy-of select="ancestor::*[local-name() = 'stem']/@font-family"/> -->
5843
+
5844
+ <xsl:call-template name="refine_mathml-style"/>
5845
+
5536
5846
  <xsl:if test="$isGenerateTableIF = 'true' and ancestor::*[local-name() = 'td' or local-name() = 'th' or local-name() = 'dl'] and not(following-sibling::node()[not(self::comment())][normalize-space() != ''])"> <!-- math in table cell, and math is last element -->
5537
5847
  <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
5538
5848
  </xsl:if>
@@ -5637,6 +5947,8 @@
5637
5947
 
5638
5948
  <fo:instream-foreign-object fox:alt-text="Math">
5639
5949
 
5950
+ <xsl:call-template name="refine_mathml_insteam_object_style"/>
5951
+
5640
5952
  <!-- put MathML in Actual Text -->
5641
5953
  <!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
5642
5954
  <xsl:attribute name="fox:actual-text">
@@ -5657,6 +5969,10 @@
5657
5969
  </fo:instream-foreign-object>
5658
5970
  </xsl:template>
5659
5971
 
5972
+ <xsl:template name="refine_mathml_insteam_object_style">
5973
+
5974
+ </xsl:template> <!-- refine_mathml_insteam_object_style -->
5975
+
5660
5976
  <xsl:template match="mathml:*" mode="mathml_actual_text">
5661
5977
  <!-- <xsl:text>a+b</xsl:text> -->
5662
5978
  <xsl:text>&lt;</xsl:text>
@@ -5720,6 +6036,79 @@
5720
6036
  <xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
5721
6037
  </xsl:template>
5722
6038
 
6039
+ <!-- special case for:
6040
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
6041
+ <mstyle displaystyle="true">
6042
+ <msup>
6043
+ <mi color="#00000000">C</mi>
6044
+ <mtext>R</mtext>
6045
+ </msup>
6046
+ <msubsup>
6047
+ <mtext>C</mtext>
6048
+ <mi>n</mi>
6049
+ <mi>k</mi>
6050
+ </msubsup>
6051
+ </mstyle>
6052
+ </math>
6053
+ -->
6054
+ <xsl:template match="mathml:msup/mathml:mi[. = '‌' or . = ''][not(preceding-sibling::*)][following-sibling::mathml:mtext]" mode="mathml">
6055
+ <xsl:copy>
6056
+ <xsl:copy-of select="@*"/>
6057
+ <xsl:variable name="next_mtext" select="ancestor::mathml:msup/following-sibling::*[1][self::mathml:msubsup or self::mathml:msub or self::mathml:msup]/mathml:mtext"/>
6058
+ <xsl:if test="string-length($next_mtext) != ''">
6059
+ <xsl:attribute name="color">#00000000</xsl:attribute>
6060
+ </xsl:if>
6061
+ <xsl:apply-templates/>
6062
+ <xsl:value-of select="$next_mtext"/>
6063
+ </xsl:copy>
6064
+ </xsl:template>
6065
+
6066
+ <!-- special case for:
6067
+ <msup>
6068
+ <mtext/>
6069
+ <mn>1</mn>
6070
+ </msup>
6071
+ convert to (add mspace after mtext and enclose them into mrow):
6072
+ <msup>
6073
+ <mrow>
6074
+ <mtext/>
6075
+ <mspace height="1.47ex"/>
6076
+ </mrow>
6077
+ <mn>1</mn>
6078
+ </msup>
6079
+ -->
6080
+ <xsl:template match="mathml:msup/mathml:mtext[not(preceding-sibling::*)]" mode="mathml">
6081
+ <mathml:mrow>
6082
+ <xsl:copy-of select="."/>
6083
+ <mathml:mspace height="1.47ex"/>
6084
+ </mathml:mrow>
6085
+ </xsl:template>
6086
+
6087
+ <!-- add space around vertical line -->
6088
+ <xsl:template match="mathml:mo[normalize-space(text()) = '|']" mode="mathml">
6089
+ <xsl:copy>
6090
+ <xsl:apply-templates select="@*" mode="mathml"/>
6091
+ <xsl:if test="not(@lspace)">
6092
+ <xsl:attribute name="lspace">0.4em</xsl:attribute>
6093
+ </xsl:if>
6094
+ <xsl:if test="not(@rspace)">
6095
+ <xsl:attribute name="rspace">0.4em</xsl:attribute>
6096
+ </xsl:if>
6097
+ <xsl:apply-templates mode="mathml"/>
6098
+ </xsl:copy>
6099
+ </xsl:template>
6100
+
6101
+ <!-- decrease fontsize for 'Circled Times' char -->
6102
+ <xsl:template match="mathml:mo[normalize-space(text()) = '⊗']" mode="mathml">
6103
+ <xsl:copy>
6104
+ <xsl:apply-templates select="@*" mode="mathml"/>
6105
+ <xsl:if test="not(@fontsize)">
6106
+ <xsl:attribute name="fontsize">55%</xsl:attribute>
6107
+ </xsl:if>
6108
+ <xsl:apply-templates mode="mathml"/>
6109
+ </xsl:copy>
6110
+ </xsl:template>
6111
+
5723
6112
  <!-- Examples:
5724
6113
  <stem type="AsciiMath">x = 1</stem>
5725
6114
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -5728,6 +6117,8 @@
5728
6117
  <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
5729
6118
  <fo:inline xsl:use-attribute-sets="mathml-style">
5730
6119
 
6120
+ <xsl:call-template name="refine_mathml-style"/>
6121
+
5731
6122
  <xsl:choose>
5732
6123
  <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
5733
6124
  <xsl:otherwise>
@@ -5772,24 +6163,30 @@
5772
6163
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
5773
6164
  </xsl:if>
5774
6165
 
6166
+ <xsl:call-template name="refine_link-style"/>
6167
+
5775
6168
  <xsl:choose>
5776
6169
  <xsl:when test="$target_text = ''">
5777
6170
  <xsl:apply-templates/>
5778
6171
  </xsl:when>
5779
6172
  <xsl:otherwise>
5780
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
5781
- <xsl:choose>
5782
- <xsl:when test="normalize-space(.) = ''">
5783
- <xsl:call-template name="add-zero-spaces-link-java">
5784
- <xsl:with-param name="text" select="$target_text"/>
5785
- </xsl:call-template>
5786
- </xsl:when>
5787
- <xsl:otherwise>
5788
- <!-- output text from <link>text</link> -->
5789
- <xsl:apply-templates/>
5790
- </xsl:otherwise>
5791
- </xsl:choose>
5792
- </fo:basic-link>
6173
+ <xsl:call-template name="insert_basic_link">
6174
+ <xsl:with-param name="element">
6175
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
6176
+ <xsl:choose>
6177
+ <xsl:when test="normalize-space(.) = ''">
6178
+ <xsl:call-template name="add-zero-spaces-link-java">
6179
+ <xsl:with-param name="text" select="$target_text"/>
6180
+ </xsl:call-template>
6181
+ </xsl:when>
6182
+ <xsl:otherwise>
6183
+ <!-- output text from <link>text</link> -->
6184
+ <xsl:apply-templates/>
6185
+ </xsl:otherwise>
6186
+ </xsl:choose>
6187
+ </fo:basic-link>
6188
+ </xsl:with-param>
6189
+ </xsl:call-template>
5793
6190
  </xsl:otherwise>
5794
6191
  </xsl:choose>
5795
6192
  </fo:inline>
@@ -5852,12 +6249,19 @@
5852
6249
  </xsl:template>
5853
6250
 
5854
6251
  <xsl:template match="*[local-name() = 'xref']">
5855
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
5856
- <xsl:if test="parent::*[local-name() = 'add']">
5857
- <xsl:call-template name="append_add-style"/>
5858
- </xsl:if>
5859
- <xsl:apply-templates/>
5860
- </fo:basic-link>
6252
+ <xsl:call-template name="insert_basic_link">
6253
+ <xsl:with-param name="element">
6254
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
6255
+ <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://'))">
6256
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6257
+ </xsl:if>
6258
+ <xsl:if test="parent::*[local-name() = 'add']">
6259
+ <xsl:call-template name="append_add-style"/>
6260
+ </xsl:if>
6261
+ <xsl:apply-templates/>
6262
+ </fo:basic-link>
6263
+ </xsl:with-param>
6264
+ </xsl:call-template>
5861
6265
  </xsl:template>
5862
6266
 
5863
6267
  <!-- ====== -->
@@ -5912,6 +6316,8 @@
5912
6316
  <fo:table-cell display-align="center">
5913
6317
  <fo:block xsl:use-attribute-sets="formula-stem-block-style">
5914
6318
 
6319
+ <xsl:call-template name="refine_formula-stem-block-style"/>
6320
+
5915
6321
  <xsl:apply-templates/>
5916
6322
  </fo:block>
5917
6323
  </fo:table-cell>
@@ -5953,16 +6359,18 @@
5953
6359
 
5954
6360
  <xsl:call-template name="setBlockSpanAll"/>
5955
6361
 
5956
- <xsl:if test="ancestor::ogc:ul or ancestor::ogc:ol and not(ancestor::ogc:note[1]/following-sibling::*)">
5957
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
5958
- </xsl:if>
6362
+ <xsl:call-template name="refine_note-style"/>
5959
6363
 
5960
6364
  <fo:block-container margin-left="0mm" margin-right="0mm">
5961
6365
 
5962
6366
  <fo:block>
5963
6367
 
6368
+ <xsl:call-template name="refine_note_block_style"/>
6369
+
5964
6370
  <fo:inline xsl:use-attribute-sets="note-name-style">
5965
6371
 
6372
+ <xsl:call-template name="refine_note-name-style"/>
6373
+
5966
6374
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
5967
6375
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
5968
6376
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -5988,6 +6396,10 @@
5988
6396
 
5989
6397
  </xsl:template>
5990
6398
 
6399
+ <xsl:template name="refine_note_block_style">
6400
+
6401
+ </xsl:template>
6402
+
5991
6403
  <xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
5992
6404
  <xsl:variable name="num"><xsl:number/></xsl:variable>
5993
6405
  <xsl:choose>
@@ -6009,12 +6421,16 @@
6009
6421
 
6010
6422
  <xsl:call-template name="setBlockSpanAll"/>
6011
6423
 
6424
+ <xsl:call-template name="refine_termnote-style"/>
6425
+
6012
6426
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
6013
6427
 
6014
6428
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
6015
6429
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
6016
6430
  </xsl:if>
6017
6431
 
6432
+ <xsl:call-template name="refine_termnote-name-style"/>
6433
+
6018
6434
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6019
6435
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
6020
6436
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -6186,6 +6602,8 @@
6186
6602
  <xsl:otherwise>
6187
6603
  <fo:block xsl:use-attribute-sets="image-style">
6188
6604
 
6605
+ <xsl:call-template name="refine_image-style"/>
6606
+
6189
6607
  <xsl:variable name="src">
6190
6608
  <xsl:call-template name="image_src"/>
6191
6609
  </xsl:variable>
@@ -6244,7 +6662,7 @@
6244
6662
  <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
6245
6663
  </xsl:when>
6246
6664
  <xsl:when test="not(starts-with(@src, 'data:'))">
6247
- <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
6665
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
6248
6666
  </xsl:when>
6249
6667
  <xsl:otherwise>
6250
6668
  <xsl:value-of select="@src"/>
@@ -6266,7 +6684,7 @@
6266
6684
  </xsl:when>
6267
6685
  <xsl:when test="not(starts-with(@src, 'data:'))">
6268
6686
  <xsl:variable name="src">
6269
- <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
6687
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
6270
6688
  </xsl:variable>
6271
6689
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
6272
6690
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -6652,15 +7070,19 @@
6652
7070
  <xsl:param name="dest"/>
6653
7071
  <fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
6654
7072
  <fo:block font-size="1pt">
6655
- <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
6656
- <fo:inline-container inline-progression-dimension="100%">
6657
- <fo:block-container height="{$height - 1}px" width="100%">
6658
- <!-- DEBUG <xsl:if test="local-name()='polygon'">
6659
- <xsl:attribute name="background-color">magenta</xsl:attribute>
6660
- </xsl:if> -->
6661
- <fo:block> </fo:block></fo:block-container>
6662
- </fo:inline-container>
6663
- </fo:basic-link>
7073
+ <xsl:call-template name="insert_basic_link">
7074
+ <xsl:with-param name="element">
7075
+ <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
7076
+ <fo:inline-container inline-progression-dimension="100%">
7077
+ <fo:block-container height="{$height - 1}px" width="100%">
7078
+ <!-- DEBUG <xsl:if test="local-name()='polygon'">
7079
+ <xsl:attribute name="background-color">magenta</xsl:attribute>
7080
+ </xsl:if> -->
7081
+ <fo:block> </fo:block></fo:block-container>
7082
+ </fo:inline-container>
7083
+ </fo:basic-link>
7084
+ </xsl:with-param>
7085
+ </xsl:call-template>
6664
7086
  </fo:block>
6665
7087
  </fo:block-container>
6666
7088
  </xsl:template>
@@ -7026,6 +7448,8 @@
7026
7448
  <xsl:if test="normalize-space() != ''">
7027
7449
  <fo:block xsl:use-attribute-sets="figure-name-style">
7028
7450
 
7451
+ <xsl:call-template name="refine_figure-name-style"/>
7452
+
7029
7453
  <xsl:apply-templates/>
7030
7454
  </fo:block>
7031
7455
  </xsl:if>
@@ -7294,6 +7718,8 @@
7294
7718
  </xsl:attribute>
7295
7719
  </xsl:for-each>
7296
7720
 
7721
+ <xsl:call-template name="refine_sourcecode-style"/>
7722
+
7297
7723
  <!-- remove margin between rows in the table with sourcecode line numbers -->
7298
7724
  <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
7299
7725
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
@@ -8020,6 +8446,8 @@
8020
8446
 
8021
8447
  <xsl:call-template name="setBlockSpanAll"/>
8022
8448
 
8449
+ <xsl:call-template name="refine_example-style"/>
8450
+
8023
8451
  <xsl:variable name="fo_element">
8024
8452
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
8025
8453
  block
@@ -8147,6 +8575,8 @@
8147
8575
  </xsl:if>
8148
8576
  <fo:block xsl:use-attribute-sets="example-p-style">
8149
8577
 
8578
+ <xsl:call-template name="refine_example-p-style"/>
8579
+
8150
8580
  <xsl:apply-templates/>
8151
8581
  </fo:block>
8152
8582
  </fo:block-container>
@@ -8163,6 +8593,7 @@
8163
8593
  </xsl:otherwise>
8164
8594
  </xsl:choose>
8165
8595
  </xsl:template> <!-- example/p -->
8596
+
8166
8597
  <!-- ====== -->
8167
8598
  <!-- ====== -->
8168
8599
 
@@ -8174,6 +8605,8 @@
8174
8605
  <xsl:template match="*[local-name() = 'termsource']" name="termsource">
8175
8606
  <fo:block xsl:use-attribute-sets="termsource-style">
8176
8607
 
8608
+ <xsl:call-template name="refine_termsource-style"/>
8609
+
8177
8610
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
8178
8611
  <xsl:variable name="termsource_text">
8179
8612
  <xsl:apply-templates/>
@@ -8226,14 +8659,18 @@
8226
8659
  </xsl:template>
8227
8660
 
8228
8661
  <xsl:template match="*[local-name() = 'origin']">
8229
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8230
- <xsl:if test="normalize-space(@citeas) = ''">
8231
- <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
8232
- </xsl:if>
8233
- <fo:inline xsl:use-attribute-sets="origin-style">
8234
- <xsl:apply-templates/>
8235
- </fo:inline>
8236
- </fo:basic-link>
8662
+ <xsl:call-template name="insert_basic_link">
8663
+ <xsl:with-param name="element">
8664
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8665
+ <xsl:if test="normalize-space(@citeas) = ''">
8666
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
8667
+ </xsl:if>
8668
+ <fo:inline xsl:use-attribute-sets="origin-style">
8669
+ <xsl:apply-templates/>
8670
+ </fo:inline>
8671
+ </fo:basic-link>
8672
+ </xsl:with-param>
8673
+ </xsl:call-template>
8237
8674
  </xsl:template>
8238
8675
 
8239
8676
  <!-- not using, see https://github.com/glossarist/iev-document/issues/23 -->
@@ -8285,6 +8722,8 @@
8285
8722
  <fo:block-container margin-left="0mm">
8286
8723
  <fo:block-container xsl:use-attribute-sets="quote-style">
8287
8724
 
8725
+ <xsl:call-template name="refine_quote-style"/>
8726
+
8288
8727
  <fo:block-container margin-left="0mm" margin-right="0mm">
8289
8728
  <fo:block role="BlockQuote">
8290
8729
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
@@ -8307,9 +8746,13 @@
8307
8746
  <xsl:if test="../*[local-name() = 'author']">
8308
8747
  <xsl:text>, </xsl:text>
8309
8748
  </xsl:if>
8310
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8311
- <xsl:apply-templates/>
8312
- </fo:basic-link>
8749
+ <xsl:call-template name="insert_basic_link">
8750
+ <xsl:with-param name="element">
8751
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8752
+ <xsl:apply-templates/>
8753
+ </fo:basic-link>
8754
+ </xsl:with-param>
8755
+ </xsl:call-template>
8313
8756
  </xsl:template>
8314
8757
 
8315
8758
  <xsl:template match="*[local-name() = 'author']">
@@ -8355,31 +8798,33 @@
8355
8798
 
8356
8799
  </xsl:if>
8357
8800
 
8358
- <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
8359
- <xsl:variable name="text" select="normalize-space()"/>
8801
+ <xsl:call-template name="refine_eref-style"/>
8360
8802
 
8361
- <fo:basic-link fox:alt-text="{@citeas}">
8362
- <xsl:if test="normalize-space(@citeas) = ''">
8363
- <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
8364
- </xsl:if>
8365
- <xsl:if test="@type = 'inline'">
8803
+ <xsl:call-template name="insert_basic_link">
8804
+ <xsl:with-param name="element">
8805
+ <fo:basic-link fox:alt-text="{@citeas}">
8806
+ <xsl:if test="normalize-space(@citeas) = ''">
8807
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
8808
+ </xsl:if>
8809
+ <xsl:if test="@type = 'inline'">
8366
8810
 
8367
- <xsl:attribute name="color">blue</xsl:attribute>
8368
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
8811
+ <xsl:call-template name="refine_basic_link_style"/>
8369
8812
 
8370
- </xsl:if>
8813
+ </xsl:if>
8371
8814
 
8372
- <xsl:choose>
8373
- <xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
8374
- <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
8375
- </xsl:when>
8376
- <xsl:otherwise>
8377
- <xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
8378
- </xsl:otherwise>
8379
- </xsl:choose>
8815
+ <xsl:choose>
8816
+ <xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
8817
+ <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
8818
+ </xsl:when>
8819
+ <xsl:otherwise>
8820
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
8821
+ </xsl:otherwise>
8822
+ </xsl:choose>
8380
8823
 
8381
- <xsl:apply-templates/>
8382
- </fo:basic-link>
8824
+ <xsl:apply-templates/>
8825
+ </fo:basic-link>
8826
+ </xsl:with-param>
8827
+ </xsl:call-template>
8383
8828
 
8384
8829
  </fo:inline>
8385
8830
  </xsl:when>
@@ -8397,6 +8842,14 @@
8397
8842
  </xsl:otherwise>
8398
8843
  </xsl:choose>
8399
8844
  </xsl:template>
8845
+
8846
+ <xsl:template name="refine_basic_link_style">
8847
+
8848
+ <xsl:attribute name="color">blue</xsl:attribute>
8849
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
8850
+
8851
+ </xsl:template> <!-- refine_basic_link_style -->
8852
+
8400
8853
  <!-- ====== -->
8401
8854
  <!-- END eref -->
8402
8855
  <!-- ====== -->
@@ -8549,16 +9002,22 @@
8549
9002
  <fo:block>
8550
9003
  <xsl:call-template name="setId"/>
8551
9004
 
8552
- <xsl:variable name="pos"><xsl:number count="ogc:sections/ogc:clause[not(@type='scope') and not(@type='conformance')]"/></xsl:variable> <!-- | ogc:sections/ogc:terms -->
8553
- <xsl:if test="$pos &gt;= 2">
8554
- <xsl:attribute name="space-before">18pt</xsl:attribute>
8555
- </xsl:if>
9005
+ <xsl:call-template name="sections_element_style"/>
8556
9006
 
8557
9007
  <xsl:apply-templates/>
8558
9008
  </fo:block>
8559
9009
 
8560
9010
  </xsl:template>
8561
9011
 
9012
+ <xsl:template name="sections_element_style">
9013
+
9014
+ <xsl:variable name="pos"><xsl:number count="ogc:sections/ogc:clause[not(@type='scope') and not(@type='conformance')]"/></xsl:variable> <!-- | ogc:sections/ogc:terms -->
9015
+ <xsl:if test="$pos &gt;= 2">
9016
+ <xsl:attribute name="space-before">18pt</xsl:attribute>
9017
+ </xsl:if>
9018
+
9019
+ </xsl:template> <!-- sections_element_style -->
9020
+
8562
9021
  <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
8563
9022
  <fo:block break-after="page"/>
8564
9023
  <fo:block>
@@ -8573,10 +9032,16 @@
8573
9032
 
8574
9033
  <xsl:call-template name="setBlockSpanAll"/>
8575
9034
 
9035
+ <xsl:call-template name="refine_clause_style"/>
9036
+
8576
9037
  <xsl:apply-templates/>
8577
9038
  </fo:block>
8578
9039
  </xsl:template>
8579
9040
 
9041
+ <xsl:template name="refine_clause_style">
9042
+
9043
+ </xsl:template> <!-- refine_clause_style -->
9044
+
8580
9045
  <xsl:template match="*[local-name() = 'definitions']">
8581
9046
  <fo:block id="{@id}">
8582
9047
  <xsl:apply-templates/>
@@ -8589,10 +9054,16 @@
8589
9054
 
8590
9055
  <xsl:call-template name="setBlockSpanAll"/>
8591
9056
 
9057
+ <xsl:call-template name="refine_annex_style"/>
9058
+
8592
9059
  </fo:block>
8593
9060
  <xsl:apply-templates/>
8594
9061
  </xsl:template>
8595
9062
 
9063
+ <xsl:template name="refine_annex_style">
9064
+
9065
+ </xsl:template>
9066
+
8596
9067
  <xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
8597
9068
  <!-- comment 2019-11-29 -->
8598
9069
  <!-- <fo:block font-weight="bold">Review:</fo:block>
@@ -8629,7 +9100,10 @@
8629
9100
  <xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/>
8630
9101
 
8631
9102
  <xsl:template name="setULLabel">
8632
- <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
9103
+ <xsl:variable name="list_level__">
9104
+ <xsl:value-of select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
9105
+ </xsl:variable>
9106
+ <xsl:variable name="list_level_" select="number($list_level__)"/>
8633
9107
  <xsl:variable name="list_level">
8634
9108
  <xsl:choose>
8635
9109
  <xsl:when test="$list_level_ &lt;= 3"><xsl:value-of select="$list_level_"/></xsl:when>
@@ -8754,6 +9228,8 @@
8754
9228
  </xsl:choose>
8755
9229
  </xsl:attribute>
8756
9230
 
9231
+ <xsl:call-template name="refine_list_container_style"/>
9232
+
8757
9233
  <fo:block-container margin-left="0mm">
8758
9234
  <fo:block>
8759
9235
  <xsl:apply-templates select="." mode="list"/>
@@ -8762,13 +9238,19 @@
8762
9238
  </fo:block-container>
8763
9239
  </xsl:when>
8764
9240
  <xsl:otherwise>
8765
- <fo:block>
8766
- <xsl:apply-templates select="." mode="list"/>
8767
- </fo:block>
9241
+
9242
+ <fo:block>
9243
+ <xsl:apply-templates select="." mode="list"/>
9244
+ </fo:block>
9245
+
8768
9246
  </xsl:otherwise>
8769
9247
  </xsl:choose>
8770
9248
  </xsl:template>
8771
9249
 
9250
+ <xsl:template name="refine_list_container_style">
9251
+
9252
+ </xsl:template> <!-- refine_list_container_style -->
9253
+
8772
9254
  <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
8773
9255
 
8774
9256
  <xsl:apply-templates select="*[local-name() = 'name']">
@@ -8779,7 +9261,7 @@
8779
9261
 
8780
9262
  <xsl:variable name="provisional_distance_between_starts_">
8781
9263
  <attributes xsl:use-attribute-sets="list-style">
8782
-
9264
+ <xsl:call-template name="refine_list-style_provisional-distance-between-starts"/>
8783
9265
  </attributes>
8784
9266
  </xsl:variable>
8785
9267
  <xsl:variable name="provisional_distance_between_starts" select="normalize-space(xalan:nodeset($provisional_distance_between_starts_)/attributes/@provisional-distance-between-starts)"/>
@@ -8815,6 +9297,8 @@
8815
9297
  <addon><xsl:value-of select="$addon"/></addon> -->
8816
9298
  </xsl:if>
8817
9299
 
9300
+ <xsl:call-template name="refine_list-style"/>
9301
+
8818
9302
  <xsl:if test="*[local-name() = 'name']">
8819
9303
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
8820
9304
  </xsl:if>
@@ -8827,6 +9311,10 @@
8827
9311
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
8828
9312
  </xsl:template>
8829
9313
 
9314
+ <xsl:template name="refine_list-style_provisional-distance-between-starts">
9315
+
9316
+ </xsl:template> <!-- refine_list-style_provisional-distance-between-starts -->
9317
+
8830
9318
  <xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
8831
9319
  <xsl:param name="process">false</xsl:param>
8832
9320
  <xsl:if test="$process = 'true'">
@@ -8840,20 +9328,27 @@
8840
9328
  <fo:list-item xsl:use-attribute-sets="list-item-style">
8841
9329
  <xsl:copy-of select="@id"/>
8842
9330
 
9331
+ <xsl:call-template name="refine_list-item-style"/>
9332
+
8843
9333
  <fo:list-item-label end-indent="label-end()">
8844
9334
  <fo:block xsl:use-attribute-sets="list-item-label-style">
8845
9335
 
9336
+ <xsl:call-template name="refine_list-item-label-style"/>
9337
+
8846
9338
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
8847
9339
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
8848
9340
  <xsl:call-template name="append_add-style"/>
8849
9341
  </xsl:if>
8850
9342
 
8851
- <xsl:call-template name="getListItemFormat"/>
9343
+ <xsl:call-template name="getListItemFormat"/>
9344
+
8852
9345
  </fo:block>
8853
9346
  </fo:list-item-label>
8854
9347
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
8855
9348
  <fo:block>
8856
9349
 
9350
+ <xsl:call-template name="refine_list-item-body-style"/>
9351
+
8857
9352
  <xsl:apply-templates/>
8858
9353
 
8859
9354
  <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
@@ -9171,6 +9666,7 @@
9171
9666
 
9172
9667
  <fo:block id="{@id}">
9173
9668
  <xsl:apply-templates/>
9669
+
9174
9670
  </fo:block>
9175
9671
  </xsl:template>
9176
9672
 
@@ -9190,6 +9686,7 @@
9190
9686
 
9191
9687
  <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style">
9192
9688
  <xsl:apply-templates/>
9689
+
9193
9690
  </fo:block>
9194
9691
 
9195
9692
  </xsl:template> <!-- references -->
@@ -9448,24 +9945,32 @@
9448
9945
  <xsl:for-each select="*[local-name() = 'tab']">
9449
9946
  <xsl:variable name="current_id" select="generate-id()"/>
9450
9947
  <fo:table-cell>
9451
- <fo:block>
9452
- <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
9453
- <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
9454
- <xsl:choose>
9455
- <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
9456
- <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
9457
- </xsl:choose>
9458
- </xsl:for-each>
9459
- </fo:basic-link>
9948
+ <fo:block line-height-shift-adjustment="disregard-shifts">
9949
+ <xsl:call-template name="insert_basic_link">
9950
+ <xsl:with-param name="element">
9951
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
9952
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
9953
+ <xsl:choose>
9954
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
9955
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
9956
+ </xsl:choose>
9957
+ </xsl:for-each>
9958
+ </fo:basic-link>
9959
+ </xsl:with-param>
9960
+ </xsl:call-template>
9460
9961
  </fo:block>
9461
9962
  </fo:table-cell>
9462
9963
  </xsl:for-each>
9463
9964
  <!-- last column - for page numbers -->
9464
9965
  <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
9465
9966
  <fo:block>
9466
- <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
9467
- <fo:page-number-citation ref-id="{$target}"/>
9468
- </fo:basic-link>
9967
+ <xsl:call-template name="insert_basic_link">
9968
+ <xsl:with-param name="element">
9969
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
9970
+ <fo:page-number-citation ref-id="{$target}"/>
9971
+ </fo:basic-link>
9972
+ </xsl:with-param>
9973
+ </xsl:call-template>
9469
9974
  </fo:block>
9470
9975
  </fo:table-cell>
9471
9976
  </xsl:template>
@@ -9507,6 +10012,27 @@
9507
10012
  <!-- End Table of Contents (ToC) processing -->
9508
10013
  <!-- =================== -->
9509
10014
 
10015
+ <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
10016
+ <xsl:template name="insert_basic_link">
10017
+ <xsl:param name="element"/>
10018
+ <xsl:variable name="element_node" select="xalan:nodeset($element)"/>
10019
+ <xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
10020
+ <xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
10021
+ <xsl:choose>
10022
+ <xsl:when test="$external-destination = 'true' or $internal-destination = 'true'">
10023
+ <xsl:copy-of select="$element_node"/>
10024
+ </xsl:when>
10025
+ <xsl:otherwise>
10026
+ <fo:inline>
10027
+ <xsl:for-each select="$element_node/fo:basic-link/@*[local-name() != 'external-destination' and local-name() != 'internal-destination' and local-name() != 'alt-text']">
10028
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
10029
+ </xsl:for-each>
10030
+ <xsl:copy-of select="$element_node/fo:basic-link/node()"/>
10031
+ </fo:inline>
10032
+ </xsl:otherwise>
10033
+ </xsl:choose>
10034
+ </xsl:template>
10035
+
9510
10036
  <xsl:template match="*[local-name() = 'variant-title']"/> <!-- [@type = 'sub'] -->
9511
10037
  <xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
9512
10038
  <fo:inline padding-right="5mm"> </fo:inline>
@@ -9739,6 +10265,9 @@
9739
10265
  </xsl:copy>
9740
10266
  </xsl:template>
9741
10267
 
10268
+ <!-- prevent empty thead processing in XSL-FO, remove it -->
10269
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'thead'][count(*) = 0]" mode="update_xml_step1"/>
10270
+
9742
10271
  <xsl:template name="add_id">
9743
10272
  <xsl:if test="not(@id)">
9744
10273
  <!-- add @id - first element with @id plus '_element_name' -->
@@ -10023,6 +10552,14 @@
10023
10552
  <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" mode="linear_xml" name="linear_xml_fn">
10024
10553
  <xsl:variable name="p_fn_">
10025
10554
  <xsl:call-template name="get_fn_list"/>
10555
+ <!-- <xsl:choose>
10556
+ <xsl:when test="$namespace = 'jis'">
10557
+ <xsl:call-template name="get_fn_list_for_element"/>
10558
+ </xsl:when>
10559
+ <xsl:otherwise>
10560
+ <xsl:call-template name="get_fn_list"/>
10561
+ </xsl:otherwise>
10562
+ </xsl:choose> -->
10026
10563
  </xsl:variable>
10027
10564
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
10028
10565
  <xsl:variable name="gen_id" select="generate-id(.)"/>
@@ -10037,8 +10574,14 @@
10037
10574
  <xsl:attribute name="current_fn_number">
10038
10575
  <xsl:value-of select="$current_fn_number"/>
10039
10576
  </xsl:attribute>
10577
+ <xsl:variable name="skip_footnote_body_" select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
10040
10578
  <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
10041
- <xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
10579
+
10580
+ <xsl:value-of select="$skip_footnote_body_"/>
10581
+
10582
+ </xsl:attribute>
10583
+ <xsl:attribute name="ref_id">
10584
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
10042
10585
  </xsl:attribute>
10043
10586
  <xsl:apply-templates select="node()" mode="linear_xml"/>
10044
10587
  </xsl:copy>