metanorma-ogc 2.8.2 → 2.8.4

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.
@@ -870,7 +870,8 @@
870
870
 
871
871
  <xsl:if test="count(*) = 1 and mn:fmt-title"> <!-- if there isn't user ToC -->
872
872
 
873
- <fo:block-container line-height="130%">
873
+ <fo:block-container xsl:use-attribute-sets="toc-style">
874
+ <xsl:call-template name="refine_toc-style"/>
874
875
  <fo:block role="TOC">
875
876
  <xsl:for-each select="$contents//mnx:item[@display = 'true' and normalize-space(@id) != '']">
876
877
 
@@ -1263,11 +1264,9 @@
1263
1264
  </xsl:template>
1264
1265
 
1265
1266
  <xsl:template match="mn:legal-statement//mn:fmt-title" priority="2">
1266
- <xsl:variable name="level">
1267
- <xsl:call-template name="getLevel"/>
1268
- </xsl:variable>
1269
1267
  <!-- inline title -->
1270
- <fo:inline font-weight="bold" role="H{$level}">
1268
+ <fo:inline xsl:use-attribute-sets="legal-statement-title-style">
1269
+ <xsl:call-template name="refine_legal-statement-title-style"/>
1271
1270
  <xsl:apply-templates/><xsl:text>: </xsl:text>
1272
1271
  </fo:inline>
1273
1272
  </xsl:template>
@@ -1279,7 +1278,8 @@
1279
1278
  </xsl:template>
1280
1279
 
1281
1280
  <xsl:template match="mn:legal-statement//mn:p" priority="2">
1282
- <fo:inline>
1281
+ <fo:inline xsl:use-attribute-sets="legal-statement-p-style">
1282
+ <xsl:call-template name="refine_legal-statement-p-style"/>
1283
1283
  <xsl:apply-templates/>
1284
1284
  </fo:inline>
1285
1285
  <xsl:if test="following-sibling::mn:p">
@@ -1435,11 +1435,7 @@
1435
1435
  </xsl:choose>
1436
1436
  </xsl:variable>
1437
1437
  <xsl:element name="{$element-name}">
1438
- <xsl:if test="@id">
1439
- <xsl:attribute name="id">
1440
- <xsl:value-of select="@id"/>
1441
- </xsl:attribute>
1442
- </xsl:if>
1438
+ <xsl:copy-of select="@id"/>
1443
1439
 
1444
1440
  <xsl:call-template name="setBlockAttributes"/>
1445
1441
 
@@ -1493,21 +1489,8 @@
1493
1489
  </xsl:if>
1494
1490
  <fo:block-container margin-left="0mm">
1495
1491
  <fo:list-block xsl:use-attribute-sets="list-style">
1496
- <xsl:if test="self::mn:ul">
1497
- <xsl:attribute name="provisional-distance-between-starts"><xsl:value-of select="$ul_indent"/>mm</xsl:attribute>
1498
- </xsl:if>
1499
- <xsl:if test="ancestor::mn:table">
1500
- <xsl:attribute name="provisional-distance-between-starts">5mm</xsl:attribute>
1501
- </xsl:if>
1502
- <xsl:if test="ancestor::mn:ul | ancestor::mn:ol">
1503
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
1504
- <xsl:if test="ancestor::mn:table[not(@class)]">
1505
- <xsl:attribute name="space-after">1mm</xsl:attribute>
1506
- </xsl:if>
1507
- </xsl:if>
1508
- <xsl:if test="following-sibling::*[1][self::mn:ul or self::mn:ol]">
1509
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
1510
- </xsl:if>
1492
+ <xsl:call-template name="refine_list-style"/>
1493
+
1511
1494
  <xsl:apply-templates>
1512
1495
  <xsl:with-param name="indent" select="$indent + $ul_indent"/>
1513
1496
  </xsl:apply-templates>
@@ -1529,10 +1512,8 @@
1529
1512
  </xsl:template>
1530
1513
 
1531
1514
  <xsl:template match="mn:term/mn:fmt-name" priority="2">
1532
- <xsl:variable name="levelTerm">
1533
- <xsl:call-template name="getLevelTermName"/>
1534
- </xsl:variable>
1535
- <fo:block space-before="36pt" margin-bottom="10pt" keep-with-next="always" role="H{$levelTerm}">
1515
+ <fo:block xsl:use-attribute-sets="term-name-style">
1516
+ <xsl:call-template name="refine_term-name-style"/>
1536
1517
  <fo:list-block color="{$color_text_title}" keep-with-next="always" provisional-distance-between-starts="{string-length()*3.25}mm">
1537
1518
  <fo:list-item>
1538
1519
  <fo:list-item-label end-indent="label-end()">
@@ -1553,7 +1534,7 @@
1553
1534
 
1554
1535
  <!-- first preferred displays on the same line as term/name -->
1555
1536
  <xsl:template match="mn:fmt-preferred[not(preceding-sibling::mn:fmt-preferred)]" mode="term_name" priority="2">
1556
- <fo:inline font-size="18pt" padding-right="3mm"><xsl:call-template name="setStyle_preferred"/><xsl:apply-templates/></fo:inline>
1537
+ <fo:inline xsl:use-attribute-sets="preferred-term-style"><xsl:call-template name="refine_preferred-term-style"/><xsl:apply-templates/></fo:inline>
1557
1538
  <fo:inline padding-right="2mm"> </fo:inline>
1558
1539
  </xsl:template>
1559
1540
 
@@ -2177,6 +2158,7 @@
2177
2158
  <xsl:variable name="en_dash">–</xsl:variable>
2178
2159
  <xsl:variable name="em_dash">—</xsl:variable>
2179
2160
  <xsl:variable name="nonbreak_space_em_dash_space"> — </xsl:variable>
2161
+ <xsl:variable name="nonbreak_space_em_dash"> —</xsl:variable>
2180
2162
  <xsl:variable name="cr">&#13;</xsl:variable>
2181
2163
  <xsl:variable name="lf">
2182
2164
  </xsl:variable>
@@ -2720,6 +2702,7 @@
2720
2702
  <xsl:template match="mn:title[following-sibling::*[1][self::mn:fmt-title]]" mode="update_xml_step1"/>
2721
2703
  <xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]" mode="update_xml_step1"/>
2722
2704
  <xsl:template match="mn:section-title[following-sibling::*[1][self::mn:p][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
2705
+ <xsl:template match="mn:floating-title[following-sibling::*[1][self::mn:p][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
2723
2706
  <!-- <xsl:template match="mn:preferred[following-sibling::*[not(local-name() = 'preferred')][1][local-name() = 'fmt-preferred']]" mode="update_xml_step1"/> -->
2724
2707
  <xsl:template match="mn:preferred" mode="update_xml_step1"/>
2725
2708
  <!-- <xsl:template match="mn:admitted[following-sibling::*[not(local-name() = 'admitted')][1][local-name() = 'fmt-admitted']]" mode="update_xml_step1"/> -->
@@ -2734,10 +2717,10 @@
2734
2717
 
2735
2718
  <xsl:template match="mn:term[@unnumbered = 'true'][not(.//*[starts-with(local-name(), 'fmt-')])]" mode="update_xml_step1"/>
2736
2719
 
2737
- <xsl:template match="mn:p[@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][self::mn:section-title]]" mode="update_xml_step1">
2720
+ <xsl:template match="mn:p[@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][self::mn:section-title or self::mn:floating-title]]" mode="update_xml_step1">
2738
2721
  <xsl:copy>
2739
2722
  <xsl:apply-templates select="@*" mode="update_xml_step1"/>
2740
- <xsl:copy-of select="preceding-sibling::*[1][self::mn:section-title]/@depth"/>
2723
+ <xsl:copy-of select="preceding-sibling::*[1][self::mn:section-title or self::mn:floating-title]/@depth"/>
2741
2724
  <xsl:apply-templates select="node()" mode="update_xml_step1"/>
2742
2725
  </xsl:copy>
2743
2726
  </xsl:template>
@@ -3535,12 +3518,18 @@
3535
3518
  <xsl:attribute name="line-height">125%</xsl:attribute>
3536
3519
  </xsl:attribute-set> <!-- license-statement-style -->
3537
3520
 
3521
+ <xsl:template name="refine_license-statement-style">
3522
+ </xsl:template>
3523
+
3538
3524
  <xsl:attribute-set name="license-statement-title-style">
3539
3525
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3540
3526
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3541
3527
  <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
3542
3528
  </xsl:attribute-set> <!-- license-statement-title-style -->
3543
3529
 
3530
+ <xsl:template name="refine_license-statement-title-style">
3531
+ </xsl:template>
3532
+
3544
3533
  <xsl:attribute-set name="license-statement-p-style">
3545
3534
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
3546
3535
  </xsl:attribute-set> <!-- license-statement-p-style -->
@@ -3553,26 +3542,55 @@
3553
3542
  <xsl:attribute name="font-size">8pt</xsl:attribute>
3554
3543
  </xsl:attribute-set> <!-- legal-statement-style -->
3555
3544
 
3545
+ <xsl:template name="refine_legal-statement-style">
3546
+ </xsl:template>
3547
+
3556
3548
  <xsl:attribute-set name="legal-statement-title-style">
3557
3549
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3550
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3558
3551
  </xsl:attribute-set> <!-- legal-statement-title-style -->
3559
3552
 
3553
+ <xsl:template name="refine_legal-statement-title-style">
3554
+ <xsl:variable name="level">
3555
+ <xsl:call-template name="getLevel"/>
3556
+ </xsl:variable>
3557
+ <xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
3558
+ </xsl:template>
3559
+
3560
3560
  <xsl:attribute-set name="legal-statement-p-style">
3561
3561
  </xsl:attribute-set> <!-- legal-statement-p-style -->
3562
3562
 
3563
+ <xsl:template name="refine_legal-statement-p-style">
3564
+ <xsl:if test="@align">
3565
+ <xsl:attribute name="text-align">
3566
+ <xsl:value-of select="@align"/>
3567
+ </xsl:attribute>
3568
+ </xsl:if>
3569
+ </xsl:template>
3570
+
3563
3571
  <xsl:attribute-set name="feedback-statement-style">
3564
3572
  <xsl:attribute name="font-size">8pt</xsl:attribute>
3565
3573
  <xsl:attribute name="line-height">125%</xsl:attribute>
3566
3574
  </xsl:attribute-set> <!-- feedback-statement-style -->
3567
3575
 
3576
+ <xsl:template name="refine_feedback-statement-style">
3577
+ </xsl:template>
3578
+
3568
3579
  <xsl:attribute-set name="feedback-statement-title-style">
3569
3580
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3570
3581
  </xsl:attribute-set> <!-- feedback-statement-title-style -->
3571
3582
 
3583
+ <xsl:template name="refine_feedback-statement-title-style">
3584
+
3585
+ </xsl:template>
3586
+
3572
3587
  <xsl:attribute-set name="feedback-statement-p-style">
3573
3588
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
3574
3589
  </xsl:attribute-set> <!-- feedback-statement-p-style -->
3575
3590
 
3591
+ <xsl:template name="refine_feedback-statement-p-style">
3592
+ </xsl:template>
3593
+
3576
3594
  <!-- End boilerplate sections styles -->
3577
3595
 
3578
3596
  <!-- ================================= -->
@@ -3607,6 +3625,7 @@
3607
3625
 
3608
3626
  <xsl:template match="mn:license-statement">
3609
3627
  <fo:block xsl:use-attribute-sets="license-statement-style">
3628
+ <xsl:call-template name="refine_license-statement-style"/>
3610
3629
  <xsl:apply-templates/>
3611
3630
  </fo:block>
3612
3631
  </xsl:template> <!-- license-statement -->
@@ -3616,6 +3635,7 @@
3616
3635
  <xsl:call-template name="getLevel"/>
3617
3636
  </xsl:variable>
3618
3637
  <fo:block role="H{$level}" xsl:use-attribute-sets="license-statement-title-style">
3638
+ <xsl:call-template name="refine_license-statement-title-style"/>
3619
3639
  <xsl:apply-templates/>
3620
3640
  </fo:block>
3621
3641
 
@@ -3632,6 +3652,7 @@
3632
3652
  <xsl:template match="mn:legal-statement">
3633
3653
  <xsl:param name="isLegacy">false</xsl:param>
3634
3654
  <fo:block xsl:use-attribute-sets="legal-statement-style">
3655
+ <xsl:call-template name="refine_legal-statement-style"/>
3635
3656
  <xsl:if test="$isLegacy = 'true'">
3636
3657
  <xsl:attribute name="font-size">9pt</xsl:attribute>
