metanorma-taste 0.1.6 → 0.1.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.
@@ -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">
@@ -444,16 +451,9 @@
444
451
  <!-- title -->
445
452
  <!-- ====== -->
446
453
  <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}">
454
+ <fo:block xsl:use-attribute-sets="annex-title-style">
455
+ <xsl:call-template name="refine_annex-title-style"/>
456
+
457
457
  <xsl:apply-templates/>
458
458
  <xsl:apply-templates select="following-sibling::*[1][self::mn:variant-title][@type = 'sub']" mode="subtitle"/>
459
459
  </fo:block>
@@ -465,25 +465,6 @@
465
465
  <xsl:call-template name="getLevel"/>
466
466
  </xsl:variable>
467
467
 
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
468
  <xsl:variable name="element-name">
488
469
  <xsl:choose>
489
470
  <xsl:when test="../@inline-header = 'true'">fo:inline</xsl:when>
@@ -491,22 +472,12 @@
491
472
  </xsl:choose>
492
473
  </xsl:variable>
493
474
 
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>
475
+ <xsl:variable name="title_styles">
476
+ <styles xsl:use-attribute-sets="title-style"><xsl:call-template name="refine_title-style"/></styles>
499
477
  </xsl:variable>
500
478
 
501
479
  <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>
480
+ <xsl:copy-of select="xalan:nodeset($title_styles)/styles/@*"/>
510
481
 
511
482
  <xsl:if test="$level = 2">
512
483
  <fo:inline padding-right="1mm">
@@ -535,20 +506,16 @@
535
506
  <xsl:otherwise>fo:block</xsl:otherwise>
536
507
  </xsl:choose>
537
508
  </xsl:variable>
538
- <xsl:element name="{$element-name}">
539
- <xsl:attribute name="id">
540
- <xsl:value-of select="@id"/>
541
- </xsl:attribute>
542
509
 
543
- <xsl:call-template name="setBlockAttributes"/>
510
+ <xsl:variable name="p_styles">
511
+ <styles xsl:use-attribute-sets="p-style">
512
+ <xsl:call-template name="refine_p-style"><xsl:with-param name="element-name" select="$element-name"/></xsl:call-template>
513
+ </styles>
514
+ </xsl:variable>
515
+
516
+ <xsl:element name="{$element-name}">
517
+ <xsl:copy-of select="xalan:nodeset($p_styles)/styles/@*"/>
544
518
 
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
519
  <xsl:apply-templates>
553
520
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
554
521
  </xsl:apply-templates>
@@ -2634,6 +2601,10 @@
2634
2601
  </xsl:element>
2635
2602
  </xsl:template>
2636
2603
 
2604
+ <!-- show sourcecode's name 'before' or 'after' source code -->
2605
+ <xsl:variable name="sourcecode-name-position"><xsl:text>after</xsl:text>
2606
+ </xsl:variable>
2607
+
2637
2608
  <xsl:template match="mn:sourcecode" name="sourcecode">
2638
2609
 
2639
2610
  <xsl:variable name="sourcecode_attributes">
@@ -2657,7 +2628,12 @@
2657
2628
 
2658
2629
  <xsl:call-template name="refine_sourcecode-container-style"/>
2659
2630
 
2660
- <fo:block-container margin-left="0mm" role="SKIP">
2631
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
2632
+
2633
+ <!-- <xsl:if test="$namespace = 'rsd'"> -->
2634
+ <xsl:if test="$sourcecode-name-position = 'before'">
2635
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name BEFORE content -->
2636
+ </xsl:if>
2661
2637
 
2662
2638
  <fo:block xsl:use-attribute-sets="sourcecode-style">
2663
2639
 
@@ -2679,7 +2655,16 @@
2679
2655
  </fo:block>
2680
2656
 
2681
2657
  <xsl:apply-templates select="mn:dl"/> <!-- Key table -->
2682
- <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
2658
+
2659
+ <!-- <xsl:choose>
2660
+ <xsl:when test="$namespace = 'rsd'"></xsl:when>
2661
+ <xsl:otherwise>
2662
+ <xsl:apply-templates select="mn:fmt-name" /> --><!-- show sourcecode's name AFTER content -->
2663
+ <!-- </xsl:otherwise>
2664
+ </xsl:choose> -->
2665
+ <xsl:if test="$sourcecode-name-position = 'after'">
2666
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
2667
+ </xsl:if>
2683
2668
 
