metanorma-csa 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.
@@ -2218,10 +2218,16 @@
2218
2218
  <xsl:attribute-set name="license-statement-style">
2219
2219
  </xsl:attribute-set> <!-- license-statement-style -->
2220
2220
 
2221
+ <xsl:template name="refine_license-statement-style">
2222
+ </xsl:template>
2223
+
2221
2224
  <xsl:attribute-set name="license-statement-title-style">
2222
2225
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2223
2226
  </xsl:attribute-set> <!-- license-statement-title-style -->
2224
2227
 
2228
+ <xsl:template name="refine_license-statement-title-style">
2229
+ </xsl:template>
2230
+
2225
2231
  <xsl:attribute-set name="license-statement-p-style">
2226
2232
  </xsl:attribute-set> <!-- license-statement-p-style -->
2227
2233
 
@@ -2232,23 +2238,47 @@
2232
2238
  <xsl:attribute-set name="legal-statement-style">
2233
2239
  </xsl:attribute-set> <!-- legal-statement-style -->
2234
2240
 
2241
+ <xsl:template name="refine_legal-statement-style">
2242
+ </xsl:template>
2243
+
2235
2244
  <xsl:attribute-set name="legal-statement-title-style">
2236
2245
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2237
2246
  </xsl:attribute-set> <!-- legal-statement-title-style -->
2238
2247
 
2248
+ <xsl:template name="refine_legal-statement-title-style">
2249
+ </xsl:template>
2250
+
2239
2251
  <xsl:attribute-set name="legal-statement-p-style">
2240
2252
  </xsl:attribute-set> <!-- legal-statement-p-style -->
2241
2253
 
2254
+ <xsl:template name="refine_legal-statement-p-style">
2255
+ <xsl:if test="@align">
2256
+ <xsl:attribute name="text-align">
2257
+ <xsl:value-of select="@align"/>
2258
+ </xsl:attribute>
2259
+ </xsl:if>
2260
+ </xsl:template>
2261
+
2242
2262
  <xsl:attribute-set name="feedback-statement-style">
2243
2263
  </xsl:attribute-set> <!-- feedback-statement-style -->
2244
2264
 
2265
+ <xsl:template name="refine_feedback-statement-style">
2266
+ </xsl:template>
2267
+
2245
2268
  <xsl:attribute-set name="feedback-statement-title-style">
2246
2269
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2247
2270
  </xsl:attribute-set> <!-- feedback-statement-title-style -->
2248
2271
 
2272
+ <xsl:template name="refine_feedback-statement-title-style">
2273
+
2274
+ </xsl:template>
2275
+
2249
2276
  <xsl:attribute-set name="feedback-statement-p-style">
2250
2277
  </xsl:attribute-set> <!-- feedback-statement-p-style -->
2251
2278
 
2279
+ <xsl:template name="refine_feedback-statement-p-style">
2280
+ </xsl:template>
2281
+
2252
2282
  <!-- End boilerplate sections styles -->
2253
2283
 
2254
2284
  <!-- ================================= -->
@@ -2274,6 +2304,7 @@
2274
2304
 
2275
2305
  <xsl:template match="mn:license-statement">
2276
2306
  <fo:block xsl:use-attribute-sets="license-statement-style">
2307
+ <xsl:call-template name="refine_license-statement-style"/>
2277
2308
  <xsl:apply-templates/>
2278
2309
  </fo:block>
2279
2310
  </xsl:template> <!-- license-statement -->
@@ -2291,6 +2322,7 @@
2291
2322
  <xsl:template match="mn:legal-statement">
2292
2323
  <xsl:param name="isLegacy">false</xsl:param>
2293
2324
  <fo:block xsl:use-attribute-sets="legal-statement-style">
2325
+ <xsl:call-template name="refine_legal-statement-style"/>
2294
2326
  <xsl:apply-templates/>
2295
2327
  </fo:block>
2296
2328
  </xsl:template> <!-- legal-statement -->
@@ -2460,6 +2492,27 @@
2460
2492
  <xsl:attribute-set name="sourcecode-container-style">
2461
2493
  </xsl:attribute-set>
2462
2494
 
2495
+ <xsl:template name="refine_sourcecode-container-style">
2496
+ <xsl:if test="not(ancestor::mn:li) or ancestor::mn:example">
2497
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2498
+ </xsl:if>
2499
+
2500
+ <xsl:if test="ancestor::mn:example">
2501
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2502
+ </xsl:if>
2503
+
2504
+ <xsl:copy-of select="@id"/>
2505
+
2506
+ <xsl:if test="parent::mn:note">
2507
+ <xsl:attribute name="margin-left">
2508
+ <xsl:choose>
2509
+ <xsl:when test="not(ancestor::mn:table)"><xsl:value-of select="$note-body-indent"/></xsl:when>
2510
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2511
+ </xsl:choose>
2512
+ </xsl:attribute>
2513
+ </xsl:if>
2514
+ </xsl:template>
2515
+
2463
2516
  <xsl:attribute-set name="sourcecode-style">
2464
2517
  <xsl:attribute name="white-space">pre</xsl:attribute>
2465
2518
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -2481,6 +2534,9 @@
2481
2534
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
2482
2535
  </xsl:attribute-set> <!-- sourcecode-name-style -->
2483
2536
 
2537
+ <xsl:template name="refine_sourcecode-name-style">
2538
+ </xsl:template>
2539
+
2484
2540
  <xsl:template name="add-zero-spaces-equal">
2485
2541
  <xsl:param name="text" select="."/>
2486
2542
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
@@ -2568,24 +2624,8 @@
2568
2624
  <xsl:otherwise>
2569
2625
  <fo:block-container xsl:use-attribute-sets="sourcecode-container-style" role="SKIP">
2570
2626
 
2571
- <xsl:if test="not(ancestor::mn:li) or ancestor::mn:example">
2572
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2573
- </xsl:if>
2574
-
2575
- <xsl:if test="ancestor::mn:example">
2576
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
2577
- </xsl:if>
2578
-
2579
- <xsl:copy-of select="@id"/>
2627
+ <xsl:call-template name="refine_sourcecode-container-style"/>
2580
2628
 
2581
- <xsl:if test="parent::mn:note">
2582
- <xsl:attribute name="margin-left">
2583
- <xsl:choose>
2584
- <xsl:when test="not(ancestor::mn:table)"><xsl:value-of select="$note-body-indent"/></xsl:when>
2585
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2586
- </xsl:choose>
2587
- </xsl:attribute>
2588
- </xsl:if>
2589
2629
  <fo:block-container margin-left="0mm" role="SKIP">
2590
2630
 
2591
2631
  <fo:block xsl:use-attribute-sets="sourcecode-style">
@@ -2912,6 +2952,7 @@
2912
2952
  <xsl:template match="mn:sourcecode/mn:fmt-name">
2913
2953
  <xsl:if test="normalize-space() != ''">
2914
2954
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2955
+ <xsl:call-template name="refine_sourcecode-name-style"/>
2915
2956
  <xsl:apply-templates/>
2916
2957
  </fo:block>
2917
2958
  </xsl:if>
@@ -2960,12 +3001,31 @@
2960
3001
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2961
3002
  <xsl:attribute name="font-family"><xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
2962
3003
  <xsl:attribute name="line-height">113%</xsl:attribute>
2963
- </xsl:attribute-set>
3004
+ </xsl:attribute-set> <!-- pre-style -->
3005
+
3006
+ <xsl:template name="refine_pre-style">
3007
+ </xsl:template>
2964
3008
 
2965
3009
  <xsl:attribute-set name="tt-style">
2966
3010
  <xsl:attribute name="font-family"><xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
2967
3011
  </xsl:attribute-set>
2968
3012
 
3013
+ <xsl:template name="refine_tt-style">
3014
+ <xsl:variable name="_font-size">10 <!-- inherit -->
3015
+ </xsl:variable>
3016
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3017
+ <xsl:if test="$font-size != ''">
3018
+ <xsl:attribute name="font-size">
3019
+ <xsl:choose>
3020
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
3021
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
3022
+ <xsl:when test="ancestor::mn:note or ancestor::mn:example"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3023
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3024
+ </xsl:choose>
3025
+ </xsl:attribute>
3026
+ </xsl:if>
3027
+ </xsl:template>
3028
+
2969
3029
  <xsl:variable name="color-added-text">
2970
3030
  <xsl:text>rgb(0, 255, 0)</xsl:text>
2971
3031
  </xsl:variable>
@@ -2978,9 +3038,14 @@
2978
3038
  <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
2979
3039
  </xsl:attribute-set>
2980
3040
 
3041
+ <xsl:template name="refine_add-style">
3042
+ </xsl:template>
3043
+
2981
3044
  <xsl:variable name="add-style">
2982
- <add-style xsl:use-attribute-sets="add-style"/>
2983
- </xsl:variable>
3045
+ <add-style xsl:use-attribute-sets="add-style">
3046
+ <xsl:call-template name="refine_add-style"/>
3047
+ </add-style>
3048
+ </xsl:variable>
2984
3049
  <xsl:template name="append_add-style">
2985
3050
  <xsl:copy-of select="xalan:nodeset($add-style)/add-style/@*"/>
2986
3051
  </xsl:template>
@@ -2993,24 +3058,77 @@
2993
3058
  <xsl:attribute name="text-decoration">line-through</xsl:attribute>
2994
3059
  </xsl:attribute-set>
2995
3060
 
