metanorma-ribose 2.7.1 → 2.7.3

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.
@@ -466,7 +466,8 @@
466
466
  </xsl:call-template>
467
467
  </fo:block>
468
468
  <fo:block><xsl:value-of select="$docnumber_version"/></fo:block>
469
- <xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:ext/mn:editorialgroup/mn:committee"/>
469
+ <!-- <xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:ext/mn:editorialgroup/mn:committee"/> -->
470
+ <xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:contributor[mn:role[@type = 'author']/mn:description = 'committee']/mn:organization/mn:subdivision[@type = 'Committee']/mn:name"/>
470
471
  <fo:block>
471
472
  <xsl:text>© </xsl:text>
472
473
  <xsl:value-of select="$copyright_year"/>
@@ -678,7 +679,8 @@
678
679
  </fo:block>
679
680
  </xsl:template>
680
681
 
681
- <xsl:template match="mn:bibdata/mn:ext/mn:editorialgroup/mn:committee">
682
+ <!-- <xsl:template match="mn:bibdata/mn:ext/mn:editorialgroup/mn:committee"> -->
683
+ <xsl:template match="mn:bibdata/mn:contributor[mn:role[@type = 'author']/mn:description = 'committee']/mn:organization/mn:subdivision[@type = 'Committee']/mn:name">
682
684
  <fo:block><xsl:apply-templates/></fo:block>
683
685
  </xsl:template>
684
686
 
@@ -1000,7 +1002,7 @@
1000
1002
  </fo:inline>
1001
1003
  </xsl:if>
1002
1004
 
1003
- <fo:inline padding-right="4mm"><xsl:if test="self::mn:fmt-preferred"><xsl:call-template name="setStyle_preferred"/></xsl:if><xsl:apply-templates/></fo:inline>
1005
+ <fo:inline padding-right="4mm"><xsl:if test="self::mn:fmt-preferred"><xsl:call-template name="refine_preferred-term-style"/></xsl:if><xsl:apply-templates/></fo:inline>
1004
1006
 
1005
1007
  <xsl:variable name="term_kind">
1006
1008
  <xsl:choose>
@@ -2859,25 +2861,48 @@
2859
2861
  <xsl:attribute-set name="copyright-statement-style">
2860
2862
  </xsl:attribute-set> <!-- copyright-statement-style -->
2861
2863
 
2864
+ <xsl:template name="refine_copyright-statement-style">
2865
+ </xsl:template>
2866
+
2862
2867
  <xsl:attribute-set name="copyright-statement-title-style">
2863
2868
  </xsl:attribute-set> <!-- copyright-statement-title-style -->
2864
2869
 
2870
+ <xsl:template name="refine_copyright-statement-title-style">
2871
+ </xsl:template>
2872
+
2865
2873
  <xsl:attribute-set name="copyright-statement-p-style">
2866
2874
  </xsl:attribute-set> <!-- copyright-statement-p-style -->
2867
2875
 
2868
- <xsl:attribute-set name="license-statement-style">
2876
+ <xsl:template name="refine_copyright-statement-p-style">
2877
+
2878
+ </xsl:template>
2879
+
2880
+ <xsl:attribute-set name="license-statement-style">
2869
2881
  </xsl:attribute-set> <!-- license-statement-style -->
2870
2882
 
2883
+ <xsl:template name="refine_license-statement-style">
2884
+ </xsl:template>
2885
+
2871
2886
  <xsl:attribute-set name="license-statement-title-style">
2872
2887
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2873
2888
  </xsl:attribute-set> <!-- license-statement-title-style -->
2874
2889
 
2890
+ <xsl:template name="refine_license-statement-title-style">
2891
+ </xsl:template>
2892
+
2875
2893
  <xsl:attribute-set name="license-statement-p-style">
2876
2894
  </xsl:attribute-set> <!-- license-statement-p-style -->
2877
2895
 
2896
+ <xsl:template name="refine_license-statement-p-style">
2897
+
2898
+ </xsl:template>
2899
+
2878
2900
  <xsl:attribute-set name="legal-statement-style">
2879
2901
  </xsl:attribute-set> <!-- legal-statement-style -->
2880
2902
 
2903
+ <xsl:template name="refine_legal-statement-style">
2904
+ </xsl:template>
2905
+
2881
2906
  <xsl:attribute-set name="legal-statement-title-style">
2882
2907
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2883
2908
  <xsl:attribute name="font-weight">normal</xsl:attribute>
@@ -2885,19 +2910,40 @@
2885
2910
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2886
2911
  </xsl:attribute-set> <!-- legal-statement-title-style -->
2887
2912
 
2913
+ <xsl:template name="refine_legal-statement-title-style">
2914
+ </xsl:template>
2915
+
2888
2916
  <xsl:attribute-set name="legal-statement-p-style">
2889
2917
  </xsl:attribute-set> <!-- legal-statement-p-style -->
2890
2918
 
2919
+ <xsl:template name="refine_legal-statement-p-style">
2920
+ <xsl:if test="@align">
2921
+ <xsl:attribute name="text-align">
2922
+ <xsl:value-of select="@align"/>
2923
+ </xsl:attribute>
2924
+ </xsl:if>
2925
+ </xsl:template>
2926
+
2891
2927
  <xsl:attribute-set name="feedback-statement-style">
2892
2928
  </xsl:attribute-set> <!-- feedback-statement-style -->
2893
2929
 
2930
+ <xsl:template name="refine_feedback-statement-style">
2931
+ </xsl:template>
2932
+
2894
2933
  <xsl:attribute-set name="feedback-statement-title-style">
2895
2934
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2896
2935
  </xsl:attribute-set> <!-- feedback-statement-title-style -->
2897
2936
 
2937
+ <xsl:template name="refine_feedback-statement-title-style">
2938
+
2939
+ </xsl:template>
2940
+
2898
2941
  <xsl:attribute-set name="feedback-statement-p-style">
2899
2942
  </xsl:attribute-set> <!-- feedback-statement-p-style -->
2900
2943
 
2944
+ <xsl:template name="refine_feedback-statement-p-style">
2945
+ </xsl:template>
2946
+
2901
2947
  <!-- End boilerplate sections styles -->
2902
2948
 
2903
2949
  <!-- ================================= -->
@@ -2905,6 +2951,8 @@
2905
2951
  <!-- ================================= -->
2906
2952
  <xsl:template match="mn:copyright-statement">
2907
2953
  <fo:block xsl:use-attribute-sets="copyright-statement-style" role="SKIP">
2954
+ <xsl:call-template name="refine_copyright-statement-style"/>
2955
+
2908
2956
  <xsl:apply-templates/>
2909
2957
  </fo:block>
2910
2958
  </xsl:template> <!-- copyright-statement -->
@@ -2921,6 +2969,7 @@
2921
2969
 
2922
2970
  <xsl:template match="mn:license-statement">
2923
2971
  <fo:block xsl:use-attribute-sets="license-statement-style">
2972
+ <xsl:call-template name="refine_license-statement-style"/>
2924
2973
  <xsl:apply-templates/>
2925
2974
  </fo:block>
2926
2975
  </xsl:template> <!-- license-statement -->
@@ -2938,6 +2987,7 @@
2938
2987
  <xsl:template match="mn:legal-statement">
2939
2988
  <xsl:param name="isLegacy">false</xsl:param>
2940
2989
  <fo:block xsl:use-attribute-sets="legal-statement-style">
2990
+ <xsl:call-template name="refine_legal-statement-style"/>
2941
2991
  <xsl:apply-templates/>
2942
2992
  </fo:block>
2943
2993
  </xsl:template> <!-- legal-statement -->
@@ -3119,6 +3169,27 @@
3119
3169
  <xsl:attribute name="space-after">12pt</xsl:attribute>
3120
3170
  </xsl:attribute-set>
3121
3171
 
3172
+ <xsl:template name="refine_sourcecode-container-style">
3173
+ <xsl:if test="not(ancestor::mn:li) or ancestor::mn:example">
3174
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3175
+ </xsl:if>
3176
+
3177
+ <xsl:if test="ancestor::mn:example">
3178
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3179
+ </xsl:if>
3180
+
3181
+ <xsl:copy-of select="@id"/>
3182
+
3183
+ <xsl:if test="parent::mn:note">
3184
+ <xsl:attribute name="margin-left">
3185
+ <xsl:choose>
3186
+ <xsl:when test="not(ancestor::mn:table)"><xsl:value-of select="$note-body-indent"/></xsl:when>
3187
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3188
+ </xsl:choose>
3189
+ </xsl:attribute>
3190
+ </xsl:if>
3191
+ </xsl:template>
3192
+
3122
3193
  <xsl:attribute-set name="sourcecode-style">
3123
3194
  <xsl:attribute name="white-space">pre</xsl:attribute>
3124
3195
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -3159,6 +3230,9 @@
3159
3230
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3160
3231
  </xsl:attribute-set> <!-- sourcecode-name-style -->
3161
3232
 
3233
+ <xsl:template name="refine_sourcecode-name-style">
3234
+ </xsl:template>
3235
+
3162
3236
  <xsl:template name="add-zero-spaces-equal">
3163
3237
  <xsl:param name="text" select="."/>
3164
3238
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
@@ -3250,24 +3324,8 @@
3250
3324
  <xsl:otherwise>
3251
3325
  <fo:block-container xsl:use-attribute-sets="sourcecode-container-style" role="SKIP">
3252
3326
 
3253
- <xsl:if test="not(ancestor::mn:li) or ancestor::mn:example">
3254
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
3255
- </xsl:if>
3256
-
3257
- <xsl:if test="ancestor::mn:example">
3258
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
3259
- </xsl:if>
3260
-
3261
- <xsl:copy-of select="@id"/>
3327
+ <xsl:call-template name="refine_sourcecode-container-style"/>
3262
3328
 
3263
- <xsl:if test="parent::mn:note">
3264
- <xsl:attribute name="margin-left">
3265
- <xsl:choose>
3266
- <xsl:when test="not(ancestor::mn:table)"><xsl:value-of select="$note-body-indent"/></xsl:when>
3267
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3268
- </xsl:choose>
3269
- </xsl:attribute>
3270
- </xsl:if>
3271
3329
  <fo:block-container margin-left="0mm" role="SKIP">
3272
3330
  <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name BEFORE content -->
3273
3331
 
@@ -3594,6 +3652,7 @@
3594
3652
  <xsl:template match="mn:sourcecode/mn:fmt-name">
3595
3653
  <xsl:if test="normalize-space() != ''">
3596
3654
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
3655
+ <xsl:call-template name="refine_sourcecode-name-style"/>
3597
3656
  <xsl:apply-templates/>
3598
3657
  </fo:block>
3599
3658
  </xsl:if>
@@ -3642,12 +3701,35 @@
3642
3701
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3643
3702
  <xsl:attribute name="font-family"><xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
3644
3703
  <xsl:attribute name="line-height">113%</xsl:attribute>
3645
- </xsl:attribute-set>
3704
+ </xsl:attribute-set> <!-- pre-style -->
3705
+
3706
+ <xsl:template name="refine_pre-style">
3707
+ </xsl:template>
3646
3708
 
3647
3709
  <xsl:attribute-set name="tt-style">
3648
3710
  <xsl:attribute name="font-family"><xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
3649
3711
  </xsl:attribute-set>
3650
3712
 
3713
+ <xsl:template name="refine_tt-style">
3714
+ <xsl:variable name="_font-size"> <!-- inherit -->
3715
+ <xsl:choose>
3716
+ <xsl:when test="ancestor::mn:table">inherit</xsl:when>
3717
+ <xsl:otherwise>95%</xsl:otherwise> <!-- 110% -->
3718
+ </xsl:choose>
3719
+ </xsl:variable>
3720
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3721
+ <xsl:if test="$font-size != ''">
3722
+ <xsl:attribute name="font-size">
3723
+ <xsl:choose>
3724
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
3725
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
3726
+ <xsl:when test="ancestor::mn:note or ancestor::mn:example"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3727
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3728
+ </xsl:choose>
3729
+ </xsl:attribute>
3730
+ </xsl:if>
3731
+ </xsl:template>
3732
+
3651
3733
  <xsl:variable name="color-added-text">
