metanorma-plateau 1.1.2 → 1.1.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.
@@ -3702,42 +3702,86 @@
3702
3702
  <xsl:attribute-set name="copyright-statement-style">
3703
3703
  </xsl:attribute-set> <!-- copyright-statement-style -->
3704
3704
 
3705
+ <xsl:template name="refine_copyright-statement-style">
3706
+ </xsl:template>
3707
+
3705
3708
  <xsl:attribute-set name="copyright-statement-title-style">
3706
3709
  </xsl:attribute-set> <!-- copyright-statement-title-style -->
3707
3710
 
3711
+ <xsl:template name="refine_copyright-statement-title-style">
3712
+ </xsl:template>
3713
+
3708
3714
  <xsl:attribute-set name="copyright-statement-p-style">
3709
3715
  </xsl:attribute-set> <!-- copyright-statement-p-style -->
3710
3716
 
3711
- <xsl:attribute-set name="license-statement-style">
3717
+ <xsl:template name="refine_copyright-statement-p-style">
3718
+
3719
+ </xsl:template>
3720
+
3721
+ <xsl:attribute-set name="license-statement-style">
3712
3722
  </xsl:attribute-set> <!-- license-statement-style -->
3713
3723
 
3724
+ <xsl:template name="refine_license-statement-style">
3725
+ </xsl:template>
3726
+
3714
3727
  <xsl:attribute-set name="license-statement-title-style">
3715
3728
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3716
3729
  </xsl:attribute-set> <!-- license-statement-title-style -->
3717
3730
 
3731
+ <xsl:template name="refine_license-statement-title-style">
3732
+ </xsl:template>
3733
+
3718
3734
  <xsl:attribute-set name="license-statement-p-style">
3719
3735
  </xsl:attribute-set> <!-- license-statement-p-style -->
3720
3736
 
3737
+ <xsl:template name="refine_license-statement-p-style">
3738
+
3739
+ </xsl:template>
3740
+
3721
3741
  <xsl:attribute-set name="legal-statement-style">
3722
3742
  </xsl:attribute-set> <!-- legal-statement-style -->
3723
3743
 
3744
+ <xsl:template name="refine_legal-statement-style">
3745
+ </xsl:template>
3746
+
3724
3747
  <xsl:attribute-set name="legal-statement-title-style">
3725
3748
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3726
3749
  </xsl:attribute-set> <!-- legal-statement-title-style -->
3727
3750
 
3751
+ <xsl:template name="refine_legal-statement-title-style">
3752
+ </xsl:template>
3753
+
3728
3754
  <xsl:attribute-set name="legal-statement-p-style">
3729
3755
  </xsl:attribute-set> <!-- legal-statement-p-style -->
3730
3756
 
3757
+ <xsl:template name="refine_legal-statement-p-style">
3758
+ <xsl:if test="@align">
3759
+ <xsl:attribute name="text-align">
3760
+ <xsl:value-of select="@align"/>
3761
+ </xsl:attribute>
3762
+ </xsl:if>
3763
+ </xsl:template>
3764
+
3731
3765
  <xsl:attribute-set name="feedback-statement-style">
3732
3766
  </xsl:attribute-set> <!-- feedback-statement-style -->
3733
3767
 
3768
+ <xsl:template name="refine_feedback-statement-style">
3769
+ </xsl:template>
3770
+
3734
3771
  <xsl:attribute-set name="feedback-statement-title-style">
3735
3772
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3736
3773
  </xsl:attribute-set> <!-- feedback-statement-title-style -->
3737
3774
 
3775
+ <xsl:template name="refine_feedback-statement-title-style">
3776
+
3777
+ </xsl:template>
3778
+
3738
3779
  <xsl:attribute-set name="feedback-statement-p-style">
3739
3780
  </xsl:attribute-set> <!-- feedback-statement-p-style -->
3740
3781
 
3782
+ <xsl:template name="refine_feedback-statement-p-style">
3783
+ </xsl:template>
3784
+
3741
3785
  <!-- End boilerplate sections styles -->
3742
3786
 
3743
3787
  <!-- ================================= -->
@@ -3745,6 +3789,8 @@
3745
3789
  <!-- ================================= -->
3746
3790
  <xsl:template match="mn:copyright-statement">
3747
3791
  <fo:block xsl:use-attribute-sets="copyright-statement-style" role="SKIP">
3792
+ <xsl:call-template name="refine_copyright-statement-style"/>
3793
+
3748
3794
  <xsl:apply-templates/>
3749
3795
  </fo:block>
3750
3796
  </xsl:template> <!-- copyright-statement -->
@@ -3761,6 +3807,7 @@
3761
3807
 
3762
3808
  <xsl:template match="mn:license-statement">
3763
3809
  <fo:block xsl:use-attribute-sets="license-statement-style">
3810
+ <xsl:call-template name="refine_license-statement-style"/>
3764
3811
  <xsl:apply-templates/>
3765
3812
  </fo:block>
3766
3813
  </xsl:template> <!-- license-statement -->
@@ -3778,6 +3825,7 @@
3778
3825
  <xsl:template match="mn:legal-statement">
3779
3826
  <xsl:param name="isLegacy">false</xsl:param>
3780
3827
  <fo:block xsl:use-attribute-sets="legal-statement-style">
3828
+ <xsl:call-template name="refine_legal-statement-style"/>
3781
3829
  <xsl:apply-templates/>
3782
3830
  </fo:block>
3783
3831
  </xsl:template> <!-- legal-statement -->
@@ -3945,6 +3993,27 @@
3945
3993
  <xsl:attribute-set name="sourcecode-container-style">
3946
3994
  </xsl:attribute-set>
3947
3995
 
3996
+ <xsl:template name="refine_sourcecode-container-style">
3997
+ <xsl:if test="not(ancestor::mn:li) or ancestor::mn:example">
3998
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3999
+ </xsl:if>
4000
+
4001
+ <xsl:if test="ancestor::mn:example">
4002
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
4003
+ </xsl:if>
4004
+
4005
+ <xsl:copy-of select="@id"/>
4006
+
4007
+ <xsl:if test="parent::mn:note">
4008
+ <xsl:attribute name="margin-left">
4009
+ <xsl:choose>
4010
+ <xsl:when test="not(ancestor::mn:table)"><xsl:value-of select="$note-body-indent"/></xsl:when>
4011
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4012
+ </xsl:choose>
4013
+ </xsl:attribute>
4014
+ </xsl:if>
4015
+ </xsl:template>
4016
+
3948
4017
  <xsl:attribute-set name="sourcecode-style">
3949
4018
  <xsl:attribute name="white-space">pre</xsl:attribute>
3950
4019
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -3962,6 +4031,9 @@
3962
4031
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
3963
4032
  </xsl:attribute-set> <!-- sourcecode-name-style -->
3964
4033
 
4034
+ <xsl:template name="refine_sourcecode-name-style">
4035
+ </xsl:template>
4036
+
3965
4037
  <xsl:template name="add-zero-spaces-equal">
3966
4038
  <xsl:param name="text" select="."/>
3967
4039
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
@@ -4049,24 +4121,8 @@
4049
4121
  <xsl:otherwise>
4050
4122
  <fo:block-container xsl:use-attribute-sets="sourcecode-container-style" role="SKIP">
4051
4123
 
4052
- <xsl:if test="not(ancestor::mn:li) or ancestor::mn:example">
4053
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
4054
- </xsl:if>
4055
-
4056
- <xsl:if test="ancestor::mn:example">
4057
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
4058
- </xsl:if>
4059
-
4060
- <xsl:copy-of select="@id"/>
4124
+ <xsl:call-template name="refine_sourcecode-container-style"/>
4061
4125
 
4062
- <xsl:if test="parent::mn:note">
4063
- <xsl:attribute name="margin-left">
4064
- <xsl:choose>
4065
- <xsl:when test="not(ancestor::mn:table)"><xsl:value-of select="$note-body-indent"/></xsl:when>
4066
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4067
- </xsl:choose>
4068
- </xsl:attribute>
4069
- </xsl:if>
4070
4126
  <fo:block-container margin-left="0mm" role="SKIP">
4071
4127
 
4072
4128
  <fo:block xsl:use-attribute-sets="sourcecode-style">
@@ -4393,6 +4449,7 @@
4393
4449
  <xsl:template match="mn:sourcecode/mn:fmt-name">
4394
4450
  <xsl:if test="normalize-space() != ''">
4395
4451
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
4452
+ <xsl:call-template name="refine_sourcecode-name-style"/>
4396
4453
  <xsl:apply-templates/>
4397
4454
  </fo:block>
4398
4455
  </xsl:if>
@@ -4439,11 +4496,30 @@
4439
4496
  <xsl:attribute-set name="pre-style">
4440
4497
  <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
4441
4498
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
4442
- </xsl:attribute-set>
4499
+ </xsl:attribute-set> <!-- pre-style -->
4500
+
4501
+ <xsl:template name="refine_pre-style">
4502
+ </xsl:template>
4443
4503
 
4444
4504
  <xsl:attribute-set name="tt-style">
4445
4505
  </xsl:attribute-set>
4446
4506
 
4507
+ <xsl:template name="refine_tt-style">
4508
+ <xsl:variable name="_font-size"> <!-- inherit -->
4509
+ </xsl:variable>
4510
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
4511
+ <xsl:if test="$font-size != ''">
4512
+ <xsl:attribute name="font-size">
4513
+ <xsl:choose>
4514
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
4515
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
4516
+ <xsl:when test="ancestor::mn:note or ancestor::mn:example"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
4517
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
4518
+ </xsl:choose>
4519
+ </xsl:attribute>
4520
+ </xsl:if>
4521
+ </xsl:template>
4522
+
4447
4523
  <xsl:variable name="color-added-text">
4448
4524
  <xsl:text>rgb(0, 255, 0)</xsl:text>
4449
4525
  </xsl:variable>
@@ -4456,9 +4532,14 @@
4456
4532
  <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
4457
4533
  </xsl:attribute-set>
4458
4534
 
4535
+ <xsl:template name="refine_add-style">
4536
+ </xsl:template>
4537
+
4459
4538
  <xsl:variable name="add-style">
4460
- <add-style xsl:use-attribute-sets="add-style"/>
4461
- </xsl:variable>
4539
+ <add-style xsl:use-attribute-sets="add-style">
4540
+ <xsl:call-template name="refine_add-style"/>
4541
+ </add-style>
4542
+ </xsl:variable>
4462
4543
  <xsl:template name="append_add-style">
4463
4544
  <xsl:copy-of select="xalan:nodeset($add-style)/add-style/@*"/>
4464
4545
  </xsl:template>
@@ -4471,24 +4552,77 @@
4471
4552
  <xsl:attribute name="text-decoration">line-through</xsl:attribute>
4472
4553
  </xsl:attribute-set>
4473
4554
 
