metanorma-csa 2.7.1 → 2.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2199,42 +2199,86 @@
2199
2199
  <xsl:attribute-set name="copyright-statement-style">
2200
2200
  </xsl:attribute-set> <!-- copyright-statement-style -->
2201
2201
 
2202
+ <xsl:template name="refine_copyright-statement-style">
2203
+ </xsl:template>
2204
+
2202
2205
  <xsl:attribute-set name="copyright-statement-title-style">
2203
2206
  </xsl:attribute-set> <!-- copyright-statement-title-style -->
2204
2207
 
2208
+ <xsl:template name="refine_copyright-statement-title-style">
2209
+ </xsl:template>
2210
+
2205
2211
  <xsl:attribute-set name="copyright-statement-p-style">
2206
2212
  </xsl:attribute-set> <!-- copyright-statement-p-style -->
2207
2213
 
2208
- <xsl:attribute-set name="license-statement-style">
2214
+ <xsl:template name="refine_copyright-statement-p-style">
2215
+
2216
+ </xsl:template>
2217
+
2218
+ <xsl:attribute-set name="license-statement-style">
2209
2219
  </xsl:attribute-set> <!-- license-statement-style -->
2210
2220
 
2221
+ <xsl:template name="refine_license-statement-style">
2222
+ </xsl:template>
2223
+
2211
2224
  <xsl:attribute-set name="license-statement-title-style">
2212
2225
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2213
2226
  </xsl:attribute-set> <!-- license-statement-title-style -->
2214
2227
 
2228
+ <xsl:template name="refine_license-statement-title-style">
2229
+ </xsl:template>
2230
+
2215
2231
  <xsl:attribute-set name="license-statement-p-style">
2216
2232
  </xsl:attribute-set> <!-- license-statement-p-style -->
2217
2233
 
2234
+ <xsl:template name="refine_license-statement-p-style">
2235
+
2236
+ </xsl:template>
2237
+
2218
2238
  <xsl:attribute-set name="legal-statement-style">
2219
2239
  </xsl:attribute-set> <!-- legal-statement-style -->
2220
2240
 
2241
+ <xsl:template name="refine_legal-statement-style">
2242
+ </xsl:template>
2243
+
2221
2244
  <xsl:attribute-set name="legal-statement-title-style">
2222
2245
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2223
2246
  </xsl:attribute-set> <!-- legal-statement-title-style -->
2224
2247
 
2248
+ <xsl:template name="refine_legal-statement-title-style">
2249
+ </xsl:template>
2250
+
2225
2251
  <xsl:attribute-set name="legal-statement-p-style">
2226
2252
  </xsl:attribute-set> <!-- legal-statement-p-style -->
2227
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
+
2228
2262
  <xsl:attribute-set name="feedback-statement-style">
2229
2263
  </xsl:attribute-set> <!-- feedback-statement-style -->
2230
2264
 
2265
+ <xsl:template name="refine_feedback-statement-style">
2266
+ </xsl:template>
2267
+
2231
2268
  <xsl:attribute-set name="feedback-statement-title-style">
2232
2269
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2233
2270
  </xsl:attribute-set> <!-- feedback-statement-title-style -->
2234
2271
 
2272
+ <xsl:template name="refine_feedback-statement-title-style">
2273
+
2274
+ </xsl:template>
2275
+
2235
2276
  <xsl:attribute-set name="feedback-statement-p-style">
2236
2277
  </xsl:attribute-set> <!-- feedback-statement-p-style -->
2237
2278
 
2279
+ <xsl:template name="refine_feedback-statement-p-style">
2280
+ </xsl:template>
2281
+
2238
2282
  <!-- End boilerplate sections styles -->
2239
2283
 
2240
2284
  <!-- ================================= -->
@@ -2242,6 +2286,8 @@
2242
2286
  <!-- ================================= -->
2243
2287
  <xsl:template match="mn:copyright-statement">
2244
2288
  <fo:block xsl:use-attribute-sets="copyright-statement-style" role="SKIP">
2289
+ <xsl:call-template name="refine_copyright-statement-style"/>
2290
+
2245
2291
  <xsl:apply-templates/>
2246
2292
  </fo:block>
2247
2293
  </xsl:template> <!-- copyright-statement -->
@@ -2258,6 +2304,7 @@
2258
2304
 
2259
2305
  <xsl:template match="mn:license-statement">
2260
2306
  <fo:block xsl:use-attribute-sets="license-statement-style">
2307
+ <xsl:call-template name="refine_license-statement-style"/>
2261
2308
  <xsl:apply-templates/>
2262
2309
  </fo:block>
2263
2310
  </xsl:template> <!-- license-statement -->
@@ -2275,6 +2322,7 @@
2275
2322
  <xsl:template match="mn:legal-statement">
2276
2323
  <xsl:param name="isLegacy">false</xsl:param>
2277
2324
  <fo:block xsl:use-attribute-sets="legal-statement-style">
2325
+ <xsl:call-template name="refine_legal-statement-style"/>
2278
2326
  <xsl:apply-templates/>
2279
2327
  </fo:block>
2280
2328
  </xsl:template> <!-- legal-statement -->
@@ -2444,6 +2492,27 @@
2444
2492
  <xsl:attribute-set name="sourcecode-container-style">
2445
2493
  </xsl:attribute-set>
2446
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
+
2447
2516
  <xsl:attribute-set name="sourcecode-style">
2448
2517
  <xsl:attribute name="white-space">pre</xsl:attribute>
2449
2518
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -2465,6 +2534,9 @@
2465
2534
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
2466
2535
  </xsl:attribute-set> <!-- sourcecode-name-style -->
2467
2536
 
2537
+ <xsl:template name="refine_sourcecode-name-style">
2538
+ </xsl:template>
2539
+
2468
2540
  <xsl:template name="add-zero-spaces-equal">
2469
2541
  <xsl:param name="text" select="."/>
2470
2542
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
@@ -2552,24 +2624,8 @@
2552
2624
  <xsl:otherwise>
2553
2625
  <fo:block-container xsl:use-attribute-sets="sourcecode-container-style" role="SKIP">
2554
2626
 
2555
- <xsl:if test="not(ancestor::mn:li) or ancestor::mn:example">
2556
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2557
- </xsl:if>
2558
-
2559
- <xsl:if test="ancestor::mn:example">
2560
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
2561
- </xsl:if>
2562
-
2563
- <xsl:copy-of select="@id"/>
2627
+ <xsl:call-template name="refine_sourcecode-container-style"/>
2564
2628
 
2565
- <xsl:if test="parent::mn:note">
2566
- <xsl:attribute name="margin-left">
2567
- <xsl:choose>
2568
- <xsl:when test="not(ancestor::mn:table)"><xsl:value-of select="$note-body-indent"/></xsl:when>
2569
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2570
- </xsl:choose>
2571
- </xsl:attribute>
2572
- </xsl:if>
2573
2629
  <fo:block-container margin-left="0mm" role="SKIP">
2574
2630
 
2575
2631
  <fo:block xsl:use-attribute-sets="sourcecode-style">
@@ -2896,6 +2952,7 @@
2896
2952
  <xsl:template match="mn:sourcecode/mn:fmt-name">
2897
2953
  <xsl:if test="normalize-space() != ''">
2898
2954
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2955
+ <xsl:call-template name="refine_sourcecode-name-style"/>
2899
2956
  <xsl:apply-templates/>
2900
2957
  </fo:block>
2901
2958
  </xsl:if>
@@ -2944,12 +3001,31 @@
2944
3001
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2945
3002
  <xsl:attribute name="font-family"><xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
2946
3003
  <xsl:attribute name="line-height">113%</xsl:attribute>
2947
- </xsl:attribute-set>
3004
+ </xsl:attribute-set> <!-- pre-style -->
3005
+
3006
+ <xsl:template name="refine_pre-style">
3007
+ </xsl:template>
2948
3008
 
2949
3009
  <xsl:attribute-set name="tt-style">
2950
3010
  <xsl:attribute name="font-family"><xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
2951
3011
  </xsl:attribute-set>
2952
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
+
2953
3029
  <xsl:variable name="color-added-text">
2954
3030
  <xsl:text>rgb(0, 255, 0)</xsl:text>
2955
3031
  </xsl:variable>
@@ -2962,9 +3038,14 @@
2962
3038
  <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
2963
3039
  </xsl:attribute-set>
2964
3040
 
3041
+ <xsl:template name="refine_add-style">
3042
+ </xsl:template>
3043
+
2965
3044
  <xsl:variable name="add-style">
2966
- <add-style xsl:use-attribute-sets="add-style"/>
2967
- </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>
2968
3049
  <xsl:template name="append_add-style">
2969
3050
  <xsl:copy-of select="xalan:nodeset($add-style)/add-style/@*"/>
2970
3051
  </xsl:template>
@@ -2977,24 +3058,77 @@
2977
3058
  <xsl:attribute name="text-decoration">line-through</xsl:attribute>
2978
3059
  </xsl:attribute-set>
2979
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
+
2980
3118
  <xsl:template match="mn:br">
2981
3119
  <xsl:value-of select="$linebreak"/>
2982
3120
  </xsl:template>
2983
3121
 
2984
- <xsl:template match="mn:em">
2985
- <fo:inline font-style="italic">
2986
- <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"/>
2987
3125
  <xsl:apply-templates/>
2988
3126
  </fo:inline>
2989
3127
  </xsl:template>
2990
3128
 
2991
- <xsl:template name="refine_italic_style">
2992
- </xsl:template>
2993
-
2994
3129
  <xsl:template match="mn:strong | *[local-name()='b']">
2995
3130
  <xsl:param name="split_keep-within-line"/>
2996
- <fo:inline font-weight="bold">
2997
-
3131
+ <fo:inline xsl:use-attribute-sets="strong-style">
2998
3132
  <xsl:call-template name="refine_strong_style"/>
2999
3133
 
