metanorma-cc 2.7.2 → 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.
@@ -2228,10 +2228,16 @@
2228
2228
  <xsl:attribute-set name="license-statement-style">
2229
2229
  </xsl:attribute-set> <!-- license-statement-style -->
2230
2230
 
2231
+ <xsl:template name="refine_license-statement-style">
2232
+ </xsl:template>
2233
+
2231
2234
  <xsl:attribute-set name="license-statement-title-style">
2232
2235
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2233
2236
  </xsl:attribute-set> <!-- license-statement-title-style -->
2234
2237
 
2238
+ <xsl:template name="refine_license-statement-title-style">
2239
+ </xsl:template>
2240
+
2235
2241
  <xsl:attribute-set name="license-statement-p-style">
2236
2242
  </xsl:attribute-set> <!-- license-statement-p-style -->
2237
2243
 
@@ -2242,23 +2248,47 @@
2242
2248
  <xsl:attribute-set name="legal-statement-style">
2243
2249
  </xsl:attribute-set> <!-- legal-statement-style -->
2244
2250
 
2251
+ <xsl:template name="refine_legal-statement-style">
2252
+ </xsl:template>
2253
+
2245
2254
  <xsl:attribute-set name="legal-statement-title-style">
2246
2255
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2247
2256
  </xsl:attribute-set> <!-- legal-statement-title-style -->
2248
2257
 
2258
+ <xsl:template name="refine_legal-statement-title-style">
2259
+ </xsl:template>
2260
+
2249
2261
  <xsl:attribute-set name="legal-statement-p-style">
2250
2262
  </xsl:attribute-set> <!-- legal-statement-p-style -->
2251
2263
 
2264
+ <xsl:template name="refine_legal-statement-p-style">
2265
+ <xsl:if test="@align">
2266
+ <xsl:attribute name="text-align">
2267
+ <xsl:value-of select="@align"/>
2268
+ </xsl:attribute>
2269
+ </xsl:if>
2270
+ </xsl:template>
2271
+
2252
2272
  <xsl:attribute-set name="feedback-statement-style">
2253
2273
  </xsl:attribute-set> <!-- feedback-statement-style -->
2254
2274
 
2275
+ <xsl:template name="refine_feedback-statement-style">
2276
+ </xsl:template>
2277
+
2255
2278
  <xsl:attribute-set name="feedback-statement-title-style">
2256
2279
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2257
2280
  </xsl:attribute-set> <!-- feedback-statement-title-style -->
2258
2281
 
2282
+ <xsl:template name="refine_feedback-statement-title-style">
2283
+
2284
+ </xsl:template>
2285
+
2259
2286
  <xsl:attribute-set name="feedback-statement-p-style">
2260
2287
  </xsl:attribute-set> <!-- feedback-statement-p-style -->
2261
2288
 
2289
+ <xsl:template name="refine_feedback-statement-p-style">
2290
+ </xsl:template>
2291
+
2262
2292
  <!-- End boilerplate sections styles -->
2263
2293
 
2264
2294
  <!-- ================================= -->
@@ -2284,6 +2314,7 @@
2284
2314
 
2285
2315
  <xsl:template match="mn:license-statement">
2286
2316
  <fo:block xsl:use-attribute-sets="license-statement-style">
2317
+ <xsl:call-template name="refine_license-statement-style"/>
2287
2318
  <xsl:apply-templates/>
2288
2319
  </fo:block>
2289
2320
  </xsl:template> <!-- license-statement -->
@@ -2301,6 +2332,7 @@
2301
2332
  <xsl:template match="mn:legal-statement">
2302
2333
  <xsl:param name="isLegacy">false</xsl:param>
2303
2334
  <fo:block xsl:use-attribute-sets="legal-statement-style">
2335
+ <xsl:call-template name="refine_legal-statement-style"/>
2304
2336
  <xsl:apply-templates/>
2305
2337
  </fo:block>
2306
2338
  </xsl:template> <!-- legal-statement -->
@@ -2470,6 +2502,27 @@
2470
2502
  <xsl:attribute-set name="sourcecode-container-style">
2471
2503
  </xsl:attribute-set>
2472
2504
 
2505
+ <xsl:template name="refine_sourcecode-container-style">
2506
+ <xsl:if test="not(ancestor::mn:li) or ancestor::mn:example">
2507
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2508
+ </xsl:if>
2509
+
2510
+ <xsl:if test="ancestor::mn:example">
2511
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2512
+ </xsl:if>
2513
+
2514
+ <xsl:copy-of select="@id"/>
2515
+
2516
+ <xsl:if test="parent::mn:note">
2517
+ <xsl:attribute name="margin-left">
2518
+ <xsl:choose>
2519
+ <xsl:when test="not(ancestor::mn:table)"><xsl:value-of select="$note-body-indent"/></xsl:when>
2520
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2521
+ </xsl:choose>
2522
+ </xsl:attribute>
2523
+ </xsl:if>
2524
+ </xsl:template>
2525
+
2473
2526
  <xsl:attribute-set name="sourcecode-style">
2474
2527
  <xsl:attribute name="white-space">pre</xsl:attribute>
2475
2528
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -2490,6 +2543,9 @@
2490
2543
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
2491
2544
  </xsl:attribute-set> <!-- sourcecode-name-style -->
2492
2545
 
2546
+ <xsl:template name="refine_sourcecode-name-style">
2547
+ </xsl:template>
2548
+
2493
2549
  <xsl:template name="add-zero-spaces-equal">
2494
2550
  <xsl:param name="text" select="."/>
2495
2551
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
@@ -2577,24 +2633,8 @@
2577
2633
  <xsl:otherwise>
2578
2634
  <fo:block-container xsl:use-attribute-sets="sourcecode-container-style" role="SKIP">
2579
2635
 
2580
- <xsl:if test="not(ancestor::mn:li) or ancestor::mn:example">
2581
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2582
- </xsl:if>
2583
-
2584
- <xsl:if test="ancestor::mn:example">
2585
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
2586
- </xsl:if>
2587
-
2588
- <xsl:copy-of select="@id"/>
2636
+ <xsl:call-template name="refine_sourcecode-container-style"/>
2589
2637
 
2590
- <xsl:if test="parent::mn:note">
2591
- <xsl:attribute name="margin-left">
2592
- <xsl:choose>
2593
- <xsl:when test="not(ancestor::mn:table)"><xsl:value-of select="$note-body-indent"/></xsl:when>
2594
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2595
- </xsl:choose>
2596
- </xsl:attribute>
2597
- </xsl:if>
2598
2638
  <fo:block-container margin-left="0mm" role="SKIP">
2599
2639
 
2600
2640
  <fo:block xsl:use-attribute-sets="sourcecode-style">
@@ -2921,6 +2961,7 @@
2921
2961
  <xsl:template match="mn:sourcecode/mn:fmt-name">
2922
2962
  <xsl:if test="normalize-space() != ''">
2923
2963
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2964
+ <xsl:call-template name="refine_sourcecode-name-style"/>
2924
2965
  <xsl:apply-templates/>
2925
2966
  </fo:block>
2926
2967
  </xsl:if>
@@ -2968,12 +3009,31 @@
2968
3009
  <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
2969
3010
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2970
3011
  <xsl:attribute name="font-family"><xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
2971
- </xsl:attribute-set>
3012
+ </xsl:attribute-set> <!-- pre-style -->
3013
+
3014
+ <xsl:template name="refine_pre-style">
3015
+ </xsl:template>
2972
3016
 
2973
3017
  <xsl:attribute-set name="tt-style">
2974
3018
  <xsl:attribute name="font-family"><xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
2975
3019
  </xsl:attribute-set>
2976
3020
 
3021
+ <xsl:template name="refine_tt-style">
3022
+ <xsl:variable name="_font-size">10 <!-- inherit -->
3023
+ </xsl:variable>
3024
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3025
+ <xsl:if test="$font-size != ''">
3026
+ <xsl:attribute name="font-size">
3027
+ <xsl:choose>
3028
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
3029
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
3030
+ <xsl:when test="ancestor::mn:note or ancestor::mn:example"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3031
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3032
+ </xsl:choose>
3033
+ </xsl:attribute>
3034
+ </xsl:if>
3035
+ </xsl:template>
3036
+
2977
3037
  <xsl:variable name="color-added-text">
2978
3038
  <xsl:text>rgb(0, 255, 0)</xsl:text>
2979
3039
  </xsl:variable>
@@ -2986,9 +3046,14 @@
2986
3046
  <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
2987
3047
  </xsl:attribute-set>
2988
3048
 
3049
+ <xsl:template name="refine_add-style">
3050
+ </xsl:template>
3051
+
2989
3052
  <xsl:variable name="add-style">
2990
- <add-style xsl:use-attribute-sets="add-style"/>
2991
- </xsl:variable>
3053
+ <add-style xsl:use-attribute-sets="add-style">
3054
+ <xsl:call-template name="refine_add-style"/>
3055
+ </add-style>
3056
+ </xsl:variable>
2992
3057
  <xsl:template name="append_add-style">
2993
3058
  <xsl:copy-of select="xalan:nodeset($add-style)/add-style/@*"/>
2994
3059
  </xsl:template>
@@ -3001,24 +3066,77 @@
3001
3066
  <xsl:attribute name="text-decoration">line-through</xsl:attribute>
3002
3067
  </xsl:attribute-set>
3003
3068
 
