metanorma-iho 1.2.6 → 1.2.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.
@@ -495,7 +495,7 @@
495
495
  <fo:table-cell number-columns-spanned="2" border="0.5pt solid rgb(0, 21, 50)" font-weight="bold" color="rgb(0, 0, 76)" padding-top="3mm">
496
496
  <fo:block-container height="165mm" width="115mm">
497
497
  <fo:block-container margin-left="10mm">
498
- <fo:block-container margin-left="0mm">
498
+ <fo:block-container xsl:use-attribute-sets="reset-margins-style">
499
499
 
500
500
  <!-- <fo:block-container display-align="center" height="90mm"> -->
501
501
  <fo:table table-layout="fixed" width="100%">
@@ -560,7 +560,7 @@
560
560
  </fo:table-cell>
561
561
  <fo:table-cell number-rows-spanned="2">
562
562
  <fo:block-container width="79mm" height="72mm" margin-left="56.8mm" background-color="rgb(0, 172, 158)" text-align="right" display-align="after">
563
- <fo:block-container margin-left="0mm">
563
+ <fo:block-container xsl:use-attribute-sets="reset-margins-style">
564
564
  <fo:block font-size="8pt" color="white" margin-right="5mm" margin-bottom="5mm" line-height-shift-adjustment="disregard-shifts">
565
565
  <xsl:apply-templates select="/mn:metanorma/mn:boilerplate/mn:feedback-statement"/>
566
566
  </fo:block>
@@ -611,7 +611,7 @@
611
611
  </xsl:call-template>
612
612
  <fo:flow flow-name="xsl-region-body">
613
613
  <fo:block-container margin-left="-1.5mm" margin-right="-1mm">
614
- <fo:block-container margin-left="0mm" margin-right="0mm" border="0.5pt solid black">
614
+ <fo:block-container xsl:use-attribute-sets="reset-margins-style" border="0.5pt solid black">
615
615
  <fo:block-container margin-top="6.5mm" margin-left="7.5mm" margin-right="8.5mm" margin-bottom="7.5mm">
616
616
  <fo:block-container margin="0">
617
617
  <fo:block text-align="justify">
@@ -960,19 +960,6 @@
960
960
 
961
961
  <xsl:template match="mn:fmt-title" name="title">
962
962
 
963
- <xsl:variable name="level">
964
- <xsl:call-template name="getLevel"/>
965
- </xsl:variable>
966
-
967
- <xsl:variable name="font-size">
968
- <xsl:choose>
969
- <xsl:when test="$level = 1">12pt</xsl:when>
970
- <xsl:when test="$level = 2">11pt</xsl:when>
971
- <xsl:when test="$level &gt;= 3">10pt</xsl:when>
972
- <xsl:otherwise>12pt</xsl:otherwise>
973
- </xsl:choose>
974
- </xsl:variable>
975
-
976
963
  <xsl:variable name="element-name">
977
964
  <xsl:choose>
978
965
  <xsl:when test="../@inline-header = 'true'">fo:inline</xsl:when>
@@ -980,58 +967,20 @@
980
967
  </xsl:choose>
981
968
  </xsl:variable>
982
969
 
983
- <xsl:element name="{$element-name}">
984
-
985
- <xsl:choose>
986
- <xsl:when test="@type = 'floating-title' or @type = 'section-title'">
987
- <xsl:copy-of select="@id"/>
988
- </xsl:when>
989
- <xsl:otherwise>
990
- <xsl:for-each select="parent::mn:clause">
991
- <xsl:call-template name="setId"/>
992
- </xsl:for-each>
993
- </xsl:otherwise>
994
- </xsl:choose>
995
-
996
- <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
997
- <xsl:attribute name="font-weight">bold</xsl:attribute>
998
- <xsl:attribute name="space-before">
999
- <xsl:choose>
1000
- <xsl:when test="$level = 1">24pt</xsl:when>
1001
- <xsl:when test="$level = 2 and ../preceding-sibling::*[1][self::mn:fmt-title]">10pt</xsl:when>
1002
- <xsl:when test="$level = 2">24pt</xsl:when>
1003
- <xsl:when test="$level &gt;= 3">6pt</xsl:when>
1004
- <xsl:when test="ancestor::mn:preface">8pt</xsl:when>
1005
- <xsl:when test="$level = ''">6pt</xsl:when><!-- 13.5pt -->
1006
- <xsl:otherwise>12pt</xsl:otherwise>
1007
- </xsl:choose>
1008
- </xsl:attribute>
1009
- <xsl:attribute name="space-after">
1010
- <xsl:choose>
1011
- <xsl:when test="$level &gt;= 3">6pt</xsl:when>
1012
- <xsl:otherwise>10pt</xsl:otherwise>
1013
- </xsl:choose>
1014
- </xsl:attribute>
1015
- <!-- <xsl:attribute name="margin-bottom">10pt</xsl:attribute> -->
1016
-
1017
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
1018
-
1019
- <xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
970
+ <xsl:variable name="title_styles">
971
+ <styles xsl:use-attribute-sets="title-style"><xsl:call-template name="refine_title-style"/></styles>
972
+ </xsl:variable>
1020
973
 