3652
3734
  <xsl:text>rgb(0, 255, 0)</xsl:text>
3653
3735
  </xsl:variable>
@@ -3660,9 +3742,14 @@
3660
3742
  <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
3661
3743
  </xsl:attribute-set>
3662
3744
 
3745
+ <xsl:template name="refine_add-style">
3746
+ </xsl:template>
3747
+
3663
3748
  <xsl:variable name="add-style">
3664
- <add-style xsl:use-attribute-sets="add-style"/>
3665
- </xsl:variable>
3749
+ <add-style xsl:use-attribute-sets="add-style">
3750
+ <xsl:call-template name="refine_add-style"/>
3751
+ </add-style>
3752
+ </xsl:variable>
3666
3753
  <xsl:template name="append_add-style">
3667
3754
  <xsl:copy-of select="xalan:nodeset($add-style)/add-style/@*"/>
3668
3755
  </xsl:template>
@@ -3675,24 +3762,81 @@
3675
3762
  <xsl:attribute name="text-decoration">line-through</xsl:attribute>
3676
3763
  </xsl:attribute-set>
3677
3764
 
3765
+ <xsl:template name="refine_del-style">
3766
+ </xsl:template>
3767
+
3768
+ <xsl:attribute-set name="strong-style">
3769
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3770
+ </xsl:attribute-set>
3771
+
3772
+ <xsl:template name="refine_strong_style">
3773
+ <xsl:if test="not(parent::mn:fmt-termsource)">
3774
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
3775
+ <xsl:attribute name="color">black</xsl:attribute>
3776
+ </xsl:if>
3777
+ <xsl:if test="ancestor::*['preferred']">
3778
+ <xsl:attribute name="role">SKIP</xsl:attribute>
3779
+ </xsl:if>
3780
+ </xsl:template> <!-- refine_strong_style -->
3781
+
3782
+ <xsl:attribute-set name="em-style">
3783
+ <xsl:attribute name="font-style">italic</xsl:attribute>
3784
+ </xsl:attribute-set>
3785
+
3786
+ <xsl:template name="refine_em_style">
3787
+ </xsl:template> <!-- refine_em_style -->
3788
+
3789
+ <xsl:attribute-set name="sup-style">
3790
+ <xsl:attribute name="font-size">80%</xsl:attribute>
3791
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
3792
+ </xsl:attribute-set>
3793
+
3794
+ <xsl:template name="refine_sup-style">
3795
+ </xsl:template>
3796
+
3797
+ <xsl:attribute-set name="sub-style">
3798
+ <xsl:attribute name="font-size">80%</xsl:attribute>
3799
+ <xsl:attribute name="vertical-align">sub</xsl:attribute>
3800
+ </xsl:attribute-set>
3801
+
3802
+ <xsl:template name="refine_sub-style">
3803
+ </xsl:template>
3804
+
3805
+ <xsl:attribute-set name="underline-style">
3806
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
3807
+ </xsl:attribute-set>
3808
+
3809
+ <xsl:template name="refine_underline-style">
3810
+ </xsl:template>
3811
+
3812
+ <xsl:attribute-set name="hi-style">
3813
+ <xsl:attribute name="background-color">yellow</xsl:attribute>
3814
+ </xsl:attribute-set>
3815
+
3816
+ <xsl:template name="refine_hi-style">
3817
+ </xsl:template>
3818
+
3819
+ <xsl:attribute-set name="strike-style">
3820
+ <xsl:attribute name="text-decoration">line-through</xsl:attribute>
3821
+ </xsl:attribute-set>
3822
+
3823
+ <xsl:template name="refine_strike-style">
3824
+ </xsl:template>
3825
+
3678
3826
  <xsl:template match="mn:br">
3679
3827
  <xsl:value-of select="$linebreak"/>
3680
3828
  </xsl:template>
3681
3829
 
3682
- <xsl:template match="mn:em">
3683
- <fo:inline font-style="italic">
3684
- <xsl:call-template name="refine_italic_style"/>
3830
+ <xsl:template match="mn:em">
3831
+ <fo:inline xsl:use-attribute-sets="em-style">
3832
+ <xsl:call-template name="refine_em_style"/>
3685
3833
  <xsl:apply-templates/>
3686
3834
  </fo:inline>
3687
3835
  </xsl:template>
3688
3836
 
3689
- <xsl:template name="refine_italic_style">
3690
- </xsl:template>
3691
-
3692
3837
  <xsl:template match="mn:strong | *[local-name()='b']">
3693
3838
  <xsl:param name="split_keep-within-line"/>
3694
- <fo:inline font-weight="bold">
3695
-
3839
+ <fo:inline xsl:use-attribute-sets="strong-style">
3696
3840
  <xsl:call-template name="refine_strong_style"/>
3697
3841
 
3698
3842
  <xsl:apply-templates>
@@ -3701,52 +3845,27 @@
3701
3845
  </fo:inline>
3702
3846
  </xsl:template>
3703
3847
 
3704
- <xsl:template name="refine_strong_style">
3705
- <xsl:if test="not(parent::mn:fmt-termsource)">
3706
- <xsl:attribute name="font-weight">normal</xsl:attribute>
3707
- <xsl:attribute name="color">black</xsl:attribute>
3708
- </xsl:if>
3709
- <xsl:if test="ancestor::*['preferred']">
3710
- <xsl:attribute name="role">SKIP</xsl:attribute>
3711
- </xsl:if>
3712
- </xsl:template>
3713
-
3714
3848
  <xsl:template match="*[local-name()='padding']">
3715
3849
  <fo:inline padding-right="{@value}"> </fo:inline>
3716
3850
  </xsl:template>
3717
3851
 
3718
3852
  <xsl:template match="mn:sup">
3719
- <fo:inline font-size="80%" vertical-align="super">
3853
+ <fo:inline xsl:use-attribute-sets="sup-style">
3854
+ <xsl:call-template name="refine_sup-style"/>
3720
3855
  <xsl:apply-templates/>
3721
3856
  </fo:inline>
3722
3857
  </xsl:template>
3723
3858
 
3724
3859
  <xsl:template match="mn:sub">
3725
- <fo:inline font-size="80%" vertical-align="sub">
3860
+ <fo:inline xsl:use-attribute-sets="sub-style">
3861
+ <xsl:call-template name="refine_sub-style"/>
3726
3862
  <xsl:apply-templates/>
3727
3863
  </fo:inline>
3728
3864
  </xsl:template>
3729
3865
 
3730
3866
  <xsl:template match="mn:tt">
3731
3867
  <fo:inline xsl:use-attribute-sets="tt-style">
3732
-
3733
- <xsl:variable name="_font-size"> <!-- inherit -->
3734
- <xsl:choose>
3735
- <xsl:when test="ancestor::mn:table">inherit</xsl:when>
3736
- <xsl:otherwise>95%</xsl:otherwise> <!-- 110% -->
3737
- </xsl:choose>
3738
- </xsl:variable>
3739
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3740
- <xsl:if test="$font-size != ''">
3741
- <xsl:attribute name="font-size">
3742
- <xsl:choose>
3743
- <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
3744
- <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
3745
- <xsl:when test="ancestor::mn:note or ancestor::mn:example"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3746
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3747
- </xsl:choose>
3748
- </xsl:attribute>
3749
- </xsl:if>
3868
+ <xsl:call-template name="refine_tt-style"/>
3750
3869
  <xsl:apply-templates/>
3751
3870
  </fo:inline>
3752
3871
  </xsl:template> <!-- tt -->
@@ -3765,7 +3884,8 @@
3765
3884
  </xsl:template>
3766
3885
 
3767
3886
  <xsl:template match="mn:underline">
3768
- <fo:inline text-decoration="underline">
3887
+ <fo:inline xsl:use-attribute-sets="underline-style">
3888
+ <xsl:call-template name="refine_underline-style"/>
3769
3889
  <xsl:apply-templates/>
3770
3890
  </fo:inline>
3771
3891
  </xsl:template>
@@ -3923,6 +4043,7 @@
3923
4043
 
3924
4044
  <xsl:template match="mn:del">
3925
4045
  <fo:inline xsl:use-attribute-sets="del-style">
4046
+ <xsl:call-template name="refine_del-style"/>
3926
4047
  <xsl:apply-templates/>
3927
4048
  </fo:inline>
3928
4049
  </xsl:template>
@@ -3932,7 +4053,8 @@
3932
4053
 
3933
4054
  <!-- highlight text -->
3934
4055
  <xsl:template match="mn:hi | mn:span[@class = 'fmt-hi']" priority="3">
3935
- <fo:inline background-color="yellow">
4056
+ <fo:inline xsl:use-attribute-sets="hi-style">
4057
+ <xsl:call-template name="refine_hi-style"/>
3936
4058
  <xsl:apply-templates/>
3937
4059
  </fo:inline>
3938
4060
  </xsl:template>
@@ -4018,7 +4140,8 @@
4018
4140
  </xsl:template>
4019
4141
 
4020
4142
  <xsl:template match="mn:strike">
4021
- <fo:inline text-decoration="line-through">
4143
+ <fo:inline xsl:use-attribute-sets="strike-style">
4144
+ <xsl:call-template name="refine_strike-style"/>
4022
4145
  <xsl:apply-templates/>
4023
4146
  </fo:inline>
4024
4147
  </xsl:template>
@@ -4046,7 +4169,7 @@
4046
4169
  </xsl:otherwise>
4047
4170
  </xsl:choose>
4048
4171
  </xsl:variable>
4049
- <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color' or $key = 'baseline-shift'">
4172
+ <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color' or $key = 'baseline-shift' or $key = 'line-height' ">
4050
4173
  <style name="{$key}"><xsl:value-of select="$value"/></style>
4051
4174
  </xsl:if>
4052
4175
  <xsl:if test="$key = 'text-indent'">
@@ -4098,6 +4221,7 @@
4098
4221
 
4099
4222
  <xsl:template match="mn:pre" name="pre">
4100
4223
  <fo:block xsl:use-attribute-sets="pre-style">
4224
+ <xsl:call-template name="refine_pre-style"/>
4101
4225
  <xsl:copy-of select="@id"/>
4102
4226
  <xsl:choose>
4103
4227
 
@@ -4128,22 +4252,40 @@
4128
4252
  <xsl:attribute-set name="permission-style">
4129
4253
  </xsl:attribute-set>
4130
4254
 
4255
+ <xsl:template name="refine_permission-style">
4256
+ </xsl:template>
4257
+
4131
4258
  <xsl:attribute-set name="permission-name-style">
4132
4259
  </xsl:attribute-set>
4133
4260
 
4261
+ <xsl:template name="refine_permission-name-style">
4262
+ </xsl:template>
4263
+
4134
4264
  <xsl:attribute-set name="permission-label-style">
4135
4265
  </xsl:attribute-set>
4136
4266
 
4267
+ <xsl:template name="refine_permission-label-style">
4268
+ </xsl:template>
4269
+
4137
4270
  <xsl:attribute-set name="requirement-style">
4138
4271
  </xsl:attribute-set>
4139
4272
 
4273
+ <xsl:template name="refine_requirement-style">
4274
+ </xsl:template>
4275
+
4140
4276
  <xsl:attribute-set name="requirement-name-style">
4141
4277
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4142
4278
  </xsl:attribute-set>
4143
4279
 
4280
+ <xsl:template name="refine_requirement-name-style">
4281
+ </xsl:template>
4282
+
4144
4283
  <xsl:attribute-set name="requirement-label-style">
4145
4284
  </xsl:attribute-set>
4146
4285
 
4286
+ <xsl:template name="refine_requirement-label-style">
4287
+ </xsl:template>
4288
+
4147
4289
  <xsl:attribute-set name="subject-style">
4148
4290
  </xsl:attribute-set>
4149
4291
 
@@ -4171,18 +4313,28 @@
4171
4313
  <xsl:attribute-set name="recommendation-style">
4172
4314
  </xsl:attribute-set>
4173
4315
 