3069
+ <xsl:template name="refine_del-style">
3070
+ </xsl:template>
3071
+
3072
+ <xsl:attribute-set name="strong-style">
3073
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3074
+ </xsl:attribute-set>
3075
+
3076
+ <xsl:template name="refine_strong_style">
3077
+ <xsl:if test="ancestor::*['preferred']">
3078
+ <xsl:attribute name="role">SKIP</xsl:attribute>
3079
+ </xsl:if>
3080
+ </xsl:template> <!-- refine_strong_style -->
3081
+
3082
+ <xsl:attribute-set name="em-style">
3083
+ <xsl:attribute name="font-style">italic</xsl:attribute>
3084
+ </xsl:attribute-set>
3085
+
3086
+ <xsl:template name="refine_em_style">
3087
+ </xsl:template> <!-- refine_em_style -->
3088
+
3089
+ <xsl:attribute-set name="sup-style">
3090
+ <xsl:attribute name="font-size">80%</xsl:attribute>
3091
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
3092
+ </xsl:attribute-set>
3093
+
3094
+ <xsl:template name="refine_sup-style">
3095
+ </xsl:template>
3096
+
3097
+ <xsl:attribute-set name="sub-style">
3098
+ <xsl:attribute name="font-size">80%</xsl:attribute>
3099
+ <xsl:attribute name="vertical-align">sub</xsl:attribute>
3100
+ </xsl:attribute-set>
3101
+
3102
+ <xsl:template name="refine_sub-style">
3103
+ </xsl:template>
3104
+
3105
+ <xsl:attribute-set name="underline-style">
3106
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
3107
+ </xsl:attribute-set>
3108
+
3109
+ <xsl:template name="refine_underline-style">
3110
+ </xsl:template>
3111
+
3112
+ <xsl:attribute-set name="hi-style">
3113
+ <xsl:attribute name="background-color">yellow</xsl:attribute>
3114
+ </xsl:attribute-set>
3115
+
3116
+ <xsl:template name="refine_hi-style">
3117
+ </xsl:template>
3118
+
3119
+ <xsl:attribute-set name="strike-style">
3120
+ <xsl:attribute name="text-decoration">line-through</xsl:attribute>
3121
+ </xsl:attribute-set>
3122
+
3123
+ <xsl:template name="refine_strike-style">
3124
+ </xsl:template>
3125
+
3004
3126
  <xsl:template match="mn:br">
3005
3127
  <xsl:value-of select="$linebreak"/>
3006
3128
  </xsl:template>
3007
3129
 
3008
- <xsl:template match="mn:em">
3009
- <fo:inline font-style="italic">
3010
- <xsl:call-template name="refine_italic_style"/>
3130
+ <xsl:template match="mn:em">
3131
+ <fo:inline xsl:use-attribute-sets="em-style">
3132
+ <xsl:call-template name="refine_em_style"/>
3011
3133
  <xsl:apply-templates/>
3012
3134
  </fo:inline>
3013
3135
  </xsl:template>
3014
3136
 
3015
- <xsl:template name="refine_italic_style">
3016
- </xsl:template>
3017
-
3018
3137
  <xsl:template match="mn:strong | *[local-name()='b']">
3019
3138
  <xsl:param name="split_keep-within-line"/>
3020
- <fo:inline font-weight="bold">
3021
-
3139
+ <fo:inline xsl:use-attribute-sets="strong-style">
3022
3140
  <xsl:call-template name="refine_strong_style"/>
3023
3141
 
3024
3142
  <xsl:apply-templates>
@@ -3027,44 +3145,27 @@
3027
3145
  </fo:inline>
3028
3146
  </xsl:template>
3029
3147
 
3030
- <xsl:template name="refine_strong_style">
3031
- <xsl:if test="ancestor::*['preferred']">
3032
- <xsl:attribute name="role">SKIP</xsl:attribute>
3033
- </xsl:if>
3034
- </xsl:template>
3035
-
3036
3148
  <xsl:template match="*[local-name()='padding']">
3037
3149
  <fo:inline padding-right="{@value}"> </fo:inline>
3038
3150
  </xsl:template>
3039
3151
 
3040
3152
  <xsl:template match="mn:sup">
3041
- <fo:inline font-size="80%" vertical-align="super">
3153
+ <fo:inline xsl:use-attribute-sets="sup-style">
3154
+ <xsl:call-template name="refine_sup-style"/>
3042
3155
  <xsl:apply-templates/>
3043
3156
  </fo:inline>
3044
3157
  </xsl:template>
3045
3158
 
3046
3159
  <xsl:template match="mn:sub">
3047
- <fo:inline font-size="80%" vertical-align="sub">
3160
+ <fo:inline xsl:use-attribute-sets="sub-style">
3161
+ <xsl:call-template name="refine_sub-style"/>
3048
3162
  <xsl:apply-templates/>
3049
3163
  </fo:inline>
3050
3164
  </xsl:template>
3051
3165
 
3052
3166
  <xsl:template match="mn:tt">
3053
3167
  <fo:inline xsl:use-attribute-sets="tt-style">
3054
-
3055
- <xsl:variable name="_font-size">10 <!-- inherit -->
3056
- </xsl:variable>
3057
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3058
- <xsl:if test="$font-size != ''">
3059
- <xsl:attribute name="font-size">
3060
- <xsl:choose>
3061
- <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
3062
- <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
3063
- <xsl:when test="ancestor::mn:note or ancestor::mn:example"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3064
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3065
- </xsl:choose>
3066
- </xsl:attribute>
3067
- </xsl:if>
3168
+ <xsl:call-template name="refine_tt-style"/>
3068
3169
  <xsl:apply-templates/>
3069
3170
  </fo:inline>
3070
3171
  </xsl:template> <!-- tt -->
@@ -3083,7 +3184,8 @@
3083
3184
  </xsl:template>
3084
3185
 
3085
3186
  <xsl:template match="mn:underline">
3086
- <fo:inline text-decoration="underline">
3187
+ <fo:inline xsl:use-attribute-sets="underline-style">
3188
+ <xsl:call-template name="refine_underline-style"/>
3087
3189
  <xsl:apply-templates/>
3088
3190
  </fo:inline>
3089
3191
  </xsl:template>
@@ -3241,6 +3343,7 @@
3241
3343
 
3242
3344
  <xsl:template match="mn:del">
3243
3345
  <fo:inline xsl:use-attribute-sets="del-style">
3346
+ <xsl:call-template name="refine_del-style"/>
3244
3347
  <xsl:apply-templates/>
3245
3348
  </fo:inline>
3246
3349
  </xsl:template>
@@ -3250,7 +3353,8 @@
3250
3353
 
3251
3354
  <!-- highlight text -->
3252
3355
  <xsl:template match="mn:hi | mn:span[@class = 'fmt-hi']" priority="3">
3253
- <fo:inline background-color="yellow">
3356
+ <fo:inline xsl:use-attribute-sets="hi-style">
3357
+ <xsl:call-template name="refine_hi-style"/>
3254
3358
  <xsl:apply-templates/>
3255
3359
  </fo:inline>
3256
3360
  </xsl:template>
@@ -3336,7 +3440,8 @@
3336
3440
  </xsl:template>
3337
3441
 
3338
3442
  <xsl:template match="mn:strike">
3339
- <fo:inline text-decoration="line-through">
3443
+ <fo:inline xsl:use-attribute-sets="strike-style">
3444
+ <xsl:call-template name="refine_strike-style"/>
3340
3445
  <xsl:apply-templates/>
3341
3446
  </fo:inline>
3342
3447
  </xsl:template>
@@ -3416,6 +3521,7 @@
3416
3521
 
3417
3522
  <xsl:template match="mn:pre" name="pre">
3418
3523
  <fo:block xsl:use-attribute-sets="pre-style">
3524
+ <xsl:call-template name="refine_pre-style"/>
3419
3525
  <xsl:copy-of select="@id"/>
3420
3526
  <xsl:choose>
3421
3527
 
@@ -3446,22 +3552,40 @@
3446
3552
  <xsl:attribute-set name="permission-style">
3447
3553
  </xsl:attribute-set>
3448
3554
 
3555
+ <xsl:template name="refine_permission-style">
3556
+ </xsl:template>
3557
+
3449
3558
  <xsl:attribute-set name="permission-name-style">
3450
3559
  </xsl:attribute-set>
3451
3560
 
3561
+ <xsl:template name="refine_permission-name-style">
3562
+ </xsl:template>
3563
+
3452
3564
  <xsl:attribute-set name="permission-label-style">
3453
3565
  </xsl:attribute-set>
3454
3566
 
3567
+ <xsl:template name="refine_permission-label-style">
3568
+ </xsl:template>
3569
+
3455
3570
  <xsl:attribute-set name="requirement-style">
3456
3571
  </xsl:attribute-set>
3457
3572
 
3573
+ <xsl:template name="refine_requirement-style">
3574
+ </xsl:template>
3575
+
3458
3576
  <xsl:attribute-set name="requirement-name-style">
3459
3577
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3460
3578
  </xsl:attribute-set>
3461
3579
 
3580
+ <xsl:template name="refine_requirement-name-style">
3581
+ </xsl:template>
3582
+
3462
3583
  <xsl:attribute-set name="requirement-label-style">
3463
3584
  </xsl:attribute-set>
3464
3585
 
3586
+ <xsl:template name="refine_requirement-label-style">
3587
+ </xsl:template>
3588
+
3465
3589
  <xsl:attribute-set name="subject-style">
3466
3590
  </xsl:attribute-set>
3467
3591
 
@@ -3489,18 +3613,28 @@
3489
3613
  <xsl:attribute-set name="recommendation-style">
3490
3614
  </xsl:attribute-set>
3491
3615
 
3616
+ <xsl:template name="refine_recommendation-style">
3617
+ </xsl:template>
3618
+
3492
3619
  <xsl:attribute-set name="recommendation-name-style">
3493
3620
  </xsl:attribute-set>
3494
3621
 
3622
+ <xsl:template name="refine_recommendation-name-style">
3623
+ </xsl:template>
3624
+
3495
3625
  <xsl:attribute-set name="recommendation-label-style">
3496
3626
  </xsl:attribute-set>
3497
3627
 
3628
+ <xsl:template name="refine_recommendation-label-style">
3629
+ </xsl:template>
3630
+
3498
3631
  <!-- ========== -->
3499
3632
  <!-- permission -->
3500
3633
  <!-- ========== -->
3501
3634
  <xsl:template match="mn:permission">
3502
3635
  <xsl:call-template name="setNamedDestination"/>
3503
3636
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
3637
+ <xsl:call-template name="refine_permission-style"/>
3504
3638
  <xsl:apply-templates select="mn:fmt-name"/>
3505
3639
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
3506
3640
  </fo:block>
@@ -3509,6 +3643,7 @@
3509
3643
  <xsl:template match="mn:permission/mn:fmt-name">
