metanorma-bipm 2.7.6 → 2.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -366,69 +366,78 @@
366
366
  <!-- Index -->
367
367
  <xsl:apply-templates select="xalan:nodeset($indexes)/doc//mn:indexsect" mode="index"/>
368
368
 
369
+ <xsl:call-template name="back-page"/>
370
+
369
371
  </fo:root>
370
372
  </xsl:template>
371
373
 
372
374
  <xsl:template name="cover-page">
373
- <fo:page-sequence master-reference="cover-page" font-family="Arial" font-size="10.5pt" force-page-count="no-force">
374
- <fo:static-content flow-name="cover-page-footer" font-size="10pt">
375
- <fo:block font-size="10pt" border-bottom="0.5pt solid black" padding-bottom="2.5mm" margin-left="-1mm" space-after="4mm">
376
- <!-- Example: First edition July 2009 -->
377
- <xsl:call-template name="printEdition"/>
378
- <xsl:text>   </xsl:text>
379
- <xsl:call-template name="convertDate">
380
- <xsl:with-param name="date" select="(//mn:metanorma)[1]/mn:bibdata/mn:date[@type = 'published']/mn:on"/>
381
- </xsl:call-template>
382
- </fo:block>
383
- <!-- Example © JCGM 2009 -->
384
- <fo:block font-size="11pt">
385
- <fo:inline font-family="Times New Roman" font-size="12pt"><xsl:text>© </xsl:text></fo:inline>
386
- <!-- <xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:ext/mn:editorialgroup/mn:committee/@acronym"/> -->
387
- <xsl:value-of select="$committee_acronym"/>
388
- <xsl:text> </xsl:text>
389
- <xsl:value-of select="$copyright_year"/>
390
- </fo:block>
391
- </fo:static-content>
392
- <fo:flow flow-name="xsl-region-body">
393
- <xsl:call-template name="insert_Logo-BIPM-Metro"/>
394
- <xsl:call-template name="insertDraftWatermark"/>
395
- <fo:block-container font-weight="bold">
396
- <fo:block font-size="16.5pt">
397
- <!-- <xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:ext/mn:editorialgroup/mn:committee/@acronym"/> -->
398
- <xsl:value-of select="$committee_acronym"/>
399
- <xsl:text> </xsl:text>
400
- <xsl:value-of select="$docnumber"/>
401
- <fo:inline font-weight="normal">:</fo:inline>
402
- <xsl:value-of select="$copyright_year"/>
403
- </fo:block>
404
- <fo:block font-size="13pt" font-weight="normal" space-after="19.5mm">
405
- <xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:title[@type = 'title-provenance']"/>
406
- </fo:block>
407
- <fo:block border-bottom="1pt solid black"> </fo:block>
408
- <fo:block font-size="16.5pt" margin-left="-0.5mm" padding-top="3.5mm" space-after="7mm" margin-right="7mm" line-height="105%" role="H1">
409
- <xsl:apply-templates select="(//mn:metanorma)[1]/mn:bibdata/mn:title[@language = $lang and @type = 'title-main']" mode="title"/>
410
- <xsl:variable name="title_part">
411
- <xsl:apply-templates select="(//mn:metanorma)[1]/mn:bibdata/mn:title[@language = $lang and @type = 'title-part']" mode="title"/>
412
- </xsl:variable>
413
- <xsl:if test="normalize-space($title_part) != ''">
414
- <xsl:text> </xsl:text>
415
- <xsl:copy-of select="$title_part"/>
416
- </xsl:if>
417
- </fo:block>
418
- <fo:block font-size="12pt" font-style="italic" line-height="140%" role="H1">
419
- <xsl:variable name="secondLang" select="(//mn:metanorma)[1]/mn:bibdata/mn:title/@language[. != $lang]"/>
420
- <xsl:apply-templates select="(//mn:metanorma)[1]/mn:bibdata/mn:title[@language = $secondLang and @type = 'title-main']" mode="title"/>
421
- <xsl:variable name="title_part">
422
- <xsl:apply-templates select="(//mn:metanorma)[1]/mn:bibdata/mn:title[@language = $secondLang and @type = 'title-part']" mode="title"/>
423
- </xsl:variable>
424
- <xsl:if test="normalize-space($title_part) != ''">
425
- <xsl:text> </xsl:text>
426
- <xsl:copy-of select="$title_part"/>
427
- </xsl:if>
428
- </fo:block>
429
- </fo:block-container>
430
- </fo:flow>
431
- </fo:page-sequence>
375
+ <xsl:choose>
376
+ <xsl:when test="(//mn:metanorma)[1]/mn:metanorma-extension/mn:presentation-metadata[mn:name = 'coverpage-image']/mn:value/mn:image and normalize-space((//mn:metanorma)[1]/mn:metanorma-extension/mn:presentation-metadata/mn:full-coverpage-replacement) = 'true'">
377
+ <xsl:call-template name="insertCoverPageFullImage"/>
378
+ </xsl:when>
379
+ <xsl:otherwise>
380
+ <fo:page-sequence master-reference="cover-page" font-family="Arial" font-size="10.5pt" force-page-count="no-force">
381
+ <fo:static-content flow-name="cover-page-footer" font-size="10pt">
382
+ <fo:block font-size="10pt" border-bottom="0.5pt solid black" padding-bottom="2.5mm" margin-left="-1mm" space-after="4mm">
383
+ <!-- Example: First edition July 2009 -->
384
+ <xsl:call-template name="printEdition"/>
385
+ <xsl:text>   </xsl:text>
386
+ <xsl:call-template name="convertDate">
387
+ <xsl:with-param name="date" select="(//mn:metanorma)[1]/mn:bibdata/mn:date[@type = 'published']/mn:on"/>
388
+ </xsl:call-template>
389
+ </fo:block>
390
+ <!-- Example © JCGM 2009 -->
391
+ <fo:block font-size="11pt">
392
+ <fo:inline font-family="Times New Roman" font-size="12pt"><xsl:text>© </xsl:text></fo:inline>
393
+ <!-- <xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:ext/mn:editorialgroup/mn:committee/@acronym"/> -->
394
+ <xsl:value-of select="$committee_acronym"/>
395
+ <xsl:text> </xsl:text>
396
+ <xsl:value-of select="$copyright_year"/>
397
+ </fo:block>
398
+ </fo:static-content>
399
+ <fo:flow flow-name="xsl-region-body">
400
+ <xsl:call-template name="insert_Logo-BIPM-Metro"/>
401
+ <xsl:call-template name="insertDraftWatermark"/>
402
+ <fo:block-container font-weight="bold">
403
+ <fo:block font-size="16.5pt">
404
+ <!-- <xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:ext/mn:editorialgroup/mn:committee/@acronym"/> -->
405
+ <xsl:value-of select="$committee_acronym"/>
406
+ <xsl:text> </xsl:text>
407
+ <xsl:value-of select="$docnumber"/>
408
+ <fo:inline font-weight="normal">:</fo:inline>
409
+ <xsl:value-of select="$copyright_year"/>
410
+ </fo:block>
411
+ <fo:block font-size="13pt" font-weight="normal" space-after="19.5mm">
412
+ <xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:title[@type = 'title-provenance']"/>
413
+ </fo:block>
414
+ <fo:block border-bottom="1pt solid black"> </fo:block>
415
+ <fo:block font-size="16.5pt" margin-left="-0.5mm" padding-top="3.5mm" space-after="7mm" margin-right="7mm" line-height="105%" role="H1">
416
+ <xsl:apply-templates select="(//mn:metanorma)[1]/mn:bibdata/mn:title[@language = $lang and @type = 'title-main']" mode="title"/>
417
+ <xsl:variable name="title_part">
418
+ <xsl:apply-templates select="(//mn:metanorma)[1]/mn:bibdata/mn:title[@language = $lang and @type = 'title-part']" mode="title"/>
419
+ </xsl:variable>
420
+ <xsl:if test="normalize-space($title_part) != ''">
421
+ <xsl:text> </xsl:text>
422
+ <xsl:copy-of select="$title_part"/>
423
+ </xsl:if>
424
+ </fo:block>
425
+ <fo:block font-size="12pt" font-style="italic" line-height="140%" role="H1">
426
+ <xsl:variable name="secondLang" select="(//mn:metanorma)[1]/mn:bibdata/mn:title/@language[. != $lang]"/>
427
+ <xsl:apply-templates select="(//mn:metanorma)[1]/mn:bibdata/mn:title[@language = $secondLang and @type = 'title-main']" mode="title"/>
428
+ <xsl:variable name="title_part">
429
+ <xsl:apply-templates select="(//mn:metanorma)[1]/mn:bibdata/mn:title[@language = $secondLang and @type = 'title-part']" mode="title"/>
430
+ </xsl:variable>
431
+ <xsl:if test="normalize-space($title_part) != ''">
432
+ <xsl:text> — </xsl:text>
433
+ <xsl:copy-of select="$title_part"/>
434
+ </xsl:if>
435
+ </fo:block>
436
+ </fo:block-container>
437
+ </fo:flow>
438
+ </fo:page-sequence>
439
+ </xsl:otherwise>
440
+ </xsl:choose>
432
441
  </xsl:template> <!-- END: cover-page -->