4555
+ <xsl:template name="refine_del-style">
4556
+ </xsl:template>
4557
+
4558
+ <xsl:attribute-set name="strong-style">
4559
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
4560
+ </xsl:attribute-set>
4561
+
4562
+ <xsl:template name="refine_strong_style">
4563
+ <xsl:if test="ancestor::*['preferred']">
4564
+ <xsl:attribute name="role">SKIP</xsl:attribute>
4565
+ </xsl:if>
4566
+ </xsl:template> <!-- refine_strong_style -->
4567
+
4568
+ <xsl:attribute-set name="em-style">
4569
+ <xsl:attribute name="font-style">italic</xsl:attribute>
4570
+ </xsl:attribute-set>
4571
+
4572
+ <xsl:template name="refine_em_style">
4573
+ </xsl:template> <!-- refine_em_style -->
4574
+
4575
+ <xsl:attribute-set name="sup-style">
4576
+ <xsl:attribute name="font-size">80%</xsl:attribute>
4577
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
4578
+ </xsl:attribute-set>
4579
+
4580
+ <xsl:template name="refine_sup-style">
4581
+ </xsl:template>
4582
+
4583
+ <xsl:attribute-set name="sub-style">
4584
+ <xsl:attribute name="font-size">80%</xsl:attribute>
4585
+ <xsl:attribute name="vertical-align">sub</xsl:attribute>
4586
+ </xsl:attribute-set>
4587
+
4588
+ <xsl:template name="refine_sub-style">
4589
+ </xsl:template>
4590
+
4591
+ <xsl:attribute-set name="underline-style">
4592
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
4593
+ </xsl:attribute-set>
4594
+
4595
+ <xsl:template name="refine_underline-style">
4596
+ </xsl:template>
4597
+
4598
+ <xsl:attribute-set name="hi-style">
4599
+ <xsl:attribute name="background-color">yellow</xsl:attribute>
4600
+ </xsl:attribute-set>
4601
+
4602
+ <xsl:template name="refine_hi-style">
4603
+ </xsl:template>
4604
+
4605
+ <xsl:attribute-set name="strike-style">
4606
+ <xsl:attribute name="text-decoration">line-through</xsl:attribute>
4607
+ </xsl:attribute-set>
4608
+
4609
+ <xsl:template name="refine_strike-style">
4610
+ </xsl:template>
4611
+
4474
4612
  <xsl:template match="mn:br">
4475
4613
  <xsl:value-of select="$linebreak"/>
4476
4614
  </xsl:template>
4477
4615
 
4478
- <xsl:template match="mn:em">
4479
- <fo:inline font-style="italic">
4480
- <xsl:call-template name="refine_italic_style"/>
4616
+ <xsl:template match="mn:em">
4617
+ <fo:inline xsl:use-attribute-sets="em-style">
4618
+ <xsl:call-template name="refine_em_style"/>
4481
4619
  <xsl:apply-templates/>
4482
4620
  </fo:inline>
4483
4621
  </xsl:template>
4484
4622
 
4485
- <xsl:template name="refine_italic_style">
4486
- </xsl:template>
4487
-
4488
4623
  <xsl:template match="mn:strong | *[local-name()='b']">
4489
4624
  <xsl:param name="split_keep-within-line"/>
4490
- <fo:inline font-weight="bold">
4491
-
4625
+ <fo:inline xsl:use-attribute-sets="strong-style">
4492
4626
  <xsl:call-template name="refine_strong_style"/>
4493
4627
 
4494
4628
  <xsl:apply-templates>
@@ -4497,44 +4631,27 @@
4497
4631
  </fo:inline>
4498
4632
  </xsl:template>
4499
4633
 
4500
- <xsl:template name="refine_strong_style">
4501
- <xsl:if test="ancestor::*['preferred']">
4502
- <xsl:attribute name="role">SKIP</xsl:attribute>
4503
- </xsl:if>
4504
- </xsl:template>
4505
-
4506
4634
  <xsl:template match="*[local-name()='padding']">
4507
4635
  <fo:inline padding-right="{@value}"> </fo:inline>
4508
4636
  </xsl:template>
4509
4637
 
4510
4638
  <xsl:template match="mn:sup">
4511
- <fo:inline font-size="80%" vertical-align="super">
4639
+ <fo:inline xsl:use-attribute-sets="sup-style">
4640
+ <xsl:call-template name="refine_sup-style"/>
4512
4641
  <xsl:apply-templates/>
4513
4642
  </fo:inline>
4514
4643
  </xsl:template>
4515
4644
 
4516
4645
  <xsl:template match="mn:sub">
4517
- <fo:inline font-size="80%" vertical-align="sub">
4646
+ <fo:inline xsl:use-attribute-sets="sub-style">
4647
+ <xsl:call-template name="refine_sub-style"/>
4518
4648
  <xsl:apply-templates/>
4519
4649
  </fo:inline>
4520
4650
  </xsl:template>
4521
4651
 
4522
4652
  <xsl:template match="mn:tt">
4523
4653
  <fo:inline xsl:use-attribute-sets="tt-style">
4524
-
4525
- <xsl:variable name="_font-size"> <!-- inherit -->
4526
- </xsl:variable>
4527
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
4528
- <xsl:if test="$font-size != ''">
4529
- <xsl:attribute name="font-size">
4530
- <xsl:choose>
4531
- <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
4532
- <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
4533
- <xsl:when test="ancestor::mn:note or ancestor::mn:example"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
4534
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
4535
- </xsl:choose>
4536
- </xsl:attribute>
4537
- </xsl:if>
4654
+ <xsl:call-template name="refine_tt-style"/>
4538
4655
  <xsl:apply-templates/>
4539
4656
  </fo:inline>
4540
4657
  </xsl:template> <!-- tt -->
@@ -4553,7 +4670,8 @@
4553
4670
  </xsl:template>
4554
4671
 
4555
4672
  <xsl:template match="mn:underline">
4556
- <fo:inline text-decoration="underline">
4673
+ <fo:inline xsl:use-attribute-sets="underline-style">
4674
+ <xsl:call-template name="refine_underline-style"/>
4557
4675
  <xsl:apply-templates/>
4558
4676
  </fo:inline>
4559
4677
  </xsl:template>
@@ -4711,6 +4829,7 @@
4711
4829
 
4712
4830
  <xsl:template match="mn:del">
4713
4831
  <fo:inline xsl:use-attribute-sets="del-style">
4832
+ <xsl:call-template name="refine_del-style"/>
4714
4833
  <xsl:apply-templates/>
4715
4834
  </fo:inline>
4716
4835
  </xsl:template>
@@ -4720,7 +4839,8 @@
4720
4839
 
4721
4840
  <!-- highlight text -->
4722
4841
  <xsl:template match="mn:hi | mn:span[@class = 'fmt-hi']" priority="3">
4723
- <fo:inline background-color="yellow">
4842
+ <fo:inline xsl:use-attribute-sets="hi-style">
4843
+ <xsl:call-template name="refine_hi-style"/>
4724
4844
  <xsl:apply-templates/>
4725
4845
  </fo:inline>
4726
4846
  </xsl:template>
@@ -4806,7 +4926,8 @@
4806
4926
  </xsl:template>
4807
4927
 
4808
4928
  <xsl:template match="mn:strike">
4809
- <fo:inline text-decoration="line-through">
4929
+ <fo:inline xsl:use-attribute-sets="strike-style">
4930
+ <xsl:call-template name="refine_strike-style"/>
4810
4931
  <xsl:apply-templates/>
4811
4932
  </fo:inline>
4812
4933
  </xsl:template>
@@ -4834,7 +4955,7 @@
4834
4955
  </xsl:otherwise>
4835
4956
  </xsl:choose>
4836
4957
  </xsl:variable>
4837
- <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color' or $key = 'baseline-shift'">
4958
+ <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color' or $key = 'baseline-shift' or $key = 'line-height' ">
4838
4959
  <style name="{$key}"><xsl:value-of select="$value"/></style>
4839
4960
  </xsl:if>
4840
4961
  <xsl:if test="$key = 'text-indent'">
@@ -4886,6 +5007,7 @@
4886
5007
 
4887
5008
  <xsl:template match="mn:pre" name="pre">
4888
5009
  <fo:block xsl:use-attribute-sets="pre-style">
5010
+ <xsl:call-template name="refine_pre-style"/>
4889
5011
  <xsl:copy-of select="@id"/>
4890
5012
  <xsl:choose>
4891
5013
 
@@ -4916,22 +5038,40 @@
4916
5038
  <xsl:attribute-set name="permission-style">
4917
5039
  </xsl:attribute-set>
4918
5040
 
5041
+ <xsl:template name="refine_permission-style">
5042
+ </xsl:template>
5043
+
4919
5044
  <xsl:attribute-set name="permission-name-style">
4920
5045
  </xsl:attribute-set>
4921
5046
 
5047
+ <xsl:template name="refine_permission-name-style">
5048
+ </xsl:template>
5049
+
4922
5050
  <xsl:attribute-set name="permission-label-style">
4923
5051
  </xsl:attribute-set>
4924
5052
 
5053
+ <xsl:template name="refine_permission-label-style">
5054
+ </xsl:template>
5055
+
4925
5056
  <xsl:attribute-set name="requirement-style">
4926
5057
  </xsl:attribute-set>
4927
5058
 
5059
+ <xsl:template name="refine_requirement-style">
5060
+ </xsl:template>
5061
+
4928
5062
  <xsl:attribute-set name="requirement-name-style">
4929
5063
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4930
5064
  </xsl:attribute-set>
4931
5065
 
5066
+ <xsl:template name="refine_requirement-name-style">
5067
+ </xsl:template>
5068
+
4932
5069
  <xsl:attribute-set name="requirement-label-style">
4933
5070
  </xsl:attribute-set>
4934
5071
 
5072
+ <xsl:template name="refine_requirement-label-style">
5073
+ </xsl:template>
5074
+
4935
5075
  <xsl:attribute-set name="subject-style">
4936
5076
  </xsl:attribute-set>
4937
5077
 
@@ -4959,18 +5099,28 @@
4959
5099
  <xsl:attribute-set name="recommendation-style">
4960
5100
  </xsl:attribute-set>
4961
5101
 
5102
+ <xsl:template name="refine_recommendation-style">
5103
+ </xsl:template>
5104
+
4962
5105
  <xsl:attribute-set name="recommendation-name-style">
4963
5106
  </xsl:attribute-set>
4964
5107
 
5108
+ <xsl:template name="refine_recommendation-name-style">
5109
+ </xsl:template>
5110
+
4965
5111
  <xsl:attribute-set name="recommendation-label-style">
4966
5112
  </xsl:attribute-set>
4967
5113
 
5114
+ <xsl:template name="refine_recommendation-label-style">
5115
+ </xsl:template>
5116
+
4968
5117
  <!-- ========== -->
4969
5118
  <!-- permission -->
4970
5119
  <!-- ========== -->
4971
5120
  <xsl:template match="mn:permission">
4972
5121
  <xsl:call-template name="setNamedDestination"/>
4973
5122
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
5123
+ <xsl:call-template name="refine_permission-style"/>
4974
5124
  <xsl:apply-templates select="mn:fmt-name"/>
4975
5125
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
4976
5126
  </fo:block>
@@ -4979,6 +5129,7 @@
4979
5129
  <xsl:template match="mn:permission/mn:fmt-name">
4980
5130
  <xsl:if test="normalize-space() != ''">
4981
5131
  <fo:block xsl:use-attribute-sets="permission-name-style">
5132
+ <xsl:call-template name="refine_permission-name-style"/>
4982
5133
  <xsl:apply-templates/>
4983
5134
  </fo:block>
4984
5135
  </xsl:if>
@@ -4986,6 +5137,7 @@
4986
5137
 
4987
5138
  <xsl:template match="mn:permission/mn:label">
4988
5139
  <fo:block xsl:use-attribute-sets="permission-label-style">
5140
+ <xsl:call-template name="refine_permission-label-style"/>
4989
5141
  <xsl:apply-templates/>
4990
5142
  </fo:block>
4991
5143
  </xsl:template>
@@ -4998,6 +5150,7 @@
4998
5150
  <xsl:template match="mn:requirement">
4999
5151
  <xsl:call-template name="setNamedDestination"/>
