metanorma-taste 0.1.6 → 0.1.9

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.
@@ -210,40 +210,47 @@
210
210
 
211
211
  <xsl:template name="cover-page">
212
212
  <!-- Cover Page -->
213
- <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
214
- <xsl:call-template name="insertFootnoteSeparatorCommon"/>
215
- <fo:static-content flow-name="cover-page-header">
216
- <fo:block-container height="2.5mm" background-color="rgb(55, 243, 244)">
217
- <fo:block font-size="1pt"> </fo:block>
218
- </fo:block-container>
219
- <fo:block-container position="absolute" top="2.5mm" height="{279.4 - 2.5}mm" width="100%" background-color="rgb(80, 203, 205)">
220
- <fo:block> </fo:block>
221
- </fo:block-container>
222
- </fo:static-content>
213
+ <xsl:choose>
214
+ <xsl:when test="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = 'coverpage-image']/mn:value/mn:image and normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:full-coverpage-replacement) = 'true'">
215
+ <xsl:call-template name="insertCoverPageFullImage"/>
216
+ </xsl:when>
217
+ <xsl:otherwise>
218
+ <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
219
+ <xsl:call-template name="insertFootnoteSeparatorCommon"/>
220
+ <fo:static-content flow-name="cover-page-header">
221
+ <fo:block-container height="2.5mm" background-color="rgb(55, 243, 244)">
222
+ <fo:block font-size="1pt"> </fo:block>
223
+ </fo:block-container>
224
+ <fo:block-container position="absolute" top="2.5mm" height="{279.4 - 2.5}mm" width="100%" background-color="rgb(80, 203, 205)">
225
+ <fo:block> </fo:block>
226
+ </fo:block-container>
227
+ </fo:static-content>
223
228
 
224
- <fo:flow flow-name="xsl-region-body">
229
+ <fo:flow flow-name="xsl-region-body">
225
230
 
226
- <fo:block-container width="136mm" margin-bottom="12pt">
227
- <fo:block font-size="36pt" font-weight="bold" color="rgb(54, 59, 74)" role="H1">
228
- <xsl:value-of select="/mn:metanorma/mn:bibdata/mn:title[@language = 'en']"/>
229
- </fo:block>
230
- </fo:block-container>
231
+ <fo:block-container width="136mm" margin-bottom="12pt">
232
+ <fo:block font-size="36pt" font-weight="bold" color="rgb(54, 59, 74)" role="H1">
233
+ <xsl:value-of select="/mn:metanorma/mn:bibdata/mn:title[@language = 'en']"/>
234
+ </fo:block>
235
+ </fo:block-container>
231
236
 
232
- <fo:block font-size="26pt" color="rgb(55, 60, 75)" role="H2">
233
- <xsl:value-of select="/mn:metanorma/mn:bibdata/mn:title[@language = 'en' and @type = 'subtitle']"/>
234
- </fo:block>
237
+ <fo:block font-size="26pt" color="rgb(55, 60, 75)" role="H2">
238
+ <xsl:value-of select="/mn:metanorma/mn:bibdata/mn:title[@language = 'en' and @type = 'subtitle']"/>
239
+ </fo:block>
235
240
 
236
- <fo:block-container absolute-position="fixed" left="11mm" top="245mm">
237
- <fo:block>
238
- <!-- <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Logo))}" width="42mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/> -->
239
- <fo:instream-foreign-object content-width="42mm" fox:alt-text="CSA Logo">
240
- <xsl:copy-of select="$Image-Logo-SVG"/>
241
- </fo:instream-foreign-object>
242
- </fo:block>
243
- </fo:block-container>
241
+ <fo:block-container absolute-position="fixed" left="11mm" top="245mm">
242
+ <fo:block>
243
+ <!-- <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Logo))}" width="42mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/> -->
244
+ <fo:instream-foreign-object content-width="42mm" fox:alt-text="CSA Logo">
245
+ <xsl:copy-of select="$Image-Logo-SVG"/>
246
+ </fo:instream-foreign-object>
247
+ </fo:block>
248
+ </fo:block-container>
244
249
 
245
- </fo:flow>
246
- </fo:page-sequence>
250
+ </fo:flow>
251
+ </fo:page-sequence>
252
+ </xsl:otherwise>
253
+ </xsl:choose>
247
254
  </xsl:template> <!-- END: cover-page -->
