metanorma-iso 1.5.5 → 1.5.6

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.
@@ -15,6 +15,8 @@
15
15
  <xsl:variable name="pageWidth" select="'210mm'"/>
16
16
  <xsl:variable name="pageHeight" select="'297mm'"/>
17
17
 
18
+ <xsl:variable name="docidentifierISO" select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso'] | /iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'ISO']"/>
19
+
18
20
  <xsl:variable name="copyrightText" select="concat('© ISO ', iso:iso-standard/iso:bibdata/iso:copyright/iso:from ,' – All rights reserved')"/>
19
21
 
20
22
  <xsl:variable name="lang-1st-letter_tmp" select="substring-before(substring-after(/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-with-lang'], '('), ')')"/>
@@ -399,7 +401,7 @@
399
401
  <xsl:value-of select="$stage-fullname-uppercased"/>
400
402
  </fo:block>
401
403
  <fo:block font-size="20pt" font-weight="bold" text-align="right">
402
- <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso']"/>
404
+ <xsl:value-of select="$docidentifierISO"/>
403
405
  </fo:block>
404
406
 
405
407
 
@@ -544,7 +546,7 @@
544
546
  </fo:table-cell>
545
547
  <fo:table-cell>
546
548
  <fo:block text-align="right" font-weight="bold" margin-bottom="13mm">
547
- <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso']"/>
549
+ <xsl:value-of select="$docidentifierISO"/>
548
550
  </fo:block>
549
551
  </fo:table-cell>
550
552
  </fo:table-row>
@@ -555,11 +557,11 @@
555
557
  <xsl:call-template name="printEdition"/>
556
558
  </xsl:if>
557
559
  <xsl:choose>
558
- <xsl:when test="$stage-abbreviation = 'IS'">
560
+ <xsl:when test="$stage-abbreviation = 'IS' and /iso:iso-standard/iso:bibdata/iso:date[@type = 'published']">
559
561
  <xsl:value-of select="$linebreak"/>
560
562
  <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:date[@type = 'published']"/>
561
- </xsl:when>
562
- <xsl:when test="$stage-abbreviation = 'published'">
563
+ </xsl:when>
564
+ <xsl:when test="$stage-abbreviation = 'IS' or $stage-abbreviation = 'published'">
563
565
  <xsl:value-of select="$linebreak"/>
564
566
  <xsl:value-of select="substring(/iso:iso-standard/iso:bibdata/iso:version/iso:revision-date,1, 7)"/>
565
567
  </xsl:when>
@@ -714,7 +716,7 @@
714
716
  </fo:table-cell>
715
717
  <fo:table-cell>
716
718
  <fo:block text-align="right" font-weight="bold" margin-bottom="13mm">
717
- <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso']"/>
719
+ <xsl:value-of select="$docidentifierISO"/>
718
720
  </fo:block>
719
721
  </fo:table-cell>
720
722
  </fo:table-row>
@@ -891,7 +893,7 @@
891
893
  </fo:block-container>
892
894
  <fo:block font-size="11pt" margin-bottom="8pt"><xsl:value-of select="$linebreak"/></fo:block>
893
895
  <fo:block-container font-size="40pt" text-align="center" margin-bottom="12pt" border="0.5pt solid black">
894
- <xsl:variable name="stage-title" select="substring-after(substring-before(/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso'], ' '), '/')"/>
896
+ <xsl:variable name="stage-title" select="substring-after(substring-before($docidentifierISO, ' '), '/')"/>
895
897
  <fo:block padding-top="2mm"><xsl:value-of select="$stage-title"/><xsl:text> stage</xsl:text></fo:block>
896
898
  </fo:block-container>
897
899
  <fo:block><xsl:value-of select="$linebreak"/></fo:block>
@@ -1446,7 +1448,7 @@
1446
1448
  </xsl:element>
1447
1449
  <xsl:if test="$element-name = 'fo:inline' and not($inline = 'true') and not(local-name(..) = 'admonition')">
1448
1450
  <fo:block margin-bottom="12pt">
1449
- <xsl:if test="ancestor::iso:annex">
1451
+ <xsl:if test="ancestor::iso:annex or following-sibling::iso:table">
1450
1452
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
1451
1453
  </xsl:if>
1452
1454
  <xsl:value-of select="$linebreak"/>
@@ -1579,7 +1581,7 @@
1579
1581
 
1580
1582
 
1581
1583
 
1582
- <xsl:template match="iso:ul | iso:ol">
1584
+ <xsl:template match="iso:ul | iso:ol" mode="ul_ol">
1583
1585
  <fo:list-block provisional-distance-between-starts="7mm" margin-top="8pt"> <!-- margin-bottom="8pt" -->
1584
1586
  <xsl:apply-templates/>
1585
1587
  </fo:list-block>
@@ -1606,7 +1608,9 @@
1606
1608
  </fo:list-item>
1607
1609
  </xsl:template>
1608
1610
 
1609
-
1611
+ <xsl:template match="iso:note" mode="process">
1612
+ <xsl:call-template name="note"/>
1613
+ </xsl:template>
1610
1614
 
1611
1615
  <xsl:template match="iso:preferred">
1612
1616
  <fo:block line-height="1.1">
@@ -1688,8 +1692,12 @@
1688
1692
 
1689
1693
  <xsl:template match="mathml:math" priority="2">
1690
1694
  <fo:inline font-family="Cambria Math">
1695
+ <xsl:variable name="mathml">
1696
+ <xsl:apply-templates select="." mode="mathml"/>
1697
+ </xsl:variable>
1691
1698
  <fo:instream-foreign-object fox:alt-text="Math">
1692
- <xsl:copy-of select="."/>
1699
+ <!-- <xsl:copy-of select="."/> -->
1700
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
1693
1701
  </fo:instream-foreign-object>
