metanorma-ogc 2.3.9 → 2.3.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -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>
276
238
 
277
- <!-- End Document Pages -->
239
+ </xsl:for-each>
240
+ </xsl:template>
241
+
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>
265
+
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>
278
291
 
279
- </fo:root>
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
  <!-- ========================== -->
@@ -1407,7 +1521,6 @@
1407
1521
  </xsl:attribute-set>
1408
1522
 
1409
1523
  <xsl:attribute-set name="xref-style">
1410
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
1411
1524
 
1412
1525
  <xsl:attribute name="color">blue</xsl:attribute>
1413
1526
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
@@ -1421,6 +1534,12 @@
1421
1534
 
1422
1535
  </xsl:attribute-set>
1423
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
+
1424
1543
  <xsl:attribute-set name="note-style">
1425
1544
 
1426
1545
  <xsl:attribute name="font-size">10pt</xsl:attribute>
@@ -1430,6 +1549,14 @@
1430
1549
 
1431
1550
  </xsl:attribute-set>
1432
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
+
1433
1560
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
1434
1561
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
1435
1562
 
@@ -1439,11 +1566,19 @@
1439
1566
 
1440
1567
  </xsl:attribute-set>
1441
1568
 
1569
+ <xsl:template name="refine_note-name-style">
1570
+
1571
+ </xsl:template> <!-- refine_note-name-style -->
1572
+
1442
1573
  <xsl:attribute-set name="table-note-name-style">
1443
1574
  <xsl:attribute name="padding-right">2mm</xsl:attribute>
1444
1575
 
1445
1576
  </xsl:attribute-set>
1446
1577
 
1578
+ <xsl:template name="refine_table-note-name-style">
1579
+
1580
+ </xsl:template> <!-- refine_table-note-name-style -->
1581
+
1447
1582
  <xsl:attribute-set name="note-p-style">
1448
1583
 
1449
1584
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1458,10 +1593,18 @@
1458
1593
 
1459
1594
  </xsl:attribute-set>
1460
1595
 
1596
+ <xsl:template name="refine_termnote-style">
1597
+
1598
+ </xsl:template> <!-- refine_termnote-style -->
1599
+
1461
1600
  <xsl:attribute-set name="termnote-name-style">
1462
1601
 
1463
1602
  </xsl:attribute-set>
1464
1603
 
1604
+ <xsl:template name="refine_termnote-name-style">
1605
+
1606
+ </xsl:template>
1607
+
1465
1608
  <xsl:attribute-set name="termnote-p-style">
1466
1609
 
1467
1610
  <xsl:attribute name="space-before">4pt</xsl:attribute>
@@ -1477,6 +1620,10 @@
1477
1620
 
1478
1621
  </xsl:attribute-set>
1479
1622
 
1623
+ <xsl:template name="refine_quote-style">
1624
+
1625
+ </xsl:template>
1626
+
1480
1627
  <xsl:attribute-set name="quote-source-style">
1481
1628
  <xsl:attribute name="text-align">right</xsl:attribute>
1482
1629
 
@@ -1491,6 +1638,10 @@
1491
1638
 
1492
1639
  </xsl:attribute-set>
1493
1640
 
1641
+ <xsl:template name="refine_termsource-style">
1642
+
1643
+ </xsl:template> <!-- refine_termsource-style -->
1644
+
1494
1645
  <xsl:attribute-set name="termsource-text-style">
1495
1646
 
1496
1647
  </xsl:attribute-set>
@@ -1535,6 +1686,10 @@
1535
1686
 
1536
1687
  </xsl:attribute-set>
1537
1688
 
1689
+ <xsl:template name="refine_figure-name-style">
1690
+
1691
+ </xsl:template> <!-- refine_figure-name-style -->
1692
+
1538
1693
  <xsl:attribute-set name="figure-source-style">
1539
1694
 
1540
1695
  </xsl:attribute-set>
@@ -1554,6 +1709,10 @@
1554
1709
 
1555
1710
  </xsl:attribute-set> <!-- formula-stem-block-style -->
1556
1711
 
1712
+ <xsl:template name="refine_formula-stem-block-style">
1713
+
1714
+ </xsl:template> <!-- refine_formula-stem-block-style -->
1715
+
1557
1716
  <xsl:attribute-set name="formula-stem-number-style">
1558
1717
  <xsl:attribute name="text-align">right</xsl:attribute>
1559
1718
 
@@ -1568,6 +1727,10 @@
1568
1727
 
1569
1728
  </xsl:attribute-set>
1570
1729
 
1730
+ <xsl:template name="refine_image-style">
1731
+
1732
+ </xsl:template>
1733
+
1571
1734
  <xsl:attribute-set name="figure-pseudocode-p-style">
1572
1735
 
1573
1736
  </xsl:attribute-set>
@@ -1662,6 +1825,10 @@
1662
1825
 
1663
1826
  </xsl:attribute-set>
1664
1827
 
1828
+ <xsl:template name="refine_mathml-style">
1829
+
1830
+ </xsl:template>
1831
+
1665
1832
  <xsl:attribute-set name="list-style">
1666
1833
 
1667
1834
  <xsl:attribute name="provisional-distance-between-starts">6.5mm</xsl:attribute>
@@ -1670,6 +1837,10 @@
1670
1837
 
1671
1838
  </xsl:attribute-set> <!-- list-style -->
1672
1839
 
1840
+ <xsl:template name="refine_list-style">
1841
+
1842
+ </xsl:template> <!-- refine_list-style -->
1843
+
1673
1844
  <xsl:attribute-set name="list-name-style">