3510
3644
  <xsl:if test="normalize-space() != ''">
3511
3645
  <fo:block xsl:use-attribute-sets="permission-name-style">
3646
+ <xsl:call-template name="refine_permission-name-style"/>
3512
3647
  <xsl:apply-templates/>
3513
3648
  </fo:block>
3514
3649
  </xsl:if>
@@ -3516,6 +3651,7 @@
3516
3651
 
3517
3652
  <xsl:template match="mn:permission/mn:label">
3518
3653
  <fo:block xsl:use-attribute-sets="permission-label-style">
3654
+ <xsl:call-template name="refine_permission-label-style"/>
3519
3655
  <xsl:apply-templates/>
3520
3656
  </fo:block>
3521
3657
  </xsl:template>
@@ -3528,6 +3664,7 @@
3528
3664
  <xsl:template match="mn:requirement">
3529
3665
  <xsl:call-template name="setNamedDestination"/>
3530
3666
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
3667
+ <xsl:call-template name="refine_requirement-style"/>
3531
3668
  <xsl:apply-templates select="mn:fmt-name"/>
3532
3669
  <xsl:apply-templates select="mn:label"/>
3533
3670
  <xsl:apply-templates select="@obligation"/>
@@ -3540,6 +3677,7 @@
3540
3677
  <xsl:if test="normalize-space() != ''">
3541
3678
 
3542
3679
  <fo:block xsl:use-attribute-sets="requirement-name-style">
3680
+ <xsl:call-template name="refine_requirement-name-style"/>
3543
3681
  <xsl:apply-templates/>
3544
3682
  </fo:block>
3545
3683
  </xsl:if>
@@ -3547,6 +3685,7 @@
3547
3685
 
3548
3686
  <xsl:template match="mn:requirement/mn:label">
3549
3687
  <fo:block xsl:use-attribute-sets="requirement-label-style">
3688
+ <xsl:call-template name="refine_requirement-label-style"/>
3550
3689
  <xsl:apply-templates/>
3551
3690
  </fo:block>
3552
3691
  </xsl:template>
@@ -3572,6 +3711,7 @@
3572
3711
  <xsl:template match="mn:recommendation">
3573
3712
  <xsl:call-template name="setNamedDestination"/>
3574
3713
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
3714
+ <xsl:call-template name="refine_recommendation-style"/>
3575
3715
  <xsl:apply-templates select="mn:fmt-name"/>
3576
3716
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
3577
3717
  </fo:block>
@@ -3581,6 +3721,7 @@
3581
3721
  <xsl:if test="normalize-space() != ''">
3582
3722
 
3583
3723
  <fo:block xsl:use-attribute-sets="recommendation-name-style">
3724
+ <xsl:call-template name="refine_recommendation-name-style"/>
3584
3725
  <xsl:apply-templates/>
3585
3726
  </fo:block>
3586
3727
  </xsl:if>
@@ -3588,6 +3729,7 @@
3588
3729
 
3589
3730
  <xsl:template match="mn:recommendation/mn:label">
3590
3731
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
3732
+ <xsl:call-template name="refine_recommendation-label-style"/>
3591
3733
  <xsl:apply-templates/>
3592
3734
  </fo:block>
3593
3735
  </xsl:template>
@@ -3768,36 +3910,66 @@
3768
3910
  <xsl:attribute-set name="term-style">
3769
3911
  </xsl:attribute-set> <!-- term-style -->
3770
3912
 
3913
+ <xsl:template name="refine_term-style">
3914
+ </xsl:template>
3915
+
3771
3916
  <xsl:attribute-set name="term-name-style">
3772
3917
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3773
3918
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3774
3919
  </xsl:attribute-set> <!-- term-name-style -->
3775
3920
 
3776
- <xsl:attribute-set name="preferred-block-style">
3921
+ <xsl:template name="refine_term-name-style">
3922
+ </xsl:template>
3923
+
3924
+ <xsl:attribute-set name="preferred-block-style">
3777
3925
  <xsl:attribute name="line-height">1.1</xsl:attribute>
3778
3926
  </xsl:attribute-set> <!-- preferred-block-style -->
3779
3927
 
3928
+ <xsl:template name="refine_preferred-block-style">
3929
+ </xsl:template>
3930
+
3780
3931
  <xsl:attribute-set name="preferred-term-style">
3781
3932
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3782
3933
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3783
3934
  </xsl:attribute-set> <!-- preferred-term-style -->
3784
3935
 
3936
+ <xsl:template name="refine_preferred-term-style">
3937
+ <xsl:if test="mn:strong">
3938
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
3939
+ </xsl:if>
3940
+ </xsl:template>
3941
+
3785
3942
  <xsl:attribute-set name="domain-style">
3786
3943
  </xsl:attribute-set> <!-- domain-style -->
3787
3944
 
3945
+ <xsl:template name="refine_domain-style">
3946
+ </xsl:template>
3947
+
3788
3948
  <xsl:attribute-set name="admitted-style">
3789
3949
  </xsl:attribute-set> <!-- admitted-style -->
3790
3950
 
3951
+ <xsl:template name="refine_admitted-style">
3952
+ </xsl:template>
3953
+
3791
3954
  <xsl:attribute-set name="deprecates-style">
3792
3955
  </xsl:attribute-set> <!-- deprecates-style -->
3793
3956
 
3957
+ <xsl:template name="refine_deprecates-style">
3958
+ </xsl:template>
3959
+
3794
3960
  <xsl:attribute-set name="related-block-style" use-attribute-sets="preferred-block-style">
3795
3961
  </xsl:attribute-set>
3796
3962
 
3963
+ <xsl:template name="refine_related-block-style">
3964
+ </xsl:template>
3965
+
3797
3966
  <xsl:attribute-set name="definition-style">
3798
3967
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3799
3968
  </xsl:attribute-set> <!-- definition-style -->
3800
3969
 
3970
+ <xsl:template name="refine_definition-style">
3971
+ </xsl:template>
3972
+
3801
3973
  <xsl:attribute-set name="termsource-style">
3802
3974
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
3803
3975
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
@@ -3809,9 +3981,15 @@
3809
3981
  <xsl:attribute-set name="termsource-text-style">
3810
3982
  </xsl:attribute-set> <!-- termsource-text-style -->
3811
3983
 
3984
+ <xsl:template name="refine_termsource-text-style">
3985
+ </xsl:template>
3986
+
3812
3987
  <xsl:attribute-set name="origin-style">
3813
3988
  </xsl:attribute-set> <!-- origin-style -->
3814
3989
 
3990
+ <xsl:template name="refine_origin-style">
3991
+ </xsl:template>
3992
+
3815
3993
  <!-- ====== -->
3816
3994
  <!-- term -->
3817
3995
  <!-- ====== -->
@@ -3827,9 +4005,8 @@
3827
4005
  <xsl:template match="mn:term">
3828
4006
  <xsl:call-template name="setNamedDestination"/>
3829
4007
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
4008
+ <xsl:call-template name="refine_term-style"/>
3830
4009
 
3831
- <xsl:if test="parent::mn:term and not(preceding-sibling::mn:term)">
3832
- </xsl:if>
3833
4010
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
3834
4011
  </fo:block>
3835
4012
  </xsl:template>
@@ -3905,6 +4082,7 @@
3905
4082
  <!-- text SOURCE: -->
3906
4083
  <xsl:template match="mn:fmt-termsource/mn:strong[1][following-sibling::*[1][self::mn:fmt-origin]]/text()">
3907
4084
  <fo:inline xsl:use-attribute-sets="termsource-text-style">
4085
+ <xsl:call-template name="refine_termsource-text-style"/>
3908
4086
  <xsl:value-of select="."/>
3909
4087
  </fo:inline>
3910
4088
  </xsl:template>
@@ -3917,6 +4095,7 @@
3917
4095
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
3918
4096
  </xsl:if>
3919
4097
  <fo:inline xsl:use-attribute-sets="origin-style">
4098
+ <xsl:call-template name="refine_origin-style"/>
3920
4099
  <xsl:apply-templates/>
3921
4100
  </fo:inline>
3922
4101
  </fo:basic-link>
@@ -3971,9 +4150,12 @@
3971
4150
  </xsl:variable>
3972
4151
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
3973
4152
 
4153
+ <xsl:call-template name="refine_preferred-block-style"/>
4154
+
3974
4155
  <xsl:if test="parent::mn:term and not(preceding-sibling::mn:fmt-preferred)"> <!-- if first preffered in term, then display term's name -->
3975
4156
 
3976
4157
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
4158
+ <xsl:call-template name="refine_term-name-style"/>
3977
4159
 
3978
4160
  <xsl:for-each select="ancestor::mn:term[1]/mn:fmt-name"><!-- change context -->
3979
4161
  <xsl:call-template name="setIDforNamedDestination"/>
@@ -3984,7 +4166,7 @@
3984
4166
  </xsl:if>
3985
4167
 
3986
4168
  <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
3987
- <xsl:call-template name="setStyle_preferred"/>
4169
+ <xsl:call-template name="refine_preferred-term-style"/>
3988
4170
 
3989
4171
  <xsl:apply-templates/>
3990
4172
  </fo:block>
@@ -4005,22 +4187,18 @@
4005
4187
 
4006
4188
  <xsl:template match="mn:fmt-admitted">
4007
4189
  <fo:block xsl:use-attribute-sets="admitted-style">
4190
+ <xsl:call-template name="refine_admitted-style"/>
4008
4191
  <xsl:apply-templates/>
4009
4192
  </fo:block>
4010
4193
  </xsl:template>
4011
4194
 
4012
4195
  <xsl:template match="mn:fmt-deprecates">
4013
4196
  <fo:block xsl:use-attribute-sets="deprecates-style">
4197
+ <xsl:call-template name="refine_deprecates-style"/>
4014
4198
  <xsl:apply-templates/>
4015
4199
  </fo:block>
4016
4200
  </xsl:template>
4017
4201
 
4018
- <xsl:template name="setStyle_preferred">
4019
- <xsl:if test="mn:strong">
4020
- <xsl:attribute name="font-weight">normal</xsl:attribute>
4021
- </xsl:if>
4022
- </xsl:template>
4023
-
4024
4202
  <!-- regarding ISO 10241-1:2011, If there is more than one preferred term, each preferred term follows the previous one on a new line. -->