5000
5152
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
5153
+ <xsl:call-template name="refine_requirement-style"/>
5001
5154
  <xsl:apply-templates select="mn:fmt-name"/>
5002
5155
  <xsl:apply-templates select="mn:label"/>
5003
5156
  <xsl:apply-templates select="@obligation"/>
@@ -5010,6 +5163,7 @@
5010
5163
  <xsl:if test="normalize-space() != ''">
5011
5164
 
5012
5165
  <fo:block xsl:use-attribute-sets="requirement-name-style">
5166
+ <xsl:call-template name="refine_requirement-name-style"/>
5013
5167
  <xsl:apply-templates/>
5014
5168
  </fo:block>
5015
5169
  </xsl:if>
@@ -5017,6 +5171,7 @@
5017
5171
 
5018
5172
  <xsl:template match="mn:requirement/mn:label">
5019
5173
  <fo:block xsl:use-attribute-sets="requirement-label-style">
5174
+ <xsl:call-template name="refine_requirement-label-style"/>
5020
5175
  <xsl:apply-templates/>
5021
5176
  </fo:block>
5022
5177
  </xsl:template>
@@ -5042,6 +5197,7 @@
5042
5197
  <xsl:template match="mn:recommendation">
5043
5198
  <xsl:call-template name="setNamedDestination"/>
5044
5199
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
5200
+ <xsl:call-template name="refine_recommendation-style"/>
5045
5201
  <xsl:apply-templates select="mn:fmt-name"/>
5046
5202
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
5047
5203
  </fo:block>
@@ -5051,6 +5207,7 @@
5051
5207
  <xsl:if test="normalize-space() != ''">
5052
5208
 
5053
5209
  <fo:block xsl:use-attribute-sets="recommendation-name-style">
5210
+ <xsl:call-template name="refine_recommendation-name-style"/>
5054
5211
  <xsl:apply-templates/>
5055
5212
  </fo:block>
5056
5213
  </xsl:if>
@@ -5058,6 +5215,7 @@
5058
5215
 
5059
5216
  <xsl:template match="mn:recommendation/mn:label">
5060
5217
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
5218
+ <xsl:call-template name="refine_recommendation-label-style"/>
5061
5219
  <xsl:apply-templates/>
5062
5220
  </fo:block>
5063
5221
  </xsl:template>
@@ -5239,6 +5397,9 @@
5239
5397
  <xsl:attribute name="space-after">12pt</xsl:attribute>
5240
5398
  </xsl:attribute-set> <!-- term-style -->
5241
5399
 
5400
+ <xsl:template name="refine_term-style">
5401
+ </xsl:template>
5402
+
5242
5403
  <xsl:attribute-set name="term-name-style">
5243
5404
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
5244
5405
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -5246,32 +5407,59 @@
5246
5407
  <xsl:attribute name="space-after">2pt</xsl:attribute>
5247
5408
  </xsl:attribute-set> <!-- term-name-style -->
5248
5409
 
5249
- <xsl:attribute-set name="preferred-block-style">
5410
+ <xsl:template name="refine_term-name-style">
5411
+ </xsl:template>
5412
+
5413
+ <xsl:attribute-set name="preferred-block-style">
5250
5414
  </xsl:attribute-set> <!-- preferred-block-style -->
5251
5415
 
5416
+ <xsl:template name="refine_preferred-block-style">
5417
+ </xsl:template>
5418
+
5252
5419
  <xsl:attribute-set name="preferred-term-style">
5253
5420
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
5254
5421
  <xsl:attribute name="font-weight">bold</xsl:attribute>
5255
5422
  <xsl:attribute name="font-weight">normal</xsl:attribute>
5256
5423
  </xsl:attribute-set> <!-- preferred-term-style -->
5257
5424
 
5425
+ <xsl:template name="refine_preferred-term-style">
5426
+ <xsl:if test="mn:strong">
5427
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
5428
+ </xsl:if>
5429
+ </xsl:template>
5430
+
5258
5431
  <xsl:attribute-set name="domain-style">
5259
5432
  </xsl:attribute-set> <!-- domain-style -->
5260
5433
 
5434
+ <xsl:template name="refine_domain-style">
5435
+ </xsl:template>
5436
+
5261
5437
  <xsl:attribute-set name="admitted-style">
5262
5438
  </xsl:attribute-set> <!-- admitted-style -->
5263
5439
 
5440
+ <xsl:template name="refine_admitted-style">
5441
+ </xsl:template>
5442
+
5264
5443
  <xsl:attribute-set name="deprecates-style">
5265
5444
  </xsl:attribute-set> <!-- deprecates-style -->
5266
5445
 
5446
+ <xsl:template name="refine_deprecates-style">
5447
+ </xsl:template>
5448
+
5267
5449
  <xsl:attribute-set name="related-block-style" use-attribute-sets="preferred-block-style">
5268
5450
  </xsl:attribute-set>
5269
5451
 
5452
+ <xsl:template name="refine_related-block-style">
5453
+ </xsl:template>
5454
+
5270
5455
  <xsl:attribute-set name="definition-style">
5271
5456
  <xsl:attribute name="space-before">2pt</xsl:attribute>
5272
5457
  <xsl:attribute name="space-after">2pt</xsl:attribute>
5273
5458
  </xsl:attribute-set> <!-- definition-style -->
5274
5459
 
5460
+ <xsl:template name="refine_definition-style">
5461
+ </xsl:template>
5462
+
5275
5463
  <xsl:attribute-set name="termsource-style">
5276
5464
  </xsl:attribute-set> <!-- termsource-style -->
5277
5465
 
@@ -5284,9 +5472,15 @@
5284
5472
  <xsl:attribute-set name="termsource-text-style">
5285
5473
  </xsl:attribute-set> <!-- termsource-text-style -->
5286
5474
 
5475
+ <xsl:template name="refine_termsource-text-style">
5476
+ </xsl:template>
5477
+
5287
5478
  <xsl:attribute-set name="origin-style">
5288
5479
  </xsl:attribute-set> <!-- origin-style -->
5289
5480
 
5481
+ <xsl:template name="refine_origin-style">
5482
+ </xsl:template>
5483
+
5290
5484
  <!-- ====== -->
5291
5485
  <!-- term -->
5292
5486
  <!-- ====== -->
@@ -5302,9 +5496,8 @@
5302
5496
  <xsl:template match="mn:term">
5303
5497
  <xsl:call-template name="setNamedDestination"/>
5304
5498
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
5499
+ <xsl:call-template name="refine_term-style"/>
5305
5500
 
5306
- <xsl:if test="parent::mn:term and not(preceding-sibling::mn:term)">
5307
- </xsl:if>
5308
5501
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
5309
5502
  </fo:block>
5310
5503
  </xsl:template>
@@ -5380,6 +5573,7 @@
5380
5573
  <!-- text SOURCE: -->
5381
5574
  <xsl:template match="mn:fmt-termsource/mn:strong[1][following-sibling::*[1][self::mn:fmt-origin]]/text()">
5382
5575
  <fo:inline xsl:use-attribute-sets="termsource-text-style">
5576
+ <xsl:call-template name="refine_termsource-text-style"/>
5383
5577
  <xsl:value-of select="."/>
5384
5578
  </fo:inline>
5385
5579
  </xsl:template>
@@ -5392,6 +5586,7 @@
5392
5586
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
5393
5587
  </xsl:if>
5394
5588
  <fo:inline xsl:use-attribute-sets="origin-style">
5589
+ <xsl:call-template name="refine_origin-style"/>
5395
5590
  <xsl:apply-templates/>
5396
5591
  </fo:inline>
5397
5592
  </fo:basic-link>
@@ -5441,9 +5636,12 @@
5441
5636
  </xsl:variable>
5442
5637
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
5443
5638
 
5639
+ <xsl:call-template name="refine_preferred-block-style"/>
5640
+
5444
5641
  <xsl:if test="parent::mn:term and not(preceding-sibling::mn:fmt-preferred)"> <!-- if first preffered in term, then display term's name -->
5445
5642
 
5446
5643
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
5644
+ <xsl:call-template name="refine_term-name-style"/>
5447
5645
 
5448
5646
  <xsl:for-each select="ancestor::mn:term[1]/mn:fmt-name"><!-- change context -->
5449
5647
  <xsl:call-template name="setIDforNamedDestination"/>
@@ -5454,7 +5652,7 @@
5454
5652
  </xsl:if>
5455
5653
 
5456
5654
  <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
5457
- <xsl:call-template name="setStyle_preferred"/>
5655
+ <xsl:call-template name="refine_preferred-term-style"/>
5458
5656
 
5459
5657
  <xsl:apply-templates/>
5460
5658
  </fo:block>
@@ -5475,22 +5673,18 @@
5475
5673
 
5476
5674
  <xsl:template match="mn:fmt-admitted">
5477
5675
  <fo:block xsl:use-attribute-sets="admitted-style">
5676
+ <xsl:call-template name="refine_admitted-style"/>
5478
5677
  <xsl:apply-templates/>
5479
5678
  </fo:block>
5480
5679
  </xsl:template>
5481
5680
 
5482
5681
  <xsl:template match="mn:fmt-deprecates">
5483
5682
  <fo:block xsl:use-attribute-sets="deprecates-style">
5683
+ <xsl:call-template name="refine_deprecates-style"/>
5484
5684
  <xsl:apply-templates/>
5485
5685
  </fo:block>
5486
5686
  </xsl:template>
5487
5687
 
5488
- <xsl:template name="setStyle_preferred">
5489
- <xsl:if test="mn:strong">
5490
- <xsl:attribute name="font-weight">normal</xsl:attribute>
5491
- </xsl:if>
5492
- </xsl:template>
5493
-
5494
5688
  <!-- regarding ISO 10241-1:2011, If there is more than one preferred term, each preferred term follows the previous one on a new line. -->
5495
5689
  <!-- in metanorma xml preferred terms delimited by semicolons -->
5496
5690
  <xsl:template match="mn:fmt-preferred/text()[contains(., ';')] | mn:fmt-preferred/mn:strong/text()[contains(., ';')]">
@@ -5500,6 +5694,7 @@
5500
5694
 
5501
5695
  <xsl:template match="mn:fmt-related">
5502
5696
  <fo:block role="SKIP" xsl:use-attribute-sets="related-block-style">
5697
+ <xsl:call-template name="refine_related-block-style"/>
5503
5698
  <xsl:apply-templates/>
5504
5699
  </fo:block>
5505
5700
  </xsl:template>
@@ -5514,6 +5709,7 @@
5514
5709
  <!-- ========== -->
5515
5710
  <xsl:template match="mn:fmt-definition">
5516
5711
  <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
5712
+ <xsl:call-template name="refine_definition-style"/>
5517
5713
  <xsl:apply-templates/>
5518
5714
  </fo:block>
5519
5715
  </xsl:template>
@@ -5561,6 +5757,9 @@
5561
5757
  <xsl:attribute-set name="example-body-style">
5562
5758
  </xsl:attribute-set> <!-- example-body-style -->
5563
5759
 
5760
+ <xsl:template name="refine_example-body-style">
5761
+ </xsl:template>
5762
+
5564
5763
  <xsl:attribute-set name="example-name-style">
5565
5764
  </xsl:attribute-set> <!-- example-name-style -->
5566
5765
 
@@ -5609,6 +5808,8 @@
5609
5808
  <xsl:when test="contains($element, 'block')">
5610
5809
  <fo:block xsl:use-attribute-sets="example-p-style">
5611
5810
 
5811
+ <xsl:call-template name="refine_example-p-style"/>
5812
+
5612
5813
  <xsl:apply-templates/>