4316
+ <xsl:template name="refine_recommendation-style">
4317
+ </xsl:template>
4318
+
4174
4319
  <xsl:attribute-set name="recommendation-name-style">
4175
4320
  </xsl:attribute-set>
4176
4321
 
4322
+ <xsl:template name="refine_recommendation-name-style">
4323
+ </xsl:template>
4324
+
4177
4325
  <xsl:attribute-set name="recommendation-label-style">
4178
4326
  </xsl:attribute-set>
4179
4327
 
4328
+ <xsl:template name="refine_recommendation-label-style">
4329
+ </xsl:template>
4330
+
4180
4331
  <!-- ========== -->
4181
4332
  <!-- permission -->
4182
4333
  <!-- ========== -->
4183
4334
  <xsl:template match="mn:permission">
4184
4335
  <xsl:call-template name="setNamedDestination"/>
4185
4336
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
4337
+ <xsl:call-template name="refine_permission-style"/>
4186
4338
  <xsl:apply-templates select="mn:fmt-name"/>
4187
4339
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
4188
4340
  </fo:block>
@@ -4191,6 +4343,7 @@
4191
4343
  <xsl:template match="mn:permission/mn:fmt-name">
4192
4344
  <xsl:if test="normalize-space() != ''">
4193
4345
  <fo:block xsl:use-attribute-sets="permission-name-style">
4346
+ <xsl:call-template name="refine_permission-name-style"/>
4194
4347
  <xsl:apply-templates/>
4195
4348
  </fo:block>
4196
4349
  </xsl:if>
@@ -4198,6 +4351,7 @@
4198
4351
 
4199
4352
  <xsl:template match="mn:permission/mn:label">
4200
4353
  <fo:block xsl:use-attribute-sets="permission-label-style">
4354
+ <xsl:call-template name="refine_permission-label-style"/>
4201
4355
  <xsl:apply-templates/>
4202
4356
  </fo:block>
4203
4357
  </xsl:template>
@@ -4210,6 +4364,7 @@
4210
4364
  <xsl:template match="mn:requirement">
4211
4365
  <xsl:call-template name="setNamedDestination"/>
4212
4366
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
4367
+ <xsl:call-template name="refine_requirement-style"/>
4213
4368
  <xsl:apply-templates select="mn:fmt-name"/>
4214
4369
  <xsl:apply-templates select="mn:label"/>
4215
4370
  <xsl:apply-templates select="@obligation"/>
@@ -4222,6 +4377,7 @@
4222
4377
  <xsl:if test="normalize-space() != ''">
4223
4378
 
4224
4379
  <fo:block xsl:use-attribute-sets="requirement-name-style">
4380
+ <xsl:call-template name="refine_requirement-name-style"/>
4225
4381
  <xsl:apply-templates/>
4226
4382
  </fo:block>
4227
4383
  </xsl:if>
@@ -4229,6 +4385,7 @@
4229
4385
 
4230
4386
  <xsl:template match="mn:requirement/mn:label">
4231
4387
  <fo:block xsl:use-attribute-sets="requirement-label-style">
4388
+ <xsl:call-template name="refine_requirement-label-style"/>
4232
4389
  <xsl:apply-templates/>
4233
4390
  </fo:block>
4234
4391
  </xsl:template>
@@ -4254,6 +4411,7 @@
4254
4411
  <xsl:template match="mn:recommendation">
4255
4412
  <xsl:call-template name="setNamedDestination"/>
4256
4413
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
4414
+ <xsl:call-template name="refine_recommendation-style"/>
4257
4415
  <xsl:apply-templates select="mn:fmt-name"/>
4258
4416
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
4259
4417
  </fo:block>
@@ -4263,6 +4421,7 @@
4263
4421
  <xsl:if test="normalize-space() != ''">
4264
4422
 
4265
4423
  <fo:block xsl:use-attribute-sets="recommendation-name-style">
4424
+ <xsl:call-template name="refine_recommendation-name-style"/>
4266
4425
  <xsl:apply-templates/>
4267
4426
  </fo:block>
4268
4427
  </xsl:if>
@@ -4270,6 +4429,7 @@
4270
4429
 
4271
4430
  <xsl:template match="mn:recommendation/mn:label">
4272
4431
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
4432
+ <xsl:call-template name="refine_recommendation-label-style"/>
4273
4433
  <xsl:apply-templates/>
4274
4434
  </fo:block>
4275
4435
  </xsl:template>
@@ -4450,41 +4610,71 @@
4450
4610
  <xsl:attribute-set name="term-style">
4451
4611
  </xsl:attribute-set> <!-- term-style -->
4452
4612
 
4613
+ <xsl:template name="refine_term-style">
4614
+ </xsl:template>
4615
+
4453
4616
  <xsl:attribute-set name="term-name-style">
4454
4617
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4455
4618
  <xsl:attribute name="font-weight">bold</xsl:attribute>
4456
4619
  </xsl:attribute-set> <!-- term-name-style -->
4457
4620
 
4458
- <xsl:attribute-set name="preferred-block-style">
4621
+ <xsl:template name="refine_term-name-style">
4622
+ </xsl:template>
4623
+
4624
+ <xsl:attribute-set name="preferred-block-style">
4459
4625
  </xsl:attribute-set> <!-- preferred-block-style -->
4460
4626
 
4627
+ <xsl:template name="refine_preferred-block-style">
4628
+ </xsl:template>
4629
+
4461
4630
  <xsl:attribute-set name="preferred-term-style">
4462
4631
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4463
4632
  <xsl:attribute name="font-weight">bold</xsl:attribute>
4464
4633
  </xsl:attribute-set> <!-- preferred-term-style -->
4465
4634
 
4635
+ <xsl:template name="refine_preferred-term-style">
4636
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
4637
+ <xsl:attribute name="color">black</xsl:attribute>
4638
+
4639
+ </xsl:template>
4640
+
4466
4641
  <xsl:attribute-set name="domain-style">
4467
4642
  </xsl:attribute-set> <!-- domain-style -->
4468
4643
 
4644
+ <xsl:template name="refine_domain-style">
4645
+ </xsl:template>
4646
+
4469
4647
  <xsl:attribute-set name="admitted-style">
4470
4648
  <xsl:attribute name="font-weight">bold</xsl:attribute>
4471
4649
  <xsl:attribute name="color">black</xsl:attribute>
4472
4650
  </xsl:attribute-set> <!-- admitted-style -->
4473
4651
 
4652
+ <xsl:template name="refine_admitted-style">
4653
+ </xsl:template>
4654
+
4474
4655
  <xsl:attribute-set name="deprecates-style">
4475
4656
  <xsl:attribute name="font-weight">bold</xsl:attribute>
4476
4657
  <xsl:attribute name="color">black</xsl:attribute>
4477
4658
  </xsl:attribute-set> <!-- deprecates-style -->
4478
4659
 
4660
+ <xsl:template name="refine_deprecates-style">
4661
+ </xsl:template>
4662
+
4479
4663
  <xsl:attribute-set name="related-block-style" use-attribute-sets="preferred-block-style">
4480
4664
  </xsl:attribute-set>
4481
4665
 
4666
+ <xsl:template name="refine_related-block-style">
4667
+ </xsl:template>
4668
+
4482
4669
  <xsl:attribute-set name="definition-style">
4483
4670
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
4484
4671
  <xsl:attribute name="space-before">12pt</xsl:attribute>
4485
4672
  <xsl:attribute name="space-after">6pt</xsl:attribute>
4486
4673
  </xsl:attribute-set> <!-- definition-style -->
4487
4674
 
4675
+ <xsl:template name="refine_definition-style">
4676
+ </xsl:template>
4677
+
4488
4678
  <xsl:attribute-set name="termsource-style">
4489
4679
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
4490
4680
  </xsl:attribute-set> <!-- termsource-style -->
@@ -4496,9 +4686,15 @@
4496
4686
  <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
4497
4687
  </xsl:attribute-set> <!-- termsource-text-style -->
4498
4688
 
4689
+ <xsl:template name="refine_termsource-text-style">
4690
+ </xsl:template>
4691
+
4499
4692
  <xsl:attribute-set name="origin-style">
4500
4693
  </xsl:attribute-set> <!-- origin-style -->
4501
4694
 
4695
+ <xsl:template name="refine_origin-style">
4696
+ </xsl:template>
4697
+
4502
4698
  <!-- ====== -->
4503
4699
  <!-- term -->
4504
4700
  <!-- ====== -->
@@ -4514,9 +4710,8 @@
4514
4710
  <xsl:template match="mn:term">
4515
4711
  <xsl:call-template name="setNamedDestination"/>
4516
4712
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
4713
+ <xsl:call-template name="refine_term-style"/>
4517
4714
 
4518
- <xsl:if test="parent::mn:term and not(preceding-sibling::mn:term)">
4519
- </xsl:if>
4520
4715
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
4521
4716
  </fo:block>
4522
4717
  </xsl:template>
@@ -4592,6 +4787,7 @@
4592
4787
  <!-- text SOURCE: -->
4593
4788
  <xsl:template match="mn:fmt-termsource/mn:strong[1][following-sibling::*[1][self::mn:fmt-origin]]/text()">
4594
4789
  <fo:inline xsl:use-attribute-sets="termsource-text-style">
4790
+ <xsl:call-template name="refine_termsource-text-style"/>
4595
4791
  <xsl:value-of select="."/>
4596
4792
  </fo:inline>
4597
4793
  </xsl:template>
@@ -4604,6 +4800,7 @@
4604
4800
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
4605
4801
  </xsl:if>
4606
4802
  <fo:inline xsl:use-attribute-sets="origin-style">
4803
+ <xsl:call-template name="refine_origin-style"/>
4607
4804
  <xsl:apply-templates/>
4608
4805
  </fo:inline>
4609
4806
  </fo:basic-link>
@@ -4653,9 +4850,12 @@
4653
4850
  </xsl:variable>
4654
4851
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
4655
4852
 
4853
+ <xsl:call-template name="refine_preferred-block-style"/>
4854
+
4656
4855
  <xsl:if test="parent::mn:term and not(preceding-sibling::mn:fmt-preferred)"> <!-- if first preffered in term, then display term's name -->
4657
4856
 
4658
4857
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
4858
+ <xsl:call-template name="refine_term-name-style"/>
4659
4859
 
4660
4860
  <xsl:for-each select="ancestor::mn:term[1]/mn:fmt-name"><!-- change context -->
4661
4861
  <xsl:call-template name="setIDforNamedDestination"/>
@@ -4666,7 +4866,7 @@
4666
4866
  </xsl:if>
4667
4867
 
4668
4868
  <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
4669
- <xsl:call-template name="setStyle_preferred"/>
4869
+ <xsl:call-template name="refine_preferred-term-style"/>
4670
4870
 
4671
4871
  <xsl:apply-templates/>
4672
4872
  </fo:block>
@@ -4687,22 +4887,18 @@
4687
4887
 
4688
4888
  <xsl:template match="mn:fmt-admitted">
4689
4889
  <fo:block xsl:use-attribute-sets="admitted-style">
4890
+ <xsl:call-template name="refine_admitted-style"/>
4690
4891
  <xsl:apply-templates/>
4691
4892
  </fo:block>
4692
4893
  </xsl:template>
4693
4894
 
4694
4895
  <xsl:template match="mn:fmt-deprecates">
4695
4896
  <fo:block xsl:use-attribute-sets="deprecates-style">
4897
+ <xsl:call-template name="refine_deprecates-style"/>
4696
4898
  <xsl:apply-templates/>
4697
4899
  </fo:block>
4698
4900
  </xsl:template>
4699
4901
 
4700
- <xsl:template name="setStyle_preferred">
4701
- <xsl:attribute name="font-weight">normal</xsl:attribute>
4702
- <xsl:attribute name="color">black</xsl:attribute>
4703
-
4704
- </xsl:template>
4705
-
4706
4902
  <!-- regarding ISO 10241-1:2011, If there is more than one preferred term, each preferred term follows the previous one on a new line. -->
4707
4903
  <!-- in metanorma xml preferred terms delimited by semicolons -->