4025
4203
  <!-- in metanorma xml preferred terms delimited by semicolons -->
4026
4204
  <xsl:template match="mn:fmt-preferred/text()[contains(., ';')] | mn:fmt-preferred/mn:strong/text()[contains(., ';')]">
@@ -4030,6 +4208,7 @@
4030
4208
 
4031
4209
  <xsl:template match="mn:fmt-related">
4032
4210
  <fo:block role="SKIP" xsl:use-attribute-sets="related-block-style">
4211
+ <xsl:call-template name="refine_related-block-style"/>
4033
4212
  <xsl:apply-templates/>
4034
4213
  </fo:block>
4035
4214
  </xsl:template>
@@ -4044,6 +4223,7 @@
4044
4223
  <!-- ========== -->
4045
4224
  <xsl:template match="mn:fmt-definition">
4046
4225
  <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
4226
+ <xsl:call-template name="refine_definition-style"/>
4047
4227
  <xsl:apply-templates/>
4048
4228
  </fo:block>
4049
4229
  </xsl:template>
@@ -4092,6 +4272,9 @@
4092
4272
  <xsl:attribute name="margin-left">12.5mm</xsl:attribute>
4093
4273
  </xsl:attribute-set> <!-- example-body-style -->
4094
4274
 
4275
+ <xsl:template name="refine_example-body-style">
4276
+ </xsl:template>
4277
+
4095
4278
  <xsl:attribute-set name="example-name-style">
4096
4279
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4097
4280
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -4140,6 +4323,8 @@
4140
4323
  <xsl:when test="contains($element, 'block')">
4141
4324
  <fo:block xsl:use-attribute-sets="example-p-style">
4142
4325
 
4326
+ <xsl:call-template name="refine_example-p-style"/>
4327
+
4143
4328
  <xsl:apply-templates/>
4144
4329
  </fo:block>
4145
4330
  </xsl:when>
@@ -4191,6 +4376,7 @@
4191
4376
  </fo:block>
4192
4377
 
4193
4378
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
4379
+ <xsl:call-template name="refine_example-body-style"/>
4194
4380
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
4195
4381
  <xsl:variable name="example_body">
4196
4382
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]">
@@ -4253,6 +4439,7 @@
4253
4439
  <xsl:if test="*[not(self::mn:fmt-name)][position() &gt; 1]">
4254
4440
  <!-- display further elements in blocks -->
4255
4441
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
4442
+ <xsl:call-template name="refine_example-body-style"/>
4256
4443
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
4257
4444
  <xsl:apply-templates select="*[not(self::mn:fmt-name)][position() &gt; 1]">
4258
4445
  <xsl:with-param name="fo_element" select="'block'"/>
@@ -4482,6 +4669,9 @@
4482
4669
  <!-- <xsl:attribute name="padding-right">5mm</xsl:attribute> -->
4483
4670
  </xsl:attribute-set> <!-- table-fn-number-style -->
4484
4671
 
4672
+ <xsl:template name="refine_table-fn-number-style">
4673
+ </xsl:template>
4674
+
4485
4675
  <xsl:attribute-set name="table-fmt-fn-label-style">
4486
4676
  <xsl:attribute name="font-size">80%</xsl:attribute>
4487
4677
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -4490,30 +4680,12 @@
4490
4680
  <xsl:template name="refine_table-fmt-fn-label-style">
4491
4681
  </xsl:template>
4492
4682
 
4493
- <xsl:attribute-set name="fn-container-body-style">
4494
- <xsl:attribute name="text-indent">0</xsl:attribute>
4495
- <xsl:attribute name="start-indent">0</xsl:attribute>
4496
- </xsl:attribute-set>
4497
-
4498
4683
  <xsl:attribute-set name="table-fn-body-style">
4499
4684
  </xsl:attribute-set>
4500
4685
 
4501
- <xsl:attribute-set name="figure-fn-number-style">
4502
- <xsl:attribute name="padding-right">5mm</xsl:attribute>
4503
- </xsl:attribute-set> <!-- figure-fn-number-style -->
4504
-
4505
- <xsl:attribute-set name="figure-fmt-fn-label-style">
4506
- <xsl:attribute name="font-size">80%</xsl:attribute>
4507
- <xsl:attribute name="vertical-align">super</xsl:attribute>
4508
- </xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
4509
-
4510
- <xsl:template name="refine_figure-fmt-fn-label-style">
4686
+ <xsl:template name="refine_table-fn-body-style">
4511
4687
  </xsl:template>
4512
4688
 
4513
- <xsl:attribute-set name="figure-fn-body-style">
4514
- <xsl:attribute name="text-align">justify</xsl:attribute>
4515
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
4516
- </xsl:attribute-set>
4517
4689
  <!-- ========================== -->
4518
4690
  <!-- END Table styles -->
4519
4691
  <!-- ========================== -->
@@ -5791,6 +5963,7 @@
5791
5963
  </xsl:apply-templates>
5792
5964
 
5793
5965
  <fo:inline xsl:use-attribute-sets="table-fn-body-style">
5966
+ <xsl:call-template name="refine_table-fn-body-style"/>
5794
5967
  <!-- <xsl:copy-of select="./node()"/> -->
5795
5968
  <xsl:apply-templates/>
5796
5969
  </fo:inline>
@@ -5809,6 +5982,7 @@
5809
5982
  <xsl:param name="process">false</xsl:param>
5810
5983
  <xsl:if test="$process = 'true'">
5811
5984
  <fo:inline xsl:use-attribute-sets="table-fn-number-style" role="SKIP">
5985
+ <xsl:call-template name="refine_table-fn-number-style"/>
5812
5986
 
5813
5987
  <!-- tab is padding-right -->
5814
5988
  <xsl:apply-templates select=".//mn:tab">
@@ -6680,9 +6854,18 @@
6680
6854
  <xsl:attribute-set name="dl-block-style">
6681
6855
  </xsl:attribute-set>
6682
6856
 
6857
+ <xsl:template name="refine_dl-block-style">
6858
+ <xsl:if test="@key = 'true' and ancestor::mn:figure">
6859
+ <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
6860
+ </xsl:if>
6861
+ </xsl:template>
6862
+
6683
6863
  <xsl:attribute-set name="dt-row-style">
6684
6864
  </xsl:attribute-set>
6685
6865
 
6866
+ <xsl:template name="refine_dt-row-style">
6867
+ </xsl:template>
6868
+
6686
6869
  <xsl:attribute-set name="dt-cell-style">
6687
6870
  </xsl:attribute-set>
6688
6871
 
@@ -6703,6 +6886,9 @@
6703
6886
  <xsl:attribute name="font-weight">bold</xsl:attribute>
6704
6887
  </xsl:attribute-set> <!-- dl-name-style -->
6705
6888
 
6889
+ <xsl:template name="refine_dl-name-style">
6890
+ </xsl:template>
6891
+
6706
6892
  <xsl:attribute-set name="dd-cell-style">
6707
6893
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
6708
6894
  </xsl:attribute-set>
@@ -6741,9 +6927,7 @@
6741
6927
  <!-- <dl><xsl:copy-of select="."/></dl> -->
6742
6928
  <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
6743
6929
 
6744
- <xsl:if test="@key = 'true' and ancestor::mn:figure">
6745
- <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
6746
- </xsl:if>
6930
+ <xsl:call-template name="refine_dl-block-style"/>
6747
6931
 
6748
6932
  <xsl:call-template name="setBlockSpanAll"/>
6749
6933
  <xsl:if test="not(ancestor::mn:quote)">
@@ -7039,6 +7223,8 @@
7039
7223
  <xsl:if test="$process = 'true'">
7040
7224
  <fo:block xsl:use-attribute-sets="dl-name-style">
7041
7225
 
7226
+ <xsl:call-template name="refine_dl-name-style"/>
7227
+
7042
7228
  <xsl:apply-templates/>
7043
7229
  </fo:block>
7044
7230
  </xsl:if>
@@ -7227,6 +7413,8 @@
7227
7413
  <xsl:param name="split_keep-within-line"/>
7228
7414
 
7229
7415
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
7416
+ <xsl:call-template name="refine_dt-row-style"/>
7417
+
7230
7418
  <xsl:call-template name="insert_dt_cell">
7231
7419
  <xsl:with-param name="key_iso" select="$key_iso"/>
7232
7420
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -7440,18 +7628,25 @@
7440
7628
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
7441
7629
  </xsl:attribute-set>
7442
7630
 
7631
+ <xsl:template name="refine_appendix-style">
7632
+ </xsl:template>
7633
+
7443
7634
  <xsl:attribute-set name="appendix-example-style">
7444
7635
  <xsl:attribute name="font-size">10pt</xsl:attribute>
7445
7636
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
7446
7637
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
7447
7638
  </xsl:attribute-set>
7448
7639
 
7640
+ <xsl:template name="refine_appendix-example-style">
7641
+ </xsl:template>
7642
+
7449
7643
  <!-- ======================== -->
7450
7644
  <!-- Appendix processing -->
7451
7645
  <!-- ======================== -->
7452
7646
  <xsl:template match="mn:appendix">
7453
7647
  <xsl:call-template name="setNamedDestination"/>
7454
7648
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
7649
+ <xsl:call-template name="refine_appendix-style"/>
7455
7650
  <xsl:apply-templates select="mn:fmt-title"/>
7456
7651
  </fo:block>
7457
7652
  <xsl:apply-templates select="node()[not(self::mn:fmt-title)]"/>
@@ -7470,13 +7665,23 @@
7470
7665
  <xsl:template match="mn:appendix//mn:example" priority="2">
7471
7666
  <xsl:call-template name="setNamedDestination"/>
7472
7667
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
7668
+ <xsl:call-template name="refine_appendix-example-style"/>
7473
7669
  <xsl:apply-templates select="mn:fmt-name"/>
7474
7670
  </fo:block>
7475
7671
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
7476
7672
  </xsl:template>
7477
7673
 
7478
7674
  <xsl:attribute-set name="xref-style">