248
255
 
249
256
  <xsl:template name="inner-cover-page">
@@ -443,21 +450,6 @@
443
450
  <!-- ====== -->
444
451
  <!-- title -->
445
452
  <!-- ====== -->
446
- <xsl:template match="mn:annex/mn:fmt-title">
447
- <xsl:variable name="level">
448
- <xsl:call-template name="getLevel"/>
449
- </xsl:variable>
450
- <xsl:variable name="color">
451
- <xsl:choose>
452
- <xsl:when test="$level &gt;= 2">rgb(3, 115, 200)</xsl:when>
453
- <xsl:otherwise>black</xsl:otherwise>
454
- </xsl:choose>
455
- </xsl:variable>
456
- <fo:block font-size="12pt" text-align="center" margin-bottom="12pt" keep-with-next="always" color="{$color}" role="H{$level}">
457
- <xsl:apply-templates/>
458
- <xsl:apply-templates select="following-sibling::*[1][self::mn:variant-title][@type = 'sub']" mode="subtitle"/>
459
- </fo:block>
460
- </xsl:template>
461
453
 
462
454
  <xsl:template match="mn:fmt-title" name="title">
463
455
 
@@ -465,25 +457,6 @@
465
457
  <xsl:call-template name="getLevel"/>
466
458
  </xsl:variable>
467
459
 
468
- <xsl:variable name="font-size">
469
- <xsl:choose>
470
- <xsl:when test="ancestor::mn:preface and $level &gt;= 2">12pt</xsl:when>
471
- <xsl:when test="ancestor::mn:preface">13pt</xsl:when>
472
- <xsl:when test="$level = 1">26pt</xsl:when>
473
- <xsl:when test="$level = 2 and ancestor::mn:terms">11pt</xsl:when>
474
- <xsl:when test="$level = 2">14pt</xsl:when>
475
- <xsl:when test="$level &gt;= 3">11pt</xsl:when>
476
- <xsl:otherwise>16pt</xsl:otherwise>
477
- </xsl:choose>
478
- </xsl:variable>
479
-
480
- <xsl:variable name="font-weight">
481
- <xsl:choose>
482
- <xsl:when test="$level = 1">normal</xsl:when>
483
- <xsl:otherwise>bold</xsl:otherwise>
484
- </xsl:choose>
485
- </xsl:variable>
486
-
487
460
  <xsl:variable name="element-name">
488
461
  <xsl:choose>
489
462
  <xsl:when test="../@inline-header = 'true'">fo:inline</xsl:when>
@@ -491,22 +464,12 @@
491
464
  </xsl:choose>
492
465
  </xsl:variable>
493
466
 
494
- <xsl:variable name="color">
495
- <xsl:choose>
496
- <xsl:when test="$level &gt;= 2">rgb(3, 115, 200)</xsl:when>
497
- <xsl:otherwise>black</xsl:otherwise>
498
- </xsl:choose>
467
+ <xsl:variable name="title_styles">
468
+ <styles xsl:use-attribute-sets="title-style"><xsl:call-template name="refine_title-style"/></styles>
499
469
  </xsl:variable>
500
470
 
501
471
  <xsl:element name="{$element-name}">
502
- <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
503
- <xsl:attribute name="font-weight"><xsl:value-of select="$font-weight"/></xsl:attribute>
504
- <xsl:attribute name="space-before">13.5pt</xsl:attribute>
505
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
506
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
507
- <xsl:attribute name="color"><xsl:value-of select="$color"/></xsl:attribute>
508
- <xsl:attribute name="line-height">120%</xsl:attribute>
509
- <xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
472
+ <xsl:copy-of select="xalan:nodeset($title_styles)/styles/@*"/>
510
473
 
511
474
  <xsl:if test="$level = 2">
512
475
  <fo:inline padding-right="1mm">
@@ -535,20 +498,16 @@
535
498
  <xsl:otherwise>fo:block</xsl:otherwise>
536
499
  </xsl:choose>
537
500
  </xsl:variable>
538
- <xsl:element name="{$element-name}">
539
- <xsl:attribute name="id">
540
- <xsl:value-of select="@id"/>
541
- </xsl:attribute>
542
501
 