1021
- <xsl:if test="../@id = '_document_history' or . = 'Document History'">
1022
- <xsl:attribute name="text-align">center</xsl:attribute>
1023
- </xsl:if>
974
+ <xsl:element name="{$element-name}">
975
+ <xsl:copy-of select="xalan:nodeset($title_styles)/styles/@*"/>
1024
976
 
1025
977
  <xsl:apply-templates/>
1026
978
  <xsl:apply-templates select="following-sibling::*[1][mn:variant-title][@type = 'sub']" mode="subtitle"/>
1027
979
  </xsl:element>
1028
980
 
1029
981
  <xsl:if test="$element-name = 'fo:inline' and not(following-sibling::mn:p)">
1030
- <fo:block> <!-- margin-bottom="12pt" -->
1031
- <xsl:value-of select="$linebreak"/>
1032
- </fo:block>
982
+ <fo:block><xsl:value-of select="$linebreak"/></fo:block>
1033
983
  </xsl:if>
1034
-
1035
984
  </xsl:template>
1036
985
  <!-- ====== -->
1037
986
  <!-- ====== -->
@@ -1049,57 +998,15 @@
1049
998
  <xsl:otherwise>fo:block</xsl:otherwise>
1050
999
  </xsl:choose>
1051
1000
  </xsl:variable>
1052
- <xsl:element name="{$element-name}">
1053
- <xsl:attribute name="text-align">
1054
- <xsl:choose>
1055
- <xsl:when test="ancestor::mn:quote">justify</xsl:when>
1056
- <xsl:when test="ancestor::mn:feedback-statement">right</xsl:when>
1057
- <xsl:when test="ancestor::mn:boilerplate and not(@align)">justify</xsl:when>
1058
- <xsl:when test="@align = 'justified'">justify</xsl:when>
1059
- <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
1060
- <xsl:when test="ancestor::mn:td/@align"><xsl:value-of select="ancestor::mn:td/@align"/></xsl:when>
1061
- <xsl:when test="ancestor::mn:th/@align"><xsl:value-of select="ancestor::mn:th/@align"/></xsl:when>
1062
- <xsl:otherwise>justify</xsl:otherwise>
1063
- </xsl:choose>
1064
- </xsl:attribute>
1065
- <xsl:call-template name="setKeepAttributes"/>
1066
- <xsl:attribute name="space-after">6pt</xsl:attribute>
1067
- <xsl:if test="parent::mn:dd">
1068
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1069
- </xsl:if>
1070
- <xsl:if test="ancestor::*[2][self::mn:license-statement] and not(following-sibling::mn:p)">
1071
- <xsl:attribute name="space-after">0pt</xsl:attribute>
1072
- </xsl:if>
1073
- <xsl:attribute name="line-height">115%</xsl:attribute>
1074
- <!-- <xsl:attribute name="border">1pt solid red</xsl:attribute> -->
1075
- <xsl:if test="ancestor::mn:boilerplate and not(ancestor::mn:feedback-statement)">
1076
- <xsl:attribute name="line-height">125%</xsl:attribute>
1077
- <xsl:attribute name="space-after">14pt</xsl:attribute>
1078
- </xsl:if>
1079
- <xsl:if test="following-sibling::*[1][self::mn:ol or self::mn:ul or self::mn:note or self::mn:termnote or self::mn:example or self::mn:dl]">
1080
- <xsl:attribute name="space-after">3pt</xsl:attribute>
1081
- </xsl:if>
1082
- <xsl:if test="following-sibling::*[1][self::mn:dl]">
1083
- <xsl:attribute name="space-after">6pt</xsl:attribute>
1084
- </xsl:if>
1085
- <xsl:if test="ancestor::mn:quote">
1086
- <xsl:attribute name="line-height">130%</xsl:attribute>
1087
- <!-- <xsl:attribute name="margin-bottom">12pt</xsl:attribute> -->
1088
- </xsl:if>
1089
-
1090
- <xsl:if test="ancestor::*[self::mn:recommendation or self::mn:requirement or self::mn:permission] and not(following-sibling::*)">
1091
- <xsl:attribute name="space-after">0pt</xsl:attribute>
1092
- </xsl:if>
1093
-
1094
- <xsl:if test="ancestor::mn:li and ancestor::mn:table">
1095
- <xsl:attribute name="space-after">0pt</xsl:attribute>
1096
- </xsl:if>
1097
1001
 
1098
- <xsl:if test=".//mn:fn">
1099
- <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
1100
- </xsl:if>
1002
+ <xsl:variable name="p_styles">
1003
+ <styles xsl:use-attribute-sets="p-style">
1004
+ <xsl:call-template name="refine_p-style"><xsl:with-param name="element-name" select="$element-name"/></xsl:call-template>
1005
+ </styles>
1006
+ </xsl:variable>
1101
1007
 
