metanorma-bipm 1.2.1 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,6 +17,8 @@
17
17
 
18
18
  <xsl:param name="add_math_as_attachment">true</xsl:param>
19
19
 
20
+ <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
21
+
20
22
  <xsl:variable name="first_pass" select="count($index//item) = 0"/>
21
23
 
22
24
  <xsl:variable name="pageWidth" select="210"/>
@@ -247,33 +249,68 @@
247
249
  <xsl:template match="/">
248
250
  <fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}">
249
251
  <fo:layout-master-set>
252
+
253
+ <!-- blank page -->
254
+ <fo:simple-page-master master-name="blankpage" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
255
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
256
+ <fo:region-before region-name="header-blank" extent="{$marginTop}mm"/>
257
+ <fo:region-after region-name="footer-blank" extent="{$marginBottom}mm"/>
258
+ <fo:region-start region-name="left-region" extent="17mm"/>
259
+ <fo:region-end region-name="right-region" extent="26.5mm"/>
260
+ </fo:simple-page-master>
261
+
250
262
  <!-- Cover page -->
251
- <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
263
+ <fo:simple-page-master master-name="simple-cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
252
264
  <fo:region-body margin-top="36mm" margin-bottom="43mm" margin-left="49mm" margin-right="48mm"/>
253
- <fo:region-before extent="36mm"/>
265
+ <fo:region-before region-name="header" extent="36mm"/>
254
266
  <fo:region-after extent="43mm"/>
255
267
  <fo:region-start extent="49mm"/>
256
268
  <fo:region-end extent="48mm"/>
257
269
  </fo:simple-page-master>
258
270
 
271
+ <fo:page-sequence-master master-name="cover-page">
272
+ <fo:repeatable-page-master-alternatives>
273
+ <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
274
+ <fo:conditional-page-master-reference master-reference="simple-cover-page" odd-or-even="odd"/>
275
+ <fo:conditional-page-master-reference master-reference="simple-cover-page" odd-or-even="even"/>
276
+ </fo:repeatable-page-master-alternatives>
277
+ </fo:page-sequence-master>
278
+
259
279
  <!-- Cover page -->
260
- <fo:simple-page-master master-name="cover-page-appendix" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
280
+ <fo:simple-page-master master-name="simple-cover-page-appendix" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
261
281
  <fo:region-body margin-top="90mm" margin-bottom="40mm" margin-left="12.5mm" margin-right="53mm"/>
262
- <fo:region-before extent="60mm"/>
282
+ <fo:region-before region-name="header" extent="60mm"/>
263
283
  <fo:region-after extent="40mm"/>
264
284
  <fo:region-start extent="12.5mm"/>
265
285
  <fo:region-end extent="53mm"/>
266
286
  </fo:simple-page-master>
267
287
 
288
+ <fo:page-sequence-master master-name="cover-page-appendix">
289
+ <fo:repeatable-page-master-alternatives>
290
+ <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
291
+ <fo:conditional-page-master-reference master-reference="simple-cover-page-appendix" odd-or-even="odd"/>
292
+ <fo:conditional-page-master-reference master-reference="simple-cover-page-appendix" odd-or-even="even"/>
293
+ </fo:repeatable-page-master-alternatives>
294
+ </fo:page-sequence-master>
295
+
296
+
268
297
  <!-- Title page -->
269
- <fo:simple-page-master master-name="title-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
298
+ <fo:simple-page-master master-name="simple-title-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
270
299
  <fo:region-body margin-top="38mm" margin-bottom="25mm" margin-left="95mm" margin-right="12mm"/>
271
- <fo:region-before extent="38mm"/>
300
+ <fo:region-before region-name="header" extent="38mm"/>
272
301
  <fo:region-after extent="25mm"/>
273
302
  <fo:region-start extent="95mm"/>
274
303
  <fo:region-end extent="12mm"/>
275
304
  </fo:simple-page-master>
276
305
 
306
+ <fo:page-sequence-master master-name="title-page">
307
+ <fo:repeatable-page-master-alternatives>
308
+ <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
309
+ <fo:conditional-page-master-reference master-reference="simple-title-page" odd-or-even="odd"/>
310
+ <fo:conditional-page-master-reference master-reference="simple-title-page" odd-or-even="even"/>
311
+ </fo:repeatable-page-master-alternatives>
312
+ </fo:page-sequence-master>
313
+
277
314
  <!-- Document pages -->
278
315
  <fo:simple-page-master master-name="document-odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
279
316
  <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
@@ -291,6 +328,7 @@
291
328
  </fo:simple-page-master>
292
329
  <fo:page-sequence-master master-name="document">
293
330
  <fo:repeatable-page-master-alternatives>
331
+ <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
294
332
  <fo:conditional-page-master-reference odd-or-even="even" master-reference="document-even"/>
295
333
  <fo:conditional-page-master-reference odd-or-even="odd" master-reference="document-odd"/>
296
334
  </fo:repeatable-page-master-alternatives>
@@ -312,7 +350,8 @@
312
350
  <fo:region-end region-name="right-region" extent="26.5mm"/>
313
351
  </fo:simple-page-master>
314
352
  <fo:page-sequence-master master-name="document-landscape">
315
- <fo:repeatable-page-master-alternatives>
353
+ <fo:repeatable-page-master-alternatives>
354
+ <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
316
355
  <fo:conditional-page-master-reference odd-or-even="even" master-reference="document-landscape-even"/>