3000
3134
  <xsl:apply-templates>
@@ -3003,44 +3137,27 @@
3003
3137
  </fo:inline>
3004
3138
  </xsl:template>
3005
3139
 
3006
- <xsl:template name="refine_strong_style">
3007
- <xsl:if test="ancestor::*['preferred']">
3008
- <xsl:attribute name="role">SKIP</xsl:attribute>
3009
- </xsl:if>
3010
- </xsl:template>
3011
-
3012
3140
  <xsl:template match="*[local-name()='padding']">
3013
3141
  <fo:inline padding-right="{@value}"> </fo:inline>
3014
3142
  </xsl:template>
3015
3143
 
3016
3144
  <xsl:template match="mn:sup">
3017
- <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"/>
3018
3147
  <xsl:apply-templates/>
3019
3148
  </fo:inline>
3020
3149
  </xsl:template>
3021
3150
 
3022
3151
  <xsl:template match="mn:sub">
3023
- <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"/>
3024
3154
  <xsl:apply-templates/>
3025
3155
  </fo:inline>
3026
3156
  </xsl:template>
3027
3157
 
3028
3158
  <xsl:template match="mn:tt">
3029
3159
  <fo:inline xsl:use-attribute-sets="tt-style">
3030
-
3031
- <xsl:variable name="_font-size">10 <!-- inherit -->
3032
- </xsl:variable>
3033
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3034
- <xsl:if test="$font-size != ''">
3035
- <xsl:attribute name="font-size">
3036
- <xsl:choose>
3037
- <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
3038
- <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
3039
- <xsl:when test="ancestor::mn:note or ancestor::mn:example"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3040
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3041
- </xsl:choose>
3042
- </xsl:attribute>
3043
- </xsl:if>
3160
+ <xsl:call-template name="refine_tt-style"/>
3044
3161
  <xsl:apply-templates/>
3045
3162
  </fo:inline>
3046
3163
  </xsl:template> <!-- tt -->
@@ -3059,7 +3176,8 @@
3059
3176
  </xsl:template>
3060
3177
 
3061
3178
  <xsl:template match="mn:underline">
3062
- <fo:inline text-decoration="underline">
3179
+ <fo:inline xsl:use-attribute-sets="underline-style">
3180
+ <xsl:call-template name="refine_underline-style"/>
3063
3181
  <xsl:apply-templates/>
3064
3182
  </fo:inline>
3065
3183
  </xsl:template>
@@ -3217,6 +3335,7 @@
3217
3335
 
3218
3336
  <xsl:template match="mn:del">
3219
3337
  <fo:inline xsl:use-attribute-sets="del-style">
3338
+ <xsl:call-template name="refine_del-style"/>
3220
3339
  <xsl:apply-templates/>
3221
3340
  </fo:inline>
3222
3341
  </xsl:template>
@@ -3226,7 +3345,8 @@
3226
3345
 
3227
3346
  <!-- highlight text -->
3228
3347
  <xsl:template match="mn:hi | mn:span[@class = 'fmt-hi']" priority="3">
3229
- <fo:inline background-color="yellow">
3348
+ <fo:inline xsl:use-attribute-sets="hi-style">
3349
+ <xsl:call-template name="refine_hi-style"/>
3230
3350
  <xsl:apply-templates/>
3231
3351
  </fo:inline>
3232
3352
  </xsl:template>
@@ -3312,7 +3432,8 @@
3312
3432
  </xsl:template>
3313
3433
 
3314
3434
  <xsl:template match="mn:strike">
3315
- <fo:inline text-decoration="line-through">
3435
+ <fo:inline xsl:use-attribute-sets="strike-style">
3436
+ <xsl:call-template name="refine_strike-style"/>
3316
3437
  <xsl:apply-templates/>
3317
3438
  </fo:inline>
3318
3439
  </xsl:template>
@@ -3340,7 +3461,7 @@
3340
3461
  </xsl:otherwise>
3341
3462
  </xsl:choose>
3342
3463
  </xsl:variable>
3343
- <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color' or $key = 'baseline-shift'">
3464
+ <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color' or $key = 'baseline-shift' or $key = 'line-height' ">
3344
3465
  <style name="{$key}"><xsl:value-of select="$value"/></style>
3345
3466
  </xsl:if>
3346
3467
  <xsl:if test="$key = 'text-indent'">
@@ -3392,6 +3513,7 @@
3392
3513
 
3393
3514
  <xsl:template match="mn:pre" name="pre">
3394
3515
  <fo:block xsl:use-attribute-sets="pre-style">
3516
+ <xsl:call-template name="refine_pre-style"/>
3395
3517
  <xsl:copy-of select="@id"/>
3396
3518
  <xsl:choose>
3397
3519
 
@@ -3422,22 +3544,40 @@
3422
3544
  <xsl:attribute-set name="permission-style">
3423
3545
  </xsl:attribute-set>
3424
3546
 
3547
+ <xsl:template name="refine_permission-style">
3548
+ </xsl:template>
3549
+
3425
3550
  <xsl:attribute-set name="permission-name-style">
3426
3551
  </xsl:attribute-set>
3427
3552
 
3553
+ <xsl:template name="refine_permission-name-style">
3554
+ </xsl:template>
3555
+
3428
3556
  <xsl:attribute-set name="permission-label-style">
3429
3557
  </xsl:attribute-set>
3430
3558
 
3559
+ <xsl:template name="refine_permission-label-style">
3560
+ </xsl:template>
3561
+
3431
3562
  <xsl:attribute-set name="requirement-style">
3432
3563
  </xsl:attribute-set>
3433
3564
 
3565
+ <xsl:template name="refine_requirement-style">
3566
+ </xsl:template>
3567
+
3434
3568
  <xsl:attribute-set name="requirement-name-style">
3435
3569
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3436
3570
  </xsl:attribute-set>
3437
3571
 
3572
+ <xsl:template name="refine_requirement-name-style">
3573
+ </xsl:template>
3574
+
3438
3575
  <xsl:attribute-set name="requirement-label-style">
3439
3576
  </xsl:attribute-set>
3440
3577
 
3578
+ <xsl:template name="refine_requirement-label-style">
3579
+ </xsl:template>
3580
+
3441
3581
  <xsl:attribute-set name="subject-style">
3442
3582
  </xsl:attribute-set>
3443
3583
 
@@ -3465,18 +3605,28 @@
3465
3605
  <xsl:attribute-set name="recommendation-style">
3466
3606
  </xsl:attribute-set>
3467
3607
 
3608
+ <xsl:template name="refine_recommendation-style">
3609
+ </xsl:template>
3610
+
3468
3611
  <xsl:attribute-set name="recommendation-name-style">
3469
3612
  </xsl:attribute-set>
3470
3613
 
3614
+ <xsl:template name="refine_recommendation-name-style">
3615
+ </xsl:template>
3616
+
3471
3617
  <xsl:attribute-set name="recommendation-label-style">
3472
3618
  </xsl:attribute-set>
3473
3619
 
3620
+ <xsl:template name="refine_recommendation-label-style">
3621
+ </xsl:template>
3622
+
3474
3623
  <!-- ========== -->
3475
3624
  <!-- permission -->
3476
3625
  <!-- ========== -->
3477
3626
  <xsl:template match="mn:permission">
3478
3627
  <xsl:call-template name="setNamedDestination"/>
3479
3628
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
3629
+ <xsl:call-template name="refine_permission-style"/>
3480
3630
  <xsl:apply-templates select="mn:fmt-name"/>
3481
3631
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
3482
3632
  </fo:block>
@@ -3485,6 +3635,7 @@
3485
3635
  <xsl:template match="mn:permission/mn:fmt-name">
3486
3636
  <xsl:if test="normalize-space() != ''">
3487
3637
  <fo:block xsl:use-attribute-sets="permission-name-style">
3638
+ <xsl:call-template name="refine_permission-name-style"/>
3488
3639
  <xsl:apply-templates/>
3489
3640
  </fo:block>
3490
3641
  </xsl:if>
@@ -3492,6 +3643,7 @@
3492
3643
 
3493
3644
  <xsl:template match="mn:permission/mn:label">
3494
3645
  <fo:block xsl:use-attribute-sets="permission-label-style">
3646
+ <xsl:call-template name="refine_permission-label-style"/>
3495
3647
  <xsl:apply-templates/>
3496
3648
  </fo:block>
3497
3649
  </xsl:template>
@@ -3504,6 +3656,7 @@
3504
3656
  <xsl:template match="mn:requirement">
3505
3657
  <xsl:call-template name="setNamedDestination"/>
3506
3658
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
3659
+ <xsl:call-template name="refine_requirement-style"/>
3507
3660
  <xsl:apply-templates select="mn:fmt-name"/>
3508
3661
  <xsl:apply-templates select="mn:label"/>
3509
3662
  <xsl:apply-templates select="@obligation"/>
@@ -3516,6 +3669,7 @@
3516
3669
  <xsl:if test="normalize-space() != ''">
3517
3670
 
3518
3671
  <fo:block xsl:use-attribute-sets="requirement-name-style">
3672
+ <xsl:call-template name="refine_requirement-name-style"/>
3519
3673
  <xsl:apply-templates/>
3520
3674
  </fo:block>
3521
3675
  </xsl:if>
@@ -3523,6 +3677,7 @@
3523
3677
 
3524
3678
  <xsl:template match="mn:requirement/mn:label">
3525
3679
  <fo:block xsl:use-attribute-sets="requirement-label-style">
3680
+ <xsl:call-template name="refine_requirement-label-style"/>
3526
3681
  <xsl:apply-templates/>
3527
3682
  </fo:block>
3528
3683
  </xsl:template>
@@ -3548,6 +3703,7 @@
3548
3703
  <xsl:template match="mn:recommendation">
3549
3704
  <xsl:call-template name="setNamedDestination"/>