1102
- <xsl:copy-of select="@id"/>
1008
+ <xsl:element name="{$element-name}">
1009
+ <xsl:copy-of select="xalan:nodeset($p_styles)/styles/@*"/>
1103
1010
 
1104
1011
  <xsl:apply-templates>
1105
1012
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -1160,6 +1067,22 @@
1160
1067
  <xsl:param name="month_year"/>
1161
1068
  <xsl:param name="font-weight" select="'bold'"/>
1162
1069
  <xsl:param name="orientation"/>
1070
+
1071
+ <xsl:call-template name="insertHeader">
1072
+ <xsl:with-param name="title_header" select="$title_header"/>
1073
+ <xsl:with-param name="orientation" select="$orientation"/>
1074
+ </xsl:call-template>
1075
+
1076
+ <xsl:call-template name="insertFooter">
1077
+ <xsl:with-param name="docidentifier" select="$docidentifier"/>
1078
+ <xsl:with-param name="edition" select="$edition"/>
1079
+ <xsl:with-param name="month_year" select="$month_year"/>
1080
+ </xsl:call-template>
1081
+ </xsl:template>
1082
+
1083
+ <xsl:template name="insertHeader">
1084
+ <xsl:param name="title_header"/>
1085
+ <xsl:param name="orientation"/>
1163
1086
  <fo:static-content flow-name="header-odd" role="artifact">
1164
1087
  <fo:block-container height="100%" font-size="8pt">
1165
1088
  <fo:block padding-top="12.5mm">
@@ -1200,12 +1123,8 @@
1200
1123
  <xsl:with-param name="title_header" select="$title_header"/>
1201
1124
  <xsl:with-param name="orientation" select="$orientation"/>
1202
1125
  </xsl:call-template>
1203
- <xsl:call-template name="insertFooter">
1204
- <xsl:with-param name="docidentifier" select="$docidentifier"/>
1205
- <xsl:with-param name="edition" select="$edition"/>
1206
- <xsl:with-param name="month_year" select="$month_year"/>
1207
- </xsl:call-template>
1208
1126
  </xsl:template>
1127
+
1209
1128
  <xsl:template name="insertHeaderBlank">
1210
1129
  <xsl:param name="title_header"/>
1211
1130
  <xsl:param name="orientation"/>
@@ -1235,6 +1154,7 @@
1235
1154
  </fo:block-container>
1236
1155
  </fo:static-content>
1237
1156
  </xsl:template>
1157
+
1238
1158
  <xsl:template name="insertFooter">
1239
1159
  <xsl:param name="docidentifier"/>
1240
1160
  <xsl:param name="edition"/>
@@ -1255,6 +1175,7 @@
1255
1175
  </fo:block-container>
1256
1176
  </fo:static-content>
1257
1177
  </xsl:template>
1178
+
1258
1179
  <xsl:template name="insertHeaderFooterBlank">
1259
1180
  <xsl:param name="title_header"/>
1260
1181
  <xsl:param name="docidentifier"/>
@@ -3399,6 +3320,10 @@
3399
3320
  </xsl:element>
3400
3321
  </xsl:template>
3401
3322
 
3323
+ <!-- show sourcecode's name 'before' or 'after' source code -->
3324
+ <xsl:variable name="sourcecode-name-position"><xsl:text>after</xsl:text>
3325
+ </xsl:variable>
3326
+
3402
3327
  <xsl:template match="mn:sourcecode" name="sourcecode">
3403
3328
 
3404
3329
  <xsl:variable name="sourcecode_attributes">
@@ -3422,7 +3347,12 @@
3422
3347
 
3423
3348
  <xsl:call-template name="refine_sourcecode-container-style"/>
3424
3349
 
3425
- <fo:block-container margin-left="0mm" role="SKIP">
3350
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
3351
+
3352
+ <!-- <xsl:if test="$namespace = 'rsd'"> -->
3353
+ <xsl:if test="$sourcecode-name-position = 'before'">
3354
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name BEFORE content -->
3355
+ </xsl:if>
3426
3356
 
3427
3357
  <fo:block xsl:use-attribute-sets="sourcecode-style">
3428
3358
 
@@ -3444,7 +3374,16 @@
3444
3374
  </fo:block>
3445
3375
 
3446
3376
  <xsl:apply-templates select="mn:dl"/> <!-- Key table -->
3447
- <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
3377
+
3378
+ <!-- <xsl:choose>
3379
+ <xsl:when test="$namespace = 'rsd'"></xsl:when>
3380
+ <xsl:otherwise>
3381
+ <xsl:apply-templates select="mn:fmt-name" /> --><!-- show sourcecode's name AFTER content -->
3382
+ <!-- </xsl:otherwise>
3383
+ </xsl:choose> -->
3384
+ <xsl:if test="$sourcecode-name-position = 'after'">
3385
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
3386
+ </xsl:if>
3448
3387
 