433
442
 
434
443
  <xsl:template name="inner-cover-page">
@@ -484,6 +493,9 @@
484
493
  </fo:page-sequence>
485
494
  </xsl:template> <!-- END: inner-cover-page -->
486
495
 
496
+ <xsl:template name="back-page">
497
+ </xsl:template>
498
+
487
499
  <xsl:template name="processPrefaceAndMainSectionsJCGM_items">
488
500
 
489
501
  <xsl:variable name="updated_xml_step_move_pagebreak">
@@ -788,18 +800,16 @@
788
800
  <xsl:otherwise>fo:block</xsl:otherwise>
789
801
  </xsl:choose>
790
802
  </xsl:variable>
791
- <xsl:element name="{$element-name}">
792
803
 
793
- <xsl:call-template name="setBlockAttributes">
794
- <xsl:with-param name="text_align_default">justify</xsl:with-param>
795
- </xsl:call-template>
804
+ <xsl:variable name="p_styles">
805
+ <styles xsl:use-attribute-sets="p-style">
806
+ <xsl:call-template name="refine_p-style"><xsl:with-param name="element-name" select="$element-name"/></xsl:call-template>
807
+ </styles>
808
+ </xsl:variable>
809
+
810
+ <xsl:element name="{$element-name}">
811
+ <xsl:copy-of select="xalan:nodeset($p_styles)/styles/@*"/>
796
812
 
797
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
798
- <xsl:if test="ancestor::*[@first or @slave]">
799
- <!-- JCGM two column layout -->
800
- <xsl:attribute name="widows">1</xsl:attribute>
801
- <xsl:attribute name="orphans">1</xsl:attribute>
802
- </xsl:if>
803
813
  <xsl:apply-templates>
804
814
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
805
815
  </xsl:apply-templates>
@@ -844,12 +854,12 @@
844
854
  <xsl:variable name="levelTerm">
845
855
  <xsl:call-template name="getLevelTermName"/>
846
856
  </xsl:variable>
847
- <fo:block role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
848
- <fo:block xsl:use-attribute-sets="term-name-style">
857
+ <fo:block role="H{$levelTerm}" xsl:use-attribute-sets="term-preferred-block-style">
858
+ <fo:block xsl:use-attribute-sets="term-number-style">
849
859
  <xsl:apply-templates select="preceding-sibling::mn:term_name[1]" mode="presentation"/>