1694
1702
  </fo:inline>
1695
1703
  </xsl:template>
@@ -2025,7 +2033,12 @@
2025
2033
 
2026
2034
 
2027
2035
 
2028
- <title-source lang="en">SOURCE</title-source>
2036
+ <title-source lang="en">
2037
+
2038
+ <xsl:text>SOURCE</xsl:text>
2039
+
2040
+
2041
+ </title-source>
2029
2042
 
2030
2043
  <title-keywords lang="en">Keywords</title-keywords>
2031
2044
 
@@ -2068,6 +2081,10 @@
2068
2081
  <title-warning lang="zh">警告</title-warning>
2069
2082
 
2070
2083
  <title-amendment lang="en">AMENDMENT</title-amendment>
2084
+
2085
+ <title-continued lang="en">(continued)</title-continued>
2086
+ <title-continued lang="fr">(continué)</title-continued>
2087
+
2071
2088
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
2072
2089
  <xsl:param name="name"/>
2073
2090
  <xsl:variable name="lang">
@@ -2088,12 +2105,12 @@
2088
2105
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
2089
2106
 
2090
2107
 
2108
+
2091
2109
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
2092
2110
  <xsl:attribute name="white-space">pre</xsl:attribute>
2093
2111
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
2094
2112
 
2095
- <xsl:attribute name="font-family">Courier</xsl:attribute>
2096
- <xsl:attribute name="font-size">9pt</xsl:attribute>
2113
+ <xsl:attribute name="font-family">Courier</xsl:attribute>
2097
2114
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2098
2115
 
2099
2116
 
@@ -2103,6 +2120,7 @@
2103
2120
 
2104
2121
 
2105
2122
 
2123
+
2106
2124
  </xsl:attribute-set><xsl:attribute-set name="permission-style">
2107
2125
 
2108
2126
  </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
@@ -2153,6 +2171,7 @@
2153
2171
 
2154
2172
 
2155
2173
 
2174
+
2156
2175
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
2157
2176
 
2158
2177
 
@@ -2173,6 +2192,7 @@
2173
2192
 
2174
2193
 
2175
2194
 
2195
+
2176
2196
 
2177
2197
 
2178
2198
 
@@ -2209,9 +2229,10 @@
2209
2229
 
2210
2230
 
2211
2231
 
2232
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
2212
2233
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2213
2234
  <xsl:attribute name="text-align">center</xsl:attribute>
2214
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
2235
+ <!-- <xsl:attribute name="margin-top">12pt</xsl:attribute> -->
2215
2236
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2216
2237
 
2217
2238
 
@@ -2242,11 +2263,13 @@
2242
2263
 
2243
2264
  <xsl:attribute name="color">blue</xsl:attribute>
2244
2265
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
2245
-
2266
+
2267
+
2246
2268
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
2247
2269
 
2248
2270
 
2249
2271
 
2272
+
2250
2273
  </xsl:attribute-set><xsl:attribute-set name="note-style">
2251
2274
 
2252
2275
 
@@ -2266,20 +2289,20 @@
2266
2289
 
2267
2290
 
2268
2291
 
2292
+ </xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
2269
2293
 
2270
2294
 
2271
- </xsl:attribute-set><xsl:attribute-set name="note-name-style">
2272
2295
 
2273
2296
 
2274
2297
 
2275
2298
 
2299
+ <xsl:attribute name="padding-right">6mm</xsl:attribute>
2300
+
2276
2301
 
2277
2302
 
2278
- <xsl:attribute name="padding-right">6mm</xsl:attribute>
2279
2303
 
2280
2304
 
2281
2305
 
2282
-
2283
2306
 
2284
2307
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
2285
2308
 
@@ -2309,6 +2332,8 @@
2309
2332
 
2310
2333
 
2311
2334
 
2335
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2336
+
2312
2337
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
2313
2338
 
2314
2339
 
@@ -2337,6 +2362,7 @@
2337
2362
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
2338
2363
 
2339
2364
 
2365
+
2340
2366
  </xsl:attribute-set><xsl:attribute-set name="term-style">
2341
2367
 
2342
2368
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
@@ -2345,6 +2371,7 @@
2345
2371
 
2346
2372
 
2347
2373
 
2374
+
2348
2375
 
2349
2376
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2350
2377
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -2388,14 +2415,16 @@
2388
2415
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
2389
2416
 
2390
2417
 
2391
- <xsl:attribute name="font-family">Courier</xsl:attribute>
2392
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2418
+ <xsl:attribute name="font-family">Courier</xsl:attribute>
2419
+
2393
2420
 
2394
2421
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
2395
2422
  <xsl:attribute name="font-size">11pt</xsl:attribute>
2396
2423
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2397
2424
  <xsl:attribute name="text-align">center</xsl:attribute>
2398
2425
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2426
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
2427
+
2399
2428
  </xsl:attribute-set><xsl:attribute-set name="domain-style">
2400
2429
 
2401
2430
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
@@ -2461,12 +2490,10 @@
2461
2490
 
2462
2491
 
2463
2492
 
2464
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2493
+ <!-- $namespace = 'iso' or -->
2465
2494
 
2466
2495
 
2467
2496
 
2468
- <xsl:call-template name="fn_name_display"/>
2469
-
2470
2497
 
2471
2498
 
2472
2499
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
@@ -2520,8 +2547,9 @@
2520
2547
 
2521
2548
 
2522
2549
 
2550
+
2523
2551
 
2524
-
2552
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
2525
2553
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2526
2554
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
2527
2555
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
@@ -2551,6 +2579,8 @@
2551
2579
 
2552
2580
 
2553
2581
 
2582
+
2583
+
2554
2584
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
2555
2585
  <xsl:choose>
2556
2586
  <xsl:when test=". = 1 or . = 0">