543
- <xsl:call-template name="setBlockAttributes"/>
502
+ <xsl:variable name="p_styles">
503
+ <styles xsl:use-attribute-sets="p-style">
504
+ <xsl:call-template name="refine_p-style"><xsl:with-param name="element-name" select="$element-name"/></xsl:call-template>
505
+ </styles>
506
+ </xsl:variable>
507
+
508
+ <xsl:element name="{$element-name}">
509
+ <xsl:copy-of select="xalan:nodeset($p_styles)/styles/@*"/>
544
510
 
545
- <xsl:attribute name="space-after">
546
- <xsl:choose>
547
- <xsl:when test="ancestor::mn:li">0pt</xsl:when>
548
- <xsl:otherwise>12pt</xsl:otherwise>
549
- </xsl:choose>
550
- </xsl:attribute>
551
- <xsl:attribute name="line-height">155%</xsl:attribute>
552
511
  <xsl:apply-templates>
553
512
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
554
513
  </xsl:apply-templates>
@@ -2634,6 +2593,10 @@
2634
2593
  </xsl:element>
2635
2594
  </xsl:template>
2636
2595
 
2596
+ <!-- show sourcecode's name 'before' or 'after' source code -->
2597
+ <xsl:variable name="sourcecode-name-position"><xsl:text>after</xsl:text>
2598
+ </xsl:variable>
2599
+
2637
2600
  <xsl:template match="mn:sourcecode" name="sourcecode">
2638
2601
 
2639
2602
  <xsl:variable name="sourcecode_attributes">
@@ -2657,7 +2620,12 @@
2657
2620
 
2658
2621
  <xsl:call-template name="refine_sourcecode-container-style"/>
2659
2622
 
2660
- <fo:block-container margin-left="0mm" role="SKIP">
2623
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
2624
+
2625
+ <!-- <xsl:if test="$namespace = 'rsd'"> -->
2626
+ <xsl:if test="$sourcecode-name-position = 'before'">
2627
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name BEFORE content -->
2628
+ </xsl:if>
2661
2629
 
2662
2630
  <fo:block xsl:use-attribute-sets="sourcecode-style">
2663
2631
 
@@ -2679,7 +2647,16 @@
2679
2647
  </fo:block>
2680
2648
 
2681
2649
  <xsl:apply-templates select="mn:dl"/> <!-- Key table -->
2682
- <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
2650
+
2651
+ <!-- <xsl:choose>
2652
+ <xsl:when test="$namespace = 'rsd'"></xsl:when>
2653
+ <xsl:otherwise>
2654
+ <xsl:apply-templates select="mn:fmt-name" /> --><!-- show sourcecode's name AFTER content -->
2655
+ <!-- </xsl:otherwise>
2656
+ </xsl:choose> -->
2657
+ <xsl:if test="$sourcecode-name-position = 'after'">
2658
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
2659
+ </xsl:if>
2683
2660
 
2684
2661
  </fo:block-container>
2685
2662
  </fo:block-container>
@@ -3936,89 +3913,83 @@
3936
3913
  <xsl:template name="refine_term-style">
3937
3914
  </xsl:template>
3938
3915
 
3939
- <xsl:attribute-set name="term-name-style">
3916
+ <xsl:attribute-set name="term-number-style">
3940
3917
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3941
3918
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3942
3919
  </xsl:attribute-set> <!-- term-name-style -->
3943
3920
 
3944
- <xsl:template name="refine_term-name-style">
3921
+ <xsl:template name="refine_term-number-style">
3945
3922
  </xsl:template>
3946
3923
 
3947
- <xsl:attribute-set name="preferred-style">
3948
- </xsl:attribute-set> <!-- preferred-style -->
3949
-
3950
- <xsl:template name="refine_preferred-style">
3951
- </xsl:template>
3952
-
3953
- <xsl:attribute-set name="preferred-block-style">
3924
+ <xsl:attribute-set name="term-preferred-block-style">
3954
3925
  </xsl:attribute-set> <!-- preferred-block-style -->
3955
3926
 
3956
- <xsl:template name="refine_preferred-block-style">
3927
+ <xsl:template name="refine_term-preferred-block-style">
3957
3928
  </xsl:template>
3958
3929
 
3959
- <xsl:attribute-set name="preferred-term-style">
3930
+ <xsl:attribute-set name="term-preferred-style">
3960
3931
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3961
3932
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3962
3933
  <xsl:attribute name="line-height">1</xsl:attribute>
