metanorma-iec 2.2.9 → 2.2.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -2489,6 +2489,14 @@
2489
2489
 
2490
2490
  </xsl:attribute-set>
2491
2491
 
2492
+ <xsl:template name="refine_link-style">
2493
+
2494
+ <xsl:if test="ancestor::*[local-name()='feedback-statement' or local-name() = 'copyright-statement']">
2495
+ <xsl:attribute name="color">blue</xsl:attribute>
2496
+ </xsl:if>
2497
+
2498
+ </xsl:template> <!-- refine_link-style -->
2499
+
2492
2500
  <xsl:attribute-set name="sourcecode-container-style">
2493
2501
 
2494
2502
  </xsl:attribute-set>
@@ -2504,6 +2512,10 @@
2504
2512
 
2505
2513
  </xsl:attribute-set>
2506
2514
 
2515
+ <xsl:template name="refine_sourcecode-style">
2516
+
2517
+ </xsl:template> <!-- refine_sourcecode-style -->
2518
+
2507
2519
  <xsl:attribute-set name="pre-style">
2508
2520
  <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
2509
2521
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -2588,6 +2600,10 @@
2588
2600
 
2589
2601
  </xsl:attribute-set> <!-- example-style -->
2590
2602
 
2603
+ <xsl:template name="refine_example-style">
2604
+
2605
+ </xsl:template> <!-- refine_example-style -->
2606
+
2591
2607
  <xsl:attribute-set name="example-body-style">
2592
2608
 
2593
2609
  <xsl:attribute name="margin-left">10mm</xsl:attribute>
@@ -2607,6 +2623,10 @@
2607
2623
 
2608
2624
  </xsl:attribute-set> <!-- example-p-style -->
2609
2625
 
2626
+ <xsl:template name="refine_example-p-style">
2627
+
2628
+ </xsl:template> <!-- refine_example-p-style -->
2629
+
2610
2630
  <xsl:attribute-set name="termexample-name-style">
2611
2631
 
2612
2632
  <xsl:attribute name="padding-right">10mm</xsl:attribute>
@@ -2635,6 +2655,19 @@
2635
2655
 
2636
2656
  </xsl:attribute-set> <!-- table-container-style -->
2637
2657
 
2658
+ <xsl:template name="refine_table-container-style">
2659
+ <xsl:param name="margin-side"/>
2660
+
2661
+ <xsl:attribute name="margin-left"><xsl:value-of select="-$margin-side"/>mm</xsl:attribute>
2662
+ <xsl:attribute name="margin-right"><xsl:value-of select="-$margin-side"/>mm</xsl:attribute>
2663
+
2664
+ <xsl:if test="ancestor::*[local-name() = 'preface']">
2665
+ <xsl:attribute name="space-after">16pt</xsl:attribute>
2666
+ </xsl:if>
2667
+
2668
+ <!-- end table block-container attributes -->
2669
+ </xsl:template> <!-- refine_table-container-style -->
2670
+
2638
2671
  <xsl:attribute-set name="table-style">
2639
2672
  <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
2640
2673
  <xsl:attribute name="table-layout">fixed</xsl:attribute>
@@ -2643,6 +2676,18 @@
2643
2676
 
2644
2677
  </xsl:attribute-set><!-- table-style -->
2645
2678
 
2679
+ <xsl:template name="refine_table-style">
2680
+ <xsl:param name="margin-side"/>
2681
+
2682
+ <xsl:if test="$margin-side != 0">
2683
+ <xsl:attribute name="margin-left"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
2684
+ <xsl:attribute name="margin-right"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
2685
+ </xsl:if>
2686
+
2687
+ <xsl:call-template name="setBordersTableArray"/>
2688
+
2689
+ </xsl:template> <!-- refine_table-style -->
2690
+
2646
2691
  <xsl:attribute-set name="table-name-style">
2647
2692
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2648
2693
 
@@ -2654,6 +2699,16 @@
2654
2699
 
2655
2700
  </xsl:attribute-set> <!-- table-name-style -->
2656
2701
 
2702
+ <xsl:template name="refine_table-name-style">
2703
+ <xsl:param name="continued"/>
2704
+
2705
+ <xsl:if test="$continued = 'true'">
2706
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2707
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2708
+ </xsl:if>
2709
+
2710
+ </xsl:template> <!-- refine_table-name-style -->
2711
+
2657
2712
  <xsl:attribute-set name="table-row-style">
2658
2713
  <xsl:attribute name="min-height">4mm</xsl:attribute>
2659
2714
 
@@ -2667,6 +2722,12 @@
2667
2722
 
2668
2723
  </xsl:attribute-set>
2669
2724
 
2725
+ <xsl:template name="refine_table-header-row-style">
2726
+
2727
+ <xsl:call-template name="setBordersTableArray"/>
2728
+
2729
+ </xsl:template> <!-- refine_table-header-row-style -->
2730
+
2670
2731
  <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
2671
2732
 
2672
2733
  <xsl:attribute name="border-left">solid black 0.5pt</xsl:attribute>
@@ -2674,10 +2735,20 @@
2674
2735
 
2675
2736
  </xsl:attribute-set>
2676
2737
 
2738
+ <xsl:template name="refine_table-footer-row-style">
2739
+
2740
+ </xsl:template> <!-- refine_table-footer-row-style -->
2741
+
2677
2742
  <xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
2678
2743
 
2679
2744
  </xsl:attribute-set>
2680
2745
 
2746
+ <xsl:template name="refine_table-body-row-style">
2747
+
2748
+ <xsl:call-template name="setBordersTableArray"/>
2749
+
2750
+ </xsl:template> <!-- refine_table-body-row-style -->
2751
+
2681
2752
  <xsl:attribute-set name="table-header-cell-style">
2682
2753
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2683
2754
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -2690,6 +2761,23 @@
2690
2761
 
2691
2762
  </xsl:attribute-set> <!-- table-header-cell-style -->
2692
2763
 
2764
+ <xsl:template name="refine_table-header-cell-style">
2765
+
2766
+ <xsl:attribute name="text-align">center</xsl:attribute>
2767
+ <xsl:if test="ancestor::*[local-name()='preface']">
2768
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
2769
+ </xsl:if>
2770
+
2771
+ <xsl:call-template name="setBordersTableArray"/>
2772
+
2773
+ <xsl:if test="$lang = 'ar'">
2774
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
2775
+ </xsl:if>
2776
+
2777
+ <xsl:call-template name="setTableCellAttributes"/>
2778
+
2779
+ </xsl:template> <!-- refine_table-header-cell-style -->
2780
+
2693
2781
  <xsl:attribute-set name="table-cell-style">
2694
2782
  <xsl:attribute name="display-align">center</xsl:attribute>
2695
2783
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -2700,6 +2788,22 @@
2700
2788
 
2701
2789
  </xsl:attribute-set> <!-- table-cell-style -->
2702
2790
 