3550
3705
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
3706
+ <xsl:call-template name="refine_recommendation-style"/>
3551
3707
  <xsl:apply-templates select="mn:fmt-name"/>
3552
3708
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
3553
3709
  </fo:block>
@@ -3557,6 +3713,7 @@
3557
3713
  <xsl:if test="normalize-space() != ''">
3558
3714
 
3559
3715
  <fo:block xsl:use-attribute-sets="recommendation-name-style">
3716
+ <xsl:call-template name="refine_recommendation-name-style"/>
3560
3717
  <xsl:apply-templates/>
3561
3718
  </fo:block>
3562
3719
  </xsl:if>
@@ -3564,6 +3721,7 @@
3564
3721
 
3565
3722
  <xsl:template match="mn:recommendation/mn:label">
3566
3723
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
3724
+ <xsl:call-template name="refine_recommendation-label-style"/>
3567
3725
  <xsl:apply-templates/>
3568
3726
  </fo:block>
3569
3727
  </xsl:template>
@@ -3744,36 +3902,66 @@
3744
3902
  <xsl:attribute-set name="term-style">
3745
3903
  </xsl:attribute-set> <!-- term-style -->
3746
3904
 
3905
+ <xsl:template name="refine_term-style">
3906
+ </xsl:template>
3907
+
3747
3908
  <xsl:attribute-set name="term-name-style">
3748
3909
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3749
3910
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3750
3911
  </xsl:attribute-set> <!-- term-name-style -->
3751
3912
 
3752
- <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">
3753
3917
  </xsl:attribute-set> <!-- preferred-block-style -->
3754
3918
 
3919
+ <xsl:template name="refine_preferred-block-style">
3920
+ </xsl:template>
3921
+
3755
3922
  <xsl:attribute-set name="preferred-term-style">
3756
3923
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3757
3924
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3758
3925
  <xsl:attribute name="line-height">1</xsl:attribute>
3759
3926
  </xsl:attribute-set> <!-- preferred-term-style -->
3760
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
+
3761
3934
  <xsl:attribute-set name="domain-style">
3762
3935
  </xsl:attribute-set> <!-- domain-style -->
3763
3936
 
3937
+ <xsl:template name="refine_domain-style">
3938
+ </xsl:template>
3939
+
3764
3940
  <xsl:attribute-set name="admitted-style">
3765
3941
  </xsl:attribute-set> <!-- admitted-style -->
3766
3942
 
3943
+ <xsl:template name="refine_admitted-style">
3944
+ </xsl:template>
3945
+
3767
3946
  <xsl:attribute-set name="deprecates-style">
3768
3947
  </xsl:attribute-set> <!-- deprecates-style -->
3769
3948
 
3949
+ <xsl:template name="refine_deprecates-style">
3950
+ </xsl:template>
3951
+
3770
3952
  <xsl:attribute-set name="related-block-style" use-attribute-sets="preferred-block-style">
3771
3953
  </xsl:attribute-set>
3772
3954
 
3955
+ <xsl:template name="refine_related-block-style">
3956
+ </xsl:template>
3957
+
3773
3958
  <xsl:attribute-set name="definition-style">
3774
3959
  <xsl:attribute name="space-after">6pt</xsl:attribute>
3775
3960
  </xsl:attribute-set> <!-- definition-style -->
3776
3961
 
3962
+ <xsl:template name="refine_definition-style">
3963
+ </xsl:template>
3964
+
3777
3965
  <xsl:attribute-set name="termsource-style">
3778
3966
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
3779
3967
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
@@ -3785,11 +3973,17 @@
3785
3973
  <xsl:attribute-set name="termsource-text-style">
3786
3974
  </xsl:attribute-set> <!-- termsource-text-style -->
3787
3975
 
3976
+ <xsl:template name="refine_termsource-text-style">
3977
+ </xsl:template>
3978
+
3788
3979
  <xsl:attribute-set name="origin-style">
3789
3980
  <xsl:attribute name="color">rgb(33, 94, 159)</xsl:attribute>
3790
3981
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
3791
3982
  </xsl:attribute-set> <!-- origin-style -->
3792
3983
 
3984
+ <xsl:template name="refine_origin-style">
3985
+ </xsl:template>
3986
+
3793
3987
  <!-- ====== -->
3794
3988
  <!-- term -->
3795
3989
  <!-- ====== -->
@@ -3805,9 +3999,8 @@
3805
3999
  <xsl:template match="mn:term">
3806
4000
  <xsl:call-template name="setNamedDestination"/>
3807
4001
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
4002
+ <xsl:call-template name="refine_term-style"/>
3808
4003
 
3809
- <xsl:if test="parent::mn:term and not(preceding-sibling::mn:term)">
3810
- </xsl:if>
3811
4004
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
3812
4005
  </fo:block>
3813
4006
  </xsl:template>
@@ -3883,6 +4076,7 @@
3883
4076
  <!-- text SOURCE: -->
3884
4077
  <xsl:template match="mn:fmt-termsource/mn:strong[1][following-sibling::*[1][self::mn:fmt-origin]]/text()">
3885
4078
  <fo:inline xsl:use-attribute-sets="termsource-text-style">
4079
+ <xsl:call-template name="refine_termsource-text-style"/>
3886
4080
  <xsl:value-of select="."/>
3887
4081
  </fo:inline>
3888
4082
  </xsl:template>
@@ -3895,6 +4089,7 @@
3895
4089
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
3896
4090
  </xsl:if>
3897
4091
  <fo:inline xsl:use-attribute-sets="origin-style">
4092
+ <xsl:call-template name="refine_origin-style"/>
3898
4093
  <xsl:apply-templates/>
3899
4094
  </fo:inline>
3900
4095
  </fo:basic-link>
@@ -3949,9 +4144,12 @@
3949
4144
  </xsl:variable>
3950
4145
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
3951
4146
 
4147
+ <xsl:call-template name="refine_preferred-block-style"/>
4148
+
3952
4149
  <xsl:if test="parent::mn:term and not(preceding-sibling::mn:fmt-preferred)"> <!-- if first preffered in term, then display term's name -->
3953
4150
 
3954
4151
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
4152
+ <xsl:call-template name="refine_term-name-style"/>
3955
4153
 
3956
4154
  <xsl:for-each select="ancestor::mn:term[1]/mn:fmt-name"><!-- change context -->
3957
4155
  <xsl:call-template name="setIDforNamedDestination"/>
@@ -3962,7 +4160,7 @@
3962
4160
  </xsl:if>
3963
4161
 
3964
4162
  <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
3965
- <xsl:call-template name="setStyle_preferred"/>
4163
+ <xsl:call-template name="refine_preferred-term-style"/>
3966
4164
 
3967
4165
  <xsl:apply-templates/>
3968
4166
  </fo:block>
@@ -3983,22 +4181,18 @@
3983
4181
 
3984
4182
  <xsl:template match="mn:fmt-admitted">
3985
4183
  <fo:block xsl:use-attribute-sets="admitted-style">
4184
+ <xsl:call-template name="refine_admitted-style"/>
3986
4185
  <xsl:apply-templates/>
3987
4186
  </fo:block>
3988
4187
  </xsl:template>
3989
4188
 
3990
4189
  <xsl:template match="mn:fmt-deprecates">
3991
4190
  <fo:block xsl:use-attribute-sets="deprecates-style">
4191
+ <xsl:call-template name="refine_deprecates-style"/>
3992
4192
  <xsl:apply-templates/>
3993
4193
  </fo:block>
3994
4194
  </xsl:template>
3995
4195
 
3996
- <xsl:template name="setStyle_preferred">
3997
- <xsl:if test="mn:strong">
3998
- <xsl:attribute name="font-weight">normal</xsl:attribute>
3999
- </xsl:if>
4000
- </xsl:template>
4001
-
4002
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. -->
4003
4197
  <!-- in metanorma xml preferred terms delimited by semicolons -->
4004
4198
  <xsl:template match="mn:fmt-preferred/text()[contains(., ';')] | mn:fmt-preferred/mn:strong/text()[contains(., ';')]">
@@ -4008,6 +4202,7 @@
4008
4202
 
4009
4203
  <xsl:template match="mn:fmt-related">
4010
4204
  <fo:block role="SKIP" xsl:use-attribute-sets="related-block-style">
4205
+ <xsl:call-template name="refine_related-block-style"/>
4011
4206
  <xsl:apply-templates/>
4012
4207
  </fo:block>
4013
4208
  </xsl:template>
@@ -4022,6 +4217,7 @@
4022
4217
  <!-- ========== -->
4023
4218
  <xsl:template match="mn:fmt-definition">
4024
4219
  <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
4220
+ <xsl:call-template name="refine_definition-style"/>
4025
4221
  <xsl:apply-templates/>
4026
4222
  </fo:block>
4027
4223
  </xsl:template>
@@ -4071,6 +4267,9 @@
4071
4267
  <xsl:attribute name="margin-right">12.5mm</xsl:attribute>
4072
4268
  </xsl:attribute-set> <!-- example-body-style -->
4073
4269
 
4270
+ <xsl:template name="refine_example-body-style">
4271
+ </xsl:template>
4272
+
4074
4273
  <xsl:attribute-set name="example-name-style">
4075
4274
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4076
4275
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -4120,6 +4319,8 @@
4120
4319
  <xsl:when test="contains($element, 'block')">
4121
4320
  <fo:block xsl:use-attribute-sets="example-p-style">
4122
4321
 
4322
+ <xsl:call-template name="refine_example-p-style"/>
4323
+
4123
4324
  <xsl:apply-templates/>
4124
4325
  </fo:block>
4125
4326
  </xsl:when>
@@ -4171,6 +4372,7 @@
4171
4372
  </fo:block>
4172
4373
 
4173
4374
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
4375
+ <xsl:call-template name="refine_example-body-style"/>
4174
4376
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
4175
4377
  <xsl:variable name="example_body">