317
356
  <fo:conditional-page-master-reference odd-or-even="odd" master-reference="document-landscape-odd"/>
318
357
  </fo:repeatable-page-master-alternatives>
@@ -334,7 +373,8 @@
334
373
  <fo:region-end region-name="right-region" extent="26.5mm"/>
335
374
  </fo:simple-page-master>
336
375
  <fo:page-sequence-master master-name="index">
337
- <fo:repeatable-page-master-alternatives>
376
+ <fo:repeatable-page-master-alternatives>
377
+ <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
338
378
  <fo:conditional-page-master-reference odd-or-even="even" master-reference="index-even"/>
339
379
  <fo:conditional-page-master-reference odd-or-even="odd" master-reference="index-odd"/>
340
380
  </fo:repeatable-page-master-alternatives>
@@ -922,8 +962,11 @@
922
962
  <xsl:template name="setListItemLabel">
923
963
  <xsl:attribute name="label">
924
964
  <xsl:choose>
925
- <xsl:when test="local-name(..) = 'ul' and ../ancestor::bipm:ul">−</xsl:when> <!-- &#x2212; - minus sign. &#x2014; - dash -->
926
- <xsl:when test="local-name(..) = 'ul'">•</xsl:when> <!-- &#x2014; dash -->
965
+ <xsl:when test="local-name(..) = 'ul'">
966
+ <xsl:call-template name="setULLabel"/>
967
+ </xsl:when>
968
+ <!-- <xsl:when test="local-name(..) = 'ul' and ../ancestor::bipm:ul">&#x2212;</xsl:when> --> <!-- &#x2212; - minus sign. &#x2014; - dash -->
969
+ <!-- <xsl:when test="local-name(..) = 'ul'">•</xsl:when> --> <!-- &#x2014; dash -->
927
970
  <xsl:otherwise> <!-- for ordered lists -->
928
971
  <xsl:variable name="start_value">
929
972
  <xsl:choose>
@@ -1106,6 +1149,9 @@
1106
1149
  </xsl:if>
1107
1150
 
1108
1151
  <xsl:call-template name="insertFootnoteSeparator"/>
1152
+
1153
+ <xsl:call-template name="insertHeaderDraftWatermark"/>
1154
+
1109
1155
  <fo:flow flow-name="xsl-region-body" font-family="Arial">
1110
1156
 
1111
1157
  <fo:block-container font-size="12pt" font-weight="bold" border-top="1pt solid black" width="82mm" margin-top="2mm" padding-top="2mm">
@@ -1303,7 +1349,9 @@
1303
1349
 
1304
1350
  <!-- Index -->
1305
1351
  <!-- <xsl:apply-templates select="xalan:nodeset($indexes)/doc[@id = $docid]//bipm:clause[@type = 'index']" mode="index" /> -->
1306
- <xsl:apply-templates select="xalan:nodeset($indexes)/doc[@id = $docid]//bipm:indexsect" mode="index"/>
1352
+ <xsl:apply-templates select="xalan:nodeset($indexes)/doc[@id = $docid]//bipm:indexsect" mode="index">
1353
+ <xsl:with-param name="isDraft" select="normalize-space(//bipm:bipm-standard/bipm:bibdata/bipm:version/bipm:draft or contains(//bipm:bipm-standard/bipm:bibdata/bipm:status/bipm:stage, 'draft') or contains(//bipm:bipm-standard/bipm:bibdata/bipm:status/bipm:stage, 'projet'))"/>
1354
+ </xsl:apply-templates>
1307
1355
 
1308
1356
  <!-- End Document Pages -->
1309
1357
 
@@ -1322,6 +1370,8 @@
1322
1370
 
1323
1371
  <fo:page-sequence master-reference="document" force-page-count="no-force">
1324
1372
 
1373
+ <xsl:call-template name="insertHeaderDraftWatermark"/>
1374
+
1325
1375
  <fo:flow flow-name="xsl-region-body" font-family="Arial">
1326
1376
 
1327
1377
  <fo:block-container font-size="12pt" font-weight="bold" border-top="1pt solid black" width="82mm" margin-top="2mm" padding-top="2mm">
@@ -1471,7 +1521,9 @@
1471
1521
 
1472
1522
  <!-- Index -->
1473
1523
  <!-- <xsl:apply-templates select="xalan:nodeset($indexes)/doc[@id = $docid]//bipm:clause[@type = 'index']" mode="index" /> -->
1474
- <xsl:apply-templates select="xalan:nodeset($indexes)/doc[@id = $docid]//bipm:indexsect" mode="index"/>
1524
+ <xsl:apply-templates select="xalan:nodeset($indexes)/doc[@id = $docid]//bipm:indexsect" mode="index">
1525
+ <xsl:with-param name="isDraft" select="normalize-space(//bipm:bipm-standard/bipm:bibdata/bipm:version/bipm:draft or contains(//bipm:bipm-standard/bipm:bibdata/bipm:status/bipm:stage, 'draft') or contains(//bipm:bipm-standard/bipm:bibdata/bipm:status/bipm:stage, 'projet'))"/>
1526
+ </xsl:apply-templates>
1475
1527
 
1476
1528
  </xsl:otherwise>
1477
1529
  </xsl:choose>
@@ -1485,6 +1537,8 @@
1485
1537
 