7479
- </xsl:attribute-set>
7675
+ </xsl:attribute-set> <!-- xref-style -->
7676
+
7677
+ <xsl:template name="refine_xref-style">
7678
+ <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])">
7679
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7680
+ </xsl:if>
7681
+ <xsl:if test="parent::mn:add">
7682
+ <xsl:call-template name="append_add-style"/>
7683
+ </xsl:if>
7684
+ </xsl:template> <!-- refine_xref-style -->
7480
7685
 
7481
7686
  <xsl:template match="mn:fmt-xref">
7482
7687
  <xsl:call-template name="insert_basic_link">
@@ -7485,12 +7690,8 @@
7485
7690
  <xsl:call-template name="getAltText"/>
7486
7691
  </xsl:variable>
7487
7692
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
7488
- <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])">
7489
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7490
- </xsl:if>
7491
- <xsl:if test="parent::mn:add">
7492
- <xsl:call-template name="append_add-style"/>
7493
- </xsl:if>
7693
+ <xsl:call-template name="refine_xref-style"/>
7694
+
7494
7695
  <xsl:apply-templates/>
7495
7696
  </fo:basic-link>
7496
7697
  </xsl:with-param>
@@ -7603,17 +7804,17 @@
7603
7804
  <xsl:attribute-set name="note-style">
7604
7805
  <xsl:attribute name="font-size">10pt</xsl:attribute>
7605
7806
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
7606
- </xsl:attribute-set>
7807
+ </xsl:attribute-set> <!-- note-style -->
7607
7808
 
7608
7809
  <xsl:template name="refine_note-style">
7609
- </xsl:template>
7810
+ </xsl:template> <!-- refine_note-style -->
7610
7811
 
7611
7812
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
7612
7813
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
7613
7814
 
7614
7815
  <xsl:attribute-set name="note-name-style">
7615
7816
  <xsl:attribute name="padding-right">6mm</xsl:attribute>
7616
- </xsl:attribute-set>
7817
+ </xsl:attribute-set> <!-- note-name-style -->
7617
7818
 
7618
7819
  <xsl:template name="refine_note-name-style">
7619
7820
  </xsl:template> <!-- refine_note-name-style -->
@@ -7627,18 +7828,21 @@
7627
7828
 
7628
7829
  <xsl:attribute-set name="note-p-style">
7629
7830
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
7630
- </xsl:attribute-set>
7831
+ </xsl:attribute-set> <!-- note-p-style -->
7832
+
7833
+ <xsl:template name="refine_note-p-style">
7834
+ </xsl:template>
7631
7835
 
7632
7836
  <xsl:attribute-set name="termnote-style">
7633
7837
  <xsl:attribute name="font-size">10pt</xsl:attribute>
7634
7838
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
7635
- </xsl:attribute-set>
7839
+ </xsl:attribute-set> <!-- termnote-style -->
7636
7840
 
7637
7841
  <xsl:template name="refine_termnote-style">
7638
7842
  </xsl:template> <!-- refine_termnote-style -->
7639
7843
 
7640
7844
  <xsl:attribute-set name="termnote-name-style">
7641
- </xsl:attribute-set>
7845
+ </xsl:attribute-set> <!-- termnote-name-style -->
7642
7846
 
7643
7847
  <xsl:template name="refine_termnote-name-style">
7644
7848
  </xsl:template>
@@ -7646,6 +7850,9 @@
7646
7850
  <xsl:attribute-set name="termnote-p-style">
7647
7851
  </xsl:attribute-set>
7648
7852
 
7853
+ <xsl:template name="refine_termnote-p-style">
7854
+ </xsl:template>
7855
+
7649
7856
  <!-- ====== -->
7650
7857
  <!-- note -->
7651
7858
  <!-- termnote -->
@@ -7706,11 +7913,13 @@
7706
7913
  <xsl:choose>
7707
7914
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
7708
7915
  <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
7916
+ <xsl:call-template name="refine_note-p-style"/>
7709
7917
  <xsl:apply-templates/>
7710
7918
  </fo:inline>
7711
7919
  </xsl:when>
7712
7920
  <xsl:otherwise>
7713
7921
  <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
7922
+ <xsl:call-template name="refine_note-p-style"/>
7714
7923
  <xsl:apply-templates/>
7715
7924
  </fo:block>
7716
7925
  </xsl:otherwise>
@@ -7802,11 +8011,13 @@
7802
8011
  <xsl:choose>
7803
8012
  <xsl:when test="$num = 1"> <!-- first paragraph renders in the same line as titlenote name -->
7804
8013
  <fo:inline xsl:use-attribute-sets="termnote-p-style">
8014
+ <xsl:call-template name="refine_termnote-p-style"/>
7805
8015
  <xsl:apply-templates/>
7806
8016
  </fo:inline>
7807
8017
  </xsl:when>
7808
8018
  <xsl:otherwise>
7809
8019
  <fo:block xsl:use-attribute-sets="termnote-p-style">
8020
+ <xsl:call-template name="refine_termnote-p-style"/>
7810
8021
  <xsl:apply-templates/>
7811
8022
  </fo:block>
7812
8023
  </xsl:otherwise>
@@ -7820,7 +8031,7 @@
7820
8031
  <xsl:attribute name="margin-left">12mm</xsl:attribute>
7821
8032
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
7822
8033
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
7823
- </xsl:attribute-set>
8034
+ </xsl:attribute-set> <!-- quote-style -->
7824
8035
 
7825
8036
  <xsl:template name="refine_quote-style">
7826
8037
  </xsl:template>
@@ -7829,6 +8040,9 @@
7829
8040
  <xsl:attribute name="text-align">right</xsl:attribute>
7830
8041
  </xsl:attribute-set>
7831
8042
 
8043
+ <xsl:template name="refine_quote-source-style">
8044
+ </xsl:template>
8045
+
7832
8046
  <!-- ====== -->
7833
8047
  <!-- quote -->
7834
8048
  <!-- source -->
@@ -7857,6 +8071,7 @@
7857
8071
  </fo:block-container>
7858
8072
  <xsl:if test="mn:author or mn:fmt-source or mn:attribution">
7859
8073
  <fo:block xsl:use-attribute-sets="quote-source-style">
8074
+ <xsl:call-template name="refine_quote-source-style"/>
7860
8075
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
7861
8076
  <xsl:apply-templates select="mn:author"/>
7862
8077
  <xsl:apply-templates select="mn:fmt-source"/>
@@ -7919,6 +8134,9 @@
7919
8134
  <xsl:attribute-set name="figure-style">
7920
8135
  </xsl:attribute-set>
7921
8136
 
8137
+ <xsl:template name="refine_figure-style">
8138
+ </xsl:template>
8139
+
7922
8140
  <xsl:attribute-set name="figure-name-style">
7923
8141
  <xsl:attribute name="role">Caption</xsl:attribute>
7924
8142
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -7926,7 +8144,7 @@
7926
8144
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
7927
8145
  <xsl:attribute name="space-after">12pt</xsl:attribute>
7928
8146
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
7929
- </xsl:attribute-set>
8147
+ </xsl:attribute-set> <!-- figure-name-style -->
7930
8148
 
7931
8149
  <xsl:template name="refine_figure-name-style">
7932
8150
  </xsl:template> <!-- refine_figure-name-style -->
@@ -7934,7 +8152,7 @@
7934
8152
  <xsl:attribute-set name="image-style">
7935
8153
  <xsl:attribute name="role">SKIP</xsl:attribute>
7936
8154
  <xsl:attribute name="text-align">center</xsl:attribute>
7937
- </xsl:attribute-set>
8155
+ </xsl:attribute-set> <!-- image-style -->
7938
8156
 
7939
8157
  <xsl:template name="refine_image-style">
7940
8158
  </xsl:template>
@@ -7944,14 +8162,51 @@
7944
8162
  <xsl:attribute name="content-height">100%</xsl:attribute>
7945
8163
  <xsl:attribute name="scaling">uniform</xsl:attribute>
7946
8164
  <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
7947
- </xsl:attribute-set>
8165
+ </xsl:attribute-set> <!-- image-graphic-style -->
8166
+
8167
+ <xsl:template name="refine_image-graphic-style">
8168
+ </xsl:template>
7948
8169
 
7949
8170
  <xsl:attribute-set name="figure-source-style">
7950
8171
  </xsl:attribute-set>
7951
8172
 
8173
+ <xsl:template name="refine_figure-source-style">
8174
+ </xsl:template>
8175
+
7952
8176
  <xsl:attribute-set name="figure-pseudocode-p-style">
7953
8177
  </xsl:attribute-set>
7954
8178
 
8179
+ <xsl:template name="refine_figure-pseudocode-p-style">
8180
+ </xsl:template>
8181
+
8182
+ <xsl:attribute-set name="figure-fn-number-style">
8183
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
8184
+ </xsl:attribute-set> <!-- figure-fn-number-style -->
8185
+
8186
+ <xsl:template name="refine_figure-fn-number-style">
8187
+ </xsl:template>
8188
+
8189
+ <xsl:attribute-set name="figure-fmt-fn-label-style">
8190
+ <xsl:attribute name="font-size">80%</xsl:attribute>
8191
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
8192
+ </xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
8193
+
8194
+ <xsl:template name="refine_figure-fmt-fn-label-style">
8195
+ </xsl:template>
8196
+
8197
+ <xsl:attribute-set name="figure-fn-body-style">
8198
+ <xsl:attribute name="text-align">justify</xsl:attribute>
8199
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
8200
+ </xsl:attribute-set>
8201
+
8202
+ <xsl:template name="refine_figure-fn-body-style">
8203
+ <xsl:variable name="key_iso">
8204
+ </xsl:variable>
8205
+ <xsl:if test="normalize-space($key_iso) = 'true'">
8206
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
8207
+ </xsl:if>
8208
+ </xsl:template>
8209
+
7955
8210
  <!-- ============================ -->
7956
8211
  <!-- figure's footnotes rendering -->
7957
8212
  <!-- ============================ -->
@@ -8064,9 +8319,8 @@
8064
8319
  </fo:table-cell>
8065
8320
  <fo:table-cell>
8066
8321
  <fo:block xsl:use-attribute-sets="figure-fn-body-style">