3637
3658
  </xsl:if>
@@ -3667,6 +3688,8 @@
3667
3688
  <xsl:template match="mn:feedback-statement//mn:p">
3668
3689
  <xsl:param name="margin"/>
3669
3690
  <fo:block xsl:use-attribute-sets="feedback-statement-p-style">
3691
+ <xsl:call-template name="refine_feedback-statement-p-style"/>
3692
+ <!-- <xsl:copy-of select="@id"/> -->
3670
3693
  <xsl:apply-templates/>
3671
3694
  </fo:block>
3672
3695
 
@@ -3803,6 +3826,27 @@
3803
3826
  <xsl:attribute-set name="sourcecode-container-style">
3804
3827
  </xsl:attribute-set>
3805
3828
 
3829
+ <xsl:template name="refine_sourcecode-container-style">
3830
+ <xsl:if test="not(ancestor::mn:li) or ancestor::mn:example">
3831
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3832
+ </xsl:if>
3833
+
3834
+ <xsl:if test="ancestor::mn:example">
3835
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3836
+ </xsl:if>
3837
+
3838
+ <xsl:copy-of select="@id"/>
3839
+
3840
+ <xsl:if test="parent::mn:note">
3841
+ <xsl:attribute name="margin-left">
3842
+ <xsl:choose>
3843
+ <xsl:when test="not(ancestor::mn:table)"><xsl:value-of select="$note-body-indent"/></xsl:when>
3844
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3845
+ </xsl:choose>
3846
+ </xsl:attribute>
3847
+ </xsl:if>
3848
+ </xsl:template>
3849
+
3806
3850
  <xsl:attribute-set name="sourcecode-style">
3807
3851
  <xsl:attribute name="white-space">pre</xsl:attribute>
3808
3852
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -3818,6 +3862,12 @@
3818
3862
  </xsl:if>
3819
3863
  </xsl:template> <!-- refine_sourcecode-style -->
3820
3864
 
3865
+ <xsl:attribute-set name="sourcecode-number-style">
3866
+ </xsl:attribute-set>
3867
+
3868
+ <xsl:template name="refine_sourcecode-number-style">
3869
+ </xsl:template>
3870
+
3821
3871
  <xsl:attribute-set name="sourcecode-name-style">
3822
3872
  <xsl:attribute name="font-size">11pt</xsl:attribute>
3823
3873
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -3826,6 +3876,9 @@
3826
3876
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
3827
3877
  </xsl:attribute-set> <!-- sourcecode-name-style -->
3828
3878
 
3879
+ <xsl:template name="refine_sourcecode-name-style">
3880
+ </xsl:template>
3881
+
3829
3882
  <xsl:template name="add-zero-spaces-equal">
3830
3883
  <xsl:param name="text" select="."/>
3831
3884
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
@@ -3917,24 +3970,8 @@
3917
3970
  <xsl:otherwise>
3918
3971
  <fo:block-container xsl:use-attribute-sets="sourcecode-container-style" role="SKIP">
3919
3972
 
3920
- <xsl:if test="not(ancestor::mn:li) or ancestor::mn:example">
3921
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
3922
- </xsl:if>
3923
-
3924
- <xsl:if test="ancestor::mn:example">
3925
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
3926
- </xsl:if>
3927
-
3928
- <xsl:copy-of select="@id"/>
3973
+ <xsl:call-template name="refine_sourcecode-container-style"/>
3929
3974
 
3930
- <xsl:if test="parent::mn:note">
3931
- <xsl:attribute name="margin-left">
3932
- <xsl:choose>
3933
- <xsl:when test="not(ancestor::mn:table)"><xsl:value-of select="$note-body-indent"/></xsl:when>
3934
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3935
- </xsl:choose>
3936
- </xsl:attribute>
3937
- </xsl:if>
3938
3975
  <fo:block-container margin-left="0mm" role="SKIP">
3939
3976
  <xsl:if test="parent::mn:example">
3940
3977
  <fo:block font-size="1pt" line-height="10%" space-after="4pt"> </fo:block>
@@ -4267,6 +4304,7 @@
4267
4304
  <xsl:template match="mn:sourcecode/mn:fmt-name">
4268
4305
  <xsl:if test="normalize-space() != ''">
4269
4306
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
4307
+ <xsl:call-template name="refine_sourcecode-name-style"/>
4270
4308
  <xsl:apply-templates/>
4271
4309
  </fo:block>
4272
4310
  </xsl:if>
@@ -4318,12 +4356,35 @@
4318
4356
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
4319
4357
  <xsl:attribute name="font-family">Fira Code, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
4320
4358
  <xsl:attribute name="line-height">113%</xsl:attribute>
4321
- </xsl:attribute-set>
4359
+ </xsl:attribute-set> <!-- pre-style -->
4360
+
4361
+ <xsl:template name="refine_pre-style">
4362
+ </xsl:template>
4322
4363
 
4323
4364
  <xsl:attribute-set name="tt-style">
4324
4365
  <xsl:attribute name="font-family">Fira Code, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
4325
4366
  </xsl:attribute-set>
4326
4367
 
4368
+ <xsl:template name="refine_tt-style">
4369
+ <xsl:variable name="_font-size"> <!-- inherit -->
4370
+ <xsl:choose>
4371
+ <xsl:when test="ancestor::mn:table">8.5</xsl:when>
4372
+ <xsl:otherwise>9.5</xsl:otherwise>
4373
+ </xsl:choose>
4374
+ </xsl:variable>
4375
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
4376
+ <xsl:if test="$font-size != ''">
4377
+ <xsl:attribute name="font-size">
4378
+ <xsl:choose>
4379
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
4380
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
4381
+ <xsl:when test="ancestor::mn:note or ancestor::mn:example"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
4382
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
4383
+ </xsl:choose>
4384
+ </xsl:attribute>
4385
+ </xsl:if>
4386
+ </xsl:template>
4387
+
4327
4388
  <xsl:variable name="color-added-text">
4328
4389
  <xsl:text>rgb(0, 255, 0)</xsl:text>
4329
4390
  </xsl:variable>
@@ -4336,9 +4397,14 @@
4336
4397
  <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
4337
4398
  </xsl:attribute-set>
4338
4399
 
4400
+ <xsl:template name="refine_add-style">
4401
+ </xsl:template>
4402
+
4339
4403
  <xsl:variable name="add-style">
4340
- <add-style xsl:use-attribute-sets="add-style"/>
4341
- </xsl:variable>
4404
+ <add-style xsl:use-attribute-sets="add-style">
4405
+ <xsl:call-template name="refine_add-style"/>
4406
+ </add-style>
4407
+ </xsl:variable>
4342
4408
  <xsl:template name="append_add-style">
4343
4409
  <xsl:copy-of select="xalan:nodeset($add-style)/add-style/@*"/>
4344
4410
  </xsl:template>
@@ -4351,24 +4417,77 @@
4351
4417
  <xsl:attribute name="text-decoration">line-through</xsl:attribute>
4352
4418
  </xsl:attribute-set>
4353
4419
 
4420
+ <xsl:template name="refine_del-style">
4421
+ </xsl:template>
4422
+
4423
+ <xsl:attribute-set name="strong-style">
4424
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
4425
+ </xsl:attribute-set>
4426
+
4427
+ <xsl:template name="refine_strong_style">
4428
+ <xsl:if test="ancestor::*['preferred']">
4429
+ <xsl:attribute name="role">SKIP</xsl:attribute>
4430
+ </xsl:if>
4431
+ </xsl:template> <!-- refine_strong_style -->
4432
+
4433
+ <xsl:attribute-set name="em-style">
4434
+ <xsl:attribute name="font-style">italic</xsl:attribute>
4435
+ </xsl:attribute-set>
4436
+
4437
+ <xsl:template name="refine_em_style">
4438
+ </xsl:template> <!-- refine_em_style -->
4439
+
4440
+ <xsl:attribute-set name="sup-style">
4441
+ <xsl:attribute name="font-size">80%</xsl:attribute>
4442
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
4443
+ </xsl:attribute-set>
4444
+
4445
+ <xsl:template name="refine_sup-style">
4446
+ </xsl:template>
4447
+
4448
+ <xsl:attribute-set name="sub-style">
4449
+ <xsl:attribute name="font-size">80%</xsl:attribute>
4450
+ <xsl:attribute name="vertical-align">sub</xsl:attribute>
4451
+ </xsl:attribute-set>
4452
+
4453
+ <xsl:template name="refine_sub-style">
4454
+ </xsl:template>
4455
+
4456
+ <xsl:attribute-set name="underline-style">
4457
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
4458
+ </xsl:attribute-set>
4459
+
4460
+ <xsl:template name="refine_underline-style">
4461
+ </xsl:template>
4462
+
4463
+ <xsl:attribute-set name="hi-style">
4464
+ <xsl:attribute name="background-color">yellow</xsl:attribute>
4465
+ </xsl:attribute-set>
4466
+
4467
+ <xsl:template name="refine_hi-style">
4468
+ </xsl:template>
4469
+
4470
+ <xsl:attribute-set name="strike-style">
4471
+ <xsl:attribute name="text-decoration">line-through</xsl:attribute>
4472
+ </xsl:attribute-set>
4473
+
4474
+ <xsl:template name="refine_strike-style">
4475
+ </xsl:template>
4476
+
4354
4477
  <xsl:template match="mn:br">
4355
4478
  <xsl:value-of select="$linebreak"/>
4356
4479
  </xsl:template>
4357
4480
 
4358
- <xsl:template match="mn:em">
4359
- <fo:inline font-style="italic">
4360
- <xsl:call-template name="refine_italic_style"/>
4481
+ <xsl:template match="mn:em">
4482
+ <fo:inline xsl:use-attribute-sets="em-style">
4483
+ <xsl:call-template name="refine_em_style"/>
4361
4484
  <xsl:apply-templates/>
4362
4485
  </fo:inline>
4363
4486
  </xsl:template>
4364
4487
 
4365
- <xsl:template name="refine_italic_style">
4366
- </xsl:template>
4367
-
4368
4488
  <xsl:template match="mn:strong | *[local-name()='b']">
4369
4489
  <xsl:param name="split_keep-within-line"/>
4370
- <fo:inline font-weight="bold">
4371
-
4490
+ <fo:inline xsl:use-attribute-sets="strong-style">
4372
4491
  <xsl:call-template name="refine_strong_style"/>
4373
4492
 
4374
4493
  <xsl:apply-templates>
@@ -4377,48 +4496,27 @@
4377
4496
  </fo:inline>
4378
4497
  </xsl:template>
4379
4498
 
4380
- <xsl:template name="refine_strong_style">
4381
- <xsl:if test="ancestor::*['preferred']">
4382
- <xsl:attribute name="role">SKIP</xsl:attribute>
4383
- </xsl:if>
4384
- </xsl:template>
4385
-
4386
4499
  <xsl:template match="*[local-name()='padding']">
4387
4500
  <fo:inline padding-right="{@value}"> </fo:inline>
4388
4501
  </xsl:template>
4389
4502
 
4390
4503
  <xsl:template match="mn:sup">
4391
- <fo:inline font-size="80%" vertical-align="super">
4504
+ <fo:inline xsl:use-attribute-sets="sup-style">
4505
+ <xsl:call-template name="refine_sup-style"/>
4392
4506
  <xsl:apply-templates/>
4393
4507
  </fo:inline>
4394
4508
  </xsl:template>
4395
4509
 
4396
4510
  <xsl:template match="mn:sub">
4397
- <fo:inline font-size="80%" vertical-align="sub">
4511
+ <fo:inline xsl:use-attribute-sets="sub-style">
4512
+ <xsl:call-template name="refine_sub-style"/>
4398
4513
  <xsl:apply-templates/>
4399
4514
  </fo:inline>
4400
4515
  </xsl:template>
4401
4516
 
4402
4517
  <xsl:template match="mn:tt">
4403
4518
  <fo:inline xsl:use-attribute-sets="tt-style">
4404
-
4405
- <xsl:variable name="_font-size"> <!-- inherit -->
4406
- <xsl:choose>
4407
- <xsl:when test="ancestor::mn:table">8.5</xsl:when>
4408
- <xsl:otherwise>9.5</xsl:otherwise>
4409
- </xsl:choose>
4410
- </xsl:variable>
4411
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
4412
- <xsl:if test="$font-size != ''">
4413
- <xsl:attribute name="font-size">
4414
- <xsl:choose>
4415
- <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
4416
- <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
4417
- <xsl:when test="ancestor::mn:note or ancestor::mn:example"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
4418
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
4419
- </xsl:choose>
4420
- </xsl:attribute>
4421
- </xsl:if>
4519
+ <xsl:call-template name="refine_tt-style"/>
4422
4520
  <xsl:apply-templates/>