1486
1538
  <fo:page-sequence master-reference="cover-page" force-page-count="even">
1487
1539
 
1540
+ <xsl:call-template name="insertHeaderDraftWatermark"/>
1541
+
1488
1542
  <fo:flow flow-name="xsl-region-body">
1489
1543
 
1490
1544
  <xsl:call-template name="insertCoverPageCommon"/>
@@ -1820,6 +1874,8 @@
1820
1874
  </fo:block>
1821
1875
  </fo:block-container>
1822
1876
 
1877
+ <xsl:call-template name="insertDraftWatermark"/>
1878
+
1823
1879
  <!-- BIPM logo -->
1824
1880
  <fo:block-container absolute-position="fixed" left="12.8mm" top="12.2mm">
1825
1881
  <fo:block>
@@ -1844,6 +1900,8 @@
1844
1900
 
1845
1901
  <fo:page-sequence master-reference="title-page" format="1" initial-page-number="1" force-page-count="even">
1846
1902
 
1903
+ <xsl:call-template name="insertHeaderDraftWatermark"/>
1904
+
1847
1905
  <fo:flow flow-name="xsl-region-body" font-family="Arial">
1848
1906
 
1849
1907
  <xsl:variable name="languages">
@@ -2126,7 +2184,7 @@
2126
2184
 
2127
2185
  <xsl:variable name="display">
2128
2186
  <xsl:choose>
2129
- <xsl:when test="$level &gt;= 4">false</xsl:when>
2187
+ <xsl:when test="$level &gt; $toc_level">false</xsl:when>
2130
2188
  <xsl:otherwise>true</xsl:otherwise>
2131
2189
  </xsl:choose>
2132
2190
  </xsl:variable>
@@ -2363,7 +2421,7 @@
2363
2421
  <!-- ====== -->
2364
2422
 
2365
2423
 
2366
- <xsl:template match="bipm:title" name="clause_title">
2424
+ <xsl:template match="bipm:title" name="title">
2367
2425
 
2368
2426
  <xsl:variable name="level">
2369
2427
  <xsl:call-template name="getLevel"/>
@@ -3036,35 +3094,6 @@
3036
3094
  </xsl:choose>
3037
3095
  </xsl:template>
3038
3096
 