850
860
  </fo:block>
851
- <fo:block xsl:use-attribute-sets="preferred-term-style">
852
- <xsl:call-template name="refine_preferred-term-style"/>
861
+ <fo:block xsl:use-attribute-sets="term-preferred-style">
862
+ <xsl:call-template name="refine_term-preferred-style"/>
853
863
  <xsl:apply-templates/>
854
864
  </fo:block>
855
865
  </fo:block>
@@ -865,8 +875,8 @@
865
875
  </xsl:template>
866
876
 
867
877
  <xsl:template match="mn:domain[not(parent::mn:term)]" priority="2">
868
- <fo:block xsl:use-attribute-sets="domain-style">
869
- <xsl:call-template name="refine_domain-style"/>
878
+ <fo:block xsl:use-attribute-sets="term-domain-style">
879
+ <xsl:call-template name="refine_term-domain-style"/>
870
880
  <fo:inline>
871
881
  <xsl:text>&lt;</xsl:text>
872
882
  <xsl:apply-templates/>
@@ -1034,6 +1044,14 @@
1034
1044
 
1035
1045
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
1036
1046
 
1047
+ <xsl:call-template name="insertHeader">
1048
+ <xsl:with-param name="isDraft" select="$isDraft"/>
1049
+ </xsl:call-template>
1050
+ <xsl:call-template name="insertFooter"/>
1051
+ </xsl:template>
1052
+
1053
+ <xsl:template name="insertHeader">
1054
+ <xsl:param name="isDraft"/>
1037
1055
  <fo:static-content flow-name="header-even-jcgm" role="artifact">
1038
1056
  <xsl:call-template name="insertDraftWatermark">
1039
1057
  <xsl:with-param name="isDraft" select="$isDraft"/>
@@ -1044,24 +1062,33 @@
1044
1062
  </fo:block>
1045
1063
  </fo:block-container>
1046
1064
  </fo:static-content>
1047
- <fo:static-content flow-name="footer-even-jcgm" role="artifact">
1065
+ <fo:static-content flow-name="header-odd-jcgm" role="artifact">
1066
+ <xsl:call-template name="insertDraftWatermark">
1067
+ <xsl:with-param name="isDraft" select="$isDraft"/>
1068
+ </xsl:call-template>
1048
1069
  <fo:block-container height="98%">
1049
- <fo:block text-align-last="justify">
1050
- <fo:inline font-size="12pt" font-weight="bold"><fo:page-number/></fo:inline>
1051
- <fo:inline keep-together.within-line="always">
1052
- <fo:leader leader-pattern="space"/>
1053
- <fo:inline font-size="10pt"><xsl:value-of select="$copyrightText"/></fo:inline>
1054
- </fo:inline>
1070
+ <fo:block font-size="13pt" font-weight="bold" text-align="right" padding-top="12mm">
1071
+ <xsl:value-of select="$header_text"/>
1055
1072
  </fo:block>
1056
1073
  </fo:block-container>
1057
1074
  </fo:static-content>
1058
- <fo:static-content flow-name="header-odd-jcgm" role="artifact">
1075
+ <fo:static-content flow-name="header-blank" role="artifact">
1059
1076
  <xsl:call-template name="insertDraftWatermark">
1060
1077
  <xsl:with-param name="isDraft" select="$isDraft"/>
1061
1078
  </xsl:call-template>
1079
+ <fo:block/>
1080
+ </fo:static-content>
1081
+ </xsl:template>
1082
+
1083
+ <xsl:template name="insertFooter">
1084
+ <fo:static-content flow-name="footer-even-jcgm" role="artifact">
1062
1085
  <fo:block-container height="98%">
1063
- <fo:block font-size="13pt" font-weight="bold" text-align="right" padding-top="12mm">
1064
- <xsl:value-of select="$header_text"/>
1086
+ <fo:block text-align-last="justify">
1087
+ <fo:inline font-size="12pt" font-weight="bold"><fo:page-number/></fo:inline>
1088
+ <fo:inline keep-together.within-line="always">
1089
+ <fo:leader leader-pattern="space"/>
1090
+ <fo:inline font-size="10pt"><xsl:value-of select="$copyrightText"/></fo:inline>
1091
+ </fo:inline>
1065
1092
  </fo:block>
1066
1093
  </fo:block-container>
1067
1094
  </fo:static-content>
@@ -1076,12 +1103,6 @@
1076
1103
  </fo:block>
1077
1104
  </fo:block-container>
1078
1105
  </fo:static-content>
1079
- <fo:static-content flow-name="header-blank" role="artifact">
1080
- <xsl:call-template name="insertDraftWatermark">
1081
- <xsl:with-param name="isDraft" select="$isDraft"/>
1082
- </xsl:call-template>
1083
- <fo:block/>
1084
- </fo:static-content>
1085
1106
  </xsl:template>
1086
1107
 
1087
1108
  <xsl:template name="insertDraftWatermark">
@@ -1124,21 +1145,6 @@
1124
1145
 
1125
1146
  <xsl:template match="mn:fmt-title" name="title">
1126
1147
 
1127
- <xsl:variable name="level">
1128
- <xsl:call-template name="getLevel"/>
1129
- </xsl:variable>
1130
-
1131
- <xsl:variable name="font-size">
1132
- <xsl:choose>
1133
- <xsl:when test="ancestor::mn:preface">15pt</xsl:when>
1134
- <xsl:when test="parent::mn:annex">15pt</xsl:when>
1135
- <xsl:when test="../@inline-header = 'true' or @inline-header = 'true'">10.5pt</xsl:when>
1136
- <xsl:when test="$level = 2">11.5pt</xsl:when>
1137
- <xsl:when test="$level &gt;= 3">10.5pt</xsl:when>
1138
- <xsl:otherwise>13pt</xsl:otherwise><!-- level 1 -->
1139
- </xsl:choose>
1140
- </xsl:variable>
1141
-
1142
1148
  <xsl:variable name="element-name">