3963
3934
  </xsl:attribute-set> <!-- preferred-term-style -->
3964
3935
 
3965
- <xsl:template name="refine_preferred-term-style">
3936
+ <xsl:template name="refine_term-preferred-style">
3966
3937
  <xsl:if test="mn:strong">
3967
3938
  <xsl:attribute name="font-weight">normal</xsl:attribute>
3968
3939
  </xsl:if>
3969
3940
  </xsl:template>
3970
3941
 
3971
- <xsl:attribute-set name="domain-style">
3972
- </xsl:attribute-set> <!-- domain-style -->
3942
+ <xsl:attribute-set name="term-domain-style">
3943
+ </xsl:attribute-set> <!-- term-domain-style -->
3973
3944
 
3974
- <xsl:template name="refine_domain-style">
3945
+ <xsl:template name="refine_term-domain-style">
3975
3946
  </xsl:template>
3976
3947
 
3977
- <xsl:attribute-set name="admitted-style">
3978
- </xsl:attribute-set> <!-- admitted-style -->
3948
+ <xsl:attribute-set name="term-admitted-style">
3949
+ </xsl:attribute-set> <!-- term-admitted-style -->
3979
3950
 
3980
- <xsl:template name="refine_admitted-style">
3951
+ <xsl:template name="refine_term-admitted-style">
3981
3952
  </xsl:template>
3982
3953
 
3983
- <xsl:attribute-set name="deprecates-style">
3984
- </xsl:attribute-set> <!-- deprecates-style -->
3954
+ <xsl:attribute-set name="term-deprecates-style">
3955
+ </xsl:attribute-set> <!-- term-deprecates-style -->
3985
3956
 
3986
- <xsl:template name="refine_deprecates-style">
3957
+ <xsl:template name="refine_term-deprecates-style">
3987
3958
  </xsl:template>
3988
3959
 
3989
- <xsl:attribute-set name="related-block-style" use-attribute-sets="preferred-block-style">
3960
+ <xsl:attribute-set name="term-related-block-style" use-attribute-sets="term-preferred-block-style">
3990
3961
  </xsl:attribute-set>
3991
3962
 
3992
- <xsl:template name="refine_related-block-style">
3963
+ <xsl:template name="refine_term-related-block-style">
3993
3964
  </xsl:template>
3994
3965
 
3995
- <xsl:attribute-set name="definition-style">
3966
+ <xsl:attribute-set name="term-definition-style">
3996
3967
  <xsl:attribute name="space-after">6pt</xsl:attribute>
3997
- </xsl:attribute-set> <!-- definition-style -->
3968
+ </xsl:attribute-set> <!-- term-definition-style -->
3998
3969
 
3999
- <xsl:template name="refine_definition-style">
3970
+ <xsl:template name="refine_term-definition-style">
4000
3971
  </xsl:template>
4001
3972
 
4002
- <xsl:attribute-set name="termsource-style">
3973
+ <xsl:attribute-set name="term-termsource-style">
4003
3974
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
4004
3975
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
4005
- </xsl:attribute-set> <!-- termsource-style -->
3976
+ </xsl:attribute-set> <!-- term-termsource-style -->
4006
3977
 
4007
- <xsl:template name="refine_termsource-style">
4008
- </xsl:template> <!-- refine_termsource-style -->
3978
+ <xsl:template name="refine_term-termsource-style">
3979
+ </xsl:template> <!-- refine_term-termsource-style -->
4009
3980
 
4010
- <xsl:attribute-set name="termsource-text-style">
4011
- </xsl:attribute-set> <!-- termsource-text-style -->
3981
+ <xsl:attribute-set name="term-termsource-text-style">
3982
+ </xsl:attribute-set> <!-- term-termsource-text-style -->
4012
3983
 
4013
- <xsl:template name="refine_termsource-text-style">
3984
+ <xsl:template name="refine_term-termsource-text-style">
4014
3985
  </xsl:template>
4015
3986
 
4016
- <xsl:attribute-set name="origin-style">
3987
+ <xsl:attribute-set name="term-origin-style">
4017
3988
  <xsl:attribute name="color">rgb(33, 94, 159)</xsl:attribute>