3039
- <!--
3040
- <fn reference="1">
3041
- <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
3042
- </fn>
3043
- -->
3044
- <xsl:template match="bipm:title//bipm:fn | bipm:name//bipm:fn | bipm:p/bipm:fn[not(ancestor::bipm:table)] | bipm:p/*/bipm:fn[not(ancestor::bipm:table)] | bipm:sourcecode/bipm:fn[not(ancestor::bipm:table)]" priority="2" name="fn">
3045
- <fo:footnote keep-with-previous.within-line="always">
3046
- <xsl:variable name="number"> <!-- select="@reference"/> -->
3047
- <xsl:number count="bipm:fn[not(ancestor::bipm:table)]" level="any"/>
3048
- </xsl:variable>
3049
- <xsl:variable name="gen_id" select="generate-id()"/>
3050
- <xsl:variable name="lang" select="ancestor::bipm:bipm-standard/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
3051
- <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super">
3052
- <fo:basic-link internal-destination="{$lang}_footnote_{@reference}_{$number}_{$gen_id}" fox:alt-text="footnote {@reference}">
3053
- <xsl:value-of select="$number"/><!-- + count(//bipm:bibitem/bipm:note) -->
3054
- </fo:basic-link>
3055
- </fo:inline>
3056
- <fo:footnote-body>
3057
- <fo:block font-size="9pt" margin-bottom="12pt" font-weight="normal" text-indent="0" start-indent="0" line-height="124%" text-align="justify">
3058
- <fo:inline id="{$lang}_footnote_{@reference}_{$number}_{$gen_id}" keep-with-next.within-line="always" font-size="60%" vertical-align="super" padding-right="1mm"> <!-- baseline-shift="30%" padding-right="3mm" font-size="60%" alignment-baseline="hanging" -->
3059
- <xsl:value-of select="$number "/><!-- + count(//bipm:bibitem/bipm:note) -->
3060
- </fo:inline>
3061
- <xsl:for-each select="bipm:p">
3062
- <xsl:apply-templates/>
3063
- </xsl:for-each>
3064
- </fo:block>
3065
- </fo:footnote-body>
3066
- </fo:footnote>
3067
- </xsl:template>
3068
3097
 
3069
3098
  <xsl:template match="bipm:fn/bipm:p">
3070
3099
  <fo:block>
@@ -3326,11 +3355,12 @@
3326
3355
 
3327
3356
  <xsl:template match="bipm:preferred">
3328
3357
  <fo:block font-weight="bold" keep-with-next="always" space-before="8pt" margin-bottom="6pt">
3358
+ <xsl:call-template name="setStyle_preferred"/>
3329
3359
  <xsl:if test="ancestor::bipm:term[1]/bipm:name">
3330
3360
  <xsl:variable name="level">
3331
3361
  <xsl:call-template name="getLevelTermName"/>
3332
3362
  </xsl:variable>
3333
- <fo:inline role="H{$level}">
3363
+ <fo:inline role="H{$level}" font-weight="bold">
3334
3364
  <xsl:attribute name="padding-right">2mm</xsl:attribute>
3335
3365
  <xsl:apply-templates select="ancestor::bipm:term[1]/bipm:name" mode="presentation"/>
3336
3366
  </fo:inline>
@@ -3908,7 +3938,11 @@
3908
3938
  <xsl:template name="insertHeaderFooter">
3909
3939
  <xsl:param name="header-title"/>
3910
3940
  <xsl:param name="orientation"/>
3941
+ <xsl:param name="isDraft"/>
3911
3942
  <fo:static-content flow-name="header-odd" role="artifact">
3943
+ <xsl:call-template name="insertDraftWatermark">
3944
+ <xsl:with-param name="isDraft" select="$isDraft"/>
3945
+ </xsl:call-template>
3912
3946
  <fo:block-container font-family="Arial" font-size="8pt" padding-top="12.5mm">
3913
3947
  <fo:block text-align="right">
3914
3948
  <xsl:copy-of select="$header-title"/>
@@ -3929,6 +3963,9 @@
3929
3963
  </fo:block-container>
3930
3964
  </fo:static-content>
3931
3965
  <fo:static-content flow-name="header-even" role="artifact">
3966
+ <xsl:call-template name="insertDraftWatermark">
3967
+ <xsl:with-param name="isDraft" select="$isDraft"/>
3968
+ </xsl:call-template>
3932
3969
  <fo:block-container font-family="Arial" font-size="8pt" padding-top="12.5mm">
3933
3970
  <fo:block>
3934
3971
  <fo:inline font-weight="bold"><fo:page-number/></fo:inline>
@@ -3944,7 +3981,74 @@
3944
3981
  <fo:block> </fo:block>
3945
3982
  </fo:block-container>
3946
3983
  </fo:block-container>
3947
- </fo:static-content>
3984
+ </fo:static-content>
3985
+ <fo:static-content flow-name="header-blank" role="artifact">
3986
+ <xsl:call-template name="insertDraftWatermark">
3987
+ <xsl:with-param name="isDraft" select="$isDraft"/>
3988
+ </xsl:call-template>
3989
+ <fo:block/>
3990
+ </fo:static-content>
3991
+ </xsl:template>
3992
+
3993
+ <xsl:template name="insertDraftWatermark">
3994
+ <xsl:param name="isDraft"/>
3995
+ <xsl:if test="$isDraft = 'true' or normalize-space(//bipm:bipm-standard/bipm:bibdata/bipm:version/bipm:draft or contains(//bipm:bipm-standard/bipm:bibdata/bipm:status/bipm:stage, 'draft') or contains(//bipm:bipm-standard/bipm:bibdata/bipm:status/bipm:stage, 'projet')) = 'true'">
3996
+ <!-- DRAFT -->
3997
+ <xsl:variable name="draft_label">
3998
+ <xsl:call-template name="getLocalizedString">
3999
+ <xsl:with-param name="key">draft_label</xsl:with-param>
4000
+ </xsl:call-template>
4001
+ </xsl:variable>
4002
+ <fo:block-container absolute-position="fixed" left="0mm" top="30mm">
4003
+ <fo:block line-height="0">
4004
+ <fo:instream-foreign-object fox:alt-text="DRAFT">
4005
+ <svg:svg xmlns:svg="http://www.w3.org/2000/svg" width="200mm" height="250mm">
4006
+ <svg:g transform="rotate(-45) scale(0.6, 1)">
4007
+ <xsl:variable name="font-size">
4008
+ <xsl:choose>
4009
+ <xsl:when test="string-length($draft_label) &gt; 5">150</xsl:when>
4010
+ <xsl:otherwise>260</xsl:otherwise>
4011
+ </xsl:choose>
4012
+ </xsl:variable>
4013
+ <svg:text x="-175mm" y="205mm" style="font-family:Arial;font-size:{$font-size}pt;font-weight:normal;fill:rgb(223, 223, 223);">
4014
+ <xsl:if test="string-length($draft_label) &gt; 5">
4015
+ <xsl:attribute name="x">-175mm</xsl:attribute>
4016
+ <xsl:attribute name="y">180mm</xsl:attribute>
4017
+ </xsl:if>
4018
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($draft_label))"/>
4019
+ </svg:text>
4020
+ </svg:g>
4021
+ </svg:svg>
4022
+ </fo:instream-foreign-object>
4023
+ </fo:block>
4024
+ </fo:block-container>
4025
+ </xsl:if>
4026
+ </xsl:template>
4027
+
4028
+ <xsl:template name="insertHeaderDraftWatermark">
4029
+ <xsl:variable name="isDraft" select="normalize-space(//bipm:bipm-standard/bipm:bibdata/bipm:version/bipm:draft or contains(//bipm:bipm-standard/bipm:bibdata/bipm:status/bipm:stage, 'draft') or contains(//bipm:bipm-standard/bipm:bibdata/bipm:status/bipm:stage, 'projet'))"/>
4030
+ <xsl:if test="$isDraft = 'true'">
4031
+ <fo:static-content flow-name="header-blank" role="artifact">
4032
+ <xsl:call-template name="insertDraftWatermark">
4033
+ <xsl:with-param name="isDraft" select="$isDraft"/>
4034
+ </xsl:call-template>
4035
+ </fo:static-content>
4036
+ <fo:static-content flow-name="header" role="artifact">
4037
+ <xsl:call-template name="insertDraftWatermark">
4038
+ <xsl:with-param name="isDraft" select="$isDraft"/>
4039
+ </xsl:call-template>
4040
+ </fo:static-content>
4041
+ <fo:static-content flow-name="header-odd" role="artifact">
4042
+ <xsl:call-template name="insertDraftWatermark">
4043
+ <xsl:with-param name="isDraft" select="$isDraft"/>
4044
+ </xsl:call-template>
4045
+ </fo:static-content>
4046
+ <fo:static-content flow-name="header-even" role="artifact">
4047
+ <xsl:call-template name="insertDraftWatermark">
4048
+ <xsl:with-param name="isDraft" select="$isDraft"/>
4049
+ </xsl:call-template>
4050
+ </fo:static-content>
4051
+ </xsl:if>
3948
4052
  </xsl:template>
3949
4053
 
3950
4054
  <!-- <xsl:template name="insertHeaderFooterAppendix">
@@ -4089,6 +4193,7 @@
4089
4193
  <!-- <xsl:template match="bipm:clause[@type = 'index']" mode="index"> -->
4090
4194
  <xsl:template match="bipm:indexsect"/>
4091
4195
  <xsl:template match="bipm:indexsect" mode="index">
4196
+ <xsl:param name="isDraft"/>
4092
4197
 
4093
4198
  <fo:page-sequence master-reference="index" force-page-count="no-force">
4094
4199
  <xsl:variable name="header-title">
@@ -4103,6 +4208,7 @@
4103
4208
  </xsl:variable>
4104
4209
  <xsl:call-template name="insertHeaderFooter">
4105
4210
  <xsl:with-param name="header-title" select="$header-title"/>
4211
+ <xsl:with-param name="isDraft" select="$isDraft"/>
4106
4212
  </xsl:call-template>
4107
4213
 
4108
4214
  <fo:flow flow-name="xsl-region-body">
@@ -5079,6 +5185,80 @@
5079
5185
 
5080
5186
  </xsl:attribute-set><xsl:attribute-set name="toc-style">
5081
5187
  <xsl:attribute name="line-height">135%</xsl:attribute>
5188
+ </xsl:attribute-set><xsl:attribute-set name="fn-style">
5189
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
5190
+ </xsl:attribute-set><xsl:attribute-set name="fn-num-style">
5191
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
5192
+
5193
+ <xsl:attribute name="font-size">65%</xsl:attribute>
5194
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
5195
+
5196
+
5197
+
5198
+
5199
+
5200
+
5201
+
5202
+
5203
+
5204
+
5205
+
5206
+
5207
+
5208
+
5209
+
5210
+
5211
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-style">
5212
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
5213
+ <xsl:attribute name="font-style">normal</xsl:attribute>
5214
+ <xsl:attribute name="text-indent">0</xsl:attribute>
5215
+ <xsl:attribute name="start-indent">0</xsl:attribute>
5216
+
5217
+
5218
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
5219
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
5220
+ <xsl:attribute name="line-height">124%</xsl:attribute>
5221
+ <xsl:attribute name="text-align">justify</xsl:attribute>
5222
+
5223
+
5224
+
5225
+
5226
+
5227
+
5228
+
5229
+
5230
+
5231
+
5232
+
5233
+
5234
+
5235
+
5236
+
5237
+
5238
+
5239
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
5240
+ <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
5241
+
5242
+ <xsl:attribute name="font-size">60%</xsl:attribute>
5243
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
5244
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
5245
+
5246
+
5247
+
5248
+
5249
+
5250
+
5251
+
5252
+
5253
+
5254
+
5255
+
5256
+
5257
+
5258
+
5259
+
5260
+
5261
+
5082
5262
  </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
5083
5263
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
5084
5264
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
@@ -5104,7 +5284,8 @@
5104
5284
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
5105
5285
 
5106
5286
  </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
5107
- <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
5287
+
5288
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
5108
5289
  <xsl:sort select="@displayorder" data-type="number"/>
5109
5290
  <xsl:apply-templates select="." mode="contents"/>
5110
5291
  </xsl:for-each>
@@ -5114,7 +5295,7 @@
5114
5295
  <xsl:apply-templates select="." mode="contents"/>
5115
5296
  </xsl:for-each>
5116
5297
 
5117
- <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
5298
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true') and not(*[local-name()='references'][@normative='true'])] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
5118
5299
  <xsl:sort select="@displayorder" data-type="number"/>
5119
5300
  <xsl:apply-templates select="." mode="contents"/>
5120
5301
  </xsl:for-each>
@@ -6116,6 +6297,102 @@
6116
6297
 
6117
6298
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
6118
6299
  <xsl:apply-templates/>
6300
+ </xsl:template><xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn">
6301
+
6302
+ <!-- list of footnotes to calculate actual footnotes number -->
6303
+ <xsl:variable name="p_fn_">
6304
+ <xsl:choose>
6305
+ <xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
6306
+ <fn gen_id="{generate-id(.)}">
6307
+ <xsl:copy-of select="@*"/>
6308
+ <xsl:copy-of select="node()"/>
6309
+ </fn>
6310
+ </xsl:when>
6311
+ <xsl:otherwise>
6312
+ <!-- itetation for:
6313
+ footnotes in bibdata/title
6314
+ footnotes in bibliography
6315
+ footnotes in document's body (except table's head/body/foot and figure text)
6316
+ -->
6317
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
6318
+ <fn gen_id="{generate-id(.)}">
6319
+ <xsl:copy-of select="@*"/>
6320
+ <xsl:copy-of select="node()"/>
6321
+ </fn>
6322
+ </xsl:for-each>
6323
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
6324
+ <xsl:sort select="@displayorder" data-type="number"/>
6325
+ <xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
6326
+ <!-- copy unique fn -->
6327
+ <fn gen_id="{generate-id(.)}">
6328
+ <xsl:copy-of select="@*"/>
6329
+ <xsl:copy-of select="node()"/>
6330
+ </fn>
6331
+ </xsl:for-each>
6332
+ </xsl:for-each>
6333
+ </xsl:otherwise>
6334
+ </xsl:choose>
6335
+ </xsl:variable>
6336
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
6337
+
6338
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
6339
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
6340
+ <xsl:variable name="reference" select="@reference"/>
6341
+ <!-- fn sequence number in document -->
6342
+ <xsl:variable name="current_fn_number">
6343
+ <xsl:choose>
6344
+ <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
6345
+ <xsl:otherwise>
6346
+ <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
6347
+ </xsl:otherwise>
6348
+ </xsl:choose>
6349
+ </xsl:variable>
6350
+ <xsl:variable name="current_fn_number_text">
6351
+ <xsl:value-of select="$current_fn_number"/>
6352
+
6353
+
6354
+ </xsl:variable>
6355
+
6356
+ <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
6357
+ <xsl:variable name="footnote_inline">
6358
+ <fo:inline xsl:use-attribute-sets="fn-num-style">
6359
+
6360
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
6361
+ <xsl:value-of select="$current_fn_number_text"/>
6362
+ </fo:basic-link>
6363
+ </fo:inline>
6364
+ </xsl:variable>
6365
+ <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
6366
+ gen_id=<xsl:value-of select="$gen_id"/> -->
6367
+ <xsl:choose>
6368
+ <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
6369
+ <xsl:copy-of select="$footnote_inline"/>
6370
+ </xsl:when>
6371
+ <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
6372
+ <fo:footnote xsl:use-attribute-sets="fn-style">
6373
+ <xsl:copy-of select="$footnote_inline"/>
6374
+ <fo:footnote-body>
6375
+
6376
+ <fo:block-container text-indent="0" start-indent="0">
6377
+
6378
+
6379
+ <fo:block xsl:use-attribute-sets="fn-body-style">
6380
+
6381
+
6382
+ <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
6383
+
6384
+ <xsl:value-of select="$current_fn_number_text"/>
6385
+ </fo:inline>
6386
+ <xsl:apply-templates/>
6387
+ </fo:block>
6388
+ </fo:block-container>
6389
+ </fo:footnote-body>
6390
+ </fo:footnote>
6391
+ </xsl:when>
6392
+ <xsl:otherwise>
6393
+ <xsl:copy-of select="$footnote_inline"/>
6394
+ </xsl:otherwise>
6395
+ </xsl:choose>
6119
6396
  </xsl:template><xsl:template name="fn_display">