2684
2669
  </fo:block-container>
2685
2670
  </fo:block-container>
@@ -3936,89 +3921,83 @@
3936
3921
  <xsl:template name="refine_term-style">
3937
3922
  </xsl:template>
3938
3923
 
3939
- <xsl:attribute-set name="term-name-style">
3924
+ <xsl:attribute-set name="term-number-style">
3940
3925
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3941
3926
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3942
3927
  </xsl:attribute-set> <!-- term-name-style -->
3943
3928
 
3944
- <xsl:template name="refine_term-name-style">
3945
- </xsl:template>
3946
-
3947
- <xsl:attribute-set name="preferred-style">
3948
- </xsl:attribute-set> <!-- preferred-style -->
3949
-
3950
- <xsl:template name="refine_preferred-style">
3929
+ <xsl:template name="refine_term-number-style">
3951
3930
  </xsl:template>
3952
3931
 
3953
- <xsl:attribute-set name="preferred-block-style">
3932
+ <xsl:attribute-set name="term-preferred-block-style">
3954
3933
  </xsl:attribute-set> <!-- preferred-block-style -->
3955
3934
 
3956
- <xsl:template name="refine_preferred-block-style">
3935
+ <xsl:template name="refine_term-preferred-block-style">
3957
3936
  </xsl:template>
3958
3937
 
3959
- <xsl:attribute-set name="preferred-term-style">
3938
+ <xsl:attribute-set name="term-preferred-style">
3960
3939
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3961
3940
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3962
3941
  <xsl:attribute name="line-height">1</xsl:attribute>
3963
3942
  </xsl:attribute-set> <!-- preferred-term-style -->
3964
3943
 
3965
- <xsl:template name="refine_preferred-term-style">
3944
+ <xsl:template name="refine_term-preferred-style">
3966
3945
  <xsl:if test="mn:strong">
3967
3946
  <xsl:attribute name="font-weight">normal</xsl:attribute>
3968
3947
  </xsl:if>
3969
3948
  </xsl:template>
3970
3949
 
3971
- <xsl:attribute-set name="domain-style">
3972
- </xsl:attribute-set> <!-- domain-style -->
3950
+ <xsl:attribute-set name="term-domain-style">
3951
+ </xsl:attribute-set> <!-- term-domain-style -->
3973
3952
 
3974
- <xsl:template name="refine_domain-style">
3953
+ <xsl:template name="refine_term-domain-style">
3975
3954
  </xsl:template>
3976
3955
 
3977
- <xsl:attribute-set name="admitted-style">
3978
- </xsl:attribute-set> <!-- admitted-style -->
3956
+ <xsl:attribute-set name="term-admitted-style">
3957
+ </xsl:attribute-set> <!-- term-admitted-style -->
3979
3958
 
3980
- <xsl:template name="refine_admitted-style">
3959
+ <xsl:template name="refine_term-admitted-style">
3981
3960
  </xsl:template>
3982
3961
 
3983
- <xsl:attribute-set name="deprecates-style">
3984
- </xsl:attribute-set> <!-- deprecates-style -->
3962
+ <xsl:attribute-set name="term-deprecates-style">
3963
+ </xsl:attribute-set> <!-- term-deprecates-style -->
3985
3964
 
3986
- <xsl:template name="refine_deprecates-style">
3965
+ <xsl:template name="refine_term-deprecates-style">
3987
3966
  </xsl:template>
3988
3967
 
3989
- <xsl:attribute-set name="related-block-style" use-attribute-sets="preferred-block-style">
3968
+ <xsl:attribute-set name="term-related-block-style" use-attribute-sets="term-preferred-block-style">
3990
3969
  </xsl:attribute-set>
3991
3970
 
3992
- <xsl:template name="refine_related-block-style">
3971
+ <xsl:template name="refine_term-related-block-style">
3993
3972
  </xsl:template>
3994
3973
 
3995
- <xsl:attribute-set name="definition-style">
3974
+ <xsl:attribute-set name="term-definition-style">
3996
3975
  <xsl:attribute name="space-after">6pt</xsl:attribute>
3997
- </xsl:attribute-set> <!-- definition-style -->
3976
+ </xsl:attribute-set> <!-- term-definition-style -->
3998
3977
 