4176
4378
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]">
@@ -4233,6 +4435,7 @@
4233
4435
  <xsl:if test="*[not(self::mn:fmt-name)][position() &gt; 1]">
4234
4436
  <!-- display further elements in blocks -->
4235
4437
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
4438
+ <xsl:call-template name="refine_example-body-style"/>
4236
4439
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
4237
4440
  <xsl:apply-templates select="*[not(self::mn:fmt-name)][position() &gt; 1]">
4238
4441
  <xsl:with-param name="fo_element" select="'block'"/>
@@ -4458,6 +4661,9 @@
4458
4661
  <!-- <xsl:attribute name="padding-right">5mm</xsl:attribute> -->
4459
4662
  </xsl:attribute-set> <!-- table-fn-number-style -->
4460
4663
 
4664
+ <xsl:template name="refine_table-fn-number-style">
4665
+ </xsl:template>
4666
+
4461
4667
  <xsl:attribute-set name="table-fmt-fn-label-style">
4462
4668
  <xsl:attribute name="font-size">80%</xsl:attribute>
4463
4669
  </xsl:attribute-set> <!-- table-fmt-fn-label-style -->
@@ -4465,30 +4671,12 @@
4465
4671
  <xsl:template name="refine_table-fmt-fn-label-style">
4466
4672
  </xsl:template>
4467
4673
 
4468
- <xsl:attribute-set name="fn-container-body-style">
4469
- <xsl:attribute name="text-indent">0</xsl:attribute>
4470
- <xsl:attribute name="start-indent">0</xsl:attribute>
4471
- </xsl:attribute-set>
4472
-
4473
4674
  <xsl:attribute-set name="table-fn-body-style">
4474
4675
  </xsl:attribute-set>
4475
4676
 
4476
- <xsl:attribute-set name="figure-fn-number-style">
4477
- <xsl:attribute name="padding-right">5mm</xsl:attribute>
4478
- </xsl:attribute-set> <!-- figure-fn-number-style -->
4479
-
4480
- <xsl:attribute-set name="figure-fmt-fn-label-style">
4481
- <xsl:attribute name="font-size">80%</xsl:attribute>
4482
- <xsl:attribute name="vertical-align">super</xsl:attribute>
4483
- </xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
4484
-
4485
- <xsl:template name="refine_figure-fmt-fn-label-style">
4677
+ <xsl:template name="refine_table-fn-body-style">
4486
4678
  </xsl:template>
4487
4679
 
4488
- <xsl:attribute-set name="figure-fn-body-style">
4489
- <xsl:attribute name="text-align">justify</xsl:attribute>
4490
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
4491
- </xsl:attribute-set>
4492
4680
  <!-- ========================== -->
4493
4681
  <!-- END Table styles -->
4494
4682
  <!-- ========================== -->
@@ -5765,6 +5953,7 @@
5765
5953
  </xsl:apply-templates>
5766
5954
 
5767
5955
  <fo:inline xsl:use-attribute-sets="table-fn-body-style">
5956
+ <xsl:call-template name="refine_table-fn-body-style"/>
5768
5957
  <!-- <xsl:copy-of select="./node()"/> -->
5769
5958
  <xsl:apply-templates/>
5770
5959
  </fo:inline>
@@ -5783,6 +5972,7 @@
5783
5972
  <xsl:param name="process">false</xsl:param>
5784
5973
  <xsl:if test="$process = 'true'">
5785
5974
  <fo:inline xsl:use-attribute-sets="table-fn-number-style" role="SKIP">
5975
+ <xsl:call-template name="refine_table-fn-number-style"/>
5786
5976
 
5787
5977
  <!-- tab is padding-right -->
5788
5978
  <xsl:apply-templates select=".//mn:tab">
@@ -6654,9 +6844,18 @@
6654
6844
  <xsl:attribute-set name="dl-block-style">
6655
6845
  </xsl:attribute-set>
6656
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
+
6657
6853
  <xsl:attribute-set name="dt-row-style">
6658
6854
  </xsl:attribute-set>
6659
6855
 
6856
+ <xsl:template name="refine_dt-row-style">
6857
+ </xsl:template>
6858
+
6660
6859
  <xsl:attribute-set name="dt-cell-style">
6661
6860
  </xsl:attribute-set>
6662
6861
 
@@ -6675,6 +6874,9 @@
6675
6874
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
6676
6875
  </xsl:attribute-set> <!-- dl-name-style -->
6677
6876
 
6877
+ <xsl:template name="refine_dl-name-style">
6878
+ </xsl:template>
6879
+
6678
6880
  <xsl:attribute-set name="dd-cell-style">
6679
6881
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
6680
6882
  </xsl:attribute-set>
@@ -6713,9 +6915,7 @@
6713
6915
  <!-- <dl><xsl:copy-of select="."/></dl> -->
6714
6916
  <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
6715
6917
 
6716
- <xsl:if test="@key = 'true' and ancestor::mn:figure">
6717
- <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
6718
- </xsl:if>
6918
+ <xsl:call-template name="refine_dl-block-style"/>
6719
6919
 
6720
6920
  <xsl:call-template name="setBlockSpanAll"/>
6721
6921
  <xsl:if test="not(ancestor::mn:quote)">
@@ -7011,6 +7211,8 @@
7011
7211
  <xsl:if test="$process = 'true'">
7012
7212
  <fo:block xsl:use-attribute-sets="dl-name-style">
7013
7213
 
7214
+ <xsl:call-template name="refine_dl-name-style"/>
7215
+
7014
7216
  <xsl:apply-templates/>
7015
7217
  </fo:block>
7016
7218
  </xsl:if>
@@ -7199,6 +7401,8 @@
7199
7401
  <xsl:param name="split_keep-within-line"/>
7200
7402
 
7201
7403
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
7404
+ <xsl:call-template name="refine_dt-row-style"/>
7405
+
7202
7406
  <xsl:call-template name="insert_dt_cell">
7203
7407
  <xsl:with-param name="key_iso" select="$key_iso"/>
7204
7408
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -7408,15 +7612,22 @@
7408
7612
  <xsl:attribute-set name="appendix-style">
7409
7613
  </xsl:attribute-set>
7410
7614
 
7615
+ <xsl:template name="refine_appendix-style">
7616
+ </xsl:template>
7617
+
7411
7618
  <xsl:attribute-set name="appendix-example-style">
7412
7619
  </xsl:attribute-set>
7413
7620
 
7621
+ <xsl:template name="refine_appendix-example-style">
7622
+ </xsl:template>
7623
+
7414
7624
  <!-- ======================== -->
7415
7625
  <!-- Appendix processing -->
7416
7626
  <!-- ======================== -->
7417
7627
  <xsl:template match="mn:appendix">
7418
7628
  <xsl:call-template name="setNamedDestination"/>
7419
7629
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
7630
+ <xsl:call-template name="refine_appendix-style"/>
7420
7631
  <xsl:apply-templates select="mn:fmt-title"/>
7421
7632
  </fo:block>
7422
7633
  <xsl:apply-templates select="node()[not(self::mn:fmt-title)]"/>
@@ -7435,6 +7646,7 @@
7435
7646
  <xsl:template match="mn:appendix//mn:example" priority="2">
7436
7647
  <xsl:call-template name="setNamedDestination"/>
7437
7648
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
7649
+ <xsl:call-template name="refine_appendix-example-style"/>
7438
7650
  <xsl:apply-templates select="mn:fmt-name"/>
7439
7651
  </fo:block>
7440
7652
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
@@ -7442,7 +7654,16 @@
7442
7654
 
7443
7655
  <xsl:attribute-set name="xref-style">
7444
7656
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
7445
- </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 -->
7446
7667
 
7447
7668
  <xsl:template match="mn:fmt-xref">
7448
7669
  <xsl:call-template name="insert_basic_link">
@@ -7451,12 +7672,8 @@
7451
7672
  <xsl:call-template name="getAltText"/>
7452
7673
  </xsl:variable>
7453
7674
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
7454
- <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])">
7455
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7456
- </xsl:if>
7457
- <xsl:if test="parent::mn:add">
7458
- <xsl:call-template name="append_add-style"/>
7459
- </xsl:if>
7675
+ <xsl:call-template name="refine_xref-style"/>
7676
+
7460
7677
  <xsl:apply-templates/>
7461
7678
  </fo:basic-link>
7462
7679
  </xsl:with-param>
@@ -7569,17 +7786,17 @@
7569
7786
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
7570
7787
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
7571
7788
  <xsl:attribute name="line-height">115%</xsl:attribute>
7572
- </xsl:attribute-set>
7789
+ </xsl:attribute-set> <!-- note-style -->
7573
7790
 
7574
7791
  <xsl:template name="refine_note-style">
7575
- </xsl:template>
7792
+ </xsl:template> <!-- refine_note-style -->
7576
7793
 
7577
7794
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
7578
7795
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
7579
7796
 
7580
7797
  <xsl:attribute-set name="note-name-style">
7581
7798
  <xsl:attribute name="padding-right">4mm</xsl:attribute>
7582
- </xsl:attribute-set>
7799
+ </xsl:attribute-set> <!-- note-name-style -->
7583
7800
 
7584
7801
  <xsl:template name="refine_note-name-style">
7585
7802
  </xsl:template> <!-- refine_note-name-style -->
@@ -7594,18 +7811,21 @@
7594
7811
  <xsl:attribute-set name="note-p-style">
7595
7812
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
7596
7813
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
7597
- </xsl:attribute-set>
7814
+ </xsl:attribute-set> <!-- note-p-style -->
7815
+
7816
+ <xsl:template name="refine_note-p-style">
7817
+ </xsl:template>
7598
7818
 
7599
7819
  <xsl:attribute-set name="termnote-style">
7600
7820
  <xsl:attribute name="font-size">10pt</xsl:attribute>
7601
7821
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
7602
- </xsl:attribute-set>
7822
+ </xsl:attribute-set> <!-- termnote-style -->
7603
7823
 