1674
1845
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1675
1846
 
@@ -1682,16 +1853,28 @@
1682
1853
 
1683
1854
  </xsl:attribute-set>
1684
1855
 
1856
+ <xsl:template name="refine_list-item-style">
1857
+
1858
+ </xsl:template> <!-- refine_list-item-style -->
1859
+
1685
1860
  <xsl:attribute-set name="list-item-label-style">
1686
1861
 
1687
1862
  </xsl:attribute-set>
1688
1863
 
1864
+ <xsl:template name="refine_list-item-label-style">
1865
+
1866
+ </xsl:template> <!-- refine_list-item-label-style -->
1867
+
1689
1868
  <xsl:attribute-set name="list-item-body-style">
1690
1869
 
1691
1870
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
1692
1871
 
1693
1872
  </xsl:attribute-set>
1694
1873
 
1874
+ <xsl:template name="refine_list-item-body-style">
1875
+
1876
+ </xsl:template> <!-- refine_list-item-body-style -->
1877
+
1695
1878
  <xsl:attribute-set name="toc-style">
1696
1879
  <xsl:attribute name="line-height">135%</xsl:attribute>
1697
1880
  </xsl:attribute-set>
@@ -1706,6 +1889,10 @@
1706
1889
 
1707
1890
  </xsl:attribute-set>
1708
1891
 
1892
+ <xsl:template name="refine_fn-reference-style">
1893
+
1894
+ </xsl:template> <!-- refine_fn-reference-style -->
1895
+
1709
1896
  <xsl:attribute-set name="fn-style">
1710
1897
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1711
1898
  </xsl:attribute-set>
@@ -1731,6 +1918,10 @@
1731
1918
 
1732
1919
  </xsl:attribute-set>
1733
1920
 
1921
+ <xsl:template name="refine_fn-body-style">
1922
+
1923
+ </xsl:template> <!-- refine_fn-body-style -->
1924
+
1734
1925
  <xsl:attribute-set name="fn-body-num-style">
1735
1926
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
1736
1927
 
@@ -1739,6 +1930,10 @@
1739
1930
 
1740
1931
  </xsl:attribute-set> <!-- fn-body-num-style -->
1741
1932
 
1933
+ <xsl:template name="refine_fn-body-num-style">
1934
+
1935
+ </xsl:template> <!-- refine_fn-body-num-style -->
1936
+
1742
1937
  <!-- admonition -->
1743
1938
  <xsl:attribute-set name="admonition-style">
1744
1939
 
@@ -2424,7 +2619,9 @@
2424
2619
 
2425
2620
  <fo:block-container xsl:use-attribute-sets="table-container-style">
2426
2621
 
2427
- <!-- 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>
2428
2625
 
2429
2626
  <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
2430
2627
 
@@ -2451,7 +2648,9 @@
2451
2648
 
2452
2649
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
2453
2650
 
2454
- <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>
2455
2654
 
2456
2655
  </xsl:element>
2457
2656
  </xsl:variable>
@@ -2473,7 +2672,7 @@
2473
2672
  </xsl:attribute>
2474
2673
  </xsl:for-each>
2475
2674
 
2476
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
2675
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
2477
2676
  <xsl:if test="$isNoteOrFnExist = 'true'">
2478
2677
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2479
2678
  </xsl:if>
@@ -2517,7 +2716,7 @@
2517
2716
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2518
2717
  </xsl:when>
2519
2718
  <xsl:otherwise>
2520
- <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() = 'example') 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 -->
2521
2720
  </xsl:otherwise>
2522
2721
  </xsl:choose>
2523
2722
 
@@ -2606,6 +2805,10 @@
2606
2805
 
2607
2806
  <fo:block xsl:use-attribute-sets="table-name-style">
2608
2807
 
2808
+ <xsl:call-template name="refine_table-name-style">
2809
+ <xsl:with-param name="continued" select="$continued"/>
2810
+ </xsl:call-template>
2811
+
2609
2812
  <xsl:choose>
2610
2813
  <xsl:when test="$continued = 'true'">
2611
2814
 
@@ -2988,6 +3191,8 @@
2988
3191
  <fo:table-row>
2989
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">
2990
3193
 
3194
+ <xsl:call-template name="refine_table-header-title-style"/>
3195
+
2991
3196
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
2992
3197
  <xsl:with-param name="continued">true</xsl:with-param>
2993
3198
  </xsl:apply-templates>
@@ -3000,6 +3205,10 @@
3000
3205
  </fo:table-row>
3001
3206
  </xsl:template> <!-- table-header-title -->
3002
3207
 
3208
+ <xsl:template name="refine_table-header-title-style">
3209
+
3210
+ </xsl:template> <!-- refine_table-header-title-style -->
3211
+
3003
3212
  <xsl:template match="*[local-name()='thead']" mode="process_tbody">
3004
3213
  <fo:table-body>
3005
3214
  <xsl:apply-templates/>
@@ -3024,7 +3233,7 @@
3024
3233
  <xsl:param name="colwidths"/>
3025
3234
  <xsl:param name="colgroup"/>
3026
3235
 
3027
- <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()='example'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
3028
3237
 
3029
3238
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3030
3239
 
@@ -3084,6 +3293,8 @@
3084
3293
  <fo:table-row>
3085
3294
  <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
3086
3295
 
3296
+ <xsl:call-template name="refine_table-footer-cell-style"/>
3297
+
3087
3298
  <xsl:call-template name="setBordersTableArray"/>
3088
3299
 
3089
3300
  <!-- fn will be processed inside 'note' processing -->
@@ -3092,8 +3303,10 @@
3092
3303
 