5613
5814
  </fo:block>
5614
5815
  </xsl:when>
@@ -5660,6 +5861,7 @@
5660
5861
  </fo:block>
5661
5862
 
5662
5863
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
5864
+ <xsl:call-template name="refine_example-body-style"/>
5663
5865
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
5664
5866
  <xsl:variable name="example_body">
5665
5867
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]">
@@ -5722,6 +5924,7 @@
5722
5924
  <xsl:if test="*[not(self::mn:fmt-name)][position() &gt; 1]">
5723
5925
  <!-- display further elements in blocks -->
5724
5926
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
5927
+ <xsl:call-template name="refine_example-body-style"/>
5725
5928
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
5726
5929
  <xsl:apply-templates select="*[not(self::mn:fmt-name)][position() &gt; 1]">
5727
5930
  <xsl:with-param name="fo_element" select="'block'"/>
@@ -5973,6 +6176,9 @@
5973
6176
  <xsl:attribute name="font-weight">bold</xsl:attribute>
5974
6177
  </xsl:attribute-set> <!-- table-fn-number-style -->
5975
6178
 
6179
+ <xsl:template name="refine_table-fn-number-style">
6180
+ </xsl:template>
6181
+
5976
6182
  <xsl:attribute-set name="table-fmt-fn-label-style">
5977
6183
  <xsl:attribute name="font-size">80%</xsl:attribute>
5978
6184
  <xsl:attribute name="font-size">60%</xsl:attribute>
@@ -5982,32 +6188,12 @@
5982
6188
  <xsl:template name="refine_table-fmt-fn-label-style">
5983
6189
  </xsl:template>
5984
6190
 
5985
- <xsl:attribute-set name="fn-container-body-style">
5986
- <xsl:attribute name="text-indent">0</xsl:attribute>
5987
- <xsl:attribute name="start-indent">0</xsl:attribute>
5988
- </xsl:attribute-set>
5989
-
5990
6191
  <xsl:attribute-set name="table-fn-body-style">
5991
6192
  </xsl:attribute-set>
5992
6193
 
5993
- <xsl:attribute-set name="figure-fn-number-style">
5994
- <xsl:attribute name="padding-right">5mm</xsl:attribute>
5995
- </xsl:attribute-set> <!-- figure-fn-number-style -->
5996
-
5997
- <xsl:attribute-set name="figure-fmt-fn-label-style">
5998
- <xsl:attribute name="font-size">80%</xsl:attribute>
5999
- <xsl:attribute name="vertical-align">super</xsl:attribute>
6000
- <xsl:attribute name="font-size">60%</xsl:attribute>
6001
- <xsl:attribute name="vertical-align">super</xsl:attribute>
6002
- </xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
6003
-
6004
- <xsl:template name="refine_figure-fmt-fn-label-style">
6194
+ <xsl:template name="refine_table-fn-body-style">
6005
6195
  </xsl:template>
6006
6196
 
6007
- <xsl:attribute-set name="figure-fn-body-style">
6008
- <xsl:attribute name="text-align">justify</xsl:attribute>
6009
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
6010
- </xsl:attribute-set>
6011
6197
  <!-- ========================== -->
6012
6198
  <!-- END Table styles -->
6013
6199
  <!-- ========================== -->
@@ -7283,6 +7469,7 @@
7283
7469
  </xsl:apply-templates>
7284
7470
 
7285
7471
  <fo:inline xsl:use-attribute-sets="table-fn-body-style">
7472
+ <xsl:call-template name="refine_table-fn-body-style"/>
7286
7473
  <!-- <xsl:copy-of select="./node()"/> -->
7287
7474
  <xsl:apply-templates/>
7288
7475
  </fo:inline>
@@ -7301,6 +7488,7 @@
7301
7488
  <xsl:param name="process">false</xsl:param>
7302
7489
  <xsl:if test="$process = 'true'">
7303
7490
  <fo:inline xsl:use-attribute-sets="table-fn-number-style" role="SKIP">
7491
+ <xsl:call-template name="refine_table-fn-number-style"/>
7304
7492
 
7305
7493
  <!-- tab is padding-right -->
7306
7494
  <xsl:apply-templates select=".//mn:tab">
@@ -8174,9 +8362,18 @@
8174
8362
  <xsl:attribute name="margin-bottom">16pt</xsl:attribute>
8175
8363
  </xsl:attribute-set>
8176
8364
 
8365
+ <xsl:template name="refine_dl-block-style">
8366
+ <xsl:if test="@key = 'true' and ancestor::mn:figure">
8367
+ <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
8368
+ </xsl:if>
8369
+ </xsl:template>
8370
+
8177
8371
  <xsl:attribute-set name="dt-row-style">
8178
8372
  </xsl:attribute-set>
8179
8373
 
8374
+ <xsl:template name="refine_dt-row-style">
8375
+ </xsl:template>
8376
+
8180
8377
  <xsl:attribute-set name="dt-cell-style">
8181
8378
  </xsl:attribute-set>
8182
8379
 
@@ -8195,6 +8392,14 @@
8195
8392
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
8196
8393
  </xsl:attribute-set> <!-- dl-name-style -->
8197
8394
 
8395
+ <xsl:template name="refine_dl-name-style">
8396
+ <xsl:if test="ancestor::mn:tfoot and ../@key = 'true'">
8397
+ <xsl:attribute name="margin-left">-<xsl:value-of select="$tableAnnotationIndent"/></xsl:attribute>
8398
+ <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
8399
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
8400
+ </xsl:if>
8401
+ </xsl:template>
8402
+
8198
8403
  <xsl:attribute-set name="dd-cell-style">
8199
8404
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
8200
8405
  </xsl:attribute-set>
@@ -8233,9 +8438,7 @@
8233
8438
  <!-- <dl><xsl:copy-of select="."/></dl> -->
8234
8439
  <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
8235
8440
 
8236
- <xsl:if test="@key = 'true' and ancestor::mn:figure">
8237
- <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
8238
- </xsl:if>
8441
+ <xsl:call-template name="refine_dl-block-style"/>
8239
8442
 
8240
8443
  <xsl:call-template name="setBlockSpanAll"/>
8241
8444
  <xsl:if test="not(ancestor::mn:quote)">
@@ -8563,11 +8766,8 @@
8563
8766
  <xsl:param name="process">false</xsl:param>
8564
8767
  <xsl:if test="$process = 'true'">
8565
8768
  <fo:block xsl:use-attribute-sets="dl-name-style">
8566
- <xsl:if test="ancestor::mn:tfoot and ../@key = 'true'">
8567
- <xsl:attribute name="margin-left">-<xsl:value-of select="$tableAnnotationIndent"/></xsl:attribute>
8568
- <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
8569
- <xsl:attribute name="font-weight">bold</xsl:attribute>
8570
- </xsl:if>
8769
+
8770
+ <xsl:call-template name="refine_dl-name-style"/>
8571
8771
 
8572
8772
  <xsl:apply-templates/>
8573
8773
  </fo:block>
@@ -8757,6 +8957,8 @@
8757
8957
  <xsl:param name="split_keep-within-line"/>
8758
8958
 
8759
8959
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
8960
+ <xsl:call-template name="refine_dt-row-style"/>
8961
+
8760
8962
  <xsl:call-template name="insert_dt_cell">
8761
8963
  <xsl:with-param name="key_iso" select="$key_iso"/>
8762
8964
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -8966,15 +9168,22 @@
8966
9168
  <xsl:attribute-set name="appendix-style">
8967
9169
  </xsl:attribute-set>
8968
9170
 
9171
+ <xsl:template name="refine_appendix-style">
9172
+ </xsl:template>
9173
+
8969
9174
  <xsl:attribute-set name="appendix-example-style">
8970
9175
  </xsl:attribute-set>
8971
9176
 
9177
+ <xsl:template name="refine_appendix-example-style">
9178
+ </xsl:template>
9179
+
8972
9180
  <!-- ======================== -->
8973
9181
  <!-- Appendix processing -->
8974
9182
  <!-- ======================== -->
8975
9183
  <xsl:template match="mn:appendix">
8976
9184
  <xsl:call-template name="setNamedDestination"/>
8977
9185
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
9186
+ <xsl:call-template name="refine_appendix-style"/>
8978
9187
  <xsl:apply-templates select="mn:fmt-title"/>
8979
9188
  </fo:block>
8980
9189
  <xsl:apply-templates select="node()[not(self::mn:fmt-title)]"/>
@@ -8993,13 +9202,23 @@
8993
9202
  <xsl:template match="mn:appendix//mn:example" priority="2">
8994
9203
  <xsl:call-template name="setNamedDestination"/>
8995
9204
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
9205
+ <xsl:call-template name="refine_appendix-example-style"/>
8996
9206
  <xsl:apply-templates select="mn:fmt-name"/>
8997
9207
  </fo:block>
8998
9208
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
8999
9209
  </xsl:template>
9000
9210
 
9001
9211
  <xsl:attribute-set name="xref-style">
9002
- </xsl:attribute-set>
9212
+ </xsl:attribute-set> <!-- xref-style -->
9213
+
9214
+ <xsl:template name="refine_xref-style">
9215
+ <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])">
9216
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
9217
+ </xsl:if>
9218
+ <xsl:if test="parent::mn:add">
9219
+ <xsl:call-template name="append_add-style"/>
9220
+ </xsl:if>
9221
+ </xsl:template> <!-- refine_xref-style -->
9003
9222
 
9004
9223
  <xsl:template match="mn:fmt-xref">
9005
9224
  <xsl:call-template name="insert_basic_link">
@@ -9008,12 +9227,8 @@
9008
9227
  <xsl:call-template name="getAltText"/>
9009
9228
  </xsl:variable>
9010
9229
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
9011
- <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])">
9012
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
9013
- </xsl:if>
9014
- <xsl:if test="parent::mn:add">
9015
- <xsl:call-template name="append_add-style"/>
9016
- </xsl:if>
9230
+ <xsl:call-template name="refine_xref-style"/>
9231
+
9017
9232
  <xsl:apply-templates/>
9018
9233
  </fo:basic-link>
9019
9234
  </xsl:with-param>
@@ -9122,16 +9337,16 @@
9122
9337
  <xsl:attribute-set name="note-style">
9123
9338
  <xsl:attribute name="text-indent">0mm</xsl:attribute>
9124
9339
  <xsl:attribute name="space-before">2pt</xsl:attribute>
9125
- </xsl:attribute-set>
9340
+ </xsl:attribute-set> <!-- note-style -->
9126
9341
 
9127
9342
  <xsl:template name="refine_note-style">
9128
- </xsl:template>
9343
+ </xsl:template> <!-- refine_note-style -->
9129
9344
 
9130
9345
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
9131
9346
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
9132
9347
 
9133
9348
  <xsl:attribute-set name="note-name-style">
9134
- </xsl:attribute-set>
9349
+ </xsl:attribute-set> <!-- note-name-style -->
9135
9350
 
9136
9351
  <xsl:template name="refine_note-name-style">
9137
9352
  <xsl:if test="ancestor::mn:figure">
@@ -9148,19 +9363,22 @@
9148
9363
  </xsl:template> <!-- refine_table-note-name-style -->
9149
9364
 
9150
9365
  <xsl:attribute-set name="note-p-style">
9151
- </xsl:attribute-set>
9366
+ </xsl:attribute-set> <!-- note-p-style -->
9367
+
9368
+ <xsl:template name="refine_note-p-style">
9369
+ </xsl:template>
9152
9370
 
9153
9371
  <xsl:attribute-set name="termnote-style">
9154
9372
  <xsl:attribute name="text-indent">0mm</xsl:attribute>