7604
7824
  <xsl:template name="refine_termnote-style">
7605
7825
  </xsl:template> <!-- refine_termnote-style -->
7606
7826
 
7607
7827
  <xsl:attribute-set name="termnote-name-style">
7608
- </xsl:attribute-set>
7828
+ </xsl:attribute-set> <!-- termnote-name-style -->
7609
7829
 
7610
7830
  <xsl:template name="refine_termnote-name-style">
7611
7831
  </xsl:template>
@@ -7613,6 +7833,9 @@
7613
7833
  <xsl:attribute-set name="termnote-p-style">
7614
7834
  </xsl:attribute-set>
7615
7835
 
7836
+ <xsl:template name="refine_termnote-p-style">
7837
+ </xsl:template>
7838
+
7616
7839
  <!-- ====== -->
7617
7840
  <!-- note -->
7618
7841
  <!-- termnote -->
@@ -7676,11 +7899,13 @@
7676
7899
  <xsl:choose>
7677
7900
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
7678
7901
  <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
7902
+ <xsl:call-template name="refine_note-p-style"/>
7679
7903
  <xsl:apply-templates/>
7680
7904
  </fo:inline>
7681
7905
  </xsl:when>
7682
7906
  <xsl:otherwise>
7683
7907
  <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
7908
+ <xsl:call-template name="refine_note-p-style"/>
7684
7909
  <xsl:apply-templates/>
7685
7910
  </fo:block>
7686
7911
  </xsl:otherwise>
@@ -7772,11 +7997,13 @@
7772
7997
  <xsl:choose>
7773
7998
  <xsl:when test="$num = 1"> <!-- first paragraph renders in the same line as titlenote name -->
7774
7999
  <fo:inline xsl:use-attribute-sets="termnote-p-style">
8000
+ <xsl:call-template name="refine_termnote-p-style"/>
7775
8001
  <xsl:apply-templates/>
7776
8002
  </fo:inline>
7777
8003
  </xsl:when>
7778
8004
  <xsl:otherwise>
7779
8005
  <fo:block xsl:use-attribute-sets="termnote-p-style">
8006
+ <xsl:call-template name="refine_termnote-p-style"/>
7780
8007
  <xsl:apply-templates/>
7781
8008
  </fo:block>
7782
8009
  </xsl:otherwise>
@@ -7791,7 +8018,7 @@
7791
8018
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
7792
8019
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
7793
8020
  <xsl:attribute name="margin-left">13mm</xsl:attribute>
7794
- </xsl:attribute-set>
8021
+ </xsl:attribute-set> <!-- quote-style -->
7795
8022
 
7796
8023
  <xsl:template name="refine_quote-style">
7797
8024
  </xsl:template>
@@ -7801,6 +8028,9 @@
7801
8028
  <xsl:attribute name="margin-right">25mm</xsl:attribute>
7802
8029
  </xsl:attribute-set>
7803
8030
 
8031
+ <xsl:template name="refine_quote-source-style">
8032
+ </xsl:template>
8033
+
7804
8034
  <!-- ====== -->
7805
8035
  <!-- quote -->
7806
8036
  <!-- source -->
@@ -7829,6 +8059,7 @@
7829
8059
  </fo:block-container>
7830
8060
  <xsl:if test="mn:author or mn:fmt-source or mn:attribution">
7831
8061
  <fo:block xsl:use-attribute-sets="quote-source-style">
8062
+ <xsl:call-template name="refine_quote-source-style"/>
7832
8063
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
7833
8064
  <xsl:apply-templates select="mn:author"/>
7834
8065
  <xsl:apply-templates select="mn:fmt-source"/>
@@ -7891,6 +8122,9 @@
7891
8122
  <xsl:attribute-set name="figure-style">
7892
8123
  </xsl:attribute-set>
7893
8124
 
8125
+ <xsl:template name="refine_figure-style">
8126
+ </xsl:template>
8127
+
7894
8128
  <xsl:attribute-set name="figure-name-style">
7895
8129
  <xsl:attribute name="role">Caption</xsl:attribute>
7896
8130
  <xsl:attribute name="font-size">11pt</xsl:attribute>
@@ -7899,7 +8133,7 @@
7899
8133
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
7900
8134
  <xsl:attribute name="space-after">6pt</xsl:attribute>
7901
8135
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
7902
- </xsl:attribute-set>
8136
+ </xsl:attribute-set> <!-- figure-name-style -->
7903
8137
 
7904
8138
  <xsl:template name="refine_figure-name-style">
7905
8139
  </xsl:template> <!-- refine_figure-name-style -->
@@ -7907,7 +8141,7 @@
7907
8141
  <xsl:attribute-set name="image-style">
7908
8142
  <xsl:attribute name="role">SKIP</xsl:attribute>
7909
8143
  <xsl:attribute name="text-align">center</xsl:attribute>
7910
- </xsl:attribute-set>
8144
+ </xsl:attribute-set> <!-- image-style -->
7911
8145
 
7912
8146
  <xsl:template name="refine_image-style">
7913
8147
  </xsl:template>
@@ -7917,14 +8151,51 @@
7917
8151
  <xsl:attribute name="content-height">100%</xsl:attribute>
7918
8152
  <xsl:attribute name="scaling">uniform</xsl:attribute>
7919
8153
  <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
7920
- </xsl:attribute-set>
8154
+ </xsl:attribute-set> <!-- image-graphic-style -->
8155
+
8156
+ <xsl:template name="refine_image-graphic-style">
8157
+ </xsl:template>
7921
8158
 
7922
8159
  <xsl:attribute-set name="figure-source-style">
7923
8160
  </xsl:attribute-set>
7924
8161
 
8162
+ <xsl:template name="refine_figure-source-style">
8163
+ </xsl:template>
8164
+
7925
8165
  <xsl:attribute-set name="figure-pseudocode-p-style">
7926
8166
  </xsl:attribute-set>
7927
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
+
7928
8199
  <!-- ============================ -->
7929
8200
  <!-- figure's footnotes rendering -->
7930
8201
  <!-- ============================ -->
@@ -8037,9 +8308,8 @@
8037
8308
  </fo:table-cell>
8038
8309
  <fo:table-cell>
8039
8310
  <fo:block xsl:use-attribute-sets="figure-fn-body-style">
8040
- <xsl:if test="normalize-space($key_iso) = 'true'">
8041
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
8042
- </xsl:if>
8311
+ <xsl:call-template name="refine_figure-fn-body-style"/>
8312
+
8043
8313
  <!-- <xsl:copy-of select="./node()"/> -->
8044
8314
  <xsl:apply-templates/>
8045
8315
  </fo:block>
@@ -8057,6 +8327,7 @@
8057
8327
  <xsl:param name="process">false</xsl:param>
8058
8328
  <xsl:if test="$process = 'true'">
8059
8329
  <fo:inline xsl:use-attribute-sets="figure-fn-number-style" role="SKIP">
8330
+ <xsl:call-template name="refine_figure-fn-number-style"/>
8060
8331
  <xsl:attribute name="padding-right">0mm</xsl:attribute>
8061
8332
 
8062
8333
  <!-- tab is padding-right -->
@@ -8094,6 +8365,7 @@
8094
8365
  <xsl:attribute name="font-size">10pt</xsl:attribute>
8095
8366
  </xsl:if>
8096
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"/>
8097
8369
  <!-- <xsl:value-of select="@reference"/> -->
8098
8370
  <xsl:apply-templates/>
8099
8371
  </fo:inline>
@@ -8139,6 +8411,8 @@
8139
8411
 
8140
8412
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
8141
8413
 
8414
+ <xsl:call-template name="refine_figure-style"/>
8415
+
8142
8416
  <xsl:for-each select="mn:fmt-name"> <!-- set context -->
8143
8417
  <xsl:call-template name="setIDforNamedDestination"/>
8144
8418
  </xsl:for-each>
@@ -8182,6 +8456,7 @@
8182
8456
 
8183
8457
  <xsl:template match="mn:figure[@class = 'pseudocode']//mn:p">
8184
8458
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
8459
+ <xsl:call-template name="refine_figure-pseudocode-p-style"/>
8185
8460
  <xsl:apply-templates/>
8186
8461
  </fo:block>
8187
8462
  </xsl:template>
@@ -8311,6 +8586,8 @@
8311
8586
  </xsl:variable>
8312
8587
  <xsl:copy-of select="xalan:nodeset($image-graphic-style_attributes)/attributes/@*"/>
8313
8588
 
8589
+ <xsl:call-template name="refine_image-graphic-style"/>
8590
+
8314
8591
  <xsl:if test="not(@mimetype = 'image/svg+xml') and not(ancestor::mn:table)">
8315
8592
  <xsl:variable name="scale">
8316
8593
  <xsl:call-template name="getImageScale">
@@ -9010,6 +9287,9 @@
9010
9287
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
9011
9288
  </xsl:attribute-set> <!-- formula-style -->
9012
9289
 
9290
+ <xsl:template name="refine_formula-style">
9291
+ </xsl:template>
9292
+
9013
9293
  <xsl:attribute-set name="formula-stem-block-style">
9014
9294
  <xsl:attribute name="text-align">center</xsl:attribute>
9015
9295
  <xsl:attribute name="text-align">left</xsl:attribute>
@@ -9080,6 +9360,8 @@
9080
9360
  <xsl:template match="mn:formula[mn:fmt-name]/mn:fmt-stem">
9081
9361
  <fo:block xsl:use-attribute-sets="formula-style">
9082
9362
 
9363
+ <xsl:call-template name="refine_formula-style"/>
9364
+
9083
9365
  <fo:table table-layout="fixed" width="100%">
9084
9366
  <fo:table-column column-width="95%"/>
9085
9367
  <fo:table-column column-width="5%"/>
@@ -9499,6 +9781,9 @@
9499
9781
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
9500
9782
  </xsl:attribute-set> <!-- list-name-style -->