1143
1149
  <xsl:choose>
1144
1150
  <xsl:when test="../@inline-header = 'true' or @inline-header = 'true'">fo:inline</xsl:when>
@@ -1146,53 +1152,22 @@
1146
1152
  </xsl:choose>
1147
1153
  </xsl:variable>
1148
1154
 
1149
- <xsl:element name="{$element-name}">
1150
- <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
1151
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1152
- <xsl:attribute name="space-before"> <!-- margin-top -->
1153
- <xsl:choose>
1155
+ <xsl:variable name="title_styles">
1156
+ <styles xsl:use-attribute-sets="title-style"><xsl:call-template name="refine_title-style"><xsl:with-param name="element-name" select="$element-name"/></xsl:call-template></styles>
1157
+ </xsl:variable>
1154
1158
 
1155
- <xsl:when test="$level = 1 and parent::mn:annex">0pt</xsl:when>
1156
- <xsl:when test="$level = 1">36pt</xsl:when>
1157
- <xsl:when test="$level = 2">18pt</xsl:when>
1158
- <xsl:when test="$level &gt;= 3">3pt</xsl:when>
1159
- <xsl:when test="$level = ''">6pt</xsl:when><!-- 13.5pt -->
1160
- <xsl:otherwise>12pt</xsl:otherwise>
1161
- </xsl:choose>
1162
- </xsl:attribute>
1163
- <xsl:attribute name="space-after">
1164
- <xsl:choose>
1165
- <xsl:when test="ancestor::mn:preface">12pt</xsl:when>
1166
- <xsl:when test="parent::mn:annex">30pt</xsl:when>
1167
- <xsl:when test="following-sibling::*[1][self::mn:fmt-admitted]">0pt</xsl:when>
1168
- <!-- <xsl:otherwise>12pt</xsl:otherwise> -->
1169
- <xsl:otherwise>12pt</xsl:otherwise>
1170
- </xsl:choose>
1171
- </xsl:attribute>
1172
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
1173
- <xsl:if test="$element-name = 'fo:inline'">
1174
- <xsl:attribute name="padding-right">
1175
- <xsl:choose>
1176
- <xsl:when test="$level = 3">6.5mm</xsl:when>
1177
- <xsl:otherwise>4mm</xsl:otherwise>
1178
- </xsl:choose>
1179
- </xsl:attribute>
1180
- </xsl:if>
1181
- <xsl:if test="parent::mn:annex">
1182
- <xsl:attribute name="text-align">center</xsl:attribute>
1183
- <xsl:attribute name="line-height">130%</xsl:attribute>
1184
- </xsl:if>
1185
- <xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
1186
- <xsl:apply-templates/>
1187
- <xsl:apply-templates select="following-sibling::*[1][self::mn:variant-title][@type = 'sub']" mode="subtitle"/>
1188
- </xsl:element>
1159
+ <xsl:element name="{$element-name}">
1160
+ <xsl:copy-of select="xalan:nodeset($title_styles)/styles/@*"/>
1189
1161
 
1190
- <xsl:if test="$element-name = 'fo:inline' and not(following-sibling::mn:p)">
1191
- <fo:block> <!-- margin-bottom="12pt" -->
1192
- <xsl:value-of select="$linebreak"/>
1193
- </fo:block>
1194
- </xsl:if>
1162
+ <xsl:apply-templates/>
1163
+ <xsl:apply-templates select="following-sibling::*[1][self::mn:variant-title][@type = 'sub']" mode="subtitle"/>
1164
+ </xsl:element>
1195
1165
 
1166
+ <xsl:if test="$element-name = 'fo:inline' and not(following-sibling::mn:p)">
1167
+ <fo:block>
1168
+ <xsl:value-of select="$linebreak"/>
1169
+ </fo:block>
1170
+ </xsl:if>
1196
1171
  </xsl:template>
1197
1172
 
1198
1173
  <xsl:template match="mn:metanorma/mn:bibdata/mn:edition">
@@ -3927,6 +3902,10 @@
3927
3902
  </xsl:element>
3928
3903
  </xsl:template>
3929
3904
 
3905
+ <!-- show sourcecode's name 'before' or 'after' source code -->
3906
+ <xsl:variable name="sourcecode-name-position"><xsl:text>after</xsl:text>
3907
+ </xsl:variable>
3908
+
3930
3909
  <xsl:template match="mn:sourcecode" name="sourcecode">
3931
3910
 
3932
3911
  <xsl:variable name="sourcecode_attributes">
@@ -3950,7 +3929,12 @@
3950
3929
 
3951
3930
  <xsl:call-template name="refine_sourcecode-container-style"/>
3952
3931
 
3953
- <fo:block-container margin-left="0mm" role="SKIP">
3932
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
3933
+
3934
+ <!-- <xsl:if test="$namespace = 'rsd'"> -->
3935
+ <xsl:if test="$sourcecode-name-position = 'before'">
3936
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name BEFORE content -->
3937
+ </xsl:if>
3954
3938
 
3955
3939
  <fo:block xsl:use-attribute-sets="sourcecode-style">
3956
3940
 
@@ -3972,7 +3956,16 @@
3972
3956
  </fo:block>
3973
3957
 
3974
3958
  <xsl:apply-templates select="mn:dl"/> <!-- Key table -->