4708
4904
  <xsl:template match="mn:fmt-preferred/text()[contains(., ';')] | mn:fmt-preferred/mn:strong/text()[contains(., ';')]">
@@ -4712,6 +4908,7 @@
4712
4908
 
4713
4909
  <xsl:template match="mn:fmt-related">
4714
4910
  <fo:block role="SKIP" xsl:use-attribute-sets="related-block-style">
4911
+ <xsl:call-template name="refine_related-block-style"/>
4715
4912
  <xsl:apply-templates/>
4716
4913
  </fo:block>
4717
4914
  </xsl:template>
@@ -4726,6 +4923,7 @@
4726
4923
  <!-- ========== -->
4727
4924
  <xsl:template match="mn:fmt-definition">
4728
4925
  <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
4926
+ <xsl:call-template name="refine_definition-style"/>
4729
4927
  <xsl:apply-templates/>
4730
4928
  </fo:block>
4731
4929
  </xsl:template>
@@ -4779,6 +4977,9 @@
4779
4977
  <xsl:attribute-set name="example-body-style">
4780
4978
  </xsl:attribute-set> <!-- example-body-style -->
4781
4979
 
4980
+ <xsl:template name="refine_example-body-style">
4981
+ </xsl:template>
4982
+
4782
4983
  <xsl:attribute-set name="example-name-style">
4783
4984
  <xsl:attribute name="font-weight">bold</xsl:attribute>
4784
4985
  <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
@@ -4827,6 +5028,8 @@
4827
5028
  <xsl:when test="contains($element, 'block')">
4828
5029
  <fo:block xsl:use-attribute-sets="example-p-style">
4829
5030
 
5031
+ <xsl:call-template name="refine_example-p-style"/>
5032
+
4830
5033
  <xsl:apply-templates/>
4831
5034
  </fo:block>
4832
5035
  </xsl:when>
@@ -4878,6 +5081,7 @@
4878
5081
  </fo:block>
4879
5082
 
4880
5083
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
5084
+ <xsl:call-template name="refine_example-body-style"/>
4881
5085
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
4882
5086
  <xsl:variable name="example_body">
4883
5087
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]">
@@ -4940,6 +5144,7 @@
4940
5144
  <xsl:if test="*[not(self::mn:fmt-name)][position() &gt; 1]">
4941
5145
  <!-- display further elements in blocks -->
4942
5146
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
5147
+ <xsl:call-template name="refine_example-body-style"/>
4943
5148
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
4944
5149
  <xsl:apply-templates select="*[not(self::mn:fmt-name)][position() &gt; 1]">
4945
5150
  <xsl:with-param name="fo_element" select="'block'"/>
@@ -5186,6 +5391,9 @@
5186
5391
  <!-- <xsl:attribute name="padding-right">5mm</xsl:attribute> -->
5187
5392
  </xsl:attribute-set> <!-- table-fn-number-style -->
5188
5393
 
5394
+ <xsl:template name="refine_table-fn-number-style">
5395
+ </xsl:template>
5396
+
5189
5397
  <xsl:attribute-set name="table-fmt-fn-label-style">
5190
5398
  <xsl:attribute name="font-size">80%</xsl:attribute>
5191
5399
  </xsl:attribute-set> <!-- table-fmt-fn-label-style -->
@@ -5193,30 +5401,12 @@
5193
5401
  <xsl:template name="refine_table-fmt-fn-label-style">
5194
5402
  </xsl:template>
5195
5403
 
5196
- <xsl:attribute-set name="fn-container-body-style">
5197
- <xsl:attribute name="text-indent">0</xsl:attribute>
5198
- <xsl:attribute name="start-indent">0</xsl:attribute>
5199
- </xsl:attribute-set>
5200
-
5201
5404
  <xsl:attribute-set name="table-fn-body-style">
5202
5405
  </xsl:attribute-set>
5203
5406
 
5204
- <xsl:attribute-set name="figure-fn-number-style">
5205
- <xsl:attribute name="padding-right">5mm</xsl:attribute>
5206
- </xsl:attribute-set> <!-- figure-fn-number-style -->
5207
-
5208
- <xsl:attribute-set name="figure-fmt-fn-label-style">
5209
- <xsl:attribute name="font-size">80%</xsl:attribute>
5210
- <xsl:attribute name="vertical-align">super</xsl:attribute>
5211
- </xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
5212
-
5213
- <xsl:template name="refine_figure-fmt-fn-label-style">
5407
+ <xsl:template name="refine_table-fn-body-style">
5214
5408
  </xsl:template>
5215
5409
 
5216
- <xsl:attribute-set name="figure-fn-body-style">
5217
- <xsl:attribute name="text-align">justify</xsl:attribute>
5218
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
5219
- </xsl:attribute-set>
5220
5410
  <!-- ========================== -->
5221
5411
  <!-- END Table styles -->
5222
5412
  <!-- ========================== -->
@@ -6493,6 +6683,7 @@
6493
6683
  </xsl:apply-templates>
6494
6684
 
6495
6685
  <fo:inline xsl:use-attribute-sets="table-fn-body-style">
6686
+ <xsl:call-template name="refine_table-fn-body-style"/>
6496
6687
  <!-- <xsl:copy-of select="./node()"/> -->
6497
6688
  <xsl:apply-templates/>
6498
6689
  </fo:inline>
@@ -6511,6 +6702,7 @@
6511
6702
  <xsl:param name="process">false</xsl:param>
6512
6703
  <xsl:if test="$process = 'true'">
6513
6704
  <fo:inline xsl:use-attribute-sets="table-fn-number-style" role="SKIP">
6705
+ <xsl:call-template name="refine_table-fn-number-style"/>
6514
6706
 
6515
6707
  <!-- tab is padding-right -->
6516
6708
  <xsl:apply-templates select=".//mn:tab">
@@ -7382,10 +7574,19 @@
7382
7574
  <xsl:attribute-set name="dl-block-style">
7383
7575
  </xsl:attribute-set>
7384
7576
 
7577
+ <xsl:template name="refine_dl-block-style">
7578
+ <xsl:if test="@key = 'true' and ancestor::mn:figure">
7579
+ <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
7580
+ </xsl:if>
7581
+ </xsl:template>
7582
+
7385
7583
  <xsl:attribute-set name="dt-row-style">
7386
7584
  <xsl:attribute name="min-height">7mm</xsl:attribute>
7387
7585
  </xsl:attribute-set>
7388
7586
 
7587
+ <xsl:template name="refine_dt-row-style">
7588
+ </xsl:template>
7589
+
7389
7590
  <xsl:attribute-set name="dt-cell-style">
7390
7591
  </xsl:attribute-set>
7391
7592
 
@@ -7408,6 +7609,9 @@
7408
7609
  <xsl:attribute name="color">black</xsl:attribute>
7409
7610
  </xsl:attribute-set> <!-- dl-name-style -->
7410
7611
 
7612
+ <xsl:template name="refine_dl-name-style">
7613
+ </xsl:template>
7614
+
7411
7615
  <xsl:attribute-set name="dd-cell-style">
7412
7616
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
7413
7617
  </xsl:attribute-set>
@@ -7446,9 +7650,7 @@
7446
7650
  <!-- <dl><xsl:copy-of select="."/></dl> -->
7447
7651
  <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
7448
7652
 
7449
- <xsl:if test="@key = 'true' and ancestor::mn:figure">
7450
- <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
7451
- </xsl:if>
7653
+ <xsl:call-template name="refine_dl-block-style"/>
7452
7654
 
7453
7655
  <xsl:call-template name="setBlockSpanAll"/>
7454
7656
  <xsl:if test="not(ancestor::mn:quote)">
@@ -7744,6 +7946,8 @@
7744
7946
  <xsl:if test="$process = 'true'">
7745
7947
  <fo:block xsl:use-attribute-sets="dl-name-style">
7746
7948
 
7949
+ <xsl:call-template name="refine_dl-name-style"/>
7950
+
7747
7951
  <xsl:apply-templates/>
7748
7952
  </fo:block>
7749
7953
  </xsl:if>
@@ -7932,6 +8136,8 @@
7932
8136
  <xsl:param name="split_keep-within-line"/>
7933
8137
 
7934
8138
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
8139
+ <xsl:call-template name="refine_dt-row-style"/>
8140
+
7935
8141
  <xsl:call-template name="insert_dt_cell">
7936
8142
  <xsl:with-param name="key_iso" select="$key_iso"/>
7937
8143
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -8146,18 +8352,25 @@
8146
8352
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
8147
8353
  </xsl:attribute-set>
8148
8354
 
8355
+ <xsl:template name="refine_appendix-style">
8356
+ </xsl:template>
8357
+
8149
8358
  <xsl:attribute-set name="appendix-example-style">
8150
8359
  <xsl:attribute name="font-weight">normal</xsl:attribute>
8151
8360
  <xsl:attribute name="color">black</xsl:attribute>
8152
8361
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
8153
8362
  </xsl:attribute-set>
8154
8363
 
8364
+ <xsl:template name="refine_appendix-example-style">
8365
+ </xsl:template>
8366
+
8155
8367
  <!-- ======================== -->
8156
8368
  <!-- Appendix processing -->
8157
8369
  <!-- ======================== -->
8158
8370
  <xsl:template match="mn:appendix">
8159
8371
  <xsl:call-template name="setNamedDestination"/>
8160
8372
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
8373
+ <xsl:call-template name="refine_appendix-style"/>
8161
8374
  <xsl:apply-templates select="mn:fmt-title"/>
8162
8375
  </fo:block>
8163
8376
  <xsl:apply-templates select="node()[not(self::mn:fmt-title)]"/>
@@ -8176,13 +8389,23 @@
8176
8389
  <xsl:template match="mn:appendix//mn:example" priority="2">
8177
8390
  <xsl:call-template name="setNamedDestination"/>
8178
8391
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
8392
+ <xsl:call-template name="refine_appendix-example-style"/>
8179
8393
  <xsl:apply-templates select="mn:fmt-name"/>
8180
8394
  </fo:block>
8181
8395
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
8182
8396
  </xsl:template>
8183
8397
 
8184
8398
  <xsl:attribute-set name="xref-style">
8185
- </xsl:attribute-set>
8399
+ </xsl:attribute-set> <!-- xref-style -->
8400
+
8401
+ <xsl:template name="refine_xref-style">
8402
+ <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])">
8403
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
8404
+ </xsl:if>
8405
+ <xsl:if test="parent::mn:add">
8406
+ <xsl:call-template name="append_add-style"/>
8407
+ </xsl:if>
8408
+ </xsl:template> <!-- refine_xref-style -->
8186
8409
 
8187
8410
  <xsl:template match="mn:fmt-xref">
8188
8411
  <xsl:call-template name="insert_basic_link">
@@ -8191,12 +8414,8 @@
8191
8414
  <xsl:call-template name="getAltText"/>
8192
8415
  </xsl:variable>
8193
8416
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
8194
- <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])">
8195
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
8196
- </xsl:if>
8197
- <xsl:if test="parent::mn:add">
8198
- <xsl:call-template name="append_add-style"/>
8199
- </xsl:if>
8417
+ <xsl:call-template name="refine_xref-style"/>
8418
+
8200
8419
  <xsl:apply-templates/>
8201
8420
  </fo:basic-link>
8202
8421
  </xsl:with-param>
@@ -8305,14 +8524,14 @@
8305
8524
  <xsl:attribute-set name="note-style">
8306
8525
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
8307
8526
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
8308
- </xsl:attribute-set>
8527
+ </xsl:attribute-set> <!-- note-style -->
8309
8528
 
8310
8529
  <xsl:template name="refine_note-style">
8311
8530
  <xsl:if test="ancestor::mn:ul or ancestor::mn:ol and not(ancestor::mn:note[1]/following-sibling::*)">
8312
8531
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
8313
8532
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
8314
8533
  </xsl:if>
8315
- </xsl:template>
8534
+ </xsl:template> <!-- refine_note-style -->
8316
8535
 