3999
- <xsl:template name="refine_definition-style">
3978
+ <xsl:template name="refine_term-definition-style">
4000
3979
  </xsl:template>
4001
3980
 
4002
- <xsl:attribute-set name="termsource-style">
3981
+ <xsl:attribute-set name="term-termsource-style">
4003
3982
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
4004
3983
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
4005
- </xsl:attribute-set> <!-- termsource-style -->
3984
+ </xsl:attribute-set> <!-- term-termsource-style -->
4006
3985
 
4007
- <xsl:template name="refine_termsource-style">
4008
- </xsl:template> <!-- refine_termsource-style -->
3986
+ <xsl:template name="refine_term-termsource-style">
3987
+ </xsl:template> <!-- refine_term-termsource-style -->
4009
3988
 
4010
- <xsl:attribute-set name="termsource-text-style">
4011
- </xsl:attribute-set> <!-- termsource-text-style -->
3989
+ <xsl:attribute-set name="term-termsource-text-style">
3990
+ </xsl:attribute-set> <!-- term-termsource-text-style -->
4012
3991
 
4013
- <xsl:template name="refine_termsource-text-style">
3992
+ <xsl:template name="refine_term-termsource-text-style">
4014
3993
  </xsl:template>
4015
3994
 
4016
- <xsl:attribute-set name="origin-style">
3995
+ <xsl:attribute-set name="term-origin-style">
4017
3996
  <xsl:attribute name="color">rgb(33, 94, 159)</xsl:attribute>
4018
3997
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
4019
- </xsl:attribute-set> <!-- origin-style -->
3998
+ </xsl:attribute-set> <!-- term-origin-style -->
4020
3999
 
4021
- <xsl:template name="refine_origin-style">
4000
+ <xsl:template name="refine_term-origin-style">
4022
4001
  </xsl:template>
4023
4002
 
4024
4003
  <!-- ====== -->
@@ -4062,9 +4041,9 @@
4062
4041
  <!-- modification -->
4063
4042
  <!-- ====== -->
4064
4043
  <xsl:template match="mn:fmt-termsource" name="termsource">
4065
- <fo:block xsl:use-attribute-sets="termsource-style">
4044
+ <fo:block xsl:use-attribute-sets="term-termsource-style">
4066
4045
 
4067
- <xsl:call-template name="refine_termsource-style"/>
4046
+ <xsl:call-template name="refine_term-termsource-style"/>
4068
4047
 
4069
4048
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
4070
4049
  <xsl:variable name="termsource_text">
@@ -4112,8 +4091,8 @@
4112
4091
 
4113
4092
  <!-- text SOURCE: -->
4114
4093
  <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"/>
4094
+ <fo:inline xsl:use-attribute-sets="term-termsource-text-style">
4095
+ <xsl:call-template name="refine_term-termsource-text-style"/>
4117
4096
  <xsl:value-of select="."/>
4118
4097
  </fo:inline>
4119
4098
  </xsl:template>
@@ -4125,8 +4104,8 @@
4125
4104
  <xsl:if test="normalize-space(@citeas) = ''">
4126
4105
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
4127
4106
  </xsl:if>
4128
- <fo:inline xsl:use-attribute-sets="origin-style">
4129
- <xsl:call-template name="refine_origin-style"/>
4107
+ <fo:inline xsl:use-attribute-sets="term-origin-style">
4108
+ <xsl:call-template name="refine_term-origin-style"/>
4130
4109
  <xsl:apply-templates/>
4131
4110
  </fo:inline>
4132
4111
  </fo:basic-link>
@@ -4179,14 +4158,14 @@
4179
4158
  <xsl:variable name="levelTerm">
4180
4159
  <xsl:call-template name="getLevelTermName"/>
4181
4160
  </xsl:variable>
4182
- <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
4161
+ <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="term-preferred-block-style">
4183
4162
 
4184
- <xsl:call-template name="refine_preferred-block-style"/>
4163
+ <xsl:call-template name="refine_term-preferred-block-style"/>
4185
4164
 
4186
4165
  <xsl:if test="parent::mn:term and not(preceding-sibling::mn:fmt-preferred)"> <!-- if first preffered in term, then display term's name -->
4187
4166
 
4188
- <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
4189
- <xsl:call-template name="refine_term-name-style"/>
4167
+ <fo:block xsl:use-attribute-sets="term-number-style" role="SKIP">
4168
+ <xsl:call-template name="refine_term-number-style"/>
4190
4169
 