3975
- <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
3959
+
3960
+ <!-- <xsl:choose>
3961
+ <xsl:when test="$namespace = 'rsd'"></xsl:when>
3962
+ <xsl:otherwise>
3963
+ <xsl:apply-templates select="mn:fmt-name" /> --><!-- show sourcecode's name AFTER content -->
3964
+ <!-- </xsl:otherwise>
3965
+ </xsl:choose> -->
3966
+ <xsl:if test="$sourcecode-name-position = 'after'">
3967
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
3968
+ </xsl:if>
3976
3969
 
3977
3970
  </fo:block-container>
3978
3971
  </fo:block-container>
@@ -5229,87 +5222,81 @@
5229
5222
  <xsl:template name="refine_term-style">
5230
5223
  </xsl:template>
5231
5224
 
5232
- <xsl:attribute-set name="term-name-style">
5225
+ <xsl:attribute-set name="term-number-style">
5233
5226
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
5234
5227
  <xsl:attribute name="font-weight">bold</xsl:attribute>
5235
5228
  </xsl:attribute-set> <!-- term-name-style -->
5236
5229
 
5237
- <xsl:template name="refine_term-name-style">
5238
- </xsl:template>
5239
-
5240
- <xsl:attribute-set name="preferred-style">
5241
- </xsl:attribute-set> <!-- preferred-style -->
5242
-
5243
- <xsl:template name="refine_preferred-style">
5230
+ <xsl:template name="refine_term-number-style">
5244
5231
  </xsl:template>
5245
5232
 
5246
- <xsl:attribute-set name="preferred-block-style">
5233
+ <xsl:attribute-set name="term-preferred-block-style">
5247
5234
  <xsl:attribute name="line-height">1.1</xsl:attribute>
5248
5235
  </xsl:attribute-set> <!-- preferred-block-style -->
5249
5236
 
5250
- <xsl:template name="refine_preferred-block-style">
5237
+ <xsl:template name="refine_term-preferred-block-style">
5251
5238
  </xsl:template>
5252
5239
 
5253
- <xsl:attribute-set name="preferred-term-style">
5240
+ <xsl:attribute-set name="term-preferred-style">
5254
5241
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
5255
5242
  <xsl:attribute name="font-weight">bold</xsl:attribute>
5256
5243
  </xsl:attribute-set> <!-- preferred-term-style -->
5257
5244
 
5258
- <xsl:template name="refine_preferred-term-style">
5245
+ <xsl:template name="refine_term-preferred-style">
5259
5246
  <xsl:if test="mn:strong">
5260
5247
  <xsl:attribute name="font-weight">normal</xsl:attribute>
5261
5248
  </xsl:if>
5262
5249
  </xsl:template>
5263
5250
 
5264
- <xsl:attribute-set name="domain-style">
5265
- </xsl:attribute-set> <!-- domain-style -->
5251
+ <xsl:attribute-set name="term-domain-style">
5252
+ </xsl:attribute-set> <!-- term-domain-style -->
5266
5253
 
5267
- <xsl:template name="refine_domain-style">
5254
+ <xsl:template name="refine_term-domain-style">
5268
5255
  </xsl:template>
5269
5256
 
5270
- <xsl:attribute-set name="admitted-style">
5257
+ <xsl:attribute-set name="term-admitted-style">
5271
5258
  <xsl:attribute name="font-weight">bold</xsl:attribute>
5272
- </xsl:attribute-set> <!-- admitted-style -->
5259
+ </xsl:attribute-set> <!-- term-admitted-style -->
5273
5260
 
5274
- <xsl:template name="refine_admitted-style">
5261
+ <xsl:template name="refine_term-admitted-style">
5275
5262
  </xsl:template>
5276
5263
 
5277
- <xsl:attribute-set name="deprecates-style">
5278
- </xsl:attribute-set> <!-- deprecates-style -->
5264
+ <xsl:attribute-set name="term-deprecates-style">
5265
+ </xsl:attribute-set> <!-- term-deprecates-style -->
5279
5266
 
5280
- <xsl:template name="refine_deprecates-style">
5267
+ <xsl:template name="refine_term-deprecates-style">
5281
5268
  </xsl:template>
5282
5269
 
5283
- <xsl:attribute-set name="related-block-style" use-attribute-sets="preferred-block-style">
5270
+ <xsl:attribute-set name="term-related-block-style" use-attribute-sets="term-preferred-block-style">
5284
5271
  </xsl:attribute-set>
5285
5272
 
5286
- <xsl:template name="refine_related-block-style">
5273
+ <xsl:template name="refine_term-related-block-style">
5287
5274
  </xsl:template>
5288
5275
 
5289
- <xsl:attribute-set name="definition-style">
5276
+ <xsl:attribute-set name="term-definition-style">
5290
5277
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
5291
- </xsl:attribute-set> <!-- definition-style -->
5278
+ </xsl:attribute-set> <!-- term-definition-style -->
5292
5279
 
5293
- <xsl:template name="refine_definition-style">
5280
+ <xsl:template name="refine_term-definition-style">
5294
5281
  </xsl:template>
5295
5282
 
5296
- <xsl:attribute-set name="termsource-style">
5283
+ <xsl:attribute-set name="term-termsource-style">
5297
5284
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
5298
- </xsl:attribute-set> <!-- termsource-style -->
5285
+ </xsl:attribute-set> <!-- term-termsource-style -->
5299
5286
 
5300
- <xsl:template name="refine_termsource-style">
5301
- </xsl:template> <!-- refine_termsource-style -->
5287
+ <xsl:template name="refine_term-termsource-style">
5288
+ </xsl:template> <!-- refine_term-termsource-style -->
5302
5289
 
5303
- <xsl:attribute-set name="termsource-text-style">
5304
- </xsl:attribute-set> <!-- termsource-text-style -->
5290
+ <xsl:attribute-set name="term-termsource-text-style">
5291
+ </xsl:attribute-set> <!-- term-termsource-text-style -->
5305
5292
 