4423
4521
  </fo:inline>
4424
4522
  </xsl:template> <!-- tt -->
@@ -4437,7 +4535,8 @@
4437
4535
  </xsl:template>
4438
4536
 
4439
4537
  <xsl:template match="mn:underline">
4440
- <fo:inline text-decoration="underline">
4538
+ <fo:inline xsl:use-attribute-sets="underline-style">
4539
+ <xsl:call-template name="refine_underline-style"/>
4441
4540
  <xsl:apply-templates/>
4442
4541
  </fo:inline>
4443
4542
  </xsl:template>
@@ -4595,6 +4694,7 @@
4595
4694
 
4596
4695
  <xsl:template match="mn:del">
4597
4696
  <fo:inline xsl:use-attribute-sets="del-style">
4697
+ <xsl:call-template name="refine_del-style"/>
4598
4698
  <xsl:apply-templates/>
4599
4699
  </fo:inline>
4600
4700
  </xsl:template>
@@ -4604,7 +4704,8 @@
4604
4704
 
4605
4705
  <!-- highlight text -->
4606
4706
  <xsl:template match="mn:hi | mn:span[@class = 'fmt-hi']" priority="3">
4607
- <fo:inline background-color="yellow">
4707
+ <fo:inline xsl:use-attribute-sets="hi-style">
4708
+ <xsl:call-template name="refine_hi-style"/>
4608
4709
  <xsl:apply-templates/>
4609
4710
  </fo:inline>
4610
4711
  </xsl:template>
@@ -4690,7 +4791,8 @@
4690
4791
  </xsl:template>
4691
4792
 
4692
4793
  <xsl:template match="mn:strike">
4693
- <fo:inline text-decoration="line-through">
4794
+ <fo:inline xsl:use-attribute-sets="strike-style">
4795
+ <xsl:call-template name="refine_strike-style"/>
4694
4796
  <xsl:apply-templates/>
4695
4797
  </fo:inline>
4696
4798
  </xsl:template>
@@ -4770,6 +4872,7 @@
4770
4872
 
4771
4873
  <xsl:template match="mn:pre" name="pre">
4772
4874
  <fo:block xsl:use-attribute-sets="pre-style">
4875
+ <xsl:call-template name="refine_pre-style"/>
4773
4876
  <xsl:copy-of select="@id"/>
4774
4877
  <xsl:choose>
4775
4878
 
@@ -4801,6 +4904,9 @@
4801
4904
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
4802
4905
  </xsl:attribute-set>
4803
4906
 
4907
+ <xsl:template name="refine_permission-style">
4908
+ </xsl:template>
4909
+
4804
4910
  <xsl:attribute-set name="permission-name-style">
4805
4911
  <xsl:attribute name="font-size">11pt</xsl:attribute>
4806
4912
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -4812,14 +4918,23 @@
4812
4918
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4813
4919
  </xsl:attribute-set>
4814
4920
 
4921
+ <xsl:template name="refine_permission-name-style">
4922
+ </xsl:template>
4923
+
4815
4924
  <xsl:attribute-set name="permission-label-style">
4816
4925
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
4817
4926
  </xsl:attribute-set>
4818
4927
 
4928
+ <xsl:template name="refine_permission-label-style">
4929
+ </xsl:template>
4930
+
4819
4931
  <xsl:attribute-set name="requirement-style">
4820
4932
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
4821
4933
  </xsl:attribute-set>
4822
4934
 
4935
+ <xsl:template name="refine_requirement-style">
4936
+ </xsl:template>
4937
+
4823
4938
  <xsl:attribute-set name="requirement-name-style">
4824
4939
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4825
4940
  <xsl:attribute name="font-size">11pt</xsl:attribute>
@@ -4831,10 +4946,19 @@
4831
4946
  <xsl:attribute name="background-color">rgb(165,165,165)</xsl:attribute>
4832
4947
  </xsl:attribute-set>
4833
4948
 
4949
+ <xsl:template name="refine_requirement-name-style">
4950
+ <xsl:if test="../@type = 'class'">
4951
+ <xsl:attribute name="background-color">white</xsl:attribute>
4952
+ </xsl:if>
4953
+ </xsl:template>
4954
+
4834
4955
  <xsl:attribute-set name="requirement-label-style">
4835
4956
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
4836
4957
  </xsl:attribute-set>
4837
4958
 
4959
+ <xsl:template name="refine_requirement-label-style">
4960
+ </xsl:template>
4961
+
4838
4962
  <xsl:attribute-set name="subject-style">
4839
4963
  </xsl:attribute-set>
4840
4964
 
@@ -4863,6 +4987,9 @@
4863
4987
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
4864
4988
  </xsl:attribute-set>
4865
4989
 
4990
+ <xsl:template name="refine_recommendation-style">
4991
+ </xsl:template>
4992
+
4866
4993
  <xsl:attribute-set name="recommendation-name-style">
4867
4994
  <xsl:attribute name="font-size">11pt</xsl:attribute>
4868
4995
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -4874,16 +5001,23 @@
4874
5001
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4875
5002
  </xsl:attribute-set>
4876
5003
 
5004
+ <xsl:template name="refine_recommendation-name-style">
5005
+ </xsl:template>
5006
+
4877
5007
  <xsl:attribute-set name="recommendation-label-style">
4878
5008
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
4879
5009
  </xsl:attribute-set>
4880
5010
 
5011
+ <xsl:template name="refine_recommendation-label-style">
5012
+ </xsl:template>
5013
+
4881
5014
  <!-- ========== -->
4882
5015
  <!-- permission -->
4883
5016
  <!-- ========== -->
4884
5017
  <xsl:template match="mn:permission">
4885
5018
  <xsl:call-template name="setNamedDestination"/>
4886
5019
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
5020
+ <xsl:call-template name="refine_permission-style"/>
4887
5021
  <xsl:apply-templates select="mn:fmt-name"/>
4888
5022
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
4889
5023
  </fo:block>
@@ -4892,6 +5026,7 @@
4892
5026
  <xsl:template match="mn:permission/mn:fmt-name">
4893
5027
  <xsl:if test="normalize-space() != ''">
4894
5028
  <fo:block xsl:use-attribute-sets="permission-name-style">
5029
+ <xsl:call-template name="refine_permission-name-style"/>
4895
5030
  <xsl:apply-templates/>
4896
5031
  <xsl:text>:</xsl:text>
4897
5032
  </fo:block>
@@ -4900,6 +5035,7 @@
4900
5035
 
4901
5036
  <xsl:template match="mn:permission/mn:label">
4902
5037
  <fo:block xsl:use-attribute-sets="permission-label-style">
5038
+ <xsl:call-template name="refine_permission-label-style"/>
4903
5039
  <xsl:apply-templates/>
4904
5040
  </fo:block>
4905
5041
  </xsl:template>
@@ -4912,6 +5048,7 @@
4912
5048
  <xsl:template match="mn:requirement">
4913
5049
  <xsl:call-template name="setNamedDestination"/>
4914
5050
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
5051
+ <xsl:call-template name="refine_requirement-style"/>
4915
5052
  <xsl:apply-templates select="mn:fmt-name"/>
4916
5053
  <xsl:apply-templates select="mn:label"/>
4917
5054
  <xsl:apply-templates select="@obligation"/>
@@ -4924,9 +5061,7 @@
4924
5061
  <xsl:if test="normalize-space() != ''">
4925
5062
 
4926
5063
  <fo:block xsl:use-attribute-sets="requirement-name-style">
4927
- <xsl:if test="../@type = 'class'">
4928
- <xsl:attribute name="background-color">white</xsl:attribute>
4929
- </xsl:if>
5064
+ <xsl:call-template name="refine_requirement-name-style"/>
4930
5065
  <xsl:apply-templates/>
4931
5066
  <xsl:text>:</xsl:text>
4932
5067
  </fo:block>
@@ -4935,6 +5070,7 @@
4935
5070
 
4936
5071
  <xsl:template match="mn:requirement/mn:label">
4937
5072
  <fo:block xsl:use-attribute-sets="requirement-label-style">
5073
+ <xsl:call-template name="refine_requirement-label-style"/>
4938
5074
  <xsl:apply-templates/>
4939
5075
  </fo:block>
4940
5076
  </xsl:template>
@@ -4960,6 +5096,7 @@
4960
5096
  <xsl:template match="mn:recommendation">
4961
5097
  <xsl:call-template name="setNamedDestination"/>
4962
5098
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
5099
+ <xsl:call-template name="refine_recommendation-style"/>
4963
5100
  <xsl:apply-templates select="mn:fmt-name"/>
4964
5101
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
4965
5102
  </fo:block>
@@ -4969,6 +5106,7 @@
4969
5106
  <xsl:if test="normalize-space() != ''">
4970
5107
 
4971
5108
  <fo:block xsl:use-attribute-sets="recommendation-name-style">
5109
+ <xsl:call-template name="refine_recommendation-name-style"/>
4972
5110
  <xsl:apply-templates/>
4973
5111
  </fo:block>
4974
5112
  </xsl:if>
@@ -4976,6 +5114,7 @@
4976
5114
 
4977
5115
  <xsl:template match="mn:recommendation/mn:label">
4978
5116
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
5117
+ <xsl:call-template name="refine_recommendation-label-style"/>
4979
5118
  <xsl:apply-templates/>
4980
5119
  </fo:block>
4981
5120
  </xsl:template>
@@ -5168,36 +5307,82 @@
5168
5307
  <xsl:attribute-set name="term-style">
5169
5308
  </xsl:attribute-set> <!-- term-style -->
5170
5309
 
5310
+ <xsl:template name="refine_term-style">
5311
+ </xsl:template>
5312
+
5171
5313
  <xsl:attribute-set name="term-name-style">
5172
5314
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
5173
5315
  <xsl:attribute name="font-weight">bold</xsl:attribute>
5316
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
5317
+ <xsl:attribute name="space-before">36pt</xsl:attribute>
5318
+ <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
5319
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
5174
5320
  </xsl:attribute-set> <!-- term-name-style -->
5175
5321
 
5176
- <xsl:attribute-set name="preferred-block-style">
5322
+ <xsl:template name="refine_term-name-style">
5323
+ <xsl:variable name="levelTerm">
5324
+ <xsl:call-template name="getLevelTermName"/>
5325
+ </xsl:variable>
5326
+ <xsl:attribute name="role">H<xsl:value-of select="$levelTerm"/></xsl:attribute>
5327
+ </xsl:template>
5328
+
5329
+ <xsl:attribute-set name="preferred-style">
5330
+ </xsl:attribute-set> <!-- preferred-style -->
5331
+
5332
+ <xsl:template name="refine_preferred-style">
5333
+ </xsl:template>
5334
+
5335
+ <xsl:attribute-set name="preferred-block-style">
5177
5336
  </xsl:attribute-set> <!-- preferred-block-style -->
5178
5337
 
5338
+ <xsl:template name="refine_preferred-block-style">
5339
+ </xsl:template>
5340
+
5179
5341
  <xsl:attribute-set name="preferred-term-style">
5180
5342
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
5181
5343
  <xsl:attribute name="font-weight">bold</xsl:attribute>
5344
+ <xsl:attribute name="font-size">18pt</xsl:attribute>
5345
+ <xsl:attribute name="padding-right">3mm</xsl:attribute>
5182
5346
  </xsl:attribute-set> <!-- preferred-term-style -->
5183
5347
 
5348
+ <xsl:template name="refine_preferred-term-style">
5349
+ <xsl:if test="mn:strong">
5350
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
5351
+ </xsl:if>
5352
+ </xsl:template>
5353
+
5184
5354
  <xsl:attribute-set name="domain-style">
5185
5355
  </xsl:attribute-set> <!-- domain-style -->
5186
5356
 
5357
+ <xsl:template name="refine_domain-style">
5358
+ </xsl:template>
5359
+
5187
5360
  <xsl:attribute-set name="admitted-style">
5188
5361
  <xsl:attribute name="font-size">11pt</xsl:attribute>
5189
5362
  </xsl:attribute-set> <!-- admitted-style -->
5190
5363
 
5364
+ <xsl:template name="refine_admitted-style">
5365
+ </xsl:template>
5366
+
5191
5367
  <xsl:attribute-set name="deprecates-style">
5192
5368
  </xsl:attribute-set> <!-- deprecates-style -->
5193
5369
 