3061
+ <xsl:template name="refine_del-style">
3062
+ </xsl:template>
3063
+
3064
+ <xsl:attribute-set name="strong-style">
3065
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3066
+ </xsl:attribute-set>
3067
+
3068
+ <xsl:template name="refine_strong_style">
3069
+ <xsl:if test="ancestor::*['preferred']">
3070
+ <xsl:attribute name="role">SKIP</xsl:attribute>
3071
+ </xsl:if>
3072
+ </xsl:template> <!-- refine_strong_style -->
3073
+
3074
+ <xsl:attribute-set name="em-style">
3075
+ <xsl:attribute name="font-style">italic</xsl:attribute>
3076
+ </xsl:attribute-set>
3077
+
3078
+ <xsl:template name="refine_em_style">
3079
+ </xsl:template> <!-- refine_em_style -->
3080
+
3081
+ <xsl:attribute-set name="sup-style">
3082
+ <xsl:attribute name="font-size">80%</xsl:attribute>
3083
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
3084
+ </xsl:attribute-set>
3085
+
3086
+ <xsl:template name="refine_sup-style">
3087
+ </xsl:template>
3088
+
3089
+ <xsl:attribute-set name="sub-style">
3090
+ <xsl:attribute name="font-size">80%</xsl:attribute>
3091
+ <xsl:attribute name="vertical-align">sub</xsl:attribute>
3092
+ </xsl:attribute-set>
3093
+
3094
+ <xsl:template name="refine_sub-style">
3095
+ </xsl:template>
3096
+
3097
+ <xsl:attribute-set name="underline-style">
3098
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
3099
+ </xsl:attribute-set>
3100
+
3101
+ <xsl:template name="refine_underline-style">
3102
+ </xsl:template>
3103
+
3104
+ <xsl:attribute-set name="hi-style">
3105
+ <xsl:attribute name="background-color">yellow</xsl:attribute>
3106
+ </xsl:attribute-set>
3107
+
3108
+ <xsl:template name="refine_hi-style">
3109
+ </xsl:template>
3110
+
3111
+ <xsl:attribute-set name="strike-style">
3112
+ <xsl:attribute name="text-decoration">line-through</xsl:attribute>
3113
+ </xsl:attribute-set>
3114
+
3115
+ <xsl:template name="refine_strike-style">
3116
+ </xsl:template>
3117
+
2996
3118
  <xsl:template match="mn:br">
2997
3119
  <xsl:value-of select="$linebreak"/>
2998
3120
  </xsl:template>
2999
3121
 
3000
- <xsl:template match="mn:em">
3001
- <fo:inline font-style="italic">
3002
- <xsl:call-template name="refine_italic_style"/>
3122
+ <xsl:template match="mn:em">
3123
+ <fo:inline xsl:use-attribute-sets="em-style">
3124
+ <xsl:call-template name="refine_em_style"/>
3003
3125
  <xsl:apply-templates/>
3004
3126
  </fo:inline>
3005
3127
  </xsl:template>
3006
3128
 
3007
- <xsl:template name="refine_italic_style">
3008
- </xsl:template>
3009
-
3010
3129
  <xsl:template match="mn:strong | *[local-name()='b']">
3011
3130
  <xsl:param name="split_keep-within-line"/>
3012
- <fo:inline font-weight="bold">
3013
-
3131
+ <fo:inline xsl:use-attribute-sets="strong-style">
3014
3132
  <xsl:call-template name="refine_strong_style"/>
3015
3133
 
3016
3134
  <xsl:apply-templates>
@@ -3019,44 +3137,27 @@
3019
3137
  </fo:inline>
3020
3138
  </xsl:template>
3021
3139
 
3022
- <xsl:template name="refine_strong_style">
3023
- <xsl:if test="ancestor::*['preferred']">
3024
- <xsl:attribute name="role">SKIP</xsl:attribute>
3025
- </xsl:if>
3026
- </xsl:template>
3027
-
3028
3140
  <xsl:template match="*[local-name()='padding']">
3029
3141
  <fo:inline padding-right="{@value}"> </fo:inline>
3030
3142
  </xsl:template>
3031
3143
 
3032
3144
  <xsl:template match="mn:sup">
3033
- <fo:inline font-size="80%" vertical-align="super">
3145
+ <fo:inline xsl:use-attribute-sets="sup-style">
3146
+ <xsl:call-template name="refine_sup-style"/>
3034
3147
  <xsl:apply-templates/>
3035
3148
  </fo:inline>
3036
3149
  </xsl:template>
3037
3150
 
3038
3151
  <xsl:template match="mn:sub">
3039
- <fo:inline font-size="80%" vertical-align="sub">
3152
+ <fo:inline xsl:use-attribute-sets="sub-style">
3153
+ <xsl:call-template name="refine_sub-style"/>
3040
3154
  <xsl:apply-templates/>
3041
3155
  </fo:inline>
3042
3156
  </xsl:template>
3043
3157
 
3044
3158
  <xsl:template match="mn:tt">
3045
3159
  <fo:inline xsl:use-attribute-sets="tt-style">
3046
-
3047
- <xsl:variable name="_font-size">10 <!-- inherit -->
3048
- </xsl:variable>
3049
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3050
- <xsl:if test="$font-size != ''">
3051
- <xsl:attribute name="font-size">
3052
- <xsl:choose>
3053
- <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
3054
- <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
3055
- <xsl:when test="ancestor::mn:note or ancestor::mn:example"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3056
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3057
- </xsl:choose>
3058
- </xsl:attribute>
3059
- </xsl:if>
3160
+ <xsl:call-template name="refine_tt-style"/>
3060
3161
  <xsl:apply-templates/>
3061
3162
  </fo:inline>
3062
3163
  </xsl:template> <!-- tt -->
@@ -3075,7 +3176,8 @@
3075
3176
  </xsl:template>
3076
3177
 
3077
3178
  <xsl:template match="mn:underline">
3078
- <fo:inline text-decoration="underline">
3179
+ <fo:inline xsl:use-attribute-sets="underline-style">
3180
+ <xsl:call-template name="refine_underline-style"/>
3079
3181
  <xsl:apply-templates/>
3080
3182
  </fo:inline>
3081
3183
  </xsl:template>
@@ -3233,6 +3335,7 @@
3233
3335
 
3234
3336
  <xsl:template match="mn:del">
3235
3337
  <fo:inline xsl:use-attribute-sets="del-style">
3338
+ <xsl:call-template name="refine_del-style"/>
3236
3339
  <xsl:apply-templates/>
3237
3340
  </fo:inline>
3238
3341
  </xsl:template>
@@ -3242,7 +3345,8 @@
3242
3345
 
3243
3346
  <!-- highlight text -->
3244
3347
  <xsl:template match="mn:hi | mn:span[@class = 'fmt-hi']" priority="3">
3245
- <fo:inline background-color="yellow">
3348
+ <fo:inline xsl:use-attribute-sets="hi-style">
3349
+ <xsl:call-template name="refine_hi-style"/>
3246
3350
  <xsl:apply-templates/>
3247
3351
  </fo:inline>
3248
3352
  </xsl:template>
@@ -3328,7 +3432,8 @@
3328
3432
  </xsl:template>
3329
3433
 
3330
3434
  <xsl:template match="mn:strike">
3331
- <fo:inline text-decoration="line-through">
3435
+ <fo:inline xsl:use-attribute-sets="strike-style">
3436
+ <xsl:call-template name="refine_strike-style"/>
3332
3437
  <xsl:apply-templates/>
3333
3438
  </fo:inline>
3334
3439
  </xsl:template>
@@ -3408,6 +3513,7 @@
3408
3513
 
3409
3514
  <xsl:template match="mn:pre" name="pre">
3410
3515
  <fo:block xsl:use-attribute-sets="pre-style">
3516
+ <xsl:call-template name="refine_pre-style"/>
3411
3517
  <xsl:copy-of select="@id"/>
3412
3518
  <xsl:choose>
3413
3519
 
@@ -3438,22 +3544,40 @@
3438
3544
  <xsl:attribute-set name="permission-style">
3439
3545
  </xsl:attribute-set>
3440
3546
 
3547
+ <xsl:template name="refine_permission-style">
3548
+ </xsl:template>
3549
+
3441
3550
  <xsl:attribute-set name="permission-name-style">
3442
3551
  </xsl:attribute-set>
3443
3552
 
3553
+ <xsl:template name="refine_permission-name-style">
3554
+ </xsl:template>
3555
+
3444
3556
  <xsl:attribute-set name="permission-label-style">
3445
3557
  </xsl:attribute-set>
3446
3558
 
3559
+ <xsl:template name="refine_permission-label-style">
3560
+ </xsl:template>
3561
+
3447
3562
  <xsl:attribute-set name="requirement-style">
3448
3563
  </xsl:attribute-set>
3449
3564
 
3565
+ <xsl:template name="refine_requirement-style">
3566
+ </xsl:template>
3567
+
3450
3568
  <xsl:attribute-set name="requirement-name-style">
3451
3569
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3452
3570
  </xsl:attribute-set>
3453
3571
 
3572
+ <xsl:template name="refine_requirement-name-style">
3573
+ </xsl:template>
3574
+
3454
3575
  <xsl:attribute-set name="requirement-label-style">
3455
3576
  </xsl:attribute-set>
3456
3577
 
3578
+ <xsl:template name="refine_requirement-label-style">
3579
+ </xsl:template>
3580
+
3457
3581
  <xsl:attribute-set name="subject-style">
3458
3582
  </xsl:attribute-set>
3459
3583
 
@@ -3481,18 +3605,28 @@
3481
3605
  <xsl:attribute-set name="recommendation-style">
3482
3606
  </xsl:attribute-set>
3483
3607
 
3608
+ <xsl:template name="refine_recommendation-style">
3609
+ </xsl:template>
3610
+
3484
3611
  <xsl:attribute-set name="recommendation-name-style">
3485
3612
  </xsl:attribute-set>
3486
3613
 
3614
+ <xsl:template name="refine_recommendation-name-style">
3615
+ </xsl:template>
3616
+
3487
3617
  <xsl:attribute-set name="recommendation-label-style">
3488
3618
  </xsl:attribute-set>
3489
3619
 
3620
+ <xsl:template name="refine_recommendation-label-style">
3621
+ </xsl:template>
3622
+
3490
3623
  <!-- ========== -->
3491
3624
  <!-- permission -->
3492
3625
  <!-- ========== -->
3493
3626
  <xsl:template match="mn:permission">
3494
3627
  <xsl:call-template name="setNamedDestination"/>
3495
3628
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
3629
+ <xsl:call-template name="refine_permission-style"/>
3496
3630
  <xsl:apply-templates select="mn:fmt-name"/>
3497
3631
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
3498
3632
  </fo:block>
@@ -3501,6 +3635,7 @@
3501
3635
  <xsl:template match="mn:permission/mn:fmt-name">