4018
3989
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
4019
- </xsl:attribute-set> <!-- origin-style -->
3990
+ </xsl:attribute-set> <!-- term-origin-style -->
4020
3991
 
4021
- <xsl:template name="refine_origin-style">
3992
+ <xsl:template name="refine_term-origin-style">
4022
3993
  </xsl:template>
4023
3994
 
4024
3995
  <!-- ====== -->
@@ -4062,9 +4033,9 @@
4062
4033
  <!-- modification -->
4063
4034
  <!-- ====== -->
4064
4035
  <xsl:template match="mn:fmt-termsource" name="termsource">
4065
- <fo:block xsl:use-attribute-sets="termsource-style">
4036
+ <fo:block xsl:use-attribute-sets="term-termsource-style">
4066
4037
 
4067
- <xsl:call-template name="refine_termsource-style"/>
4038
+ <xsl:call-template name="refine_term-termsource-style"/>
4068
4039
 
4069
4040
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
4070
4041
  <xsl:variable name="termsource_text">
@@ -4112,8 +4083,8 @@
4112
4083
 
4113
4084
  <!-- text SOURCE: -->
4114
4085
  <xsl:template match="mn:fmt-termsource/mn:strong[1][following-sibling::*[1][self::mn:fmt-origin]]/text()">
4115
- <fo:inline xsl:use-attribute-sets="termsource-text-style">
4116
- <xsl:call-template name="refine_termsource-text-style"/>
4086
+ <fo:inline xsl:use-attribute-sets="term-termsource-text-style">
4087
+ <xsl:call-template name="refine_term-termsource-text-style"/>
4117
4088
  <xsl:value-of select="."/>
4118
4089
  </fo:inline>
4119
4090
  </xsl:template>
@@ -4125,8 +4096,8 @@
4125
4096
  <xsl:if test="normalize-space(@citeas) = ''">
4126
4097
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
4127
4098
  </xsl:if>
4128
- <fo:inline xsl:use-attribute-sets="origin-style">
4129
- <xsl:call-template name="refine_origin-style"/>
4099
+ <fo:inline xsl:use-attribute-sets="term-origin-style">
4100
+ <xsl:call-template name="refine_term-origin-style"/>
4130
4101
  <xsl:apply-templates/>
4131
4102
  </fo:inline>
4132
4103
  </fo:basic-link>
@@ -4179,14 +4150,14 @@
4179
4150
  <xsl:variable name="levelTerm">
4180
4151
  <xsl:call-template name="getLevelTermName"/>
4181
4152
  </xsl:variable>
4182
- <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
4153
+ <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="term-preferred-block-style">
4183
4154
 
4184
- <xsl:call-template name="refine_preferred-block-style"/>
4155
+ <xsl:call-template name="refine_term-preferred-block-style"/>
4185
4156
 
4186
4157
  <xsl:if test="parent::mn:term and not(preceding-sibling::mn:fmt-preferred)"> <!-- if first preffered in term, then display term's name -->
4187
4158
 
4188
- <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
4189
- <xsl:call-template name="refine_term-name-style"/>
4159
+ <fo:block xsl:use-attribute-sets="term-number-style" role="SKIP">
4160
+ <xsl:call-template name="refine_term-number-style"/>
4190
4161
 
4191
4162
  <xsl:for-each select="ancestor::mn:term[1]/mn:fmt-name"><!-- change context -->
4192
4163
  <xsl:call-template name="setIDforNamedDestination"/>
@@ -4196,8 +4167,8 @@
4196
4167
  </fo:block>
4197
4168
  </xsl:if>
4198
4169
 
4199
- <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
4200
- <xsl:call-template name="refine_preferred-term-style"/>
4170
+ <fo:block xsl:use-attribute-sets="term-preferred-style" role="SKIP">
4171
+ <xsl:call-template name="refine_term-preferred-style"/>
4201
4172
 
4202
4173
  <xsl:apply-templates/>
4203
4174
  </fo:block>
@@ -4217,15 +4188,15 @@
4217
4188
  <xsl:template match="mn:domain"/>
4218
4189
 
4219
4190
  <xsl:template match="mn:fmt-admitted">