3449
3388
  </fo:block-container>
3450
3389
  </fo:block-container>
@@ -4707,88 +4646,82 @@
4707
4646
  <xsl:template name="refine_term-style">
4708
4647
  </xsl:template>
4709
4648
 
4710
- <xsl:attribute-set name="term-name-style">
4649
+ <xsl:attribute-set name="term-number-style">
4711
4650
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4712
4651
  <xsl:attribute name="font-weight">bold</xsl:attribute>
4713
4652
  </xsl:attribute-set> <!-- term-name-style -->
4714
4653
 
4715
- <xsl:template name="refine_term-name-style">
4654
+ <xsl:template name="refine_term-number-style">
4716
4655
  </xsl:template>
4717
4656
 
4718
- <xsl:attribute-set name="preferred-style">
4719
- </xsl:attribute-set> <!-- preferred-style -->
4720
-
4721
- <xsl:template name="refine_preferred-style">
4722
- </xsl:template>
4723
-
4724
- <xsl:attribute-set name="preferred-block-style">
4657
+ <xsl:attribute-set name="term-preferred-block-style">
4725
4658
  <xsl:attribute name="line-height">1.1</xsl:attribute>
4726
4659
  </xsl:attribute-set> <!-- preferred-block-style -->
4727
4660
 
4728
- <xsl:template name="refine_preferred-block-style">
4661
+ <xsl:template name="refine_term-preferred-block-style">
4729
4662
  </xsl:template>
4730
4663
 
4731
- <xsl:attribute-set name="preferred-term-style">
4664
+ <xsl:attribute-set name="term-preferred-style">
4732
4665
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4733
4666
  <xsl:attribute name="font-weight">bold</xsl:attribute>
4734
4667
  </xsl:attribute-set> <!-- preferred-term-style -->
4735
4668
 
4736
- <xsl:template name="refine_preferred-term-style">
4669
+ <xsl:template name="refine_term-preferred-style">
4737
4670
  <xsl:if test="mn:strong">
4738
4671
  <xsl:attribute name="font-weight">normal</xsl:attribute>
4739
4672
  </xsl:if>
4740
4673
  </xsl:template>
4741
4674
 
4742
- <xsl:attribute-set name="domain-style">
4743
- </xsl:attribute-set> <!-- domain-style -->
4675
+ <xsl:attribute-set name="term-domain-style">
4676
+ </xsl:attribute-set> <!-- term-domain-style -->
4744
4677
 
4745
- <xsl:template name="refine_domain-style">
4678
+ <xsl:template name="refine_term-domain-style">
4746
4679
  </xsl:template>
4747
4680
 
4748
- <xsl:attribute-set name="admitted-style">
4749
- </xsl:attribute-set> <!-- admitted-style -->
4681
+ <xsl:attribute-set name="term-admitted-style">
4682
+ </xsl:attribute-set> <!-- term-admitted-style -->
4750
4683
 
4751
- <xsl:template name="refine_admitted-style">
4684
+ <xsl:template name="refine_term-admitted-style">
4752
4685
  </xsl:template>
4753
4686
 
4754
- <xsl:attribute-set name="deprecates-style">
4755
- </xsl:attribute-set> <!-- deprecates-style -->
4687
+ <xsl:attribute-set name="term-deprecates-style">
4688
+ </xsl:attribute-set> <!-- term-deprecates-style -->
4756
4689
 
4757
- <xsl:template name="refine_deprecates-style">
4690
+ <xsl:template name="refine_term-deprecates-style">
4758
4691
  </xsl:template>
4759
4692
 
4760
- <xsl:attribute-set name="related-block-style" use-attribute-sets="preferred-block-style">
4693
+ <xsl:attribute-set name="term-related-block-style" use-attribute-sets="term-preferred-block-style">
4761
4694
  </xsl:attribute-set>
4762
4695
 
4763
- <xsl:template name="refine_related-block-style">
4696
+ <xsl:template name="refine_term-related-block-style">
4764
4697
  </xsl:template>
4765
4698
 
4766
- <xsl:attribute-set name="definition-style">
4699
+ <xsl:attribute-set name="term-definition-style">
4767
4700
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
4768
- </xsl:attribute-set> <!-- definition-style -->
4701
+ </xsl:attribute-set> <!-- term-definition-style -->
4769
4702
 
4770
- <xsl:template name="refine_definition-style">
4703
+ <xsl:template name="refine_term-definition-style">
4771
4704
  </xsl:template>
4772
4705
 
4773
- <xsl:attribute-set name="termsource-style">
4706
+ <xsl:attribute-set name="term-termsource-style">
4774
4707
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
4775
- </xsl:attribute-set> <!-- termsource-style -->
4708
+ </xsl:attribute-set> <!-- term-termsource-style -->
4776
4709
 