3502
3636
  <xsl:if test="normalize-space() != ''">
3503
3637
  <fo:block xsl:use-attribute-sets="permission-name-style">
3638
+ <xsl:call-template name="refine_permission-name-style"/>
3504
3639
  <xsl:apply-templates/>
3505
3640
  </fo:block>
3506
3641
  </xsl:if>
@@ -3508,6 +3643,7 @@
3508
3643
 
3509
3644
  <xsl:template match="mn:permission/mn:label">
3510
3645
  <fo:block xsl:use-attribute-sets="permission-label-style">
3646
+ <xsl:call-template name="refine_permission-label-style"/>
3511
3647
  <xsl:apply-templates/>
3512
3648
  </fo:block>
3513
3649
  </xsl:template>
@@ -3520,6 +3656,7 @@
3520
3656
  <xsl:template match="mn:requirement">
3521
3657
  <xsl:call-template name="setNamedDestination"/>
3522
3658
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
3659
+ <xsl:call-template name="refine_requirement-style"/>
3523
3660
  <xsl:apply-templates select="mn:fmt-name"/>
3524
3661
  <xsl:apply-templates select="mn:label"/>
3525
3662
  <xsl:apply-templates select="@obligation"/>
@@ -3532,6 +3669,7 @@
3532
3669
  <xsl:if test="normalize-space() != ''">
3533
3670
 
3534
3671
  <fo:block xsl:use-attribute-sets="requirement-name-style">
3672
+ <xsl:call-template name="refine_requirement-name-style"/>
3535
3673
  <xsl:apply-templates/>
3536
3674
  </fo:block>
3537
3675
  </xsl:if>
@@ -3539,6 +3677,7 @@
3539
3677
 
3540
3678
  <xsl:template match="mn:requirement/mn:label">
3541
3679
  <fo:block xsl:use-attribute-sets="requirement-label-style">
3680
+ <xsl:call-template name="refine_requirement-label-style"/>
3542
3681
  <xsl:apply-templates/>
3543
3682
  </fo:block>
3544
3683
  </xsl:template>
@@ -3564,6 +3703,7 @@
3564
3703
  <xsl:template match="mn:recommendation">
3565
3704
  <xsl:call-template name="setNamedDestination"/>
3566
3705
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
3706
+ <xsl:call-template name="refine_recommendation-style"/>
3567
3707
  <xsl:apply-templates select="mn:fmt-name"/>
3568
3708
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
3569
3709
  </fo:block>
@@ -3573,6 +3713,7 @@
3573
3713
  <xsl:if test="normalize-space() != ''">
3574
3714
 
3575
3715
  <fo:block xsl:use-attribute-sets="recommendation-name-style">
3716
+ <xsl:call-template name="refine_recommendation-name-style"/>
3576
3717
  <xsl:apply-templates/>
3577
3718
  </fo:block>
3578
3719
  </xsl:if>
@@ -3580,6 +3721,7 @@
3580
3721
 
3581
3722
  <xsl:template match="mn:recommendation/mn:label">
3582
3723
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
3724
+ <xsl:call-template name="refine_recommendation-label-style"/>
3583
3725
  <xsl:apply-templates/>
3584
3726
  </fo:block>
3585
3727
  </xsl:template>
@@ -3760,36 +3902,66 @@
3760
3902
  <xsl:attribute-set name="term-style">
3761
3903
  </xsl:attribute-set> <!-- term-style -->
3762
3904
 
3905
+ <xsl:template name="refine_term-style">
3906
+ </xsl:template>
3907
+
3763
3908
  <xsl:attribute-set name="term-name-style">
3764
3909
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3765
3910
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3766
3911
  </xsl:attribute-set> <!-- term-name-style -->
3767
3912
 
3768
- <xsl:attribute-set name="preferred-block-style">
3913
+ <xsl:template name="refine_term-name-style">
3914
+ </xsl:template>
3915
+
3916
+ <xsl:attribute-set name="preferred-block-style">
3769
3917
  </xsl:attribute-set> <!-- preferred-block-style -->
3770
3918
 
3919
+ <xsl:template name="refine_preferred-block-style">
3920
+ </xsl:template>
3921
+
3771
3922
  <xsl:attribute-set name="preferred-term-style">
3772
3923
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3773
3924
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3774
3925
  <xsl:attribute name="line-height">1</xsl:attribute>
3775
3926
  </xsl:attribute-set> <!-- preferred-term-style -->
3776
3927
 
3928
+ <xsl:template name="refine_preferred-term-style">
3929
+ <xsl:if test="mn:strong">
3930
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
3931
+ </xsl:if>
3932
+ </xsl:template>
3933
+
3777
3934
  <xsl:attribute-set name="domain-style">
3778
3935
  </xsl:attribute-set> <!-- domain-style -->
3779
3936
 
3937
+ <xsl:template name="refine_domain-style">
3938
+ </xsl:template>
3939
+
3780
3940
  <xsl:attribute-set name="admitted-style">
3781
3941
  </xsl:attribute-set> <!-- admitted-style -->
3782
3942
 
3943
+ <xsl:template name="refine_admitted-style">
3944
+ </xsl:template>
3945
+
3783
3946
  <xsl:attribute-set name="deprecates-style">
3784
3947
  </xsl:attribute-set> <!-- deprecates-style -->
3785
3948
 
3949
+ <xsl:template name="refine_deprecates-style">
3950
+ </xsl:template>
3951
+
3786
3952
  <xsl:attribute-set name="related-block-style" use-attribute-sets="preferred-block-style">
3787
3953
  </xsl:attribute-set>
3788
3954
 
3955
+ <xsl:template name="refine_related-block-style">
3956
+ </xsl:template>
3957
+
3789
3958
  <xsl:attribute-set name="definition-style">
3790
3959
  <xsl:attribute name="space-after">6pt</xsl:attribute>
3791
3960
  </xsl:attribute-set> <!-- definition-style -->
3792
3961
 
3962
+ <xsl:template name="refine_definition-style">
3963
+ </xsl:template>
3964
+
3793
3965
  <xsl:attribute-set name="termsource-style">
3794
3966
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
3795
3967
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
@@ -3801,11 +3973,17 @@
3801
3973
  <xsl:attribute-set name="termsource-text-style">
3802
3974
  </xsl:attribute-set> <!-- termsource-text-style -->
3803
3975
 
3976
+ <xsl:template name="refine_termsource-text-style">
3977
+ </xsl:template>
3978
+
3804
3979
  <xsl:attribute-set name="origin-style">
3805
3980
  <xsl:attribute name="color">rgb(33, 94, 159)</xsl:attribute>
3806
3981
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
3807
3982
  </xsl:attribute-set> <!-- origin-style -->
3808
3983
 
3984
+ <xsl:template name="refine_origin-style">
3985
+ </xsl:template>
3986
+
3809
3987
  <!-- ====== -->
3810
3988
  <!-- term -->
3811
3989
  <!-- ====== -->
@@ -3821,9 +3999,8 @@
3821
3999
  <xsl:template match="mn:term">
3822
4000
  <xsl:call-template name="setNamedDestination"/>
3823
4001
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
4002
+ <xsl:call-template name="refine_term-style"/>
3824
4003
 
3825
- <xsl:if test="parent::mn:term and not(preceding-sibling::mn:term)">
3826
- </xsl:if>
3827
4004
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
3828
4005
  </fo:block>
3829
4006
  </xsl:template>
@@ -3899,6 +4076,7 @@
3899
4076
  <!-- text SOURCE: -->
3900
4077
  <xsl:template match="mn:fmt-termsource/mn:strong[1][following-sibling::*[1][self::mn:fmt-origin]]/text()">
3901
4078
  <fo:inline xsl:use-attribute-sets="termsource-text-style">
4079
+ <xsl:call-template name="refine_termsource-text-style"/>
3902
4080
  <xsl:value-of select="."/>
3903
4081
  </fo:inline>
3904
4082
  </xsl:template>
@@ -3911,6 +4089,7 @@
3911
4089
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
3912
4090
  </xsl:if>
3913
4091
  <fo:inline xsl:use-attribute-sets="origin-style">
4092
+ <xsl:call-template name="refine_origin-style"/>
3914
4093
  <xsl:apply-templates/>
3915
4094
  </fo:inline>
3916
4095
  </fo:basic-link>
@@ -3965,9 +4144,12 @@
3965
4144
  </xsl:variable>
3966
4145
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
3967
4146
 
4147
+ <xsl:call-template name="refine_preferred-block-style"/>
4148
+
3968
4149
  <xsl:if test="parent::mn:term and not(preceding-sibling::mn:fmt-preferred)"> <!-- if first preffered in term, then display term's name -->
3969
4150
 
3970
4151
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
4152
+ <xsl:call-template name="refine_term-name-style"/>
3971
4153
 
3972
4154
  <xsl:for-each select="ancestor::mn:term[1]/mn:fmt-name"><!-- change context -->
3973
4155
  <xsl:call-template name="setIDforNamedDestination"/>
@@ -3978,7 +4160,7 @@
3978
4160
  </xsl:if>
3979
4161
 
3980
4162
  <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
3981
- <xsl:call-template name="setStyle_preferred"/>
4163
+ <xsl:call-template name="refine_preferred-term-style"/>
3982
4164
 
3983
4165
  <xsl:apply-templates/>
3984
4166
  </fo:block>
@@ -3999,22 +4181,18 @@
3999
4181
 
4000
4182
  <xsl:template match="mn:fmt-admitted">
4001
4183
  <fo:block xsl:use-attribute-sets="admitted-style">
4184
+ <xsl:call-template name="refine_admitted-style"/>
4002
4185
  <xsl:apply-templates/>
4003
4186
  </fo:block>
4004
4187
  </xsl:template>
4005
4188
 
4006
4189
  <xsl:template match="mn:fmt-deprecates">
4007
4190
  <fo:block xsl:use-attribute-sets="deprecates-style">
4191
+ <xsl:call-template name="refine_deprecates-style"/>
4008
4192
  <xsl:apply-templates/>
4009
4193
  </fo:block>
4010
4194
  </xsl:template>
4011
4195
 