9155
9373
  <xsl:attribute name="space-before">4pt</xsl:attribute>
9156
9374
  <xsl:attribute name="space-after">4pt</xsl:attribute>
9157
- </xsl:attribute-set>
9375
+ </xsl:attribute-set> <!-- termnote-style -->
9158
9376
 
9159
9377
  <xsl:template name="refine_termnote-style">
9160
9378
  </xsl:template> <!-- refine_termnote-style -->
9161
9379
 
9162
9380
  <xsl:attribute-set name="termnote-name-style">
9163
- </xsl:attribute-set>
9381
+ </xsl:attribute-set> <!-- termnote-name-style -->
9164
9382
 
9165
9383
  <xsl:template name="refine_termnote-name-style">
9166
9384
  </xsl:template>
@@ -9168,6 +9386,9 @@
9168
9386
  <xsl:attribute-set name="termnote-p-style">
9169
9387
  </xsl:attribute-set>
9170
9388
 
9389
+ <xsl:template name="refine_termnote-p-style">
9390
+ </xsl:template>
9391
+
9171
9392
  <!-- ====== -->
9172
9393
  <!-- note -->
9173
9394
  <!-- termnote -->
@@ -9231,11 +9452,13 @@
9231
9452
  <xsl:choose>
9232
9453
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
9233
9454
  <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
9455
+ <xsl:call-template name="refine_note-p-style"/>
9234
9456
  <xsl:apply-templates/>
9235
9457
  </fo:inline>
9236
9458
  </xsl:when>
9237
9459
  <xsl:otherwise>
9238
9460
  <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
9461
+ <xsl:call-template name="refine_note-p-style"/>
9239
9462
  <xsl:apply-templates/>
9240
9463
  </fo:block>
9241
9464
  </xsl:otherwise>
@@ -9327,11 +9550,13 @@
9327
9550
  <xsl:choose>
9328
9551
  <xsl:when test="$num = 1"> <!-- first paragraph renders in the same line as titlenote name -->
9329
9552
  <fo:inline xsl:use-attribute-sets="termnote-p-style">
9553
+ <xsl:call-template name="refine_termnote-p-style"/>
9330
9554
  <xsl:apply-templates/>
9331
9555
  </fo:inline>
9332
9556
  </xsl:when>
9333
9557
  <xsl:otherwise>
9334
9558
  <fo:block xsl:use-attribute-sets="termnote-p-style">
9559
+ <xsl:call-template name="refine_termnote-p-style"/>
9335
9560
  <xsl:apply-templates/>
9336
9561
  </fo:block>
9337
9562
  </xsl:otherwise>
@@ -9346,7 +9571,7 @@
9346
9571
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
9347
9572
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
9348
9573
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
9349
- </xsl:attribute-set>
9574
+ </xsl:attribute-set> <!-- quote-style -->
9350
9575
 
9351
9576
  <xsl:template name="refine_quote-style">
9352
9577
  </xsl:template>
@@ -9355,6 +9580,9 @@
9355
9580
  <xsl:attribute name="text-align">right</xsl:attribute>
9356
9581
  </xsl:attribute-set>
9357
9582
 
9583
+ <xsl:template name="refine_quote-source-style">
9584
+ </xsl:template>
9585
+
9358
9586
  <!-- ====== -->
9359
9587
  <!-- quote -->
9360
9588
  <!-- source -->
@@ -9383,6 +9611,7 @@
9383
9611
  </fo:block-container>
9384
9612
  <xsl:if test="mn:author or mn:fmt-source or mn:attribution">
9385
9613
  <fo:block xsl:use-attribute-sets="quote-source-style">
9614
+ <xsl:call-template name="refine_quote-source-style"/>
9386
9615
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
9387
9616
  <xsl:apply-templates select="mn:author"/>
9388
9617
  <xsl:apply-templates select="mn:fmt-source"/>
@@ -9444,6 +9673,9 @@
9444
9673
  <xsl:attribute-set name="figure-style">
9445
9674
  </xsl:attribute-set>
9446
9675
 
9676
+ <xsl:template name="refine_figure-style">
9677
+ </xsl:template>
9678
+
9447
9679
  <xsl:attribute-set name="figure-name-style">
9448
9680
  <xsl:attribute name="role">Caption</xsl:attribute>
9449
9681
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -9451,7 +9683,7 @@
9451
9683
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
9452
9684
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
9453
9685
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
9454
- </xsl:attribute-set>
9686
+ </xsl:attribute-set> <!-- figure-name-style -->
9455
9687
 
9456
9688
  <xsl:template name="refine_figure-name-style">
9457
9689
  <xsl:if test="$doctype = 'technical-report'">
@@ -9462,7 +9694,7 @@
9462
9694
  <xsl:attribute-set name="image-style">
9463
9695
  <xsl:attribute name="role">SKIP</xsl:attribute>
9464
9696
  <xsl:attribute name="text-align">center</xsl:attribute>
9465
- </xsl:attribute-set>
9697
+ </xsl:attribute-set> <!-- image-style -->
9466
9698
 
9467
9699
  <xsl:template name="refine_image-style">
9468
9700
  </xsl:template>
@@ -9472,14 +9704,55 @@
9472
9704
  <xsl:attribute name="content-height">100%</xsl:attribute>
9473
9705
  <xsl:attribute name="scaling">uniform</xsl:attribute>
9474
9706
  <xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
9475
- </xsl:attribute-set>
9707
+ </xsl:attribute-set> <!-- image-graphic-style -->
9708
+
9709
+ <xsl:template name="refine_image-graphic-style">
9710
+ </xsl:template>
9476
9711
 
9477
9712
  <xsl:attribute-set name="figure-source-style">
9478
9713
  </xsl:attribute-set>
9479
9714
 
9715
+ <xsl:template name="refine_figure-source-style">
9716
+ </xsl:template>
9717
+
9480
9718
  <xsl:attribute-set name="figure-pseudocode-p-style">
9481
9719
  </xsl:attribute-set>
9482
9720
 
9721
+ <xsl:template name="refine_figure-pseudocode-p-style">
9722
+ </xsl:template>
9723
+
9724
+ <xsl:attribute-set name="figure-fn-number-style">
9725
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
9726
+ </xsl:attribute-set> <!-- figure-fn-number-style -->
9727
+
9728
+ <xsl:template name="refine_figure-fn-number-style">
9729
+ </xsl:template>
9730
+
9731
+ <xsl:attribute-set name="figure-fmt-fn-label-style">
9732
+ <xsl:attribute name="font-size">80%</xsl:attribute>
9733
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
9734
+ <xsl:attribute name="font-size">60%</xsl:attribute>
9735
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
9736
+ </xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
9737
+
9738
+ <xsl:template name="refine_figure-fmt-fn-label-style">
9739
+ </xsl:template>
9740
+
9741
+ <xsl:attribute-set name="figure-fn-body-style">
9742
+ <xsl:attribute name="text-align">justify</xsl:attribute>
9743
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
9744
+ </xsl:attribute-set>
9745
+
9746
+ <xsl:template name="refine_figure-fn-body-style">
9747
+ <xsl:variable name="key_iso">
9748
+ </xsl:variable>
9749
+ <xsl:if test="normalize-space($key_iso) = 'true'">
9750
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
9751
+ </xsl:if>
9752
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
9753
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
9754
+ </xsl:template>
9755
+
9483
9756
  <!-- ============================ -->
9484
9757
  <!-- figure's footnotes rendering -->
9485
9758
  <!-- ============================ -->
@@ -9595,11 +9868,8 @@
9595
9868
  </fo:table-cell>
9596
9869
  <fo:table-cell>
9597
9870
  <fo:block xsl:use-attribute-sets="figure-fn-body-style">
9598
- <xsl:if test="normalize-space($key_iso) = 'true'">
9599
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
9600
- </xsl:if>
9601
- <xsl:attribute name="margin-left">5mm</xsl:attribute>
9602
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
9871
+ <xsl:call-template name="refine_figure-fn-body-style"/>
9872
+
9603
9873
  <!-- <xsl:copy-of select="./node()"/> -->
9604
9874
  <xsl:apply-templates/>
9605
9875
  </fo:block>
@@ -9617,6 +9887,7 @@
9617
9887
  <xsl:param name="process">false</xsl:param>
9618
9888
  <xsl:if test="$process = 'true'">
9619
9889
  <fo:inline xsl:use-attribute-sets="figure-fn-number-style" role="SKIP">
9890
+ <xsl:call-template name="refine_figure-fn-number-style"/>
9620
9891
  <xsl:attribute name="padding-right">0mm</xsl:attribute>
9621
9892
 
9622
9893
  <!-- tab is padding-right -->
@@ -9654,6 +9925,7 @@
9654
9925
  <xsl:attribute name="font-size">10pt</xsl:attribute>
9655
9926
  </xsl:if>
9656
9927
  <fo:inline xsl:use-attribute-sets="figure-fn-number-style figure-fmt-fn-label-style"> <!-- id="{@id}" -->
9928
+ <xsl:call-template name="refine_figure-fn-number-style"/>
9657
9929
  <!-- <xsl:value-of select="@reference"/> -->
9658
9930
  <xsl:apply-templates/>
9659
9931
  </fo:inline>
@@ -9699,6 +9971,8 @@
9699
9971
 
9700
9972
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
9701
9973
 
9974
+ <xsl:call-template name="refine_figure-style"/>
9975
+
9702
9976
  <xsl:for-each select="mn:fmt-name"> <!-- set context -->
9703
9977
  <xsl:call-template name="setIDforNamedDestination"/>
9704
9978
  </xsl:for-each>
@@ -9742,6 +10016,7 @@
9742
10016
 
9743
10017
  <xsl:template match="mn:figure[@class = 'pseudocode']//mn:p">
9744
10018
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
10019
+ <xsl:call-template name="refine_figure-pseudocode-p-style"/>
9745
10020
  <xsl:apply-templates/>
9746
10021
  </fo:block>
9747
10022
  </xsl:template>
@@ -9871,6 +10146,8 @@
9871
10146
  </xsl:variable>
9872
10147
  <xsl:copy-of select="xalan:nodeset($image-graphic-style_attributes)/attributes/@*"/>
9873
10148
 
10149
+ <xsl:call-template name="refine_image-graphic-style"/>
10150
+
9874
10151
  <xsl:if test="not(@mimetype = 'image/svg+xml') and not(ancestor::mn:table)">
9875
10152
  <xsl:variable name="scale">
9876
10153
  <xsl:call-template name="getImageScale">
@@ -10570,6 +10847,9 @@
10570
10847
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10571
10848
  </xsl:attribute-set> <!-- formula-style -->
10572
10849
 
10850
+ <xsl:template name="refine_formula-style">
10851
+ </xsl:template>
10852
+
10573
10853
  <xsl:attribute-set name="formula-stem-block-style">
10574
10854
  <xsl:attribute name="text-align">center</xsl:attribute>
10575
10855
  </xsl:attribute-set> <!-- formula-stem-block-style -->
@@ -10638,6 +10918,8 @@
10638
10918
  <xsl:template match="mn:formula[mn:fmt-name]/mn:fmt-stem">
10639
10919
  <fo:block xsl:use-attribute-sets="formula-style">
10640
10920
 
10921
+ <xsl:call-template name="refine_formula-style"/>
10922
+
10641
10923
  <fo:table table-layout="fixed" width="100%">
10642
10924
  <fo:table-column column-width="95%"/>
10643
10925
  <fo:table-column column-width="5%"/>