5370
+ <xsl:template name="refine_deprecates-style">
5371
+ </xsl:template>
5372
+
5194
5373
  <xsl:attribute-set name="related-block-style" use-attribute-sets="preferred-block-style">
5195
5374
  </xsl:attribute-set>
5196
5375
 
5376
+ <xsl:template name="refine_related-block-style">
5377
+ </xsl:template>
5378
+
5197
5379
  <xsl:attribute-set name="definition-style">
5198
5380
  <xsl:attribute name="space-after">6pt</xsl:attribute>
5199
5381
  </xsl:attribute-set> <!-- definition-style -->
5200
5382
 
5383
+ <xsl:template name="refine_definition-style">
5384
+ </xsl:template>
5385
+
5201
5386
  <xsl:attribute-set name="termsource-style">
5202
5387
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
5203
5388
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
@@ -5210,9 +5395,15 @@
5210
5395
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
5211
5396
  </xsl:attribute-set> <!-- termsource-text-style -->
5212
5397
 
5398
+ <xsl:template name="refine_termsource-text-style">
5399
+ </xsl:template>
5400
+
5213
5401
  <xsl:attribute-set name="origin-style">
5214
5402
  </xsl:attribute-set> <!-- origin-style -->
5215
5403
 
5404
+ <xsl:template name="refine_origin-style">
5405
+ </xsl:template>
5406
+
5216
5407
  <!-- ====== -->
5217
5408
  <!-- term -->
5218
5409
  <!-- ====== -->
@@ -5228,10 +5419,9 @@
5228
5419
  <xsl:template match="mn:term">
5229
5420
  <xsl:call-template name="setNamedDestination"/>
5230
5421
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
5422
+ <xsl:call-template name="refine_term-style"/>
5231
5423
  <xsl:apply-templates select="mn:fmt-name"/>
5232
5424
 
5233
- <xsl:if test="parent::mn:term and not(preceding-sibling::mn:term)">
5234
- </xsl:if>
5235
5425
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
5236
5426
  </fo:block>
5237
5427
  </xsl:template>
@@ -5307,6 +5497,7 @@
5307
5497
  <!-- text SOURCE: -->
5308
5498
  <xsl:template match="mn:fmt-termsource/mn:strong[1][following-sibling::*[1][self::mn:fmt-origin]]/text()">
5309
5499
  <fo:inline xsl:use-attribute-sets="termsource-text-style">
5500
+ <xsl:call-template name="refine_termsource-text-style"/>
5310
5501
  <xsl:value-of select="."/>
5311
5502
  </fo:inline>
5312
5503
  </xsl:template>
@@ -5319,6 +5510,7 @@
5319
5510
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
5320
5511
  </xsl:if>
5321
5512
  <fo:inline xsl:use-attribute-sets="origin-style">
5513
+ <xsl:call-template name="refine_origin-style"/>
5322
5514
  <xsl:apply-templates/>
5323
5515
  </fo:inline>
5324
5516
  </fo:basic-link>
@@ -5368,9 +5560,12 @@
5368
5560
  </xsl:variable>
5369
5561
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
5370
5562
 
5563
+ <xsl:call-template name="refine_preferred-block-style"/>
5564
+
5371
5565
  <xsl:if test="parent::mn:term and not(preceding-sibling::mn:fmt-preferred)"> <!-- if first preffered in term, then display term's name -->
5372
5566
 
5373
5567
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
5568
+ <xsl:call-template name="refine_term-name-style"/>
5374
5569
 
5375
5570
  <xsl:for-each select="ancestor::mn:term[1]/mn:fmt-name"><!-- change context -->
5376
5571
  <xsl:call-template name="setIDforNamedDestination"/>
@@ -5381,7 +5576,7 @@
5381
5576
  </xsl:if>
5382
5577
 
5383
5578
  <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
5384
- <xsl:call-template name="setStyle_preferred"/>
5579
+ <xsl:call-template name="refine_preferred-term-style"/>
5385
5580
 
5386
5581
  <xsl:apply-templates/>
5387
5582
  </fo:block>
@@ -5402,22 +5597,18 @@
5402
5597
 
5403
5598
  <xsl:template match="mn:fmt-admitted">
5404
5599
  <fo:block xsl:use-attribute-sets="admitted-style">
5600
+ <xsl:call-template name="refine_admitted-style"/>
5405
5601
  <xsl:apply-templates/>
5406
5602
  </fo:block>
5407
5603
  </xsl:template>
5408
5604
 
5409
5605
  <xsl:template match="mn:fmt-deprecates">
5410
5606
  <fo:block xsl:use-attribute-sets="deprecates-style">
5607
+ <xsl:call-template name="refine_deprecates-style"/>
5411
5608
  <xsl:apply-templates/>
5412
5609
  </fo:block>
5413
5610
  </xsl:template>
5414
5611
 
5415
- <xsl:template name="setStyle_preferred">
5416
- <xsl:if test="mn:strong">
5417
- <xsl:attribute name="font-weight">normal</xsl:attribute>
5418
- </xsl:if>
5419
- </xsl:template>
5420
-
5421
5612
  <!-- regarding ISO 10241-1:2011, If there is more than one preferred term, each preferred term follows the previous one on a new line. -->
5422
5613
  <!-- in metanorma xml preferred terms delimited by semicolons -->
5423
5614
  <xsl:template match="mn:fmt-preferred/text()[contains(., ';')] | mn:fmt-preferred/mn:strong/text()[contains(., ';')]">
@@ -5427,6 +5618,7 @@
5427
5618
 
5428
5619
  <xsl:template match="mn:fmt-related">
5429
5620
  <fo:block role="SKIP" xsl:use-attribute-sets="related-block-style">
5621
+ <xsl:call-template name="refine_related-block-style"/>
5430
5622
  <xsl:apply-templates/>
5431
5623
  </fo:block>
5432
5624
  </xsl:template>
@@ -5441,6 +5633,7 @@
5441
5633
  <!-- ========== -->
5442
5634
  <xsl:template match="mn:fmt-definition">
5443
5635
  <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
5636
+ <xsl:call-template name="refine_definition-style"/>
5444
5637
  <xsl:apply-templates/>
5445
5638
  </fo:block>
5446
5639
  </xsl:template>
@@ -5489,6 +5682,9 @@
5489
5682
  <xsl:attribute-set name="example-body-style">
5490
5683
  </xsl:attribute-set> <!-- example-body-style -->
5491
5684
 
5685
+ <xsl:template name="refine_example-body-style">
5686
+ </xsl:template>
5687
+
5492
5688
  <xsl:attribute-set name="example-name-style">
5493
5689
  <xsl:attribute name="font-weight">bold</xsl:attribute>
5494
5690
  </xsl:attribute-set> <!-- example-name-style -->
@@ -5535,6 +5731,8 @@
5535
5731
  <xsl:when test="contains($element, 'block')">
5536
5732
  <fo:block xsl:use-attribute-sets="example-p-style">
5537
5733
 
5734
+ <xsl:call-template name="refine_example-p-style"/>
5735
+
5538
5736
  <xsl:apply-templates/>
5539
5737
  </fo:block>
5540
5738
  </xsl:when>
@@ -5586,6 +5784,7 @@
5586
5784
  </fo:block>
5587
5785
 
5588
5786
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
5787
+ <xsl:call-template name="refine_example-body-style"/>
5589
5788
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
5590
5789
  <xsl:variable name="example_body">
5591
5790
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]">
@@ -5648,6 +5847,7 @@
5648
5847
  <xsl:if test="*[not(self::mn:fmt-name)][position() &gt; 1]">
5649
5848
  <!-- display further elements in blocks -->
5650
5849
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
5850
+ <xsl:call-template name="refine_example-body-style"/>
5651
5851
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
5652
5852
  <xsl:apply-templates select="*[not(self::mn:fmt-name)][position() &gt; 1]">
5653
5853
  <xsl:with-param name="fo_element" select="'block'"/>
@@ -5768,6 +5968,12 @@
5768
5968
  <xsl:call-template name="setBordersTableArray"/>
5769
5969
  </xsl:template> <!-- refine_table-style -->
5770
5970
 
5971
+ <xsl:attribute-set name="table-number-style">
5972
+ </xsl:attribute-set>
5973
+
5974
+ <xsl:template name="refine_table-number-style">
5975
+ </xsl:template>
5976
+
5771
5977
  <xsl:attribute-set name="table-name-style">
5772
5978
  <xsl:attribute name="role">Caption</xsl:attribute>
5773
5979
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
@@ -5898,6 +6104,9 @@
5898
6104
  <!-- <xsl:attribute name="padding-right">5mm</xsl:attribute> -->
5899
6105
  </xsl:attribute-set> <!-- table-fn-number-style -->
5900
6106
 
6107
+ <xsl:template name="refine_table-fn-number-style">
6108
+ </xsl:template>
6109
+
5901
6110
  <xsl:attribute-set name="table-fmt-fn-label-style">
5902
6111
  <xsl:attribute name="font-size">80%</xsl:attribute>
5903
6112
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -5906,30 +6115,12 @@
5906
6115
  <xsl:template name="refine_table-fmt-fn-label-style">
5907
6116
  </xsl:template>
5908
6117
 
5909
- <xsl:attribute-set name="fn-container-body-style">
5910
- <xsl:attribute name="text-indent">0</xsl:attribute>
5911
- <xsl:attribute name="start-indent">0</xsl:attribute>
5912
- </xsl:attribute-set>
5913
-
5914
6118
  <xsl:attribute-set name="table-fn-body-style">
5915
6119
  </xsl:attribute-set>
5916
6120
 
5917
- <xsl:attribute-set name="figure-fn-number-style">
5918
- <xsl:attribute name="padding-right">5mm</xsl:attribute>
5919
- </xsl:attribute-set> <!-- figure-fn-number-style -->
5920
-
5921
- <xsl:attribute-set name="figure-fmt-fn-label-style">
5922
- <xsl:attribute name="font-size">80%</xsl:attribute>
5923
- <xsl:attribute name="vertical-align">super</xsl:attribute>
5924
- </xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
5925
-
5926
- <xsl:template name="refine_figure-fmt-fn-label-style">
6121
+ <xsl:template name="refine_table-fn-body-style">
5927
6122
  </xsl:template>
5928
6123
 
5929
- <xsl:attribute-set name="figure-fn-body-style">
5930
- <xsl:attribute name="text-align">justify</xsl:attribute>
5931
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
5932
- </xsl:attribute-set>
5933
6124
  <!-- ========================== -->
5934
6125
  <!-- END Table styles -->
5935
6126
  <!-- ========================== -->
@@ -6250,7 +6441,7 @@
6250
6441
 
6251
6442
  </fo:block>
6252
6443
 
6253
- <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
6444
+ <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'pas' or $namespace = 'iec' or $namespace = 'iso'"> -->
6254
6445
  <xsl:if test="$continued = 'true'">
6255
6446
 
6256
6447
  <!-- to prevent the error 'THead element may contain only TR elements' -->
@@ -7211,6 +7402,7 @@
7211
7402
  </xsl:apply-templates>
7212
7403
 
7213
7404
  <fo:inline xsl:use-attribute-sets="table-fn-body-style">
7405
+ <xsl:call-template name="refine_table-fn-body-style"/>
7214
7406
  <!-- <xsl:copy-of select="./node()"/> -->
7215
7407
  <xsl:apply-templates/>
7216
7408
  </fo:inline>
@@ -7229,6 +7421,7 @@
7229
7421
  <xsl:param name="process">false</xsl:param>
7230
7422
  <xsl:if test="$process = 'true'">
7231
7423
  <fo:inline xsl:use-attribute-sets="table-fn-number-style" role="SKIP">
7424
+ <xsl:call-template name="refine_table-fn-number-style"/>
7232
7425
 
7233
7426
  <!-- tab is padding-right -->
7234
7427
  <xsl:apply-templates select=".//mn:tab">
@@ -8101,10 +8294,22 @@
8101
8294
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
8102
8295
  </xsl:attribute-set>
8103
8296
 
8297
+ <xsl:template name="refine_dl-block-style">
8298
+ <xsl:if test="@key = 'true' and ancestor::mn:figure">
8299
+ <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
8300
+ </xsl:if>
8301
+ </xsl:template>
8302
+
8104
8303
  <xsl:attribute-set name="dt-row-style">
8105
8304
  <xsl:attribute name="min-height">8.5mm</xsl:attribute>
8106
8305
  </xsl:attribute-set>
8107
8306
 