4012
- <xsl:template name="setStyle_preferred">
4013
- <xsl:if test="mn:strong">
4014
- <xsl:attribute name="font-weight">normal</xsl:attribute>
4015
- </xsl:if>
4016
- </xsl:template>
4017
-
4018
4196
  <!-- regarding ISO 10241-1:2011, If there is more than one preferred term, each preferred term follows the previous one on a new line. -->
4019
4197
  <!-- in metanorma xml preferred terms delimited by semicolons -->
4020
4198
  <xsl:template match="mn:fmt-preferred/text()[contains(., ';')] | mn:fmt-preferred/mn:strong/text()[contains(., ';')]">
@@ -4024,6 +4202,7 @@
4024
4202
 
4025
4203
  <xsl:template match="mn:fmt-related">
4026
4204
  <fo:block role="SKIP" xsl:use-attribute-sets="related-block-style">
4205
+ <xsl:call-template name="refine_related-block-style"/>
4027
4206
  <xsl:apply-templates/>
4028
4207
  </fo:block>
4029
4208
  </xsl:template>
@@ -4038,6 +4217,7 @@
4038
4217
  <!-- ========== -->
4039
4218
  <xsl:template match="mn:fmt-definition">
4040
4219
  <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
4220
+ <xsl:call-template name="refine_definition-style"/>
4041
4221
  <xsl:apply-templates/>
4042
4222
  </fo:block>
4043
4223
  </xsl:template>
@@ -4087,6 +4267,9 @@
4087
4267
  <xsl:attribute name="margin-right">12.5mm</xsl:attribute>
4088
4268
  </xsl:attribute-set> <!-- example-body-style -->
4089
4269
 
4270
+ <xsl:template name="refine_example-body-style">
4271
+ </xsl:template>
4272
+
4090
4273
  <xsl:attribute-set name="example-name-style">
4091
4274
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4092
4275
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -4136,6 +4319,8 @@
4136
4319
  <xsl:when test="contains($element, 'block')">
4137
4320
  <fo:block xsl:use-attribute-sets="example-p-style">
4138
4321
 
4322
+ <xsl:call-template name="refine_example-p-style"/>
4323
+
4139
4324
  <xsl:apply-templates/>
4140
4325
  </fo:block>
4141
4326
  </xsl:when>
@@ -4187,6 +4372,7 @@
4187
4372
  </fo:block>
4188
4373
 
4189
4374
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
4375
+ <xsl:call-template name="refine_example-body-style"/>
4190
4376
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
4191
4377
  <xsl:variable name="example_body">
4192
4378
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]">
@@ -4249,6 +4435,7 @@
4249
4435
  <xsl:if test="*[not(self::mn:fmt-name)][position() &gt; 1]">
4250
4436
  <!-- display further elements in blocks -->
4251
4437
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
4438
+ <xsl:call-template name="refine_example-body-style"/>
4252
4439
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
4253
4440
  <xsl:apply-templates select="*[not(self::mn:fmt-name)][position() &gt; 1]">
4254
4441
  <xsl:with-param name="fo_element" select="'block'"/>
@@ -4474,6 +4661,9 @@
4474
4661
  <!-- <xsl:attribute name="padding-right">5mm</xsl:attribute> -->
4475
4662
  </xsl:attribute-set> <!-- table-fn-number-style -->
4476
4663
 
4664
+ <xsl:template name="refine_table-fn-number-style">
4665
+ </xsl:template>
4666
+
4477
4667
  <xsl:attribute-set name="table-fmt-fn-label-style">
4478
4668
  <xsl:attribute name="font-size">80%</xsl:attribute>
4479
4669
  </xsl:attribute-set> <!-- table-fmt-fn-label-style -->
@@ -4481,30 +4671,12 @@
4481
4671
  <xsl:template name="refine_table-fmt-fn-label-style">
4482
4672
  </xsl:template>
4483
4673
 
4484
- <xsl:attribute-set name="fn-container-body-style">
4485
- <xsl:attribute name="text-indent">0</xsl:attribute>
4486
- <xsl:attribute name="start-indent">0</xsl:attribute>
4487
- </xsl:attribute-set>
4488
-
4489
4674
  <xsl:attribute-set name="table-fn-body-style">
4490
4675
  </xsl:attribute-set>
4491
4676
 
4492
- <xsl:attribute-set name="figure-fn-number-style">
4493
- <xsl:attribute name="padding-right">5mm</xsl:attribute>
4494
- </xsl:attribute-set> <!-- figure-fn-number-style -->
4495
-
4496
- <xsl:attribute-set name="figure-fmt-fn-label-style">
4497
- <xsl:attribute name="font-size">80%</xsl:attribute>
4498
- <xsl:attribute name="vertical-align">super</xsl:attribute>
4499
- </xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
4500
-
4501
- <xsl:template name="refine_figure-fmt-fn-label-style">
4677
+ <xsl:template name="refine_table-fn-body-style">
4502
4678
  </xsl:template>
4503
4679
 
4504
- <xsl:attribute-set name="figure-fn-body-style">
4505
- <xsl:attribute name="text-align">justify</xsl:attribute>
4506
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
4507
- </xsl:attribute-set>
4508
4680
  <!-- ========================== -->
4509
4681
  <!-- END Table styles -->
4510
4682
  <!-- ========================== -->
@@ -5781,6 +5953,7 @@
5781
5953
  </xsl:apply-templates>
5782
5954
 
5783
5955
  <fo:inline xsl:use-attribute-sets="table-fn-body-style">
5956
+ <xsl:call-template name="refine_table-fn-body-style"/>
5784
5957
  <!-- <xsl:copy-of select="./node()"/> -->
5785
5958
  <xsl:apply-templates/>
5786
5959
  </fo:inline>
@@ -5799,6 +5972,7 @@
5799
5972
  <xsl:param name="process">false</xsl:param>
5800
5973
  <xsl:if test="$process = 'true'">
5801
5974
  <fo:inline xsl:use-attribute-sets="table-fn-number-style" role="SKIP">
5975
+ <xsl:call-template name="refine_table-fn-number-style"/>
5802
5976
 
5803
5977
  <!-- tab is padding-right -->
5804
5978
  <xsl:apply-templates select=".//mn:tab">
@@ -6670,9 +6844,18 @@
6670
6844
  <xsl:attribute-set name="dl-block-style">
6671
6845
  </xsl:attribute-set>
6672
6846
 
6847
+ <xsl:template name="refine_dl-block-style">
6848
+ <xsl:if test="@key = 'true' and ancestor::mn:figure">
6849
+ <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
6850
+ </xsl:if>
6851
+ </xsl:template>
6852
+
6673
6853
  <xsl:attribute-set name="dt-row-style">
6674
6854
  </xsl:attribute-set>
6675
6855
 
6856
+ <xsl:template name="refine_dt-row-style">
6857
+ </xsl:template>
6858
+
6676
6859
  <xsl:attribute-set name="dt-cell-style">
6677
6860
  </xsl:attribute-set>
6678
6861
 
@@ -6691,6 +6874,9 @@
6691
6874
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
6692
6875
  </xsl:attribute-set> <!-- dl-name-style -->
6693
6876
 
6877
+ <xsl:template name="refine_dl-name-style">
6878
+ </xsl:template>
6879
+
6694
6880
  <xsl:attribute-set name="dd-cell-style">
6695
6881
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
6696
6882
  </xsl:attribute-set>
@@ -6729,9 +6915,7 @@
6729
6915
  <!-- <dl><xsl:copy-of select="."/></dl> -->
6730
6916
  <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
6731
6917
 
6732
- <xsl:if test="@key = 'true' and ancestor::mn:figure">
6733
- <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
6734
- </xsl:if>
6918
+ <xsl:call-template name="refine_dl-block-style"/>
6735
6919
 
6736
6920
  <xsl:call-template name="setBlockSpanAll"/>
6737
6921
  <xsl:if test="not(ancestor::mn:quote)">
@@ -7027,6 +7211,8 @@
7027
7211
  <xsl:if test="$process = 'true'">
7028
7212
  <fo:block xsl:use-attribute-sets="dl-name-style">
7029
7213
 
7214
+ <xsl:call-template name="refine_dl-name-style"/>
7215
+
7030
7216
  <xsl:apply-templates/>
7031
7217
  </fo:block>
7032
7218
  </xsl:if>
@@ -7215,6 +7401,8 @@
7215
7401
  <xsl:param name="split_keep-within-line"/>
7216
7402
 
7217
7403
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
7404
+ <xsl:call-template name="refine_dt-row-style"/>
7405
+
7218
7406
  <xsl:call-template name="insert_dt_cell">
7219
7407
  <xsl:with-param name="key_iso" select="$key_iso"/>
7220
7408
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -7424,15 +7612,22 @@
7424
7612
  <xsl:attribute-set name="appendix-style">
7425
7613
  </xsl:attribute-set>
7426
7614
 
7615
+ <xsl:template name="refine_appendix-style">
7616
+ </xsl:template>
7617
+
7427
7618
  <xsl:attribute-set name="appendix-example-style">
7428
7619
  </xsl:attribute-set>
7429
7620
 
7621
+ <xsl:template name="refine_appendix-example-style">
7622
+ </xsl:template>
7623
+
7430
7624
  <!-- ======================== -->
7431
7625
  <!-- Appendix processing -->
7432
7626
  <!-- ======================== -->
7433
7627
  <xsl:template match="mn:appendix">
7434
7628
  <xsl:call-template name="setNamedDestination"/>
7435
7629
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
7630
+ <xsl:call-template name="refine_appendix-style"/>
7436
7631
  <xsl:apply-templates select="mn:fmt-title"/>
7437
7632
  </fo:block>
7438
7633
  <xsl:apply-templates select="node()[not(self::mn:fmt-title)]"/>
@@ -7451,6 +7646,7 @@
7451
7646
  <xsl:template match="mn:appendix//mn:example" priority="2">
7452
7647
  <xsl:call-template name="setNamedDestination"/>
7453
7648
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
7649
+ <xsl:call-template name="refine_appendix-example-style"/>
7454
7650
  <xsl:apply-templates select="mn:fmt-name"/>
7455
7651
  </fo:block>
7456
7652
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
@@ -7458,7 +7654,16 @@
7458
7654
 