9501
9783
 
9784
+ <xsl:template name="refine_list-name-style">
9785
+ </xsl:template>
9786
+
9502
9787
  <xsl:attribute-set name="list-item-style">
9503
9788
  </xsl:attribute-set>
9504
9789
 
@@ -9798,6 +10083,7 @@
9798
10083
  <xsl:param name="process">false</xsl:param>
9799
10084
  <xsl:if test="$process = 'true'">
9800
10085
  <fo:block xsl:use-attribute-sets="list-name-style">
10086
+ <xsl:call-template name="refine_list-name-style"/>
9801
10087
  <xsl:apply-templates/>
9802
10088
  </fo:block>
9803
10089
  </xsl:if>
@@ -9858,24 +10144,45 @@
9858
10144
  <!-- END Lists processing -->
9859
10145
  <!-- ===================================== -->
9860
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
+
9861
10161
  <xsl:attribute-set name="fn-reference-style">
9862
10162
  <xsl:attribute name="font-size">80%</xsl:attribute>
9863
10163
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
9864
-
9865
- </xsl:attribute-set>
10164
+ </xsl:attribute-set> <!-- fn-reference-style -->
9866
10165
 
9867
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>
9868
10169
  </xsl:template> <!-- refine_fn-reference-style -->
9869
10170
 
9870
10171
  <xsl:attribute-set name="fn-style">
9871
10172
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
9872
10173
  </xsl:attribute-set>
9873
10174
 
10175
+ <xsl:template name="refine_fn-style">
10176
+ </xsl:template>
10177
+
9874
10178
  <xsl:attribute-set name="fn-num-style">
9875
10179
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
9876
10180
  <xsl:attribute name="font-size">65%</xsl:attribute>
9877
10181
  <xsl:attribute name="vertical-align">super</xsl:attribute>
9878
- </xsl:attribute-set>
10182
+ </xsl:attribute-set> <!-- fn-num-style -->
10183
+
10184
+ <xsl:template name="refine_fn-num-style">
10185
+ </xsl:template>
9879
10186
 
9880
10187
  <xsl:attribute-set name="fn-body-style">
9881
10188
  <xsl:attribute name="font-weight">normal</xsl:attribute>
@@ -9887,7 +10194,7 @@
9887
10194
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
9888
10195
  <xsl:attribute name="color">rgb(168, 170, 173)</xsl:attribute>
9889
10196
  <xsl:attribute name="text-align">left</xsl:attribute>
9890
- </xsl:attribute-set>
10197
+ </xsl:attribute-set> <!-- fn-body-style" -->
9891
10198
 
9892
10199
  <xsl:template name="refine_fn-body-style">
9893
10200
  </xsl:template> <!-- refine_fn-body-style -->
@@ -9951,10 +10258,12 @@
9951
10258
  <xsl:choose>
9952
10259
  <xsl:when test="ancestor::mn:bibitem">
9953
10260
  <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
10261
+ <xsl:call-template name="refine_bibitem-note-fn-style"/>
9954
10262
  </fn_styles>
9955
10263
  </xsl:when>
9956
10264
  <xsl:otherwise>
9957
10265
  <fn_styles xsl:use-attribute-sets="fn-num-style">
10266
+ <xsl:call-template name="refine_fn-num-style"/>
9958
10267
  </fn_styles>
9959
10268
  </xsl:otherwise>
9960
10269
  </xsl:choose>
@@ -9964,9 +10273,12 @@
9964
10273
  <xsl:copy-of select="."/>
9965
10274
  </xsl:for-each>
9966
10275
 
9967
- <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]">
9968
10278
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
9969
- </xsl:if>
10279
+ </xsl:if> -->
10280
+
10281
+ <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">,</xsl:if>
9970
10282
 
9971
10283
  <xsl:call-template name="insert_basic_link">
9972
10284
  <xsl:with-param name="element">
@@ -9989,10 +10301,12 @@
9989
10301
  <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
9990
10302
 
9991
10303
  <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
10304
+ <xsl:call-template name="refine_fn-style"/>
9992
10305
  <xsl:copy-of select="$footnote_inline"/>
9993
10306
  <fo:footnote-body role="Note">
9994
10307
 
9995
10308
  <fo:block-container xsl:use-attribute-sets="fn-container-body-style" role="SKIP">
10309
+ <xsl:call-template name="refine_fn-container-body-style"/>
9996
10310
 
9997
10311
  <xsl:variable name="fn_block">
9998
10312
  <xsl:call-template name="refine_fn-body-style"/>
@@ -10094,6 +10408,9 @@
10094
10408
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10095
10409
  </xsl:attribute-set> <!-- admonition-style -->
10096
10410
 
10411
+ <xsl:template name="refine_admonition-style">
10412
+ </xsl:template>
10413
+
10097
10414
  <xsl:attribute-set name="admonition-container-style">
10098
10415
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
10099
10416
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -10101,6 +10418,9 @@
10101
10418
  <xsl:attribute name="padding-top">3mm</xsl:attribute>
10102
10419
  </xsl:attribute-set> <!-- admonition-container-style -->
10103
10420
 
10421
+ <xsl:template name="refine_admonition-container-style">
10422
+ </xsl:template>
10423
+
10104
10424
  <xsl:attribute-set name="admonition-name-style">
10105
10425
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
10106
10426
  <xsl:attribute name="font-size">11pt</xsl:attribute>
@@ -10110,9 +10430,16 @@
10110
10430
  <xsl:attribute name="text-align">center</xsl:attribute>
10111
10431
  </xsl:attribute-set> <!-- admonition-name-style -->
10112
10432
 
10433
+ <xsl:template name="refine_admonition-name-style">
10434
+ </xsl:template>
10435
+
10113
10436
  <xsl:attribute-set name="admonition-p-style">
10114
10437
  <xsl:attribute name="font-style">italic</xsl:attribute>
10115
10438
  </xsl:attribute-set> <!-- admonition-p-style -->
10439
+
10440
+ <xsl:template name="refine_admonition-p-style">
10441
+ </xsl:template>
10442
+
10116
10443
  <!-- end admonition -->
10117
10444
 
10118
10445
  <!-- ================ -->
@@ -10122,8 +10449,12 @@
10122
10449
  <xsl:call-template name="setNamedDestination"/>
10123
10450
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
10124
10451
 
10452
+ <xsl:call-template name="refine_admonition-style"/>
10453
+
10125
10454
  <xsl:call-template name="setBlockSpanAll"/>
10126
10455
  <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
10456
+
10457
+ <xsl:call-template name="refine_admonition-container-style"/>
10127
10458
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
10128
10459
  <fo:block>
10129
10460
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
@@ -10186,6 +10517,13 @@
10186
10517
  <!-- END Admonition -->
10187
10518
  <!-- ================ -->
10188
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
+
10189
10527
  <!-- bibitem in Normative References (references/@normative="true") -->
10190
10528
  <xsl:attribute-set name="bibitem-normative-style">
10191
10529
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -10194,34 +10532,55 @@
10194
10532
  <xsl:attribute name="line-height">145%</xsl:attribute>
10195
10533
  </xsl:attribute-set> <!-- bibitem-normative-style -->
10196
10534
 
10535
+ <xsl:template name="refine_bibitem-normative-style">
10536
+ </xsl:template>
10537
+
10197
10538
  <!-- bibitem in Normative References (references/@normative="true"), renders as list -->
10198
10539
  <xsl:attribute-set name="bibitem-normative-list-style">
10199
10540
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
10200
10541
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10201
10542
  </xsl:attribute-set> <!-- bibitem-normative-list-style -->
10202
10543
 
10544
+ <xsl:template name="refine_bibitem-normative-list-style">
10545
+ </xsl:template>
10546
+
10203
10547
  <xsl:attribute-set name="bibitem-non-normative-style">
10204
10548
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10205
10549
  <xsl:attribute name="line-height">145%</xsl:attribute>
10206
10550
  </xsl:attribute-set> <!-- bibitem-non-normative-style -->
10207
10551
 
10552
+ <xsl:template name="refine_bibitem-non-normative-style">
10553
+ </xsl:template>
10554
+
10208
10555
  <!-- bibitem in bibliography section (references/@normative="false"), renders as list -->
10209
10556
  <xsl:attribute-set name="bibitem-non-normative-list-style">
10210
10557
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
10211
10558
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10212
10559
  </xsl:attribute-set> <!-- bibitem-non-normative-list-style -->
10213
10560
 
10561
+ <xsl:template name="refine_bibitem-non-normative-list-style">
10562
+ </xsl:template>
10563
+
10214
10564
  <xsl:attribute-set name="bibitem-non-normative-list-item-style">
10215
10565
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10216
10566
  </xsl:attribute-set>
10217
10567
 
10568
+ <xsl:template name="refine_bibitem-non-normative-list-item-style">
10569
+ </xsl:template>
10570
+
10218
10571
  <!-- bibitem in bibliography section (references/@normative="false"), list body -->
10219
10572
  <xsl:attribute-set name="bibitem-normative-list-body-style">
10220
10573
  </xsl:attribute-set>
10221
10574
 
10575
+ <xsl:template name="refine_bibitem-normative-list-body-style">
10576
+ </xsl:template>
10577
+
10222
10578
  <xsl:attribute-set name="bibitem-non-normative-list-body-style">
10223
10579
  </xsl:attribute-set> <!-- bibitem-non-normative-list-body-style -->
10224
10580
 
10581
+ <xsl:template name="refine_bibitem-non-normative-list-body-style">
10582
+ </xsl:template>
10583
+
10225
10584
  <!-- footnote reference number for bibitem, in the text -->
10226
10585
  <xsl:attribute-set name="bibitem-note-fn-style">
10227
10586
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
@@ -10229,6 +10588,9 @@
10229
10588
  <xsl:attribute name="vertical-align">super</xsl:attribute>
10230
10589
  </xsl:attribute-set> <!-- bibitem-note-fn-style -->