3093
3304
  <!-- except gb and bsi -->
3094
3305
 
3306
+ <xsl:apply-templates select="../*[local-name()='p']"/>
3095
3307
  <xsl:apply-templates select="../*[local-name()='dl']"/>
3096
3308
  <xsl:apply-templates select="../*[local-name()='note']"/>
3309
+ <xsl:apply-templates select="../*[local-name()='example']"/>
3097
3310
  <xsl:apply-templates select="../*[local-name()='source']"/>
3098
3311
 
3099
3312
  <xsl:variable name="isDisplayRowSeparator">
@@ -3102,7 +3315,7 @@
3102
3315
 
3103
3316
  <!-- horizontal row separator -->
3104
3317
  <xsl:if test="normalize-space($isDisplayRowSeparator) = 'true'">
3105
- <xsl:if test="../*[local-name()='note'] and normalize-space($table_fn_block) != ''">
3318
+ <xsl:if test="(../*[local-name()='note'] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
3106
3319
  <fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
3107
3320
 
3108
3321
  <xsl:call-template name="setBordersTableArray"/>
@@ -3223,7 +3436,7 @@
3223
3436
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
3224
3437
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
3225
3438
 
3226
- <xsl:call-template name="setBordersTableArray"/>
3439
+ <xsl:call-template name="refine_table-header-row-style"/>
3227
3440
 
3228
3441
  <xsl:call-template name="setTableRowAttributes"/>
3229
3442
 
@@ -3257,6 +3470,8 @@
3257
3470
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
3258
3471
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
3259
3472
 
3473
+ <xsl:call-template name="refine_table-footer-row-style"/>
3474
+
3260
3475
  <xsl:call-template name="setTableRowAttributes"/>
3261
3476
  <xsl:apply-templates/>
3262
3477
  </fo:table-row>
@@ -3270,9 +3485,10 @@
3270
3485
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3271
3486
  </xsl:if>
3272
3487
 
3273
- <xsl:call-template name="setBordersTableArray"/>
3488
+ <xsl:call-template name="refine_table-body-row-style"/>
3274
3489
 
3275
3490
  <xsl:call-template name="setTableRowAttributes"/>
3491
+
3276
3492
  <xsl:apply-templates/>
3277
3493
  </fo:table-row>
3278
3494
  </xsl:template>
@@ -3291,13 +3507,7 @@
3291
3507
  <xsl:with-param name="default">center</xsl:with-param>
3292
3508
  </xsl:call-template>
3293
3509
 
3294
- <xsl:call-template name="setBordersTableArray"/>
3295
-
3296
- <xsl:if test="$lang = 'ar'">
3297
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
3298
- </xsl:if>
3299
-
3300
- <xsl:call-template name="setTableCellAttributes"/>
3510
+ <xsl:call-template name="refine_table-header-cell-style"/>
3301
3511
 
3302
3512
  <fo:block>
3303
3513
  <xsl:apply-templates/>
@@ -3339,13 +3549,7 @@
3339
3549
  <xsl:with-param name="default">left</xsl:with-param>
3340
3550
  </xsl:call-template>
3341
3551
 
3342
- <xsl:if test="$lang = 'ar'">
3343
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
3344
- </xsl:if>
3345
-
3346
- <!-- bsi -->
3347
-
3348
- <xsl:call-template name="setBordersTableArray"/>
3552
+ <xsl:call-template name="refine_table-cell-style"/>
3349
3553
 
3350
3554
  <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
3351
3555
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -3372,13 +3576,17 @@
3372
3576
  </fo:table-cell>
3373
3577
  </xsl:template> <!-- td -->
3374
3578
 
3375
- <xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2">
3579
+ <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
3376
3580
 
3377
3581
  <fo:block xsl:use-attribute-sets="table-note-style">
3378
3582
 
3379
- <!-- Table's note name (NOTE, for example) -->
3583
+ <xsl:call-template name="refine_table-note-style"/>
3584
+
3585
+ <!-- Table's note/example name (NOTE, for example) -->
3380
3586
  <fo:inline xsl:use-attribute-sets="table-note-name-style">
3381
3587
 
3588
+ <xsl:call-template name="refine_table-note-name-style"/>
3589
+
3382
3590
  <xsl:apply-templates select="*[local-name() = 'name']"/>
3383
3591
 
3384
3592
  </fo:inline>
@@ -3388,7 +3596,7 @@
3388
3596
 
3389
3597
  </xsl:template> <!-- table/note -->
3390
3598
 