8067
- <xsl:if test="normalize-space($key_iso) = 'true'">
8068
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
8069
- </xsl:if>
8322
+ <xsl:call-template name="refine_figure-fn-body-style"/>
8323
+
8070
8324
  <!-- <xsl:copy-of select="./node()"/> -->
8071
8325
  <xsl:apply-templates/>
8072
8326
  </fo:block>
@@ -8084,6 +8338,7 @@
8084
8338
  <xsl:param name="process">false</xsl:param>
8085
8339
  <xsl:if test="$process = 'true'">
8086
8340
  <fo:inline xsl:use-attribute-sets="figure-fn-number-style" role="SKIP">
8341
+ <xsl:call-template name="refine_figure-fn-number-style"/>
8087
8342
  <xsl:attribute name="padding-right">0mm</xsl:attribute>
8088
8343
 
8089
8344
  <!-- tab is padding-right -->
@@ -8121,6 +8376,7 @@
8121
8376
  <xsl:attribute name="font-size">10pt</xsl:attribute>
8122
8377
  </xsl:if>
8123
8378
  <fo:inline xsl:use-attribute-sets="figure-fn-number-style figure-fmt-fn-label-style"> <!-- id="{@id}" -->
8379
+ <xsl:call-template name="refine_figure-fn-number-style"/>
8124
8380
  <!-- <xsl:value-of select="@reference"/> -->
8125
8381
  <xsl:apply-templates/>
8126
8382
  </fo:inline>
@@ -8166,6 +8422,8 @@
8166
8422
 
8167
8423
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
8168
8424
 
8425
+ <xsl:call-template name="refine_figure-style"/>
8426
+
8169
8427
  <xsl:for-each select="mn:fmt-name"> <!-- set context -->
8170
8428
  <xsl:call-template name="setIDforNamedDestination"/>
8171
8429
  </xsl:for-each>
@@ -8209,6 +8467,7 @@
8209
8467
 
8210
8468
  <xsl:template match="mn:figure[@class = 'pseudocode']//mn:p">
8211
8469
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
8470
+ <xsl:call-template name="refine_figure-pseudocode-p-style"/>
8212
8471
  <xsl:apply-templates/>
8213
8472
  </fo:block>
8214
8473
  </xsl:template>
@@ -8338,6 +8597,8 @@
8338
8597
  </xsl:variable>
8339
8598
  <xsl:copy-of select="xalan:nodeset($image-graphic-style_attributes)/attributes/@*"/>
8340
8599
 
8600
+ <xsl:call-template name="refine_image-graphic-style"/>
8601
+
8341
8602
  <xsl:if test="not(@mimetype = 'image/svg+xml') and not(ancestor::mn:table)">
8342
8603
  <xsl:variable name="scale">
8343
8604
  <xsl:call-template name="getImageScale">
@@ -9037,6 +9298,9 @@
9037
9298
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
9038
9299
  </xsl:attribute-set> <!-- formula-style -->
9039
9300
 
9301
+ <xsl:template name="refine_formula-style">
9302
+ </xsl:template>
9303
+
9040
9304
  <xsl:attribute-set name="formula-stem-block-style">
9041
9305
  <xsl:attribute name="text-align">center</xsl:attribute>
9042
9306
  <xsl:attribute name="text-align">left</xsl:attribute>
@@ -9107,6 +9371,8 @@
9107
9371
  <xsl:template match="mn:formula[mn:fmt-name]/mn:fmt-stem">
9108
9372
  <fo:block xsl:use-attribute-sets="formula-style">
9109
9373
 
9374
+ <xsl:call-template name="refine_formula-style"/>
9375
+
9110
9376
  <fo:table table-layout="fixed" width="100%">
9111
9377
  <fo:table-column column-width="95%"/>
9112
9378
  <fo:table-column column-width="5%"/>
@@ -9530,6 +9796,9 @@
9530
9796
  <xsl:attribute name="font-weight">bold</xsl:attribute>
9531
9797
  </xsl:attribute-set> <!-- list-name-style -->
9532
9798
 
9799
+ <xsl:template name="refine_list-name-style">
9800
+ </xsl:template>
9801
+
9533
9802
  <xsl:attribute-set name="list-item-style">
9534
9803
  </xsl:attribute-set>
9535
9804
 
@@ -9826,6 +10095,7 @@
9826
10095
  <xsl:param name="process">false</xsl:param>
9827
10096
  <xsl:if test="$process = 'true'">
9828
10097
  <fo:block xsl:use-attribute-sets="list-name-style">
10098
+ <xsl:call-template name="refine_list-name-style"/>
9829
10099
  <xsl:apply-templates/>
9830
10100
  </fo:block>
9831
10101
  </xsl:if>
@@ -9886,24 +10156,45 @@
9886
10156
  <!-- END Lists processing -->
9887
10157
  <!-- ===================================== -->
9888
10158
 
10159
+ <xsl:attribute-set name="footnote-separator-leader-style">
10160
+ </xsl:attribute-set>
10161
+
10162
+ <xsl:template name="refine_footnote-separator-leader-style">
10163
+ </xsl:template>
10164
+
10165
+ <xsl:attribute-set name="fn-container-body-style">
10166
+ <xsl:attribute name="text-indent">0</xsl:attribute>
10167
+ <xsl:attribute name="start-indent">0</xsl:attribute>
10168
+ </xsl:attribute-set>
10169
+
10170
+ <xsl:template name="refine_fn-container-body-style">
10171
+ </xsl:template>
10172
+
9889
10173
  <xsl:attribute-set name="fn-reference-style">
9890
10174
  <xsl:attribute name="font-size">80%</xsl:attribute>
9891
10175
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
9892
-
9893
- </xsl:attribute-set>
10176
+ </xsl:attribute-set> <!-- fn-reference-style -->
9894
10177
 
9895
10178
  <xsl:template name="refine_fn-reference-style">
10179
+ <!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
10180
+ <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">,</xsl:if>
9896
10181
  </xsl:template> <!-- refine_fn-reference-style -->
9897
10182
 
9898
10183
  <xsl:attribute-set name="fn-style">
9899
10184
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
9900
10185
  </xsl:attribute-set>
9901
10186
 
10187
+ <xsl:template name="refine_fn-style">
10188
+ </xsl:template>
10189
+
9902
10190
  <xsl:attribute-set name="fn-num-style">
9903
10191
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
9904
10192
  <xsl:attribute name="font-size">65%</xsl:attribute>
9905
10193
  <xsl:attribute name="vertical-align">super</xsl:attribute>
9906
- </xsl:attribute-set>
10194
+ </xsl:attribute-set> <!-- fn-num-style -->
10195
+
10196
+ <xsl:template name="refine_fn-num-style">
10197
+ </xsl:template>
9907
10198
 
9908
10199
  <xsl:attribute-set name="fn-body-style">
9909
10200
  <xsl:attribute name="font-weight">normal</xsl:attribute>
@@ -9912,7 +10203,7 @@
9912
10203
  <xsl:attribute name="start-indent">0</xsl:attribute>
9913
10204
  <xsl:attribute name="font-size">10pt</xsl:attribute>
9914
10205
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
9915
- </xsl:attribute-set>
10206
+ </xsl:attribute-set> <!-- fn-body-style" -->
9916
10207
 
9917
10208
  <xsl:template name="refine_fn-body-style">
9918
10209
  </xsl:template> <!-- refine_fn-body-style -->
@@ -9976,10 +10267,12 @@
9976
10267
  <xsl:choose>
9977
10268
  <xsl:when test="ancestor::mn:bibitem">
9978
10269
  <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
10270
+ <xsl:call-template name="refine_bibitem-note-fn-style"/>
9979
10271
  </fn_styles>
9980
10272
  </xsl:when>
9981
10273
  <xsl:otherwise>
9982
10274
  <fn_styles xsl:use-attribute-sets="fn-num-style">
10275
+ <xsl:call-template name="refine_fn-num-style"/>
9983
10276
  </fn_styles>
9984
10277
  </xsl:otherwise>
9985
10278
  </xsl:choose>
@@ -9989,9 +10282,12 @@
9989
10282
  <xsl:copy-of select="."/>
9990
10283
  </xsl:for-each>
9991
10284
 
9992
- <xsl:if test="following-sibling::node()[normalize-space() != ''][1][self::mn:fn]">
10285
+ <!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
10286
+ <!-- <xsl:if test="following-sibling::node()[normalize-space() != ''][1][self::mn:fn]">
9993
10287
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
9994
- </xsl:if>
10288
+ </xsl:if> -->
10289
+
10290
+ <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">,</xsl:if>
9995
10291
 
9996
10292
  <xsl:call-template name="insert_basic_link">
9997
10293
  <xsl:with-param name="element">
@@ -10014,10 +10310,12 @@
10014
10310
  <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
10015
10311
 
10016
10312
  <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
10313
+ <xsl:call-template name="refine_fn-style"/>
10017
10314
  <xsl:copy-of select="$footnote_inline"/>
10018
10315
  <fo:footnote-body role="Note">
10019
10316
 
10020
10317
  <fo:block-container xsl:use-attribute-sets="fn-container-body-style" role="SKIP">
10318
+ <xsl:call-template name="refine_fn-container-body-style"/>
10021
10319
 
10022
10320
  <xsl:variable name="fn_block">
10023
10321
  <xsl:call-template name="refine_fn-body-style"/>
@@ -10116,17 +10414,30 @@
10116
10414
  <xsl:attribute name="font-weight">bold</xsl:attribute>
10117
10415
  </xsl:attribute-set> <!-- admonition-style -->
10118
10416
 
10417
+ <xsl:template name="refine_admonition-style">
10418
+ </xsl:template>
10419
+
10119
10420
  <xsl:attribute-set name="admonition-container-style">
10120
10421
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
10121
10422
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
10122
10423
  </xsl:attribute-set> <!-- admonition-container-style -->
10123
10424
 
10425
+ <xsl:template name="refine_admonition-container-style">
10426
+ </xsl:template>
10427
+
10124
10428
  <xsl:attribute-set name="admonition-name-style">
10125
10429
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
10126
10430
  </xsl:attribute-set> <!-- admonition-name-style -->