2791
+ <xsl:template name="refine_table-cell-style">
2792
+
2793
+ <xsl:if test="$lang = 'ar'">
2794
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
2795
+ </xsl:if>
2796
+
2797
+ <!-- bsi -->
2798
+
2799
+ <xsl:if test="ancestor::*[local-name()='preface']">
2800
+ <xsl:attribute name="text-align">center</xsl:attribute>
2801
+ </xsl:if>
2802
+
2803
+ <xsl:call-template name="setBordersTableArray"/>
2804
+
2805
+ </xsl:template> <!-- refine_table-cell-style -->
2806
+
2703
2807
  <xsl:attribute-set name="table-footer-cell-style">
2704
2808
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
2705
2809
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -2710,6 +2814,10 @@
2710
2814
 
2711
2815
  </xsl:attribute-set> <!-- table-footer-cell-style -->
2712
2816
 
2817
+ <xsl:template name="refine_table-footer-cell-style">
2818
+
2819
+ </xsl:template> <!-- refine_table-footer-cell-style -->
2820
+
2713
2821
  <xsl:attribute-set name="table-note-style">
2714
2822
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2715
2823
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -2719,6 +2827,10 @@
2719
2827
 
2720
2828
  </xsl:attribute-set><!-- table-note-style -->
2721
2829
 
2830
+ <xsl:template name="refine_table-note-style">
2831
+
2832
+ </xsl:template> <!-- refine_table-note-style -->
2833
+
2722
2834
  <xsl:attribute-set name="table-fn-style">
2723
2835
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2724
2836
 
@@ -2785,11 +2897,19 @@
2785
2897
 
2786
2898
  </xsl:attribute-set>
2787
2899
 
2900
+ <xsl:template name="refine_dt-cell-style">
2901
+
2902
+ </xsl:template> <!-- refine_dt-cell-style -->
2903
+
2788
2904
  <xsl:attribute-set name="dt-block-style">
2789
2905
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
2790
2906
 
2791
2907
  </xsl:attribute-set>
2792
2908
 
2909
+ <xsl:template name="refine_dt-block-style">
2910
+
2911
+ </xsl:template> <!-- refine_dt-block-style -->
2912
+
2793
2913
  <xsl:attribute-set name="dl-name-style">
2794
2914
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2795
2915
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -2803,6 +2923,10 @@
2803
2923
 
2804
2924
  </xsl:attribute-set>
2805
2925
 
2926
+ <xsl:template name="refine_dd-cell-style">
2927
+
2928
+ </xsl:template> <!-- refine_dd-cell-style -->
2929
+
2806
2930
  <!-- ========================== -->
2807
2931
  <!-- END Definition's list styles -->
2808
2932
  <!-- ========================== -->
@@ -2823,7 +2947,6 @@
2823
2947
  </xsl:attribute-set>
2824
2948
 
2825
2949
  <xsl:attribute-set name="xref-style">
2826
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
2827
2950
 
2828
2951
  </xsl:attribute-set>
2829
2952
 
@@ -2831,6 +2954,12 @@
2831
2954
 
2832
2955
  </xsl:attribute-set>
2833
2956
 
2957
+ <xsl:template name="refine_eref-style">
2958
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
2959
+ <xsl:variable name="text" select="normalize-space()"/>
2960
+
2961
+ </xsl:template> <!-- refine_eref-style -->
2962
+
2834
2963
  <xsl:attribute-set name="note-style">
2835
2964
 
2836
2965
  <xsl:attribute name="font-size">8pt</xsl:attribute>
@@ -2839,6 +2968,10 @@
2839
2968
 
2840
2969
  </xsl:attribute-set>
2841
2970
 
2971
+ <xsl:template name="refine_note-style">
2972
+
2973
+ </xsl:template>
2974
+
2842
2975
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
2843
2976
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
2844
2977
 
@@ -2848,11 +2981,19 @@
2848
2981
 
2849
2982
  </xsl:attribute-set>
2850
2983
 
2984
+ <xsl:template name="refine_note-name-style">
2985
+
2986
+ </xsl:template> <!-- refine_note-name-style -->
2987
+
2851
2988
  <xsl:attribute-set name="table-note-name-style">
2852
2989
  <xsl:attribute name="padding-right">2mm</xsl:attribute>
2853
2990
 
2854
2991
  </xsl:attribute-set>
2855
2992
 
2993
+ <xsl:template name="refine_table-note-name-style">
2994
+
2995
+ </xsl:template> <!-- refine_table-note-name-style -->
2996
+
2856
2997
  <xsl:attribute-set name="note-p-style">
2857
2998
 
2858
2999
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
@@ -2867,10 +3008,18 @@
2867
3008
 
2868
3009
  </xsl:attribute-set>
2869
3010
 
3011
+ <xsl:template name="refine_termnote-style">
3012
+
3013
+ </xsl:template> <!-- refine_termnote-style -->
3014
+
2870
3015
  <xsl:attribute-set name="termnote-name-style">
2871
3016
 
2872
3017
  </xsl:attribute-set>
2873
3018
 
3019
+ <xsl:template name="refine_termnote-name-style">
3020
+
3021
+ </xsl:template>
3022
+
2874
3023
  <xsl:attribute-set name="termnote-p-style">
2875
3024
 
2876
3025
  </xsl:attribute-set>
@@ -2884,6 +3033,10 @@
2884
3033
 
2885
3034
  </xsl:attribute-set>
2886
3035
 
3036
+ <xsl:template name="refine_quote-style">
3037
+
3038
+ </xsl:template>
3039
+
2887
3040
  <xsl:attribute-set name="quote-source-style">
2888
3041
  <xsl:attribute name="text-align">right</xsl:attribute>
2889
3042
 
@@ -2900,6 +3053,10 @@
2900
3053
 
2901
3054
  </xsl:attribute-set>
2902
3055
 
3056
+ <xsl:template name="refine_termsource-style">
3057
+
3058
+ </xsl:template> <!-- refine_termsource-style -->
3059
+
2903
3060
  <xsl:attribute-set name="termsource-text-style">
2904
3061
 
2905
3062
  </xsl:attribute-set>
@@ -2938,6 +3095,10 @@
2938
3095
 
2939
3096
  </xsl:attribute-set>
2940
3097
 
3098
+ <xsl:template name="refine_figure-name-style">
3099
+
3100
+ </xsl:template> <!-- refine_figure-name-style -->
3101
+
2941
3102
  <xsl:attribute-set name="figure-source-style">
2942
3103
 
2943
3104
  <xsl:attribute name="font-size">6pt</xsl:attribute>
@@ -2958,6 +3119,10 @@
2958
3119
 
2959
3120
  </xsl:attribute-set> <!-- formula-stem-block-style -->
2960
3121
 
3122
+ <xsl:template name="refine_formula-stem-block-style">
3123
+
3124
+ </xsl:template> <!-- refine_formula-stem-block-style -->
3125
+
2961
3126
  <xsl:attribute-set name="formula-stem-number-style">
2962
3127
  <xsl:attribute name="text-align">right</xsl:attribute>
2963
3128
 
@@ -2971,6 +3136,10 @@
2971
3136
 
2972
3137
  </xsl:attribute-set>
2973
3138
 
3139
+ <xsl:template name="refine_image-style">
3140
+
3141
+ </xsl:template>
3142
+
2974
3143
  <xsl:attribute-set name="figure-pseudocode-p-style">
2975
3144
 
2976
3145
  </xsl:attribute-set>