4777
- <xsl:template name="refine_termsource-style">
4778
- </xsl:template> <!-- refine_termsource-style -->
4710
+ <xsl:template name="refine_term-termsource-style">
4711
+ </xsl:template> <!-- refine_term-termsource-style -->
4779
4712
 
4780
- <xsl:attribute-set name="termsource-text-style">
4781
- </xsl:attribute-set> <!-- termsource-text-style -->
4713
+ <xsl:attribute-set name="term-termsource-text-style">
4714
+ </xsl:attribute-set> <!-- term-termsource-text-style -->
4782
4715
 
4783
- <xsl:template name="refine_termsource-text-style">
4716
+ <xsl:template name="refine_term-termsource-text-style">
4784
4717
  </xsl:template>
4785
4718
 
4786
- <xsl:attribute-set name="origin-style">
4719
+ <xsl:attribute-set name="term-origin-style">
4787
4720
  <xsl:attribute name="color">blue</xsl:attribute>
4788
4721
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
4789
- </xsl:attribute-set> <!-- origin-style -->
4722
+ </xsl:attribute-set> <!-- term-origin-style -->
4790
4723
 
4791
- <xsl:template name="refine_origin-style">
4724
+ <xsl:template name="refine_term-origin-style">
4792
4725
  </xsl:template>
4793
4726
 
4794
4727
  <!-- ====== -->
@@ -4832,9 +4765,9 @@
4832
4765
  <!-- modification -->
4833
4766
  <!-- ====== -->
4834
4767
  <xsl:template match="mn:fmt-termsource" name="termsource">
4835
- <fo:block xsl:use-attribute-sets="termsource-style">
4768
+ <fo:block xsl:use-attribute-sets="term-termsource-style">
4836
4769
 
4837
- <xsl:call-template name="refine_termsource-style"/>
4770
+ <xsl:call-template name="refine_term-termsource-style"/>
4838
4771
 
4839
4772
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
4840
4773
  <xsl:variable name="termsource_text">
@@ -4882,8 +4815,8 @@
4882
4815
 
4883
4816
  <!-- text SOURCE: -->
4884
4817
  <xsl:template match="mn:fmt-termsource/mn:strong[1][following-sibling::*[1][self::mn:fmt-origin]]/text()">
4885
- <fo:inline xsl:use-attribute-sets="termsource-text-style">
4886
- <xsl:call-template name="refine_termsource-text-style"/>
4818
+ <fo:inline xsl:use-attribute-sets="term-termsource-text-style">
4819
+ <xsl:call-template name="refine_term-termsource-text-style"/>
4887
4820
  <xsl:value-of select="."/>
4888
4821
  </fo:inline>
4889
4822
  </xsl:template>
@@ -4895,8 +4828,8 @@
4895
4828
  <xsl:if test="normalize-space(@citeas) = ''">
4896
4829
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
4897
4830
  </xsl:if>
4898
- <fo:inline xsl:use-attribute-sets="origin-style">
4899
- <xsl:call-template name="refine_origin-style"/>
4831
+ <fo:inline xsl:use-attribute-sets="term-origin-style">
4832
+ <xsl:call-template name="refine_term-origin-style"/>
4900
4833
  <xsl:apply-templates/>
4901
4834
  </fo:inline>
4902
4835
  </fo:basic-link>
@@ -4944,14 +4877,14 @@
4944
4877
  <xsl:variable name="levelTerm">
4945
4878
  <xsl:call-template name="getLevelTermName"/>
4946
4879
  </xsl:variable>
4947
- <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
4880
+ <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="term-preferred-block-style">
4948
4881
 
4949
- <xsl:call-template name="refine_preferred-block-style"/>
4882
+ <xsl:call-template name="refine_term-preferred-block-style"/>
4950
4883
 
4951
4884
  <xsl:if test="parent::mn:term and not(preceding-sibling::mn:fmt-preferred)"> <!-- if first preffered in term, then display term's name -->
4952
4885
 
4953
- <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
4954
- <xsl:call-template name="refine_term-name-style"/>
4886
+ <fo:block xsl:use-attribute-sets="term-number-style" role="SKIP">
4887
+ <xsl:call-template name="refine_term-number-style"/>
4955
4888
 
4956
4889
  <xsl:for-each select="ancestor::mn:term[1]/mn:fmt-name"><!-- change context -->
4957
4890
  <xsl:call-template name="setIDforNamedDestination"/>
@@ -4961,8 +4894,8 @@
4961
4894
  </fo:block>
4962
4895
  </xsl:if>
4963
4896
 
4964
- <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
4965
- <xsl:call-template name="refine_preferred-term-style"/>
4897
+ <fo:block xsl:use-attribute-sets="term-preferred-style" role="SKIP">
4898
+ <xsl:call-template name="refine_term-preferred-style"/>
4966
4899
 
4967
4900
  <xsl:apply-templates/>
4968
4901
  </fo:block>
@@ -4982,15 +4915,15 @@
4982
4915
  <xsl:template match="mn:domain"/>