7459
7655
  <xsl:attribute-set name="xref-style">
7460
7656
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
7461
- </xsl:attribute-set>
7657
+ </xsl:attribute-set> <!-- xref-style -->
7658
+
7659
+ <xsl:template name="refine_xref-style">
7660
+ <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])">
7661
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7662
+ </xsl:if>
7663
+ <xsl:if test="parent::mn:add">
7664
+ <xsl:call-template name="append_add-style"/>
7665
+ </xsl:if>
7666
+ </xsl:template> <!-- refine_xref-style -->
7462
7667
 
7463
7668
  <xsl:template match="mn:fmt-xref">
7464
7669
  <xsl:call-template name="insert_basic_link">
@@ -7467,12 +7672,8 @@
7467
7672
  <xsl:call-template name="getAltText"/>
7468
7673
  </xsl:variable>
7469
7674
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
7470
- <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])">
7471
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7472
- </xsl:if>
7473
- <xsl:if test="parent::mn:add">
7474
- <xsl:call-template name="append_add-style"/>
7475
- </xsl:if>
7675
+ <xsl:call-template name="refine_xref-style"/>
7676
+
7476
7677
  <xsl:apply-templates/>
7477
7678
  </fo:basic-link>
7478
7679
  </xsl:with-param>
@@ -7585,17 +7786,17 @@
7585
7786
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
7586
7787
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
7587
7788
  <xsl:attribute name="line-height">115%</xsl:attribute>
7588
- </xsl:attribute-set>
7789
+ </xsl:attribute-set> <!-- note-style -->
7589
7790
 
7590
7791
  <xsl:template name="refine_note-style">
7591
- </xsl:template>
7792
+ </xsl:template> <!-- refine_note-style -->
7592
7793
 
7593
7794
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
7594
7795
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
7595
7796
 
7596
7797
  <xsl:attribute-set name="note-name-style">
7597
7798
  <xsl:attribute name="padding-right">4mm</xsl:attribute>
7598
- </xsl:attribute-set>
7799
+ </xsl:attribute-set> <!-- note-name-style -->
7599
7800
 
7600
7801
  <xsl:template name="refine_note-name-style">
7601
7802
  </xsl:template> <!-- refine_note-name-style -->
@@ -7610,18 +7811,21 @@
7610
7811
  <xsl:attribute-set name="note-p-style">
7611
7812
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
7612
7813
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
7613
- </xsl:attribute-set>
7814
+ </xsl:attribute-set> <!-- note-p-style -->
7815
+
7816
+ <xsl:template name="refine_note-p-style">
7817
+ </xsl:template>
7614
7818
 
7615
7819
  <xsl:attribute-set name="termnote-style">
7616
7820
  <xsl:attribute name="font-size">10pt</xsl:attribute>
7617
7821
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
7618
- </xsl:attribute-set>
7822
+ </xsl:attribute-set> <!-- termnote-style -->
7619
7823
 
7620
7824
  <xsl:template name="refine_termnote-style">
7621
7825
  </xsl:template> <!-- refine_termnote-style -->
7622
7826
 
7623
7827
  <xsl:attribute-set name="termnote-name-style">
7624
- </xsl:attribute-set>
7828
+ </xsl:attribute-set> <!-- termnote-name-style -->
7625
7829
 
7626
7830
  <xsl:template name="refine_termnote-name-style">
7627
7831
  </xsl:template>
@@ -7629,6 +7833,9 @@
7629
7833
  <xsl:attribute-set name="termnote-p-style">
7630
7834
  </xsl:attribute-set>
7631
7835
 
7836
+ <xsl:template name="refine_termnote-p-style">
7837
+ </xsl:template>
7838
+
7632
7839
  <!-- ====== -->
7633
7840
  <!-- note -->
7634
7841
  <!-- termnote -->
@@ -7692,11 +7899,13 @@
7692
7899
  <xsl:choose>
7693
7900
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
7694
7901
  <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
7902
+ <xsl:call-template name="refine_note-p-style"/>
7695
7903
  <xsl:apply-templates/>
7696
7904
  </fo:inline>
7697
7905
  </xsl:when>
7698
7906
  <xsl:otherwise>
7699
7907
  <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
7908
+ <xsl:call-template name="refine_note-p-style"/>
7700
7909
  <xsl:apply-templates/>
7701
7910
  </fo:block>
7702
7911
  </xsl:otherwise>
@@ -7788,11 +7997,13 @@
7788
7997
  <xsl:choose>
7789
7998
  <xsl:when test="$num = 1"> <!-- first paragraph renders in the same line as titlenote name -->
7790
7999
  <fo:inline xsl:use-attribute-sets="termnote-p-style">
8000
+ <xsl:call-template name="refine_termnote-p-style"/>
7791
8001
  <xsl:apply-templates/>
7792
8002
  </fo:inline>
7793
8003
  </xsl:when>
7794
8004
  <xsl:otherwise>
7795
8005
  <fo:block xsl:use-attribute-sets="termnote-p-style">
8006
+ <xsl:call-template name="refine_termnote-p-style"/>
7796
8007
  <xsl:apply-templates/>
7797
8008
  </fo:block>
7798
8009
  </xsl:otherwise>
@@ -7807,7 +8018,7 @@
7807
8018
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
7808
8019
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
7809
8020
  <xsl:attribute name="margin-left">13mm</xsl:attribute>
7810
- </xsl:attribute-set>
8021
+ </xsl:attribute-set> <!-- quote-style -->
7811
8022
 
7812
8023
  <xsl:template name="refine_quote-style">
7813
8024
  </xsl:template>
@@ -7817,6 +8028,9 @@
7817
8028
  <xsl:attribute name="margin-right">25mm</xsl:attribute>
7818
8029
  </xsl:attribute-set>
7819
8030
 
8031
+ <xsl:template name="refine_quote-source-style">
8032
+ </xsl:template>
8033
+
7820
8034
  <!-- ====== -->
7821
8035
  <!-- quote -->
7822
8036
  <!-- source -->
@@ -7845,6 +8059,7 @@
7845
8059
  </fo:block-container>
7846
8060
  <xsl:if test="mn:author or mn:fmt-source or mn:attribution">
7847
8061
  <fo:block xsl:use-attribute-sets="quote-source-style">
8062
+ <xsl:call-template name="refine_quote-source-style"/>
7848
8063
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
7849
8064
  <xsl:apply-templates select="mn:author"/>
7850
8065
  <xsl:apply-templates select="mn:fmt-source"/>
@@ -7907,6 +8122,9 @@
7907
8122
  <xsl:attribute-set name="figure-style">
7908
8123
  </xsl:attribute-set>
7909
8124
 
8125
+ <xsl:template name="refine_figure-style">
8126
+ </xsl:template>
8127
+
7910
8128
  <xsl:attribute-set name="figure-name-style">
7911
8129
  <xsl:attribute name="role">Caption</xsl:attribute>
7912
8130
  <xsl:attribute name="font-size">11pt</xsl:attribute>
@@ -7915,7 +8133,7 @@
7915
8133
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
7916
8134
  <xsl:attribute name="space-after">6pt</xsl:attribute>
7917
8135
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
7918
- </xsl:attribute-set>
8136
+ </xsl:attribute-set> <!-- figure-name-style -->
7919
8137
 
7920
8138
  <xsl:template name="refine_figure-name-style">
7921
8139
  </xsl:template> <!-- refine_figure-name-style -->
@@ -7923,7 +8141,7 @@
7923
8141
  <xsl:attribute-set name="image-style">
7924
8142
  <xsl:attribute name="role">SKIP</xsl:attribute>
7925
8143
  <xsl:attribute name="text-align">center</xsl:attribute>
7926
- </xsl:attribute-set>
8144
+ </xsl:attribute-set> <!-- image-style -->
7927
8145
 
7928
8146
  <xsl:template name="refine_image-style">
7929
8147
  </xsl:template>
@@ -7933,14 +8151,51 @@
7933
8151
  <xsl:attribute name="content-height">100%</xsl:attribute>
7934
8152
  <xsl:attribute name="scaling">uniform</xsl:attribute>
7935
8153
  <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
7936
- </xsl:attribute-set>
8154
+ </xsl:attribute-set> <!-- image-graphic-style -->
8155
+
8156
+ <xsl:template name="refine_image-graphic-style">
8157
+ </xsl:template>
7937
8158
 
7938
8159
  <xsl:attribute-set name="figure-source-style">
7939
8160
  </xsl:attribute-set>
7940
8161
 
8162
+ <xsl:template name="refine_figure-source-style">
8163
+ </xsl:template>
8164
+
7941
8165
  <xsl:attribute-set name="figure-pseudocode-p-style">
7942
8166
  </xsl:attribute-set>
7943
8167
 
8168
+ <xsl:template name="refine_figure-pseudocode-p-style">
8169
+ </xsl:template>
8170
+
8171
+ <xsl:attribute-set name="figure-fn-number-style">
8172
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
8173
+ </xsl:attribute-set> <!-- figure-fn-number-style -->
8174
+
8175
+ <xsl:template name="refine_figure-fn-number-style">
8176
+ </xsl:template>
8177
+
8178
+ <xsl:attribute-set name="figure-fmt-fn-label-style">
8179
+ <xsl:attribute name="font-size">80%</xsl:attribute>
8180
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
8181
+ </xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
8182
+
8183
+ <xsl:template name="refine_figure-fmt-fn-label-style">
8184
+ </xsl:template>
8185
+
8186
+ <xsl:attribute-set name="figure-fn-body-style">
8187
+ <xsl:attribute name="text-align">justify</xsl:attribute>
8188
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
8189
+ </xsl:attribute-set>
8190
+
8191
+ <xsl:template name="refine_figure-fn-body-style">
8192
+ <xsl:variable name="key_iso">
8193
+ </xsl:variable>
8194
+ <xsl:if test="normalize-space($key_iso) = 'true'">
8195
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
8196
+ </xsl:if>
8197
+ </xsl:template>
8198
+
7944
8199
  <!-- ============================ -->
7945
8200
  <!-- figure's footnotes rendering -->
7946
8201
  <!-- ============================ -->