@@ -3069,6 +3238,10 @@
3069
3238
 
3070
3239
  </xsl:attribute-set>
3071
3240
 
3241
+ <xsl:template name="refine_mathml-style">
3242
+
3243
+ </xsl:template>
3244
+
3072
3245
  <xsl:attribute-set name="list-style">
3073
3246
 
3074
3247
  <xsl:attribute name="provisional-distance-between-starts">6mm</xsl:attribute>
@@ -3076,6 +3249,14 @@
3076
3249
 
3077
3250
  </xsl:attribute-set> <!-- list-style -->
3078
3251
 
3252
+ <xsl:template name="refine_list-style">
3253
+
3254
+ <xsl:if test="ancestor::iec:ul or ancestor::iec:ol">
3255
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
3256
+ </xsl:if>
3257
+
3258
+ </xsl:template> <!-- refine_list-style -->
3259
+
3079
3260
  <xsl:attribute-set name="list-name-style">
3080
3261
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3081
3262
 
@@ -3087,14 +3268,26 @@
3087
3268
 
3088
3269
  </xsl:attribute-set>
3089
3270
 
3271
+ <xsl:template name="refine_list-item-style">
3272
+
3273
+ </xsl:template> <!-- refine_list-item-style -->
3274
+
3090
3275
  <xsl:attribute-set name="list-item-label-style">
3091
3276
 
3092
3277
  </xsl:attribute-set>
3093
3278
 
3279
+ <xsl:template name="refine_list-item-label-style">
3280
+
3281
+ </xsl:template> <!-- refine_list-item-label-style -->
3282
+
3094
3283
  <xsl:attribute-set name="list-item-body-style">
3095
3284
 
3096
3285
  </xsl:attribute-set>
3097
3286
 
3287
+ <xsl:template name="refine_list-item-body-style">
3288
+
3289
+ </xsl:template> <!-- refine_list-item-body-style -->
3290
+
3098
3291
  <xsl:attribute-set name="toc-style">
3099
3292
  <xsl:attribute name="line-height">135%</xsl:attribute>
3100
3293
  </xsl:attribute-set>
@@ -3105,6 +3298,15 @@
3105
3298
 
3106
3299
  </xsl:attribute-set>
3107
3300
 
3301
+ <xsl:template name="refine_fn-reference-style">
3302
+
3303
+ <xsl:if test="ancestor::*[local-name()='table']">
3304
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
3305
+ <xsl:attribute name="baseline-shift">15%</xsl:attribute>
3306
+ </xsl:if>
3307
+
3308
+ </xsl:template> <!-- refine_fn-reference-style -->
3309
+
3108
3310
  <xsl:attribute-set name="fn-style">
3109
3311
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3110
3312
  </xsl:attribute-set>
@@ -3128,6 +3330,10 @@
3128
3330
 
3129
3331
  </xsl:attribute-set>
3130
3332
 
3333
+ <xsl:template name="refine_fn-body-style">
3334
+
3335
+ </xsl:template> <!-- refine_fn-body-style -->
3336
+
3131
3337
  <xsl:attribute-set name="fn-body-num-style">
3132
3338
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
3133
3339
 
@@ -3136,6 +3342,10 @@
3136
3342
 
3137
3343
  </xsl:attribute-set> <!-- fn-body-num-style -->
3138
3344
 
3345
+ <xsl:template name="refine_fn-body-num-style">
3346
+
3347
+ </xsl:template> <!-- refine_fn-body-num-style -->
3348
+
3139
3349
  <!-- admonition -->
3140
3350
  <xsl:attribute-set name="admonition-style">
3141
3351
 
@@ -3799,14 +4009,9 @@
3799
4009
 
3800
4010
  <fo:block-container xsl:use-attribute-sets="table-container-style">
3801
4011
 
3802
- <xsl:attribute name="margin-left"><xsl:value-of select="-$margin-side"/>mm</xsl:attribute>
3803
- <xsl:attribute name="margin-right"><xsl:value-of select="-$margin-side"/>mm</xsl:attribute>
3804
-
3805
- <xsl:if test="ancestor::*[local-name() = 'preface']">
3806
- <xsl:attribute name="space-after">16pt</xsl:attribute>
3807
- </xsl:if>
3808
-
3809
- <!-- end table block-container attributes -->
4012
+ <xsl:call-template name="refine_table-container-style">
4013
+ <xsl:with-param name="margin-side" select="$margin-side"/>
4014
+ </xsl:call-template>
3810
4015
 
3811
4016
  <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
3812
4017
 
@@ -3827,12 +4032,9 @@
3827
4032
 
3828
4033
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
3829
4034
 
3830
- <xsl:if test="$margin-side != 0">
3831
- <xsl:attribute name="margin-left"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
3832
- <xsl:attribute name="margin-right"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
3833
- </xsl:if>
3834
-
3835
- <xsl:call-template name="setBordersTableArray"/>
4035
+ <xsl:call-template name="refine_table-style">
4036
+ <xsl:with-param name="margin-side" select="$margin-side"/>
4037
+ </xsl:call-template>
3836
4038
 
3837
4039
  </xsl:element>
3838
4040
  </xsl:variable>
@@ -3854,7 +4056,7 @@
3854
4056
  </xsl:attribute>
3855
4057
  </xsl:for-each>
3856
4058
 
3857
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
4059
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
3858
4060
  <xsl:if test="$isNoteOrFnExist = 'true'">
3859
4061
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
3860
4062
  </xsl:if>
@@ -3898,7 +4100,7 @@
3898
4100
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3899
4101
  </xsl:when>
3900
4102
  <xsl:otherwise>
3901
- <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
4103
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'example') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'p') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
3902
4104
  </xsl:otherwise>
3903
4105
  </xsl:choose>
3904
4106
 
@@ -3993,10 +4195,9 @@
3993
4195
 
3994
4196
  <fo:block xsl:use-attribute-sets="table-name-style">
3995
4197
 
3996
- <xsl:if test="$continued = 'true'">
3997
- <xsl:attribute name="font-size">10pt</xsl:attribute>
3998
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3999
- </xsl:if>
4198
+ <xsl:call-template name="refine_table-name-style">
4199
+ <xsl:with-param name="continued" select="$continued"/>
4200
+ </xsl:call-template>
4000
4201
 
4001
4202
  <xsl:choose>
4002
4203
  <xsl:when test="$continued = 'true'">
@@ -4394,10 +4595,7 @@
4394
4595
  <fo:table-row>
4395
4596
  <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
4396
4597
 
4397
- <xsl:attribute name="border-left">1pt solid white</xsl:attribute>
4398
- <xsl:attribute name="border-right">1pt solid white</xsl:attribute>
4399
- <xsl:attribute name="border-top">1pt solid white</xsl:attribute>
4400
- <xsl:attribute name="border-bottom">none</xsl:attribute>
4598
+ <xsl:call-template name="refine_table-header-title-style"/>
4401
4599
 
4402
4600
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
4403
4601
  <xsl:with-param name="continued">true</xsl:with-param>
@@ -4411,6 +4609,15 @@
4411
4609
  </fo:table-row>
4412
4610
  </xsl:template> <!-- table-header-title -->
4413
4611
 