4191
4170
  <xsl:for-each select="ancestor::mn:term[1]/mn:fmt-name"><!-- change context -->
4192
4171
  <xsl:call-template name="setIDforNamedDestination"/>
@@ -4196,8 +4175,8 @@
4196
4175
  </fo:block>
4197
4176
  </xsl:if>
4198
4177
 
4199
- <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
4200
- <xsl:call-template name="refine_preferred-term-style"/>
4178
+ <fo:block xsl:use-attribute-sets="term-preferred-style" role="SKIP">
4179
+ <xsl:call-template name="refine_term-preferred-style"/>
4201
4180
 
4202
4181
  <xsl:apply-templates/>
4203
4182
  </fo:block>
@@ -4217,15 +4196,15 @@
4217
4196
  <xsl:template match="mn:domain"/>
4218
4197
 
4219
4198
  <xsl:template match="mn:fmt-admitted">
4220
- <fo:block xsl:use-attribute-sets="admitted-style">
4221
- <xsl:call-template name="refine_admitted-style"/>
4199
+ <fo:block xsl:use-attribute-sets="term-admitted-style">
4200
+ <xsl:call-template name="refine_term-admitted-style"/>
4222
4201
  <xsl:apply-templates/>
4223
4202
  </fo:block>
4224
4203
  </xsl:template>
4225
4204
 
4226
4205
  <xsl:template match="mn:fmt-deprecates">
4227
- <fo:block xsl:use-attribute-sets="deprecates-style">
4228
- <xsl:call-template name="refine_deprecates-style"/>
4206
+ <fo:block xsl:use-attribute-sets="term-deprecates-style">
4207
+ <xsl:call-template name="refine_term-deprecates-style"/>
4229
4208
  <xsl:apply-templates/>
4230
4209
  </fo:block>
4231
4210
  </xsl:template>
@@ -4238,8 +4217,8 @@
4238
4217
  <!-- End Preferred, admitted, deprecated -->
4239
4218
 
4240
4219
  <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"/>
4220
+ <fo:block role="SKIP" xsl:use-attribute-sets="term-related-block-style">
4221
+ <xsl:call-template name="refine_term-related-block-style"/>
4243
4222
  <xsl:apply-templates/>
4244
4223
  </fo:block>
4245
4224
  </xsl:template>
@@ -4253,8 +4232,8 @@
4253
4232
  <!-- definition -->
4254
4233
  <!-- ========== -->
4255
4234
  <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"/>
4235
+ <fo:block xsl:use-attribute-sets="term-definition-style" role="SKIP">
4236
+ <xsl:call-template name="refine_term-definition-style"/>
4258
4237
  <xsl:apply-templates/>
4259
4238
  </fo:block>
4260
4239
  </xsl:template>
@@ -8449,6 +8428,10 @@
8449
8428
  <!-- image -->
8450
8429
  <!-- ====== -->
8451
8430
 
8431
+ <!-- show figure's name 'before' or 'after' image -->
8432
+ <xsl:variable name="figure-name-position"><xsl:text>after</xsl:text>
8433
+ </xsl:variable>
8434
+
8452
8435
  <xsl:template match="mn:figure" name="figure">
8453
8436
  <xsl:variable name="isAdded" select="@added"/>
8454
8437
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -8461,6 +8444,10 @@
8461
8444
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
8462
8445
  </xsl:call-template>
8463
8446
 
8447
+ <xsl:if test="$figure-name-position = 'before'"> <!-- show figure's name BEFORE image -->
8448
+ <xsl:apply-templates select="mn:fmt-name"/>
8449
+ </xsl:if>
8450
+
8464
8451
  <!-- Example: Dimensions in millimeters -->
8465
8452
  <xsl:apply-templates select="mn:note[@type = 'units']"/>
8466
8453
 
@@ -8481,7 +8468,16 @@
8481
8468
  <xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
8482
8469
  <xsl:call-template name="showFigureKey"/>
8483
8470
  </xsl:if>