8317
8536
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
8318
8537
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
@@ -8321,7 +8540,7 @@
8321
8540
  <xsl:attribute name="font-weight">bold</xsl:attribute>
8322
8541
  <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
8323
8542
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
8324
- </xsl:attribute-set>
8543
+ </xsl:attribute-set> <!-- note-name-style -->
8325
8544
 
8326
8545
  <xsl:template name="refine_note-name-style">
8327
8546
  </xsl:template> <!-- refine_note-name-style -->
@@ -8338,11 +8557,14 @@
8338
8557
  <xsl:attribute-set name="note-p-style">
8339
8558
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
8340
8559
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
8341
- </xsl:attribute-set>
8560
+ </xsl:attribute-set> <!-- note-p-style -->
8561
+
8562
+ <xsl:template name="refine_note-p-style">
8563
+ </xsl:template>
8342
8564
 
8343
8565
  <xsl:attribute-set name="termnote-style">
8344
8566
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
8345
- </xsl:attribute-set>
8567
+ </xsl:attribute-set> <!-- termnote-style -->
8346
8568
 
8347
8569
  <xsl:template name="refine_termnote-style">
8348
8570
  </xsl:template> <!-- refine_termnote-style -->
@@ -8351,7 +8573,7 @@
8351
8573
  <xsl:attribute name="font-weight">bold</xsl:attribute>
8352
8574
  <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
8353
8575
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
8354
- </xsl:attribute-set>
8576
+ </xsl:attribute-set> <!-- termnote-name-style -->
8355
8577
 
8356
8578
  <xsl:template name="refine_termnote-name-style">
8357
8579
  </xsl:template>
@@ -8359,6 +8581,9 @@
8359
8581
  <xsl:attribute-set name="termnote-p-style">
8360
8582
  </xsl:attribute-set>
8361
8583
 
8584
+ <xsl:template name="refine_termnote-p-style">
8585
+ </xsl:template>
8586
+
8362
8587
  <!-- ====== -->
8363
8588
  <!-- note -->
8364
8589
  <!-- termnote -->
@@ -8419,11 +8644,13 @@
8419
8644
  <xsl:choose>
8420
8645
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
8421
8646
  <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
8647
+ <xsl:call-template name="refine_note-p-style"/>
8422
8648
  <xsl:apply-templates/>
8423
8649
  </fo:inline>
8424
8650
  </xsl:when>
8425
8651
  <xsl:otherwise>
8426
8652
  <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
8653
+ <xsl:call-template name="refine_note-p-style"/>
8427
8654
  <xsl:apply-templates/>
8428
8655
  </fo:block>
8429
8656
  </xsl:otherwise>
@@ -8515,11 +8742,13 @@
8515
8742
  <xsl:choose>
8516
8743
  <xsl:when test="$num = 1"> <!-- first paragraph renders in the same line as titlenote name -->
8517
8744
  <fo:inline xsl:use-attribute-sets="termnote-p-style">
8745
+ <xsl:call-template name="refine_termnote-p-style"/>
8518
8746
  <xsl:apply-templates/>
8519
8747
  </fo:inline>
8520
8748
  </xsl:when>
8521
8749
  <xsl:otherwise>
8522
8750
  <fo:block xsl:use-attribute-sets="termnote-p-style">
8751
+ <xsl:call-template name="refine_termnote-p-style"/>
8523
8752
  <xsl:apply-templates/>
8524
8753
  </fo:block>
8525
8754
  </xsl:otherwise>
@@ -8534,7 +8763,7 @@
8534
8763
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
8535
8764
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
8536
8765
  <xsl:attribute name="margin-left">13mm</xsl:attribute>
8537
- </xsl:attribute-set>
8766
+ </xsl:attribute-set> <!-- quote-style -->
8538
8767
 
8539
8768
  <xsl:template name="refine_quote-style">
8540
8769
  </xsl:template>
@@ -8544,6 +8773,9 @@
8544
8773
  <xsl:attribute name="margin-right">25mm</xsl:attribute>
8545
8774
  </xsl:attribute-set>
8546
8775
 
8776
+ <xsl:template name="refine_quote-source-style">
8777
+ </xsl:template>
8778
+
8547
8779
  <!-- ====== -->
8548
8780
  <!-- quote -->
8549
8781
  <!-- source -->
@@ -8572,6 +8804,7 @@
8572
8804
  </fo:block-container>
8573
8805
  <xsl:if test="mn:author or mn:fmt-source or mn:attribution">
8574
8806
  <fo:block xsl:use-attribute-sets="quote-source-style">
8807
+ <xsl:call-template name="refine_quote-source-style"/>
8575
8808
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
8576
8809
  <xsl:apply-templates select="mn:author"/>
8577
8810
  <xsl:apply-templates select="mn:fmt-source"/>
@@ -8641,6 +8874,9 @@
8641
8874
  <xsl:attribute name="margin-bottom">3mm</xsl:attribute>
8642
8875
  </xsl:attribute-set>
8643
8876
 
8877
+ <xsl:template name="refine_figure-style">
8878
+ </xsl:template>
8879
+
8644
8880
  <xsl:attribute-set name="figure-name-style">
8645
8881
  <xsl:attribute name="role">Caption</xsl:attribute>
8646
8882
  <xsl:attribute name="font-size">13pt</xsl:attribute>
@@ -8650,7 +8886,7 @@
8650
8886
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
8651
8887
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
8652
8888
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
8653
- </xsl:attribute-set>
8889
+ </xsl:attribute-set> <!-- figure-name-style -->
8654
8890
 
8655
8891
  <xsl:template name="refine_figure-name-style">
8656
8892
  </xsl:template> <!-- refine_figure-name-style -->
@@ -8658,7 +8894,7 @@
8658
8894
  <xsl:attribute-set name="image-style">
8659
8895
  <xsl:attribute name="role">SKIP</xsl:attribute>
8660
8896
  <xsl:attribute name="text-align">center</xsl:attribute>
8661
- </xsl:attribute-set>
8897
+ </xsl:attribute-set> <!-- image-style -->
8662
8898
 
8663
8899
  <xsl:template name="refine_image-style">
8664
8900
  </xsl:template>
@@ -8668,14 +8904,51 @@
8668
8904
  <xsl:attribute name="content-height">100%</xsl:attribute>
8669
8905
  <xsl:attribute name="scaling">uniform</xsl:attribute>
8670
8906
  <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
8671
- </xsl:attribute-set>
8907
+ </xsl:attribute-set> <!-- image-graphic-style -->
8908
+
8909
+ <xsl:template name="refine_image-graphic-style">
8910
+ </xsl:template>
8672
8911
 
8673
8912
  <xsl:attribute-set name="figure-source-style">
8674
8913
  </xsl:attribute-set>
8675
8914
 
8915
+ <xsl:template name="refine_figure-source-style">
8916
+ </xsl:template>
8917
+
8676
8918
  <xsl:attribute-set name="figure-pseudocode-p-style">
8677
8919
  </xsl:attribute-set>
8678
8920
 
8921
+ <xsl:template name="refine_figure-pseudocode-p-style">
8922
+ </xsl:template>
8923
+
8924
+ <xsl:attribute-set name="figure-fn-number-style">
8925
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
8926
+ </xsl:attribute-set> <!-- figure-fn-number-style -->
8927
+
8928
+ <xsl:template name="refine_figure-fn-number-style">
8929
+ </xsl:template>
8930
+
8931
+ <xsl:attribute-set name="figure-fmt-fn-label-style">
8932
+ <xsl:attribute name="font-size">80%</xsl:attribute>
8933
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
8934
+ </xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
8935
+
8936
+ <xsl:template name="refine_figure-fmt-fn-label-style">
8937
+ </xsl:template>
8938
+
8939
+ <xsl:attribute-set name="figure-fn-body-style">
8940
+ <xsl:attribute name="text-align">justify</xsl:attribute>
8941
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
8942
+ </xsl:attribute-set>
8943
+
8944
+ <xsl:template name="refine_figure-fn-body-style">
8945
+ <xsl:variable name="key_iso">
8946
+ </xsl:variable>
8947
+ <xsl:if test="normalize-space($key_iso) = 'true'">
8948
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
8949
+ </xsl:if>
8950
+ </xsl:template>
8951
+
8679
8952
  <!-- ============================ -->
8680
8953
  <!-- figure's footnotes rendering -->
8681
8954
  <!-- ============================ -->
@@ -8788,9 +9061,8 @@
8788
9061
  </fo:table-cell>
8789
9062
  <fo:table-cell>
8790
9063
  <fo:block xsl:use-attribute-sets="figure-fn-body-style">
8791
- <xsl:if test="normalize-space($key_iso) = 'true'">
8792
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
8793
- </xsl:if>
9064
+ <xsl:call-template name="refine_figure-fn-body-style"/>
9065
+
8794
9066
  <!-- <xsl:copy-of select="./node()"/> -->
8795
9067
  <xsl:apply-templates/>
8796
9068
  </fo:block>
@@ -8808,6 +9080,7 @@
8808
9080
  <xsl:param name="process">false</xsl:param>
8809
9081
  <xsl:if test="$process = 'true'">
8810
9082
  <fo:inline xsl:use-attribute-sets="figure-fn-number-style" role="SKIP">
9083
+ <xsl:call-template name="refine_figure-fn-number-style"/>
8811
9084
  <xsl:attribute name="padding-right">0mm</xsl:attribute>
8812
9085
 
8813
9086
  <!-- tab is padding-right -->
@@ -8845,6 +9118,7 @@
8845
9118
  <xsl:attribute name="font-size">10pt</xsl:attribute>
8846
9119
  </xsl:if>
8847
9120
  <fo:inline xsl:use-attribute-sets="figure-fn-number-style figure-fmt-fn-label-style"> <!-- id="{@id}" -->
9121
+ <xsl:call-template name="refine_figure-fn-number-style"/>
8848
9122
  <!-- <xsl:value-of select="@reference"/> -->
8849
9123
  <xsl:apply-templates/>
8850
9124
  </fo:inline>
@@ -8893,6 +9167,8 @@
8893
9167
 
8894
9168
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
8895
9169
 
9170
+ <xsl:call-template name="refine_figure-style"/>
9171
+
8896
9172
  <xsl:for-each select="mn:fmt-name"> <!-- set context -->
8897
9173
  <xsl:call-template name="setIDforNamedDestination"/>
8898
9174
  </xsl:for-each>
@@ -8935,6 +9211,7 @@
8935
9211
 
8936
9212
  <xsl:template match="mn:figure[@class = 'pseudocode']//mn:p">
8937
9213
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
9214
+ <xsl:call-template name="refine_figure-pseudocode-p-style"/>
8938
9215
  <xsl:apply-templates/>
8939
9216
  </fo:block>
8940
9217
  </xsl:template>
@@ -9064,6 +9341,8 @@
9064
9341
  </xsl:variable>
9065
9342
  <xsl:copy-of select="xalan:nodeset($image-graphic-style_attributes)/attributes/@*"/>
9066
9343
 
9344
+ <xsl:call-template name="refine_image-graphic-style"/>
9345
+
9067
9346
  <xsl:if test="not(@mimetype = 'image/svg+xml') and not(ancestor::mn:table)">
9068
9347
  <xsl:variable name="scale">
9069
9348
  <xsl:call-template name="getImageScale">
@@ -9763,6 +10042,9 @@
9763
10042
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
9764
10043
  </xsl:attribute-set> <!-- formula-style -->
9765
10044
 
10045
+ <xsl:template name="refine_formula-style">
10046
+ </xsl:template>
10047
+
9766
10048
  <xsl:attribute-set name="formula-stem-block-style">
9767
10049
  <xsl:attribute name="text-align">center</xsl:attribute>
9768
10050
  <xsl:attribute name="text-align">left</xsl:attribute>
@@ -9833,6 +10115,8 @@
9833
10115
  <xsl:template match="mn:formula[mn:fmt-name]/mn:fmt-stem">
9834
10116
  <fo:block xsl:use-attribute-sets="formula-style">
9835
10117
 
10118
+ <xsl:call-template name="refine_formula-style"/>
10119
+
9836
10120
  <fo:table table-layout="fixed" width="100%">