6120
6397
  <xsl:variable name="references">
6121
6398
 
@@ -6326,6 +6603,8 @@
6326
6603
 
6327
6604
  </fo:basic-link>
6328
6605
  </fo:inline>
6606
+ </xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
6607
+ <fo:inline><xsl:value-of select="."/></fo:inline>
6329
6608
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
6330
6609
  <fo:inline>
6331
6610
  <xsl:apply-templates/>
@@ -6690,6 +6969,7 @@
6690
6969
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
6691
6970
  <xsl:apply-templates/>
6692
6971
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
6972
+ <xsl:apply-templates select="@language"/>
6693
6973
  <xsl:apply-templates/>
6694
6974
  </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
6695
6975
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
@@ -7351,22 +7631,6 @@
7351
7631
  <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
7352
7632
  <xsl:apply-templates/>
7353
7633
  </fo:inline>
7354
- </xsl:template><xsl:template match="*[local-name() = 'modification']">
7355
- <xsl:variable name="title-modified">
7356
-
7357
-
7358
- <xsl:call-template name="getTitle">
7359
- <xsl:with-param name="name" select="'title-modified'"/>
7360
- </xsl:call-template>
7361
-
7362
- </xsl:variable>
7363
-
7364
- <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
7365
- <xsl:choose>
7366
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
7367
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
7368
- </xsl:choose>
7369
- <xsl:apply-templates/>
7370
7634
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
7371
7635
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
7372
7636
 