8307
+ <xsl:template name="refine_dt-row-style">
8308
+ <xsl:if test="not(following-sibling::mn:dt) or ancestor::mn:sourcecode"> <!-- last item -->
8309
+ <xsl:attribute name="min-height">3mm</xsl:attribute>
8310
+ </xsl:if>
8311
+ </xsl:template>
8312
+
8108
8313
  <xsl:attribute-set name="dt-cell-style">
8109
8314
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
8110
8315
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
@@ -8139,6 +8344,9 @@
8139
8344
  <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
8140
8345
  </xsl:attribute-set> <!-- dl-name-style -->
8141
8346
 
8347
+ <xsl:template name="refine_dl-name-style">
8348
+ </xsl:template>
8349
+
8142
8350
  <xsl:attribute-set name="dd-cell-style">
8143
8351
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
8144
8352
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
@@ -8181,9 +8389,7 @@
8181
8389
  <!-- <dl><xsl:copy-of select="."/></dl> -->
8182
8390
  <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
8183
8391
 
8184
- <xsl:if test="@key = 'true' and ancestor::mn:figure">
8185
- <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
8186
- </xsl:if>
8392
+ <xsl:call-template name="refine_dl-block-style"/>
8187
8393
 
8188
8394
  <xsl:call-template name="setBlockSpanAll"/>
8189
8395
  <xsl:if test="not(ancestor::mn:quote)">
@@ -8479,6 +8685,8 @@
8479
8685
  <xsl:if test="$process = 'true'">
8480
8686
  <fo:block xsl:use-attribute-sets="dl-name-style">
8481
8687
 
8688
+ <xsl:call-template name="refine_dl-name-style"/>
8689
+
8482
8690
  <xsl:apply-templates/>
8483
8691
  </fo:block>
8484
8692
  </xsl:if>
@@ -8667,9 +8875,8 @@
8667
8875
  <xsl:param name="split_keep-within-line"/>
8668
8876
 
8669
8877
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
8670
- <xsl:if test="not(following-sibling::mn:dt) or ancestor::mn:sourcecode"> <!-- last item -->
8671
- <xsl:attribute name="min-height">3mm</xsl:attribute>
8672
- </xsl:if>
8878
+ <xsl:call-template name="refine_dt-row-style"/>
8879
+
8673
8880
  <xsl:call-template name="insert_dt_cell">
8674
8881
  <xsl:with-param name="key_iso" select="$key_iso"/>
8675
8882
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -8885,18 +9092,25 @@
8885
9092
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
8886
9093
  </xsl:attribute-set>
8887
9094
 
9095
+ <xsl:template name="refine_appendix-style">
9096
+ </xsl:template>
9097
+
8888
9098
  <xsl:attribute-set name="appendix-example-style">
8889
9099
  <xsl:attribute name="font-size">10pt</xsl:attribute>
8890
9100
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
8891
9101
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
8892
9102
  </xsl:attribute-set>
8893
9103
 
9104
+ <xsl:template name="refine_appendix-example-style">
9105
+ </xsl:template>
9106
+
8894
9107
  <!-- ======================== -->
8895
9108
  <!-- Appendix processing -->
8896
9109
  <!-- ======================== -->
8897
9110
  <xsl:template match="mn:appendix">
8898
9111
  <xsl:call-template name="setNamedDestination"/>
8899
9112
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
9113
+ <xsl:call-template name="refine_appendix-style"/>
8900
9114
  <xsl:apply-templates select="mn:fmt-title"/>
8901
9115
  </fo:block>
8902
9116
  <xsl:apply-templates select="node()[not(self::mn:fmt-title)]"/>
@@ -8915,13 +9129,23 @@
8915
9129
  <xsl:template match="mn:appendix//mn:example" priority="2">
8916
9130
  <xsl:call-template name="setNamedDestination"/>
8917
9131
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
9132
+ <xsl:call-template name="refine_appendix-example-style"/>
8918
9133
  <xsl:apply-templates select="mn:fmt-name"/>
8919
9134
  </fo:block>
8920
9135
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
8921
9136
  </xsl:template>
8922
9137
 
8923
9138
  <xsl:attribute-set name="xref-style">
8924
- </xsl:attribute-set>
9139
+ </xsl:attribute-set> <!-- xref-style -->
9140
+
9141
+ <xsl:template name="refine_xref-style">
9142
+ <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[self::mn:table or self::mn:dl])">
9143
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
9144
+ </xsl:if>
9145
+ <xsl:if test="parent::mn:add">
9146
+ <xsl:call-template name="append_add-style"/>
9147
+ </xsl:if>
9148
+ </xsl:template> <!-- refine_xref-style -->
8925
9149
 
8926
9150
  <xsl:template match="mn:fmt-xref">
8927
9151
  <xsl:call-template name="insert_basic_link">
@@ -8930,12 +9154,8 @@
8930
9154
  <xsl:call-template name="getAltText"/>
8931
9155
  </xsl:variable>
8932
9156
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
8933
- <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[self::mn:table or self::mn:dl])">
8934
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
8935
- </xsl:if>
8936
- <xsl:if test="parent::mn:add">
8937
- <xsl:call-template name="append_add-style"/>
8938
- </xsl:if>
9157
+ <xsl:call-template name="refine_xref-style"/>
9158
+
8939
9159
  <xsl:apply-templates/>
8940
9160
  </fo:basic-link>
8941
9161
  </xsl:with-param>
@@ -9044,13 +9264,13 @@
9044
9264
  <xsl:attribute-set name="note-style">
9045
9265
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
9046
9266
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
9047
- </xsl:attribute-set>
9267
+ </xsl:attribute-set> <!-- note-style -->
9048
9268
 
9049
9269
  <xsl:template name="refine_note-style">
9050
9270
  <xsl:if test="ancestor::mn:ul or ancestor::mn:ol and not(ancestor::mn:note[1]/following-sibling::*)">
9051
9271
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
9052
9272
  </xsl:if>
9053
- </xsl:template>
9273
+ </xsl:template> <!-- refine_note-style -->
9054
9274
 
9055
9275
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
9056
9276
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
@@ -9058,7 +9278,7 @@
9058
9278
  <xsl:attribute-set name="note-name-style">
9059
9279
  <xsl:attribute name="font-weight">bold</xsl:attribute>
9060
9280
  <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
9061
- </xsl:attribute-set>
9281
+ </xsl:attribute-set> <!-- note-name-style -->
9062
9282
 
9063
9283
  <xsl:template name="refine_note-name-style">
9064
9284
  </xsl:template> <!-- refine_note-name-style -->
@@ -9073,12 +9293,15 @@
9073
9293
  <xsl:attribute-set name="note-p-style">
9074
9294
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
9075
9295
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
9076
- </xsl:attribute-set>
9296
+ </xsl:attribute-set> <!-- note-p-style -->
9297
+
9298
+ <xsl:template name="refine_note-p-style">
9299
+ </xsl:template>
9077
9300
 
9078
9301
  <xsl:attribute-set name="termnote-style">
9079
9302
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
9080
9303
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
9081
- </xsl:attribute-set>
9304
+ </xsl:attribute-set> <!-- termnote-style -->
9082
9305
 
9083
9306
  <xsl:template name="refine_termnote-style">
9084
9307
  </xsl:template> <!-- refine_termnote-style -->
@@ -9086,7 +9309,7 @@
9086
9309
  <xsl:attribute-set name="termnote-name-style">
9087
9310
  <xsl:attribute name="font-weight">bold</xsl:attribute>
9088
9311
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
9089
- </xsl:attribute-set>
9312
+ </xsl:attribute-set> <!-- termnote-name-style -->
9090
9313
 
9091
9314
  <xsl:template name="refine_termnote-name-style">
9092
9315
  </xsl:template>
@@ -9095,6 +9318,9 @@
9095
9318
  <xsl:attribute name="space-before">4pt</xsl:attribute>
9096
9319
  </xsl:attribute-set>
9097
9320
 
9321
+ <xsl:template name="refine_termnote-p-style">
9322
+ </xsl:template>
9323
+
9098
9324
  <!-- ====== -->
9099
9325
  <!-- note -->
9100
9326
  <!-- termnote -->
@@ -9155,11 +9381,13 @@
9155
9381
  <xsl:choose>
9156
9382
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
9157
9383
  <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
9384
+ <xsl:call-template name="refine_note-p-style"/>
9158
9385
  <xsl:apply-templates/>
9159
9386
  </fo:inline>
9160
9387
  </xsl:when>
9161
9388
  <xsl:otherwise>
9162
9389
  <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
9390
+ <xsl:call-template name="refine_note-p-style"/>
9163
9391
  <xsl:apply-templates/>
9164
9392
  </fo:block>
9165
9393
  </xsl:otherwise>
@@ -9251,11 +9479,13 @@
9251
9479
  <xsl:choose>
9252
9480
  <xsl:when test="$num = 1"> <!-- first paragraph renders in the same line as titlenote name -->
9253
9481
  <fo:inline xsl:use-attribute-sets="termnote-p-style">
9482
+ <xsl:call-template name="refine_termnote-p-style"/>
9254
9483
  <xsl:apply-templates/>
9255
9484
  </fo:inline>
9256
9485
  </xsl:when>
9257
9486
  <xsl:otherwise>
9258
9487
  <fo:block xsl:use-attribute-sets="termnote-p-style">
9488
+ <xsl:call-template name="refine_termnote-p-style"/>
9259
9489
  <xsl:apply-templates/>
9260
9490
  </fo:block>
9261
9491
  </xsl:otherwise>
@@ -9270,7 +9500,7 @@
9270
9500
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
9271
9501
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
9272
9502
  <xsl:attribute name="margin-left">13mm</xsl:attribute>
9273
- </xsl:attribute-set>
9503
+ </xsl:attribute-set> <!-- quote-style -->
9274
9504
 
9275
9505
  <xsl:template name="refine_quote-style">
9276
9506
  </xsl:template>
@@ -9280,6 +9510,9 @@
9280
9510
  <xsl:attribute name="margin-right">25mm</xsl:attribute>
9281
9511
  </xsl:attribute-set>
9282
9512
 
9513
+ <xsl:template name="refine_quote-source-style">
9514
+ </xsl:template>
9515
+
9283
9516
  <!-- ====== -->
9284
9517
  <!-- quote -->
9285
9518
  <!-- source -->
@@ -9308,6 +9541,7 @@
9308
9541
  </fo:block-container>
9309
9542
  <xsl:if test="mn:author or mn:fmt-source or mn:attribution">
9310
9543
  <fo:block xsl:use-attribute-sets="quote-source-style">
9544
+ <xsl:call-template name="refine_quote-source-style"/>
9311
9545
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
9312
9546
  <xsl:apply-templates select="mn:author"/>
9313
9547
  <xsl:apply-templates select="mn:fmt-source"/>
@@ -9370,6 +9604,15 @@
9370
9604
  <xsl:attribute-set name="figure-style">
9371
9605
  </xsl:attribute-set>
9372
9606
 
9607
+ <xsl:template name="refine_figure-style">
9608
+ </xsl:template>
9609
+
9610
+ <xsl:attribute-set name="figure-number-style">
9611
+ </xsl:attribute-set>
9612
+
9613
+ <xsl:template name="refine_figure-number-style">
9614
+ </xsl:template>
9615
+
9373
9616
  <xsl:attribute-set name="figure-name-style">
9374
9617
  <xsl:attribute name="role">Caption</xsl:attribute>
9375
9618
  <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
@@ -9379,7 +9622,7 @@
9379
9622
  <!-- <xsl:attribute name="keep-with-next">always</xsl:attribute> -->
9380
9623
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
9381
9624
  <xsl:attribute name="text-align">center</xsl:attribute>
9382
- </xsl:attribute-set>
9625
+ </xsl:attribute-set> <!-- figure-name-style -->
9383
9626
 
9384
9627
  <xsl:template name="refine_figure-name-style">
9385
9628
  </xsl:template> <!-- refine_figure-name-style -->
@@ -9389,7 +9632,7 @@
9389
9632
  <xsl:attribute name="text-align">center</xsl:attribute>
9390
9633
  <xsl:attribute name="space-before">12pt</xsl:attribute>
9391
9634
  <xsl:attribute name="space-after">6pt</xsl:attribute>
9392
- </xsl:attribute-set>
9635
+ </xsl:attribute-set> <!-- image-style -->
9393
9636
 
9394
9637
  <xsl:template name="refine_image-style">
9395
9638
  </xsl:template>
@@ -9399,14 +9642,51 @@
9399
9642
  <xsl:attribute name="content-height">100%</xsl:attribute>
9400
9643
  <xsl:attribute name="scaling">uniform</xsl:attribute>