@@ -11061,6 +11343,9 @@
11061
11343
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
11062
11344
  </xsl:attribute-set> <!-- list-name-style -->
11063
11345
 
11346
+ <xsl:template name="refine_list-name-style">
11347
+ </xsl:template>
11348
+
11064
11349
  <xsl:attribute-set name="list-item-style">
11065
11350
  </xsl:attribute-set>
11066
11351
 
@@ -11366,6 +11651,7 @@
11366
11651
  <xsl:param name="process">false</xsl:param>
11367
11652
  <xsl:if test="$process = 'true'">
11368
11653
  <fo:block xsl:use-attribute-sets="list-name-style">
11654
+ <xsl:call-template name="refine_list-name-style"/>
11369
11655
  <xsl:apply-templates/>
11370
11656
  </fo:block>
11371
11657
  </xsl:if>
@@ -11426,33 +11712,54 @@
11426
11712
  <!-- END Lists processing -->
11427
11713
  <!-- ===================================== -->
11428
11714
 
11715
+ <xsl:attribute-set name="footnote-separator-leader-style">
11716
+ </xsl:attribute-set>
11717
+
11718
+ <xsl:template name="refine_footnote-separator-leader-style">
11719
+ </xsl:template>
11720
+
11721
+ <xsl:attribute-set name="fn-container-body-style">
11722
+ <xsl:attribute name="text-indent">0</xsl:attribute>
11723
+ <xsl:attribute name="start-indent">0</xsl:attribute>
11724
+ </xsl:attribute-set>
11725
+
11726
+ <xsl:template name="refine_fn-container-body-style">
11727
+ </xsl:template>
11728
+
11429
11729
  <xsl:attribute-set name="fn-reference-style">
11430
11730
  <xsl:attribute name="font-size">80%</xsl:attribute>
11431
11731
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
11432
11732
  <xsl:attribute name="font-size">6pt</xsl:attribute>
11433
11733
  <xsl:attribute name="baseline-shift">25%</xsl:attribute>
11434
-
11435
- </xsl:attribute-set>
11734
+ </xsl:attribute-set> <!-- fn-reference-style -->
11436
11735
 
11437
11736
  <xsl:template name="refine_fn-reference-style">
11737
+ <!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
11738
+ <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">,</xsl:if>
11438
11739
  </xsl:template> <!-- refine_fn-reference-style -->
11439
11740
 
11440
11741
  <xsl:attribute-set name="fn-style">
11441
11742
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
11442
11743
  </xsl:attribute-set>
11443
11744
 
11745
+ <xsl:template name="refine_fn-style">
11746
+ </xsl:template>
11747
+
11444
11748
  <xsl:attribute-set name="fn-num-style">
11445
11749
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
11446
11750
  <xsl:attribute name="font-size">6pt</xsl:attribute>
11447
11751
  <xsl:attribute name="baseline-shift">25%</xsl:attribute>
11448
- </xsl:attribute-set>
11752
+ </xsl:attribute-set> <!-- fn-num-style -->
11753
+
11754
+ <xsl:template name="refine_fn-num-style">
11755
+ </xsl:template>
11449
11756
 
11450
11757
  <xsl:attribute-set name="fn-body-style">
11451
11758
  <xsl:attribute name="font-weight">normal</xsl:attribute>
11452
11759
  <xsl:attribute name="font-style">normal</xsl:attribute>
11453
11760
  <xsl:attribute name="text-indent">0</xsl:attribute>
11454
11761
  <xsl:attribute name="start-indent">0</xsl:attribute>
11455
- </xsl:attribute-set>
11762
+ </xsl:attribute-set> <!-- fn-body-style" -->
11456
11763
 
11457
11764
  <xsl:template name="refine_fn-body-style">
11458
11765
  </xsl:template> <!-- refine_fn-body-style -->
@@ -11517,10 +11824,12 @@
11517
11824
  <xsl:choose>
11518
11825
  <xsl:when test="ancestor::mn:bibitem">
11519
11826
  <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
11827
+ <xsl:call-template name="refine_bibitem-note-fn-style"/>
11520
11828
  </fn_styles>
11521
11829
  </xsl:when>
11522
11830
  <xsl:otherwise>
11523
11831
  <fn_styles xsl:use-attribute-sets="fn-num-style">
11832
+ <xsl:call-template name="refine_fn-num-style"/>
11524
11833
  </fn_styles>
11525
11834
  </xsl:otherwise>
11526
11835
  </xsl:choose>
@@ -11530,9 +11839,12 @@
11530
11839
  <xsl:copy-of select="."/>
11531
11840
  </xsl:for-each>
11532
11841
 
11533
- <xsl:if test="following-sibling::node()[normalize-space() != ''][1][self::mn:fn]">
11842
+ <!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
11843
+ <!-- <xsl:if test="following-sibling::node()[normalize-space() != ''][1][self::mn:fn]">
11534
11844
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
11535
- </xsl:if>
11845
+ </xsl:if> -->
11846
+
11847
+ <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">,</xsl:if>
11536
11848
 
11537
11849
  <xsl:call-template name="insert_basic_link">
11538
11850
  <xsl:with-param name="element">
@@ -11555,10 +11867,12 @@
11555
11867
  <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
11556
11868
 
11557
11869
  <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
11870
+ <xsl:call-template name="refine_fn-style"/>
11558
11871
  <xsl:copy-of select="$footnote_inline"/>
11559
11872
  <fo:footnote-body role="Note">
11560
11873
 
11561
11874
  <fo:block-container xsl:use-attribute-sets="fn-container-body-style" role="SKIP">
11875
+ <xsl:call-template name="refine_fn-container-body-style"/>
11562
11876
 
11563
11877
  <xsl:variable name="fn_block">
11564
11878
  <xsl:call-template name="refine_fn-body-style"/>
@@ -11655,17 +11969,30 @@
11655
11969
  <xsl:attribute-set name="admonition-style">
11656
11970
  </xsl:attribute-set> <!-- admonition-style -->
11657
11971
 
11972
+ <xsl:template name="refine_admonition-style">
11973
+ </xsl:template>
11974
+
11658
11975
  <xsl:attribute-set name="admonition-container-style">
11659
11976
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
11660
11977
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
11661
11978
  </xsl:attribute-set> <!-- admonition-container-style -->
11662
11979
 
11980
+ <xsl:template name="refine_admonition-container-style">
11981
+ </xsl:template>
11982
+
11663
11983
  <xsl:attribute-set name="admonition-name-style">
11664
11984
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
11665
11985
  </xsl:attribute-set> <!-- admonition-name-style -->
11666
11986
 
11987
+ <xsl:template name="refine_admonition-name-style">
11988
+ </xsl:template>
11989
+
11667
11990
  <xsl:attribute-set name="admonition-p-style">
11668
11991
  </xsl:attribute-set> <!-- admonition-p-style -->
11992
+
11993
+ <xsl:template name="refine_admonition-p-style">
11994
+ </xsl:template>
11995
+
11669
11996
  <!-- end admonition -->
11670
11997
 
11671
11998
  <!-- ================ -->
@@ -11675,8 +12002,12 @@
11675
12002
  <xsl:call-template name="setNamedDestination"/>
11676
12003
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
11677
12004
 
12005
+ <xsl:call-template name="refine_admonition-style"/>
12006
+
11678
12007
  <xsl:call-template name="setBlockSpanAll"/>
11679
12008
  <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
12009
+
12010
+ <xsl:call-template name="refine_admonition-container-style"/>
11680
12011
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
11681
12012
  <fo:block>
11682
12013
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
@@ -11732,6 +12063,7 @@
11732
12063
 
11733
12064
  <xsl:template match="mn:admonition/mn:p">
11734
12065
  <fo:block xsl:use-attribute-sets="admonition-p-style">
12066
+ <xsl:call-template name="refine_admonition-p-style"/>
11735
12067
 
11736
12068
  <xsl:apply-templates/>
11737
12069
  </fo:block>
@@ -11741,6 +12073,13 @@
11741
12073
  <!-- END Admonition -->
11742
12074
  <!-- ================ -->
11743
12075
 
12076
+ <xsl:attribute-set name="references-non-normative-title-style">
12077
+ </xsl:attribute-set>
12078
+
12079
+ <xsl:template name="refine_references-non-normative-title-style">
12080
+
12081
+ </xsl:template>
12082
+
11744
12083
  <!-- bibitem in Normative References (references/@normative="true") -->
11745
12084
  <xsl:attribute-set name="bibitem-normative-style">
11746
12085
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -11748,15 +12087,24 @@
11748
12087
  <xsl:attribute name="text-indent">-6mm</xsl:attribute>
11749
12088
  </xsl:attribute-set> <!-- bibitem-normative-style -->
11750
12089
 
12090
+ <xsl:template name="refine_bibitem-normative-style">
12091
+ </xsl:template>
12092
+
11751
12093
  <!-- bibitem in Normative References (references/@normative="true"), renders as list -->
11752
12094
  <xsl:attribute-set name="bibitem-normative-list-style">
11753
12095
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
11754
12096
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
11755
12097
  </xsl:attribute-set> <!-- bibitem-normative-list-style -->
11756
12098
 
12099
+ <xsl:template name="refine_bibitem-normative-list-style">
12100
+ </xsl:template>
12101
+
11757
12102
  <xsl:attribute-set name="bibitem-non-normative-style">
11758
12103
  </xsl:attribute-set> <!-- bibitem-non-normative-style -->
11759
12104
 
12105
+ <xsl:template name="refine_bibitem-non-normative-style">
12106
+ </xsl:template>
12107
+
11760
12108
  <!-- bibitem in bibliography section (references/@normative="false"), renders as list -->
11761
12109
  <xsl:attribute-set name="bibitem-non-normative-list-style">
11762
12110
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
@@ -11766,17 +12114,29 @@
11766
12114
  <xsl:attribute name="line-height">1.5</xsl:attribute>
11767
12115
  </xsl:attribute-set> <!-- bibitem-non-normative-list-style -->
11768
12116
 
12117
+ <xsl:template name="refine_bibitem-non-normative-list-style">
12118
+ </xsl:template>
12119
+
11769
12120
  <xsl:attribute-set name="bibitem-non-normative-list-item-style">
11770
12121
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
11771
12122
  </xsl:attribute-set>
11772
12123
 
12124
+ <xsl:template name="refine_bibitem-non-normative-list-item-style">
12125
+ </xsl:template>
12126
+
11773
12127
  <!-- bibitem in bibliography section (references/@normative="false"), list body -->
11774
12128
  <xsl:attribute-set name="bibitem-normative-list-body-style">
11775
12129
  </xsl:attribute-set>
11776
12130
 
12131
+ <xsl:template name="refine_bibitem-normative-list-body-style">
12132
+ </xsl:template>
12133
+
11777
12134
  <xsl:attribute-set name="bibitem-non-normative-list-body-style">
11778
12135
  </xsl:attribute-set> <!-- bibitem-non-normative-list-body-style -->
11779
12136
 
12137
+ <xsl:template name="refine_bibitem-non-normative-list-body-style">
12138
+ </xsl:template>
12139
+
11780
12140
  <!-- footnote reference number for bibitem, in the text -->
11781
12141
  <xsl:attribute-set name="bibitem-note-fn-style">
11782
12142
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
@@ -11785,6 +12145,9 @@
11785
12145
  <xsl:attribute name="baseline-shift">25%</xsl:attribute>
11786
12146
  </xsl:attribute-set> <!-- bibitem-note-fn-style -->
11787
12147
 
12148
+ <xsl:template name="refine_bibitem-note-fn-style">
12149
+ </xsl:template>
12150
+
11788
12151
  <!-- footnote number on the page bottom -->