@@ -7951,12 +8215,12 @@
7951
8215
  </xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
7952
8216
  <xsl:apply-templates mode="contents"/>
7953
8217
  <xsl:text> </xsl:text>
7954
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
8218
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks">
7955
8219
  <xsl:apply-templates mode="bookmarks"/>
7956
8220
  <xsl:text> </xsl:text>
7957
8221
  </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
7958
8222
  <xsl:value-of select="."/>
7959
- </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
8223
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
7960
8224
  <xsl:value-of select="."/>
7961
8225
  </xsl:template><xsl:template match="node()" mode="contents">
7962
8226
  <xsl:apply-templates mode="contents"/>
@@ -8240,6 +8504,8 @@
8240
8504
 
8241
8505
 
8242
8506
 
8507
+
8508
+
8243
8509
  <fo:block xsl:use-attribute-sets="sourcecode-style">
8244
8510
  <xsl:variable name="_font-size">
8245
8511
 
@@ -8273,13 +8539,17 @@
8273
8539
 
8274
8540
 
8275
8541
 
8542
+
8543
+
8276
8544
  <xsl:apply-templates/>
8277
8545
  </fo:block>
8278
-
8546
+
8279
8547
 
8280
8548
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
8281
8549
 
8282
8550
 
8551
+
8552
+
8283
8553
  </fo:block-container>