4983
4916
 
4984
4917
  <xsl:template match="mn:fmt-admitted">
4985
- <fo:block xsl:use-attribute-sets="admitted-style">
4986
- <xsl:call-template name="refine_admitted-style"/>
4918
+ <fo:block xsl:use-attribute-sets="term-admitted-style">
4919
+ <xsl:call-template name="refine_term-admitted-style"/>
4987
4920
  <xsl:apply-templates/>
4988
4921
  </fo:block>
4989
4922
  </xsl:template>
4990
4923
 
4991
4924
  <xsl:template match="mn:fmt-deprecates">
4992
- <fo:block xsl:use-attribute-sets="deprecates-style">
4993
- <xsl:call-template name="refine_deprecates-style"/>
4925
+ <fo:block xsl:use-attribute-sets="term-deprecates-style">
4926
+ <xsl:call-template name="refine_term-deprecates-style"/>
4994
4927
  <xsl:apply-templates/>
4995
4928
  </fo:block>
4996
4929
  </xsl:template>
@@ -5003,8 +4936,8 @@
5003
4936
  <!-- End Preferred, admitted, deprecated -->
5004
4937
 
5005
4938
  <xsl:template match="mn:fmt-related">
5006
- <fo:block role="SKIP" xsl:use-attribute-sets="related-block-style">
5007
- <xsl:call-template name="refine_related-block-style"/>
4939
+ <fo:block role="SKIP" xsl:use-attribute-sets="term-related-block-style">
4940
+ <xsl:call-template name="refine_term-related-block-style"/>
5008
4941
  <xsl:apply-templates/>
5009
4942
  </fo:block>
5010
4943
  </xsl:template>
@@ -5018,8 +4951,8 @@
5018
4951
  <!-- definition -->
5019
4952
  <!-- ========== -->
5020
4953
  <xsl:template match="mn:fmt-definition">
5021
- <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
5022
- <xsl:call-template name="refine_definition-style"/>
4954
+ <fo:block xsl:use-attribute-sets="term-definition-style" role="SKIP">
4955
+ <xsl:call-template name="refine_term-definition-style"/>
5023
4956
  <xsl:apply-templates/>
5024
4957
  </fo:block>
5025
4958
  </xsl:template>
@@ -9250,6 +9183,10 @@
9250
9183
  <!-- image -->
9251
9184
  <!-- ====== -->
9252
9185
 
9186
+ <!-- show figure's name 'before' or 'after' image -->
9187
+ <xsl:variable name="figure-name-position"><xsl:text>after</xsl:text>
9188
+ </xsl:variable>
9189
+
9253
9190
  <xsl:template match="mn:figure" name="figure">
9254
9191
  <xsl:variable name="isAdded" select="@added"/>
9255
9192
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -9262,6 +9199,10 @@
9262
9199
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
9263
9200
  </xsl:call-template>
9264
9201
 
9202
+ <xsl:if test="$figure-name-position = 'before'"> <!-- show figure's name BEFORE image -->
9203
+ <xsl:apply-templates select="mn:fmt-name"/>
9204
+ </xsl:if>
9205
+
9265
9206
  <!-- Example: Dimensions in millimeters -->
9266
9207
  <xsl:apply-templates select="mn:note[@type = 'units']"/>
9267
9208
 
@@ -9282,7 +9223,16 @@
9282
9223
  <xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
9283
9224
  <xsl:call-template name="showFigureKey"/>
9284
9225
  </xsl:if>
9285
- <xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
9226
+
9227
+ <!-- <xsl:choose>
9228
+ <xsl:when test="$namespace = 'bsi' or $namespace = 'pas' or $namespace = 'rsd'"></xsl:when>
9229
+ <xsl:otherwise>
9230
+ <xsl:apply-templates select="mn:fmt-name" /> --> <!-- show figure's name AFTER image -->
9231
+ <!-- </xsl:otherwise>
9232
+ </xsl:choose> -->
9233
+ <xsl:if test="$figure-name-position = 'after'">
9234
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
9235
+ </xsl:if>
9286
9236
 
9287
9237
  </fo:block-container>
9288
9238
  </xsl:template>
@@ -11377,7 +11327,6 @@
11377
11327
  </xsl:attribute-set>
11378
11328
 
11379
11329
  <xsl:template name="refine_references-non-normative-title-style">
11380
-
11381
11330
  </xsl:template>
11382
11331
 
11383
11332
  <!-- bibitem in Normative References (references/@normative="true") -->
@@ -13496,7 +13445,7 @@
13496
13445
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
13497
13446
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
13498
13447
  <xsl:attribute name="role">H1</xsl:attribute>
13499
- </xsl:attribute-set>
13448
+ </xsl:attribute-set> <!-- annex-title-style -->
13500
13449
 
13501
13450
  <xsl:template name="refine_annex-title-style">
13502
13451
  </xsl:template>