8484
- <xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
8471
+
8472
+ <!-- <xsl:choose>
8473
+ <xsl:when test="$namespace = 'bsi' or $namespace = 'pas' or $namespace = 'rsd'"></xsl:when>
8474
+ <xsl:otherwise>
8475
+ <xsl:apply-templates select="mn:fmt-name" /> --> <!-- show figure's name AFTER image -->
8476
+ <!-- </xsl:otherwise>
8477
+ </xsl:choose> -->
8478
+ <xsl:if test="$figure-name-position = 'after'">
8479
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
8480
+ </xsl:if>
8485
8481
 
8486
8482
  </fo:block-container>
8487
8483
  </xsl:template>
@@ -10563,7 +10559,6 @@
10563
10559
  </xsl:attribute-set>
10564
10560
 
10565
10561
  <xsl:template name="refine_references-non-normative-title-style">
10566
-
10567
10562
  </xsl:template>
10568
10563
 
10569
10564
  <!-- bibitem in Normative References (references/@normative="true") -->
@@ -12613,9 +12608,23 @@
12613
12608
  <!-- ===================================== -->
12614
12609
 
12615
12610
  <xsl:attribute-set name="annex-title-style">
12616
- </xsl:attribute-set>
12611
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
12612
+ <xsl:attribute name="text-align">center</xsl:attribute>
12613
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
12614
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
12615
+ <xsl:attribute name="color">black</xsl:attribute>
12616
+ <xsl:attribute name="role">H1</xsl:attribute>
12617
+ </xsl:attribute-set> <!-- annex-title-style -->
12617
12618
 
12618
12619
  <xsl:template name="refine_annex-title-style">
12620
+ <!-- <xsl:call-template name="setIDforNamedDestination"/> -->
12621
+ <xsl:variable name="level">
12622
+ <xsl:call-template name="getLevel"/>
12623
+ </xsl:variable>
12624
+ <xsl:if test="$level &gt;= 2">
12625
+ <xsl:attribute name="color">rgb(3, 115, 200)</xsl:attribute>
12626
+ <xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
12627
+ </xsl:if>
12619
12628
  </xsl:template>
12620
12629
 
12621
12630
  <xsl:attribute-set name="p-zzSTDTitle1-style">
@@ -12624,6 +12633,65 @@
12624
12633
  <xsl:template name="refine_p-zzSTDTitle1-style">
12625
12634
  </xsl:template>
12626
12635
 
12636
+ <xsl:attribute-set name="p-style">
12637
+ <xsl:attribute name="line-height">155%</xsl:attribute>
12638
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
12639
+ </xsl:attribute-set> <!-- p-style -->
12640
+
12641
+ <xsl:template name="refine_p-style">
12642
+ <xsl:param name="element-name"/>
12643
+ <xsl:param name="margin"/>
12644
+ <xsl:copy-of select="@id"/>
12645
+ <xsl:call-template name="setBlockAttributes"/>
12646
+
12647
+ <xsl:if test="ancestor::mn:li">
12648
+ <xsl:attribute name="space-after">0pt</xsl:attribute>
12649
+ </xsl:if>
12650
+ <!-- $namespace = 'csa' -->
12651
+
12652
+ </xsl:template> <!-- refine_p-style -->
12653
+
12654
+ <xsl:attribute-set name="title-style">
12655
+ <!-- Note: font-size for level 1 title -->
12656
+ <xsl:attribute name="font-size">26pt</xsl:attribute>
12657
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
12658
+ <xsl:attribute name="space-before">13.5pt</xsl:attribute>
12659
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
12660
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
12661
+ <xsl:attribute name="color">black</xsl:attribute>
12662
+ <xsl:attribute name="line-height">120%</xsl:attribute>
12663
+ </xsl:attribute-set> <!-- title-style -->
12664
+
12665
+ <xsl:template name="refine_title-style">
12666
+ <xsl:param name="element-name"/>
12667
+ <xsl:variable name="level">
12668
+ <xsl:call-template name="getLevel"/>
12669
+ </xsl:variable>
12670
+ <xsl:if test="$level &gt; 1">
12671
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
12672
+ </xsl:if>
12673
+ <xsl:if test="$level = 2">
12674
+ <xsl:attribute name="font-size">14pt</xsl:attribute>
12675
+ <xsl:if test="ancestor::mn:terms">
12676
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
12677
+ </xsl:if>
12678
+ </xsl:if>
12679
+ <xsl:if test="$level &gt;= 2">
12680
+ <xsl:attribute name="color">rgb(3, 115, 200)</xsl:attribute>
12681
+ </xsl:if>
12682
+ <xsl:if test="$level &gt;= 3">
12683
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
12684
+ </xsl:if>
12685
+ <xsl:if test="ancestor::mn:preface">
12686
+ <xsl:attribute name="font-size">13pt</xsl:attribute>
12687
+ <xsl:if test="$level &gt;= 2">
12688
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
12689
+ </xsl:if>
12690
+ </xsl:if>
12691
+ <!-- $namespace = 'csa' -->
12692
+ <xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
12693
+ </xsl:template> <!-- refine_title-style -->
12694
+
12627
12695
  <xsl:template name="processPrefaceSectionsDefault">