11789
12152
  <xsl:attribute-set name="bibitem-note-fn-number-style">
11790
12153
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
@@ -11800,6 +12163,9 @@
11800
12163
  <xsl:attribute-set name="references-non-normative-style">
11801
12164
  </xsl:attribute-set> <!-- references-non-normative-style -->
11802
12165
 
12166
+ <xsl:template name="refine_references-non-normative-style">
12167
+ </xsl:template>
12168
+
11803
12169
  <!-- ======================= -->
11804
12170
  <!-- Bibliography rendering -->
11805
12171
  <!-- ======================= -->
@@ -11841,6 +12207,7 @@
11841
12207
  <xsl:apply-templates select="mn:fmt-title[@columns = 1]"/>
11842
12208
 
11843
12209
  <fo:block xsl:use-attribute-sets="references-non-normative-style">
12210
+ <xsl:call-template name="refine_references-non-normative-style"/>
11844
12211
  <xsl:apply-templates select="node()[not(self::mn:fmt-title and @columns = 1)]"/>
11845
12212
  </fo:block>
11846
12213
  </xsl:template> <!-- references -->
@@ -11854,18 +12221,22 @@
11854
12221
  <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
11855
12222
  <xsl:call-template name="setNamedDestination"/>
11856
12223
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
12224
+ <xsl:call-template name="refine_bibitem-normative-style"/>
12225
+
11857
12226
  <xsl:call-template name="processBibitem"/>
11858
12227
  </fo:block>
11859
12228
 
11860
12229
  </xsl:template> <!-- bibitem -->
11861
12230
 
11862
12231
  <!-- Bibliography (non-normative references) -->
11863
- <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem | mn:references[not(@normative='true')]/mn:note" name="bibitem_non_normative" priority="2">
12232
+ <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem" name="bibitem_non_normative" priority="2">
11864
12233
  <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
11865
12234
  $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
11866
12235
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
11867
12236
  <xsl:call-template name="setNamedDestination"/>
11868
12237
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
12238
+ <xsl:call-template name="refine_bibitem-non-normative-list-style"/>
12239
+
11869
12240
  <fo:list-item>
11870
12241
  <fo:list-item-label end-indent="label-end()">
11871
12242
  <fo:block role="SKIP">
@@ -11878,6 +12249,7 @@
11878
12249
  </fo:list-item-label>
11879
12250
  <fo:list-item-body start-indent="body-start()">
11880
12251
  <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
12252
+ <xsl:call-template name="refine_bibitem-non-normative-list-body-style"/>
11881
12253
  <xsl:call-template name="processBibitem">
11882
12254
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
11883
12255
  </xsl:call-template>
@@ -11888,12 +12260,17 @@
11888
12260
 
11889
12261
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
11890
12262
 
12263
+ <!-- bibitem's notes will be processing in 'processBibitemFollowingNotes' -->
12264
+ <xsl:template match="mn:references/mn:note" priority="2"/> <!-- [not(@normative='true')] -->
12265
+
11891
12266
  <xsl:template name="insertListItem_Bibitem">
11892
12267
  <xsl:choose>
11893
12268
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
11894
12269
  <xsl:otherwise>
11895
12270
  <xsl:call-template name="setNamedDestination"/>
11896
12271
  <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
12272
+ <xsl:call-template name="refine_bibitem-non-normative-list-item-style"/>
12273
+
11897
12274
  <fo:list-item-label end-indent="label-end()">
11898
12275
  <fo:block role="SKIP">
11899
12276
  <fo:inline role="SKIP">
@@ -11904,16 +12281,18 @@
11904
12281
  </fo:block>
11905
12282
  </fo:list-item-label>
11906
12283
  <fo:list-item-body start-indent="body-start()">
11907
- <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
12284
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style"> <!-- role="SKIP" -->
12285
+ <xsl:call-template name="refine_bibitem-non-normative-list-body-style"/>
11908
12286
  <xsl:call-template name="processBibitem">
11909
12287
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
11910
12288
  </xsl:call-template>
11911
12289
  </fo:block>
12290
+ <xsl:call-template name="processBibitemFollowingNotes"/>
11912
12291
  </fo:list-item-body>
11913
12292
  </fo:list-item>
11914
12293
  </xsl:otherwise>
11915
12294
  </xsl:choose>
11916
- <xsl:apply-templates select="following-sibling::*[1]"> <!-- [self::mn:bibitem] -->
12295
+ <xsl:apply-templates select="following-sibling::*[self::mn:bibitem][1]">
11917
12296
  <xsl:with-param name="skip">false</xsl:with-param>
11918
12297
  </xsl:apply-templates>
11919
12298
  </xsl:template>
@@ -11929,25 +12308,16 @@
11929
12308
  <xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
11930
12309
  </xsl:apply-templates>
11931
12310
  <xsl:apply-templates select="mn:formattedref"/>
12311
+ <xsl:call-template name="processBibitemFollowingNotes"/>
11932
12312
  <!-- end bibitem processing -->
11933
-
11934
- <xsl:call-template name="processBibliographyNote"/>
11935
12313
  </xsl:template> <!-- processBibitem (bibitem) -->
11936
12314
 
11937
- <xsl:template name="processBibliographyNote">
11938
- <xsl:if test="self::mn:note">
11939
- <xsl:variable name="note_node">
11940
- <xsl:element name="{local-name(..)}" namespace="{$namespace_full}"> <!-- save parent context node for determining styles -->
11941
- <xsl:copy> <!-- skip @id -->
11942
- <xsl:copy-of select="node()"/>
11943
- </xsl:copy>
11944
- </xsl:element>
11945
- </xsl:variable>
11946
- <!-- <xsl:for-each select="xalan:nodeset($note_node)//mn:note">
11947
- <xsl:call-template name="note"/>
11948
- </xsl:for-each> -->
12315
+ <xsl:template name="processBibitemFollowingNotes">
12316
+ <!-- current context is bibitem element -->
12317
+ <xsl:variable name="bibitem_id" select="@id"/>
12318
+ <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]]">
11949
12319
  <xsl:call-template name="note"/>
11950
- </xsl:if>
12320
+ </xsl:for-each>
11951
12321
  </xsl:template>
11952
12322
 
11953
12323
  <xsl:template match="mn:title" mode="title">
@@ -12150,11 +12520,17 @@
12150
12520
  <xsl:attribute name="font-weight">bold</xsl:attribute>
12151
12521
  <xsl:attribute name="span">all</xsl:attribute>
12152
12522
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
12153
- </xsl:attribute-set>
12523
+ </xsl:attribute-set> <!-- indexsect-title-style -->
12524
+
12525
+ <xsl:template name="refine_indexsect-title-style">
12526
+ </xsl:template>
12154
12527
 
12155
12528
  <xsl:attribute-set name="indexsect-clause-title-style">
12156
12529
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
12157
- </xsl:attribute-set>
12530
+ </xsl:attribute-set> <!-- indexsect-clause-title-style -->
12531
+
12532
+ <xsl:template name="refine_indexsect-clause-title-style">
12533
+ </xsl:template>
12158
12534
  <!-- End Index section styles -->
12159
12535
 
12160
12536
  <!-- =================== -->
@@ -12348,6 +12724,7 @@
12348
12724
 
12349
12725
  <xsl:template match="mn:indexsect/mn:fmt-title | mn:indexsect/mn:title" priority="4">
12350
12726
  <fo:block xsl:use-attribute-sets="indexsect-title-style">
12727
+ <xsl:call-template name="refine_indexsect-title-style"/>
12351
12728
  <!-- Index -->
12352
12729
  <xsl:apply-templates/>
12353
12730
  </fo:block>
@@ -12356,6 +12733,7 @@
12356
12733
  <xsl:template match="mn:indexsect/mn:clause/mn:fmt-title | mn:indexsect/mn:clause/mn:title" priority="4">
12357
12734
  <!-- Letter A, B, C, ... -->
12358
12735
  <fo:block xsl:use-attribute-sets="indexsect-clause-title-style">
12736
+ <xsl:call-template name="refine_indexsect-clause-title-style"/>
12359
12737
  <xsl:apply-templates/>
12360
12738
  </fo:block>
12361
12739
  </xsl:template>
@@ -12399,13 +12777,31 @@
12399
12777
  <!-- skip here, see the template 'fmt-review-start' -->
12400
12778
  </xsl:when>
12401
12779
  <xsl:otherwise>