@@ -13507,6 +13456,113 @@
13507
13456
  <xsl:template name="refine_p-zzSTDTitle1-style">
13508
13457
  </xsl:template>
13509
13458
 
13459
+ <xsl:attribute-set name="p-style">
13460
+ <xsl:attribute name="space-after">6pt</xsl:attribute>
13461
+ <xsl:attribute name="line-height">115%</xsl:attribute>
13462
+ </xsl:attribute-set> <!-- p-style -->
13463
+
13464
+ <xsl:template name="refine_p-style">
13465
+ <xsl:param name="element-name"/>
13466
+ <xsl:param name="margin"/>
13467
+ <xsl:attribute name="text-align">
13468
+ <xsl:choose>
13469
+ <xsl:when test="ancestor::mn:quote">justify</xsl:when>
13470
+ <xsl:when test="ancestor::mn:feedback-statement">right</xsl:when>
13471
+ <xsl:when test="ancestor::mn:boilerplate and not(@align)">justify</xsl:when>
13472
+ <xsl:when test="@align = 'justified'">justify</xsl:when>
13473
+ <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
13474
+ <xsl:when test="ancestor::mn:td/@align"><xsl:value-of select="ancestor::mn:td/@align"/></xsl:when>
13475
+ <xsl:when test="ancestor::mn:th/@align"><xsl:value-of select="ancestor::mn:th/@align"/></xsl:when>
13476
+ <xsl:otherwise>justify</xsl:otherwise>
13477
+ </xsl:choose>
13478
+ </xsl:attribute>
13479
+ <xsl:call-template name="setKeepAttributes"/>
13480
+
13481
+ <xsl:if test="parent::mn:dd">
13482
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
13483
+ </xsl:if>
13484
+ <xsl:if test="ancestor::*[2][self::mn:license-statement] and not(following-sibling::mn:p)">
13485
+ <xsl:attribute name="space-after">0pt</xsl:attribute>
13486
+ </xsl:if>
13487
+
13488
+ <!-- <xsl:attribute name="border">1pt solid red</xsl:attribute> -->
13489
+ <xsl:if test="ancestor::mn:boilerplate and not(ancestor::mn:feedback-statement)">
13490
+ <xsl:attribute name="line-height">125%</xsl:attribute>
13491
+ <xsl:attribute name="space-after">14pt</xsl:attribute>
13492
+ </xsl:if>
13493
+ <xsl:if test="following-sibling::*[1][self::mn:ol or self::mn:ul or self::mn:note or self::mn:termnote or self::mn:example or self::mn:dl]">
13494
+ <xsl:attribute name="space-after">3pt</xsl:attribute>
13495
+ </xsl:if>
13496
+ <xsl:if test="following-sibling::*[1][self::mn:dl]">
13497
+ <xsl:attribute name="space-after">6pt</xsl:attribute>
13498
+ </xsl:if>
13499
+ <xsl:if test="ancestor::mn:quote">
13500
+ <xsl:attribute name="line-height">130%</xsl:attribute>
13501
+ <!-- <xsl:attribute name="margin-bottom">12pt</xsl:attribute> -->
13502
+ </xsl:if>
13503
+
13504
+ <xsl:if test="ancestor::*[self::mn:recommendation or self::mn:requirement or self::mn:permission] and not(following-sibling::*)">
13505
+ <xsl:attribute name="space-after">0pt</xsl:attribute>
13506
+ </xsl:if>
13507
+
13508
+ <xsl:if test="ancestor::mn:li and ancestor::mn:table">
13509
+ <xsl:attribute name="space-after">0pt</xsl:attribute>
13510
+ </xsl:if>
13511
+
13512
+ <xsl:if test=".//mn:fn">
13513
+ <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
13514
+ </xsl:if>
13515
+
13516
+ <xsl:copy-of select="@id"/>
13517
+ <!-- $namespace = 'iho' -->
13518
+
13519
+ </xsl:template> <!-- refine_p-style -->
13520
+
13521
+ <xsl:attribute-set name="title-style">
13522
+ <!-- Note: font-size for level 1 title -->
13523
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
13524
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
13525
+ <xsl:attribute name="space-before">24pt</xsl:attribute>
13526
+ <xsl:attribute name="space-after">10pt</xsl:attribute>
13527
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
13528
+ </xsl:attribute-set> <!-- title-style -->
13529
+
13530
+ <xsl:template name="refine_title-style">
13531
+ <xsl:param name="element-name"/>
13532
+ <xsl:variable name="level">
13533
+ <xsl:call-template name="getLevel"/>
13534
+ </xsl:variable>
13535
+ <xsl:choose>
13536
+ <xsl:when test="@type = 'floating-title' or @type = 'section-title'">
13537
+ <xsl:copy-of select="@id"/>
13538
+ </xsl:when>
13539
+ <xsl:otherwise>
13540
+ <xsl:for-each select="parent::mn:clause">
13541
+ <xsl:call-template name="setId"/>
13542
+ </xsl:for-each>
13543
+ </xsl:otherwise>
13544
+ </xsl:choose>
13545
+
13546
+ <xsl:if test="$level = 2">
13547
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
13548
+ <xsl:attribute name="space-before">24pt</xsl:attribute>
13549
+ <xsl:if test="../preceding-sibling::*[1][self::mn:fmt-title]">
13550
+ <xsl:attribute name="space-before">10pt</xsl:attribute>
13551
+ </xsl:if>
13552
+ </xsl:if>
13553
+ <xsl:if test="$level &gt;= 3">
13554
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
13555
+ <xsl:attribute name="space-before">6pt</xsl:attribute>
13556
+ <xsl:attribute name="space-after">6pt</xsl:attribute>
13557
+ </xsl:if>
13558
+
13559
+ <xsl:if test="../@id = '_document_history' or . = 'Document History'">
13560
+ <xsl:attribute name="text-align">center</xsl:attribute>
13561
+ </xsl:if>
13562
+ <!-- $namespace = 'iho' -->
13563
+ <xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
13564
+ </xsl:template> <!-- refine_title-style -->
13565
+
13510
13566
  <xsl:template name="processPrefaceSectionsDefault">