9401
9644
  <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
9402
- </xsl:attribute-set>
9645
+ </xsl:attribute-set> <!-- image-graphic-style -->
9646
+
9647
+ <xsl:template name="refine_image-graphic-style">
9648
+ </xsl:template>
9403
9649
 
9404
9650
  <xsl:attribute-set name="figure-source-style">
9405
9651
  </xsl:attribute-set>
9406
9652
 
9653
+ <xsl:template name="refine_figure-source-style">
9654
+ </xsl:template>
9655
+
9407
9656
  <xsl:attribute-set name="figure-pseudocode-p-style">
9408
9657
  </xsl:attribute-set>
9409
9658
 
9659
+ <xsl:template name="refine_figure-pseudocode-p-style">
9660
+ </xsl:template>
9661
+
9662
+ <xsl:attribute-set name="figure-fn-number-style">
9663
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
9664
+ </xsl:attribute-set> <!-- figure-fn-number-style -->
9665
+
9666
+ <xsl:template name="refine_figure-fn-number-style">
9667
+ </xsl:template>
9668
+
9669
+ <xsl:attribute-set name="figure-fmt-fn-label-style">
9670
+ <xsl:attribute name="font-size">80%</xsl:attribute>
9671
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
9672
+ </xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
9673
+
9674
+ <xsl:template name="refine_figure-fmt-fn-label-style">
9675
+ </xsl:template>
9676
+
9677
+ <xsl:attribute-set name="figure-fn-body-style">
9678
+ <xsl:attribute name="text-align">justify</xsl:attribute>
9679
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
9680
+ </xsl:attribute-set>
9681
+
9682
+ <xsl:template name="refine_figure-fn-body-style">
9683
+ <xsl:variable name="key_iso">
9684
+ </xsl:variable>
9685
+ <xsl:if test="normalize-space($key_iso) = 'true'">
9686
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
9687
+ </xsl:if>
9688
+ </xsl:template>
9689
+
9410
9690
  <!-- ============================ -->
9411
9691
  <!-- figure's footnotes rendering -->
9412
9692
  <!-- ============================ -->
@@ -9519,9 +9799,8 @@
9519
9799
  </fo:table-cell>
9520
9800
  <fo:table-cell>
9521
9801
  <fo:block xsl:use-attribute-sets="figure-fn-body-style">
9522
- <xsl:if test="normalize-space($key_iso) = 'true'">
9523
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
9524
- </xsl:if>
9802
+ <xsl:call-template name="refine_figure-fn-body-style"/>
9803
+
9525
9804
  <!-- <xsl:copy-of select="./node()"/> -->
9526
9805
  <xsl:apply-templates/>
9527
9806
  </fo:block>
@@ -9539,6 +9818,7 @@
9539
9818
  <xsl:param name="process">false</xsl:param>
9540
9819
  <xsl:if test="$process = 'true'">
9541
9820
  <fo:inline xsl:use-attribute-sets="figure-fn-number-style" role="SKIP">
9821
+ <xsl:call-template name="refine_figure-fn-number-style"/>
9542
9822
  <xsl:attribute name="padding-right">0mm</xsl:attribute>
9543
9823
 
9544
9824
  <!-- tab is padding-right -->
@@ -9576,6 +9856,7 @@
9576
9856
  <xsl:attribute name="font-size">10pt</xsl:attribute>
9577
9857
  </xsl:if>
9578
9858
  <fo:inline xsl:use-attribute-sets="figure-fn-number-style figure-fmt-fn-label-style"> <!-- id="{@id}" -->
9859
+ <xsl:call-template name="refine_figure-fn-number-style"/>
9579
9860
  <!-- <xsl:value-of select="@reference"/> -->
9580
9861
  <xsl:apply-templates/>
9581
9862
  </fo:inline>
@@ -9621,6 +9902,8 @@
9621
9902
 
9622
9903
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
9623
9904
 
9905
+ <xsl:call-template name="refine_figure-style"/>
9906
+
9624
9907
  <xsl:for-each select="mn:fmt-name"> <!-- set context -->
9625
9908
  <xsl:call-template name="setIDforNamedDestination"/>
9626
9909
  </xsl:for-each>
@@ -9664,6 +9947,7 @@
9664
9947
 
9665
9948
  <xsl:template match="mn:figure[@class = 'pseudocode']//mn:p">
9666
9949
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
9950
+ <xsl:call-template name="refine_figure-pseudocode-p-style"/>
9667
9951
  <xsl:apply-templates/>
9668
9952
  </fo:block>
9669
9953
  </xsl:template>
@@ -9793,6 +10077,8 @@
9793
10077
  </xsl:variable>
9794
10078
  <xsl:copy-of select="xalan:nodeset($image-graphic-style_attributes)/attributes/@*"/>
9795
10079
 
10080
+ <xsl:call-template name="refine_image-graphic-style"/>
10081
+
9796
10082
  <xsl:if test="not(@mimetype = 'image/svg+xml') and not(ancestor::mn:table)">
9797
10083
  <xsl:variable name="scale">
9798
10084
  <xsl:call-template name="getImageScale">
@@ -10492,6 +10778,9 @@
10492
10778
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10493
10779
  </xsl:attribute-set> <!-- formula-style -->
10494
10780
 
10781
+ <xsl:template name="refine_formula-style">
10782
+ </xsl:template>
10783
+
10495
10784
  <xsl:attribute-set name="formula-stem-block-style">
10496
10785
  <xsl:attribute name="text-align">center</xsl:attribute>
10497
10786
  <xsl:attribute name="text-align">left</xsl:attribute>
@@ -10561,6 +10850,8 @@
10561
10850
  <xsl:template match="mn:formula[mn:fmt-name]/mn:fmt-stem">
10562
10851
  <fo:block xsl:use-attribute-sets="formula-style">
10563
10852
 
10853
+ <xsl:call-template name="refine_formula-style"/>
10854
+
10564
10855
  <fo:table table-layout="fixed" width="100%">
10565
10856
  <fo:table-column column-width="95%"/>
10566
10857
  <fo:table-column column-width="5%"/>
@@ -10975,6 +11266,22 @@
10975
11266
  </xsl:attribute-set> <!-- list-style -->
10976
11267
 
10977
11268
  <xsl:template name="refine_list-style">
11269
+ <xsl:variable name="ul_indent">6</xsl:variable>
11270
+ <xsl:if test="self::mn:ul">
11271
+ <xsl:attribute name="provisional-distance-between-starts"><xsl:value-of select="$ul_indent"/>mm</xsl:attribute>
11272
+ </xsl:if>
11273
+ <xsl:if test="ancestor::mn:table">
11274
+ <xsl:attribute name="provisional-distance-between-starts">5mm</xsl:attribute>
11275
+ </xsl:if>
11276
+ <xsl:if test="ancestor::mn:ul | ancestor::mn:ol">
11277
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
11278
+ <xsl:if test="ancestor::mn:table[not(@class)]">
11279
+ <xsl:attribute name="space-after">1mm</xsl:attribute>
11280
+ </xsl:if>
11281
+ </xsl:if>
11282
+ <xsl:if test="following-sibling::*[1][self::mn:ul or self::mn:ol]">
11283
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
11284
+ </xsl:if>
10978
11285
  </xsl:template> <!-- refine_list-style -->
10979
11286
 
10980
11287
  <xsl:attribute-set name="list-name-style">
@@ -10983,6 +11290,9 @@
10983
11290
  <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
10984
11291
  </xsl:attribute-set> <!-- list-name-style -->
10985
11292
 
11293
+ <xsl:template name="refine_list-name-style">
11294
+ </xsl:template>
11295
+
10986
11296
  <xsl:attribute-set name="list-item-style">
10987
11297
  </xsl:attribute-set>
10988
11298
 
@@ -11287,6 +11597,7 @@
11287
11597
  <xsl:param name="process">false</xsl:param>
11288
11598
  <xsl:if test="$process = 'true'">
11289
11599
  <fo:block xsl:use-attribute-sets="list-name-style">
11600
+ <xsl:call-template name="refine_list-name-style"/>
11290
11601
  <xsl:apply-templates/>
11291
11602
  </fo:block>
11292
11603
  </xsl:if>
@@ -11347,25 +11658,46 @@
11347
11658
  <!-- END Lists processing -->
11348
11659
  <!-- ===================================== -->
11349
11660
 
11661
+ <xsl:attribute-set name="footnote-separator-leader-style">
11662
+ </xsl:attribute-set>
11663
+
11664
+ <xsl:template name="refine_footnote-separator-leader-style">
11665
+ </xsl:template>
11666
+
11667
+ <xsl:attribute-set name="fn-container-body-style">
11668
+ <xsl:attribute name="text-indent">0</xsl:attribute>
11669
+ <xsl:attribute name="start-indent">0</xsl:attribute>
11670
+ </xsl:attribute-set>
11671
+
11672
+ <xsl:template name="refine_fn-container-body-style">
11673
+ </xsl:template>
11674
+
11350
11675
  <xsl:attribute-set name="fn-reference-style">
11351
11676
  <xsl:attribute name="font-size">80%</xsl:attribute>
11352
11677
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
11353
11678
  <xsl:attribute name="vertical-align">super</xsl:attribute>
11354
-
11355
- </xsl:attribute-set>
11679
+ </xsl:attribute-set> <!-- fn-reference-style -->
11356
11680
 
11357
11681
  <xsl:template name="refine_fn-reference-style">
11682
+ <!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
11683
+ <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">,</xsl:if>
11358
11684
  </xsl:template> <!-- refine_fn-reference-style -->
11359
11685
 
11360
11686
  <xsl:attribute-set name="fn-style">
11361
11687
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
11362
11688
  </xsl:attribute-set>
11363
11689
 
11690
+ <xsl:template name="refine_fn-style">
11691
+ </xsl:template>
11692
+
11364
11693
  <xsl:attribute-set name="fn-num-style">
11365
11694
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
11366
11695
  <xsl:attribute name="font-size">65%</xsl:attribute>
11367
11696
  <xsl:attribute name="vertical-align">super</xsl:attribute>
11368
- </xsl:attribute-set>
11697
+ </xsl:attribute-set> <!-- fn-num-style -->
11698
+
11699
+ <xsl:template name="refine_fn-num-style">
11700
+ </xsl:template>
11369
11701
 
11370
11702
  <xsl:attribute-set name="fn-body-style">
11371
11703
  <xsl:attribute name="font-weight">normal</xsl:attribute>
@@ -11377,7 +11709,7 @@
11377
11709
  <xsl:attribute name="color"><xsl:value-of select="$color_main"/></xsl:attribute>
11378
11710
  <xsl:attribute name="line-height">124%</xsl:attribute>
11379
11711
  <xsl:attribute name="text-align">justify</xsl:attribute>
11380
- </xsl:attribute-set>
11712
+ </xsl:attribute-set> <!-- fn-body-style" -->
11381
11713
 
11382
11714
  <xsl:template name="refine_fn-body-style">
11383
11715
  </xsl:template> <!-- refine_fn-body-style -->
@@ -11441,10 +11773,12 @@
11441
11773
  <xsl:choose>
11442
11774
  <xsl:when test="ancestor::mn:bibitem">
11443
11775
  <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
11776
+ <xsl:call-template name="refine_bibitem-note-fn-style"/>
11444
11777
  </fn_styles>
11445
11778
  </xsl:when>
11446
11779
  <xsl:otherwise>
11447
11780
  <fn_styles xsl:use-attribute-sets="fn-num-style">
11781
+ <xsl:call-template name="refine_fn-num-style"/>
11448
11782
  </fn_styles>
11449
11783
  </xsl:otherwise>
11450
11784
  </xsl:choose>
@@ -11454,9 +11788,12 @@
11454
11788
  <xsl:copy-of select="."/>
11455
11789
  </xsl:for-each>
11456
11790
 
11457
- <xsl:if test="following-sibling::node()[normalize-space() != ''][1][self::mn:fn]">
11791
+ <!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
11792
+ <!-- <xsl:if test="following-sibling::node()[normalize-space() != ''][1][self::mn:fn]">
11458
11793
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
11459
- </xsl:if>
11794
+ </xsl:if> -->
11795
+
11796
+ <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">,</xsl:if>
11460
11797
 
11461
11798
  <xsl:call-template name="insert_basic_link">
11462
11799
  <xsl:with-param name="element">
@@ -11479,10 +11816,12 @@
11479
11816
  <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
11480
11817
 
11481
11818
  <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
11819
+ <xsl:call-template name="refine_fn-style"/>
11482
11820
  <xsl:copy-of select="$footnote_inline"/>