9837
10121
  <fo:table-column column-width="95%"/>
9838
10122
  <fo:table-column column-width="5%"/>
@@ -10253,6 +10537,9 @@
10253
10537
  <xsl:attribute name="color">black</xsl:attribute>
10254
10538
  </xsl:attribute-set> <!-- list-name-style -->
10255
10539
 
10540
+ <xsl:template name="refine_list-name-style">
10541
+ </xsl:template>
10542
+
10256
10543
  <xsl:attribute-set name="list-item-style">
10257
10544
  <xsl:attribute name="space-after">4pt</xsl:attribute>
10258
10545
  </xsl:attribute-set>
@@ -10555,6 +10842,7 @@
10555
10842
  <xsl:param name="process">false</xsl:param>
10556
10843
  <xsl:if test="$process = 'true'">
10557
10844
  <fo:block xsl:use-attribute-sets="list-name-style">
10845
+ <xsl:call-template name="refine_list-name-style"/>
10558
10846
  <xsl:apply-templates/>
10559
10847
  </fo:block>
10560
10848
  </xsl:if>
@@ -10615,27 +10903,48 @@
10615
10903
  <!-- END Lists processing -->
10616
10904
  <!-- ===================================== -->
10617
10905
 
10906
+ <xsl:attribute-set name="footnote-separator-leader-style">
10907
+ </xsl:attribute-set>
10908
+
10909
+ <xsl:template name="refine_footnote-separator-leader-style">
10910
+ </xsl:template>
10911
+
10912
+ <xsl:attribute-set name="fn-container-body-style">
10913
+ <xsl:attribute name="text-indent">0</xsl:attribute>
10914
+ <xsl:attribute name="start-indent">0</xsl:attribute>
10915
+ </xsl:attribute-set>
10916
+
10917
+ <xsl:template name="refine_fn-container-body-style">
10918
+ </xsl:template>
10919
+
10618
10920
  <xsl:attribute-set name="fn-reference-style">
10619
10921
  <xsl:attribute name="font-size">80%</xsl:attribute>
10620
10922
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
10621
10923
  <xsl:attribute name="font-size">70%</xsl:attribute>
10622
10924
  <xsl:attribute name="vertical-align">super</xsl:attribute>
10623
10925
  <xsl:attribute name="font-style">italic</xsl:attribute>
10624
-
10625
- </xsl:attribute-set>
10926
+ </xsl:attribute-set> <!-- fn-reference-style -->
10626
10927
 
10627
10928
  <xsl:template name="refine_fn-reference-style">
10929
+ <!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
10930
+ <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">,</xsl:if>
10628
10931
  </xsl:template> <!-- refine_fn-reference-style -->
10629
10932
 
10630
10933
  <xsl:attribute-set name="fn-style">
10631
10934
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
10632
10935
  </xsl:attribute-set>
10633
10936
 
10937
+ <xsl:template name="refine_fn-style">
10938
+ </xsl:template>
10939
+
10634
10940
  <xsl:attribute-set name="fn-num-style">
10635
10941
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
10636
10942
  <xsl:attribute name="font-size">65%</xsl:attribute>
10637
10943
  <xsl:attribute name="vertical-align">super</xsl:attribute>
10638
- </xsl:attribute-set>
10944
+ </xsl:attribute-set> <!-- fn-num-style -->
10945
+
10946
+ <xsl:template name="refine_fn-num-style">
10947
+ </xsl:template>
10639
10948
 
10640
10949
  <xsl:attribute-set name="fn-body-style">
10641
10950
  <xsl:attribute name="font-weight">normal</xsl:attribute>
@@ -10646,7 +10955,7 @@
10646
10955
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10647
10956
  <xsl:attribute name="color">rgb(168, 170, 173)</xsl:attribute>
10648
10957
  <xsl:attribute name="text-align">left</xsl:attribute>
10649
- </xsl:attribute-set>
10958
+ </xsl:attribute-set> <!-- fn-body-style" -->
10650
10959
 
10651
10960
  <xsl:template name="refine_fn-body-style">
10652
10961
  </xsl:template> <!-- refine_fn-body-style -->
@@ -10710,10 +11019,12 @@
10710
11019
  <xsl:choose>
10711
11020
  <xsl:when test="ancestor::mn:bibitem">
10712
11021
  <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
11022
+ <xsl:call-template name="refine_bibitem-note-fn-style"/>
10713
11023
  </fn_styles>
10714
11024
  </xsl:when>
10715
11025
  <xsl:otherwise>
10716
11026
  <fn_styles xsl:use-attribute-sets="fn-num-style">
11027
+ <xsl:call-template name="refine_fn-num-style"/>
10717
11028
  </fn_styles>
10718
11029
  </xsl:otherwise>
10719
11030
  </xsl:choose>
@@ -10723,9 +11034,12 @@
10723
11034
  <xsl:copy-of select="."/>
10724
11035
  </xsl:for-each>
10725
11036
 
10726
- <xsl:if test="following-sibling::node()[normalize-space() != ''][1][self::mn:fn]">
11037
+ <!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
11038
+ <!-- <xsl:if test="following-sibling::node()[normalize-space() != ''][1][self::mn:fn]">
10727
11039
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
10728
- </xsl:if>
11040
+ </xsl:if> -->
11041
+
11042
+ <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">,</xsl:if>
10729
11043
 
10730
11044
  <xsl:call-template name="insert_basic_link">
10731
11045
  <xsl:with-param name="element">
@@ -10748,10 +11062,12 @@
10748
11062
  <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
10749
11063
 
10750
11064
  <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
11065
+ <xsl:call-template name="refine_fn-style"/>
10751
11066
  <xsl:copy-of select="$footnote_inline"/>
10752
11067
  <fo:footnote-body role="Note">
10753
11068
 
10754
11069
  <fo:block-container xsl:use-attribute-sets="fn-container-body-style" role="SKIP">
11070
+ <xsl:call-template name="refine_fn-container-body-style"/>
10755
11071
 
10756
11072
  <xsl:variable name="fn_block">
10757
11073
  <xsl:call-template name="refine_fn-body-style"/>
@@ -10853,6 +11169,9 @@
10853
11169
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10854
11170
  </xsl:attribute-set> <!-- admonition-style -->
10855
11171
 
11172
+ <xsl:template name="refine_admonition-style">
11173
+ </xsl:template>
11174
+
10856
11175
  <xsl:attribute-set name="admonition-container-style">
10857
11176
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
10858
11177
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -10860,6 +11179,9 @@
10860
11179
  <xsl:attribute name="padding-top">3mm</xsl:attribute>
10861
11180
  </xsl:attribute-set> <!-- admonition-container-style -->
10862
11181
 
11182
+ <xsl:template name="refine_admonition-container-style">
11183
+ </xsl:template>
11184
+
10863
11185
  <xsl:attribute-set name="admonition-name-style">
10864
11186
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
10865
11187
  <xsl:attribute name="font-size">11pt</xsl:attribute>
@@ -10869,9 +11191,16 @@
10869
11191
  <xsl:attribute name="text-align">center</xsl:attribute>
10870
11192
  </xsl:attribute-set> <!-- admonition-name-style -->
10871
11193
 
11194
+ <xsl:template name="refine_admonition-name-style">
11195
+ </xsl:template>
11196
+
10872
11197
  <xsl:attribute-set name="admonition-p-style">
10873
11198
  <xsl:attribute name="font-style">italic</xsl:attribute>
10874
11199
  </xsl:attribute-set> <!-- admonition-p-style -->
11200
+
11201
+ <xsl:template name="refine_admonition-p-style">
11202
+ </xsl:template>
11203
+
10875
11204
  <!-- end admonition -->
10876
11205
 
10877
11206
  <!-- ================ -->
@@ -10881,12 +11210,18 @@
10881
11210
  <xsl:call-template name="setNamedDestination"/>
10882
11211
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
10883
11212
 
11213
+ <xsl:call-template name="refine_admonition-style"/>
11214
+
10884
11215
  <xsl:call-template name="setBlockSpanAll"/>
10885
11216
  <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
11217
+
11218
+ <xsl:call-template name="refine_admonition-container-style"/>
10886
11219
  <fo:block xsl:use-attribute-sets="admonition-name-style">
11220
+ <xsl:call-template name="refine_admonition-name-style"/>
10887
11221
  <xsl:call-template name="displayAdmonitionName"/>
10888
11222
  </fo:block>
10889
11223
  <fo:block xsl:use-attribute-sets="admonition-p-style">
11224
+ <xsl:call-template name="refine_admonition-p-style"/>
10890
11225
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
10891
11226
  </fo:block>
10892
11227
 
@@ -10940,6 +11275,7 @@
10940
11275
 
10941
11276
  <xsl:template match="mn:admonition/mn:p">
10942
11277
  <fo:block xsl:use-attribute-sets="admonition-p-style">
11278
+ <xsl:call-template name="refine_admonition-p-style"/>
10943
11279
 
10944
11280
  <xsl:apply-templates/>
10945
11281
  </fo:block>
@@ -10949,12 +11285,22 @@
10949
11285
  <!-- END Admonition -->
10950
11286
  <!-- ================ -->
10951
11287
 
11288
+ <xsl:attribute-set name="references-non-normative-title-style">
11289
+ </xsl:attribute-set>
11290
+
11291
+ <xsl:template name="refine_references-non-normative-title-style">
11292
+
11293
+ </xsl:template>
11294
+
10952
11295
  <!-- bibitem in Normative References (references/@normative="true") -->
10953
11296
  <xsl:attribute-set name="bibitem-normative-style">
10954
11297
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10955
11298
  <xsl:attribute name="font-weight">normal</xsl:attribute>
10956
11299
  </xsl:attribute-set> <!-- bibitem-normative-style -->
10957
11300
 
11301
+ <xsl:template name="refine_bibitem-normative-style">
11302
+ </xsl:template>
11303
+
10958
11304
  <!-- bibitem in Normative References (references/@normative="true"), renders as list -->
10959
11305
  <xsl:attribute-set name="bibitem-normative-list-style">
10960
11306
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
@@ -10963,9 +11309,15 @@
10963
11309
  <xsl:attribute name="provisional-distance-between-starts">8mm</xsl:attribute>
10964
11310
  </xsl:attribute-set> <!-- bibitem-normative-list-style -->
10965
11311
 
11312
+ <xsl:template name="refine_bibitem-normative-list-style">
11313
+ </xsl:template>
11314
+
10966
11315
  <xsl:attribute-set name="bibitem-non-normative-style">
10967
11316
  </xsl:attribute-set> <!-- bibitem-non-normative-style -->
10968
11317
 
11318
+ <xsl:template name="refine_bibitem-non-normative-style">
11319
+ </xsl:template>
11320
+
10969
11321
  <!-- bibitem in bibliography section (references/@normative="false"), renders as list -->
10970
11322
  <xsl:attribute-set name="bibitem-non-normative-list-style">
10971
11323
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
@@ -10974,18 +11326,30 @@
10974
11326
  <xsl:attribute name="provisional-distance-between-starts">8mm</xsl:attribute>
10975
11327
  </xsl:attribute-set> <!-- bibitem-non-normative-list-style -->
10976
11328
 
11329
+ <xsl:template name="refine_bibitem-non-normative-list-style">
11330
+ </xsl:template>
11331
+
10977
11332
  <xsl:attribute-set name="bibitem-non-normative-list-item-style">
10978
11333
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10979
11334
  <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
10980
11335
  </xsl:attribute-set>
10981
11336
 
11337
+ <xsl:template name="refine_bibitem-non-normative-list-item-style">
11338
+ </xsl:template>
11339
+
10982
11340
  <!-- bibitem in bibliography section (references/@normative="false"), list body -->
10983
11341
  <xsl:attribute-set name="bibitem-normative-list-body-style">
10984
11342
  </xsl:attribute-set>
10985
11343
 
11344
+ <xsl:template name="refine_bibitem-normative-list-body-style">
11345
+ </xsl:template>
11346
+
10986
11347
  <xsl:attribute-set name="bibitem-non-normative-list-body-style">