10231
10590
 
10591
+ <xsl:template name="refine_bibitem-note-fn-style">
10592
+ </xsl:template>
10593
+
10232
10594
  <!-- footnote number on the page bottom -->
10233
10595
  <xsl:attribute-set name="bibitem-note-fn-number-style">
10234
10596
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
@@ -10249,6 +10611,9 @@
10249
10611
  <xsl:attribute name="line-height">145%</xsl:attribute>
10250
10612
  </xsl:attribute-set> <!-- references-non-normative-style -->
10251
10613
 
10614
+ <xsl:template name="refine_references-non-normative-style">
10615
+ </xsl:template>
10616
+
10252
10617
  <!-- ======================= -->
10253
10618
  <!-- Bibliography rendering -->
10254
10619
  <!-- ======================= -->
@@ -10290,6 +10655,7 @@
10290
10655
  <xsl:apply-templates select="mn:fmt-title[@columns = 1]"/>
10291
10656
 
10292
10657
  <fo:block xsl:use-attribute-sets="references-non-normative-style">
10658
+ <xsl:call-template name="refine_references-non-normative-style"/>
10293
10659
  <xsl:apply-templates select="node()[not(self::mn:fmt-title and @columns = 1)]"/>
10294
10660
  </fo:block>
10295
10661
  </xsl:template> <!-- references -->
@@ -10303,31 +10669,39 @@
10303
10669
  <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
10304
10670
  <xsl:call-template name="setNamedDestination"/>
10305
10671
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
10672
+ <xsl:call-template name="refine_bibitem-normative-style"/>
10673
+
10306
10674
  <xsl:call-template name="processBibitem"/>
10307
10675
  </fo:block>
10308
10676
 
10309
10677
  </xsl:template> <!-- bibitem -->
10310
10678
 
10311
10679
  <!-- Bibliography (non-normative references) -->
10312
- <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">
10313
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 -->
10314
10682
  <!-- start CSA bibitem processing -->
10315
10683
  <xsl:call-template name="setNamedDestination"/>
10316
10684
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-style">
10685
+ <xsl:call-template name="refine_bibitem-non-normative-style"/>
10317
10686
  <xsl:apply-templates select="mn:biblio-tag"/>
10318
10687
  <xsl:apply-templates select="mn:formattedref"/>
10319
- <xsl:call-template name="processBibliographyNote"/>
10320
10688
  </fo:block>
10689
+ <xsl:call-template name="processBibitemFollowingNotes"/>
10321
10690
  <!-- END CSA bibitem processing -->
10322
10691
 
10323
10692
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
10324
10693
 
10694
+ <!-- bibitem's notes will be processing in 'processBibitemFollowingNotes' -->
10695
+ <xsl:template match="mn:references/mn:note" priority="2"/> <!-- [not(@normative='true')] -->
10696
+
10325
10697
  <xsl:template name="insertListItem_Bibitem">
10326
10698
  <xsl:choose>
10327
10699
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
10328
10700
  <xsl:otherwise>
10329
10701
  <xsl:call-template name="setNamedDestination"/>
10330
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
+
10331
10705
  <fo:list-item-label end-indent="label-end()">
10332
10706
  <fo:block role="SKIP">
10333
10707
  <fo:inline role="SKIP">
@@ -10338,16 +10712,18 @@
10338
10712
  </fo:block>
10339
10713
  </fo:list-item-label>
10340
10714
  <fo:list-item-body start-indent="body-start()">
10341
- <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"/>
10342
10717
  <xsl:call-template name="processBibitem">
10343
10718
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
10344
10719
  </xsl:call-template>
10345
10720
  </fo:block>
10721
+ <xsl:call-template name="processBibitemFollowingNotes"/>
10346
10722
  </fo:list-item-body>
10347
10723
  </fo:list-item>
10348
10724
  </xsl:otherwise>
10349
10725
  </xsl:choose>
10350
- <xsl:apply-templates select="following-sibling::*[1]"> <!-- [self::mn:bibitem] -->
10726
+ <xsl:apply-templates select="following-sibling::*[self::mn:bibitem][1]">
10351
10727
  <xsl:with-param name="skip">false</xsl:with-param>
10352
10728
  </xsl:apply-templates>
10353
10729
  </xsl:template>
@@ -10363,25 +10739,16 @@
10363
10739
  <xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
10364
10740
  </xsl:apply-templates>
10365
10741
  <xsl:apply-templates select="mn:formattedref"/>
10742
+ <xsl:call-template name="processBibitemFollowingNotes"/>
10366
10743
  <!-- end bibitem processing -->
10367
-
10368
- <xsl:call-template name="processBibliographyNote"/>
10369
10744
  </xsl:template> <!-- processBibitem (bibitem) -->
10370
10745
 
10371
- <xsl:template name="processBibliographyNote">
10372
- <xsl:if test="self::mn:note">
10373
- <xsl:variable name="note_node">
10374
- <xsl:element name="{local-name(..)}" namespace="{$namespace_full}"> <!-- save parent context node for determining styles -->
10375
- <xsl:copy> <!-- skip @id -->
10376
- <xsl:copy-of select="node()"/>
10377
- </xsl:copy>
10378
- </xsl:element>
10379
- </xsl:variable>
10380
- <!-- <xsl:for-each select="xalan:nodeset($note_node)//mn:note">
10381
- <xsl:call-template name="note"/>
10382
- </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]]">
10383
10750
  <xsl:call-template name="note"/>
10384
- </xsl:if>
10751
+ </xsl:for-each>
10385
10752
  </xsl:template>
10386
10753
 
10387
10754
  <xsl:template match="mn:title" mode="title">
@@ -10581,11 +10948,17 @@
10581
10948
  <!-- Index section styles -->
10582
10949
  <xsl:attribute-set name="indexsect-title-style">
10583
10950
  <xsl:attribute name="role">H1</xsl:attribute>
10584
- </xsl:attribute-set>
10951
+ </xsl:attribute-set> <!-- indexsect-title-style -->
10952
+
10953
+ <xsl:template name="refine_indexsect-title-style">
10954
+ </xsl:template>
10585
10955
 
10586
10956
  <xsl:attribute-set name="indexsect-clause-title-style">
10587
10957
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
10588
- </xsl:attribute-set>
10958
+ </xsl:attribute-set> <!-- indexsect-clause-title-style -->
10959
+
10960
+ <xsl:template name="refine_indexsect-clause-title-style">
10961
+ </xsl:template>
10589
10962
  <!-- End Index section styles -->
10590
10963
 
10591
10964
  <!-- =================== -->
@@ -10779,6 +11152,7 @@
10779
11152
 
10780
11153
  <xsl:template match="mn:indexsect/mn:fmt-title | mn:indexsect/mn:title" priority="4">
10781
11154
  <fo:block xsl:use-attribute-sets="indexsect-title-style">
11155
+ <xsl:call-template name="refine_indexsect-title-style"/>
10782
11156
  <!-- Index -->
10783
11157
  <xsl:apply-templates/>
10784
11158
  </fo:block>
@@ -10787,6 +11161,7 @@
10787
11161
  <xsl:template match="mn:indexsect/mn:clause/mn:fmt-title | mn:indexsect/mn:clause/mn:title" priority="4">
10788
11162
  <!-- Letter A, B, C, ... -->
10789
11163
  <fo:block xsl:use-attribute-sets="indexsect-clause-title-style">
11164
+ <xsl:call-template name="refine_indexsect-clause-title-style"/>
10790
11165
  <xsl:apply-templates/>
10791
11166
  </fo:block>
10792
11167
  </xsl:template>
@@ -10829,13 +11204,31 @@
10829
11204
  <!-- skip here, see the template 'fmt-review-start' -->
10830
11205
  </xsl:when>
10831
11206
  <xsl:otherwise>