4220
- <fo:block xsl:use-attribute-sets="admitted-style">
4221
- <xsl:call-template name="refine_admitted-style"/>
4191
+ <fo:block xsl:use-attribute-sets="term-admitted-style">
4192
+ <xsl:call-template name="refine_term-admitted-style"/>
4222
4193
  <xsl:apply-templates/>
4223
4194
  </fo:block>
4224
4195
  </xsl:template>
4225
4196
 
4226
4197
  <xsl:template match="mn:fmt-deprecates">
4227
- <fo:block xsl:use-attribute-sets="deprecates-style">
4228
- <xsl:call-template name="refine_deprecates-style"/>
4198
+ <fo:block xsl:use-attribute-sets="term-deprecates-style">
4199
+ <xsl:call-template name="refine_term-deprecates-style"/>
4229
4200
  <xsl:apply-templates/>
4230
4201
  </fo:block>
4231
4202
  </xsl:template>
@@ -4238,8 +4209,8 @@
4238
4209
  <!-- End Preferred, admitted, deprecated -->
4239
4210
 
4240
4211
  <xsl:template match="mn:fmt-related">
4241
- <fo:block role="SKIP" xsl:use-attribute-sets="related-block-style">
4242
- <xsl:call-template name="refine_related-block-style"/>
4212
+ <fo:block role="SKIP" xsl:use-attribute-sets="term-related-block-style">
4213
+ <xsl:call-template name="refine_term-related-block-style"/>
4243
4214
  <xsl:apply-templates/>
4244
4215
  </fo:block>
4245
4216
  </xsl:template>
@@ -4253,8 +4224,8 @@
4253
4224
  <!-- definition -->
4254
4225
  <!-- ========== -->
4255
4226
  <xsl:template match="mn:fmt-definition">
4256
- <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
4257
- <xsl:call-template name="refine_definition-style"/>
4227
+ <fo:block xsl:use-attribute-sets="term-definition-style" role="SKIP">
4228
+ <xsl:call-template name="refine_term-definition-style"/>
4258
4229
  <xsl:apply-templates/>
4259
4230
  </fo:block>
4260
4231
  </xsl:template>
@@ -8449,6 +8420,10 @@
8449
8420
  <!-- image -->
8450
8421
  <!-- ====== -->
8451
8422
 
8423
+ <!-- show figure's name 'before' or 'after' image -->
8424
+ <xsl:variable name="figure-name-position"><xsl:text>after</xsl:text>
8425
+ </xsl:variable>
8426
+
8452
8427
  <xsl:template match="mn:figure" name="figure">
8453
8428
  <xsl:variable name="isAdded" select="@added"/>
8454
8429
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -8461,6 +8436,10 @@
8461
8436
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
8462
8437
  </xsl:call-template>
8463
8438
 
8439
+ <xsl:if test="$figure-name-position = 'before'"> <!-- show figure's name BEFORE image -->
8440
+ <xsl:apply-templates select="mn:fmt-name"/>
8441
+ </xsl:if>
8442
+
8464
8443
  <!-- Example: Dimensions in millimeters -->
8465
8444
  <xsl:apply-templates select="mn:note[@type = 'units']"/>
8466
8445
 
@@ -8481,7 +8460,16 @@
8481
8460
  <xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
8482
8461
  <xsl:call-template name="showFigureKey"/>
8483
8462
  </xsl:if>
8484
- <xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
8463
+
8464
+ <!-- <xsl:choose>
8465
+ <xsl:when test="$namespace = 'bsi' or $namespace = 'pas' or $namespace = 'rsd'"></xsl:when>
8466
+ <xsl:otherwise>
8467
+ <xsl:apply-templates select="mn:fmt-name" /> --> <!-- show figure's name AFTER image -->
8468
+ <!-- </xsl:otherwise>
8469
+ </xsl:choose> -->
8470
+ <xsl:if test="$figure-name-position = 'after'">
8471
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
8472
+ </xsl:if>
8485
8473
 
8486
8474
  </fo:block-container>
8487
8475
  </xsl:template>
@@ -10559,11 +10547,10 @@
10559
10547
  <!-- END Admonition -->
10560
10548
  <!-- ================ -->
10561
10549
 
10562
- <xsl:attribute-set name="references-non-normative-title-style">
10550
+ <xsl:attribute-set name="bibliography-title-style">
10563
10551
  </xsl:attribute-set>
10564
10552
 