8284
8554
  </fo:block-container>
8285
8555
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
@@ -8626,60 +8896,69 @@
8626
8896
  <xsl:variable name="termsource_text">
8627
8897
  <xsl:apply-templates/>
8628
8898
  </xsl:variable>
8629
-
8630
- <xsl:choose>
8899
+ <xsl:copy-of select="$termsource_text"/>
8900
+ <!-- <xsl:choose>
8631
8901
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
8632
- <!-- <xsl:apply-templates /> -->
8633
8902
  <xsl:copy-of select="$termsource_text"/>
8634
8903
  </xsl:when>
8635
8904
  <xsl:otherwise>
8636
-
8637
-
8905
+ <xsl:if test="$namespace = 'bsi'">
8906
+ <xsl:choose>
8907
+ <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when>
8908
+ <xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise>
8909
+ </xsl:choose>
8910
+ </xsl:if>
8911
+ <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
8638
8912
  <xsl:text>[</xsl:text>
8639
-
8640
- <!-- <xsl:apply-templates /> -->
8913
+ </xsl:if>
8641
8914
  <xsl:copy-of select="$termsource_text"/>
8642
-
8643
-
8915
+ <xsl:if test="$namespace = 'bsi'">
8916
+ <xsl:choose>
8917
+ <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when>
8918
+ <xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise>
8919
+ </xsl:choose>
8920
+ </xsl:if>
8921
+ <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
8644
8922
  <xsl:text>]</xsl:text>
8645
-
8923
+ </xsl:if>
8646
8924
  </xsl:otherwise>
8647
- </xsl:choose>
8925
+ </xsl:choose> -->
8648
8926
  </fo:block>
8649
8927
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
8650
8928
  <xsl:if test="normalize-space() != ''">
8651
8929
  <xsl:value-of select="."/>
8652
8930
  </xsl:if>
8653
- </xsl:template><xsl:variable name="localized.source">
8654
- <xsl:call-template name="getLocalizedString">
8655
- <xsl:with-param name="key">source</xsl:with-param>
8656
- </xsl:call-template>
8657
- </xsl:variable><xsl:template match="*[local-name() = 'origin']">
8931
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
8932
+ <fo:inline>
8933
+
8934
+
8935
+ <xsl:value-of select="."/>
8936
+ </fo:inline>
8937
+ </xsl:template><xsl:template match="*[local-name() = 'origin']">
8658
8938
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8659
8939
  <xsl:if test="normalize-space(@citeas) = ''">
8660
8940
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
8661
8941
  </xsl:if>
8662
-
8663
-
8664
- <fo:inline>
8665
-
8666
-
8667
-
8668
-
8669
-
8670
-
8671
- <xsl:value-of select="$localized.source"/>
8672
- <xsl:text> </xsl:text>
8673
-
8674
-
8675
-
8676
- </fo:inline>
8677
-
8678
8942
  <fo:inline xsl:use-attribute-sets="origin-style">
8679
8943
  <xsl:apply-templates/>
8680
8944
  </fo:inline>
8945
+ </fo:basic-link>
8946
+ </xsl:template><xsl:template match="*[local-name() = 'modification']">
8947
+ <xsl:variable name="title-modified">
8681
8948
 
8682
- </fo:basic-link>
8949
+
8950
+ <xsl:call-template name="getTitle">
8951
+ <xsl:with-param name="name" select="'title-modified'"/>
8952
+ </xsl:call-template>
8953
+
8954
+ </xsl:variable>
8955
+
8956
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
8957
+ <xsl:choose>
8958
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
8959
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
8960
+ </xsl:choose>
8961
+ <xsl:apply-templates/>
8683
8962
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
8684
8963
  <fo:inline><xsl:apply-templates/></fo:inline>
8685
8964
  </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
@@ -8870,24 +9149,29 @@
8870
9149
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
8871
9150
  <xsl:variable name="title-deprecated">
8872
9151
 
8873
-
8874
- <xsl:call-template name="getTitle">
8875
- <xsl:with-param name="name" select="'title-deprecated'"/>
9152
+ <xsl:call-template name="getLocalizedString">
9153
+ <xsl:with-param name="key">deprecated</xsl:with-param>
8876
9154
  </xsl:call-template>
8877
9155
 
9156
+
8878
9157
  </xsl:variable>
8879
9158
  <fo:block xsl:use-attribute-sets="deprecates-style">
8880
9159
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
8881
9160
  </fo:block>
9161
+ </xsl:template><xsl:template name="setStyle_preferred">
9162
+ <xsl:if test="*[local-name() = 'strong']">
9163
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
9164
+ </xsl:if>
8882
9165
  </xsl:template><xsl:template match="*[local-name() = 'definition']">
8883
9166
  <fo:block xsl:use-attribute-sets="definition-style">
8884
9167
  <xsl:apply-templates/>
8885
9168
  </fo:block>
8886
9169
  </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