3391
- <xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" priority="2">
3599
+ <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name()='example']/*[local-name()='p']" priority="2">
3392
3600
  <xsl:apply-templates/>
3393
3601
  </xsl:template>
3394
3602
 
@@ -3406,6 +3614,14 @@
3406
3614
  <!-- list of footnotes to calculate actual footnotes number -->
3407
3615
  <xsl:variable name="p_fn_">
3408
3616
  <xsl:call-template name="get_fn_list"/>
3617
+ <!-- <xsl:choose>
3618
+ <xsl:when test="$namespace = 'jis'">
3619
+ <xsl:call-template name="get_fn_list_for_element"/>
3620
+ </xsl:when>
3621
+ <xsl:otherwise>
3622
+ <xsl:call-template name="get_fn_list"/>
3623
+ </xsl:otherwise>
3624
+ </xsl:choose> -->
3409
3625
  </xsl:variable>
3410
3626
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
3411
3627
 
@@ -3430,7 +3646,14 @@
3430
3646
 
3431
3647
  </xsl:variable>
3432
3648
 
3433
- <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
3649
+ <xsl:variable name="ref_id">
3650
+ <xsl:choose>
3651
+ <xsl:when test="normalize-space(@ref_id) != ''"><xsl:value-of select="@ref_id"/></xsl:when>
3652
+ <xsl:otherwise>
3653
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
3654
+ </xsl:otherwise>
3655
+ </xsl:choose>
3656
+ </xsl:variable>
3434
3657
  <xsl:variable name="footnote_inline">
3435
3658
  <fo:inline>
3436
3659
 
@@ -3456,7 +3679,7 @@
3456
3679
  <xsl:call-template name="insert_basic_link">
3457
3680
  <xsl:with-param name="element">
3458
3681
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3459
- <xsl:value-of select="$current_fn_number_text"/>
3682
+ <xsl:copy-of select="$current_fn_number_text"/>
3460
3683
  </fo:basic-link>
3461
3684
  </xsl:with-param>
3462
3685
  </xsl:call-template>
@@ -3476,8 +3699,12 @@
3476
3699
 
3477
3700
  <fo:block xsl:use-attribute-sets="fn-body-style">
3478
3701
 
3702
+ <xsl:call-template name="refine_fn-body-style"/>
3703
+
3479
3704
  <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
3480
3705
 
3706
+ <xsl:call-template name="refine_fn-body-num-style"/>
3707
+
3481
3708
  <xsl:value-of select="$current_fn_number_text"/>
3482
3709
  </fo:inline>
3483
3710
  <xsl:apply-templates/>
@@ -3529,6 +3756,28 @@
3529
3756
  </xsl:choose>
3530
3757
  </xsl:template>
3531
3758
 
3759
+ <xsl:template name="get_fn_list_for_element">
3760
+ <xsl:choose>
3761
+ <xsl:when test="@current_fn_number"> <!-- footnote reference number calculated already -->
3762
+ <fn gen_id="{generate-id(.)}">
3763
+ <xsl:copy-of select="@*"/>
3764
+ <xsl:copy-of select="node()"/>
3765
+ </fn>
3766
+ </xsl:when>
3767
+ <xsl:otherwise>
3768
+ <xsl:for-each select="ancestor::*[local-name() = 'ul' or local-name() = 'ol'][1]">
3769
+ <xsl:variable name="element_id" select="@id"/>
3770
+ <xsl:for-each select=".//*[local-name() = 'fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
3771
+ <!-- copy unique fn -->
3772
+ <fn gen_id="{generate-id(.)}">
3773
+ <xsl:copy-of select="@*"/>
3774
+ <xsl:copy-of select="node()"/>
3775
+ </fn>
3776
+ </xsl:for-each>
3777
+ </xsl:for-each>
3778
+ </xsl:otherwise>
3779
+ </xsl:choose>
3780
+ </xsl:template>
3532
3781
  <!-- ============================ -->
3533
3782
  <!-- table's footnotes rendering -->
3534
3783
  <!-- ============================ -->
@@ -3709,6 +3958,8 @@
3709
3958
  <xsl:template match="*[local-name()='fn']">
3710
3959
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
3711
3960
 
3961
+ <xsl:call-template name="refine_fn-reference-style"/>
3962
+
3712
3963
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
3713
3964
 
3714
3965
  <xsl:attribute name="internal-destination">
@@ -3813,6 +4064,8 @@
3813
4064
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
3814
4065
  <fo:block margin-bottom="12pt" text-align="left">
3815
4066
 
4067
+ <xsl:call-template name="refine_dl_formula_where_style"/>
4068
+
3816
4069
  <!-- <xsl:variable name="title-where">
3817
4070
  <xsl:call-template name="getLocalizedString">
3818
4071
  <xsl:with-param name="key">where</xsl:with-param>
@@ -3826,6 +4079,8 @@
3826
4079
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
3827
4080
  <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
3828
4081
 
4082
+ <xsl:call-template name="refine_figure_key_style"/>
4083
+
3829
4084
  <xsl:variable name="title-key">
3830
4085
  <xsl:call-template name="getLocalizedString">
3831
4086
  <xsl:with-param name="key">key</xsl:with-param>
@@ -3840,12 +4095,16 @@
3840
4095
  <xsl:if test="$onlyOneComponent = 'false'">
3841
4096
  <fo:block>
3842
4097
 
4098
+ <xsl:call-template name="refine_multicomponent_style"/>
4099
+
3843
4100
  <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
3844
4101
  <xsl:attribute name="margin-top">0</xsl:attribute>
3845
4102
  </xsl:if>
3846
4103
 
3847
4104
  <fo:block>
3848
4105
 
4106
+ <xsl:call-template name="refine_multicomponent_block_style"/>
4107
+
3849
4108
  <xsl:apply-templates select="*[local-name() = 'name']">
3850
4109
  <xsl:with-param name="process">true</xsl:with-param>
3851
4110
  </xsl:apply-templates>
@@ -4003,6 +4262,24 @@
4003
4262
 
4004
4263
  </xsl:template> <!-- END: dl -->
4005
4264
 
4265
+ <xsl:template name="refine_dl_formula_where_style">
4266
+
4267
+ </xsl:template> <!-- refine_dl_formula_where_style -->
4268
+
4269
+ <xsl:template name="refine_figure_key_style">
4270
+
4271
+ </xsl:template> <!-- refine_figure_key_style -->
4272
+
4273
+ <xsl:template name="refine_multicomponent_style">
4274
+ <xsl:variable name="parent" select="local-name(..)"/>
4275
+
4276
+ </xsl:template> <!-- refine_multicomponent_style -->
4277
+
4278
+ <xsl:template name="refine_multicomponent_block_style">
4279
+ <xsl:variable name="parent" select="local-name(..)"/>
4280
+
4281
+ </xsl:template> <!-- refine_multicomponent_block_style -->
4282
+
4006
4283
  <!-- ignore 'p' with 'where' in formula, before 'dl' -->
4007
4284
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/>
4008
4285
 
@@ -4222,6 +4499,8 @@
4222
4499
 
4223
4500
  </xsl:if>
4224
4501
 
4502
+ <xsl:call-template name="refine_dt-cell-style"/>
4503
+
4225
4504
  <fo:block xsl:use-attribute-sets="dt-block-style">
4226
4505
  <xsl:copy-of select="@id"/>
4227
4506
 
@@ -4229,6 +4508,8 @@
4229
4508
  <xsl:attribute name="margin-top">0</xsl:attribute>
4230
4509
  </xsl:if>
4231
4510
 
4511
+ <xsl:call-template name="refine_dt-block-style"/>
4512
+
4232
4513
  <xsl:apply-templates>
4233
4514
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4234
4515
  </xsl:apply-templates>
@@ -4248,6 +4529,8 @@
4248
4529
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
4249
4530
  </xsl:if>
4250
4531
 
4532
+ <xsl:call-template name="refine_dd-cell-style"/>
4533
+
4251
4534
  <fo:block>
4252
4535
 
4253
4536
  <xsl:if test="$isGenerateTableIF = 'true'">
@@ -4398,12 +4681,18 @@
4398
4681
  <xsl:param name="split_keep-within-line"/>
4399
4682
  <fo:inline font-weight="bold">
4400
4683
 
4684
+ <xsl:call-template name="refine_strong_style"/>
4685
+
4401
4686
  <xsl:apply-templates>
4402
4687
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4403
4688
  </xsl:apply-templates>
4404
4689
  </fo:inline>
4405
4690
  </xsl:template>
4406
4691
 
4692
+ <xsl:template name="refine_strong_style">
4693
+
4694
+ </xsl:template>
4695
+
4407
4696
  <xsl:template match="*[local-name()='padding']">
4408
4697
  <fo:inline padding-right="{@value}"> </fo:inline>
4409
4698
  </xsl:template>
@@ -4875,7 +5164,10 @@
4875
5164
  </xsl:choose>
4876
5165
  </xsl:variable>
4877
5166
 
4878
- <xsl:value-of select="$text9"/>
5167
+ <!-- replace sequence #x200B and space TO space -->
5168
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
5169
+
5170
+ <xsl:value-of select="$text10"/>
4879
5171
  </xsl:template>
4880
5172
 
4881
5173
  <xsl:template name="add-zero-spaces-link-java">
@@ -5550,6 +5842,11 @@
5550
5842
 
5551
5843
  <fo:inline xsl:use-attribute-sets="mathml-style">
5552
5844
 
5845
+ <!-- DEBUG -->
5846
+ <!-- <xsl:copy-of select="ancestor::*[local-name() = 'stem']/@font-family"/> -->
5847
+
5848
+ <xsl:call-template name="refine_mathml-style"/>
5849
+
5553
5850
  <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 -->
5554
5851
  <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
5555
5852
  </xsl:if>
@@ -5654,6 +5951,8 @@
5654
5951
 
5655
5952
  <fo:instream-foreign-object fox:alt-text="Math">
5656
5953
 
5954
+ <xsl:call-template name="refine_mathml_insteam_object_style"/>
5955
+
5657
5956
  <!-- put MathML in Actual Text -->
5658
5957
  <!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
5659
5958
  <xsl:attribute name="fox:actual-text">
@@ -5674,6 +5973,10 @@
5674
5973
  </fo:instream-foreign-object>
5675
5974
  </xsl:template>
5676
5975
 
5976
+ <xsl:template name="refine_mathml_insteam_object_style">
5977
+
5978
+ </xsl:template> <!-- refine_mathml_insteam_object_style -->
5979
+
5677
5980
  <xsl:template match="mathml:*" mode="mathml_actual_text">
5678
5981
  <!-- <xsl:text>a+b</xsl:text> -->
5679
5982
  <xsl:text>&lt;</xsl:text>
@@ -5818,6 +6121,8 @@
5818
6121
  <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
5819
6122
  <fo:inline xsl:use-attribute-sets="mathml-style">
5820
6123
 
6124
+ <xsl:call-template name="refine_mathml-style"/>
6125
+
5821
6126
  <xsl:choose>
5822
6127
  <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
5823
6128
  <xsl:otherwise>
@@ -5862,6 +6167,8 @@
5862
6167
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
5863
6168
  </xsl:if>
5864
6169
 
6170
+ <xsl:call-template name="refine_link-style"/>
6171
+
5865
6172
  <xsl:choose>
5866
6173
  <xsl:when test="$target_text = ''">
5867
6174
  <xsl:apply-templates/>
@@ -5949,6 +6256,9 @@
5949
6256
  <xsl:call-template name="insert_basic_link">
5950
6257
  <xsl:with-param name="element">
5951
6258
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
6259
+ <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[local-name() = 'table' or local-name() = 'dl'])">
6260
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6261
+ </xsl:if>
5952
6262
  <xsl:if test="parent::*[local-name() = 'add']">
5953
6263
  <xsl:call-template name="append_add-style"/>
5954
6264
  </xsl:if>
@@ -6010,6 +6320,8 @@
6010
6320
  <fo:table-cell display-align="center">
6011
6321
  <fo:block xsl:use-attribute-sets="formula-stem-block-style">
6012
6322
 
6323
+ <xsl:call-template name="refine_formula-stem-block-style"/>
6324
+
6013
6325
  <xsl:apply-templates/>
6014
6326
  </fo:block>
6015
6327
  </fo:table-cell>
@@ -6051,16 +6363,18 @@
6051
6363
 
6052
6364
  <xsl:call-template name="setBlockSpanAll"/>
6053
6365
 
6054
- <xsl:if test="ancestor::ogc:ul or ancestor::ogc:ol and not(ancestor::ogc:note[1]/following-sibling::*)">
6055
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
6056
- </xsl:if>
6366
+ <xsl:call-template name="refine_note-style"/>
6057
6367
 
6058
6368
  <fo:block-container margin-left="0mm" margin-right="0mm">
6059
6369
 
6060
6370
  <fo:block>
6061
6371
 
6372
+ <xsl:call-template name="refine_note_block_style"/>
6373
+
6062
6374
  <fo:inline xsl:use-attribute-sets="note-name-style">
6063
6375
 
6376
+ <xsl:call-template name="refine_note-name-style"/>
6377
+
6064
6378
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6065
6379
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
6066
6380
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -6086,6 +6400,10 @@
6086
6400
 
6087
6401
  </xsl:template>
6088
6402
 
6403
+ <xsl:template name="refine_note_block_style">
6404
+
6405
+ </xsl:template>
6406
+
6089
6407
  <xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
6090
6408
  <xsl:variable name="num"><xsl:number/></xsl:variable>
6091
6409
  <xsl:choose>
@@ -6107,12 +6425,16 @@
6107
6425
 
6108
6426
  <xsl:call-template name="setBlockSpanAll"/>
6109
6427
 
6428
+ <xsl:call-template name="refine_termnote-style"/>
6429
+
6110
6430
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
6111
6431
 
6112
6432
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
6113
6433
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
6114
6434
  </xsl:if>
6115
6435
 
6436
+ <xsl:call-template name="refine_termnote-name-style"/>
6437
+
6116
6438
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6117
6439
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
6118
6440
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -6284,6 +6606,8 @@
6284
6606
  <xsl:otherwise>
6285
6607
  <fo:block xsl:use-attribute-sets="image-style">
6286
6608
 
6609
+ <xsl:call-template name="refine_image-style"/>
6610
+
6287
6611
  <xsl:variable name="src">
6288
6612
  <xsl:call-template name="image_src"/>
6289
6613
  </xsl:variable>
@@ -7128,6 +7452,8 @@
7128
7452
  <xsl:if test="normalize-space() != ''">
7129
7453
  <fo:block xsl:use-attribute-sets="figure-name-style">
7130
7454
 
7455
+ <xsl:call-template name="refine_figure-name-style"/>
7456
+
7131
7457
  <xsl:apply-templates/>
7132
7458
  </fo:block>
7133
7459
  </xsl:if>
@@ -7396,6 +7722,8 @@
7396
7722
  </xsl:attribute>
7397
7723
  </xsl:for-each>
7398
7724
 
7725
+ <xsl:call-template name="refine_sourcecode-style"/>
7726
+
7399
7727
  <!-- remove margin between rows in the table with sourcecode line numbers -->
7400
7728
  <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
7401
7729
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
@@ -8122,6 +8450,8 @@
8122
8450
 
8123
8451
  <xsl:call-template name="setBlockSpanAll"/>
8124
8452
 
8453
+ <xsl:call-template name="refine_example-style"/>
8454
+
8125
8455
  <xsl:variable name="fo_element">
8126
8456
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
8127
8457
  block
@@ -8232,6 +8562,12 @@
8232
8562
 
8233
8563
  </xsl:template>
8234
8564
 
8565
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name']">
8566
+ <fo:inline xsl:use-attribute-sets="example-name-style">
8567
+ <xsl:apply-templates/>
8568
+ </fo:inline>
8569
+ </xsl:template>
8570
+
8235
8571
  <xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
8236
8572
  <xsl:param name="fo_element">block</xsl:param>
8237
8573
 
@@ -8249,6 +8585,8 @@
8249
8585
  </xsl:if>
8250
8586
  <fo:block xsl:use-attribute-sets="example-p-style">
8251
8587
 
8588
+ <xsl:call-template name="refine_example-p-style"/>
8589
+
8252
8590
  <xsl:apply-templates/>
8253
8591
  </fo:block>
8254
8592
  </fo:block-container>
@@ -8265,6 +8603,7 @@
8265
8603
  </xsl:otherwise>
8266
8604
  </xsl:choose>
8267
8605
  </xsl:template> <!-- example/p -->
8606
+
8268
8607
  <!-- ====== -->
8269
8608
  <!-- ====== -->
8270
8609
 
@@ -8276,6 +8615,8 @@
8276
8615
  <xsl:template match="*[local-name() = 'termsource']" name="termsource">
8277
8616
  <fo:block xsl:use-attribute-sets="termsource-style">
8278
8617
 
8618
+ <xsl:call-template name="refine_termsource-style"/>
8619
+
8279
8620
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
8280
8621
  <xsl:variable name="termsource_text">
8281
8622
  <xsl:apply-templates/>
@@ -8391,6 +8732,8 @@
8391
8732
  <fo:block-container margin-left="0mm">
8392
8733
  <fo:block-container xsl:use-attribute-sets="quote-style">
8393
8734
 
8735
+ <xsl:call-template name="refine_quote-style"/>
8736
+
8394
8737
  <fo:block-container margin-left="0mm" margin-right="0mm">
8395
8738
  <fo:block role="BlockQuote">
8396
8739
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
@@ -8465,8 +8808,7 @@
8465
8808
 
8466
8809
  </xsl:if>
8467
8810
 
8468
- <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
8469
- <xsl:variable name="text" select="normalize-space()"/>
8811
+ <xsl:call-template name="refine_eref-style"/>
8470
8812
 
8471
8813
  <xsl:call-template name="insert_basic_link">
8472
8814
  <xsl:with-param name="element">
@@ -8476,8 +8818,7 @@
8476
8818
  </xsl:if>
8477
8819
  <xsl:if test="@type = 'inline'">
8478
8820
 
8479
- <xsl:attribute name="color">blue</xsl:attribute>
8480
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
8821
+ <xsl:call-template name="refine_basic_link_style"/>
8481
8822
 
8482
8823
  </xsl:if>
8483
8824
 
@@ -8511,6 +8852,14 @@
8511
8852
  </xsl:otherwise>
8512
8853
  </xsl:choose>
8513
8854
  </xsl:template>
8855
+
8856
+ <xsl:template name="refine_basic_link_style">
8857
+
8858
+ <xsl:attribute name="color">blue</xsl:attribute>
8859
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
8860
+
8861
+ </xsl:template> <!-- refine_basic_link_style -->
8862
+
8514
8863
  <!-- ====== -->
8515
8864
  <!-- END eref -->
8516
8865
  <!-- ====== -->
@@ -8663,16 +9012,22 @@
8663
9012
  <fo:block>
8664
9013
  <xsl:call-template name="setId"/>
8665
9014
 
8666
- <xsl:variable name="pos"><xsl:number count="ogc:sections/ogc:clause[not(@type='scope') and not(@type='conformance')]"/></xsl:variable> <!-- | ogc:sections/ogc:terms -->
8667
- <xsl:if test="$pos &gt;= 2">
8668
- <xsl:attribute name="space-before">18pt</xsl:attribute>
8669
- </xsl:if>
9015
+ <xsl:call-template name="sections_element_style"/>
8670
9016
 
8671
9017
  <xsl:apply-templates/>
8672
9018
  </fo:block>
8673
9019
 
8674
9020
  </xsl:template>
8675
9021
 
9022
+ <xsl:template name="sections_element_style">
9023
+
9024
+ <xsl:variable name="pos"><xsl:number count="ogc:sections/ogc:clause[not(@type='scope') and not(@type='conformance')]"/></xsl:variable> <!-- | ogc:sections/ogc:terms -->
9025
+ <xsl:if test="$pos &gt;= 2">
9026
+ <xsl:attribute name="space-before">18pt</xsl:attribute>
9027
+ </xsl:if>
9028
+
9029
+ </xsl:template> <!-- sections_element_style -->
9030
+
8676
9031
  <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
8677
9032
  <fo:block break-after="page"/>
8678
9033
  <fo:block>
@@ -8687,10 +9042,16 @@
8687
9042
 
8688
9043
  <xsl:call-template name="setBlockSpanAll"/>
8689
9044
 
9045
+ <xsl:call-template name="refine_clause_style"/>
9046
+
8690
9047
  <xsl:apply-templates/>
8691
9048
  </fo:block>
8692
9049
  </xsl:template>
8693
9050
 
9051
+ <xsl:template name="refine_clause_style">
9052
+
9053
+ </xsl:template> <!-- refine_clause_style -->
9054
+
8694
9055
  <xsl:template match="*[local-name() = 'definitions']">
8695
9056
  <fo:block id="{@id}">
8696
9057
  <xsl:apply-templates/>
@@ -8703,10 +9064,16 @@
8703
9064
 
8704
9065
  <xsl:call-template name="setBlockSpanAll"/>
8705
9066
 
9067
+ <xsl:call-template name="refine_annex_style"/>
9068
+
8706
9069
  </fo:block>
8707
9070
  <xsl:apply-templates/>
8708
9071
  </xsl:template>
8709
9072
 
9073
+ <xsl:template name="refine_annex_style">
9074
+
9075
+ </xsl:template>
9076
+
8710
9077
  <xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
8711
9078
  <!-- comment 2019-11-29 -->
8712
9079
  <!-- <fo:block font-weight="bold">Review:</fo:block>
@@ -8783,6 +9150,9 @@
8783
9150
  <xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
8784
9151
  </xsl:choose>
8785
9152
  </xsl:when>
9153
+ <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
9154
+ <xsl:value-of select="@label"/>
9155
+ </xsl:when>
8786
9156
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
8787
9157
 
8788
9158
  <!-- Example: for BSI <?list-start 2?> -->
@@ -8840,10 +9210,10 @@
8840
9210
  <xsl:when test="$type = 'arabic'">
8841
9211
  1)
8842
9212
  </xsl:when>
8843
- <xsl:when test="$type = 'alphabet'">
9213
+ <xsl:when test="$type = 'alphabet' or $type = 'alphabetic'">
8844
9214
  a)
8845
9215
  </xsl:when>
8846
- <xsl:when test="$type = 'alphabet_upper'">
9216
+ <xsl:when test="$type = 'alphabet_upper' or $type = 'alphabetic_upper'">
8847
9217
  A)
8848
9218
  </xsl:when>
8849
9219
  <xsl:when test="$type = 'roman'">
@@ -8871,6 +9241,8 @@
8871
9241
  </xsl:choose>
8872
9242
  </xsl:attribute>
8873
9243
 
9244
+ <xsl:call-template name="refine_list_container_style"/>
9245
+
8874
9246
  <fo:block-container margin-left="0mm">
8875
9247
  <fo:block>
8876
9248
  <xsl:apply-templates select="." mode="list"/>
@@ -8888,6 +9260,10 @@
8888
9260
  </xsl:choose>
8889
9261
  </xsl:template>
8890
9262
 
9263
+ <xsl:template name="refine_list_container_style">
9264
+
9265
+ </xsl:template> <!-- refine_list_container_style -->
9266
+
8891
9267
  <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
8892
9268
 
8893
9269
  <xsl:apply-templates select="*[local-name() = 'name']">
@@ -8898,7 +9274,7 @@
8898
9274
 
8899
9275
  <xsl:variable name="provisional_distance_between_starts_">
8900
9276
  <attributes xsl:use-attribute-sets="list-style">
8901
-
9277
+ <xsl:call-template name="refine_list-style_provisional-distance-between-starts"/>
8902
9278
  </attributes>
8903
9279
  </xsl:variable>
8904
9280
  <xsl:variable name="provisional_distance_between_starts" select="normalize-space(xalan:nodeset($provisional_distance_between_starts_)/attributes/@provisional-distance-between-starts)"/>
@@ -8934,6 +9310,8 @@
8934
9310
  <addon><xsl:value-of select="$addon"/></addon> -->
8935
9311
  </xsl:if>
8936
9312
 
9313
+ <xsl:call-template name="refine_list-style"/>
9314
+
8937
9315
  <xsl:if test="*[local-name() = 'name']">
8938
9316
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
8939
9317
  </xsl:if>
@@ -8946,6 +9324,10 @@
8946
9324
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
8947
9325
  </xsl:template>
8948
9326
 
9327
+ <xsl:template name="refine_list-style_provisional-distance-between-starts">
9328
+
9329
+ </xsl:template> <!-- refine_list-style_provisional-distance-between-starts -->
9330
+
8949
9331
  <xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
8950
9332
  <xsl:param name="process">false</xsl:param>
8951
9333
  <xsl:if test="$process = 'true'">
@@ -8959,20 +9341,27 @@
8959
9341
  <fo:list-item xsl:use-attribute-sets="list-item-style">
8960
9342
  <xsl:copy-of select="@id"/>
8961
9343
 
9344
+ <xsl:call-template name="refine_list-item-style"/>
9345
+
8962
9346
  <fo:list-item-label end-indent="label-end()">
8963
9347
  <fo:block xsl:use-attribute-sets="list-item-label-style">
8964
9348
 
9349
+ <xsl:call-template name="refine_list-item-label-style"/>
9350
+
8965
9351
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
8966
9352
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
8967
9353
  <xsl:call-template name="append_add-style"/>
8968
9354
  </xsl:if>
8969
9355
 
8970
9356
  <xsl:call-template name="getListItemFormat"/>
9357
+
8971
9358
  </fo:block>
8972
9359
  </fo:list-item-label>
8973
9360
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
8974
9361
  <fo:block>
8975
9362
 
9363
+ <xsl:call-template name="refine_list-item-body-style"/>
9364
+
8976
9365
  <xsl:apply-templates/>
8977
9366
 
8978
9367
  <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
@@ -9290,6 +9679,7 @@
9290
9679
 
9291
9680
  <fo:block id="{@id}">
9292
9681
  <xsl:apply-templates/>
9682
+
9293
9683
  </fo:block>
9294
9684
  </xsl:template>
9295
9685
 
@@ -9309,6 +9699,7 @@
9309
9699
 
9310
9700
  <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style">
9311
9701
  <xsl:apply-templates/>
9702
+
9312
9703
  </fo:block>
9313
9704
 
9314
9705
  </xsl:template> <!-- references -->
@@ -9887,6 +10278,9 @@
9887
10278
  </xsl:copy>
9888
10279
  </xsl:template>
9889
10280
 
10281
+ <!-- prevent empty thead processing in XSL-FO, remove it -->
10282
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'thead'][count(*) = 0]" mode="update_xml_step1"/>
10283
+
9890
10284
  <xsl:template name="add_id">
9891
10285
  <xsl:if test="not(@id)">
9892
10286
  <!-- add @id - first element with @id plus '_element_name' -->
@@ -10171,6 +10565,14 @@
10171
10565
  <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">
10172
10566
  <xsl:variable name="p_fn_">
10173
10567
  <xsl:call-template name="get_fn_list"/>
10568
+ <!-- <xsl:choose>
10569
+ <xsl:when test="$namespace = 'jis'">
10570
+ <xsl:call-template name="get_fn_list_for_element"/>
10571
+ </xsl:when>
10572
+ <xsl:otherwise>
10573
+ <xsl:call-template name="get_fn_list"/>
10574
+ </xsl:otherwise>
10575
+ </xsl:choose> -->
10174
10576
  </xsl:variable>
10175
10577
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
10176
10578
  <xsl:variable name="gen_id" select="generate-id(.)"/>
@@ -10185,8 +10587,14 @@
10185
10587
  <xsl:attribute name="current_fn_number">
10186
10588
  <xsl:value-of select="$current_fn_number"/>
10187
10589
  </xsl:attribute>
10590
+ <xsl:variable name="skip_footnote_body_" select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
10188
10591
  <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
10189
- <xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
10592
+
10593
+ <xsl:value-of select="$skip_footnote_body_"/>
10594
+
10595
+ </xsl:attribute>
10596
+ <xsl:attribute name="ref_id">
10597
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
10190
10598
  </xsl:attribute>
10191
10599
  <xsl:apply-templates select="node()" mode="linear_xml"/>
10192
10600
  </xsl:copy>