4612
+ <xsl:template name="refine_table-header-title-style">
4613
+
4614
+ <xsl:attribute name="border-left">1pt solid white</xsl:attribute>
4615
+ <xsl:attribute name="border-right">1pt solid white</xsl:attribute>
4616
+ <xsl:attribute name="border-top">1pt solid white</xsl:attribute>
4617
+ <xsl:attribute name="border-bottom">none</xsl:attribute>
4618
+
4619
+ </xsl:template> <!-- refine_table-header-title-style -->
4620
+
4414
4621
  <xsl:template match="*[local-name()='thead']" mode="process_tbody">
4415
4622
  <fo:table-body>
4416
4623
  <xsl:apply-templates/>
@@ -4435,7 +4642,7 @@
4435
4642
  <xsl:param name="colwidths"/>
4436
4643
  <xsl:param name="colgroup"/>
4437
4644
 
4438
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source']"/>
4645
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='example'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
4439
4646
 
4440
4647
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
4441
4648
 
@@ -4495,6 +4702,8 @@
4495
4702
  <fo:table-row>
4496
4703
  <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
4497
4704
 
4705
+ <xsl:call-template name="refine_table-footer-cell-style"/>
4706
+
4498
4707
  <xsl:call-template name="setBordersTableArray"/>
4499
4708
 
4500
4709
  <!-- fn will be processed inside 'note' processing -->
@@ -4507,8 +4716,10 @@
4507
4716
 
4508
4717
  <!-- except gb and bsi -->
4509
4718
 
4719
+ <xsl:apply-templates select="../*[local-name()='p']"/>
4510
4720
  <xsl:apply-templates select="../*[local-name()='dl']"/>
4511
4721
  <xsl:apply-templates select="../*[local-name()='note']"/>
4722
+ <xsl:apply-templates select="../*[local-name()='example']"/>
4512
4723
  <xsl:apply-templates select="../*[local-name()='source']"/>
4513
4724
 
4514
4725
  <xsl:variable name="isDisplayRowSeparator">
@@ -4518,7 +4729,7 @@
4518
4729
 
4519
4730
  <!-- horizontal row separator -->
4520
4731
  <xsl:if test="normalize-space($isDisplayRowSeparator) = 'true'">
4521
- <xsl:if test="../*[local-name()='note'] and normalize-space($table_fn_block) != ''">
4732
+ <xsl:if test="(../*[local-name()='note'] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
4522
4733
  <fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
4523
4734
 
4524
4735
  <xsl:call-template name="setBordersTableArray"/>
@@ -4683,7 +4894,7 @@
4683
4894
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
4684
4895
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
4685
4896
 
4686
- <xsl:call-template name="setBordersTableArray"/>
4897
+ <xsl:call-template name="refine_table-header-row-style"/>
4687
4898
 
4688
4899
  <xsl:call-template name="setTableRowAttributes"/>
4689
4900
 
@@ -4717,6 +4928,8 @@
4717
4928
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
4718
4929
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
4719
4930
 
4931
+ <xsl:call-template name="refine_table-footer-row-style"/>
4932
+
4720
4933
  <xsl:call-template name="setTableRowAttributes"/>
4721
4934
  <xsl:apply-templates/>
4722
4935
  </fo:table-row>
@@ -4730,9 +4943,10 @@
4730
4943
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4731
4944
  </xsl:if>
4732
4945
 
4733
- <xsl:call-template name="setBordersTableArray"/>
4946
+ <xsl:call-template name="refine_table-body-row-style"/>
4734
4947
 
4735
4948
  <xsl:call-template name="setTableRowAttributes"/>
4949
+
4736
4950
  <xsl:apply-templates/>
4737
4951
  </fo:table-row>
4738
4952
  </xsl:template>
@@ -4751,18 +4965,7 @@
4751
4965
  <xsl:with-param name="default">center</xsl:with-param>
4752
4966
  </xsl:call-template>
4753
4967
 
4754
- <xsl:attribute name="text-align">center</xsl:attribute>
4755
- <xsl:if test="ancestor::*[local-name()='preface']">
4756
- <xsl:attribute name="font-weight">normal</xsl:attribute>
4757
- </xsl:if>
4758
-
4759
- <xsl:call-template name="setBordersTableArray"/>
4760
-
4761
- <xsl:if test="$lang = 'ar'">
4762
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
4763
- </xsl:if>
4764
-
4765
- <xsl:call-template name="setTableCellAttributes"/>
4968
+ <xsl:call-template name="refine_table-header-cell-style"/>
4766
4969
 
4767
4970
  <fo:block>
4768
4971
  <xsl:apply-templates/>
@@ -4804,17 +5007,7 @@
4804
5007
  <xsl:with-param name="default">left</xsl:with-param>
4805
5008
  </xsl:call-template>
4806
5009
 
4807
- <xsl:if test="$lang = 'ar'">
4808
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
4809
- </xsl:if>
4810
-
4811
- <!-- bsi -->
4812
-
4813
- <xsl:if test="ancestor::*[local-name()='preface']">
4814
- <xsl:attribute name="text-align">center</xsl:attribute>
4815
- </xsl:if>
4816
-
4817
- <xsl:call-template name="setBordersTableArray"/>
5010
+ <xsl:call-template name="refine_table-cell-style"/>
4818
5011
 
4819
5012
  <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
4820
5013
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -4841,13 +5034,17 @@
4841
5034
  </fo:table-cell>
4842
5035
  </xsl:template> <!-- td -->
4843
5036
 
4844
- <xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2">
5037
+ <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
4845
5038
 
4846
5039
  <fo:block xsl:use-attribute-sets="table-note-style">
4847
5040
 
4848
- <!-- Table's note name (NOTE, for example) -->
5041
+ <xsl:call-template name="refine_table-note-style"/>
5042
+
5043
+ <!-- Table's note/example name (NOTE, for example) -->
4849
5044
  <fo:inline xsl:use-attribute-sets="table-note-name-style">
4850
5045
 
5046
+ <xsl:call-template name="refine_table-note-name-style"/>
5047
+
4851
5048
  <xsl:apply-templates select="*[local-name() = 'name']"/>
4852
5049
 
4853
5050
  </fo:inline>
@@ -4857,7 +5054,7 @@
4857
5054
 
4858
5055
  </xsl:template> <!-- table/note -->
4859
5056
 