@@ -2581,8 +2611,11 @@
2581
2611
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
2582
2612
  <xsl:if test="normalize-space() != ''">
2583
2613
  <fo:block xsl:use-attribute-sets="table-name-style">
2584
- <xsl:apply-templates/>
2585
- </fo:block>
2614
+
2615
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2616
+
2617
+ <xsl:apply-templates/>
2618
+ </fo:block>
2586
2619
  </xsl:if>
2587
2620
  </xsl:template><xsl:template name="calculate-columns-numbers">
2588
2621
  <xsl:param name="table-row"/>
@@ -2698,28 +2731,29 @@
2698
2731
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
2699
2732
  <xsl:param name="cols-count"/>
2700
2733
  <!-- font-weight="bold" -->
2701
- <fo:table-header>
2702
-
2703
- <fo:table-row>
2704
- <fo:table-cell number-columns-spanned="{$cols-count}"> <!-- border-left="1pt solid white" border-right="1pt solid white" border-top="1pt solid white" -->
2705
- <fo:block text-align="center" font-size="11pt" font-weight="bold">
2706
- <!-- (continued) -->
2707
- <fo:block-container position="absolute" top="-7mm">
2708
- <fo:block>
2709
- <fo:retrieve-table-marker retrieve-class-name="table_continued" retrieve-position-within-table="first-starting" retrieve-boundary-within-table="table-fragment"/>
2710
- </fo:block>
2711
- </fo:block-container>
2734
+ <fo:table-header>
2712
2735
 
2713
- </fo:block>
2714
- <!-- <fo:block>fn_name_display
2715
- <xsl:call-template name="fn_name_display"/>
2716
- </fo:block> -->
2736
+ <xsl:call-template name="table-header-title">
2737
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2738
+ </xsl:call-template>
2717
2739
 
2718
- </fo:table-cell>
2719
- </fo:table-row>
2720
-
2721
2740
  <xsl:apply-templates/>
2722
2741
  </fo:table-header>
2742
+ </xsl:template><xsl:template name="table-header-title">
2743
+ <xsl:param name="cols-count"/>
2744
+ <!-- row for title -->
2745
+ <fo:table-row>
2746
+ <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">
2747
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
2748
+ <xsl:for-each select="ancestor::*[local-name()='table'][1]">
2749
+ <xsl:call-template name="fn_name_display"/>
2750
+ </xsl:for-each>
2751
+ <fo:block text-align="right" font-style="italic">
2752
+ <xsl:text> </xsl:text>
2753
+ <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
2754
+ </fo:block>
2755
+ </fo:table-cell>
2756
+ </fo:table-row>
2723
2757
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
2724
2758
  <fo:table-body>
2725
2759
  <xsl:apply-templates/>
@@ -2785,6 +2819,17 @@
2785
2819
  </xsl:choose>
2786
2820
  </xsl:variable>
2787
2821
 