10987
11348
  </xsl:attribute-set> <!-- bibitem-non-normative-list-body-style -->
10988
11349
 
11350
+ <xsl:template name="refine_bibitem-non-normative-list-body-style">
11351
+ </xsl:template>
11352
+
10989
11353
  <!-- footnote reference number for bibitem, in the text -->
10990
11354
  <xsl:attribute-set name="bibitem-note-fn-style">
10991
11355
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
@@ -10993,6 +11357,9 @@
10993
11357
  <xsl:attribute name="vertical-align">super</xsl:attribute>
10994
11358
  </xsl:attribute-set> <!-- bibitem-note-fn-style -->
10995
11359
 
11360
+ <xsl:template name="refine_bibitem-note-fn-style">
11361
+ </xsl:template>
11362
+
10996
11363
  <!-- footnote number on the page bottom -->
10997
11364
  <xsl:attribute-set name="bibitem-note-fn-number-style">
10998
11365
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
@@ -11011,6 +11378,9 @@
11011
11378
  <xsl:attribute-set name="references-non-normative-style">
11012
11379
  </xsl:attribute-set> <!-- references-non-normative-style -->
11013
11380
 
11381
+ <xsl:template name="refine_references-non-normative-style">
11382
+ </xsl:template>
11383
+
11014
11384
  <!-- ======================= -->
11015
11385
  <!-- Bibliography rendering -->
11016
11386
  <!-- ======================= -->
@@ -11052,6 +11422,7 @@
11052
11422
  <xsl:apply-templates select="mn:fmt-title[@columns = 1]"/>
11053
11423
 
11054
11424
  <fo:block xsl:use-attribute-sets="references-non-normative-style">
11425
+ <xsl:call-template name="refine_references-non-normative-style"/>
11055
11426
  <xsl:apply-templates select="node()[not(self::mn:fmt-title and @columns = 1)]"/>
11056
11427
  </fo:block>
11057
11428
  </xsl:template> <!-- references -->
@@ -11065,16 +11436,19 @@
11065
11436
  <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
11066
11437
  <xsl:call-template name="setNamedDestination"/>
11067
11438
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
11439
+ <xsl:call-template name="refine_bibitem-normative-style"/>
11440
+
11068
11441
  <xsl:call-template name="processBibitem"/>
11069
11442
  </fo:block>
11070
11443
 
11071
11444
  </xsl:template> <!-- bibitem -->
11072
11445
 
11073
11446
  <!-- Bibliography (non-normative references) -->
11074
- <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem | mn:references[not(@normative='true')]/mn:note" name="bibitem_non_normative" priority="2">
11447
+ <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem" name="bibitem_non_normative" priority="2">
11075
11448
  <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 -->
11076
11449
  <xsl:call-template name="setNamedDestination"/>
11077
11450
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
11451
+ <xsl:call-template name="refine_bibitem-non-normative-list-style"/>
11078
11452
  <fo:list-item>
11079
11453
  <fo:list-item-label end-indent="label-end()">
11080
11454
  <fo:block>
@@ -11089,8 +11463,8 @@
11089
11463
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
11090
11464
  </xsl:apply-templates>
11091
11465
  <xsl:apply-templates select="mn:formattedref"/>
11092
- <xsl:call-template name="processBibliographyNote"/>
11093
11466
  </fo:block>
11467
+ <xsl:call-template name="processBibitemFollowingNotes"/>
11094
11468
  </fo:list-item-body>
11095
11469
  </fo:list-item>
11096
11470
  </fo:list-block>
@@ -11098,12 +11472,17 @@
11098
11472
 
11099
11473
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
11100
11474
 
11475
+ <!-- bibitem's notes will be processing in 'processBibitemFollowingNotes' -->
11476
+ <xsl:template match="mn:references/mn:note" priority="2"/> <!-- [not(@normative='true')] -->
11477
+
11101
11478
  <xsl:template name="insertListItem_Bibitem">
11102
11479
  <xsl:choose>
11103
11480
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
11104
11481
  <xsl:otherwise>
11105
11482
  <xsl:call-template name="setNamedDestination"/>
11106
11483
  <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
11484
+ <xsl:call-template name="refine_bibitem-non-normative-list-item-style"/>
11485
+
11107
11486
  <fo:list-item-label end-indent="label-end()">
11108
11487
  <fo:block role="SKIP">
11109
11488
  <fo:inline role="SKIP">
@@ -11114,16 +11493,18 @@
11114
11493
  </fo:block>
11115
11494
  </fo:list-item-label>
11116
11495
  <fo:list-item-body start-indent="body-start()">
11117
- <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
11496
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style"> <!-- role="SKIP" -->
11497
+ <xsl:call-template name="refine_bibitem-non-normative-list-body-style"/>
11118
11498
  <xsl:call-template name="processBibitem">
11119
11499
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
11120
11500
  </xsl:call-template>
11121
11501
  </fo:block>
11502
+ <xsl:call-template name="processBibitemFollowingNotes"/>
11122
11503
  </fo:list-item-body>
11123
11504
  </fo:list-item>
11124
11505
  </xsl:otherwise>
11125
11506
  </xsl:choose>
11126
- <xsl:apply-templates select="following-sibling::*[1]"> <!-- [self::mn:bibitem] -->
11507
+ <xsl:apply-templates select="following-sibling::*[self::mn:bibitem][1]">
11127
11508
  <xsl:with-param name="skip">false</xsl:with-param>
11128
11509
  </xsl:apply-templates>
11129
11510
  </xsl:template>
@@ -11139,25 +11520,16 @@
11139
11520
  <xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
11140
11521
  </xsl:apply-templates>
11141
11522
  <xsl:apply-templates select="mn:formattedref"/>
11523
+ <xsl:call-template name="processBibitemFollowingNotes"/>
11142
11524
  <!-- end bibitem processing -->
11143
-
11144
- <xsl:call-template name="processBibliographyNote"/>
11145
11525
  </xsl:template> <!-- processBibitem (bibitem) -->
11146
11526
 
11147
- <xsl:template name="processBibliographyNote">
11148
- <xsl:if test="self::mn:note">
11149
- <xsl:variable name="note_node">
11150
- <xsl:element name="{local-name(..)}" namespace="{$namespace_full}"> <!-- save parent context node for determining styles -->
11151
- <xsl:copy> <!-- skip @id -->
11152
- <xsl:copy-of select="node()"/>
11153
- </xsl:copy>
11154
- </xsl:element>
11155
- </xsl:variable>
11156
- <!-- <xsl:for-each select="xalan:nodeset($note_node)//mn:note">
11157
- <xsl:call-template name="note"/>
11158
- </xsl:for-each> -->
11527
+ <xsl:template name="processBibitemFollowingNotes">
11528
+ <!-- current context is bibitem element -->
11529
+ <xsl:variable name="bibitem_id" select="@id"/>
11530
+ <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]]">
11159
11531
  <xsl:call-template name="note"/>
11160
- </xsl:if>
11532
+ </xsl:for-each>
11161
11533
  </xsl:template>
11162
11534
 
11163
11535
  <xsl:template match="mn:title" mode="title">
@@ -11357,11 +11729,17 @@
11357
11729
  <!-- Index section styles -->
11358
11730
  <xsl:attribute-set name="indexsect-title-style">
11359
11731
  <xsl:attribute name="role">H1</xsl:attribute>
11360
- </xsl:attribute-set>
11732
+ </xsl:attribute-set> <!-- indexsect-title-style -->
11733
+
11734
+ <xsl:template name="refine_indexsect-title-style">
11735
+ </xsl:template>
11361
11736
 
11362
11737
  <xsl:attribute-set name="indexsect-clause-title-style">
11363
11738
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
11364
- </xsl:attribute-set>
11739
+ </xsl:attribute-set> <!-- indexsect-clause-title-style -->
11740
+
11741
+ <xsl:template name="refine_indexsect-clause-title-style">
11742
+ </xsl:template>
11365
11743
  <!-- End Index section styles -->
11366
11744
 
11367
11745
  <!-- =================== -->
@@ -11555,6 +11933,7 @@
11555
11933
 
11556
11934
  <xsl:template match="mn:indexsect/mn:fmt-title | mn:indexsect/mn:title" priority="4">
11557
11935
  <fo:block xsl:use-attribute-sets="indexsect-title-style">
11936
+ <xsl:call-template name="refine_indexsect-title-style"/>
11558
11937
  <!-- Index -->
11559
11938
  <xsl:apply-templates/>
11560
11939
  </fo:block>
@@ -11563,6 +11942,7 @@
11563
11942
  <xsl:template match="mn:indexsect/mn:clause/mn:fmt-title | mn:indexsect/mn:clause/mn:title" priority="4">
11564
11943
  <!-- Letter A, B, C, ... -->
11565
11944
  <fo:block xsl:use-attribute-sets="indexsect-clause-title-style">
11945
+ <xsl:call-template name="refine_indexsect-clause-title-style"/>
11566
11946
  <xsl:apply-templates/>
11567
11947
  </fo:block>
11568
11948
  </xsl:template>
@@ -11605,13 +11985,31 @@
11605
11985
  <!-- skip here, see the template 'fmt-review-start' -->
11606
11986
  </xsl:when>
11607
11987
  <xsl:otherwise>
11608
- <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
11609
- <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>
11610
- <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
11611
- <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
11988
+ <xsl:choose>
11989
+ <xsl:when test="parent::mn:example or parent::mn:termexample or parent::mn:note or parent::mn:termnote">
11990
+ <fo:block font-size="1pt" line-height="0.1">
11991
+ <xsl:call-template name="fo_inline_bookmark">
11992
+ <xsl:with-param name="bookmark_id" select="$bookmark_id"/>
11993
+ </xsl:call-template>
11994
+ </fo:block>
11995
+ </xsl:when>
11996
+ <xsl:otherwise>
11997
+ <xsl:call-template name="fo_inline_bookmark">
11998
+ <xsl:with-param name="bookmark_id" select="$bookmark_id"/>
11999
+ </xsl:call-template>
12000
+ </xsl:otherwise>
12001
+ </xsl:choose>
11612
12002
  </xsl:otherwise>
11613
12003
  </xsl:choose>
11614
12004
  </xsl:template>
12005
+
12006
+ <xsl:template name="fo_inline_bookmark">
12007
+ <xsl:param name="bookmark_id"/>
12008
+ <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
12009
+ <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>
12010
+ <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
12011
+ <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
12012
+ </xsl:template>
11615
12013
  <!-- =================== -->
11616
12014
  <!-- End of Index processing -->
11617
12015
  <!-- =================== -->
@@ -11764,10 +12162,16 @@
11764
12162
  <xsl:attribute name="rule-thickness">0.2mm</xsl:attribute>
11765
12163
  </xsl:attribute-set> <!-- END: toc-leader-style -->
11766
12164
 
12165
+ <xsl:template name="refine_toc-leader-style">
12166
+ </xsl:template>
12167
+
11767
12168
  <xsl:attribute-set name="toc-pagenumber-style">
11768
12169
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
11769
12170
  </xsl:attribute-set>
11770
12171
 
12172
+ <xsl:template name="refine_toc-pagenumber-style">
12173
+ </xsl:template>
12174
+
11771
12175
  <!-- List of Figures, Tables -->
11772
12176
  <xsl:attribute-set name="toc-listof-title-style">
11773
12177
  <xsl:attribute name="font-size">13pt</xsl:attribute>
@@ -11784,6 +12188,9 @@
11784
12188
  <xsl:attribute-set name="toc-listof-item-block-style">
11785
12189
  </xsl:attribute-set>
11786
12190
 
12191
+ <xsl:template name="refine_toc-listof-item-block-style">
12192
+ </xsl:template>
12193
+
11787
12194
  <xsl:attribute-set name="toc-listof-item-style">
11788
12195
  <xsl:attribute name="role">TOCI</xsl:attribute>
11789
12196
  <xsl:attribute name="font-size">13pt</xsl:attribute>
@@ -11791,6 +12198,9 @@
11791
12198
  <xsl:attribute name="space-before">4pt</xsl:attribute>