10565
- <xsl:template name="refine_references-non-normative-title-style">
10566
-
10553
+ <xsl:template name="refine_bibliography-title-style">
10567
10554
  </xsl:template>
10568
10555
 
10569
10556
  <!-- bibitem in Normative References (references/@normative="true") -->
@@ -12613,7 +12600,13 @@
12613
12600
  <!-- ===================================== -->
12614
12601
 
12615
12602
  <xsl:attribute-set name="annex-title-style">
12616
- </xsl:attribute-set>
12603
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
12604
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
12605
+ <xsl:attribute name="text-align">center</xsl:attribute>
12606
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
12607
+ <xsl:attribute name="color">black</xsl:attribute>
12608
+ <xsl:attribute name="role">H1</xsl:attribute>
12609
+ </xsl:attribute-set> <!-- annex-title-style -->
12617
12610
 
12618
12611
  <xsl:template name="refine_annex-title-style">
12619
12612
  </xsl:template>
@@ -12624,6 +12617,77 @@
12624
12617
  <xsl:template name="refine_p-zzSTDTitle1-style">
12625
12618
  </xsl:template>
12626
12619
 
12620
+ <xsl:attribute-set name="p-style">
12621
+ <xsl:attribute name="line-height">155%</xsl:attribute>
12622
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
12623
+ </xsl:attribute-set> <!-- p-style -->
12624
+
12625
+ <xsl:template name="refine_p-style">
12626
+ <xsl:param name="element-name"/>
12627
+ <xsl:param name="margin"/>
12628
+ <xsl:copy-of select="@id"/>
12629
+ <xsl:call-template name="setBlockAttributes"/>
12630
+
12631
+ <xsl:if test="ancestor::mn:li">
12632
+ <xsl:attribute name="space-after">0pt</xsl:attribute>
12633
+ </xsl:if>
12634
+ <!-- $namespace = 'csa' -->
12635
+
12636
+ </xsl:template> <!-- refine_p-style -->
12637
+
12638
+ <xsl:attribute-set name="title-style">
12639
+ <!-- Note: font-size for level 1 title -->
12640
+ <xsl:attribute name="font-size">26pt</xsl:attribute>
12641
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
12642
+ <xsl:attribute name="space-before">13.5pt</xsl:attribute>
12643
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
12644
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
12645
+ <xsl:attribute name="color">black</xsl:attribute>
12646
+ <xsl:attribute name="line-height">120%</xsl:attribute>
12647
+ </xsl:attribute-set> <!-- title-style -->
12648
+
12649
+ <xsl:template name="refine_title-style">
12650
+ <xsl:param name="element-name"/>
12651
+ <xsl:variable name="level">
12652
+ <xsl:call-template name="getLevel"/>
12653
+ </xsl:variable>
12654
+ <xsl:if test="$level &gt; 1">
12655
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
12656
+ </xsl:if>
12657
+ <xsl:if test="$level = 2">
12658
+ <xsl:attribute name="font-size">14pt</xsl:attribute>
12659
+ <xsl:if test="ancestor::mn:terms">
12660
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
12661
+ </xsl:if>
12662
+ </xsl:if>
12663
+ <xsl:if test="$level &gt;= 2">
12664
+ <xsl:attribute name="color">rgb(3, 115, 200)</xsl:attribute>
12665
+ </xsl:if>
12666
+ <xsl:if test="$level &gt;= 3">
12667
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
12668
+ </xsl:if>
12669
+ <xsl:if test="ancestor::mn:preface">
12670
+ <xsl:attribute name="font-size">13pt</xsl:attribute>
12671
+ <xsl:if test="$level &gt;= 2">
12672
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
12673
+ </xsl:if>
12674
+ </xsl:if>
12675
+ <xsl:if test="parent::mn:annex"><!-- Annex title -->
12676
+ <xsl:variable name="annex_title_styles">
12677
+ <styles xsl:use-attribute-sets="annex-title-style"><xsl:call-template name="refine_annex-title-style"/></styles>
12678
+ </xsl:variable>
12679
+ <xsl:copy-of select="xalan:nodeset($annex_title_styles)/styles/@*"/>
12680
+ </xsl:if>
12681
+ <xsl:if test="parent::mn:references[not(@normative='true')]"><!-- Bibliography section title -->
12682
+ <xsl:variable name="bibliography_title_styles">
12683
+ <styles xsl:use-attribute-sets="bibliography-title-style"><xsl:call-template name="refine_bibliography-title-style"/></styles>
12684
+ </xsl:variable>
12685
+ <xsl:copy-of select="xalan:nodeset($bibliography_title_styles)/styles/@*"/>
12686
+ </xsl:if>
12687
+ <!-- $namespace = 'csa' -->
12688
+ <xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
12689
+ </xsl:template> <!-- refine_title-style -->
12690
+
12627
12691
  <xsl:template name="processPrefaceSectionsDefault">