@@ -8053,9 +8308,8 @@
8053
8308
  </fo:table-cell>
8054
8309
  <fo:table-cell>
8055
8310
  <fo:block xsl:use-attribute-sets="figure-fn-body-style">
8056
- <xsl:if test="normalize-space($key_iso) = 'true'">
8057
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
8058
- </xsl:if>
8311
+ <xsl:call-template name="refine_figure-fn-body-style"/>
8312
+
8059
8313
  <!-- <xsl:copy-of select="./node()"/> -->
8060
8314
  <xsl:apply-templates/>
8061
8315
  </fo:block>
@@ -8073,6 +8327,7 @@
8073
8327
  <xsl:param name="process">false</xsl:param>
8074
8328
  <xsl:if test="$process = 'true'">
8075
8329
  <fo:inline xsl:use-attribute-sets="figure-fn-number-style" role="SKIP">
8330
+ <xsl:call-template name="refine_figure-fn-number-style"/>
8076
8331
  <xsl:attribute name="padding-right">0mm</xsl:attribute>
8077
8332
 
8078
8333
  <!-- tab is padding-right -->
@@ -8110,6 +8365,7 @@
8110
8365
  <xsl:attribute name="font-size">10pt</xsl:attribute>
8111
8366
  </xsl:if>
8112
8367
  <fo:inline xsl:use-attribute-sets="figure-fn-number-style figure-fmt-fn-label-style"> <!-- id="{@id}" -->
8368
+ <xsl:call-template name="refine_figure-fn-number-style"/>
8113
8369
  <!-- <xsl:value-of select="@reference"/> -->
8114
8370
  <xsl:apply-templates/>
8115
8371
  </fo:inline>
@@ -8155,6 +8411,8 @@
8155
8411
 
8156
8412
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
8157
8413
 
8414
+ <xsl:call-template name="refine_figure-style"/>
8415
+
8158
8416
  <xsl:for-each select="mn:fmt-name"> <!-- set context -->
8159
8417
  <xsl:call-template name="setIDforNamedDestination"/>
8160
8418
  </xsl:for-each>
@@ -8198,6 +8456,7 @@
8198
8456
 
8199
8457
  <xsl:template match="mn:figure[@class = 'pseudocode']//mn:p">
8200
8458
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
8459
+ <xsl:call-template name="refine_figure-pseudocode-p-style"/>
8201
8460
  <xsl:apply-templates/>
8202
8461
  </fo:block>
8203
8462
  </xsl:template>
@@ -8327,6 +8586,8 @@
8327
8586
  </xsl:variable>
8328
8587
  <xsl:copy-of select="xalan:nodeset($image-graphic-style_attributes)/attributes/@*"/>
8329
8588
 
8589
+ <xsl:call-template name="refine_image-graphic-style"/>
8590
+
8330
8591
  <xsl:if test="not(@mimetype = 'image/svg+xml') and not(ancestor::mn:table)">
8331
8592
  <xsl:variable name="scale">
8332
8593
  <xsl:call-template name="getImageScale">
@@ -9026,6 +9287,9 @@
9026
9287
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
9027
9288
  </xsl:attribute-set> <!-- formula-style -->
9028
9289
 
9290
+ <xsl:template name="refine_formula-style">
9291
+ </xsl:template>
9292
+
9029
9293
  <xsl:attribute-set name="formula-stem-block-style">
9030
9294
  <xsl:attribute name="text-align">center</xsl:attribute>
9031
9295
  <xsl:attribute name="text-align">left</xsl:attribute>
@@ -9096,6 +9360,8 @@
9096
9360
  <xsl:template match="mn:formula[mn:fmt-name]/mn:fmt-stem">
9097
9361
  <fo:block xsl:use-attribute-sets="formula-style">
9098
9362
 
9363
+ <xsl:call-template name="refine_formula-style"/>
9364
+
9099
9365
  <fo:table table-layout="fixed" width="100%">
9100
9366
  <fo:table-column column-width="95%"/>
9101
9367
  <fo:table-column column-width="5%"/>
@@ -9515,6 +9781,9 @@
9515
9781
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
9516
9782
  </xsl:attribute-set> <!-- list-name-style -->
9517
9783
 
9784
+ <xsl:template name="refine_list-name-style">
9785
+ </xsl:template>
9786
+
9518
9787
  <xsl:attribute-set name="list-item-style">
9519
9788
  </xsl:attribute-set>
9520
9789
 
@@ -9814,6 +10083,7 @@
9814
10083
  <xsl:param name="process">false</xsl:param>
9815
10084
  <xsl:if test="$process = 'true'">
9816
10085
  <fo:block xsl:use-attribute-sets="list-name-style">
10086
+ <xsl:call-template name="refine_list-name-style"/>
9817
10087
  <xsl:apply-templates/>
9818
10088
  </fo:block>
9819
10089
  </xsl:if>
@@ -9874,24 +10144,45 @@
9874
10144
  <!-- END Lists processing -->
9875
10145
  <!-- ===================================== -->
9876
10146
 
10147
+ <xsl:attribute-set name="footnote-separator-leader-style">
10148
+ </xsl:attribute-set>
10149
+
10150
+ <xsl:template name="refine_footnote-separator-leader-style">
10151
+ </xsl:template>
10152
+
10153
+ <xsl:attribute-set name="fn-container-body-style">
10154
+ <xsl:attribute name="text-indent">0</xsl:attribute>
10155
+ <xsl:attribute name="start-indent">0</xsl:attribute>
10156
+ </xsl:attribute-set>
10157
+
10158
+ <xsl:template name="refine_fn-container-body-style">
10159
+ </xsl:template>
10160
+
9877
10161
  <xsl:attribute-set name="fn-reference-style">
9878
10162
  <xsl:attribute name="font-size">80%</xsl:attribute>
9879
10163
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
9880
-
9881
- </xsl:attribute-set>
10164
+ </xsl:attribute-set> <!-- fn-reference-style -->
9882
10165
 
9883
10166
  <xsl:template name="refine_fn-reference-style">
10167
+ <!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
10168
+ <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">,</xsl:if>
9884
10169
  </xsl:template> <!-- refine_fn-reference-style -->
9885
10170
 
9886
10171
  <xsl:attribute-set name="fn-style">
9887
10172
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
9888
10173
  </xsl:attribute-set>
9889
10174
 
10175
+ <xsl:template name="refine_fn-style">
10176
+ </xsl:template>
10177
+
9890
10178
  <xsl:attribute-set name="fn-num-style">
9891
10179
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
9892
10180
  <xsl:attribute name="font-size">65%</xsl:attribute>
9893
10181
  <xsl:attribute name="vertical-align">super</xsl:attribute>
9894
- </xsl:attribute-set>
10182
+ </xsl:attribute-set> <!-- fn-num-style -->
10183
+
10184
+ <xsl:template name="refine_fn-num-style">
10185
+ </xsl:template>
9895
10186
 
9896
10187
  <xsl:attribute-set name="fn-body-style">
9897
10188
  <xsl:attribute name="font-weight">normal</xsl:attribute>
@@ -9903,7 +10194,7 @@
9903
10194
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
9904
10195
  <xsl:attribute name="color">rgb(168, 170, 173)</xsl:attribute>
9905
10196
  <xsl:attribute name="text-align">left</xsl:attribute>
9906
- </xsl:attribute-set>
10197
+ </xsl:attribute-set> <!-- fn-body-style" -->
9907
10198
 
9908
10199
  <xsl:template name="refine_fn-body-style">
9909
10200
  </xsl:template> <!-- refine_fn-body-style -->
@@ -9967,10 +10258,12 @@
9967
10258
  <xsl:choose>
9968
10259
  <xsl:when test="ancestor::mn:bibitem">
9969
10260
  <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
10261
+ <xsl:call-template name="refine_bibitem-note-fn-style"/>
9970
10262
  </fn_styles>
9971
10263
  </xsl:when>
9972
10264
  <xsl:otherwise>
9973
10265
  <fn_styles xsl:use-attribute-sets="fn-num-style">
10266
+ <xsl:call-template name="refine_fn-num-style"/>
9974
10267
  </fn_styles>
9975
10268
  </xsl:otherwise>
9976
10269
  </xsl:choose>
@@ -9980,9 +10273,12 @@
9980
10273
  <xsl:copy-of select="."/>
9981
10274
  </xsl:for-each>
9982
10275
 
9983
- <xsl:if test="following-sibling::node()[normalize-space() != ''][1][self::mn:fn]">
10276
+ <!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
10277
+ <!-- <xsl:if test="following-sibling::node()[normalize-space() != ''][1][self::mn:fn]">
9984
10278
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
9985
- </xsl:if>
10279
+ </xsl:if> -->
10280
+
10281
+ <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">,</xsl:if>
9986
10282
 
9987
10283
  <xsl:call-template name="insert_basic_link">
9988
10284
  <xsl:with-param name="element">
@@ -10005,10 +10301,12 @@
10005
10301
  <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
10006
10302
 
10007
10303
  <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
10304
+ <xsl:call-template name="refine_fn-style"/>
10008
10305
  <xsl:copy-of select="$footnote_inline"/>
10009
10306
  <fo:footnote-body role="Note">
10010
10307
 
10011
10308
  <fo:block-container xsl:use-attribute-sets="fn-container-body-style" role="SKIP">
10309
+ <xsl:call-template name="refine_fn-container-body-style"/>
10012
10310
 
10013
10311
  <xsl:variable name="fn_block">
10014
10312
  <xsl:call-template name="refine_fn-body-style"/>
@@ -10110,6 +10408,9 @@
10110
10408
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10111
10409
  </xsl:attribute-set> <!-- admonition-style -->
10112
10410
 
10411
+ <xsl:template name="refine_admonition-style">
10412
+ </xsl:template>
10413
+
10113
10414
  <xsl:attribute-set name="admonition-container-style">
10114
10415
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
10115
10416
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -10117,6 +10418,9 @@
10117
10418
  <xsl:attribute name="padding-top">3mm</xsl:attribute>
10118
10419
  </xsl:attribute-set> <!-- admonition-container-style -->
10119
10420
 