11483
11821
  <fo:footnote-body role="Note">
11484
11822
 
11485
11823
  <fo:block-container xsl:use-attribute-sets="fn-container-body-style" role="SKIP">
11824
+ <xsl:call-template name="refine_fn-container-body-style"/>
11486
11825
 
11487
11826
  <xsl:variable name="fn_block">
11488
11827
  <xsl:call-template name="refine_fn-body-style"/>
@@ -11584,6 +11923,9 @@
11584
11923
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
11585
11924
  </xsl:attribute-set> <!-- admonition-style -->
11586
11925
 
11926
+ <xsl:template name="refine_admonition-style">
11927
+ </xsl:template>
11928
+
11587
11929
  <xsl:attribute-set name="admonition-container-style">
11588
11930
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
11589
11931
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -11591,6 +11933,9 @@
11591
11933
  <xsl:attribute name="padding-top">3mm</xsl:attribute>
11592
11934
  </xsl:attribute-set> <!-- admonition-container-style -->
11593
11935
 
11936
+ <xsl:template name="refine_admonition-container-style">
11937
+ </xsl:template>
11938
+
11594
11939
  <xsl:attribute-set name="admonition-name-style">
11595
11940
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
11596
11941
  <xsl:attribute name="font-size">11pt</xsl:attribute>
@@ -11600,9 +11945,16 @@
11600
11945
  <xsl:attribute name="text-align">center</xsl:attribute>
11601
11946
  </xsl:attribute-set> <!-- admonition-name-style -->
11602
11947
 
11948
+ <xsl:template name="refine_admonition-name-style">
11949
+ </xsl:template>
11950
+
11603
11951
  <xsl:attribute-set name="admonition-p-style">
11604
11952
  <xsl:attribute name="font-style">italic</xsl:attribute>
11605
11953
  </xsl:attribute-set> <!-- admonition-p-style -->
11954
+
11955
+ <xsl:template name="refine_admonition-p-style">
11956
+ </xsl:template>
11957
+
11606
11958
  <!-- end admonition -->
11607
11959
 
11608
11960
  <!-- ================ -->
@@ -11612,6 +11964,8 @@
11612
11964
  <xsl:call-template name="setNamedDestination"/>
11613
11965
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
11614
11966
 
11967
+ <xsl:call-template name="refine_admonition-style"/>
11968
+
11615
11969
  <xsl:call-template name="setBlockSpanAll"/>
11616
11970
  <xsl:variable name="admonition_color" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = concat('color-admonition-', @type)]/mn:value)"/>
11617
11971
  <xsl:if test="$admonition_color != ''">
@@ -11619,10 +11973,14 @@
11619
11973
  <xsl:attribute name="color"><xsl:value-of select="$admonition_color"/></xsl:attribute>
11620
11974
  </xsl:if>
11621
11975
  <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
11976
+
11977
+ <xsl:call-template name="refine_admonition-container-style"/>
11622
11978
  <fo:block xsl:use-attribute-sets="admonition-name-style">
11979
+ <xsl:call-template name="refine_admonition-name-style"/>
11623
11980
  <xsl:call-template name="displayAdmonitionName"/>
11624
11981
  </fo:block>
11625
11982
  <fo:block xsl:use-attribute-sets="admonition-p-style">
11983
+ <xsl:call-template name="refine_admonition-p-style"/>
11626
11984
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
11627
11985
  </fo:block>
11628
11986
 
@@ -11676,6 +12034,7 @@
11676
12034
 
11677
12035
  <xsl:template match="mn:admonition/mn:p">
11678
12036
  <fo:block xsl:use-attribute-sets="admonition-p-style">
12037
+ <xsl:call-template name="refine_admonition-p-style"/>
11679
12038
 
11680
12039
  <xsl:apply-templates/>
11681
12040
  </fo:block>
@@ -11685,6 +12044,13 @@
11685
12044
  <!-- END Admonition -->
11686
12045
  <!-- ================ -->
11687
12046
 
12047
+ <xsl:attribute-set name="references-non-normative-title-style">
12048
+ </xsl:attribute-set>
12049
+
12050
+ <xsl:template name="refine_references-non-normative-title-style">
12051
+
12052
+ </xsl:template>
12053
+
11688
12054
  <!-- bibitem in Normative References (references/@normative="true") -->
11689
12055
  <xsl:attribute-set name="bibitem-normative-style">
11690
12056
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -11693,6 +12059,9 @@
11693
12059
  <xsl:attribute name="line-height">115%</xsl:attribute>
11694
12060
  </xsl:attribute-set> <!-- bibitem-normative-style -->
11695
12061
 
12062
+ <xsl:template name="refine_bibitem-normative-style">
12063
+ </xsl:template>
12064
+
11696
12065
  <!-- bibitem in Normative References (references/@normative="true"), renders as list -->
11697
12066
  <xsl:attribute-set name="bibitem-normative-list-style">
11698
12067
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
@@ -11701,9 +12070,15 @@
11701
12070
  <xsl:attribute name="provisional-distance-between-starts">13mm</xsl:attribute>
11702
12071
  </xsl:attribute-set> <!-- bibitem-normative-list-style -->
11703
12072
 
12073
+ <xsl:template name="refine_bibitem-normative-list-style">
12074
+ </xsl:template>
12075
+
11704
12076
  <xsl:attribute-set name="bibitem-non-normative-style">
11705
12077
  </xsl:attribute-set> <!-- bibitem-non-normative-style -->
11706
12078
 
12079
+ <xsl:template name="refine_bibitem-non-normative-style">
12080
+ </xsl:template>
12081
+
11707
12082
  <!-- bibitem in bibliography section (references/@normative="false"), renders as list -->
11708
12083
  <xsl:attribute-set name="bibitem-non-normative-list-style">
11709
12084
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
@@ -11711,17 +12086,29 @@
11711
12086
  <xsl:attribute name="provisional-distance-between-starts">13mm</xsl:attribute>
11712
12087
  </xsl:attribute-set> <!-- bibitem-non-normative-list-style -->
11713
12088
 
12089
+ <xsl:template name="refine_bibitem-non-normative-list-style">
12090
+ </xsl:template>
12091
+
11714
12092
  <xsl:attribute-set name="bibitem-non-normative-list-item-style">
11715
12093
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
11716
12094
  </xsl:attribute-set>
11717
12095
 
12096
+ <xsl:template name="refine_bibitem-non-normative-list-item-style">
12097
+ </xsl:template>
12098
+
11718
12099
  <!-- bibitem in bibliography section (references/@normative="false"), list body -->
11719
12100
  <xsl:attribute-set name="bibitem-normative-list-body-style">
11720
12101
  </xsl:attribute-set>
11721
12102
 
12103
+ <xsl:template name="refine_bibitem-normative-list-body-style">
12104
+ </xsl:template>
12105
+
11722
12106
  <xsl:attribute-set name="bibitem-non-normative-list-body-style">
11723
12107
  </xsl:attribute-set> <!-- bibitem-non-normative-list-body-style -->
11724
12108
 
12109
+ <xsl:template name="refine_bibitem-non-normative-list-body-style">
12110
+ </xsl:template>
12111
+
11725
12112
  <!-- footnote reference number for bibitem, in the text -->
11726
12113
  <xsl:attribute-set name="bibitem-note-fn-style">
11727
12114
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
@@ -11729,6 +12116,9 @@
11729
12116
  <xsl:attribute name="vertical-align">super</xsl:attribute>
11730
12117
  </xsl:attribute-set> <!-- bibitem-note-fn-style -->
11731
12118
 
12119
+ <xsl:template name="refine_bibitem-note-fn-style">
12120
+ </xsl:template>
12121
+
11732
12122
  <!-- footnote number on the page bottom -->
11733
12123
  <xsl:attribute-set name="bibitem-note-fn-number-style">
11734
12124
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
@@ -11747,6 +12137,9 @@
11747
12137
  <xsl:attribute name="line-height">120%</xsl:attribute>
11748
12138
  </xsl:attribute-set> <!-- references-non-normative-style -->
11749
12139
 
12140
+ <xsl:template name="refine_references-non-normative-style">
12141
+ </xsl:template>
12142
+
11750
12143
  <!-- ======================= -->
11751
12144
  <!-- Bibliography rendering -->
11752
12145
  <!-- ======================= -->
@@ -11788,6 +12181,7 @@
11788
12181
  <xsl:apply-templates select="mn:fmt-title[@columns = 1]"/>
11789
12182
 
11790
12183
  <fo:block xsl:use-attribute-sets="references-non-normative-style">
12184
+ <xsl:call-template name="refine_references-non-normative-style"/>
11791
12185
  <xsl:apply-templates select="node()[not(self::mn:fmt-title and @columns = 1)]"/>
11792
12186
  </fo:block>
11793
12187
  </xsl:template> <!-- references -->
@@ -11801,21 +12195,25 @@
11801
12195
  <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
11802
12196
  <xsl:call-template name="setNamedDestination"/>
11803
12197
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
12198
+ <xsl:call-template name="refine_bibitem-normative-style"/>
12199
+
11804
12200
  <xsl:call-template name="processBibitem"/>
11805
12201
  </fo:block>
11806
12202
 
11807
12203
  </xsl:template> <!-- bibitem -->
11808
12204
 
11809
12205
  <!-- Bibliography (non-normative references) -->
11810
- <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem | mn:references[not(@normative='true')]/mn:note" name="bibitem_non_normative" priority="2">
12206
+ <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem" name="bibitem_non_normative" priority="2">
11811
12207
  <xsl:param name="skip" select="normalize-space(preceding-sibling::*[not(self::mn:note)][1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first --> <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'ieee' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
11812
12208
  $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
11813
12209
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
11814
12210
  <xsl:call-template name="setNamedDestination"/>
11815
12211
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
12212
+ <xsl:call-template name="refine_bibitem-non-normative-list-style"/>
12213
+
11816
12214
  <fo:list-item>
11817
12215
  <fo:list-item-label end-indent="label-end()">
11818
- <fo:block role="SKIP">
12216
+ <fo:block role="SKIP" id="__internal_layout__bibitem_{@id}_{generate-id()}">
11819
12217
  <fo:inline role="SKIP">
11820
12218
  <xsl:apply-templates select="mn:biblio-tag">
11821
12219
  <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
@@ -11825,6 +12223,7 @@
11825
12223
  </fo:list-item-label>
11826
12224
  <fo:list-item-body start-indent="body-start()">
11827
12225
  <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
12226
+ <xsl:call-template name="refine_bibitem-non-normative-list-body-style"/>
11828
12227
  <xsl:call-template name="processBibitem">
11829
12228
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
11830
12229
  </xsl:call-template>
@@ -11835,12 +12234,17 @@
11835
12234
 
11836
12235
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
11837
12236
 
12237
+ <!-- bibitem's notes will be processing in 'processBibitemFollowingNotes' -->
12238
+ <xsl:template match="mn:references/mn:note" priority="2"/> <!-- [not(@normative='true')] -->
12239
+
11838
12240
  <xsl:template name="insertListItem_Bibitem">
11839
12241
  <xsl:choose>
11840
12242
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
11841
12243
  <xsl:otherwise>
11842
12244
  <xsl:call-template name="setNamedDestination"/>
11843
12245
  <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
12246
+ <xsl:call-template name="refine_bibitem-non-normative-list-item-style"/>
12247
+
11844
12248
  <fo:list-item-label end-indent="label-end()">
11845
12249
  <fo:block role="SKIP">
11846
12250
  <fo:inline role="SKIP">
@@ -11851,16 +12255,18 @@
11851
12255
  </fo:block>
11852
12256
  </fo:list-item-label>
11853
12257
  <fo:list-item-body start-indent="body-start()">
11854
- <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
12258
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style"> <!-- role="SKIP" -->
12259
+ <xsl:call-template name="refine_bibitem-non-normative-list-body-style"/>
11855
12260
  <xsl:call-template name="processBibitem">
11856
12261
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
11857
12262
  </xsl:call-template>
11858
12263
  </fo:block>
12264
+ <xsl:call-template name="processBibitemFollowingNotes"/>
11859
12265
  </fo:list-item-body>
11860
12266
  </fo:list-item>
11861
12267
  </xsl:otherwise>
11862
12268
  </xsl:choose>
11863
- <xsl:apply-templates select="following-sibling::*[1]"> <!-- [self::mn:bibitem] -->
12269
+ <xsl:apply-templates select="following-sibling::*[self::mn:bibitem][1]">
11864
12270
  <xsl:with-param name="skip">false</xsl:with-param>