4860
- <xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" priority="2">
5057
+ <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name()='example']/*[local-name()='p']" priority="2">
4861
5058
  <xsl:apply-templates/>
4862
5059
  </xsl:template>
4863
5060
 
@@ -4875,6 +5072,14 @@
4875
5072
  <!-- list of footnotes to calculate actual footnotes number -->
4876
5073
  <xsl:variable name="p_fn_">
4877
5074
  <xsl:call-template name="get_fn_list"/>
5075
+ <!-- <xsl:choose>
5076
+ <xsl:when test="$namespace = 'jis'">
5077
+ <xsl:call-template name="get_fn_list_for_element"/>
5078
+ </xsl:when>
5079
+ <xsl:otherwise>
5080
+ <xsl:call-template name="get_fn_list"/>
5081
+ </xsl:otherwise>
5082
+ </xsl:choose> -->
4878
5083
  </xsl:variable>
4879
5084
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
4880
5085
 
@@ -4899,7 +5104,14 @@
4899
5104
 
4900
5105
  </xsl:variable>
4901
5106
 
4902
- <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
5107
+ <xsl:variable name="ref_id">
5108
+ <xsl:choose>
5109
+ <xsl:when test="normalize-space(@ref_id) != ''"><xsl:value-of select="@ref_id"/></xsl:when>
5110
+ <xsl:otherwise>
5111
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
5112
+ </xsl:otherwise>
5113
+ </xsl:choose>
5114
+ </xsl:variable>
4903
5115
  <xsl:variable name="footnote_inline">
4904
5116
  <fo:inline>
4905
5117
 
@@ -4925,7 +5137,7 @@
4925
5137
  <xsl:call-template name="insert_basic_link">
4926
5138
  <xsl:with-param name="element">
4927
5139
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4928
- <xsl:value-of select="$current_fn_number_text"/>
5140
+ <xsl:copy-of select="$current_fn_number_text"/>
4929
5141
  </fo:basic-link>
4930
5142
  </xsl:with-param>
4931
5143
  </xsl:call-template>
@@ -4945,8 +5157,12 @@
4945
5157
 
4946
5158
  <fo:block xsl:use-attribute-sets="fn-body-style">
4947
5159
 
5160
+ <xsl:call-template name="refine_fn-body-style"/>
5161
+
4948
5162
  <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
4949
5163
 
5164
+ <xsl:call-template name="refine_fn-body-num-style"/>
5165
+
4950
5166
  <xsl:value-of select="$current_fn_number_text"/>
4951
5167
  </fo:inline>
4952
5168
  <xsl:apply-templates/>
@@ -4998,6 +5214,28 @@
4998
5214
  </xsl:choose>
4999
5215
  </xsl:template>
5000
5216
 
5217
+ <xsl:template name="get_fn_list_for_element">
5218
+ <xsl:choose>
5219
+ <xsl:when test="@current_fn_number"> <!-- footnote reference number calculated already -->
5220
+ <fn gen_id="{generate-id(.)}">
5221
+ <xsl:copy-of select="@*"/>
5222
+ <xsl:copy-of select="node()"/>
5223
+ </fn>
5224
+ </xsl:when>
5225
+ <xsl:otherwise>
5226
+ <xsl:for-each select="ancestor::*[local-name() = 'ul' or local-name() = 'ol'][1]">
5227
+ <xsl:variable name="element_id" select="@id"/>
5228
+ <xsl:for-each select=".//*[local-name() = 'fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
5229
+ <!-- copy unique fn -->
5230
+ <fn gen_id="{generate-id(.)}">
5231
+ <xsl:copy-of select="@*"/>
5232
+ <xsl:copy-of select="node()"/>
5233
+ </fn>
5234
+ </xsl:for-each>
5235
+ </xsl:for-each>
5236
+ </xsl:otherwise>
5237
+ </xsl:choose>
5238
+ </xsl:template>
5001
5239
  <!-- ============================ -->
5002
5240
  <!-- table's footnotes rendering -->
5003
5241
  <!-- ============================ -->
@@ -5172,10 +5410,7 @@
5172
5410
  <xsl:template match="*[local-name()='fn']">
5173
5411
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
5174
5412
 
5175
- <xsl:if test="ancestor::*[local-name()='table']">
5176
- <xsl:attribute name="font-weight">normal</xsl:attribute>
5177
- <xsl:attribute name="baseline-shift">15%</xsl:attribute>
5178
- </xsl:if>
5413
+ <xsl:call-template name="refine_fn-reference-style"/>
5179
5414
 
5180
5415
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5181
5416
 
@@ -5281,7 +5516,7 @@
5281
5516
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
5282
5517
  <fo:block margin-bottom="12pt" text-align="left">
5283
5518
 
5284
- <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
5519
+ <xsl:call-template name="refine_dl_formula_where_style"/>
5285
5520
 
5286
5521
  <!-- <xsl:variable name="title-where">
5287
5522
  <xsl:call-template name="getLocalizedString">
@@ -5296,8 +5531,7 @@
5296
5531
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
5297
5532
  <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
5298
5533
 
5299
- <xsl:attribute name="font-size">8pt</xsl:attribute>
5300
- <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
5534
+ <xsl:call-template name="refine_figure_key_style"/>
5301
5535
 
5302
5536
  <xsl:variable name="title-key">
5303
5537
  <xsl:call-template name="getLocalizedString">
@@ -5313,12 +5547,16 @@
5313
5547
  <xsl:if test="$onlyOneComponent = 'false'">
5314
5548
  <fo:block>
5315
5549
 
5550
+ <xsl:call-template name="refine_multicomponent_style"/>
5551
+
5316
5552
  <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
5317
5553
  <xsl:attribute name="margin-top">0</xsl:attribute>
5318
5554
  </xsl:if>
5319
5555
 
5320
5556
  <fo:block>
5321
5557
 
5558
+ <xsl:call-template name="refine_multicomponent_block_style"/>
5559
+
5322
5560
  <xsl:apply-templates select="*[local-name() = 'name']">
5323
5561
  <xsl:with-param name="process">true</xsl:with-param>
5324
5562
  </xsl:apply-templates>
@@ -5478,6 +5716,29 @@
5478
5716
 
5479
5717
  </xsl:template> <!-- END: dl -->
5480
5718
 
5719
+ <xsl:template name="refine_dl_formula_where_style">
5720
+
5721
+ <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
5722
+
5723
+ </xsl:template> <!-- refine_dl_formula_where_style -->
5724
+
5725
+ <xsl:template name="refine_figure_key_style">
5726
+
5727
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
5728
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
5729
+
5730
+ </xsl:template> <!-- refine_figure_key_style -->
5731
+
5732
+ <xsl:template name="refine_multicomponent_style">
5733
+ <xsl:variable name="parent" select="local-name(..)"/>
5734
+
5735
+ </xsl:template> <!-- refine_multicomponent_style -->
5736
+
5737
+ <xsl:template name="refine_multicomponent_block_style">
5738
+ <xsl:variable name="parent" select="local-name(..)"/>
5739
+
5740
+ </xsl:template> <!-- refine_multicomponent_block_style -->
5741
+
5481
5742
  <!-- ignore 'p' with 'where' in formula, before 'dl' -->
5482
5743
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/>
5483
5744
 
@@ -5697,6 +5958,8 @@
5697
5958
 
5698
5959
  </xsl:if>
5699
5960
 
5961
+ <xsl:call-template name="refine_dt-cell-style"/>
5962
+
5700
5963
  <fo:block xsl:use-attribute-sets="dt-block-style">
5701
5964
  <xsl:copy-of select="@id"/>
5702
5965
 
@@ -5704,6 +5967,8 @@
5704
5967
  <xsl:attribute name="margin-top">0</xsl:attribute>
5705
5968
  </xsl:if>
5706
5969
 
5970
+ <xsl:call-template name="refine_dt-block-style"/>
5971
+
5707
5972
  <xsl:apply-templates>
5708
5973
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
5709
5974
  </xsl:apply-templates>
@@ -5723,6 +5988,8 @@
5723
5988
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
5724
5989
  </xsl:if>
5725
5990
 
5991
+ <xsl:call-template name="refine_dd-cell-style"/>
5992
+
5726
5993
  <fo:block>
5727
5994
 
5728
5995
  <xsl:if test="$isGenerateTableIF = 'true'">
@@ -5865,20 +6132,31 @@
5865
6132
  <!-- ========================= -->
5866
6133
  <xsl:template match="*[local-name()='em']">
5867
6134
  <fo:inline font-style="italic">
6135
+ <xsl:call-template name="refine_italic_style"/>
5868
6136
  <xsl:apply-templates/>
5869
6137
  </fo:inline>
5870
6138
  </xsl:template>
5871
6139
 
6140
+ <xsl:template name="refine_italic_style">
6141
+
6142
+ </xsl:template>
6143
+
5872
6144
  <xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
5873
6145
  <xsl:param name="split_keep-within-line"/>
5874
6146
  <fo:inline font-weight="bold">
5875
6147
 
6148
+ <xsl:call-template name="refine_strong_style"/>
6149
+
5876
6150
  <xsl:apply-templates>
5877
6151
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
5878
6152
  </xsl:apply-templates>
5879
6153
  </fo:inline>
5880
6154
  </xsl:template>
5881
6155
 
6156
+ <xsl:template name="refine_strong_style">
6157
+
6158
+ </xsl:template>
6159
+
5882
6160
  <xsl:template match="*[local-name()='padding']">
5883
6161
  <fo:inline padding-right="{@value}"> </fo:inline>
5884
6162
  </xsl:template>
@@ -6418,7 +6696,10 @@
6418
6696
  </xsl:choose>
6419
6697
  </xsl:variable>
6420
6698
 
6421
- <xsl:value-of select="$text9"/>
6699
+ <!-- replace sequence #x200B and space TO space -->
6700
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
6701
+
6702
+ <xsl:value-of select="$text10"/>
6422
6703
  </xsl:template>
6423
6704
 
6424
6705
  <xsl:template name="add-zero-spaces-link-java">
@@ -7093,6 +7374,11 @@
7093
7374
 
7094
7375
  <fo:inline xsl:use-attribute-sets="mathml-style">
7095
7376
 
7377
+ <!-- DEBUG -->
7378
+ <!-- <xsl:copy-of select="ancestor::*[local-name() = 'stem']/@font-family"/> -->
7379
+
7380
+ <xsl:call-template name="refine_mathml-style"/>
7381
+
7096
7382
  <xsl:if test="$isGenerateTableIF = 'true' and ancestor::*[local-name() = 'td' or local-name() = 'th' or local-name() = 'dl'] and not(following-sibling::node()[not(self::comment())][normalize-space() != ''])"> <!-- math in table cell, and math is last element -->
7097
7383
  <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
7098
7384
  </xsl:if>
@@ -7197,6 +7483,8 @@
7197
7483
 
7198
7484
  <fo:instream-foreign-object fox:alt-text="Math">
7199
7485
 
7486
+ <xsl:call-template name="refine_mathml_insteam_object_style"/>
7487
+
7200
7488
  <!-- put MathML in Actual Text -->
7201
7489
  <!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
7202
7490
  <xsl:attribute name="fox:actual-text">
@@ -7217,6 +7505,10 @@
7217
7505
  </fo:instream-foreign-object>
7218
7506
  </xsl:template>
7219
7507
 
7508
+ <xsl:template name="refine_mathml_insteam_object_style">
7509
+
7510
+ </xsl:template> <!-- refine_mathml_insteam_object_style -->
7511
+
7220
7512
  <xsl:template match="mathml:*" mode="mathml_actual_text">
7221
7513
  <!-- <xsl:text>a+b</xsl:text> -->
7222
7514
  <xsl:text>&lt;</xsl:text>
@@ -7361,6 +7653,8 @@
7361
7653
  <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
7362
7654
  <fo:inline xsl:use-attribute-sets="mathml-style">
7363
7655
 
7656
+ <xsl:call-template name="refine_mathml-style"/>
7657
+
7364
7658
  <xsl:choose>
7365
7659
  <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
7366
7660
  <xsl:otherwise>
@@ -7405,9 +7699,7 @@
7405
7699
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7406
7700
  </xsl:if>
7407
7701
 
7408
- <xsl:if test="ancestor::*[local-name()='feedback-statement' or local-name() = 'copyright-statement']">
7409
- <xsl:attribute name="color">blue</xsl:attribute>
7410
- </xsl:if>
7702
+ <xsl:call-template name="refine_link-style"/>
7411
7703
 
7412
7704
  <xsl:choose>
7413
7705
  <xsl:when test="$target_text = ''">
@@ -7496,6 +7788,9 @@
7496
7788
  <xsl:call-template name="insert_basic_link">
7497
7789
  <xsl:with-param name="element">
7498
7790
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
7791
+ <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[local-name() = 'table' or local-name() = 'dl'])">
7792
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7793
+ </xsl:if>
7499
7794
  <xsl:if test="parent::*[local-name() = 'add']">
7500
7795
  <xsl:call-template name="append_add-style"/>
7501
7796
  </xsl:if>
@@ -7557,6 +7852,8 @@
7557
7852
  <fo:table-cell display-align="center">
7558
7853
  <fo:block xsl:use-attribute-sets="formula-stem-block-style">
7559
7854
 
7855
+ <xsl:call-template name="refine_formula-stem-block-style"/>
7856
+
7560
7857
  <xsl:apply-templates/>
7561
7858
  </fo:block>
7562
7859
  </fo:table-cell>
@@ -7598,12 +7895,18 @@
7598
7895
 
7599
7896
  <xsl:call-template name="setBlockSpanAll"/>
7600
7897
 
7898
+ <xsl:call-template name="refine_note-style"/>
7899
+
7601
7900
  <fo:block-container margin-left="0mm" margin-right="0mm">
7602
7901
 
7603
7902
  <fo:block>
7604
7903
 
7904
+ <xsl:call-template name="refine_note_block_style"/>
7905
+
7605
7906
  <fo:inline xsl:use-attribute-sets="note-name-style">
7606
7907
 
7908
+ <xsl:call-template name="refine_note-name-style"/>
7909
+
7607
7910
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
7608
7911
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
7609
7912
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -7629,6 +7932,10 @@
7629
7932
 
7630
7933
  </xsl:template>
7631
7934
 
7935
+ <xsl:template name="refine_note_block_style">
7936
+
7937
+ </xsl:template>
7938
+
7632
7939
  <xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
7633
7940
  <xsl:variable name="num"><xsl:number/></xsl:variable>
7634
7941
  <xsl:choose>
@@ -7650,12 +7957,16 @@
7650
7957
 
7651
7958
  <xsl:call-template name="setBlockSpanAll"/>
7652
7959
 
7960
+ <xsl:call-template name="refine_termnote-style"/>
7961
+
7653
7962
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
7654
7963
 
7655
7964
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
7656
7965
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
7657
7966
  </xsl:if>
7658
7967
 
7968
+ <xsl:call-template name="refine_termnote-name-style"/>
7969
+
7659
7970
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
7660
7971
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
7661
7972
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -7829,6 +8140,8 @@
7829
8140
  <xsl:otherwise>
7830
8141
  <fo:block xsl:use-attribute-sets="image-style">
7831
8142
 
8143
+ <xsl:call-template name="refine_image-style"/>
8144
+
7832
8145
  <xsl:variable name="src">
7833
8146
  <xsl:call-template name="image_src"/>
7834
8147
  </xsl:variable>
@@ -8689,6 +9002,8 @@
8689
9002
  <xsl:if test="normalize-space() != ''">
8690
9003
  <fo:block xsl:use-attribute-sets="figure-name-style">
8691
9004
 
9005
+ <xsl:call-template name="refine_figure-name-style"/>
9006
+
8692
9007
  <xsl:apply-templates/>
8693
9008
  </fo:block>
8694
9009
  </xsl:if>
@@ -8954,6 +9269,8 @@
8954
9269
  </xsl:attribute>
8955
9270
  </xsl:for-each>
8956
9271
 
9272
+ <xsl:call-template name="refine_sourcecode-style"/>
9273
+
8957
9274
  <!-- remove margin between rows in the table with sourcecode line numbers -->
8958
9275
  <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
8959
9276
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
@@ -9658,6 +9975,8 @@
9658
9975
 
9659
9976
  <xsl:call-template name="setBlockSpanAll"/>
9660
9977
 
9978
+ <xsl:call-template name="refine_example-style"/>
9979
+
9661
9980
  <xsl:variable name="fo_element">
9662
9981
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
9663
9982
 
@@ -9774,6 +10093,12 @@
9774
10093
 
9775
10094
  </xsl:template>
9776
10095
 
10096
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name']">
10097
+ <fo:inline xsl:use-attribute-sets="example-name-style">
10098
+ <xsl:apply-templates/>
10099
+ </fo:inline>
10100
+ </xsl:template>
10101
+
9777
10102
  <xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
9778
10103
  <xsl:param name="fo_element">block</xsl:param>
9779
10104
 
@@ -9791,6 +10116,8 @@
9791
10116
  </xsl:if>
9792
10117
  <fo:block xsl:use-attribute-sets="example-p-style">
9793
10118
 
10119
+ <xsl:call-template name="refine_example-p-style"/>
10120
+
9794
10121
  <xsl:apply-templates/>
9795
10122
  </fo:block>
9796
10123
  </fo:block-container>
@@ -9807,6 +10134,7 @@
9807
10134
  </xsl:otherwise>
9808
10135
  </xsl:choose>
9809
10136
  </xsl:template> <!-- example/p -->
10137
+
9810
10138
  <!-- ====== -->
9811
10139
  <!-- ====== -->
9812
10140
 
@@ -9818,6 +10146,8 @@
9818
10146
  <xsl:template match="*[local-name() = 'termsource']" name="termsource">
9819
10147
  <fo:block xsl:use-attribute-sets="termsource-style">
9820
10148
 
10149
+ <xsl:call-template name="refine_termsource-style"/>
10150
+
9821
10151
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
9822
10152
  <xsl:variable name="termsource_text">
9823
10153
  <xsl:apply-templates/>
@@ -9933,6 +10263,8 @@
9933
10263
  <fo:block-container margin-left="0mm">
9934
10264
  <fo:block-container xsl:use-attribute-sets="quote-style">
9935
10265
 
10266
+ <xsl:call-template name="refine_quote-style"/>
10267
+
9936
10268
  <fo:block-container margin-left="0mm" margin-right="0mm">
9937
10269
  <fo:block role="BlockQuote">
9938
10270
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
@@ -10007,8 +10339,7 @@
10007
10339
 
10008
10340
  </xsl:if>
10009
10341
 
10010
- <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
10011
- <xsl:variable name="text" select="normalize-space()"/>
10342
+ <xsl:call-template name="refine_eref-style"/>
10012
10343
 
10013
10344
  <xsl:call-template name="insert_basic_link">
10014
10345
  <xsl:with-param name="element">
@@ -10018,6 +10349,8 @@
10018
10349
  </xsl:if>
10019
10350
  <xsl:if test="@type = 'inline'">
10020
10351
 
10352
+ <xsl:call-template name="refine_basic_link_style"/>
10353
+
10021
10354
  </xsl:if>
10022
10355
 
10023
10356
  <xsl:choose>
@@ -10050,6 +10383,11 @@
10050
10383
  </xsl:otherwise>
10051
10384
  </xsl:choose>
10052
10385
  </xsl:template>
10386
+
10387
+ <xsl:template name="refine_basic_link_style">
10388
+
10389
+ </xsl:template> <!-- refine_basic_link_style -->
10390
+
10053
10391
  <!-- ====== -->
10054
10392
  <!-- END eref -->
10055
10393
  <!-- ====== -->
@@ -10198,11 +10536,17 @@
10198
10536
  <fo:block>
10199
10537
  <xsl:call-template name="setId"/>
10200
10538
 
10539
+ <xsl:call-template name="sections_element_style"/>
10540
+
10201
10541
  <xsl:apply-templates/>
10202
10542
  </fo:block>
10203
10543
 
10204
10544
  </xsl:template>
10205
10545
 
10546
+ <xsl:template name="sections_element_style">
10547
+
10548
+ </xsl:template> <!-- sections_element_style -->
10549
+
10206
10550
  <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
10207
10551
  <fo:block break-after="page"/>
10208
10552
  <fo:block>
@@ -10217,10 +10561,16 @@
10217
10561
 
10218
10562
  <xsl:call-template name="setBlockSpanAll"/>
10219
10563
 
10564
+ <xsl:call-template name="refine_clause_style"/>
10565
+
10220
10566
  <xsl:apply-templates/>
10221
10567
  </fo:block>
10222
10568
  </xsl:template>
10223
10569
 
10570
+ <xsl:template name="refine_clause_style">
10571
+
10572
+ </xsl:template> <!-- refine_clause_style -->
10573
+
10224
10574
  <xsl:template match="*[local-name() = 'definitions']">
10225
10575
  <fo:block id="{@id}">
10226
10576
  <xsl:apply-templates/>
@@ -10233,10 +10583,16 @@
10233
10583
 
10234
10584
  <xsl:call-template name="setBlockSpanAll"/>
10235
10585
 
10586
+ <xsl:call-template name="refine_annex_style"/>
10587
+
10236
10588
  </fo:block>
10237
10589
  <xsl:apply-templates/>
10238
10590
  </xsl:template>
10239
10591
 
10592
+ <xsl:template name="refine_annex_style">
10593
+
10594
+ </xsl:template>
10595
+
10240
10596
  <xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
10241
10597
  <!-- comment 2019-11-29 -->
10242
10598
  <!-- <fo:block font-weight="bold">Review:</fo:block>
@@ -10315,6 +10671,9 @@
10315
10671
  <xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
10316
10672
  </xsl:choose>
10317
10673
  </xsl:when>
10674
+ <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
10675
+ <xsl:value-of select="@label"/>
10676
+ </xsl:when>
10318
10677
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
10319
10678
 
10320
10679
  <!-- Example: for BSI <?list-start 2?> -->
@@ -10372,10 +10731,10 @@
10372
10731
  <xsl:when test="$type = 'arabic'">
10373
10732
  1)
10374
10733
  </xsl:when>
10375
- <xsl:when test="$type = 'alphabet'">
10734
+ <xsl:when test="$type = 'alphabet' or $type = 'alphabetic'">
10376
10735
  a)
10377
10736
  </xsl:when>
10378
- <xsl:when test="$type = 'alphabet_upper'">
10737
+ <xsl:when test="$type = 'alphabet_upper' or $type = 'alphabetic_upper'">
10379
10738
  A.
10380
10739
  </xsl:when>
10381
10740
  <xsl:when test="$type = 'roman'">
@@ -10403,6 +10762,8 @@
10403
10762
  </xsl:choose>
10404
10763
  </xsl:attribute>
10405
10764
 
10765
+ <xsl:call-template name="refine_list_container_style"/>
10766
+
10406
10767
  <fo:block-container margin-left="0mm">
10407
10768
  <fo:block>
10408
10769
  <xsl:apply-templates select="." mode="list"/>
@@ -10420,6 +10781,10 @@
10420
10781
  </xsl:choose>
10421
10782
  </xsl:template>
10422
10783
 
10784
+ <xsl:template name="refine_list_container_style">
10785
+
10786
+ </xsl:template> <!-- refine_list_container_style -->
10787
+
10423
10788
  <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
10424
10789
 
10425
10790
  <xsl:apply-templates select="*[local-name() = 'name']">
@@ -10430,11 +10795,7 @@
10430
10795
 
10431
10796
  <xsl:variable name="provisional_distance_between_starts_">
10432
10797
  <attributes xsl:use-attribute-sets="list-style">
10433
-
10434
- <xsl:if test="ancestor::iec:legal-statement or ancestor::iec:clause[@type = 'boilerplate_legal']">
10435
- <xsl:attribute name="provisional-distance-between-starts">5mm</xsl:attribute>
10436
- </xsl:if>
10437
-
10798
+ <xsl:call-template name="refine_list-style_provisional-distance-between-starts"/>
10438
10799
  </attributes>
10439
10800
  </xsl:variable>
10440
10801
  <xsl:variable name="provisional_distance_between_starts" select="normalize-space(xalan:nodeset($provisional_distance_between_starts_)/attributes/@provisional-distance-between-starts)"/>
@@ -10470,9 +10831,7 @@
10470
10831
  <addon><xsl:value-of select="$addon"/></addon> -->
10471
10832
  </xsl:if>
10472
10833
 
10473
- <xsl:if test="ancestor::iec:ul or ancestor::iec:ol">
10474
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
10475
- </xsl:if>
10834
+ <xsl:call-template name="refine_list-style"/>
10476
10835
 
10477
10836
  <xsl:if test="*[local-name() = 'name']">
10478
10837
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
@@ -10486,6 +10845,14 @@
10486
10845
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
10487
10846
  </xsl:template>
10488
10847
 
10848
+ <xsl:template name="refine_list-style_provisional-distance-between-starts">
10849
+
10850
+ <xsl:if test="ancestor::iec:legal-statement or ancestor::iec:clause[@type = 'boilerplate_legal']">
10851
+ <xsl:attribute name="provisional-distance-between-starts">5mm</xsl:attribute>
10852
+ </xsl:if>
10853
+
10854
+ </xsl:template> <!-- refine_list-style_provisional-distance-between-starts -->
10855
+
10489
10856
  <xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
10490
10857
  <xsl:param name="process">false</xsl:param>
10491
10858
  <xsl:if test="$process = 'true'">
@@ -10499,20 +10866,27 @@
10499
10866
  <fo:list-item xsl:use-attribute-sets="list-item-style">
10500
10867
  <xsl:copy-of select="@id"/>
10501
10868
 
10869
+ <xsl:call-template name="refine_list-item-style"/>
10870
+
10502
10871
  <fo:list-item-label end-indent="label-end()">
10503
10872
  <fo:block xsl:use-attribute-sets="list-item-label-style">
10504
10873
 
10874
+ <xsl:call-template name="refine_list-item-label-style"/>
10875
+
10505
10876
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
10506
10877
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
10507
10878
  <xsl:call-template name="append_add-style"/>
10508
10879
  </xsl:if>
10509
10880
 
10510
10881
  <xsl:call-template name="getListItemFormat"/>
10882
+
10511
10883
  </fo:block>
10512
10884
  </fo:list-item-label>
10513
10885
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
10514
10886
  <fo:block>
10515
10887
 
10888
+ <xsl:call-template name="refine_list-item-body-style"/>
10889
+
10516
10890
  <xsl:apply-templates/>
10517
10891
 
10518
10892
  <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
@@ -10830,6 +11204,7 @@
10830
11204
 
10831
11205
  <fo:block id="{@id}">
10832
11206
  <xsl:apply-templates/>
11207
+
10833
11208
  </fo:block>
10834
11209
  </xsl:template>
10835
11210
 
@@ -10849,6 +11224,7 @@
10849
11224
 
10850
11225
  <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style">
10851
11226
  <xsl:apply-templates/>
11227
+
10852
11228
  </fo:block>
10853
11229
 
10854
11230
  <!-- horizontal line -->
@@ -11431,6 +11807,9 @@
11431
11807
  </xsl:copy>
11432
11808
  </xsl:template>
11433
11809
 
11810
+ <!-- prevent empty thead processing in XSL-FO, remove it -->
11811
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'thead'][count(*) = 0]" mode="update_xml_step1"/>
11812
+
11434
11813
  <xsl:template name="add_id">
11435
11814
  <xsl:if test="not(@id)">
11436
11815
  <!-- add @id - first element with @id plus '_element_name' -->
@@ -11715,6 +12094,14 @@
11715
12094
  <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" mode="linear_xml" name="linear_xml_fn">
11716
12095
  <xsl:variable name="p_fn_">
11717
12096
  <xsl:call-template name="get_fn_list"/>
12097
+ <!-- <xsl:choose>
12098
+ <xsl:when test="$namespace = 'jis'">
12099
+ <xsl:call-template name="get_fn_list_for_element"/>
12100
+ </xsl:when>
12101
+ <xsl:otherwise>
12102
+ <xsl:call-template name="get_fn_list"/>
12103
+ </xsl:otherwise>
12104
+ </xsl:choose> -->
11718
12105
  </xsl:variable>
11719
12106
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
11720
12107
  <xsl:variable name="gen_id" select="generate-id(.)"/>
@@ -11729,8 +12116,14 @@
11729
12116
  <xsl:attribute name="current_fn_number">
11730
12117
  <xsl:value-of select="$current_fn_number"/>
11731
12118
  </xsl:attribute>
12119
+ <xsl:variable name="skip_footnote_body_" select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
11732
12120
  <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
11733
- <xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
12121
+
12122
+ <xsl:value-of select="$skip_footnote_body_"/>
12123
+
12124
+ </xsl:attribute>
12125
+ <xsl:attribute name="ref_id">
12126
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
11734
12127
  </xsl:attribute>
11735
12128
  <xsl:apply-templates select="node()" mode="linear_xml"/>
11736
12129
  </xsl:copy>