10421
+ <xsl:template name="refine_admonition-container-style">
10422
+ </xsl:template>
10423
+
10120
10424
  <xsl:attribute-set name="admonition-name-style">
10121
10425
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
10122
10426
  <xsl:attribute name="font-size">11pt</xsl:attribute>
@@ -10126,9 +10430,16 @@
10126
10430
  <xsl:attribute name="text-align">center</xsl:attribute>
10127
10431
  </xsl:attribute-set> <!-- admonition-name-style -->
10128
10432
 
10433
+ <xsl:template name="refine_admonition-name-style">
10434
+ </xsl:template>
10435
+
10129
10436
  <xsl:attribute-set name="admonition-p-style">
10130
10437
  <xsl:attribute name="font-style">italic</xsl:attribute>
10131
10438
  </xsl:attribute-set> <!-- admonition-p-style -->
10439
+
10440
+ <xsl:template name="refine_admonition-p-style">
10441
+ </xsl:template>
10442
+
10132
10443
  <!-- end admonition -->
10133
10444
 
10134
10445
  <!-- ================ -->
@@ -10138,8 +10449,12 @@
10138
10449
  <xsl:call-template name="setNamedDestination"/>
10139
10450
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
10140
10451
 
10452
+ <xsl:call-template name="refine_admonition-style"/>
10453
+
10141
10454
  <xsl:call-template name="setBlockSpanAll"/>
10142
10455
  <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
10456
+
10457
+ <xsl:call-template name="refine_admonition-container-style"/>
10143
10458
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
10144
10459
  <fo:block>
10145
10460
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
@@ -10202,6 +10517,13 @@
10202
10517
  <!-- END Admonition -->
10203
10518
  <!-- ================ -->
10204
10519
 
10520
+ <xsl:attribute-set name="references-non-normative-title-style">
10521
+ </xsl:attribute-set>
10522
+
10523
+ <xsl:template name="refine_references-non-normative-title-style">
10524
+
10525
+ </xsl:template>
10526
+
10205
10527
  <!-- bibitem in Normative References (references/@normative="true") -->
10206
10528
  <xsl:attribute-set name="bibitem-normative-style">
10207
10529
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -10210,34 +10532,55 @@
10210
10532
  <xsl:attribute name="line-height">145%</xsl:attribute>
10211
10533
  </xsl:attribute-set> <!-- bibitem-normative-style -->
10212
10534
 
10535
+ <xsl:template name="refine_bibitem-normative-style">
10536
+ </xsl:template>
10537
+
10213
10538
  <!-- bibitem in Normative References (references/@normative="true"), renders as list -->
10214
10539
  <xsl:attribute-set name="bibitem-normative-list-style">
10215
10540
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
10216
10541
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10217
10542
  </xsl:attribute-set> <!-- bibitem-normative-list-style -->
10218
10543
 
10544
+ <xsl:template name="refine_bibitem-normative-list-style">
10545
+ </xsl:template>
10546
+
10219
10547
  <xsl:attribute-set name="bibitem-non-normative-style">
10220
10548
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10221
10549
  <xsl:attribute name="line-height">145%</xsl:attribute>
10222
10550
  </xsl:attribute-set> <!-- bibitem-non-normative-style -->
10223
10551
 
10552
+ <xsl:template name="refine_bibitem-non-normative-style">
10553
+ </xsl:template>
10554
+
10224
10555
  <!-- bibitem in bibliography section (references/@normative="false"), renders as list -->
10225
10556
  <xsl:attribute-set name="bibitem-non-normative-list-style">
10226
10557
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
10227
10558
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10228
10559
  </xsl:attribute-set> <!-- bibitem-non-normative-list-style -->
10229
10560
 
10561
+ <xsl:template name="refine_bibitem-non-normative-list-style">
10562
+ </xsl:template>
10563
+
10230
10564
  <xsl:attribute-set name="bibitem-non-normative-list-item-style">
10231
10565
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10232
10566
  </xsl:attribute-set>
10233
10567
 
10568
+ <xsl:template name="refine_bibitem-non-normative-list-item-style">
10569
+ </xsl:template>
10570
+
10234
10571
  <!-- bibitem in bibliography section (references/@normative="false"), list body -->
10235
10572
  <xsl:attribute-set name="bibitem-normative-list-body-style">
10236
10573
  </xsl:attribute-set>
10237
10574
 
10575
+ <xsl:template name="refine_bibitem-normative-list-body-style">
10576
+ </xsl:template>
10577
+
10238
10578
  <xsl:attribute-set name="bibitem-non-normative-list-body-style">
10239
10579
  </xsl:attribute-set> <!-- bibitem-non-normative-list-body-style -->
10240
10580
 
10581
+ <xsl:template name="refine_bibitem-non-normative-list-body-style">
10582
+ </xsl:template>
10583
+
10241
10584
  <!-- footnote reference number for bibitem, in the text -->
10242
10585
  <xsl:attribute-set name="bibitem-note-fn-style">
10243
10586
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
@@ -10245,6 +10588,9 @@
10245
10588
  <xsl:attribute name="vertical-align">super</xsl:attribute>
10246
10589
  </xsl:attribute-set> <!-- bibitem-note-fn-style -->
10247
10590
 
10591
+ <xsl:template name="refine_bibitem-note-fn-style">
10592
+ </xsl:template>
10593
+
10248
10594
  <!-- footnote number on the page bottom -->
10249
10595
  <xsl:attribute-set name="bibitem-note-fn-number-style">
10250
10596
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
@@ -10265,6 +10611,9 @@
10265
10611
  <xsl:attribute name="line-height">145%</xsl:attribute>
10266
10612
  </xsl:attribute-set> <!-- references-non-normative-style -->
10267
10613
 
10614
+ <xsl:template name="refine_references-non-normative-style">
10615
+ </xsl:template>
10616
+
10268
10617
  <!-- ======================= -->
10269
10618
  <!-- Bibliography rendering -->
10270
10619
  <!-- ======================= -->
@@ -10306,6 +10655,7 @@
10306
10655
  <xsl:apply-templates select="mn:fmt-title[@columns = 1]"/>
10307
10656
 
10308
10657
  <fo:block xsl:use-attribute-sets="references-non-normative-style">
10658
+ <xsl:call-template name="refine_references-non-normative-style"/>
10309
10659
  <xsl:apply-templates select="node()[not(self::mn:fmt-title and @columns = 1)]"/>
10310
10660
  </fo:block>
10311
10661
  </xsl:template> <!-- references -->
@@ -10319,31 +10669,39 @@
10319
10669
  <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
10320
10670
  <xsl:call-template name="setNamedDestination"/>
10321
10671
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
10672
+ <xsl:call-template name="refine_bibitem-normative-style"/>
10673
+
10322
10674
  <xsl:call-template name="processBibitem"/>
10323
10675
  </fo:block>
10324
10676
 
10325
10677
  </xsl:template> <!-- bibitem -->
10326
10678
 
10327
10679
  <!-- Bibliography (non-normative references) -->
10328
- <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">
10329
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 -->
10330
10682
  <!-- start CSA bibitem processing -->
10331
10683
  <xsl:call-template name="setNamedDestination"/>
10332
10684
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-style">
10685
+ <xsl:call-template name="refine_bibitem-non-normative-style"/>
10333
10686
  <xsl:apply-templates select="mn:biblio-tag"/>
10334
10687
  <xsl:apply-templates select="mn:formattedref"/>
10335
- <xsl:call-template name="processBibliographyNote"/>
10336
10688
  </fo:block>
10689
+ <xsl:call-template name="processBibitemFollowingNotes"/>
10337
10690
  <!-- END CSA bibitem processing -->
10338
10691
 
10339
10692
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
10340
10693
 
10694
+ <!-- bibitem's notes will be processing in 'processBibitemFollowingNotes' -->
10695
+ <xsl:template match="mn:references/mn:note" priority="2"/> <!-- [not(@normative='true')] -->
10696
+
10341
10697
  <xsl:template name="insertListItem_Bibitem">
10342
10698
  <xsl:choose>
10343
10699
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
10344
10700
  <xsl:otherwise>
10345
10701
  <xsl:call-template name="setNamedDestination"/>
10346
10702
  <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
10703
+ <xsl:call-template name="refine_bibitem-non-normative-list-item-style"/>
10704
+
10347
10705
  <fo:list-item-label end-indent="label-end()">
10348
10706
  <fo:block role="SKIP">
10349
10707
  <fo:inline role="SKIP">
@@ -10354,16 +10712,18 @@
10354
10712
  </fo:block>
10355
10713
  </fo:list-item-label>
10356
10714
  <fo:list-item-body start-indent="body-start()">
10357
- <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
10715
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style"> <!-- role="SKIP" -->
10716
+ <xsl:call-template name="refine_bibitem-non-normative-list-body-style"/>
10358
10717
  <xsl:call-template name="processBibitem">
10359
10718
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
10360
10719
  </xsl:call-template>
10361
10720
  </fo:block>
10721
+ <xsl:call-template name="processBibitemFollowingNotes"/>
10362
10722
  </fo:list-item-body>
10363
10723
  </fo:list-item>
10364
10724
  </xsl:otherwise>
10365
10725
  </xsl:choose>
10366
- <xsl:apply-templates select="following-sibling::*[1]"> <!-- [self::mn:bibitem] -->
10726
+ <xsl:apply-templates select="following-sibling::*[self::mn:bibitem][1]">
10367
10727
  <xsl:with-param name="skip">false</xsl:with-param>
10368
10728
  </xsl:apply-templates>
10369
10729
  </xsl:template>
@@ -10379,25 +10739,16 @@
10379
10739
  <xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
10380
10740
  </xsl:apply-templates>
10381
10741
  <xsl:apply-templates select="mn:formattedref"/>
10742
+ <xsl:call-template name="processBibitemFollowingNotes"/>
10382
10743
  <!-- end bibitem processing -->
10383
-
10384
- <xsl:call-template name="processBibliographyNote"/>
10385
10744
  </xsl:template> <!-- processBibitem (bibitem) -->
10386
10745
 