11865
12271
  </xsl:apply-templates>
11866
12272
  </xsl:template>
@@ -11876,25 +12282,16 @@
11876
12282
  <xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
11877
12283
  </xsl:apply-templates>
11878
12284
  <xsl:apply-templates select="mn:formattedref"/>
12285
+ <xsl:call-template name="processBibitemFollowingNotes"/>
11879
12286
  <!-- end bibitem processing -->
11880
-
11881
- <xsl:call-template name="processBibliographyNote"/>
11882
12287
  </xsl:template> <!-- processBibitem (bibitem) -->
11883
12288
 
11884
- <xsl:template name="processBibliographyNote">
11885
- <xsl:if test="self::mn:note">
11886
- <xsl:variable name="note_node">
11887
- <xsl:element name="{local-name(..)}" namespace="{$namespace_full}"> <!-- save parent context node for determining styles -->
11888
- <xsl:copy> <!-- skip @id -->
11889
- <xsl:copy-of select="node()"/>
11890
- </xsl:copy>
11891
- </xsl:element>
11892
- </xsl:variable>
11893
- <!-- <xsl:for-each select="xalan:nodeset($note_node)//mn:note">
11894
- <xsl:call-template name="note"/>
11895
- </xsl:for-each> -->
12289
+ <xsl:template name="processBibitemFollowingNotes">
12290
+ <!-- current context is bibitem element -->
12291
+ <xsl:variable name="bibitem_id" select="@id"/>
12292
+ <xsl:for-each select="following-sibling::mn:note[preceding-sibling::mn:bibitem[1][@id = $bibitem_id] and preceding-sibling::*[1][self::mn:note or self::mn:bibitem]]">
11896
12293
  <xsl:call-template name="note"/>
11897
- </xsl:if>
12294
+ </xsl:for-each>
11898
12295
  </xsl:template>
11899
12296
 
11900
12297
  <xsl:template match="mn:title" mode="title">
@@ -12094,11 +12491,17 @@
12094
12491
  <!-- Index section styles -->
12095
12492
  <xsl:attribute-set name="indexsect-title-style">
12096
12493
  <xsl:attribute name="role">H1</xsl:attribute>
12097
- </xsl:attribute-set>
12494
+ </xsl:attribute-set> <!-- indexsect-title-style -->
12495
+
12496
+ <xsl:template name="refine_indexsect-title-style">
12497
+ </xsl:template>
12098
12498
 
12099
12499
  <xsl:attribute-set name="indexsect-clause-title-style">
12100
12500
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
12101
- </xsl:attribute-set>
12501
+ </xsl:attribute-set> <!-- indexsect-clause-title-style -->
12502
+
12503
+ <xsl:template name="refine_indexsect-clause-title-style">
12504
+ </xsl:template>
12102
12505
  <!-- End Index section styles -->
12103
12506
 
12104
12507
  <!-- =================== -->
@@ -12292,6 +12695,7 @@
12292
12695
 
12293
12696
  <xsl:template match="mn:indexsect/mn:fmt-title | mn:indexsect/mn:title" priority="4">
12294
12697
  <fo:block xsl:use-attribute-sets="indexsect-title-style">
12698
+ <xsl:call-template name="refine_indexsect-title-style"/>
12295
12699
  <!-- Index -->
12296
12700
  <xsl:apply-templates/>
12297
12701
  </fo:block>
@@ -12300,6 +12704,7 @@
12300
12704
  <xsl:template match="mn:indexsect/mn:clause/mn:fmt-title | mn:indexsect/mn:clause/mn:title" priority="4">
12301
12705
  <!-- Letter A, B, C, ... -->
12302
12706
  <fo:block xsl:use-attribute-sets="indexsect-clause-title-style">
12707
+ <xsl:call-template name="refine_indexsect-clause-title-style"/>
12303
12708
  <xsl:apply-templates/>
12304
12709
  </fo:block>
12305
12710
  </xsl:template>
@@ -12461,6 +12866,7 @@
12461
12866
  <!-- =================== -->
12462
12867
 
12463
12868
  <xsl:attribute-set name="toc-style">
12869
+ <xsl:attribute name="line-height">130%</xsl:attribute>
12464
12870
  </xsl:attribute-set>
12465
12871
 
12466
12872
  <xsl:template name="refine_toc-style">
@@ -12507,9 +12913,15 @@
12507
12913
  <xsl:attribute name="leader-pattern">dots</xsl:attribute>
12508
12914
  </xsl:attribute-set> <!-- END: toc-leader-style -->
12509
12915
 
12916
+ <xsl:template name="refine_toc-leader-style">
12917
+ </xsl:template>
12918
+
12510
12919
  <xsl:attribute-set name="toc-pagenumber-style">
12511
12920
  </xsl:attribute-set>
12512
12921
 
12922
+ <xsl:template name="refine_toc-pagenumber-style">
12923
+ </xsl:template>
12924
+
12513
12925
  <!-- List of Figures, Tables -->
12514
12926
  <xsl:attribute-set name="toc-listof-title-style">
12515
12927
  <xsl:attribute name="margin-left">-18mm</xsl:attribute>
@@ -12525,12 +12937,18 @@
12525
12937
  <xsl:attribute-set name="toc-listof-item-block-style">
12526
12938
  </xsl:attribute-set>
12527
12939
 
12940
+ <xsl:template name="refine_toc-listof-item-block-style">
12941
+ </xsl:template>
12942
+
12528
12943
  <xsl:attribute-set name="toc-listof-item-style">
12529
12944
  <xsl:attribute name="role">TOCI</xsl:attribute>
12530
12945
  <xsl:attribute name="text-align-last">justify</xsl:attribute>
12531
12946
  <xsl:attribute name="margin-top">2pt</xsl:attribute>
12532
12947
  </xsl:attribute-set>
12533
12948
 
12949
+ <xsl:template name="refine_toc-listof-item-style">
12950
+ </xsl:template>
12951
+
12534
12952
  <xsl:template name="processPrefaceSectionsDefault_Contents">
12535
12953
  <xsl:variable name="nodes_preface_">
12536
12954
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
@@ -13612,23 +14030,55 @@
13612
14030
  <!-- Ruby text (CJK languages) rendering -->
13613
14031
  <!-- ===================================== -->
13614
14032
  <!-- ===================================== -->
14033
+
14034
+ <xsl:attribute-set name="ruby-style">
14035
+ <xsl:attribute name="text-indent">0mm</xsl:attribute>
14036
+ <xsl:attribute name="last-line-end-indent">0mm</xsl:attribute>
14037
+ </xsl:attribute-set>
14038
+
14039
+ <xsl:template name="refine_ruby-style">
14040
+ <xsl:if test="not(ancestor::mn:ruby)">
14041
+ <xsl:attribute name="alignment-baseline">central</xsl:attribute>
14042
+ </xsl:if>
14043
+ <xsl:variable name="rt_text" select="mn:rt"/>
14044
+ <xsl:variable name="rb_text" select=".//mn:rb[not(mn:ruby)]"/>
14045
+ <!-- Example: width="2em" -->
14046
+ <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
14047
+ <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
14048
+ <xsl:variable name="text_width">
14049
+ <xsl:choose>
14050
+ <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
14051
+ <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
14052
+ </xsl:choose>
14053
+ </xsl:variable>
14054
+ <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
14055
+ </xsl:template> <!-- refine_ruby-style -->
14056
+
14057
+ <xsl:attribute-set name="rb-style">
14058
+ <xsl:attribute name="line-height">1em</xsl:attribute>
14059
+ <xsl:attribute name="text-align">center</xsl:attribute>
14060
+ </xsl:attribute-set>
14061
+
14062
+ <xsl:template name="refine_rb-style">
14063
+ </xsl:template>
14064
+
14065
+ <xsl:attribute-set name="rt-style">
14066
+ <xsl:attribute name="font-size">0.5em</xsl:attribute>
14067
+ <xsl:attribute name="text-align">center</xsl:attribute>
14068
+ <xsl:attribute name="line-height">1.2em</xsl:attribute>
14069
+ <xsl:attribute name="space-before">-1.4em</xsl:attribute>
14070
+ <xsl:attribute name="space-before.conditionality">retain</xsl:attribute>
14071
+ </xsl:attribute-set>
14072
+
14073
+ <xsl:template name="refine_rt-style">
14074
+ <xsl:if test="ancestor::mn:ruby[last()]//mn:ruby or ancestor::mn:rb">
14075
+ <xsl:attribute name="space-before">0em</xsl:attribute>
14076
+ </xsl:if>
14077
+ </xsl:template>
14078
+
13615
14079
  <xsl:template match="mn:ruby">
13616
- <fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
13617
- <xsl:if test="not(ancestor::mn:ruby)">
13618
- <xsl:attribute name="alignment-baseline">central</xsl:attribute>
13619
- </xsl:if>
13620
- <xsl:variable name="rt_text" select="mn:rt"/>
13621
- <xsl:variable name="rb_text" select=".//mn:rb[not(mn:ruby)]"/>
13622
- <!-- Example: width="2em" -->
13623
- <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
13624
- <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
13625
- <xsl:variable name="text_width">
13626
- <xsl:choose>
13627
- <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
13628
- <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
13629
- </xsl:choose>
13630
- </xsl:variable>
13631
- <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
14080
+ <fo:inline-container xsl:use-attribute-sets="ruby-style">
14081
+ <xsl:call-template name="refine_ruby-style"/>
13632
14082
 
13633
14083
  <xsl:choose>
13634
14084
  <xsl:when test="ancestor::mn:ruby">
@@ -13646,17 +14096,14 @@
13646
14096
  </xsl:template>
13647
14097
 
13648
14098
  <xsl:template match="mn:rb">
13649
- <fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
14099
+ <fo:block xsl:use-attribute-sets="rb-style"><xsl:call-template name="refine_rb-style"/><xsl:apply-templates/></fo:block>
13650
14100
  </xsl:template>
13651
14101
 
13652
14102
  <xsl:template match="mn:rt">
13653
- <fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
13654
- <xsl:if test="ancestor::mn:ruby[last()]//mn:ruby or ancestor::mn:rb">
13655
- <xsl:attribute name="space-before">0em</xsl:attribute>
13656
- </xsl:if>
14103
+ <fo:block xsl:use-attribute-sets="rt-style"> <!-- -->
14104
+ <xsl:call-template name="refine_rt-style"/>
13657
14105
  <xsl:apply-templates/>
13658
14106
  </fo:block>
13659
-
13660
14107
  </xsl:template>
13661
14108
 
13662
14109
  <!-- ===================================== -->
@@ -13665,6 +14112,18 @@
13665
14112
  <!-- ===================================== -->
13666
14113
  <!-- ===================================== -->
13667
14114
 
14115
+ <xsl:attribute-set name="annex-title-style">
14116
+ </xsl:attribute-set>
14117
+
14118
+ <xsl:template name="refine_annex-title-style">
14119
+ </xsl:template>
14120
+
14121
+ <xsl:attribute-set name="p-zzSTDTitle1-style">
14122
+ </xsl:attribute-set>
14123
+
14124
+ <xsl:template name="refine_p-zzSTDTitle1-style">
14125
+ </xsl:template>
14126
+
13668
14127
  <xsl:template name="processPrefaceSectionsDefault">
13669
14128
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
13670
14129
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -14003,10 +14462,17 @@
14003
14462
  </xsl:choose>
14004
14463
  </xsl:template>
14005
14464
 
14465
+ <xsl:attribute-set name="clause-style">
14466
+
14467
+ </xsl:attribute-set>
14468
+
14469
+ <xsl:template name="refine_clause-style">
14470
+ </xsl:template>
14471
+
14006
14472
  <!-- main sections -->
14007
14473
  <xsl:template match="/*/mn:sections/*" name="sections_node" priority="2">
14008
14474
  <xsl:call-template name="setNamedDestination"/>
14009
- <fo:block>
14475
+ <fo:block role="Sect">
14010
14476
  <xsl:call-template name="setId"/>
14011
14477
 
14012
14478
  <xsl:call-template name="sections_element_style"/>
@@ -14134,6 +14600,10 @@
14134
14600
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
14135
14601
  </xsl:template>
14136
14602
 
14603
+ <!-- for case when update_xml_step1 (common.updatexml.xsl) doesn't apply when $table_if = 'true' -->
14604
+ <xsl:template match="mn:title[following-sibling::*[1][self::mn:fmt-title]]"/>
14605
+ <xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]"/>
14606
+
14137
14607
  <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
14138
14608
  <xsl:template name="insert_basic_link">
14139
14609
  <xsl:param name="element"/>