10127
10431
 
10432
+ <xsl:template name="refine_admonition-name-style">
10433
+ </xsl:template>
10434
+
10128
10435
  <xsl:attribute-set name="admonition-p-style">
10129
10436
  </xsl:attribute-set> <!-- admonition-p-style -->
10437
+
10438
+ <xsl:template name="refine_admonition-p-style">
10439
+ </xsl:template>
10440
+
10130
10441
  <!-- end admonition -->
10131
10442
 
10132
10443
  <!-- ================ -->
@@ -10135,6 +10446,8 @@
10135
10446
  <xsl:template match="mn:admonition">
10136
10447
  <fo:block xsl:use-attribute-sets="admonition-style">
10137
10448
 
10449
+ <xsl:call-template name="refine_admonition-style"/>
10450
+
10138
10451
  <xsl:call-template name="setBlockSpanAll"/>
10139
10452
 
10140
10453
  <xsl:if test="@type = 'editorial'">
@@ -10202,6 +10515,7 @@
10202
10515
 
10203
10516
  <xsl:template match="mn:admonition/mn:p">
10204
10517
  <fo:block xsl:use-attribute-sets="admonition-p-style">
10518
+ <xsl:call-template name="refine_admonition-p-style"/>
10205
10519
 
10206
10520
  <xsl:apply-templates/>
10207
10521
  </fo:block>
@@ -10211,37 +10525,65 @@
10211
10525
  <!-- END Admonition -->
10212
10526
  <!-- ================ -->
10213
10527
 
10528
+ <xsl:attribute-set name="references-non-normative-title-style">
10529
+ </xsl:attribute-set>
10530
+
10531
+ <xsl:template name="refine_references-non-normative-title-style">
10532
+
10533
+ </xsl:template>
10534
+
10214
10535
  <!-- bibitem in Normative References (references/@normative="true") -->
10215
10536
  <xsl:attribute-set name="bibitem-normative-style">
10216
10537
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
10217
10538
  </xsl:attribute-set> <!-- bibitem-normative-style -->
10218
10539
 
10540
+ <xsl:template name="refine_bibitem-normative-style">
10541
+ </xsl:template>
10542
+
10219
10543
  <!-- bibitem in Normative References (references/@normative="true"), renders as list -->
10220
10544
  <xsl:attribute-set name="bibitem-normative-list-style">
10221
10545
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
10222
10546
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10223
10547
  </xsl:attribute-set> <!-- bibitem-normative-list-style -->
10224
10548
 
10549
+ <xsl:template name="refine_bibitem-normative-list-style">
10550
+ </xsl:template>
10551
+
10225
10552
  <xsl:attribute-set name="bibitem-non-normative-style">
10226
10553
  </xsl:attribute-set> <!-- bibitem-non-normative-style -->
10227
10554
 
10555
+ <xsl:template name="refine_bibitem-non-normative-style">
10556
+ </xsl:template>
10557
+
10228
10558
  <!-- bibitem in bibliography section (references/@normative="false"), renders as list -->
10229
10559
  <xsl:attribute-set name="bibitem-non-normative-list-style">
10230
10560
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
10231
10561
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10232
10562
  </xsl:attribute-set> <!-- bibitem-non-normative-list-style -->
10233
10563
 
10564
+ <xsl:template name="refine_bibitem-non-normative-list-style">
10565
+ </xsl:template>
10566
+
10234
10567
  <xsl:attribute-set name="bibitem-non-normative-list-item-style">
10235
10568
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10236
10569
  </xsl:attribute-set>
10237
10570
 
10571
+ <xsl:template name="refine_bibitem-non-normative-list-item-style">
10572
+ </xsl:template>
10573
+
10238
10574
  <!-- bibitem in bibliography section (references/@normative="false"), list body -->
10239
10575
  <xsl:attribute-set name="bibitem-normative-list-body-style">
10240
10576
  </xsl:attribute-set>
10241
10577
 
10578
+ <xsl:template name="refine_bibitem-normative-list-body-style">
10579
+ </xsl:template>
10580
+
10242
10581
  <xsl:attribute-set name="bibitem-non-normative-list-body-style">
10243
10582
  </xsl:attribute-set> <!-- bibitem-non-normative-list-body-style -->
10244
10583
 
10584
+ <xsl:template name="refine_bibitem-non-normative-list-body-style">
10585
+ </xsl:template>
10586
+
10245
10587
  <!-- footnote reference number for bibitem, in the text -->
10246
10588
  <xsl:attribute-set name="bibitem-note-fn-style">
10247
10589
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
@@ -10249,6 +10591,9 @@
10249
10591
  <xsl:attribute name="vertical-align">super</xsl:attribute>
10250
10592
  </xsl:attribute-set> <!-- bibitem-note-fn-style -->
10251
10593
 
10594
+ <xsl:template name="refine_bibitem-note-fn-style">
10595
+ </xsl:template>
10596
+
10252
10597
  <!-- footnote number on the page bottom -->
10253
10598
  <xsl:attribute-set name="bibitem-note-fn-number-style">
10254
10599
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
@@ -10266,6 +10611,9 @@
10266
10611
  <xsl:attribute-set name="references-non-normative-style">
10267
10612
  </xsl:attribute-set> <!-- references-non-normative-style -->
10268
10613
 
10614
+ <xsl:template name="refine_references-non-normative-style">
10615
+ </xsl:template>
10616
+
10269
10617
  <!-- ======================= -->
10270
10618
  <!-- Bibliography rendering -->
10271
10619
  <!-- ======================= -->
@@ -10307,6 +10655,7 @@
10307
10655
  <xsl:apply-templates select="mn:fmt-title[@columns = 1]"/>
10308
10656
 
10309
10657
  <fo:block xsl:use-attribute-sets="references-non-normative-style">
10658
+ <xsl:call-template name="refine_references-non-normative-style"/>
10310
10659
  <xsl:apply-templates select="node()[not(self::mn:fmt-title and @columns = 1)]"/>
10311
10660
  </fo:block>
10312
10661
  </xsl:template> <!-- references -->
@@ -10320,18 +10669,22 @@
10320
10669
  <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
10321
10670
  <xsl:call-template name="setNamedDestination"/>
10322
10671
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
10672
+ <xsl:call-template name="refine_bibitem-normative-style"/>
10673
+
10323
10674
  <xsl:call-template name="processBibitem"/>
10324
10675
  </fo:block>
10325
10676
 
10326
10677
  </xsl:template> <!-- bibitem -->
10327
10678
 
10328
10679
  <!-- Bibliography (non-normative references) -->
10329
- <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem | mn:references[not(@normative='true')]/mn:note" name="bibitem_non_normative" priority="2">
10680
+ <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem" name="bibitem_non_normative" priority="2">
10330
10681
  <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
10331
10682
  $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
10332
10683
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
10333
10684
  <xsl:call-template name="setNamedDestination"/>
10334
10685
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
10686
+ <xsl:call-template name="refine_bibitem-non-normative-list-style"/>
10687
+
10335
10688
  <fo:list-item>
10336
10689
  <fo:list-item-label end-indent="label-end()">
10337
10690
  <fo:block role="SKIP">
@@ -10344,6 +10697,7 @@
10344
10697
  </fo:list-item-label>
10345
10698
  <fo:list-item-body start-indent="body-start()">
10346
10699
  <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
10700
+ <xsl:call-template name="refine_bibitem-non-normative-list-body-style"/>
10347
10701
  <xsl:call-template name="processBibitem">
10348
10702
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
10349
10703
  </xsl:call-template>
@@ -10354,12 +10708,17 @@
10354
10708
 
10355
10709
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
10356
10710
 
10711
+ <!-- bibitem's notes will be processing in 'processBibitemFollowingNotes' -->
10712
+ <xsl:template match="mn:references/mn:note" priority="2"/> <!-- [not(@normative='true')] -->
10713
+
10357
10714
  <xsl:template name="insertListItem_Bibitem">
10358
10715
  <xsl:choose>
10359
10716
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
10360
10717
  <xsl:otherwise>
10361
10718
  <xsl:call-template name="setNamedDestination"/>
10362
10719
  <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
10720
+ <xsl:call-template name="refine_bibitem-non-normative-list-item-style"/>
10721
+
10363
10722
  <fo:list-item-label end-indent="label-end()">
10364
10723
  <fo:block role="SKIP">
10365
10724
  <fo:inline role="SKIP">
@@ -10370,16 +10729,18 @@
10370
10729
  </fo:block>
10371
10730
  </fo:list-item-label>
10372
10731
  <fo:list-item-body start-indent="body-start()">
10373
- <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
10732
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style"> <!-- role="SKIP" -->
10733
+ <xsl:call-template name="refine_bibitem-non-normative-list-body-style"/>
10374
10734
  <xsl:call-template name="processBibitem">
10375
10735
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
10376
10736
  </xsl:call-template>
10377
10737
  </fo:block>
10738
+ <xsl:call-template name="processBibitemFollowingNotes"/>
10378
10739
  </fo:list-item-body>
10379
10740
  </fo:list-item>
10380
10741
  </xsl:otherwise>
10381
10742
  </xsl:choose>
10382
- <xsl:apply-templates select="following-sibling::*[1]"> <!-- [self::mn:bibitem] -->
10743
+ <xsl:apply-templates select="following-sibling::*[self::mn:bibitem][1]">
10383
10744
  <xsl:with-param name="skip">false</xsl:with-param>
10384
10745
  </xsl:apply-templates>
10385
10746
  </xsl:template>
@@ -10395,25 +10756,16 @@
10395
10756
  <xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
10396
10757
  </xsl:apply-templates>
10397
10758
  <xsl:apply-templates select="mn:formattedref"/>
10759
+ <xsl:call-template name="processBibitemFollowingNotes"/>
10398
10760
  <!-- end bibitem processing -->
10399
-
10400
- <xsl:call-template name="processBibliographyNote"/>
10401
10761
  </xsl:template> <!-- processBibitem (bibitem) -->
10402
10762
 