10832
- <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
10833
- <fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[self::mn:fmt-annotation-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-annotation-end][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
10834
- <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
10835
- <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
11207
+ <xsl:choose>
11208
+ <xsl:when test="parent::mn:example or parent::mn:termexample or parent::mn:note or parent::mn:termnote">
11209
+ <fo:block font-size="1pt" line-height="0.1">
11210
+ <xsl:call-template name="fo_inline_bookmark">
11211
+ <xsl:with-param name="bookmark_id" select="$bookmark_id"/>
11212
+ </xsl:call-template>
11213
+ </fo:block>
11214
+ </xsl:when>
11215
+ <xsl:otherwise>
11216
+ <xsl:call-template name="fo_inline_bookmark">
11217
+ <xsl:with-param name="bookmark_id" select="$bookmark_id"/>
11218
+ </xsl:call-template>
11219
+ </xsl:otherwise>
11220
+ </xsl:choose>
10836
11221
  </xsl:otherwise>
10837
11222
  </xsl:choose>
10838
11223
  </xsl:template>
11224
+
11225
+ <xsl:template name="fo_inline_bookmark">
11226
+ <xsl:param name="bookmark_id"/>
11227
+ <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
11228
+ <fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[self::mn:fmt-annotation-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-annotation-end][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
11229
+ <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
11230
+ <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
11231
+ </xsl:template>
10839
11232
  <!-- =================== -->
10840
11233
  <!-- End of Index processing -->
10841
11234
  <!-- =================== -->
@@ -10980,9 +11373,15 @@
10980
11373
  <xsl:attribute name="leader-pattern">dots</xsl:attribute>
10981
11374
  </xsl:attribute-set> <!-- END: toc-leader-style -->
10982
11375
 
11376
+ <xsl:template name="refine_toc-leader-style">
11377
+ </xsl:template>
11378
+
10983
11379
  <xsl:attribute-set name="toc-pagenumber-style">
10984
11380
  </xsl:attribute-set>
10985
11381
 
11382
+ <xsl:template name="refine_toc-pagenumber-style">
11383
+ </xsl:template>
11384
+
10986
11385
  <!-- List of Figures, Tables -->
10987
11386
  <xsl:attribute-set name="toc-listof-title-style">
10988
11387
  <xsl:attribute name="provisional-distance-between-starts">3mm</xsl:attribute>
@@ -10995,6 +11394,9 @@
10995
11394
  <xsl:attribute name="provisional-distance-between-starts">10mm</xsl:attribute>
10996
11395
  </xsl:attribute-set>
10997
11396
 
11397
+ <xsl:template name="refine_toc-listof-item-block-style">
11398
+ </xsl:template>
11399
+
10998
11400
  <xsl:attribute-set name="toc-listof-item-style">
10999
11401
  <xsl:attribute name="role">TOCI</xsl:attribute>
11000
11402
  <xsl:attribute name="text-align-last">justify</xsl:attribute>
@@ -11002,6 +11404,9 @@
11002
11404
  <xsl:attribute name="text-indent">-12mm</xsl:attribute>
11003
11405
  </xsl:attribute-set>
11004
11406
 
11407
+ <xsl:template name="refine_toc-listof-item-style">
11408
+ </xsl:template>
11409
+
11005
11410
  <xsl:template name="processPrefaceSectionsDefault_Contents">
11006
11411
  <xsl:variable name="nodes_preface_">
11007
11412
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
@@ -12109,23 +12514,55 @@
12109
12514
  <!-- Ruby text (CJK languages) rendering -->
12110
12515
  <!-- ===================================== -->
12111
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
+
12112
12563
  <xsl:template match="mn:ruby">
12113
- <fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
12114
- <xsl:if test="not(ancestor::mn:ruby)">
12115
- <xsl:attribute name="alignment-baseline">central</xsl:attribute>
12116
- </xsl:if>
12117
- <xsl:variable name="rt_text" select="mn:rt"/>
12118
- <xsl:variable name="rb_text" select=".//mn:rb[not(mn:ruby)]"/>
12119
- <!-- Example: width="2em" -->
12120
- <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
12121
- <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
12122
- <xsl:variable name="text_width">
12123
- <xsl:choose>
12124
- <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
12125
- <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
12126
- </xsl:choose>
12127
- </xsl:variable>
12128
- <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"/>
12129
12566
 
12130
12567
  <xsl:choose>
12131
12568
  <xsl:when test="ancestor::mn:ruby">
@@ -12143,17 +12580,14 @@
12143
12580
  </xsl:template>
12144
12581
 
12145
12582
  <xsl:template match="mn:rb">
12146
- <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>
12147
12584
  </xsl:template>
12148
12585
 
12149
12586
  <xsl:template match="mn:rt">
12150
- <fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
12151
- <xsl:if test="ancestor::mn:ruby[last()]//mn:ruby or ancestor::mn:rb">
12152
- <xsl:attribute name="space-before">0em</xsl:attribute>
12153
- </xsl:if>
12587
+ <fo:block xsl:use-attribute-sets="rt-style"> <!-- -->
12588
+ <xsl:call-template name="refine_rt-style"/>
12154
12589
  <xsl:apply-templates/>
12155
12590
  </fo:block>
12156
-
12157
12591
  </xsl:template>
12158
12592
 
12159
12593
  <!-- ===================================== -->
@@ -12162,6 +12596,18 @@
12162
12596
  <!-- ===================================== -->
12163
12597
  <!-- ===================================== -->
12164
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
+
12165
12611
  <xsl:template name="processPrefaceSectionsDefault">
12166
12612
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
12167
12613
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -12721,11 +13167,35 @@
12721
13167
 
12722
13168
  <xsl:template match="mn:svgmap"/>
12723
13169
 
13170
+ <xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]"/>
13171
+
12724
13172
  <!-- for correct rendering combining chars, added in mode="update_xml_step2" -->
12725
13173
  <xsl:template match="*[local-name() = 'lang_none']">
12726
13174
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
12727
13175
  </xsl:template>
12728
13176
 
13177
+ <xsl:template name="addTagElementT">
13178
+ <xsl:variable name="title_">
13179
+ <xsl:apply-templates select="mn:fmt-title"/>
13180
+ </xsl:variable>
13181
+ <xsl:variable name="title__">
13182
+ <xsl:for-each select="xalan:nodeset($title_)/*/node()">
13183
+ <xsl:choose>
13184
+ <xsl:when test="self::text()"><xsl:text> </xsl:text><xsl:value-of select="."/><xsl:text> </xsl:text></xsl:when>
13185
+ <xsl:otherwise><xsl:text> </xsl:text><xsl:copy-of select="."/><xsl:text> </xsl:text></xsl:otherwise>
13186
+ </xsl:choose>
13187
+ </xsl:for-each>
13188
+ </xsl:variable>
13189
+ <xsl:variable name="title" select="normalize-space($title__)"/>
13190
+ <xsl:if test="$title != ''">
13191
+ <xsl:attribute name="fox:title">
13192
+ <xsl:if test="ancestor::mn:sections">
13193
+ <xsl:text>Section </xsl:text>
13194
+ </xsl:if>
13195
+ <xsl:value-of select="$title"/></xsl:attribute>
13196
+ </xsl:if>
13197
+ </xsl:template>
13198
+
12729
13199
  <xsl:template name="replaceChar">
12730
13200
  <xsl:param name="text"/>
12731
13201
  <xsl:param name="replace"/>
@@ -13492,6 +13962,13 @@
13492
13962
  <xsl:with-param name="default" select="$text_align_default"/>
13493
13963
  </xsl:call-template>
13494
13964
  <xsl:call-template name="setKeepAttributes"/>
13965
+ <xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
13966
+ <xsl:variable name="styles">
13967
+ <xsl:apply-templates select="*[1]"/>
13968
+ </xsl:variable>
13969
+ <!-- move attribute line-height from inline to block -->
13970
+ <xsl:attribute name="line-height"><xsl:value-of select="xalan:nodeset($styles)//*/@line-height"/></xsl:attribute>
13971
+ </xsl:if>
13495
13972
  </xsl:template>
13496
13973
 
13497
13974
  <xsl:template name="setKeepAttributes">
@@ -13517,34 +13994,41 @@
13517
13994
  <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
13518
13995
  <fo:block>
13519
13996
  <xsl:for-each select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = $name][1]/mn:value/mn:image[$num]">
13520
- <xsl:choose>
13521
- <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
13522
- <fo:instream-foreign-object fox:alt-text="Image Front">
13523
- <xsl:attribute name="content-height"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
13524
- <xsl:call-template name="getSVG"/>
13525
- </fo:instream-foreign-object>
13526
- </xsl:when>
13527
- <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
13528
- <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
13529
- </xsl:when>
13530
- <xsl:otherwise> <!-- bitmap image -->
13531
- <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
13532
- <xsl:if test="$coverimage_src != ''">
13533
- <xsl:variable name="coverpage">
13534
- <xsl:call-template name="getImageURL">
13535
- <xsl:with-param name="src" select="$coverimage_src"/>
13536
- </xsl:call-template>
13537
- </xsl:variable>
13538
- <!-- <xsl:variable name="coverpage" select="concat('url(file:',$basepath, 'coverpage1.png', ')')"/> --> <!-- for DEBUG -->
13539
- <fo:external-graphic src="{$coverpage}" width="{$pageWidth}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
13540
- </xsl:if>
13541
- </xsl:otherwise>
13542
- </xsl:choose>
13997
+
13998
+ <xsl:call-template name="insertPageImage"/>
13999
+
13543
14000
  </xsl:for-each>
13544
14001
  </fo:block>
13545
14002
  </fo:block-container>
13546
14003
  </xsl:template>
13547
14004
 
14005
+ <xsl:template name="insertPageImage">
14006
+ <xsl:param name="svg_content_height" select="$pageHeight"/>
14007
+ <xsl:param name="bitmap_width" select="$pageWidth"/>
14008
+ <xsl:choose>
14009
+ <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
14010
+ <fo:instream-foreign-object fox:alt-text="Image Front">
14011
+ <xsl:attribute name="content-height"><xsl:value-of select="$svg_content_height"/>mm</xsl:attribute>
14012
+ <xsl:call-template name="getSVG"/>
14013
+ </fo:instream-foreign-object>
14014
+ </xsl:when>
14015
+ <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
14016
+ <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
14017
+ </xsl:when>
14018
+ <xsl:otherwise> <!-- bitmap image -->
14019
+ <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
14020
+ <xsl:if test="$coverimage_src != ''">
14021
+ <xsl:variable name="coverpage">
14022
+ <xsl:call-template name="getImageURL">
14023
+ <xsl:with-param name="src" select="$coverimage_src"/>
14024
+ </xsl:call-template>
14025
+ </xsl:variable>
14026
+ <fo:external-graphic src="{$coverpage}" width="{$bitmap_width}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
14027
+ </xsl:if>
14028
+ </xsl:otherwise>
14029
+ </xsl:choose>
14030
+ </xsl:template>
14031
+
13548
14032
  <xsl:template name="getImageURL">
13549
14033
  <xsl:param name="src"/>
13550
14034
  <xsl:choose>
@@ -13972,6 +14456,14 @@
13972
14456
  </xsl:attribute>
13973
14457
  </xsl:template>
13974
14458
 
14459
+ <xsl:template name="getCharByCodePoint">
14460
+ <xsl:param name="codepoint"/>
14461
+ <xsl:param name="radix">16</xsl:param>
14462
+ <xsl:variable name="codepointInt" select="java:java.lang.Integer.parseInt($codepoint,$radix)"/>
14463
+ <xsl:variable name="chars" select="java:java.lang.Character.toChars($codepointInt)"/>
14464
+ <xsl:value-of select="java:java.lang.String.new($chars)"/>
14465
+ </xsl:template>
14466
+
13975
14467
  <xsl:template name="substring-after-last">
13976
14468
  <xsl:param name="value"/>
13977
14469
  <xsl:param name="delimiter"/>