8887
9170
  <xsl:apply-templates/>
8888
- </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
9171
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
8889
9172
  <fo:inline> <xsl:apply-templates/></fo:inline>
8890
- <fo:block> </fo:block>
9173
+ <!-- <fo:block>&#xA0;</fo:block> -->
9174
+ <fo:block/>
8891
9175
  </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
8892
9176
 
8893
9177
  <fo:block>
@@ -8945,6 +9229,53 @@
8945
9229
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
8946
9230
  <!-- 0xA0 to space replacement -->
8947
9231
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
9232
+ </xsl:template><xsl:variable name="ul_labels_">
9233
+
9234
+ <label level="1" font-size="15pt">•</label>
9235
+ <label level="2">−</label><!-- &#x2212; - minus sign. &#x2014; - en dash -->
9236
+ <label level="3" font-size="75%">o</label> <!-- white circle -->
9237
+
9238
+
9239
+
9240
+
9241
+
9242
+
9243
+
9244
+
9245
+
9246
+
9247
+
9248
+
9249
+
9250
+
9251
+
9252
+
9253
+
9254
+ </xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
9255
+ <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
9256
+ <xsl:variable name="list_level">
9257
+ <xsl:choose>
9258
+ <xsl:when test="$list_level_ &lt;= 3"><xsl:value-of select="$list_level_"/></xsl:when>
9259
+ <xsl:otherwise><xsl:value-of select="$list_level_ mod 3"/></xsl:otherwise>
9260
+ </xsl:choose>
9261
+ </xsl:variable>
9262
+ <xsl:choose>
9263
+ <xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels -->
9264
+ <xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/>
9265
+ </xsl:when>
9266
+ <xsl:when test="$list_level mod 3 = 0">
9267
+ <xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/>
9268
+ </xsl:when>
9269
+ <xsl:when test="$list_level mod 2 = 0">
9270
+ <xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/>
9271
+ </xsl:when>
9272
+ <xsl:otherwise>
9273
+ <xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
9274
+ </xsl:otherwise>
9275
+ </xsl:choose>
9276
+ </xsl:template><xsl:template match="label" mode="ul_labels">
9277
+ <xsl:copy-of select="@*[not(local-name() = 'level')]"/>
9278
+ <xsl:value-of select="."/>
8948
9279
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
8949
9280
  <xsl:choose>
8950
9281
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
@@ -9314,7 +9645,31 @@
9314
9645
  <fo:block-container border="1pt solid black" width="50%">
9315
9646
  <fo:block> </fo:block>
9316
9647
  </fo:block-container>
9317
- </xsl:template><xsl:template match="*[local-name() = 'toc']">
9648
+ </xsl:template><xsl:variable name="toc_level">
9649
+ <xsl:choose>
9650
+ <xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
9651
+ <xsl:otherwise><!-- default value -->
9652
+ 3
9653
+
9654
+
9655
+
9656
+
9657
+
9658
+
9659
+
9660
+
9661
+
9662
+
9663
+
9664
+
9665
+
9666
+
9667
+
9668
+
9669
+
9670
+ </xsl:otherwise>
9671
+ </xsl:choose>
9672
+ </xsl:variable><xsl:template match="*[local-name() = 'toc']">
9318
9673
  <xsl:param name="colwidths"/>
9319
9674
  <xsl:variable name="colwidths_">
9320
9675
  <xsl:choose>
@@ -9405,6 +9760,10 @@
9405
9760
  </svg>
9406
9761
  </fo:instream-foreign-object>
9407
9762
  </fo:inline>
9763
+ </xsl:template><xsl:template match="@language">
9764
+ <xsl:copy-of select="."/>
9765
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="4">
9766
+ <xsl:call-template name="title"/>
9408
9767
  </xsl:template><xsl:template name="convertDate">
9409
9768
  <xsl:param name="date"/>
9410
9769
  <xsl:param name="format" select="'short'"/>
@@ -9849,12 +10208,15 @@
9849
10208
  <xsl:param name="default">left</xsl:param>
9850
10209
  <xsl:attribute name="text-align">
9851
10210
  <xsl:choose>
9852
- <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
10211
+ <xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
9853
10212
  <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
9854
10213
  <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
9855
10214
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
9856
10215
  </xsl:choose>
9857
10216
  </xsl:attribute>
10217
+ <xsl:if test="@align = 'indent'">
10218
+ <xsl:attribute name="margin-left">7mm</xsl:attribute>
10219
+ </xsl:if>
9858
10220
  </xsl:template><xsl:template name="number-to-words">
9859
10221
  <xsl:param name="number"/>
9860
10222
  <xsl:param name="first"/>
@@ -9951,4 +10313,14 @@
9951
10313
  </xsl:otherwise>
9952
10314
  </xsl:choose>
9953
10315
  </xsl:if>
10316
+ </xsl:template><xsl:template name="setAltText">
10317
+ <xsl:param name="value"/>
10318
+ <xsl:attribute name="fox:alt-text">
10319
+ <xsl:choose>
10320
+ <xsl:when test="normalize-space($value) != ''">
10321
+ <xsl:value-of select="$value"/>
10322
+ </xsl:when>
10323
+ <xsl:otherwise>_</xsl:otherwise>
10324
+ </xsl:choose>
10325
+ </xsl:attribute>
9954
10326
  </xsl:template></xsl:stylesheet>