11792
12199
  </xsl:attribute-set>
11793
12200
 
12201
+ <xsl:template name="refine_toc-listof-item-style">
12202
+ </xsl:template>
12203
+
11794
12204
  <xsl:template name="processPrefaceSectionsDefault_Contents">
11795
12205
  <xsl:variable name="nodes_preface_">
11796
12206
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
@@ -12898,23 +13308,55 @@
12898
13308
  <!-- Ruby text (CJK languages) rendering -->
12899
13309
  <!-- ===================================== -->
12900
13310
  <!-- ===================================== -->
13311
+
13312
+ <xsl:attribute-set name="ruby-style">
13313
+ <xsl:attribute name="text-indent">0mm</xsl:attribute>
13314
+ <xsl:attribute name="last-line-end-indent">0mm</xsl:attribute>
13315
+ </xsl:attribute-set>
13316
+
13317
+ <xsl:template name="refine_ruby-style">
13318
+ <xsl:if test="not(ancestor::mn:ruby)">
13319
+ <xsl:attribute name="alignment-baseline">central</xsl:attribute>
13320
+ </xsl:if>
13321
+ <xsl:variable name="rt_text" select="mn:rt"/>
13322
+ <xsl:variable name="rb_text" select=".//mn:rb[not(mn:ruby)]"/>
13323
+ <!-- Example: width="2em" -->
13324
+ <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
13325
+ <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
13326
+ <xsl:variable name="text_width">
13327
+ <xsl:choose>
13328
+ <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
13329
+ <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
13330
+ </xsl:choose>
13331
+ </xsl:variable>
13332
+ <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
13333
+ </xsl:template> <!-- refine_ruby-style -->
13334
+
13335
+ <xsl:attribute-set name="rb-style">
13336
+ <xsl:attribute name="line-height">1em</xsl:attribute>
13337
+ <xsl:attribute name="text-align">center</xsl:attribute>
13338
+ </xsl:attribute-set>
13339
+
13340
+ <xsl:template name="refine_rb-style">
13341
+ </xsl:template>
13342
+
13343
+ <xsl:attribute-set name="rt-style">
13344
+ <xsl:attribute name="font-size">0.5em</xsl:attribute>
13345
+ <xsl:attribute name="text-align">center</xsl:attribute>
13346
+ <xsl:attribute name="line-height">1.2em</xsl:attribute>
13347
+ <xsl:attribute name="space-before">-1.4em</xsl:attribute>
13348
+ <xsl:attribute name="space-before.conditionality">retain</xsl:attribute>
13349
+ </xsl:attribute-set>
13350
+
13351
+ <xsl:template name="refine_rt-style">
13352
+ <xsl:if test="ancestor::mn:ruby[last()]//mn:ruby or ancestor::mn:rb">
13353
+ <xsl:attribute name="space-before">0em</xsl:attribute>
13354
+ </xsl:if>
13355
+ </xsl:template>
13356
+
12901
13357
  <xsl:template match="mn:ruby">
12902
- <fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
12903
- <xsl:if test="not(ancestor::mn:ruby)">
12904
- <xsl:attribute name="alignment-baseline">central</xsl:attribute>
12905
- </xsl:if>
12906
- <xsl:variable name="rt_text" select="mn:rt"/>
12907
- <xsl:variable name="rb_text" select=".//mn:rb[not(mn:ruby)]"/>
12908
- <!-- Example: width="2em" -->
12909
- <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
12910
- <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
12911
- <xsl:variable name="text_width">
12912
- <xsl:choose>
12913
- <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
12914
- <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
12915
- </xsl:choose>
12916
- </xsl:variable>
12917
- <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
13358
+ <fo:inline-container xsl:use-attribute-sets="ruby-style">
13359
+ <xsl:call-template name="refine_ruby-style"/>
12918
13360
 
12919
13361
  <xsl:choose>
12920
13362
  <xsl:when test="ancestor::mn:ruby">
@@ -12932,17 +13374,14 @@
12932
13374
  </xsl:template>
12933
13375
 
12934
13376
  <xsl:template match="mn:rb">
12935
- <fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
13377
+ <fo:block xsl:use-attribute-sets="rb-style"><xsl:call-template name="refine_rb-style"/><xsl:apply-templates/></fo:block>
12936
13378
  </xsl:template>
12937
13379
 
12938
13380
  <xsl:template match="mn:rt">
12939
- <fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
12940
- <xsl:if test="ancestor::mn:ruby[last()]//mn:ruby or ancestor::mn:rb">
12941
- <xsl:attribute name="space-before">0em</xsl:attribute>
12942
- </xsl:if>
13381
+ <fo:block xsl:use-attribute-sets="rt-style"> <!-- -->
13382
+ <xsl:call-template name="refine_rt-style"/>
12943
13383
  <xsl:apply-templates/>
12944
13384
  </fo:block>
12945
-
12946
13385
  </xsl:template>
12947
13386
 
12948
13387
  <!-- ===================================== -->
@@ -12951,6 +13390,18 @@
12951
13390
  <!-- ===================================== -->
12952
13391
  <!-- ===================================== -->
12953
13392
 
13393
+ <xsl:attribute-set name="annex-title-style">
13394
+ </xsl:attribute-set>
13395
+
13396
+ <xsl:template name="refine_annex-title-style">
13397
+ </xsl:template>
13398
+
13399
+ <xsl:attribute-set name="p-zzSTDTitle1-style">
13400
+ </xsl:attribute-set>
13401
+
13402
+ <xsl:template name="refine_p-zzSTDTitle1-style">
13403
+ </xsl:template>
13404
+
12954
13405
  <xsl:template name="processPrefaceSectionsDefault">
12955
13406
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
12956
13407
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -13510,11 +13961,35 @@
13510
13961
 
13511
13962
  <xsl:template match="mn:svgmap"/>
13512
13963
 
13964
+ <xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]"/>
13965
+
13513
13966
  <!-- for correct rendering combining chars, added in mode="update_xml_step2" -->
13514
13967
  <xsl:template match="*[local-name() = 'lang_none']">
13515
13968
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
13516
13969
  </xsl:template>
13517
13970
 
13971
+ <xsl:template name="addTagElementT">
13972
+ <xsl:variable name="title_">
13973
+ <xsl:apply-templates select="mn:fmt-title"/>
13974
+ </xsl:variable>
13975
+ <xsl:variable name="title__">
13976
+ <xsl:for-each select="xalan:nodeset($title_)/*/node()">
13977
+ <xsl:choose>
13978
+ <xsl:when test="self::text()"><xsl:text> </xsl:text><xsl:value-of select="."/><xsl:text> </xsl:text></xsl:when>
13979
+ <xsl:otherwise><xsl:text> </xsl:text><xsl:copy-of select="."/><xsl:text> </xsl:text></xsl:otherwise>
13980
+ </xsl:choose>
13981
+ </xsl:for-each>
13982
+ </xsl:variable>
13983
+ <xsl:variable name="title" select="normalize-space($title__)"/>
13984
+ <xsl:if test="$title != ''">
13985
+ <xsl:attribute name="fox:title">
13986
+ <xsl:if test="ancestor::mn:sections">
13987
+ <xsl:text>Section </xsl:text>
13988
+ </xsl:if>
13989
+ <xsl:value-of select="$title"/></xsl:attribute>
13990
+ </xsl:if>
13991
+ </xsl:template>
13992
+
13518
13993
  <xsl:template name="replaceChar">
13519
13994
  <xsl:param name="text"/>
13520
13995
  <xsl:param name="replace"/>
@@ -14281,6 +14756,13 @@
14281
14756
  <xsl:with-param name="default" select="$text_align_default"/>
14282
14757
  </xsl:call-template>
14283
14758
  <xsl:call-template name="setKeepAttributes"/>
14759
+ <xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
14760
+ <xsl:variable name="styles">
14761
+ <xsl:apply-templates select="*[1]"/>
14762
+ </xsl:variable>
14763
+ <!-- move attribute line-height from inline to block -->
14764
+ <xsl:attribute name="line-height"><xsl:value-of select="xalan:nodeset($styles)//*/@line-height"/></xsl:attribute>
14765
+ </xsl:if>
14284
14766
  </xsl:template>
14285
14767
 
14286
14768
  <xsl:template name="setKeepAttributes">
@@ -14306,34 +14788,41 @@
14306
14788
  <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
14307
14789
  <fo:block>
14308
14790
  <xsl:for-each select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = $name][1]/mn:value/mn:image[$num]">
14309
- <xsl:choose>
14310
- <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
14311
- <fo:instream-foreign-object fox:alt-text="Image Front">
14312
- <xsl:attribute name="content-height"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
14313
- <xsl:call-template name="getSVG"/>
14314
- </fo:instream-foreign-object>
14315
- </xsl:when>
14316
- <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
14317
- <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
14318
- </xsl:when>
14319
- <xsl:otherwise> <!-- bitmap image -->
14320
- <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
14321
- <xsl:if test="$coverimage_src != ''">
14322
- <xsl:variable name="coverpage">
14323
- <xsl:call-template name="getImageURL">
14324
- <xsl:with-param name="src" select="$coverimage_src"/>
14325
- </xsl:call-template>
14326
- </xsl:variable>
14327
- <!-- <xsl:variable name="coverpage" select="concat('url(file:',$basepath, 'coverpage1.png', ')')"/> --> <!-- for DEBUG -->
14328
- <fo:external-graphic src="{$coverpage}" width="{$pageWidth}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
14329
- </xsl:if>
14330
- </xsl:otherwise>
14331
- </xsl:choose>
14791
+
14792
+ <xsl:call-template name="insertPageImage"/>
14793
+
14332
14794
  </xsl:for-each>
14333
14795
  </fo:block>
14334
14796
  </fo:block-container>
14335
14797
  </xsl:template>
14336
14798
 
14799
+ <xsl:template name="insertPageImage">
14800
+ <xsl:param name="svg_content_height" select="$pageHeight"/>
14801
+ <xsl:param name="bitmap_width" select="$pageWidth"/>
14802
+ <xsl:choose>
14803
+ <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
14804
+ <fo:instream-foreign-object fox:alt-text="Image Front">
14805
+ <xsl:attribute name="content-height"><xsl:value-of select="$svg_content_height"/>mm</xsl:attribute>
14806
+ <xsl:call-template name="getSVG"/>
14807
+ </fo:instream-foreign-object>
14808
+ </xsl:when>
14809
+ <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
14810
+ <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
14811
+ </xsl:when>
14812
+ <xsl:otherwise> <!-- bitmap image -->
14813
+ <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
14814
+ <xsl:if test="$coverimage_src != ''">
14815
+ <xsl:variable name="coverpage">
14816
+ <xsl:call-template name="getImageURL">
14817
+ <xsl:with-param name="src" select="$coverimage_src"/>
14818
+ </xsl:call-template>
14819
+ </xsl:variable>
14820
+ <fo:external-graphic src="{$coverpage}" width="{$bitmap_width}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
14821
+ </xsl:if>
14822
+ </xsl:otherwise>
14823
+ </xsl:choose>
14824
+ </xsl:template>
14825
+
14337
14826
  <xsl:template name="getImageURL">
14338
14827
  <xsl:param name="src"/>
14339
14828
  <xsl:choose>
@@ -14761,6 +15250,14 @@
14761
15250
  </xsl:attribute>
14762
15251
  </xsl:template>
14763
15252
 
15253
+ <xsl:template name="getCharByCodePoint">
15254
+ <xsl:param name="codepoint"/>
15255
+ <xsl:param name="radix">16</xsl:param>
15256
+ <xsl:variable name="codepointInt" select="java:java.lang.Integer.parseInt($codepoint,$radix)"/>
15257
+ <xsl:variable name="chars" select="java:java.lang.Character.toChars($codepointInt)"/>
15258
+ <xsl:value-of select="java:java.lang.String.new($chars)"/>
15259
+ </xsl:template>
15260
+
14764
15261
  <xsl:template name="substring-after-last">
14765
15262
  <xsl:param name="value"/>
14766
15263
  <xsl:param name="delimiter"/>