5306
- <xsl:template name="refine_termsource-text-style">
5293
+ <xsl:template name="refine_term-termsource-text-style">
5307
5294
  </xsl:template>
5308
5295
 
5309
- <xsl:attribute-set name="origin-style">
5310
- </xsl:attribute-set> <!-- origin-style -->
5296
+ <xsl:attribute-set name="term-origin-style">
5297
+ </xsl:attribute-set> <!-- term-origin-style -->
5311
5298
 
5312
- <xsl:template name="refine_origin-style">
5299
+ <xsl:template name="refine_term-origin-style">
5313
5300
  </xsl:template>
5314
5301
 
5315
5302
  <!-- ====== -->
@@ -5353,9 +5340,9 @@
5353
5340
  <!-- modification -->
5354
5341
  <!-- ====== -->
5355
5342
  <xsl:template match="mn:fmt-termsource" name="termsource">
5356
- <fo:block xsl:use-attribute-sets="termsource-style">
5343
+ <fo:block xsl:use-attribute-sets="term-termsource-style">
5357
5344
 
5358
- <xsl:call-template name="refine_termsource-style"/>
5345
+ <xsl:call-template name="refine_term-termsource-style"/>
5359
5346
 
5360
5347
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
5361
5348
  <xsl:variable name="termsource_text">
@@ -5403,8 +5390,8 @@
5403
5390
 
5404
5391
  <!-- text SOURCE: -->
5405
5392
  <xsl:template match="mn:fmt-termsource/mn:strong[1][following-sibling::*[1][self::mn:fmt-origin]]/text()">
5406
- <fo:inline xsl:use-attribute-sets="termsource-text-style">
5407
- <xsl:call-template name="refine_termsource-text-style"/>
5393
+ <fo:inline xsl:use-attribute-sets="term-termsource-text-style">
5394
+ <xsl:call-template name="refine_term-termsource-text-style"/>
5408
5395
  <xsl:value-of select="."/>
5409
5396
  </fo:inline>
5410
5397
  </xsl:template>
@@ -5416,8 +5403,8 @@
5416
5403
  <xsl:if test="normalize-space(@citeas) = ''">
5417
5404
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
5418
5405
  </xsl:if>
5419
- <fo:inline xsl:use-attribute-sets="origin-style">
5420
- <xsl:call-template name="refine_origin-style"/>
5406
+ <fo:inline xsl:use-attribute-sets="term-origin-style">
5407
+ <xsl:call-template name="refine_term-origin-style"/>
5421
5408
  <xsl:apply-templates/>
5422
5409
  </fo:inline>
5423
5410
  </fo:basic-link>
@@ -5465,14 +5452,14 @@
5465
5452
  <xsl:variable name="levelTerm">
5466
5453
  <xsl:call-template name="getLevelTermName"/>
5467
5454
  </xsl:variable>
5468
- <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
5455
+ <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="term-preferred-block-style">
5469
5456
 
5470
- <xsl:call-template name="refine_preferred-block-style"/>
5457
+ <xsl:call-template name="refine_term-preferred-block-style"/>
5471
5458
 
5472
5459
  <xsl:if test="parent::mn:term and not(preceding-sibling::mn:fmt-preferred)"> <!-- if first preffered in term, then display term's name -->
5473
5460
 
5474
- <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
5475
- <xsl:call-template name="refine_term-name-style"/>
5461
+ <fo:block xsl:use-attribute-sets="term-number-style" role="SKIP">
5462
+ <xsl:call-template name="refine_term-number-style"/>
5476
5463
 
5477
5464
  <xsl:for-each select="ancestor::mn:term[1]/mn:fmt-name"><!-- change context -->
5478
5465
  <xsl:call-template name="setIDforNamedDestination"/>
@@ -5482,8 +5469,8 @@
5482
5469
  </fo:block>
5483
5470
  </xsl:if>
5484
5471
 
5485
- <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
5486
- <xsl:call-template name="refine_preferred-term-style"/>
5472
+ <fo:block xsl:use-attribute-sets="term-preferred-style" role="SKIP">
5473
+ <xsl:call-template name="refine_term-preferred-style"/>
5487
5474
 
5488
5475
  <xsl:apply-templates/>
5489
5476
  </fo:block>
@@ -5503,15 +5490,15 @@
5503
5490
  <xsl:template match="mn:domain"/>
5504
5491
 
5505
5492
  <xsl:template match="mn:fmt-admitted">
5506
- <fo:block xsl:use-attribute-sets="admitted-style">
5507
- <xsl:call-template name="refine_admitted-style"/>
5493
+ <fo:block xsl:use-attribute-sets="term-admitted-style">
5494
+ <xsl:call-template name="refine_term-admitted-style"/>
5508
5495
  <xsl:apply-templates/>
5509
5496
  </fo:block>
5510
5497
  </xsl:template>
5511
5498
 
5512
5499
  <xsl:template match="mn:fmt-deprecates">
5513
- <fo:block xsl:use-attribute-sets="deprecates-style">
5514
- <xsl:call-template name="refine_deprecates-style"/>
5500
+ <fo:block xsl:use-attribute-sets="term-deprecates-style">
5501
+ <xsl:call-template name="refine_term-deprecates-style"/>
5515
5502
  <xsl:apply-templates/>
5516
5503
  </fo:block>
5517
5504
  </xsl:template>
@@ -5524,8 +5511,8 @@
5524
5511
  <!-- End Preferred, admitted, deprecated -->
5525
5512
 
5526
5513
  <xsl:template match="mn:fmt-related">