2822
+
2823
+ <!-- if there isn't 'thead' and there is a table's title -->
2824
+ <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='thead']) and ancestor::*[local-name()='table']/*[local-name()='name']">
2825
+ <fo:table-header>
2826
+ <xsl:call-template name="table-header-title">
2827
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2828
+ </xsl:call-template>
2829
+ </fo:table-header>
2830
+ </xsl:if>
2831
+
2832
+
2788
2833
  <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
2789
2834
  <xsl:with-param name="cols-count" select="$cols-count"/>
2790
2835
  </xsl:apply-templates>
@@ -2794,6 +2839,30 @@
2794
2839
  </xsl:call-template>
2795
2840
 
2796
2841
  <fo:table-body>
2842
+
2843
+ <xsl:variable name="title_continued">
2844
+ <xsl:call-template name="getTitle">
2845
+ <xsl:with-param name="name" select="'title-continued'"/>
2846
+ </xsl:call-template>
2847
+ </xsl:variable>
2848
+ <fo:table-row height="0" keep-with-next.within-page="always">
2849
+ <fo:table-cell>
2850
+ <fo:marker marker-class-name="table_continued"/>
2851
+ <fo:block/>
2852
+ </fo:table-cell>
2853
+ </fo:table-row>
2854
+ <fo:table-row height="0" keep-with-next.within-page="always">
2855
+ <fo:table-cell>
2856
+ <fo:marker marker-class-name="table_continued">
2857
+ <!-- <fo:inline font-style="italic" font-weight="normal"> -->
2858
+ <xsl:value-of select="$title_continued"/>
2859
+ <!-- </fo:inline> -->
2860
+ </fo:marker>
2861
+ <fo:block/>
2862
+ </fo:table-cell>
2863
+ </fo:table-row>
2864
+
2865
+
2797
2866
  <xsl:apply-templates/>
2798
2867
  <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
2799
2868
 
@@ -2835,6 +2904,8 @@
2835
2904
 
2836
2905
  </xsl:if>
2837
2906
 
2907
+
2908
+
2838
2909
 
2839
2910
  <xsl:apply-templates/>
2840
2911
  </fo:table-row>
@@ -2859,6 +2930,7 @@
2859
2930
 
2860
2931
 
2861
2932
 
2933
+
2862
2934
  <xsl:if test="@colspan">
2863
2935
  <xsl:attribute name="number-columns-spanned">
2864
2936
  <xsl:value-of select="@colspan"/>
@@ -2869,10 +2941,22 @@
2869
2941
  <xsl:value-of select="@rowspan"/>
2870
2942
  </xsl:attribute>
2871
2943
  </xsl:if>
2944
+ <xsl:call-template name="display-align"/>
2872
2945
  <fo:block>
2873
2946
  <xsl:apply-templates/>
2874
2947
  </fo:block>
2875
2948
  </fo:table-cell>
2949
+ </xsl:template><xsl:template name="display-align">
2950
+ <xsl:if test="@valign">
2951
+ <xsl:attribute name="display-align">
2952
+ <xsl:choose>
2953
+ <xsl:when test="@valign = 'top'">before</xsl:when>
2954
+ <xsl:when test="@valign = 'middle'">center</xsl:when>
2955
+ <xsl:when test="@valign = 'bottom'">after</xsl:when>
2956
+ <xsl:otherwise>before</xsl:otherwise>
2957
+ </xsl:choose>
2958
+ </xsl:attribute>
2959
+ </xsl:if>
2876
2960
  </xsl:template><xsl:template match="*[local-name()='td']">
2877
2961
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
2878
2962
  <xsl:attribute name="text-align">
@@ -2898,6 +2982,7 @@
2898
2982
 
2899
2983
 
2900
2984
 
2985
+
2901
2986
  <xsl:if test="@colspan">
2902
2987
  <xsl:attribute name="number-columns-spanned">
2903
2988
  <xsl:value-of select="@colspan"/>
@@ -2908,20 +2993,8 @@
2908
2993
  <xsl:value-of select="@rowspan"/>
2909
2994
  </xsl:attribute>
2910
2995
  </xsl:if>
2911
- <fo:block>
2912
-
2913
- <xsl:variable name="row_number">
2914
- <xsl:number format="1" count="*[local-name() = 'tr'] | *[local-name() = 'th']"/>
2915
- </xsl:variable>
2916
- <fo:marker marker-class-name="table_continued">
2917
- <xsl:if test="$row_number &gt; 1">
2918
- <fo:inline>
2919
- <xsl:apply-templates select="ancestor::*[local-name() = 'table']/*[local-name() = 'name']" mode="contents"/>
2920
- <fo:inline font-style="italic" font-weight="normal">(continued)</fo:inline>
2921
- </fo:inline>
2922
- </xsl:if>
2923
- </fo:marker>
2924
-
2996
+ <xsl:call-template name="display-align"/>
2997
+ <fo:block>
2925
2998
  <xsl:apply-templates/>
2926
2999
  </fo:block>
2927
3000
  </fo:table-cell>
@@ -3110,6 +3183,7 @@
3110
3183
 
3111
3184
 
3112
3185
 
3186
+
3113
3187
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
3114
3188
 
3115
3189
  <xsl:value-of select="@reference"/>
@@ -3120,129 +3194,143 @@
3120
3194
  <xsl:apply-templates/>
3121
3195
  </fo:inline>
3122
3196
  </xsl:template><xsl:template match="*[local-name()='dl']">
3123
- <xsl:variable name="parent" select="local-name(..)"/>
3124
-
3125
- <xsl:variable name="key_iso">
3126
-
3127
- <xsl:if test="$parent = 'figure' or $parent = 'formula'">true</xsl:if>
3128
- <!-- and (not(../@class) or ../@class !='pseudocode') -->
3129
- </xsl:variable>
3130
-
3131
- <xsl:choose>
3132
- <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
3133
-
3197
+ <fo:block-container margin-left="0mm">
3198
+ <xsl:if test="parent::*[local-name() = 'note']">
3199
+ <xsl:attribute name="margin-left">
3200
+ <xsl:choose>
3201
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3202
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3203
+ </xsl:choose>
3204
+ </xsl:attribute>
3134
3205
 
3135
- <fo:block margin-bottom="12pt" text-align="left">
3136
-
3137
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
3138
-
3139
- <xsl:variable name="title-where">
3140
- <xsl:call-template name="getTitle">
3141
- <xsl:with-param name="name" select="'title-where'"/>
3142
- </xsl:call-template>
3143
- </xsl:variable>
3144
- <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
3145
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
3146
- <xsl:text/>
3147
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
3148
- </fo:block>
3206
+ </xsl:if>
3207
+ <fo:block-container margin-left="0mm">
3208
+
3209
+ <xsl:variable name="parent" select="local-name(..)"/>
3149
3210
 
3150
- </xsl:when>
3151
- <xsl:when test="$parent = 'formula'"> <!-- a few components -->
3152
- <fo:block margin-bottom="12pt" text-align="left">
3153
-
3154
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3211
+ <xsl:variable name="key_iso">
3155
3212
 
3156
-
3157
-
3158
-
3159
- <xsl:variable name="title-where">
3160
- <xsl:call-template name="getTitle">
3161
- <xsl:with-param name="name" select="'title-where'"/>
3162
- </xsl:call-template>
3163
- </xsl:variable>
3164
- <xsl:value-of select="$title-where"/>
3165
- </fo:block>
3166
- </xsl:when>
3167
- <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
3168
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
3169
-
3170
- <xsl:attribute name="font-size">10pt</xsl:attribute>
3171
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
3172
-
3173
-
3174
-
3175
- <xsl:variable name="title-key">
3176
- <xsl:call-template name="getTitle">
3177
- <xsl:with-param name="name" select="'title-key'"/>
3178
- </xsl:call-template>
3179
- </xsl:variable>
3180
- <xsl:value-of select="$title-key"/>
3181
- </fo:block>
3182
- </xsl:when>
3183
- </xsl:choose>
3184
-
3185
- <!-- a few components -->
3186
- <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
3187
- <fo:block>
3188
-
3189
- <xsl:if test="$parent = 'formula'">
3190
- <xsl:attribute name="margin-left">4mm</xsl:attribute>
3191
- </xsl:if>
3192
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
3193
-
3194
-
3195
-
3213
+ <xsl:if test="$parent = 'figure' or $parent = 'formula'">true</xsl:if>
3214
+ <!-- and (not(../@class) or ../@class !='pseudocode') -->
3215
+ </xsl:variable>
3196
3216
 
3197
- <fo:block>
3198
-
3199
-
3200
-
3201
-
3202
- <fo:table width="95%" table-layout="fixed">
3217
+ <xsl:choose>
3218
+ <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
3203
3219
 
3204
- <xsl:choose>
3205
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
3206
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
3207
- </xsl:when>
3208
- <xsl:when test="normalize-space($key_iso) = 'true'">
3220
+
3221
+ <fo:block margin-bottom="12pt" text-align="left">
3222
+
3223
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
3224
+
3225
+ <xsl:variable name="title-where">
3226
+ <xsl:call-template name="getTitle">
3227
+ <xsl:with-param name="name" select="'title-where'"/>
3228
+ </xsl:call-template>
3229
+ </xsl:variable>
3230
+ <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
3231
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
3232
+ <xsl:text/>
3233
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
3234
+ </fo:block>
3235
+
3236
+ </xsl:when>
3237
+ <xsl:when test="$parent = 'formula'"> <!-- a few components -->
3238
+ <fo:block margin-bottom="12pt" text-align="left">
3239
+
3240
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3241
+
3242
+
3243
+
3244
+
3245
+ <xsl:variable name="title-where">
3246
+ <xsl:call-template name="getTitle">
3247
+ <xsl:with-param name="name" select="'title-where'"/>
3248
+ </xsl:call-template>
3249
+ </xsl:variable>
3250
+ <xsl:value-of select="$title-where"/>
3251
+ </fo:block>
3252
+ </xsl:when>
3253
+ <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
3254
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
3255
+
3209
3256
  <xsl:attribute name="font-size">10pt</xsl:attribute>
3257
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
3258
+
3259
+
3260
+
3261
+ <xsl:variable name="title-key">
3262
+ <xsl:call-template name="getTitle">
3263
+ <xsl:with-param name="name" select="'title-key'"/>
3264
+ </xsl:call-template>
3265
+ </xsl:variable>
3266
+ <xsl:value-of select="$title-key"/>
3267
+ </fo:block>
3268
+ </xsl:when>
3269
+ </xsl:choose>
3270
+
3271
+ <!-- a few components -->
3272
+ <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
3273
+ <fo:block>
3274
+
3275
+ <xsl:if test="$parent = 'formula'">
3276
+ <xsl:attribute name="margin-left">4mm</xsl:attribute>
3277
+ </xsl:if>
3278
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
3279
+
3280
+
3281
+
3282
+
3283
+ <fo:block>
3284
+
3285
+
3286
+
3287
+
3288
+ <fo:table width="95%" table-layout="fixed">
3210
3289
 
3211
- </xsl:when>
3212
- </xsl:choose>
3213
- <!-- create virtual html table for dl/[dt and dd] -->
3214
- <xsl:variable name="html-table">
3215
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
3216
- <xsl:element name="{$ns}:table">
3217
- <tbody>
3218
- <xsl:apply-templates mode="dl"/>
3219
- </tbody>
3220
- </xsl:element>
3221
- </xsl:variable>
3222
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
3223
- <xsl:variable name="colwidths">
3224
- <xsl:call-template name="calculate-column-widths">
3225
- <xsl:with-param name="cols-count" select="2"/>
3226
- <xsl:with-param name="table" select="$html-table"/>
3227
- </xsl:call-template>
3228
- </xsl:variable>
3229
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
3230
- <xsl:variable name="maxlength_dt">
3231
- <xsl:call-template name="getMaxLength_dt"/>
3232
- </xsl:variable>
3233
- <xsl:call-template name="setColumnWidth_dl">
3234
- <xsl:with-param name="colwidths" select="$colwidths"/>
3235
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
3236
- </xsl:call-template>
3237
- <fo:table-body>
3238
- <xsl:apply-templates>
3239
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
3240
- </xsl:apply-templates>
3241
- </fo:table-body>
3242
- </fo:table>
3243
- </fo:block>
3244
- </fo:block>
3245
- </xsl:if>
3290
+ <xsl:choose>
3291
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
3292
+ <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
3293
+ </xsl:when>
3294
+ <xsl:when test="normalize-space($key_iso) = 'true'">
3295
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
3296
+
3297
+ </xsl:when>
3298
+ </xsl:choose>
3299
+ <!-- create virtual html table for dl/[dt and dd] -->
3300
+ <xsl:variable name="html-table">
3301
+ <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
3302
+ <xsl:element name="{$ns}:table">
3303
+ <tbody>
3304
+ <xsl:apply-templates mode="dl"/>
3305
+ </tbody>
3306
+ </xsl:element>
3307
+ </xsl:variable>
3308
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
3309
+ <xsl:variable name="colwidths">
3310
+ <xsl:call-template name="calculate-column-widths">
3311
+ <xsl:with-param name="cols-count" select="2"/>
3312
+ <xsl:with-param name="table" select="$html-table"/>
3313
+ </xsl:call-template>
3314
+ </xsl:variable>
3315
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
3316
+ <xsl:variable name="maxlength_dt">
3317
+ <xsl:call-template name="getMaxLength_dt"/>
3318
+ </xsl:variable>
3319
+ <xsl:call-template name="setColumnWidth_dl">
3320
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3321
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
3322
+ </xsl:call-template>
3323
+ <fo:table-body>
3324
+ <xsl:apply-templates>
3325
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
3326
+ </xsl:apply-templates>
3327
+ </fo:table-body>
3328
+ </fo:table>
3329
+ </fo:block>
3330
+ </fo:block>
3331
+ </xsl:if>
3332
+ </fo:block-container>
3333
+ </fo:block-container>
3246
3334
  </xsl:template><xsl:template name="setColumnWidth_dl">
3247
3335
  <xsl:param name="colwidths"/>
3248
3336
  <xsl:param name="maxlength_dt"/>
@@ -3339,6 +3427,7 @@
3339
3427
  <xsl:param name="key_iso"/>
3340
3428
 
3341
3429
  <fo:table-row>
3430
+
3342
3431
  <fo:table-cell>
3343
3432
 
3344
3433
  <fo:block margin-top="6pt">
@@ -3420,6 +3509,31 @@
3420
3509
  </fo:inline>
3421
3510
  </xsl:template><xsl:template match="*[local-name()='tt']">
3422
3511
  <fo:inline xsl:use-attribute-sets="tt-style">
3512
+ <xsl:variable name="_font-size">
3513
+
3514
+
3515
+
3516
+
3517
+
3518
+ 10
3519
+
3520
+
3521
+
3522
+
3523
+
3524
+
3525
+
3526
+
3527
+ </xsl:variable>
3528
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3529
+ <xsl:if test="$font-size != ''">
3530
+ <xsl:attribute name="font-size">
3531
+ <xsl:choose>
3532
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3533
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3534
+ </xsl:choose>
3535
+ </xsl:attribute>
3536
+ </xsl:if>
3423
3537
  <xsl:apply-templates/>
3424
3538
  </fo:inline>
3425
3539
  </xsl:template><xsl:template match="*[local-name()='del']">
@@ -3746,10 +3860,23 @@
3746
3860
  <xsl:value-of select="substring($str, 2)"/>
3747
3861
  </xsl:template><xsl:template match="mathml:math">
3748
3862
  <fo:inline font-family="STIX2Math">
3749
- <fo:instream-foreign-object fox:alt-text="Math">
3750
- <xsl:copy-of select="."/>
3751
- </fo:instream-foreign-object>
3863
+ <xsl:variable name="mathml">
3864
+ <xsl:apply-templates select="." mode="mathml"/>
3865
+ </xsl:variable>
3866
+ <fo:instream-foreign-object fox:alt-text="Math">
3867
+ <!-- <xsl:copy-of select="."/> -->
3868
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
3869
+ </fo:instream-foreign-object>
3752
3870
  </fo:inline>
3871
+ </xsl:template><xsl:template match="@*|node()" mode="mathml">
3872
+ <xsl:copy>
3873
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
3874
+ </xsl:copy>
3875
+ </xsl:template><xsl:template match="mathml:mtext" mode="mathml">
3876
+ <xsl:copy>
3877
+ <!-- replace start and end spaces to non-break space -->
3878
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3879
+ </xsl:copy>
3753
3880
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3754
3881
  <xsl:variable name="target">
3755
3882
  <xsl:choose>
@@ -3830,9 +3957,22 @@
3830
3957
  <xsl:apply-templates/>
3831
3958
  </fo:basic-link>
3832
3959
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
3833
- <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
3834
- <xsl:apply-templates/>
3835
- </fo:block>
3960
+ <fo:block-container margin-left="0mm">
3961
+ <xsl:if test="parent::*[local-name() = 'note']">
3962
+ <xsl:attribute name="margin-left">
3963
+ <xsl:choose>
3964
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3965
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3966
+ </xsl:choose>
3967
+ </xsl:attribute>
3968
+
3969
+ </xsl:if>
3970
+ <fo:block-container margin-left="0mm">
3971
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
3972
+ <xsl:apply-templates/>
3973
+ </fo:block>
3974
+ </fo:block-container>
3975
+ </fo:block-container>
3836
3976
  </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
3837
3977
  <fo:inline>
3838
3978
  <xsl:apply-templates/>
@@ -3892,7 +4032,9 @@
3892
4032
  </xsl:choose>
3893
4033
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
3894
4034
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
3895
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4035
+ <fo:inline xsl:use-attribute-sets="termnote-name-style">
4036
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4037
+ </fo:inline>
3896
4038
  <xsl:apply-templates/>
3897
4039
  </fo:block>
3898
4040
  </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name'] | *[local-name() = 'termnote']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']" mode="presentation">
@@ -4061,21 +4203,61 @@
4061
4203
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
4062
4204
  <xsl:text> </xsl:text>
4063
4205
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
4064
- <fo:block xsl:use-attribute-sets="sourcecode-style">
4065
- <xsl:apply-templates/>
4066
- </fo:block>
4067
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4068
- </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()">
4206
+
4207
+ <fo:block-container margin-left="0mm">
4208
+ <xsl:if test="parent::*[local-name() = 'note']">
4209
+ <xsl:attribute name="margin-left">
4210
+ <xsl:choose>
4211
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
4212
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4213
+ </xsl:choose>
4214
+ </xsl:attribute>
4215
+
4216
+ </xsl:if>
4217
+ <fo:block-container margin-left="0mm">
4218
+
4219
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
4220
+ <xsl:variable name="_font-size">
4221
+
4222
+
4223
+
4224
+
4225
+
4226
+ 9
4227
+
4228
+
4229
+
4230
+
4231
+
4232
+
4233
+
4234
+
4235
+ </xsl:variable>
4236
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
4237
+ <xsl:if test="$font-size != ''">
4238
+ <xsl:attribute name="font-size">
4239
+ <xsl:choose>
4240
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
4241
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
4242
+ </xsl:choose>
4243
+ </xsl:attribute>
4244
+ </xsl:if>
4245
+ <xsl:apply-templates/>
4246
+ </fo:block>
4247
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4248
+
4249
+ </fo:block-container>
4250
+ </fo:block-container>
4251
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
4069
4252
  <xsl:variable name="text">
4070
4253
  <xsl:call-template name="add-zero-spaces-equal"/>
4071
4254
  </xsl:variable>
4072
- <xsl:call-template name="add-zero-spaces">
4255
+ <xsl:call-template name="add-zero-spaces-java">
4073
4256
  <xsl:with-param name="text" select="$text"/>
4074
4257
  </xsl:call-template>
4075
4258
  </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
4076
4259
  <xsl:if test="normalize-space() != ''">
4077
- <fo:block xsl:use-attribute-sets="sourcecode-name-style">
4078
-
4260
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
4079
4261
  <xsl:apply-templates/>
4080
4262
  </fo:block>
4081
4263
  </xsl:if>
@@ -4149,9 +4331,9 @@
4149
4331
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
4150
4332
  </xsl:if>
4151
4333
  <fo:block-container margin-left="0mm" margin-right="0mm">
4152
- <fo:table id="{@id}" table-layout="fixed" width="100%" border="1pt solid black">
4334
+ <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
4153
4335
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
4154
- <xsl:attribute name="border">0.5pt solid black</xsl:attribute>
4336
+ <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
4155
4337
  </xsl:if>
4156
4338
  <xsl:variable name="simple-table">
4157
4339
  <xsl:call-template name="getSimpleTable"/>
@@ -4160,8 +4342,8 @@
4160
4342
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
4161
4343
  <!-- <fo:table-column column-width="35mm"/>
4162
4344
  <fo:table-column column-width="115mm"/> -->
4163
- <fo:table-column column-width="25%"/>
4164
- <fo:table-column column-width="75%"/>
4345
+ <fo:table-column column-width="30%"/>
4346
+ <fo:table-column column-width="70%"/>
4165
4347
  </xsl:if>
4166
4348
  <xsl:apply-templates mode="requirement"/>
4167
4349
  </fo:table>
@@ -4184,14 +4366,21 @@
4184
4366
  <xsl:apply-templates mode="requirement"/>
4185
4367
  </fo:table-body>
4186
4368
  </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
4187
- <fo:table-row height="7mm">
4188
- <xsl:if test="parent::*[local-name()='thead'] and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission'])">
4189
- <xsl:attribute name="border">1pt solid black</xsl:attribute>
4369
+ <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
4370
+ <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
4371
+ <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
4372
+ <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
4373
+ </xsl:if>
4374
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
4375
+ <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
4376
+ </xsl:if>
4377
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
4378
+ <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
4190
4379
  </xsl:if>
4191
4380
  <xsl:apply-templates mode="requirement"/>
4192
4381
  </fo:table-row>
4193
4382
  </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
4194
- <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black">
4383
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
4195
4384
  <xsl:attribute name="text-align">
4196
4385
  <xsl:choose>
4197
4386
  <xsl:when test="@align">
@@ -4210,6 +4399,7 @@
4210
4399
  <xsl:value-of select="@rowspan"/>
4211
4400
  </xsl:attribute>
4212
4401
  </xsl:if>
4402
+ <xsl:call-template name="display-align"/>
4213
4403
 
4214
4404
  <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
4215
4405
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
@@ -4225,7 +4415,7 @@
4225
4415
  </fo:block>
4226
4416
  </fo:table-cell>
4227
4417
  </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
4228
- <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black">
4418
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
4229
4419
  <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
4230
4420
  <xsl:attribute name="padding">0mm</xsl:attribute>
4231
4421
  <xsl:attribute name="padding-left">0mm</xsl:attribute>
@@ -4238,6 +4428,9 @@
4238
4428
  <xsl:otherwise>left</xsl:otherwise>
4239
4429
  </xsl:choose>
4240
4430
  </xsl:attribute>
4431
+ <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
4432
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
4433
+ </xsl:if>
4241
4434
  <xsl:if test="@colspan">
4242
4435
  <xsl:attribute name="number-columns-spanned">
4243
4436
  <xsl:value-of select="@colspan"/>
@@ -4248,6 +4441,7 @@
4248
4441
  <xsl:value-of select="@rowspan"/>
4249
4442
  </xsl:attribute>
4250
4443
  </xsl:if>
4444
+ <xsl:call-template name="display-align"/>
4251
4445
 
4252
4446
  <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
4253
4447
  <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
@@ -4263,7 +4457,7 @@
4263
4457
  </fo:block>
4264
4458
  </fo:table-cell>
4265
4459
  </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
4266
- <fo:block font-size="11pt" font-weight="bold"> <!-- margin-bottom="4pt" text-align="center" -->
4460
+ <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
4267
4461
  <xsl:apply-templates/>
4268
4462
  </fo:block>
4269
4463
  </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
@@ -4289,12 +4483,13 @@
4289
4483
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4290
4484
 
4291
4485
  <xsl:variable name="element">
4292
- block
4486
+ block
4293
4487
 
4488
+ <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
4294
4489
  </xsl:variable>
4295
4490
 
4296
4491
  <xsl:choose>
4297
- <xsl:when test="normalize-space($element) = 'block'">
4492
+ <xsl:when test="contains(normalize-space($element), 'block')">
4298
4493
  <fo:block xsl:use-attribute-sets="example-body-style">
4299
4494
  <xsl:apply-templates/>
4300
4495
  </fo:block>
@@ -4331,25 +4526,44 @@
4331
4526
  </xsl:otherwise>
4332
4527
  </xsl:choose>
4333
4528
 
4334
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
4335
- <fo:block xsl:use-attribute-sets="example-p-style">
4529
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
4530
+
4531
+ <xsl:variable name="element">
4532
+ block
4336
4533
 
4337
- <xsl:apply-templates/>
4338
- </fo:block>
4534
+ </xsl:variable>
4535
+ <xsl:choose>
4536
+ <xsl:when test="normalize-space($element) = 'block'">
4537
+ <fo:block xsl:use-attribute-sets="example-p-style">
4538
+
4539
+ <xsl:apply-templates/>
4540
+ </fo:block>
4541
+ </xsl:when>
4542
+ <xsl:otherwise>
4543
+ <fo:inline xsl:use-attribute-sets="example-p-style">
4544
+ <xsl:apply-templates/>
4545
+ </fo:inline>
4546
+ </xsl:otherwise>
4547
+ </xsl:choose>
4339
4548
  </xsl:template><xsl:template match="*[local-name() = 'termsource']">
4340
4549
  <fo:block xsl:use-attribute-sets="termsource-style">
4341
4550
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
4342
4551
  <xsl:variable name="termsource_text">
4343
4552
  <xsl:apply-templates/>
4344
4553
  </xsl:variable>
4554
+
4345
4555
  <xsl:choose>
4346
4556
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
4347
4557
  <xsl:apply-templates/>
4348
4558
  </xsl:when>
4349
- <xsl:otherwise>
4350
- <xsl:text>[</xsl:text>
4351
- <xsl:apply-templates/>
4352
- <xsl:text>]</xsl:text>
4559
+ <xsl:otherwise>
4560
+
4561
+ <xsl:text>[</xsl:text>
4562
+
4563
+ <xsl:apply-templates/>
4564
+
4565
+ <xsl:text>]</xsl:text>
4566
+
4353
4567
  </xsl:otherwise>
4354
4568
  </xsl:choose>
4355
4569
  </fo:block>
@@ -4360,10 +4574,13 @@
4360
4574
  </xsl:template><xsl:template match="*[local-name() = 'origin']">
4361
4575
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4362
4576
 
4363
- <xsl:call-template name="getTitle">
4364
- <xsl:with-param name="name" select="'title-source'"/>
4365
- </xsl:call-template>
4366
- <xsl:text>: </xsl:text>
4577
+ <fo:inline>
4578
+
4579
+ <xsl:call-template name="getTitle">
4580
+ <xsl:with-param name="name" select="'title-source'"/>
4581
+ </xsl:call-template>
4582
+ <xsl:text>: </xsl:text>
4583
+ </fo:inline>
4367
4584
 
4368
4585
  <fo:inline xsl:use-attribute-sets="origin-style">
4369
4586
  <xsl:apply-templates/>
@@ -4375,18 +4592,29 @@
4375
4592
  <xsl:if test="normalize-space() != ''">
4376
4593
  <xsl:value-of select="."/>
4377
4594
  </xsl:if>
4378
- </xsl:template><xsl:template match="*[local-name() = 'quote']">
4595
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
4596
+ <fo:block-container margin-left="0mm">
4597
+ <xsl:if test="parent::*[local-name() = 'note']">
4598
+ <xsl:if test="not(ancestor::*[local-name() = 'table'])">
4599
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
4600
+ </xsl:if>
4601
+ </xsl:if>
4602
+
4603
+ <fo:block-container margin-left="0mm">
4379
4604
 
4380
- <fo:block xsl:use-attribute-sets="quote-style">
4381
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
4382
- </fo:block>
4383
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
4384
- <fo:block xsl:use-attribute-sets="quote-source-style">
4385
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
4386
- <xsl:apply-templates select="*[local-name() = 'author']"/>
4387
- <xsl:apply-templates select="*[local-name() = 'source']"/>
4388
- </fo:block>
4389
- </xsl:if>
4605
+ <fo:block xsl:use-attribute-sets="quote-style">
4606
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
4607
+ </fo:block>
4608
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
4609
+ <fo:block xsl:use-attribute-sets="quote-source-style">
4610
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
4611
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
4612
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
4613
+ </fo:block>
4614
+ </xsl:if>
4615
+
4616
+ </fo:block-container>
4617
+ </fo:block-container>
4390
4618
  </xsl:template><xsl:template match="*[local-name() = 'source']">
4391
4619
  <xsl:if test="../*[local-name() = 'author']">
4392
4620
  <xsl:text>, </xsl:text>
@@ -4414,6 +4642,7 @@
4414
4642
  <xsl:if test="@type = 'inline'">
4415
4643
 
4416
4644
 
4645
+
4417
4646
  </xsl:if>
4418
4647
 
4419
4648
 
@@ -4451,6 +4680,7 @@
4451
4680
 
4452
4681
 
4453
4682
 
4683
+
4454
4684
  </xsl:variable>
4455
4685
 
4456
4686
  <xsl:variable name="padding-right">
@@ -4570,6 +4800,21 @@
4570
4800
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
4571
4801
  <!-- 0xA0 to space replacement -->
4572
4802
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
4803
+ </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
4804
+ <fo:block-container margin-left="0mm">
4805
+ <xsl:if test="parent::*[local-name() = 'note']">
4806
+ <xsl:attribute name="margin-left">
4807
+ <xsl:choose>
4808
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
4809
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4810
+ </xsl:choose>
4811
+ </xsl:attribute>
4812
+
4813
+ </xsl:if>
4814
+ <fo:block-container margin-left="0mm">
4815
+ <xsl:apply-templates select="." mode="ul_ol"/>
4816
+ </fo:block-container>
4817
+ </fo:block-container>
4573
4818
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
4574
4819
  <!-- <row>
4575
4820
  <date>05-07-2013</date>
@@ -4602,7 +4847,28 @@
4602
4847
  <fo:block><xsl:apply-templates/></fo:block>
4603
4848
  </fo:table-cell>
4604
4849
  </xsl:template><xsl:template name="processBibitem">
4850
+
4851
+
4605
4852
 
4853
+
4854
+ </xsl:template><xsl:template name="processBibitemDocId">
4855
+ <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
4856
+ <xsl:choose>
4857
+ <xsl:when test="normalize-space($_doc_ident) != ''">
4858
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
4859
+ <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
4860
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4861
+ </xsl:if>
4862
+ <xsl:value-of select="$_doc_ident"/>
4863
+ </xsl:when>
4864
+ <xsl:otherwise>
4865
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
4866
+ <xsl:if test="$type != ''">
4867
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4868
+ </xsl:if>
4869
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
4870
+ </xsl:otherwise>
4871
+ </xsl:choose>
4606
4872
  </xsl:template><xsl:template name="processPersonalAuthor">
4607
4873
  <xsl:choose>
4608
4874
  <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">