12628
12692
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
12629
12693
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -12962,6 +13026,12 @@
12962
13026
  </xsl:choose>
12963
13027
  </xsl:template>
12964
13028
 
13029
+ <xsl:attribute-set name="reset-margins-style">
13030
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
13031
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
13032
+ <xsl:attribute name="role">SKIP</xsl:attribute>
13033
+ </xsl:attribute-set>
13034
+
12965
13035
  <xsl:attribute-set name="clause-style">
12966
13036
 
12967
13037
  </xsl:attribute-set>
@@ -13977,8 +14047,9 @@
13977
14047
 
13978
14048
  <xsl:template name="setTextAlignment">
13979
14049
  <xsl:param name="default">left</xsl:param>
14050
+ <xsl:param name="skip_default">false</xsl:param>
13980
14051
  <xsl:variable name="align" select="normalize-space(@align)"/>
13981
- <xsl:attribute name="text-align">
14052
+ <xsl:variable name="text_align">
13982
14053
  <xsl:choose>
13983
14054
  <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
13984
14055
  <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
@@ -13986,9 +14057,13 @@
13986
14057
  <xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
13987
14058
  <xsl:when test="ancestor::mn:td/@align"><xsl:value-of select="ancestor::mn:td/@align"/></xsl:when>
13988
14059
  <xsl:when test="ancestor::mn:th/@align"><xsl:value-of select="ancestor::mn:th/@align"/></xsl:when>
14060
+ <xsl:when test="$skip_default = 'true'"/>
13989
14061
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
13990
14062
  </xsl:choose>
13991
- </xsl:attribute>
14063
+ </xsl:variable>
14064
+ <xsl:if test="normalize-space($text_align) != ''">
14065
+ <xsl:attribute name="text-align"><xsl:value-of select="$text_align"/></xsl:attribute>
14066
+ </xsl:if>
13992
14067
  <xsl:if test="$align = 'indent'">
13993
14068
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
13994
14069
  </xsl:if>
@@ -13996,8 +14071,10 @@
13996
14071
 
13997
14072
  <xsl:template name="setBlockAttributes">
13998
14073
  <xsl:param name="text_align_default">left</xsl:param>
14074
+ <xsl:param name="skip_text_align_default">false</xsl:param>
13999
14075
  <xsl:call-template name="setTextAlignment">
14000
14076
  <xsl:with-param name="default" select="$text_align_default"/>
14077
+ <xsl:with-param name="skip_default" select="$skip_text_align_default"/>
14001
14078
  </xsl:call-template>
14002
14079
  <xsl:call-template name="setKeepAttributes"/>
14003
14080
  <xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
@@ -14040,6 +14117,20 @@
14040
14117
  </fo:block-container>
14041
14118
  </xsl:template>
14042
14119
 
14120
+ <!-- for https://github.com/metanorma/mn-native-pdf/issues/845 -->
14121
+ <xsl:template name="insertCoverPageFullImage">
14122
+ <xsl:param name="name">coverpage-image</xsl:param>
14123
+ <xsl:for-each select="//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = $name][1]/mn:value/mn:image">
14124
+ <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
14125
+ <fo:flow flow-name="xsl-region-body">
14126
+ <xsl:call-template name="insertBackgroundPageImage">
14127
+ <xsl:with-param name="number" select="position()"/>
14128
+ </xsl:call-template>
14129
+ </fo:flow>
14130
+ </fo:page-sequence>
14131
+ </xsl:for-each>
14132
+ </xsl:template>
14133
+
14043
14134
  <xsl:template name="insertPageImage">
14044
14135
  <xsl:param name="svg_content_height" select="$pageHeight"/>
14045
14136
  <xsl:param name="bitmap_width" select="$pageWidth"/>