10387
- <xsl:template name="processBibliographyNote">
10388
- <xsl:if test="self::mn:note">
10389
- <xsl:variable name="note_node">
10390
- <xsl:element name="{local-name(..)}" namespace="{$namespace_full}"> <!-- save parent context node for determining styles -->
10391
- <xsl:copy> <!-- skip @id -->
10392
- <xsl:copy-of select="node()"/>
10393
- </xsl:copy>
10394
- </xsl:element>
10395
- </xsl:variable>
10396
- <!-- <xsl:for-each select="xalan:nodeset($note_node)//mn:note">
10397
- <xsl:call-template name="note"/>
10398
- </xsl:for-each> -->
10746
+ <xsl:template name="processBibitemFollowingNotes">
10747
+ <!-- current context is bibitem element -->
10748
+ <xsl:variable name="bibitem_id" select="@id"/>
10749
+ <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]]">
10399
10750
  <xsl:call-template name="note"/>
10400
- </xsl:if>
10751
+ </xsl:for-each>
10401
10752
  </xsl:template>
10402
10753
 
10403
10754
  <xsl:template match="mn:title" mode="title">
@@ -10597,11 +10948,17 @@
10597
10948
  <!-- Index section styles -->
10598
10949
  <xsl:attribute-set name="indexsect-title-style">
10599
10950
  <xsl:attribute name="role">H1</xsl:attribute>
10600
- </xsl:attribute-set>
10951
+ </xsl:attribute-set> <!-- indexsect-title-style -->
10952
+
10953
+ <xsl:template name="refine_indexsect-title-style">
10954
+ </xsl:template>
10601
10955
 
10602
10956
  <xsl:attribute-set name="indexsect-clause-title-style">
10603
10957
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
10604
- </xsl:attribute-set>
10958
+ </xsl:attribute-set> <!-- indexsect-clause-title-style -->
10959
+
10960
+ <xsl:template name="refine_indexsect-clause-title-style">
10961
+ </xsl:template>
10605
10962
  <!-- End Index section styles -->
10606
10963
 
10607
10964
  <!-- =================== -->
@@ -10795,6 +11152,7 @@
10795
11152
 
10796
11153
  <xsl:template match="mn:indexsect/mn:fmt-title | mn:indexsect/mn:title" priority="4">
10797
11154
  <fo:block xsl:use-attribute-sets="indexsect-title-style">
11155
+ <xsl:call-template name="refine_indexsect-title-style"/>
10798
11156
  <!-- Index -->
10799
11157
  <xsl:apply-templates/>
10800
11158
  </fo:block>
@@ -10803,6 +11161,7 @@
10803
11161
  <xsl:template match="mn:indexsect/mn:clause/mn:fmt-title | mn:indexsect/mn:clause/mn:title" priority="4">
10804
11162
  <!-- Letter A, B, C, ... -->
10805
11163
  <fo:block xsl:use-attribute-sets="indexsect-clause-title-style">
11164
+ <xsl:call-template name="refine_indexsect-clause-title-style"/>
10806
11165
  <xsl:apply-templates/>
10807
11166
  </fo:block>
10808
11167
  </xsl:template>
@@ -11014,9 +11373,15 @@
11014
11373
  <xsl:attribute name="leader-pattern">dots</xsl:attribute>
11015
11374
  </xsl:attribute-set> <!-- END: toc-leader-style -->
11016
11375
 
11376
+ <xsl:template name="refine_toc-leader-style">
11377
+ </xsl:template>
11378
+
11017
11379
  <xsl:attribute-set name="toc-pagenumber-style">
11018
11380
  </xsl:attribute-set>
11019
11381
 
11382
+ <xsl:template name="refine_toc-pagenumber-style">
11383
+ </xsl:template>
11384
+
11020
11385
  <!-- List of Figures, Tables -->
11021
11386
  <xsl:attribute-set name="toc-listof-title-style">
11022
11387
  <xsl:attribute name="provisional-distance-between-starts">3mm</xsl:attribute>
@@ -11029,6 +11394,9 @@
11029
11394
  <xsl:attribute name="provisional-distance-between-starts">10mm</xsl:attribute>
11030
11395
  </xsl:attribute-set>
11031
11396
 
11397
+ <xsl:template name="refine_toc-listof-item-block-style">
11398
+ </xsl:template>
11399
+
11032
11400
  <xsl:attribute-set name="toc-listof-item-style">
11033
11401
  <xsl:attribute name="role">TOCI</xsl:attribute>
11034
11402
  <xsl:attribute name="text-align-last">justify</xsl:attribute>
@@ -11036,6 +11404,9 @@
11036
11404
  <xsl:attribute name="text-indent">-12mm</xsl:attribute>
11037
11405
  </xsl:attribute-set>
11038
11406
 
11407
+ <xsl:template name="refine_toc-listof-item-style">
11408
+ </xsl:template>
11409
+
11039
11410
  <xsl:template name="processPrefaceSectionsDefault_Contents">
11040
11411
  <xsl:variable name="nodes_preface_">
11041
11412
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
@@ -12143,23 +12514,55 @@
12143
12514
  <!-- Ruby text (CJK languages) rendering -->
12144
12515
  <!-- ===================================== -->
12145
12516
  <!-- ===================================== -->
12517
+
12518
+ <xsl:attribute-set name="ruby-style">
12519
+ <xsl:attribute name="text-indent">0mm</xsl:attribute>
12520
+ <xsl:attribute name="last-line-end-indent">0mm</xsl:attribute>
12521
+ </xsl:attribute-set>
12522
+
12523
+ <xsl:template name="refine_ruby-style">
12524
+ <xsl:if test="not(ancestor::mn:ruby)">
12525
+ <xsl:attribute name="alignment-baseline">central</xsl:attribute>
12526
+ </xsl:if>
12527
+ <xsl:variable name="rt_text" select="mn:rt"/>
12528
+ <xsl:variable name="rb_text" select=".//mn:rb[not(mn:ruby)]"/>
12529
+ <!-- Example: width="2em" -->
12530
+ <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
12531
+ <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
12532
+ <xsl:variable name="text_width">
12533
+ <xsl:choose>
12534
+ <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
12535
+ <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
12536
+ </xsl:choose>
12537
+ </xsl:variable>
12538
+ <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
12539
+ </xsl:template> <!-- refine_ruby-style -->
12540
+
12541
+ <xsl:attribute-set name="rb-style">
12542
+ <xsl:attribute name="line-height">1em</xsl:attribute>
12543
+ <xsl:attribute name="text-align">center</xsl:attribute>
12544
+ </xsl:attribute-set>
12545
+
12546
+ <xsl:template name="refine_rb-style">
12547
+ </xsl:template>
12548
+
12549
+ <xsl:attribute-set name="rt-style">
12550
+ <xsl:attribute name="font-size">0.5em</xsl:attribute>
12551
+ <xsl:attribute name="text-align">center</xsl:attribute>
12552
+ <xsl:attribute name="line-height">1.2em</xsl:attribute>
12553
+ <xsl:attribute name="space-before">-1.4em</xsl:attribute>
12554
+ <xsl:attribute name="space-before.conditionality">retain</xsl:attribute>
12555
+ </xsl:attribute-set>
12556
+
12557
+ <xsl:template name="refine_rt-style">
12558
+ <xsl:if test="ancestor::mn:ruby[last()]//mn:ruby or ancestor::mn:rb">
12559
+ <xsl:attribute name="space-before">0em</xsl:attribute>
12560
+ </xsl:if>
12561
+ </xsl:template>
12562
+
12146
12563
  <xsl:template match="mn:ruby">
12147
- <fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
12148
- <xsl:if test="not(ancestor::mn:ruby)">
12149
- <xsl:attribute name="alignment-baseline">central</xsl:attribute>
12150
- </xsl:if>
12151
- <xsl:variable name="rt_text" select="mn:rt"/>
12152
- <xsl:variable name="rb_text" select=".//mn:rb[not(mn:ruby)]"/>
12153
- <!-- Example: width="2em" -->
12154
- <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
12155
- <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
12156
- <xsl:variable name="text_width">
12157
- <xsl:choose>
12158
- <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
12159
- <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
12160
- </xsl:choose>
12161
- </xsl:variable>
12162
- <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
12564
+ <fo:inline-container xsl:use-attribute-sets="ruby-style">
12565
+ <xsl:call-template name="refine_ruby-style"/>
12163
12566
 
12164
12567
  <xsl:choose>
12165
12568
  <xsl:when test="ancestor::mn:ruby">
@@ -12177,17 +12580,14 @@
12177
12580
  </xsl:template>
12178
12581
 
12179
12582
  <xsl:template match="mn:rb">
12180
- <fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
12583
+ <fo:block xsl:use-attribute-sets="rb-style"><xsl:call-template name="refine_rb-style"/><xsl:apply-templates/></fo:block>
12181
12584
  </xsl:template>
12182
12585
 
12183
12586
  <xsl:template match="mn:rt">
12184
- <fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
12185
- <xsl:if test="ancestor::mn:ruby[last()]//mn:ruby or ancestor::mn:rb">
12186
- <xsl:attribute name="space-before">0em</xsl:attribute>
12187
- </xsl:if>
12587
+ <fo:block xsl:use-attribute-sets="rt-style"> <!-- -->
12588
+ <xsl:call-template name="refine_rt-style"/>
12188
12589
  <xsl:apply-templates/>
12189
12590
  </fo:block>
12190
-
12191
12591
  </xsl:template>
12192
12592
 
12193
12593
  <!-- ===================================== -->
@@ -12196,6 +12596,18 @@
12196
12596
  <!-- ===================================== -->
12197
12597
  <!-- ===================================== -->
12198
12598
 
12599
+ <xsl:attribute-set name="annex-title-style">
12600
+ </xsl:attribute-set>
12601
+
12602
+ <xsl:template name="refine_annex-title-style">
12603
+ </xsl:template>
12604
+
12605
+ <xsl:attribute-set name="p-zzSTDTitle1-style">
12606
+ </xsl:attribute-set>
12607
+
12608
+ <xsl:template name="refine_p-zzSTDTitle1-style">
12609
+ </xsl:template>
12610
+
12199
12611
  <xsl:template name="processPrefaceSectionsDefault">
12200
12612
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
12201
12613
  <xsl:sort select="@displayorder" data-type="number"/>