12402
- <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
12403
- <fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[self::mn:fmt-annotation-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-annotation-end][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
12404
- <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
12405
- <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
12780
+ <xsl:choose>
12781
+ <xsl:when test="parent::mn:example or parent::mn:termexample or parent::mn:note or parent::mn:termnote">
12782
+ <fo:block font-size="1pt" line-height="0.1">
12783
+ <xsl:call-template name="fo_inline_bookmark">
12784
+ <xsl:with-param name="bookmark_id" select="$bookmark_id"/>
12785
+ </xsl:call-template>
12786
+ </fo:block>
12787
+ </xsl:when>
12788
+ <xsl:otherwise>
12789
+ <xsl:call-template name="fo_inline_bookmark">
12790
+ <xsl:with-param name="bookmark_id" select="$bookmark_id"/>
12791
+ </xsl:call-template>
12792
+ </xsl:otherwise>
12793
+ </xsl:choose>
12406
12794
  </xsl:otherwise>
12407
12795
  </xsl:choose>
12408
12796
  </xsl:template>
12797
+
12798
+ <xsl:template name="fo_inline_bookmark">
12799
+ <xsl:param name="bookmark_id"/>
12800
+ <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
12801
+ <fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[self::mn:fmt-annotation-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-annotation-end][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
12802
+ <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
12803
+ <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
12804
+ </xsl:template>
12409
12805
  <!-- =================== -->
12410
12806
  <!-- End of Index processing -->
12411
12807
  <!-- =================== -->
@@ -12540,9 +12936,15 @@
12540
12936
  <xsl:attribute name="leader-pattern">dots</xsl:attribute>
12541
12937
  </xsl:attribute-set> <!-- END: toc-leader-style -->
12542
12938
 
12939
+ <xsl:template name="refine_toc-leader-style">
12940
+ </xsl:template>
12941
+
12543
12942
  <xsl:attribute-set name="toc-pagenumber-style">
12544
12943
  </xsl:attribute-set>
12545
12944
 
12945
+ <xsl:template name="refine_toc-pagenumber-style">
12946
+ </xsl:template>
12947
+
12546
12948
  <!-- List of Figures, Tables -->
12547
12949
  <xsl:attribute-set name="toc-listof-title-style">
12548
12950
  </xsl:attribute-set>
@@ -12553,10 +12955,16 @@
12553
12955
  <xsl:attribute-set name="toc-listof-item-block-style">
12554
12956
  </xsl:attribute-set>
12555
12957
 
12958
+ <xsl:template name="refine_toc-listof-item-block-style">
12959
+ </xsl:template>
12960
+
12556
12961
  <xsl:attribute-set name="toc-listof-item-style">
12557
12962
  <xsl:attribute name="role">TOCI</xsl:attribute>
12558
12963
  </xsl:attribute-set>
12559
12964
 
12965
+ <xsl:template name="refine_toc-listof-item-style">
12966
+ </xsl:template>
12967
+
12560
12968
  <xsl:template name="processPrefaceSectionsDefault_Contents">
12561
12969
  <xsl:variable name="nodes_preface_">
12562
12970
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
@@ -13663,23 +14071,55 @@
13663
14071
  <!-- Ruby text (CJK languages) rendering -->
13664
14072
  <!-- ===================================== -->
13665
14073
  <!-- ===================================== -->
14074
+
14075
+ <xsl:attribute-set name="ruby-style">
14076
+ <xsl:attribute name="text-indent">0mm</xsl:attribute>
14077
+ <xsl:attribute name="last-line-end-indent">0mm</xsl:attribute>
14078
+ </xsl:attribute-set>
14079
+
14080
+ <xsl:template name="refine_ruby-style">
14081
+ <xsl:if test="not(ancestor::mn:ruby)">
14082
+ <xsl:attribute name="alignment-baseline">central</xsl:attribute>
14083
+ </xsl:if>
14084
+ <xsl:variable name="rt_text" select="mn:rt"/>
14085
+ <xsl:variable name="rb_text" select=".//mn:rb[not(mn:ruby)]"/>
14086
+ <!-- Example: width="2em" -->
14087
+ <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
14088
+ <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
14089
+ <xsl:variable name="text_width">
14090
+ <xsl:choose>
14091
+ <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
14092
+ <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
14093
+ </xsl:choose>
14094
+ </xsl:variable>
14095
+ <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
14096
+ </xsl:template> <!-- refine_ruby-style -->
14097
+
14098
+ <xsl:attribute-set name="rb-style">
14099
+ <xsl:attribute name="line-height">1em</xsl:attribute>
14100
+ <xsl:attribute name="text-align">center</xsl:attribute>
14101
+ </xsl:attribute-set>
14102
+
14103
+ <xsl:template name="refine_rb-style">
14104
+ </xsl:template>
14105
+
14106
+ <xsl:attribute-set name="rt-style">
14107
+ <xsl:attribute name="font-size">0.5em</xsl:attribute>
14108
+ <xsl:attribute name="text-align">center</xsl:attribute>
14109
+ <xsl:attribute name="line-height">1.2em</xsl:attribute>
14110
+ <xsl:attribute name="space-before">-1.4em</xsl:attribute>
14111
+ <xsl:attribute name="space-before.conditionality">retain</xsl:attribute>
14112
+ </xsl:attribute-set>
14113
+
14114
+ <xsl:template name="refine_rt-style">
14115
+ <xsl:if test="ancestor::mn:ruby[last()]//mn:ruby or ancestor::mn:rb">
14116
+ <xsl:attribute name="space-before">0em</xsl:attribute>
14117
+ </xsl:if>
14118
+ </xsl:template>
14119
+
13666
14120
  <xsl:template match="mn:ruby">
13667
- <fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
13668
- <xsl:if test="not(ancestor::mn:ruby)">
13669
- <xsl:attribute name="alignment-baseline">central</xsl:attribute>
13670
- </xsl:if>
13671
- <xsl:variable name="rt_text" select="mn:rt"/>
13672
- <xsl:variable name="rb_text" select=".//mn:rb[not(mn:ruby)]"/>
13673
- <!-- Example: width="2em" -->
13674
- <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
13675
- <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
13676
- <xsl:variable name="text_width">
13677
- <xsl:choose>
13678
- <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
13679
- <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
13680
- </xsl:choose>
13681
- </xsl:variable>
13682
- <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
14121
+ <fo:inline-container xsl:use-attribute-sets="ruby-style">
14122
+ <xsl:call-template name="refine_ruby-style"/>
13683
14123
 
13684
14124
  <xsl:choose>
13685
14125
  <xsl:when test="ancestor::mn:ruby">
@@ -13697,17 +14137,14 @@
13697
14137
  </xsl:template>
13698
14138
 
13699
14139
  <xsl:template match="mn:rb">
13700
- <fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
14140
+ <fo:block xsl:use-attribute-sets="rb-style"><xsl:call-template name="refine_rb-style"/><xsl:apply-templates/></fo:block>
13701
14141
  </xsl:template>
13702
14142
 
13703
14143
  <xsl:template match="mn:rt">
13704
- <fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
13705
- <xsl:if test="ancestor::mn:ruby[last()]//mn:ruby or ancestor::mn:rb">
13706
- <xsl:attribute name="space-before">0em</xsl:attribute>
13707
- </xsl:if>
14144
+ <fo:block xsl:use-attribute-sets="rt-style"> <!-- -->
14145
+ <xsl:call-template name="refine_rt-style"/>
13708
14146
  <xsl:apply-templates/>
13709
14147
  </fo:block>
13710
-
13711
14148
  </xsl:template>
13712
14149
 
13713
14150
  <!-- ===================================== -->
@@ -13716,6 +14153,18 @@
13716
14153
  <!-- ===================================== -->
13717
14154
  <!-- ===================================== -->
13718
14155
 
14156
+ <xsl:attribute-set name="annex-title-style">
14157
+ </xsl:attribute-set>
14158
+
14159
+ <xsl:template name="refine_annex-title-style">
14160
+ </xsl:template>
14161
+
14162
+ <xsl:attribute-set name="p-zzSTDTitle1-style">
14163
+ </xsl:attribute-set>
14164
+
14165
+ <xsl:template name="refine_p-zzSTDTitle1-style">
14166
+ </xsl:template>
14167
+
13719
14168
  <xsl:template name="processPrefaceSectionsDefault">
13720
14169
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
13721
14170
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -14271,11 +14720,35 @@
14271
14720
 
14272
14721
  <xsl:template match="mn:svgmap"/>
14273
14722
 
14723
+ <xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]"/>
14724
+
14274
14725
  <!-- for correct rendering combining chars, added in mode="update_xml_step2" -->
14275
14726
  <xsl:template match="*[local-name() = 'lang_none']">
14276
14727
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
14277
14728
  </xsl:template>
14278
14729
 
14730
+ <xsl:template name="addTagElementT">
14731
+ <xsl:variable name="title_">
14732
+ <xsl:apply-templates select="mn:fmt-title"/>
14733
+ </xsl:variable>
14734
+ <xsl:variable name="title__">
14735
+ <xsl:for-each select="xalan:nodeset($title_)/*/node()">
14736
+ <xsl:choose>
14737
+ <xsl:when test="self::text()"><xsl:text> </xsl:text><xsl:value-of select="."/><xsl:text> </xsl:text></xsl:when>
14738
+ <xsl:otherwise><xsl:text> </xsl:text><xsl:copy-of select="."/><xsl:text> </xsl:text></xsl:otherwise>
14739
+ </xsl:choose>
14740
+ </xsl:for-each>
14741
+ </xsl:variable>
14742
+ <xsl:variable name="title" select="normalize-space($title__)"/>
14743
+ <xsl:if test="$title != ''">
14744
+ <xsl:attribute name="fox:title">
14745
+ <xsl:if test="ancestor::mn:sections">
14746
+ <xsl:text>Section </xsl:text>
14747
+ </xsl:if>
14748
+ <xsl:value-of select="$title"/></xsl:attribute>
14749
+ </xsl:if>
14750
+ </xsl:template>
14751
+
14279
14752
  <xsl:template name="replaceChar">
14280
14753
  <xsl:param name="text"/>
14281
14754
  <xsl:param name="replace"/>
@@ -15066,6 +15539,13 @@
15066
15539
  <xsl:with-param name="default" select="$text_align_default"/>
15067
15540
  </xsl:call-template>
15068
15541
  <xsl:call-template name="setKeepAttributes"/>
15542
+ <xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
15543
+ <xsl:variable name="styles">
15544
+ <xsl:apply-templates select="*[1]"/>
15545
+ </xsl:variable>
15546
+ <!-- move attribute line-height from inline to block -->
15547
+ <xsl:attribute name="line-height"><xsl:value-of select="xalan:nodeset($styles)//*/@line-height"/></xsl:attribute>
15548
+ </xsl:if>
15069
15549
  </xsl:template>
15070
15550
 
15071
15551
  <xsl:template name="setKeepAttributes">
@@ -15091,34 +15571,41 @@
15091
15571
  <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
15092
15572
  <fo:block>
15093
15573
  <xsl:for-each select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = $name][1]/mn:value/mn:image[$num]">
15094
- <xsl:choose>
15095
- <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
15096
- <fo:instream-foreign-object fox:alt-text="Image Front">
15097
- <xsl:attribute name="content-height"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
15098
- <xsl:call-template name="getSVG"/>
15099
- </fo:instream-foreign-object>
15100
- </xsl:when>
15101
- <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
15102
- <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
15103
- </xsl:when>
15104
- <xsl:otherwise> <!-- bitmap image -->
15105
- <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
15106
- <xsl:if test="$coverimage_src != ''">
15107
- <xsl:variable name="coverpage">
15108
- <xsl:call-template name="getImageURL">
15109
- <xsl:with-param name="src" select="$coverimage_src"/>
15110
- </xsl:call-template>
15111
- </xsl:variable>
15112
- <!-- <xsl:variable name="coverpage" select="concat('url(file:',$basepath, 'coverpage1.png', ')')"/> --> <!-- for DEBUG -->
15113
- <fo:external-graphic src="{$coverpage}" width="{$pageWidth}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
15114
- </xsl:if>
15115
- </xsl:otherwise>
15116
- </xsl:choose>
15574
+
15575
+ <xsl:call-template name="insertPageImage"/>
15576
+
15117
15577
  </xsl:for-each>
15118
15578
  </fo:block>
15119
15579
  </fo:block-container>
15120
15580
  </xsl:template>
15121
15581
 
15582
+ <xsl:template name="insertPageImage">
15583
+ <xsl:param name="svg_content_height" select="$pageHeight"/>
15584
+ <xsl:param name="bitmap_width" select="$pageWidth"/>
15585
+ <xsl:choose>
15586
+ <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
15587
+ <fo:instream-foreign-object fox:alt-text="Image Front">
15588
+ <xsl:attribute name="content-height"><xsl:value-of select="$svg_content_height"/>mm</xsl:attribute>
15589
+ <xsl:call-template name="getSVG"/>
15590
+ </fo:instream-foreign-object>
15591
+ </xsl:when>
15592
+ <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
15593
+ <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
15594
+ </xsl:when>
15595
+ <xsl:otherwise> <!-- bitmap image -->
15596
+ <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
15597
+ <xsl:if test="$coverimage_src != ''">
15598
+ <xsl:variable name="coverpage">
15599
+ <xsl:call-template name="getImageURL">
15600
+ <xsl:with-param name="src" select="$coverimage_src"/>
15601
+ </xsl:call-template>
15602
+ </xsl:variable>
15603
+ <fo:external-graphic src="{$coverpage}" width="{$bitmap_width}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
15604
+ </xsl:if>
15605
+ </xsl:otherwise>
15606
+ </xsl:choose>
15607
+ </xsl:template>
15608
+
15122
15609
  <xsl:template name="getImageURL">
15123
15610
  <xsl:param name="src"/>
15124
15611
  <xsl:choose>
@@ -15546,6 +16033,14 @@
15546
16033
  </xsl:attribute>
15547
16034
  </xsl:template>
15548
16035
 
16036
+ <xsl:template name="getCharByCodePoint">
16037
+ <xsl:param name="codepoint"/>
16038
+ <xsl:param name="radix">16</xsl:param>
16039
+ <xsl:variable name="codepointInt" select="java:java.lang.Integer.parseInt($codepoint,$radix)"/>
16040
+ <xsl:variable name="chars" select="java:java.lang.Character.toChars($codepointInt)"/>
16041
+ <xsl:value-of select="java:java.lang.String.new($chars)"/>
16042
+ </xsl:template>
16043
+
15549
16044
  <xsl:template name="substring-after-last">
15550
16045
  <xsl:param name="value"/>
15551
16046
  <xsl:param name="delimiter"/>