5527
- <fo:block role="SKIP" xsl:use-attribute-sets="related-block-style">
5528
- <xsl:call-template name="refine_related-block-style"/>
5514
+ <fo:block role="SKIP" xsl:use-attribute-sets="term-related-block-style">
5515
+ <xsl:call-template name="refine_term-related-block-style"/>
5529
5516
  <xsl:apply-templates/>
5530
5517
  </fo:block>
5531
5518
  </xsl:template>
@@ -5539,8 +5526,8 @@
5539
5526
  <!-- definition -->
5540
5527
  <!-- ========== -->
5541
5528
  <xsl:template match="mn:fmt-definition">
5542
- <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
5543
- <xsl:call-template name="refine_definition-style"/>
5529
+ <fo:block xsl:use-attribute-sets="term-definition-style" role="SKIP">
5530
+ <xsl:call-template name="refine_term-definition-style"/>
5544
5531
  <xsl:apply-templates/>
5545
5532
  </fo:block>
5546
5533
  </xsl:template>
@@ -9850,6 +9837,10 @@
9850
9837
  <!-- image -->
9851
9838
  <!-- ====== -->
9852
9839
 
9840
+ <!-- show figure's name 'before' or 'after' image -->
9841
+ <xsl:variable name="figure-name-position"><xsl:text>after</xsl:text>
9842
+ </xsl:variable>
9843
+
9853
9844
  <xsl:template match="mn:figure" name="figure">
9854
9845
  <xsl:variable name="isAdded" select="@added"/>
9855
9846
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -9862,6 +9853,10 @@
9862
9853
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
9863
9854
  </xsl:call-template>
9864
9855
 
9856
+ <xsl:if test="$figure-name-position = 'before'"> <!-- show figure's name BEFORE image -->
9857
+ <xsl:apply-templates select="mn:fmt-name"/>
9858
+ </xsl:if>
9859
+
9865
9860
  <!-- Example: Dimensions in millimeters -->
9866
9861
  <xsl:apply-templates select="mn:note[@type = 'units']"/>
9867
9862
 
@@ -9882,7 +9877,16 @@
9882
9877
  <xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
9883
9878
  <xsl:call-template name="showFigureKey"/>
9884
9879
  </xsl:if>
9885
- <xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
9880
+
9881
+ <!-- <xsl:choose>
9882
+ <xsl:when test="$namespace = 'bsi' or $namespace = 'pas' or $namespace = 'rsd'"></xsl:when>
9883
+ <xsl:otherwise>
9884
+ <xsl:apply-templates select="mn:fmt-name" /> --> <!-- show figure's name AFTER image -->
9885
+ <!-- </xsl:otherwise>
9886
+ </xsl:choose> -->
9887
+ <xsl:if test="$figure-name-position = 'after'">
9888
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
9889
+ </xsl:if>
9886
9890
 
9887
9891
  </fo:block-container>
9888
9892
  </xsl:template>
@@ -11975,7 +11979,6 @@
11975
11979
  </xsl:attribute-set>
11976
11980
 
11977
11981
  <xsl:template name="refine_references-non-normative-title-style">
11978
-
11979
11982
  </xsl:template>
11980
11983
 
11981
11984
  <!-- bibitem in Normative References (references/@normative="true") -->
@@ -14039,7 +14042,7 @@
14039
14042
  <!-- ===================================== -->
14040
14043
 
14041
14044
  <xsl:attribute-set name="annex-title-style">
14042
- </xsl:attribute-set>
14045
+ </xsl:attribute-set> <!-- annex-title-style -->
14043
14046
 
14044
14047
  <xsl:template name="refine_annex-title-style">
14045
14048
  </xsl:template>
@@ -14050,6 +14053,85 @@
14050
14053
  <xsl:template name="refine_p-zzSTDTitle1-style">
14051
14054
  </xsl:template>
14052
14055
 
14056
+ <xsl:attribute-set name="p-style">
14057
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
14058
+ </xsl:attribute-set> <!-- p-style -->
14059
+
14060
+ <xsl:template name="refine_p-style">
14061
+ <xsl:param name="element-name"/>
14062
+ <xsl:param name="margin"/>
14063
+ <xsl:call-template name="setBlockAttributes">
14064
+ <xsl:with-param name="text_align_default">justify</xsl:with-param>
14065
+ </xsl:call-template>
14066
+
14067
+ <xsl:if test="ancestor::*[@first or @slave]">
14068
+ <!-- JCGM two column layout -->
14069
+ <xsl:attribute name="widows">1</xsl:attribute>
14070
+ <xsl:attribute name="orphans">1</xsl:attribute>
14071
+ </xsl:if>
14072
+ <!-- $namespace = 'jcgm' -->
14073
+
14074
+ </xsl:template> <!-- refine_p-style -->
14075
+
14076
+ <xsl:attribute-set name="title-style">
14077
+ <!-- Note: font-size for level 1 title -->
14078
+ <xsl:attribute name="font-size">13pt</xsl:attribute>
14079
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
14080
+ <xsl:attribute name="space-before">36pt</xsl:attribute>
14081
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
14082
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
14083
+ </xsl:attribute-set> <!-- title-style -->
14084
+
14085
+ <xsl:template name="refine_title-style">
14086
+ <xsl:param name="element-name"/>
14087
+ <xsl:variable name="level">
14088
+ <xsl:call-template name="getLevel"/>
14089
+ </xsl:variable>
14090
+
14091
+ <xsl:if test="$level = 1">
14092
+ <xsl:if test="parent::mn:annex">
14093
+ <xsl:attribute name="space-before">0pt</xsl:attribute>
14094
+ </xsl:if>
14095
+ </xsl:if>
14096
+ <xsl:if test="$level = 2">
14097
+ <xsl:attribute name="font-size">11.5pt</xsl:attribute>
14098
+ <xsl:attribute name="space-before">18pt</xsl:attribute>
14099
+ </xsl:if>
14100
+ <xsl:if test="$level &gt;= 3">
14101
+ <xsl:attribute name="font-size">10.5pt</xsl:attribute>
14102
+ <xsl:attribute name="space-before">3pt</xsl:attribute>
14103
+ </xsl:if>
14104
+ <xsl:if test="../@inline-header = 'true' or @inline-header = 'true'">
14105
+ <xsl:attribute name="font-size">10.5pt</xsl:attribute>
14106
+ </xsl:if>
14107
+ <xsl:if test="following-sibling::*[1][self::mn:fmt-admitted]">
14108
+ <xsl:attribute name="space-after">0pt</xsl:attribute>
14109
+ </xsl:if>
14110
+ <xsl:if test="ancestor::mn:preface">
14111
+ <xsl:attribute name="font-size">15pt</xsl:attribute>
14112
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
14113
+ </xsl:if>
14114
+ <xsl:if test="parent::mn:annex">
14115
+ <xsl:attribute name="font-size">15pt</xsl:attribute>
14116
+ <xsl:attribute name="space-after">30pt</xsl:attribute>
14117
+ </xsl:if>
14118
+ <xsl:if test="$element-name = 'fo:inline'">
14119
+ <xsl:attribute name="padding-right">
14120
+ <xsl:choose>
14121
+ <xsl:when test="$level = 3">6.5mm</xsl:when>
14122
+ <xsl:otherwise>4mm</xsl:otherwise>
14123
+ </xsl:choose>
14124
+ </xsl:attribute>
14125
+ </xsl:if>
14126
+ <xsl:if test="parent::mn:annex">
14127
+ <xsl:attribute name="text-align">center</xsl:attribute>
14128
+ <xsl:attribute name="line-height">130%</xsl:attribute>
14129
+ </xsl:if>
14130
+
14131
+ <!-- $namespace = 'jcgm' -->
14132
+ <xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
14133
+ </xsl:template> <!-- refine_title-style -->
14134
+
14053
14135
  <xsl:template name="processPrefaceSectionsDefault">