10403
- <xsl:template name="processBibliographyNote">
10404
- <xsl:if test="self::mn:note">
10405
- <xsl:variable name="note_node">
10406
- <xsl:element name="{local-name(..)}" namespace="{$namespace_full}"> <!-- save parent context node for determining styles -->
10407
- <xsl:copy> <!-- skip @id -->
10408
- <xsl:copy-of select="node()"/>
10409
- </xsl:copy>
10410
- </xsl:element>
10411
- </xsl:variable>
10412
- <!-- <xsl:for-each select="xalan:nodeset($note_node)//mn:note">
10413
- <xsl:call-template name="note"/>
10414
- </xsl:for-each> -->
10763
+ <xsl:template name="processBibitemFollowingNotes">
10764
+ <!-- current context is bibitem element -->
10765
+ <xsl:variable name="bibitem_id" select="@id"/>
10766
+ <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]]">
10415
10767
  <xsl:call-template name="note"/>
10416
- </xsl:if>
10768
+ </xsl:for-each>
10417
10769
  </xsl:template>
10418
10770
 
10419
10771
  <xsl:template match="mn:title" mode="title">
@@ -10613,11 +10965,17 @@
10613
10965
  <!-- Index section styles -->
10614
10966
  <xsl:attribute-set name="indexsect-title-style">
10615
10967
  <xsl:attribute name="role">H1</xsl:attribute>
10616
- </xsl:attribute-set>
10968
+ </xsl:attribute-set> <!-- indexsect-title-style -->
10969
+
10970
+ <xsl:template name="refine_indexsect-title-style">
10971
+ </xsl:template>
10617
10972
 
10618
10973
  <xsl:attribute-set name="indexsect-clause-title-style">
10619
10974
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
10620
- </xsl:attribute-set>
10975
+ </xsl:attribute-set> <!-- indexsect-clause-title-style -->
10976
+
10977
+ <xsl:template name="refine_indexsect-clause-title-style">
10978
+ </xsl:template>
10621
10979
  <!-- End Index section styles -->
10622
10980
 
10623
10981
  <!-- =================== -->
@@ -10811,6 +11169,7 @@
10811
11169
 
10812
11170
  <xsl:template match="mn:indexsect/mn:fmt-title | mn:indexsect/mn:title" priority="4">
10813
11171
  <fo:block xsl:use-attribute-sets="indexsect-title-style">
11172
+ <xsl:call-template name="refine_indexsect-title-style"/>
10814
11173
  <!-- Index -->
10815
11174
  <xsl:apply-templates/>
10816
11175
  </fo:block>
@@ -10819,6 +11178,7 @@
10819
11178
  <xsl:template match="mn:indexsect/mn:clause/mn:fmt-title | mn:indexsect/mn:clause/mn:title" priority="4">
10820
11179
  <!-- Letter A, B, C, ... -->
10821
11180
  <fo:block xsl:use-attribute-sets="indexsect-clause-title-style">
11181
+ <xsl:call-template name="refine_indexsect-clause-title-style"/>
10822
11182
  <xsl:apply-templates/>
10823
11183
  </fo:block>
10824
11184
  </xsl:template>
@@ -11023,9 +11383,15 @@
11023
11383
  <xsl:attribute name="leader-pattern">dots</xsl:attribute>
11024
11384
  </xsl:attribute-set> <!-- END: toc-leader-style -->
11025
11385
 
11386
+ <xsl:template name="refine_toc-leader-style">
11387
+ </xsl:template>
11388
+
11026
11389
  <xsl:attribute-set name="toc-pagenumber-style">
11027
11390
  </xsl:attribute-set>
11028
11391
 
11392
+ <xsl:template name="refine_toc-pagenumber-style">
11393
+ </xsl:template>
11394
+
11029
11395
  <!-- List of Figures, Tables -->
11030
11396
  <xsl:attribute-set name="toc-listof-title-style">
11031
11397
  <xsl:attribute name="role">TOCI</xsl:attribute>
@@ -11041,6 +11407,9 @@
11041
11407
  <xsl:attribute name="role">SKIP</xsl:attribute>
11042
11408
  </xsl:attribute-set>
11043
11409
 
11410
+ <xsl:template name="refine_toc-listof-item-block-style">
11411
+ </xsl:template>
11412
+
11044
11413
  <xsl:attribute-set name="toc-listof-item-style">
11045
11414
  <xsl:attribute name="role">TOCI</xsl:attribute>
11046
11415
  <xsl:attribute name="text-align-last">justify</xsl:attribute>
@@ -11049,6 +11418,9 @@
11049
11418
  <xsl:attribute name="role">SKIP</xsl:attribute>
11050
11419
  </xsl:attribute-set>
11051
11420
 
11421
+ <xsl:template name="refine_toc-listof-item-style">
11422
+ </xsl:template>
11423
+
11052
11424
  <xsl:template name="processPrefaceSectionsDefault_Contents">
11053
11425
  <xsl:variable name="nodes_preface_">
11054
11426
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
@@ -12161,23 +12533,55 @@
12161
12533
  <!-- Ruby text (CJK languages) rendering -->
12162
12534
  <!-- ===================================== -->
12163
12535
  <!-- ===================================== -->
12536
+
12537
+ <xsl:attribute-set name="ruby-style">
12538
+ <xsl:attribute name="text-indent">0mm</xsl:attribute>
12539
+ <xsl:attribute name="last-line-end-indent">0mm</xsl:attribute>
12540
+ </xsl:attribute-set>
12541
+
12542
+ <xsl:template name="refine_ruby-style">
12543
+ <xsl:if test="not(ancestor::mn:ruby)">
12544
+ <xsl:attribute name="alignment-baseline">central</xsl:attribute>
12545
+ </xsl:if>
12546
+ <xsl:variable name="rt_text" select="mn:rt"/>
12547
+ <xsl:variable name="rb_text" select=".//mn:rb[not(mn:ruby)]"/>
12548
+ <!-- Example: width="2em" -->
12549
+ <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
12550
+ <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
12551
+ <xsl:variable name="text_width">
12552
+ <xsl:choose>
12553
+ <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
12554
+ <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
12555
+ </xsl:choose>
12556
+ </xsl:variable>
12557
+ <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
12558
+ </xsl:template> <!-- refine_ruby-style -->
12559
+
12560
+ <xsl:attribute-set name="rb-style">
12561
+ <xsl:attribute name="line-height">1em</xsl:attribute>
12562
+ <xsl:attribute name="text-align">center</xsl:attribute>
12563
+ </xsl:attribute-set>
12564
+
12565
+ <xsl:template name="refine_rb-style">
12566
+ </xsl:template>
12567
+
12568
+ <xsl:attribute-set name="rt-style">
12569
+ <xsl:attribute name="font-size">0.5em</xsl:attribute>
12570
+ <xsl:attribute name="text-align">center</xsl:attribute>
12571
+ <xsl:attribute name="line-height">1.2em</xsl:attribute>
12572
+ <xsl:attribute name="space-before">-1.4em</xsl:attribute>
12573
+ <xsl:attribute name="space-before.conditionality">retain</xsl:attribute>
12574
+ </xsl:attribute-set>
12575
+
12576
+ <xsl:template name="refine_rt-style">
12577
+ <xsl:if test="ancestor::mn:ruby[last()]//mn:ruby or ancestor::mn:rb">
12578
+ <xsl:attribute name="space-before">0em</xsl:attribute>
12579
+ </xsl:if>
12580
+ </xsl:template>
12581
+
12164
12582
  <xsl:template match="mn:ruby">
12165
- <fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
12166
- <xsl:if test="not(ancestor::mn:ruby)">
12167
- <xsl:attribute name="alignment-baseline">central</xsl:attribute>
12168
- </xsl:if>
12169
- <xsl:variable name="rt_text" select="mn:rt"/>
12170
- <xsl:variable name="rb_text" select=".//mn:rb[not(mn:ruby)]"/>
12171
- <!-- Example: width="2em" -->
12172
- <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
12173
- <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
12174
- <xsl:variable name="text_width">
12175
- <xsl:choose>
12176
- <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
12177
- <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
12178
- </xsl:choose>
12179
- </xsl:variable>
12180
- <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
12583
+ <fo:inline-container xsl:use-attribute-sets="ruby-style">
12584
+ <xsl:call-template name="refine_ruby-style"/>
12181
12585
 
12182
12586
  <xsl:choose>
12183
12587
  <xsl:when test="ancestor::mn:ruby">
@@ -12195,17 +12599,14 @@
12195
12599
  </xsl:template>
12196
12600
 
12197
12601
  <xsl:template match="mn:rb">
12198
- <fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
12602
+ <fo:block xsl:use-attribute-sets="rb-style"><xsl:call-template name="refine_rb-style"/><xsl:apply-templates/></fo:block>
12199
12603
  </xsl:template>
12200
12604
 
12201
12605
  <xsl:template match="mn:rt">
12202
- <fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
12203
- <xsl:if test="ancestor::mn:ruby[last()]//mn:ruby or ancestor::mn:rb">
12204
- <xsl:attribute name="space-before">0em</xsl:attribute>
12205
- </xsl:if>
12606
+ <fo:block xsl:use-attribute-sets="rt-style"> <!-- -->
12607
+ <xsl:call-template name="refine_rt-style"/>
12206
12608
  <xsl:apply-templates/>
12207
12609
  </fo:block>
12208
-
12209
12610
  </xsl:template>
12210
12611
 
12211
12612
  <!-- ===================================== -->
@@ -12214,6 +12615,18 @@
12214
12615
  <!-- ===================================== -->
12215
12616
  <!-- ===================================== -->
12216
12617
 
12618
+ <xsl:attribute-set name="annex-title-style">
12619
+ </xsl:attribute-set>
12620
+
12621
+ <xsl:template name="refine_annex-title-style">
12622
+ </xsl:template>
12623
+
12624
+ <xsl:attribute-set name="p-zzSTDTitle1-style">
12625
+ </xsl:attribute-set>
12626
+
12627
+ <xsl:template name="refine_p-zzSTDTitle1-style">
12628
+ </xsl:template>
12629
+
12217
12630
  <xsl:template name="processPrefaceSectionsDefault">
12218
12631
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
12219
12632
  <xsl:sort select="@displayorder" data-type="number"/>