12628
12696
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
12629
12697
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -12962,6 +13030,12 @@
12962
13030
  </xsl:choose>
12963
13031
  </xsl:template>
12964
13032
 
13033
+ <xsl:attribute-set name="reset-margins-style">
13034
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
13035
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
13036
+ <xsl:attribute name="role">SKIP</xsl:attribute>
13037
+ </xsl:attribute-set>
13038
+
12965
13039
  <xsl:attribute-set name="clause-style">
12966
13040
 
12967
13041
  </xsl:attribute-set>
@@ -13977,8 +14051,9 @@
13977
14051
 
13978
14052
  <xsl:template name="setTextAlignment">
13979
14053
  <xsl:param name="default">left</xsl:param>
14054
+ <xsl:param name="skip_default">false</xsl:param>
13980
14055
  <xsl:variable name="align" select="normalize-space(@align)"/>
13981
- <xsl:attribute name="text-align">
14056
+ <xsl:variable name="text_align">
13982
14057
  <xsl:choose>
13983
14058
  <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
13984
14059
  <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
@@ -13986,9 +14061,13 @@
13986
14061
  <xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
13987
14062
  <xsl:when test="ancestor::mn:td/@align"><xsl:value-of select="ancestor::mn:td/@align"/></xsl:when>
13988
14063
  <xsl:when test="ancestor::mn:th/@align"><xsl:value-of select="ancestor::mn:th/@align"/></xsl:when>
14064
+ <xsl:when test="$skip_default = 'true'"/>
13989
14065
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
13990
14066
  </xsl:choose>
13991
- </xsl:attribute>
14067
+ </xsl:variable>
14068
+ <xsl:if test="normalize-space($text_align) != ''">
14069
+ <xsl:attribute name="text-align"><xsl:value-of select="$text_align"/></xsl:attribute>
14070
+ </xsl:if>
13992
14071
  <xsl:if test="$align = 'indent'">
13993
14072
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
13994
14073
  </xsl:if>
@@ -13996,8 +14075,10 @@
13996
14075
 
13997
14076
  <xsl:template name="setBlockAttributes">
13998
14077
  <xsl:param name="text_align_default">left</xsl:param>
14078
+ <xsl:param name="skip_text_align_default">false</xsl:param>
13999
14079
  <xsl:call-template name="setTextAlignment">
14000
14080
  <xsl:with-param name="default" select="$text_align_default"/>
14081
+ <xsl:with-param name="skip_default" select="$skip_text_align_default"/>
14001
14082
  </xsl:call-template>
14002
14083
  <xsl:call-template name="setKeepAttributes"/>
14003
14084
  <xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
@@ -14040,6 +14121,20 @@
14040
14121
  </fo:block-container>
14041
14122
  </xsl:template>
14042
14123
 
14124
+ <!-- for https://github.com/metanorma/mn-native-pdf/issues/845 -->
14125
+ <xsl:template name="insertCoverPageFullImage">
14126
+ <xsl:param name="name">coverpage-image</xsl:param>
14127
+ <xsl:for-each select="//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = $name][1]/mn:value/mn:image">
14128
+ <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
14129
+ <fo:flow flow-name="xsl-region-body">
14130
+ <xsl:call-template name="insertBackgroundPageImage">
14131
+ <xsl:with-param name="number" select="position()"/>
14132
+ </xsl:call-template>
14133
+ </fo:flow>
14134
+ </fo:page-sequence>
14135
+ </xsl:for-each>
14136
+ </xsl:template>
14137
+
14043
14138
  <xsl:template name="insertPageImage">
14044
14139
  <xsl:param name="svg_content_height" select="$pageHeight"/>
14045
14140
  <xsl:param name="bitmap_width" select="$pageWidth"/>