13511
13567
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
13512
13568
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -13845,6 +13901,12 @@
13845
13901
  </xsl:choose>
13846
13902
  </xsl:template>
13847
13903
 
13904
+ <xsl:attribute-set name="reset-margins-style">
13905
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
13906
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
13907
+ <xsl:attribute name="role">SKIP</xsl:attribute>
13908
+ </xsl:attribute-set>
13909
+
13848
13910
  <xsl:attribute-set name="clause-style">
13849
13911
 
13850
13912
  </xsl:attribute-set>
@@ -14856,8 +14918,9 @@
14856
14918
 
14857
14919
  <xsl:template name="setTextAlignment">
14858
14920
  <xsl:param name="default">left</xsl:param>
14921
+ <xsl:param name="skip_default">false</xsl:param>
14859
14922
  <xsl:variable name="align" select="normalize-space(@align)"/>
14860
- <xsl:attribute name="text-align">
14923
+ <xsl:variable name="text_align">
14861
14924
  <xsl:choose>
14862
14925
  <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
14863
14926
  <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
@@ -14865,9 +14928,13 @@
14865
14928
  <xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
14866
14929
  <xsl:when test="ancestor::mn:td/@align"><xsl:value-of select="ancestor::mn:td/@align"/></xsl:when>
14867
14930
  <xsl:when test="ancestor::mn:th/@align"><xsl:value-of select="ancestor::mn:th/@align"/></xsl:when>
14931
+ <xsl:when test="$skip_default = 'true'"/>
14868
14932
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
14869
14933
  </xsl:choose>
14870
- </xsl:attribute>
14934
+ </xsl:variable>
14935
+ <xsl:if test="normalize-space($text_align) != ''">
14936
+ <xsl:attribute name="text-align"><xsl:value-of select="$text_align"/></xsl:attribute>
14937
+ </xsl:if>
14871
14938
  <xsl:if test="$align = 'indent'">
14872
14939
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
14873
14940
  </xsl:if>
@@ -14875,8 +14942,10 @@
14875
14942
 
14876
14943
  <xsl:template name="setBlockAttributes">
14877
14944
  <xsl:param name="text_align_default">left</xsl:param>
14945
+ <xsl:param name="skip_text_align_default">false</xsl:param>
14878
14946
  <xsl:call-template name="setTextAlignment">
14879
14947
  <xsl:with-param name="default" select="$text_align_default"/>
14948
+ <xsl:with-param name="skip_default" select="$skip_text_align_default"/>
14880
14949
  </xsl:call-template>
14881
14950
  <xsl:call-template name="setKeepAttributes"/>
14882
14951
  <xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
@@ -14919,6 +14988,20 @@
14919
14988
  </fo:block-container>
14920
14989
  </xsl:template>
14921
14990
 
14991
+ <!-- for https://github.com/metanorma/mn-native-pdf/issues/845 -->
14992
+ <xsl:template name="insertCoverPageFullImage">
14993
+ <xsl:param name="name">coverpage-image</xsl:param>
14994
+ <xsl:for-each select="//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = $name][1]/mn:value/mn:image">
14995
+ <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
14996
+ <fo:flow flow-name="xsl-region-body">
14997
+ <xsl:call-template name="insertBackgroundPageImage">
14998
+ <xsl:with-param name="number" select="position()"/>
14999
+ </xsl:call-template>
15000
+ </fo:flow>
15001
+ </fo:page-sequence>
15002
+ </xsl:for-each>
15003
+ </xsl:template>
15004
+
14922
15005
  <xsl:template name="insertPageImage">
14923
15006
  <xsl:param name="svg_content_height" select="$pageHeight"/>
14924
15007
  <xsl:param name="bitmap_width" select="$pageWidth"/>