14054
14136
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
14055
14137
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -14388,6 +14470,12 @@
14388
14470
  </xsl:choose>
14389
14471
  </xsl:template>
14390
14472
 
14473
+ <xsl:attribute-set name="reset-margins-style">
14474
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
14475
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
14476
+ <xsl:attribute name="role">SKIP</xsl:attribute>
14477
+ </xsl:attribute-set>
14478
+
14391
14479
  <xsl:attribute-set name="clause-style">
14392
14480
 
14393
14481
  </xsl:attribute-set>
@@ -15404,8 +15492,9 @@
15404
15492
 
15405
15493
  <xsl:template name="setTextAlignment">
15406
15494
  <xsl:param name="default">left</xsl:param>
15495
+ <xsl:param name="skip_default">false</xsl:param>
15407
15496
  <xsl:variable name="align" select="normalize-space(@align)"/>
15408
- <xsl:attribute name="text-align">
15497
+ <xsl:variable name="text_align">
15409
15498
  <xsl:choose>
15410
15499
  <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
15411
15500
  <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
@@ -15413,9 +15502,13 @@
15413
15502
  <xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
15414
15503
  <xsl:when test="ancestor::mn:td/@align"><xsl:value-of select="ancestor::mn:td/@align"/></xsl:when>
15415
15504
  <xsl:when test="ancestor::mn:th/@align"><xsl:value-of select="ancestor::mn:th/@align"/></xsl:when>
15505
+ <xsl:when test="$skip_default = 'true'"/>
15416
15506
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
15417
15507
  </xsl:choose>
15418
- </xsl:attribute>
15508
+ </xsl:variable>
15509
+ <xsl:if test="normalize-space($text_align) != ''">
15510
+ <xsl:attribute name="text-align"><xsl:value-of select="$text_align"/></xsl:attribute>
15511
+ </xsl:if>
15419
15512
  <xsl:if test="$align = 'indent'">
15420
15513
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
15421
15514
  </xsl:if>
@@ -15423,8 +15516,10 @@
15423
15516
 
15424
15517
  <xsl:template name="setBlockAttributes">
15425
15518
  <xsl:param name="text_align_default">left</xsl:param>
15519
+ <xsl:param name="skip_text_align_default">false</xsl:param>
15426
15520
  <xsl:call-template name="setTextAlignment">
15427
15521
  <xsl:with-param name="default" select="$text_align_default"/>
15522
+ <xsl:with-param name="skip_default" select="$skip_text_align_default"/>
15428
15523
  </xsl:call-template>
15429
15524
  <xsl:call-template name="setKeepAttributes"/>
15430
15525
  <xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
@@ -15467,6 +15562,20 @@
15467
15562
  </fo:block-container>
15468
15563
  </xsl:template>
15469
15564
 
15565
+ <!-- for https://github.com/metanorma/mn-native-pdf/issues/845 -->
15566
+ <xsl:template name="insertCoverPageFullImage">
15567
+ <xsl:param name="name">coverpage-image</xsl:param>
15568
+ <xsl:for-each select="//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = $name][1]/mn:value/mn:image">
15569
+ <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
15570
+ <fo:flow flow-name="xsl-region-body">
15571
+ <xsl:call-template name="insertBackgroundPageImage">
15572
+ <xsl:with-param name="number" select="position()"/>
15573
+ </xsl:call-template>
15574
+ </fo:flow>
15575
+ </fo:page-sequence>
15576
+ </xsl:for-each>
15577
+ </xsl:template>
15578
+
15470
15579
  <xsl:template name="insertPageImage">
15471
15580
  <xsl:param name="svg_content_height" select="$pageHeight"/>
15472
15581
  <xsl:param name="bitmap_width" select="$pageWidth"/>