metanorma-plateau 1.0.6 → 1.0.8

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.
@@ -1,4 +1,4 @@
1
- <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:plateau="https://www.metanorma.org/ns/standoc" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:java="http://xml.apache.org/xalan/java" xmlns:jeuclid="http://jeuclid.sf.net/ns/ext" xmlns:barcode="http://barcode4j.krysalis.org/ns" xmlns:redirect="http://xml.apache.org/xalan/redirect" exclude-result-prefixes="java redirect" extension-element-prefixes="redirect" version="1.0">
1
+ <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:plateau="https://www.metanorma.org/ns/standoc" xmlns:mn="https://www.metanorma.org/ns/xslt" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:java="http://xml.apache.org/xalan/java" xmlns:jeuclid="http://jeuclid.sf.net/ns/ext" xmlns:barcode="http://barcode4j.krysalis.org/ns" xmlns:redirect="http://xml.apache.org/xalan/redirect" exclude-result-prefixes="java redirect" extension-element-prefixes="redirect" version="1.0">
2
2
 
3
3
  <xsl:output method="xml" encoding="UTF-8" indent="no"/>
4
4
 
@@ -41,16 +41,16 @@
41
41
  </xsl:variable>
42
42
 
43
43
  <xsl:for-each select="xalan:nodeset($current_document)"> <!-- . -->
44
- <doc num="{$num}" firstpage_id="firstpage_id_{$num}" title-part="{$docnumber}" bundle="{$bundle}"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
45
- <contents>
44
+ <mn:doc num="{$num}" firstpage_id="firstpage_id_{$num}" title-part="{$docnumber}" bundle="{$bundle}"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
45
+ <mn:contents>
46
46
  <!-- <xsl:call-template name="processPrefaceSectionsDefault_Contents"/> -->
47
47
 
48
48
  <xsl:call-template name="processMainSectionsDefault_Contents"/>
49
49
 
50
50
  <xsl:apply-templates select="//plateau:indexsect" mode="contents"/>
51
51
 
52
- </contents>
53
- </doc>
52
+ </mn:contents>
53
+ </mn:doc>
54
54
  </xsl:for-each>
55
55
  </xsl:for-each>
56
56
  </xsl:variable>
@@ -504,8 +504,8 @@
504
504
  <xsl:attribute name="font-weight">normal</xsl:attribute>
505
505
  <xsl:attribute name="line-height">1.2</xsl:attribute>
506
506
  </xsl:if>
507
- <xsl:if test="$contents/doc[@num = $num]//item[@display = 'true']">
508
- <xsl:for-each select="$contents/doc[@num = $num]//item[@display = 'true'][@level &lt;= $toc_level or @type='figure' or @type = 'table']">
507
+ <xsl:if test="$contents/mn:doc[@num = $num]//mn:item[@display = 'true']">
508
+ <xsl:for-each select="$contents/mn:doc[@num = $num]//mn:item[@display = 'true'][@level &lt;= $toc_level or @type='figure' or @type = 'table']">
509
509
  <fo:block role="TOCI">
510
510
  <xsl:choose>
511
511
  <xsl:when test="$doctype = 'technical-report'">
@@ -598,12 +598,12 @@
598
598
  <xsl:template name="insertTocItem">
599
599
  <xsl:param name="printSection">false</xsl:param>
600
600
  <fo:block text-align-last="justify" role="TOCI">
601
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
601
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{mn:title}">
602
602
  <xsl:if test="$printSection = 'true' and @section != ''">
603
603
  <xsl:value-of select="@section"/>
604
604
  <xsl:text>. </xsl:text>
605
605
  </xsl:if>
606
- <fo:inline><xsl:apply-templates select="title"/><xsl:text> </xsl:text></fo:inline>
606
+ <fo:inline><xsl:apply-templates select="mn:title"/><xsl:text> </xsl:text></fo:inline>
607
607
  <fo:inline keep-together.within-line="always">
608
608
  <fo:leader leader-pattern="dots"/>
609
609
  <fo:inline>
@@ -864,19 +864,19 @@
864
864
  <xsl:if test="ancestor-or-self::plateau:annex">annex</xsl:if>
865
865
  </xsl:variable>
866
866
 
867
- <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}" display="{$display}">
867
+ <mn:item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}" display="{$display}">
868
868
  <xsl:if test="$type = 'index'">
869
869
  <xsl:attribute name="level">1</xsl:attribute>
870
870
  </xsl:if>
871
- <title>
871
+ <mn:title>
872
872
  <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item">
873
873
  <xsl:with-param name="mode">contents</xsl:with-param>
874
874
  </xsl:apply-templates>
875
- </title>
875
+ </mn:title>
876
876
  <xsl:if test="$type != 'index'">
877
877
  <xsl:apply-templates mode="contents"/>
878
878
  </xsl:if>
879
- </item>
879
+ </mn:item>
880
880
  </xsl:if>
881
881
  </xsl:template>
882
882
 
@@ -1612,7 +1612,7 @@
1612
1612
  </xsl:template>
1613
1613
 
1614
1614
  <!-- for $contents -->
1615
- <xsl:template match="title/text()">
1615
+ <xsl:template match="mn:title/text()">
1616
1616
  <xsl:variable name="regex_en_contents">([^\u3000-\u9FFF\uF900-\uFFFF\(\)]{1,})</xsl:variable>
1617
1617
  <xsl:variable name="text_en_" select="java:replaceAll(java:java.lang.String.new(.), $regex_en_contents, concat($tag_font_en_bold_open,'$1',$tag_font_en_bold_close))"/>
1618
1618
  <xsl:variable name="text_en">
@@ -2003,34 +2003,25 @@
2003
2003
  </svg>
2004
2004
  </xsl:variable>
2005
2005
 
2006
- <!-- <xsl:strip-space elements="plateau:xref"/> -->
2006
+ <!-- https://www.metanorma.org/ns/standoc -->
2007
+ <xsl:variable name="namespace_full" select="namespace-uri(//*[local-name() = 'metanorma'][1])"/>
2007
2008
 
2008
- <xsl:variable name="namespace_full_">
2009
- <xsl:choose>
2010
- <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="namespace-uri(//*[local-name() = 'metanorma'][1])"/></xsl:when>
2011
- <xsl:otherwise><xsl:value-of select="namespace-uri(/*)"/></xsl:otherwise><!-- example: https://www.metanorma.org/ns/standoc -->
2012
- </xsl:choose>
2013
- </xsl:variable>
2014
- <xsl:variable name="namespace_full" select="normalize-space($namespace_full_)"/>
2009
+ <!-- https://www.metanorma.org/ns/xsl -->
2010
+ <xsl:variable name="namespace_mn_xsl">https://www.metanorma.org/ns/xslt</xsl:variable>
2015
2011
 
2016
- <xsl:variable name="root_element_">
2017
- <xsl:choose>
2018
- <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="local-name(//*[local-name() = 'metanorma'][1])"/></xsl:when>
2019
- <xsl:otherwise><xsl:value-of select="local-name(/*)"/></xsl:otherwise><!-- example: metanorma (former iso-standard) -->
2020
- </xsl:choose>
2021
- </xsl:variable>
2022
- <xsl:variable name="root_element" select="normalize-space($root_element_)"/>
2012
+ <xsl:variable name="root_element">metanorma</xsl:variable>
2023
2013
 
2014
+ <!---examples: 2013, 2024 -->
2024
2015
  <xsl:variable name="document_scheme" select="normalize-space(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'document-scheme']/*[local-name() = 'value'])"/>
2025
2016
 
2026
2017
  <!-- external parameters -->
2027
-
2028
2018
  <xsl:param name="svg_images"/> <!-- svg images array -->
2029
2019
  <xsl:variable name="images" select="document($svg_images)"/>
2030
2020
  <xsl:param name="basepath"/> <!-- base path for images -->
2031
2021
  <xsl:param name="inputxml_basepath"/> <!-- input xml file path -->
2032
2022
  <xsl:param name="inputxml_filename"/> <!-- input xml file name -->
2033
2023
  <xsl:param name="output_path"/> <!-- output PDF file name -->
2024
+ <xsl:param name="outputpdf_basepath"/> <!-- output PDF folder -->
2034
2025
  <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
2035
2026
  <xsl:param name="syntax-highlight">false</xsl:param> <!-- syntax highlighting feature, default - off -->
2036
2027
  <xsl:param name="add_math_as_text">true</xsl:param> <!-- add math in text behind svg formula, to copy-paste formula from PDF as text -->
@@ -2077,20 +2068,13 @@
2077
2068
 
2078
2069
  <xsl:param name="table_if_debug">false</xsl:param> <!-- set 'true' to put debug width data before table or dl -->
2079
2070
 
2080
- <xsl:variable name="isApplyAutolayoutAlgorithm_">
2081
- true
2071
+ <!-- don't remove and rename this variable, it's using in mn2pdf tool -->
2072
+ <xsl:variable name="isApplyAutolayoutAlgorithm_">true
2082
2073
  </xsl:variable>
2083
2074
  <xsl:variable name="isApplyAutolayoutAlgorithm" select="normalize-space($isApplyAutolayoutAlgorithm_)"/>
2084
2075
 
2085
- <xsl:variable name="isGenerateTableIF_">
2086
- <xsl:choose>
2087
- <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
2088
- <xsl:value-of select="normalize-space($table_if) = 'true'"/>
2089
- </xsl:when>
2090
- <xsl:otherwise>false</xsl:otherwise>
2091
- </xsl:choose>
2092
- </xsl:variable>
2093
- <xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/>
2076
+ <xsl:variable name="isGenerateTableIF"><xsl:value-of select="$table_if"/></xsl:variable>
2077
+ <!-- <xsl:variable name="isGenerateTableIF" select="normalize-space(normalize-space($table_if) = 'true' and 1 = 1)"/> -->
2094
2078
 
2095
2079
  <xsl:variable name="lang">
2096
2080
  <xsl:call-template name="getLang"/>
@@ -2142,8 +2126,7 @@
2142
2126
  <xsl:variable name="pageWidth_">
2143
2127
  <xsl:choose>
2144
2128
  <xsl:when test="$papersize_width != ''"><xsl:value-of select="$papersize_width"/></xsl:when>
2145
- <xsl:otherwise>
2146
- 210
2129
+ <xsl:otherwise>210
2147
2130
  </xsl:otherwise>
2148
2131
  </xsl:choose>
2149
2132
  </xsl:variable>
@@ -2153,8 +2136,7 @@
2153
2136
  <xsl:variable name="pageHeight_">
2154
2137
  <xsl:choose>
2155
2138
  <xsl:when test="$papersize_height != ''"><xsl:value-of select="$papersize_height"/></xsl:when>
2156
- <xsl:otherwise>
2157
- 297
2139
+ <xsl:otherwise>297
2158
2140
  </xsl:otherwise>
2159
2141
  </xsl:choose>
2160
2142
  </xsl:variable>
@@ -2164,41 +2146,37 @@
2164
2146
  <!-- marginLeftRight1 and marginLeftRight2 - is left or right margin depends on odd/even page,
2165
2147
  for example, left margin on odd page and right margin on even page -->
2166
2148
  <xsl:variable name="marginLeftRight1_">
2167
-
2168
- <xsl:choose>
2169
- <xsl:when test="$doctype = 'technical-report'">19.5</xsl:when>
2170
- <xsl:otherwise>15.4</xsl:otherwise> <!-- handbook -->
2171
- </xsl:choose>
2149
+ <xsl:choose>
2150
+ <xsl:when test="$doctype = 'technical-report'">19.5</xsl:when>
2151
+ <xsl:otherwise>15.4</xsl:otherwise> <!-- handbook -->
2152
+ </xsl:choose>
2172
2153
 
2173
2154
  </xsl:variable>
2174
2155
  <xsl:variable name="marginLeftRight1" select="normalize-space($marginLeftRight1_)"/>
2175
2156
 
2176
2157
  <xsl:variable name="marginLeftRight2_">
2177
-
2178
- <xsl:choose>
2179
- <xsl:when test="$doctype = 'technical-report'">18</xsl:when>
2180
- <xsl:otherwise>15.4</xsl:otherwise> <!-- handbook -->
2181
- </xsl:choose>
2158
+ <xsl:choose>
2159
+ <xsl:when test="$doctype = 'technical-report'">18</xsl:when>
2160
+ <xsl:otherwise>15.4</xsl:otherwise> <!-- handbook -->
2161
+ </xsl:choose>
2182
2162
 
2183
2163
  </xsl:variable>
2184
2164
  <xsl:variable name="marginLeftRight2" select="normalize-space($marginLeftRight2_)"/>
2185
2165
 
2186
2166
  <xsl:variable name="marginTop_">
2187
-
2188
- <xsl:choose>
2189
- <xsl:when test="$doctype = 'technical-report'">26</xsl:when>
2190
- <xsl:otherwise>16</xsl:otherwise> <!-- handbook -->
2191
- </xsl:choose>
2167
+ <xsl:choose>
2168
+ <xsl:when test="$doctype = 'technical-report'">26</xsl:when>
2169
+ <xsl:otherwise>16</xsl:otherwise> <!-- handbook -->
2170
+ </xsl:choose>
2192
2171
 
2193
2172
  </xsl:variable>
2194
2173
  <xsl:variable name="marginTop" select="normalize-space($marginTop_)"/>
2195
2174
 
2196
2175
  <xsl:variable name="marginBottom_">
2197
-
2198
- <xsl:choose>
2199
- <xsl:when test="$doctype = 'technical-report'">26</xsl:when>
2200
- <xsl:otherwise>32</xsl:otherwise> <!-- handbook -->
2201
- </xsl:choose>
2176
+ <xsl:choose>
2177
+ <xsl:when test="$doctype = 'technical-report'">26</xsl:when>
2178
+ <xsl:otherwise>32</xsl:otherwise> <!-- handbook -->
2179
+ </xsl:choose>
2202
2180
 
2203
2181
  </xsl:variable>
2204
2182
  <xsl:variable name="marginBottom" select="normalize-space($marginBottom_)"/>
@@ -2248,13 +2226,10 @@
2248
2226
  <title-toc lang="zh">目次</title-toc>
2249
2227
 
2250
2228
  <title-part lang="en">
2251
-
2252
2229
  </title-part>
2253
2230
  <title-part lang="fr">
2254
-
2255
2231
  </title-part>
2256
2232
  <title-part lang="ru">
2257
-
2258
2233
  </title-part>
2259
2234
  <title-part lang="zh">第 # 部分:</title-part>
2260
2235
 
@@ -2308,6 +2283,7 @@
2308
2283
  <xsl:variable name="hair_space"> </xsl:variable>
2309
2284
  <xsl:variable name="en_dash">–</xsl:variable>
2310
2285
  <xsl:variable name="em_dash">—</xsl:variable>
2286
+ <xsl:variable name="nonbreak_space_em_dash_space"> — </xsl:variable>
2311
2287
  <xsl:variable name="cr">&#13;</xsl:variable>
2312
2288
  <xsl:variable name="lf">
2313
2289
  </xsl:variable>
@@ -2349,11 +2325,9 @@
2349
2325
  <xsl:variable name="font_noto_sans_mono">Noto Sans Mono, Noto Sans Mono CJK HK, Noto Sans Mono CJK JP, Noto Sans Mono CJK KR, Noto Sans Mono CJK SC, Noto Sans Mono CJK TC</xsl:variable>
2350
2326
  <xsl:variable name="font_noto_serif">Noto Serif, Noto Serif HK, Noto Serif JP, Noto Serif KR, Noto Serif SC, Noto Serif TC</xsl:variable>
2351
2327
  <xsl:attribute-set name="root-style">
2352
-
2353
- <xsl:attribute name="font-family">Yu Gothic, STIX Two Math, <xsl:value-of select="$font_noto_sans"/></xsl:attribute>
2354
- <xsl:attribute name="font-family-generic">Sans</xsl:attribute>
2355
- <xsl:attribute name="font-size">10.5pt</xsl:attribute>
2356
-
2328
+ <xsl:attribute name="font-family">Yu Gothic, STIX Two Math, <xsl:value-of select="$font_noto_sans"/></xsl:attribute>
2329
+ <xsl:attribute name="font-family-generic">Sans</xsl:attribute>
2330
+ <xsl:attribute name="font-size">10.5pt</xsl:attribute>
2357
2331
  </xsl:attribute-set> <!-- root-style -->
2358
2332
 
2359
2333
  <xsl:template name="insertRootStyle">
@@ -2441,28 +2415,22 @@
2441
2415
 
2442
2416
  <!-- Preface sections styles -->
2443
2417
  <xsl:attribute-set name="copyright-statement-style">
2444
-
2445
2418
  </xsl:attribute-set> <!-- copyright-statement-style -->
2446
2419
 
2447
2420
  <xsl:attribute-set name="copyright-statement-title-style">
2448
-
2449
2421
  </xsl:attribute-set> <!-- copyright-statement-title-style -->
2450
2422
 
2451
2423
  <xsl:attribute-set name="copyright-statement-p-style">
2452
-
2453
2424
  </xsl:attribute-set> <!-- copyright-statement-p-style -->
2454
2425
 
2455
2426
  <xsl:attribute-set name="license-statement-style">
2456
-
2457
2427
  </xsl:attribute-set>
2458
2428
 
2459
2429
  <xsl:attribute-set name="license-statement-title-style">
2460
2430
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2461
-
2462
2431
  </xsl:attribute-set> <!-- license-statement-title-style -->
2463
2432
 
2464
2433
  <xsl:attribute-set name="license-statement-p-style">
2465
-
2466
2434
  </xsl:attribute-set> <!-- license-statement-p-style -->
2467
2435
 
2468
2436
  <xsl:attribute-set name="legal-statement-style">
@@ -2471,80 +2439,63 @@
2471
2439
 
2472
2440
  <xsl:attribute-set name="legal-statement-title-style">
2473
2441
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2474
-
2475
2442
  </xsl:attribute-set> <!-- legal-statement-title-style -->
2476
2443
 
2477
2444
  <xsl:attribute-set name="legal-statement-p-style">
2478
-
2479
2445
  </xsl:attribute-set> <!-- legal-statement-p-style -->
2480
2446
 
2481
2447
  <xsl:attribute-set name="feedback-statement-style">
2482
-
2483
2448
  </xsl:attribute-set> <!-- feedback-statement-style -->
2484
2449
 
2485
2450
  <xsl:attribute-set name="feedback-statement-title-style">
2486
2451
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2487
-
2488
2452
  </xsl:attribute-set> <!-- feedback-statement-title-style -->
2489
2453
 
2490
2454
  <xsl:attribute-set name="feedback-statement-p-style">
2491
-
2492
2455
  </xsl:attribute-set> <!-- feedback-statement-p-style -->
2493
2456
 
2494
2457
  <!-- End Preface sections styles -->
2495
2458
 
2496
2459
  <xsl:attribute-set name="link-style">
2497
-
2498
2460
  </xsl:attribute-set>
2499
2461
 
2500
2462
  <xsl:template name="refine_link-style">
2501
-
2502
2463
  </xsl:template> <!-- refine_link-style -->
2503
2464
 
2504
2465
  <xsl:attribute-set name="sourcecode-container-style">
2505
-
2506
2466
  </xsl:attribute-set>
2507
2467
 
2508
2468
  <xsl:attribute-set name="sourcecode-style">
2509
2469
  <xsl:attribute name="white-space">pre</xsl:attribute>
2510
2470
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
2511
2471
  <xsl:attribute name="role">Code</xsl:attribute>
2512
-
2513
2472
  </xsl:attribute-set>
2514
2473
 
2515
2474
  <xsl:template name="refine_sourcecode-style">
2516
-
2517
2475
  </xsl:template> <!-- refine_sourcecode-style -->
2518
2476
 
2519
2477
  <xsl:attribute-set name="pre-style">
2520
2478
  <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
2521
2479
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2522
-
2523
2480
  </xsl:attribute-set>
2524
2481
 
2525
2482
  <xsl:attribute-set name="permission-style">
2526
-
2527
2483
  </xsl:attribute-set>
2528
2484
 
2529
2485
  <xsl:attribute-set name="permission-name-style">
2530
-
2531
2486
  </xsl:attribute-set>
2532
2487
 
2533
2488
  <xsl:attribute-set name="permission-label-style">
2534
-
2535
2489
  </xsl:attribute-set>
2536
2490
 
2537
2491
  <xsl:attribute-set name="requirement-style">
2538
-
2539
2492
  </xsl:attribute-set>
2540
2493
 
2541
2494
  <xsl:attribute-set name="requirement-name-style">
2542
2495
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2543
-
2544
2496
  </xsl:attribute-set>
2545
2497
 
2546
2498
  <xsl:attribute-set name="requirement-label-style">
2547
-
2548
2499
  </xsl:attribute-set>
2549
2500
 
2550
2501
  <xsl:attribute-set name="subject-style">
@@ -2572,127 +2523,98 @@
2572
2523
  </xsl:attribute-set>
2573
2524
 
2574
2525
  <xsl:attribute-set name="recommendation-style">
2575
-
2576
2526
  </xsl:attribute-set>
2577
2527
 
2578
2528
  <xsl:attribute-set name="recommendation-name-style">
2579
-
2580
2529
  </xsl:attribute-set>
2581
2530
 
2582
2531
  <xsl:attribute-set name="recommendation-label-style">
2583
-
2584
2532
  </xsl:attribute-set>
2585
2533
 
2586
2534
  <xsl:attribute-set name="termexample-style">
2587
-
2588
- <xsl:attribute name="margin-top">4pt</xsl:attribute>
2589
- <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
2590
-
2535
+ <xsl:attribute name="margin-top">4pt</xsl:attribute>
2536
+ <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
2591
2537
  </xsl:attribute-set>
2592
2538
 
2593
2539
  <xsl:template name="refine_termexample-style">
2594
-
2595
2540
  </xsl:template>
2596
2541
 
2597
2542
  <xsl:attribute-set name="example-style">
2598
-
2599
- <xsl:attribute name="margin-top">4pt</xsl:attribute>
2600
- <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
2601
-
2543
+ <xsl:attribute name="margin-top">4pt</xsl:attribute>
2544
+ <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
2602
2545
  </xsl:attribute-set> <!-- example-style -->
2603
2546
 
2604
2547
  <xsl:template name="refine_example-style">
2605
-
2606
2548
  </xsl:template> <!-- refine_example-style -->
2607
2549
 
2608
2550
  <xsl:attribute-set name="example-body-style">
2609
-
2610
2551
  </xsl:attribute-set> <!-- example-body-style -->
2611
2552
 
2612
2553
  <xsl:attribute-set name="example-name-style">
2613
-
2614
2554
  </xsl:attribute-set> <!-- example-name-style -->
2615
2555
 
2616
2556
  <xsl:template name="refine_example-name-style">
2617
-
2618
- <xsl:if test="ancestor::*[local-name() = 'figure']">
2619
- <xsl:attribute name="font-weight">bold</xsl:attribute>
2620
- </xsl:if>
2621
-
2557
+ <xsl:if test="ancestor::*[local-name() = 'figure']">
2558
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2559
+ </xsl:if>
2622
2560
  </xsl:template>
2623
2561
 
2624
2562
  <xsl:attribute-set name="example-p-style">
2625
-
2626
- <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
2563
+ <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
2627
2564
 
2628
2565
  </xsl:attribute-set> <!-- example-p-style -->
2629
2566
 
2630
2567
  <xsl:template name="refine_example-p-style">
2631
-
2632
2568
  </xsl:template> <!-- refine_example-p-style -->
2633
2569
 
2634
2570
  <xsl:attribute-set name="termexample-name-style">
2635
-
2636
2571
  </xsl:attribute-set> <!-- termexample-name-style -->
2637
2572
 
2638
2573
  <xsl:template name="refine_termexample-name-style">
2639
-
2640
2574
  </xsl:template>
2641
2575
 
2642
2576
  <!-- ========================== -->
2643
2577
  <!-- Table styles -->
2644
2578
  <!-- ========================== -->
2645
- <xsl:variable name="table-border_">
2646
-
2647
- 1pt solid black
2579
+ <xsl:variable name="table-border_">1pt solid black
2648
2580
  </xsl:variable>
2649
2581
  <xsl:variable name="table-border" select="normalize-space($table-border_)"/>
2650
2582
 
2651
- <xsl:variable name="table-cell-border_">
2652
-
2653
- 0.5pt solid black
2583
+ <xsl:variable name="table-cell-border_">0.5pt solid black
2654
2584
  </xsl:variable>
2655
2585
  <xsl:variable name="table-cell-border" select="normalize-space($table-cell-border_)"/>
2656
2586
 
2657
2587
  <xsl:attribute-set name="table-container-style">
2658
2588
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2659
2589
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
2660
-
2661
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2662
- <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
2663
-
2590
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2591
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
2664
2592
  </xsl:attribute-set> <!-- table-container-style -->
2665
2593
 
2666
2594
  <xsl:template name="refine_table-container-style">
2667
2595
  <xsl:param name="margin-side"/>
2668
-
2669
2596
  <!-- end table block-container attributes -->
2670
2597
  </xsl:template> <!-- refine_table-container-style -->
2671
2598
 
2672
2599
  <xsl:attribute-set name="table-style">
2673
2600
  <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
2674
2601
  <xsl:attribute name="table-layout">fixed</xsl:attribute>
2675
-
2676
- <xsl:attribute name="border"><xsl:value-of select="$table-border"/></xsl:attribute>
2677
-
2602
+ <xsl:attribute name="border"><xsl:value-of select="$table-border"/></xsl:attribute>
2678
2603
  </xsl:attribute-set><!-- table-style -->
2679
2604
 
2680
2605
  <xsl:template name="refine_table-style">
2681
2606
  <xsl:param name="margin-side"/>
2682
2607
 
2683
2608
  <xsl:call-template name="setBordersTableArray"/>
2684
-
2685
2609
  </xsl:template> <!-- refine_table-style -->
2686
2610
 
2687
2611
  <xsl:attribute-set name="table-name-style">
2688
2612
  <xsl:attribute name="role">Caption</xsl:attribute>
2689
2613
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2690
-
2691
- <xsl:attribute name="font-weight">bold</xsl:attribute>
2692
- <xsl:attribute name="text-align">center</xsl:attribute>
2693
- <xsl:attribute name="margin-top">20pt</xsl:attribute>
2694
- <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
2695
-
2614
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2615
+ <xsl:attribute name="text-align">center</xsl:attribute>
2616
+ <xsl:attribute name="margin-top">20pt</xsl:attribute>
2617
+ <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
2696
2618
  </xsl:attribute-set> <!-- table-name-style -->
2697
2619
 
2698
2620
  <xsl:template name="refine_table-name-style">
@@ -2700,41 +2622,32 @@
2700
2622
  <xsl:if test="$continued = 'true'">
2701
2623
  <xsl:attribute name="role">SKIP</xsl:attribute>
2702
2624
  </xsl:if>
2703
-
2704
- <xsl:if test="$doctype = 'technical-report'">
2705
- <xsl:attribute name="font-weight">normal</xsl:attribute>
2706
- </xsl:if>
2707
-
2625
+ <xsl:if test="$doctype = 'technical-report'">
2626
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
2627
+ </xsl:if>
2708
2628
  </xsl:template> <!-- refine_table-name-style -->
2709
2629
 
2710
2630
  <xsl:attribute-set name="table-row-style">
2711
2631
  <xsl:attribute name="min-height">4mm</xsl:attribute>
2712
-
2713
2632
  </xsl:attribute-set>
2714
2633
 
2715
2634
  <xsl:attribute-set name="table-header-row-style" use-attribute-sets="table-row-style">
2716
2635
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2717
-
2718
- <xsl:attribute name="border-top"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2719
- <xsl:attribute name="border-bottom"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2720
-
2636
+ <xsl:attribute name="border-top"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2637
+ <xsl:attribute name="border-bottom"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2721
2638
  </xsl:attribute-set>
2722
2639
 
2723
2640
  <xsl:template name="refine_table-header-row-style">
2724
2641
 
2725
2642
  <xsl:call-template name="setBordersTableArray"/>
2726
-
2727
2643
  </xsl:template> <!-- refine_table-header-row-style -->
2728
2644
 
2729
2645
  <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
2730
-
2731
- <xsl:attribute name="border-left"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2732
- <xsl:attribute name="border-right"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2733
-
2646
+ <xsl:attribute name="border-left"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2647
+ <xsl:attribute name="border-right"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2734
2648
  </xsl:attribute-set>
2735
2649
 
2736
2650
  <xsl:template name="refine_table-footer-row-style">
2737
-
2738
2651
  </xsl:template> <!-- refine_table-footer-row-style -->
2739
2652
 
2740
2653
  <xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
@@ -2744,7 +2657,6 @@
2744
2657
  <xsl:template name="refine_table-body-row-style">
2745
2658
 
2746
2659
  <xsl:call-template name="setBordersTableArray"/>
2747
-
2748
2660
  </xsl:template> <!-- refine_table-body-row-style -->
2749
2661
 
2750
2662
  <xsl:attribute-set name="table-header-cell-style">
@@ -2752,12 +2664,10 @@
2752
2664
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
2753
2665
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2754
2666
  <xsl:attribute name="display-align">center</xsl:attribute>
2755
-
2756
- <xsl:attribute name="font-weight">normal</xsl:attribute>
2757
- <xsl:attribute name="border"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2758
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2759
- <xsl:attribute name="background-color">rgb(206,206,206)</xsl:attribute>
2760
-
2667
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
2668
+ <xsl:attribute name="border"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2669
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2670
+ <xsl:attribute name="background-color">rgb(206,206,206)</xsl:attribute>
2761
2671
  </xsl:attribute-set> <!-- table-header-cell-style -->
2762
2672
 
2763
2673
  <xsl:template name="refine_table-header-cell-style">
@@ -2769,17 +2679,14 @@
2769
2679
  </xsl:if>
2770
2680
 
2771
2681
  <xsl:call-template name="setTableCellAttributes"/>
2772
-
2773
2682
  </xsl:template> <!-- refine_table-header-cell-style -->
2774
2683
 
2775
2684
  <xsl:attribute-set name="table-cell-style">
2776
2685
  <xsl:attribute name="display-align">center</xsl:attribute>
2777
2686
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
2778
2687
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2779
-
2780
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2781
- <xsl:attribute name="border"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2782
-
2688
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2689
+ <xsl:attribute name="border"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2783
2690
  </xsl:attribute-set> <!-- table-cell-style -->
2784
2691
 
2785
2692
  <xsl:template name="refine_table-cell-style">
@@ -2788,8 +2695,6 @@
2788
2695
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2789
2696
  </xsl:if>
2790
2697
 
2791
- <!-- bsi -->
2792
-
2793
2698
  <xsl:call-template name="setBordersTableArray"/>
2794
2699
 
2795
2700
  </xsl:template> <!-- refine_table-cell-style -->
@@ -2799,74 +2704,56 @@
2799
2704
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
2800
2705
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2801
2706
  <xsl:attribute name="padding-top">1mm</xsl:attribute>
2802
-
2803
- <xsl:attribute name="border"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2804
- <xsl:attribute name="border-top">solid black 0pt</xsl:attribute>
2805
-
2707
+ <xsl:attribute name="border"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2708
+ <xsl:attribute name="border-top">solid black 0pt</xsl:attribute>
2806
2709
  </xsl:attribute-set> <!-- table-footer-cell-style -->
2807
2710
 
2808
2711
  <xsl:template name="refine_table-footer-cell-style">
2809
-
2810
2712
  </xsl:template> <!-- refine_table-footer-cell-style -->
2811
2713
 
2812
2714
  <xsl:attribute-set name="table-note-style">
2813
2715
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2814
2716
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2815
-
2816
- <xsl:attribute name="font-size">inherit</xsl:attribute>
2817
- <xsl:attribute name="margin-bottom">1pt</xsl:attribute>
2818
-
2717
+ <xsl:attribute name="font-size">inherit</xsl:attribute>
2718
+ <xsl:attribute name="margin-bottom">1pt</xsl:attribute>
2819
2719
  </xsl:attribute-set><!-- table-note-style -->
2820
2720
 
2821
2721
  <xsl:template name="refine_table-note-style">
2822
-
2823
- <xsl:attribute name="margin-left"><xsl:value-of select="$tableAnnotationIndent"/></xsl:attribute>
2824
-
2722
+ <xsl:attribute name="margin-left"><xsl:value-of select="$tableAnnotationIndent"/></xsl:attribute>
2825
2723
  </xsl:template> <!-- refine_table-note-style -->
2826
2724
 
2827
2725
  <xsl:attribute-set name="table-fn-style">
2828
2726
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2829
-
2830
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2831
- <xsl:attribute name="margin-bottom">1pt</xsl:attribute>
2832
-
2727
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2728
+ <xsl:attribute name="margin-bottom">1pt</xsl:attribute>
2833
2729
  </xsl:attribute-set> <!-- table-fn-style -->
2834
2730
 
2835
2731
  <xsl:template name="refine_table-fn-style">
2836
-
2837
- <xsl:attribute name="margin-left"><xsl:value-of select="$tableAnnotationIndent"/></xsl:attribute>
2838
-
2732
+ <xsl:attribute name="margin-left"><xsl:value-of select="$tableAnnotationIndent"/></xsl:attribute>
2839
2733
  </xsl:template>
2840
2734
 
2841
2735
  <xsl:attribute-set name="table-fn-number-style">
2842
2736
  <!-- <xsl:attribute name="padding-right">5mm</xsl:attribute> -->
2843
-
2844
- <xsl:attribute name="font-size">100%</xsl:attribute>
2845
- <!-- <xsl:attribute name="padding-right">2mm</xsl:attribute> -->
2846
- <xsl:attribute name="font-weight">bold</xsl:attribute>
2847
-
2737
+ <xsl:attribute name="font-size">100%</xsl:attribute>
2738
+ <!-- <xsl:attribute name="padding-right">2mm</xsl:attribute> -->
2739
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2848
2740
  </xsl:attribute-set> <!-- table-fn-number-style -->
2849
2741
 
2850
2742
  <xsl:attribute-set name="table-fmt-fn-label-style">
2851
2743
  <xsl:attribute name="font-size">80%</xsl:attribute>
2852
-
2853
- <xsl:attribute name="font-size">60%</xsl:attribute>
2854
- <xsl:attribute name="vertical-align">super</xsl:attribute>
2855
-
2744
+ <xsl:attribute name="font-size">60%</xsl:attribute>
2745
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
2856
2746
  </xsl:attribute-set> <!-- table-fmt-fn-label-style -->
2857
2747
 
2858
2748
  <xsl:template name="refine_table-fmt-fn-label-style">
2859
-
2860
2749
  </xsl:template>
2861
2750
 
2862
2751
  <xsl:attribute-set name="fn-container-body-style">
2863
2752
  <xsl:attribute name="text-indent">0</xsl:attribute>
2864
2753
  <xsl:attribute name="start-indent">0</xsl:attribute>
2865
-
2866
2754
  </xsl:attribute-set>
2867
2755
 
2868
2756
  <xsl:attribute-set name="table-fn-body-style">
2869
-
2870
2757
  </xsl:attribute-set>
2871
2758
 
2872
2759
  <xsl:attribute-set name="figure-fn-number-style">
@@ -2876,20 +2763,16 @@
2876
2763
  <xsl:attribute-set name="figure-fmt-fn-label-style">
2877
2764
  <xsl:attribute name="font-size">80%</xsl:attribute>
2878
2765
  <xsl:attribute name="vertical-align">super</xsl:attribute>
2879
-
2880
- <xsl:attribute name="font-size">60%</xsl:attribute>
2881
- <xsl:attribute name="vertical-align">super</xsl:attribute>
2882
-
2766
+ <xsl:attribute name="font-size">60%</xsl:attribute>
2767
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
2883
2768
  </xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
2884
2769
 
2885
2770
  <xsl:template name="refine_figure-fmt-fn-label-style">
2886
-
2887
2771
  </xsl:template>
2888
2772
 
2889
2773
  <xsl:attribute-set name="figure-fn-body-style">
2890
2774
  <xsl:attribute name="text-align">justify</xsl:attribute>
2891
2775
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2892
-
2893
2776
  </xsl:attribute-set>
2894
2777
  <!-- ========================== -->
2895
2778
  <!-- END Table styles -->
@@ -2900,45 +2783,35 @@
2900
2783
  <!-- ========================== -->
2901
2784
 
2902
2785
  <xsl:attribute-set name="dl-block-style">
2903
-
2904
- <xsl:attribute name="margin-bottom">16pt</xsl:attribute>
2905
-
2786
+ <xsl:attribute name="margin-bottom">16pt</xsl:attribute>
2906
2787
  </xsl:attribute-set>
2907
2788
 
2908
2789
  <xsl:attribute-set name="dt-row-style">
2909
-
2910
2790
  </xsl:attribute-set>
2911
2791
 
2912
2792
  <xsl:attribute-set name="dt-cell-style">
2913
-
2914
2793
  </xsl:attribute-set>
2915
2794
 
2916
2795
  <xsl:template name="refine_dt-cell-style">
2917
-
2918
2796
  </xsl:template> <!-- refine_dt-cell-style -->
2919
2797
 
2920
2798
  <xsl:attribute-set name="dt-block-style">
2921
2799
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
2922
-
2923
2800
  </xsl:attribute-set>
2924
2801
 
2925
2802
  <xsl:template name="refine_dt-block-style">
2926
-
2927
2803
  </xsl:template> <!-- refine_dt-block-style -->
2928
2804
 
2929
2805
  <xsl:attribute-set name="dl-name-style">
2930
2806
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2931
2807
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2932
-
2933
2808
  </xsl:attribute-set> <!-- dl-name-style -->
2934
2809
 
2935
2810
  <xsl:attribute-set name="dd-cell-style">
2936
2811
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
2937
-
2938
2812
  </xsl:attribute-set>
2939
2813
 
2940
2814
  <xsl:template name="refine_dd-cell-style">
2941
-
2942
2815
  </xsl:template> <!-- refine_dd-cell-style -->
2943
2816
 
2944
2817
  <!-- ========================== -->
@@ -2946,236 +2819,179 @@
2946
2819
  <!-- ========================== -->
2947
2820
 
2948
2821
  <xsl:attribute-set name="appendix-style">
2949
-
2950
2822
  </xsl:attribute-set>
2951
2823
 
2952
2824
  <xsl:attribute-set name="appendix-example-style">
2953
-
2954
2825
  </xsl:attribute-set>
2955
2826
 
2956
2827
  <xsl:attribute-set name="xref-style">
2957
-
2958
2828
  </xsl:attribute-set>
2959
2829
 
2960
2830
  <xsl:attribute-set name="eref-style">
2961
-
2962
2831
  </xsl:attribute-set>
2963
2832
 
2964
2833
  <xsl:template name="refine_eref-style">
2965
2834
  <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
2966
2835
  <xsl:variable name="text" select="normalize-space()"/>
2967
-
2968
2836
  </xsl:template> <!-- refine_eref-style -->
2969
2837
 
2970
2838
  <xsl:attribute-set name="note-style">
2971
-
2972
- <xsl:attribute name="text-indent">0mm</xsl:attribute>
2973
- <xsl:attribute name="space-before">2pt</xsl:attribute>
2974
-
2839
+ <xsl:attribute name="text-indent">0mm</xsl:attribute>
2840
+ <xsl:attribute name="space-before">2pt</xsl:attribute>
2975
2841
  </xsl:attribute-set>
2976
2842
 
2977
2843
  <xsl:template name="refine_note-style">
2978
-
2979
2844
  </xsl:template>
2980
2845
 
2981
2846
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
2982
2847
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
2983
2848
 
2984
2849
  <xsl:attribute-set name="note-name-style">
2985
-
2986
2850
  </xsl:attribute-set>
2987
2851
 
2988
2852
  <xsl:template name="refine_note-name-style">
2989
-
2990
- <xsl:if test="ancestor::*[local-name() = 'figure']">
2991
- <xsl:attribute name="font-weight">bold</xsl:attribute>
2992
- </xsl:if>
2993
-
2853
+ <xsl:if test="ancestor::*[local-name() = 'figure']">
2854
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2855
+ </xsl:if>
2994
2856
  </xsl:template> <!-- refine_note-name-style -->
2995
2857
 
2996
2858
  <xsl:attribute-set name="table-note-name-style">
2997
2859
  <xsl:attribute name="padding-right">2mm</xsl:attribute>
2998
-
2999
2860
  </xsl:attribute-set>
3000
2861
 
3001
2862
  <xsl:template name="refine_table-note-name-style">
3002
-
3003
- <xsl:attribute name="font-weight">bold</xsl:attribute>
3004
-
2863
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3005
2864
  </xsl:template> <!-- refine_table-note-name-style -->
3006
2865
 
3007
2866
  <xsl:attribute-set name="note-p-style">
3008
-
3009
2867
  </xsl:attribute-set>
3010
2868
 
3011
2869
  <xsl:attribute-set name="termnote-style">
3012
-
3013
- <xsl:attribute name="text-indent">0mm</xsl:attribute>
3014
- <xsl:attribute name="space-before">4pt</xsl:attribute>
3015
- <xsl:attribute name="space-after">4pt</xsl:attribute>
3016
-
2870
+ <xsl:attribute name="text-indent">0mm</xsl:attribute>
2871
+ <xsl:attribute name="space-before">4pt</xsl:attribute>
2872
+ <xsl:attribute name="space-after">4pt</xsl:attribute>
3017
2873
  </xsl:attribute-set>
3018
2874
 
3019
2875
  <xsl:template name="refine_termnote-style">
3020
-
3021
2876
  </xsl:template> <!-- refine_termnote-style -->
3022
2877
 
3023
2878
  <xsl:attribute-set name="termnote-name-style">
3024
-
3025
2879
  </xsl:attribute-set>
3026
2880
 
3027
2881
  <xsl:template name="refine_termnote-name-style">
3028
-
3029
- <!-- <xsl:if test="$namespace = 'ieee'">
3030
- <xsl:attribute name="padding-right">0mm</xsl:attribute>
3031
- </xsl:if> -->
3032
-
3033
2882
  </xsl:template>
3034
2883
 
3035
2884
  <xsl:attribute-set name="termnote-p-style">
3036
-
3037
2885
  </xsl:attribute-set>
3038
2886
 
3039
2887
  <xsl:attribute-set name="quote-style">
3040
2888
  <xsl:attribute name="margin-left">12mm</xsl:attribute>
3041
2889
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
3042
-
3043
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
3044
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
3045
-
2890
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2891
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3046
2892
  </xsl:attribute-set>
3047
2893
 
3048
2894
  <xsl:template name="refine_quote-style">
3049
-
3050
2895
  </xsl:template>
3051
2896
 
3052
2897
  <xsl:attribute-set name="quote-source-style">
3053
2898
  <xsl:attribute name="text-align">right</xsl:attribute>
3054
-
3055
2899
  </xsl:attribute-set>
3056
2900
 
3057
2901
  <xsl:attribute-set name="termsource-style">
3058
-
3059
2902
  </xsl:attribute-set>
3060
2903
 
3061
2904
  <xsl:template name="refine_termsource-style">
3062
-
3063
- <xsl:if test="ancestor::*[local-name() = 'table']">
3064
- <xsl:attribute name="margin-bottom">1pt</xsl:attribute>
3065
- </xsl:if>
3066
-
2905
+ <xsl:if test="ancestor::*[local-name() = 'table']">
2906
+ <xsl:attribute name="margin-bottom">1pt</xsl:attribute>
2907
+ </xsl:if>
3067
2908
  </xsl:template> <!-- refine_termsource-style -->
3068
2909
 
3069
2910
  <xsl:attribute-set name="termsource-text-style">
3070
-
3071
2911
  </xsl:attribute-set>
3072
2912
 
3073
2913
  <xsl:attribute-set name="origin-style">
3074
-
3075
2914
  </xsl:attribute-set>
3076
2915
 
3077
2916
  <xsl:attribute-set name="term-style">
3078
-
3079
- <xsl:attribute name="space-after">12pt</xsl:attribute>
3080
-
2917
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
3081
2918
  </xsl:attribute-set>
3082
2919
 
3083
2920
  <xsl:attribute-set name="term-name-style">
3084
2921
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3085
2922
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3086
-
3087
- <xsl:attribute name="font-weight">normal</xsl:attribute>
3088
- <xsl:attribute name="space-after">2pt</xsl:attribute>
3089
-
2923
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
2924
+ <xsl:attribute name="space-after">2pt</xsl:attribute>
3090
2925
  </xsl:attribute-set>
3091
2926
 
3092
2927
  <xsl:attribute-set name="figure-block-style">
3093
2928
  <xsl:attribute name="role">SKIP</xsl:attribute>
3094
-
3095
2929
  </xsl:attribute-set>
3096
2930
 
3097
2931
  <xsl:template name="refine_figure-block-style">
3098
-
3099
2932
  </xsl:template>
3100
2933
 
3101
2934
  <xsl:attribute-set name="figure-style">
3102
-
3103
2935
  </xsl:attribute-set>
3104
2936
 
3105
2937
  <xsl:attribute-set name="figure-name-style">
3106
2938
  <xsl:attribute name="role">Caption</xsl:attribute>
3107
-
3108
- <xsl:attribute name="font-weight">bold</xsl:attribute>
3109
- <xsl:attribute name="text-align">center</xsl:attribute>
3110
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
3111
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
3112
- <xsl:attribute name="keep-with-previous">always</xsl:attribute>
3113
-
2939
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2940
+ <xsl:attribute name="text-align">center</xsl:attribute>
2941
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
2942
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2943
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
3114
2944
  </xsl:attribute-set>
3115
2945
 
3116
2946
  <xsl:template name="refine_figure-name-style">
3117
-
3118
- <xsl:if test="$doctype = 'technical-report'">
3119
- <xsl:attribute name="font-weight">normal</xsl:attribute>
3120
- </xsl:if>
3121
-
2947
+ <xsl:if test="$doctype = 'technical-report'">
2948
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
2949
+ </xsl:if>
3122
2950
  </xsl:template> <!-- refine_figure-name-style -->
3123
2951
 
3124
2952
  <xsl:attribute-set name="figure-source-style">
3125
-
3126
2953
  </xsl:attribute-set>
3127
2954
 
3128
2955
  <!-- Formula's styles -->
3129
2956
  <xsl:attribute-set name="formula-style">
3130
2957
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
3131
2958
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
3132
-
3133
2959
  </xsl:attribute-set> <!-- formula-style -->
3134
2960
 
3135
2961
  <xsl:attribute-set name="formula-stem-block-style">
3136
2962
  <xsl:attribute name="text-align">center</xsl:attribute>
3137
-
3138
2963
  </xsl:attribute-set> <!-- formula-stem-block-style -->
3139
2964
 
3140
2965
  <xsl:template name="refine_formula-stem-block-style">
3141
-
3142
2966
  </xsl:template> <!-- refine_formula-stem-block-style -->
3143
2967
 
3144
2968
  <xsl:attribute-set name="formula-stem-number-style">
3145
2969
  <xsl:attribute name="text-align">right</xsl:attribute>
3146
-
3147
2970
  </xsl:attribute-set> <!-- formula-stem-number-style -->
3148
2971
  <!-- End Formula's styles -->
3149
2972
 
3150
2973
  <xsl:template name="refine_formula-stem-number-style">
3151
-
3152
2974
  </xsl:template>
3153
2975
 
3154
2976
  <xsl:attribute-set name="image-style">
3155
2977
  <xsl:attribute name="role">SKIP</xsl:attribute>
3156
2978
  <xsl:attribute name="text-align">center</xsl:attribute>
3157
-
3158
2979
  </xsl:attribute-set>
3159
2980
 
3160
2981
  <xsl:template name="refine_image-style">
3161
-
3162
2982
  </xsl:template>
3163
2983
 
3164
2984
  <xsl:attribute-set name="figure-pseudocode-p-style">
3165
-
3166
2985
  </xsl:attribute-set>
3167
2986
 
3168
2987
  <xsl:attribute-set name="image-graphic-style">
3169
2988
  <xsl:attribute name="width">100%</xsl:attribute>
3170
2989
  <xsl:attribute name="content-height">100%</xsl:attribute>
3171
2990
  <xsl:attribute name="scaling">uniform</xsl:attribute>
3172
-
3173
- <xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
3174
-
2991
+ <xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
3175
2992
  </xsl:attribute-set>
3176
2993
 
3177
2994
  <xsl:attribute-set name="tt-style">
3178
-
3179
2995
  </xsl:attribute-set>
3180
2996
 
3181
2997
  <xsl:attribute-set name="sourcecode-name-style">
@@ -3184,55 +3000,44 @@
3184
3000
  <xsl:attribute name="text-align">center</xsl:attribute>
3185
3001
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
3186
3002
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
3187
-
3188
3003
  </xsl:attribute-set>
3189
3004
 
3190
3005
  <xsl:attribute-set name="preferred-block-style">
3191
-
3192
3006
  </xsl:attribute-set>
3193
3007
 
3194
3008
  <xsl:attribute-set name="preferred-term-style">
3195
3009
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3196
3010
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3197
-
3198
- <xsl:attribute name="font-weight">normal</xsl:attribute>
3199
-
3011
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
3200
3012
  </xsl:attribute-set>
3201
3013
 
3202
3014
  <xsl:attribute-set name="domain-style">
3203
-
3204
3015
  </xsl:attribute-set>
3205
3016
 
3206
3017
  <xsl:attribute-set name="admitted-style">
3207
-
3208
3018
  </xsl:attribute-set>
3209
3019
 
3210
3020
  <xsl:attribute-set name="deprecates-style">
3211
-
3212
3021
  </xsl:attribute-set>
3213
3022
 
3214
3023
  <xsl:attribute-set name="related-block-style" use-attribute-sets="preferred-block-style">
3215
3024
  </xsl:attribute-set>
3216
3025
 
3217
3026
  <xsl:attribute-set name="definition-style">
3218
-
3219
- <xsl:attribute name="space-before">2pt</xsl:attribute>
3220
- <xsl:attribute name="space-after">2pt</xsl:attribute>
3221
-
3027
+ <xsl:attribute name="space-before">2pt</xsl:attribute>
3028
+ <xsl:attribute name="space-after">2pt</xsl:attribute>
3222
3029
  </xsl:attribute-set>
3223
3030
 
3224
3031
  <xsl:variable name="color-added-text">
3225
3032
  <xsl:text>rgb(0, 255, 0)</xsl:text>
3226
3033
  </xsl:variable>
3227
3034
  <xsl:attribute-set name="add-style">
3228
-
3229
- <xsl:attribute name="color">red</xsl:attribute>
3230
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
3231
- <!-- <xsl:attribute name="color">black</xsl:attribute>
3035
+ <xsl:attribute name="color">red</xsl:attribute>
3036
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
3037
+ <!-- <xsl:attribute name="color">black</xsl:attribute>
3232
3038
  <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
3233
3039
  <xsl:attribute name="padding-top">1mm</xsl:attribute>
3234
3040
  <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
3235
-
3236
3041
  </xsl:attribute-set>
3237
3042
 
3238
3043
  <xsl:variable name="add-style">
@@ -3252,56 +3057,43 @@
3252
3057
 
3253
3058
  <xsl:attribute-set name="mathml-style">
3254
3059
  <xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
3255
-
3256
3060
  </xsl:attribute-set>
3257
3061
 
3258
3062
  <xsl:template name="refine_mathml-style">
3259
-
3260
3063
  </xsl:template>
3261
3064
 
3262
3065
  <xsl:attribute-set name="list-style">
3263
-
3264
- <xsl:attribute name="provisional-distance-between-starts">7mm</xsl:attribute>
3265
- <xsl:attribute name="space-after">20pt</xsl:attribute>
3266
-
3066
+ <xsl:attribute name="provisional-distance-between-starts">7mm</xsl:attribute>
3067
+ <xsl:attribute name="space-after">20pt</xsl:attribute>
3267
3068
  </xsl:attribute-set> <!-- list-style -->
3268
3069
 
3269
3070
  <xsl:template name="refine_list-style">
3270
-
3271
- <xsl:if test="ancestor::*[local-name() = 'table']">
3272
- <xsl:attribute name="provisional-distance-between-starts">4.5mm</xsl:attribute>
3273
- <xsl:attribute name="space-after">0pt</xsl:attribute>
3274
- </xsl:if>
3275
-
3071
+ <xsl:if test="ancestor::*[local-name() = 'table']">
3072
+ <xsl:attribute name="provisional-distance-between-starts">4.5mm</xsl:attribute>
3073
+ <xsl:attribute name="space-after">0pt</xsl:attribute>
3074
+ </xsl:if>
3276
3075
  </xsl:template> <!-- refine_list-style -->
3277
3076
 
3278
3077
  <xsl:attribute-set name="list-name-style">
3279
3078
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3280
-
3281
3079
  </xsl:attribute-set> <!-- list-name-style -->
3282
3080
 
3283
3081
  <xsl:attribute-set name="list-item-style">
3284
-
3285
3082
  </xsl:attribute-set>
3286
3083
 
3287
3084
  <xsl:template name="refine_list-item-style">
3288
-
3289
3085
  </xsl:template> <!-- refine_list-item-style -->
3290
3086
 
3291
3087
  <xsl:attribute-set name="list-item-label-style">
3292
-
3293
3088
  </xsl:attribute-set>
3294
3089
 
3295
3090
  <xsl:template name="refine_list-item-label-style">
3296
-
3297
3091
  </xsl:template> <!-- refine_list-item-label-style -->
3298
3092
 
3299
3093
  <xsl:attribute-set name="list-item-body-style">
3300
-
3301
3094
  </xsl:attribute-set>
3302
3095
 
3303
3096
  <xsl:template name="refine_list-item-body-style">
3304
-
3305
3097
  </xsl:template> <!-- refine_list-item-body-style -->
3306
3098
 
3307
3099
  <xsl:attribute-set name="toc-style">
@@ -3311,14 +3103,12 @@
3311
3103
  <xsl:attribute-set name="fn-reference-style">
3312
3104
  <xsl:attribute name="font-size">80%</xsl:attribute>
3313
3105
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3314
-
3315
- <xsl:attribute name="font-size">6pt</xsl:attribute>
3316
- <xsl:attribute name="baseline-shift">25%</xsl:attribute>
3106
+ <xsl:attribute name="font-size">6pt</xsl:attribute>
3107
+ <xsl:attribute name="baseline-shift">25%</xsl:attribute>
3317
3108
 
3318
3109
  </xsl:attribute-set>
3319
3110
 
3320
3111
  <xsl:template name="refine_fn-reference-style">
3321
-
3322
3112
  </xsl:template> <!-- refine_fn-reference-style -->
3323
3113
 
3324
3114
  <xsl:attribute-set name="fn-style">
@@ -3327,10 +3117,8 @@
3327
3117
 
3328
3118
  <xsl:attribute-set name="fn-num-style">
3329
3119
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3330
-
3331
- <xsl:attribute name="font-size">6pt</xsl:attribute>
3332
- <xsl:attribute name="baseline-shift">25%</xsl:attribute>
3333
-
3120
+ <xsl:attribute name="font-size">6pt</xsl:attribute>
3121
+ <xsl:attribute name="baseline-shift">25%</xsl:attribute>
3334
3122
  </xsl:attribute-set>
3335
3123
 
3336
3124
  <xsl:attribute-set name="fn-body-style">
@@ -3338,110 +3126,84 @@
3338
3126
  <xsl:attribute name="font-style">normal</xsl:attribute>
3339
3127
  <xsl:attribute name="text-indent">0</xsl:attribute>
3340
3128
  <xsl:attribute name="start-indent">0</xsl:attribute>
3341
-
3342
3129
  </xsl:attribute-set>
3343
3130
 
3344
3131
  <xsl:template name="refine_fn-body-style">
3345
-
3346
3132
  </xsl:template> <!-- refine_fn-body-style -->
3347
3133
 
3348
3134
  <xsl:attribute-set name="fn-body-num-style">
3349
3135
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
3350
-
3351
- <xsl:attribute name="font-size">6pt</xsl:attribute>
3352
- <xsl:attribute name="baseline-shift">25%</xsl:attribute>
3353
-
3136
+ <xsl:attribute name="font-size">6pt</xsl:attribute>
3137
+ <xsl:attribute name="baseline-shift">25%</xsl:attribute>
3354
3138
  </xsl:attribute-set> <!-- fn-body-num-style -->
3355
3139
 
3356
3140
  <xsl:template name="refine_fn-body-num-style">
3357
-
3358
3141
  </xsl:template> <!-- refine_fn-body-num-style -->
3359
3142
 
3360
3143
  <!-- admonition -->
3361
3144
  <xsl:attribute-set name="admonition-style">
3362
-
3363
3145
  </xsl:attribute-set> <!-- admonition-style -->
3364
3146
 
3365
3147
  <xsl:attribute-set name="admonition-container-style">
3366
3148
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
3367
3149
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
3368
-
3369
3150
  </xsl:attribute-set> <!-- admonition-container-style -->
3370
3151
 
3371
3152
  <xsl:attribute-set name="admonition-name-style">
3372
3153
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3373
-
3374
3154
  </xsl:attribute-set> <!-- admonition-name-style -->
3375
3155
 
3376
3156
  <xsl:attribute-set name="admonition-p-style">
3377
-
3378
3157
  </xsl:attribute-set> <!-- admonition-p-style -->
3379
3158
  <!-- end admonition -->
3380
3159
 
3381
3160
  <!-- bibitem in Normative References (references/@normative="true") -->
3382
3161
  <xsl:attribute-set name="bibitem-normative-style">
3383
-
3384
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3385
- <xsl:attribute name="start-indent">6mm</xsl:attribute>
3386
- <xsl:attribute name="text-indent">-6mm</xsl:attribute>
3387
-
3162
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3163
+ <xsl:attribute name="start-indent">6mm</xsl:attribute>
3164
+ <xsl:attribute name="text-indent">-6mm</xsl:attribute>
3388
3165
  </xsl:attribute-set> <!-- bibitem-normative-style -->
3389
3166
 
3390
3167
  <!-- bibitem in Normative References (references/@normative="true"), renders as list -->
3391
3168
  <xsl:attribute-set name="bibitem-normative-list-style">
3392
3169
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
3393
3170
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
3394
-
3395
- <!-- <xsl:if test="$namespace = 'ieee'">
3396
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3397
- <xsl:attribute name="provisional-distance-between-starts">9.5mm</xsl:attribute>
3398
- </xsl:if> -->
3399
-
3400
3171
  </xsl:attribute-set> <!-- bibitem-normative-list-style -->
3401
3172
 
3402
3173
  <xsl:attribute-set name="bibitem-non-normative-style">
3403
-
3404
3174
  </xsl:attribute-set> <!-- bibitem-non-normative-style -->
3405
3175
 
3406
3176
  <!-- bibitem in bibliography section (references/@normative="false"), renders as list -->
3407
3177
  <xsl:attribute-set name="bibitem-non-normative-list-style">
3408
3178
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
3409
3179
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
3410
-
3411
- <xsl:attribute name="provisional-distance-between-starts">9.5mm</xsl:attribute>
3412
- <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
3413
- <xsl:attribute name="line-height">1.5</xsl:attribute>
3414
-
3180
+ <xsl:attribute name="provisional-distance-between-starts">9.5mm</xsl:attribute>
3181
+ <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
3182
+ <xsl:attribute name="line-height">1.5</xsl:attribute>
3415
3183
  </xsl:attribute-set> <!-- bibitem-non-normative-list-style -->
3416
3184
 
3417
3185
  <xsl:attribute-set name="bibitem-non-normative-list-item-style">
3418
3186
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
3419
-
3420
3187
  </xsl:attribute-set>
3421
3188
 
3422
3189
  <!-- bibitem in bibliography section (references/@normative="false"), list body -->
3423
3190
  <xsl:attribute-set name="bibitem-normative-list-body-style">
3424
-
3425
3191
  </xsl:attribute-set>
3426
3192
 
3427
3193
  <xsl:attribute-set name="bibitem-non-normative-list-body-style">
3428
-
3429
3194
  </xsl:attribute-set> <!-- bibitem-non-normative-list-body-style -->
3430
3195
 
3431
3196
  <!-- footnote reference number for bibitem, in the text -->
3432
3197
  <xsl:attribute-set name="bibitem-note-fn-style">
3433
3198
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3434
3199
  <xsl:attribute name="font-size">65%</xsl:attribute>
3435
-
3436
- <xsl:attribute name="font-size">6pt</xsl:attribute>
3437
- <xsl:attribute name="baseline-shift">25%</xsl:attribute>
3438
-
3200
+ <xsl:attribute name="font-size">6pt</xsl:attribute>
3201
+ <xsl:attribute name="baseline-shift">25%</xsl:attribute>
3439
3202
  </xsl:attribute-set> <!-- bibitem-note-fn-style -->
3440
3203
 
3441
3204
  <!-- footnote number on the page bottom -->
3442
3205
  <xsl:attribute-set name="bibitem-note-fn-number-style">
3443
3206
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
3444
-
3445
3207
  </xsl:attribute-set> <!-- bibitem-note-fn-number-style -->
3446
3208
 
3447
3209
  <!-- footnote body (text) on the page bottom -->
@@ -3449,11 +3211,9 @@
3449
3211
  <xsl:attribute name="font-size">10pt</xsl:attribute>
3450
3212
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
3451
3213
  <xsl:attribute name="start-indent">0pt</xsl:attribute>
3452
-
3453
3214
  </xsl:attribute-set> <!-- bibitem-note-fn-body-style -->
3454
3215
 
3455
3216
  <xsl:attribute-set name="references-non-normative-style">
3456
-
3457
3217
  </xsl:attribute-set> <!-- references-non-normative-style -->
3458
3218
 
3459
3219
  <!-- Highlight.js syntax GitHub styles -->
@@ -3613,16 +3373,13 @@
3613
3373
  <!-- Index section styles -->
3614
3374
  <xsl:attribute-set name="indexsect-title-style">
3615
3375
  <xsl:attribute name="role">H1</xsl:attribute>
3616
-
3617
- <xsl:attribute name="font-weight">bold</xsl:attribute>
3618
- <xsl:attribute name="span">all</xsl:attribute>
3619
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
3620
-
3376
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3377
+ <xsl:attribute name="span">all</xsl:attribute>
3378
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
3621
3379
  </xsl:attribute-set>
3622
3380
 
3623
3381
  <xsl:attribute-set name="indexsect-clause-title-style">
3624
3382
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3625
-
3626
3383
  </xsl:attribute-set>
3627
3384
 
3628
3385
  <!-- End Index section styles -->
@@ -3699,47 +3456,47 @@
3699
3456
  </xsl:template>
3700
3457
 
3701
3458
  <xsl:template name="processTables_Contents">
3702
- <tables>
3459
+ <mn:tables>
3703
3460
  <xsl:for-each select="//*[local-name() = 'table'][not(ancestor::*[local-name() = 'metanorma-extension'])][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
3704
3461
  <xsl:choose>
3705
3462
  <xsl:when test="*[local-name() = 'fmt-name']">
3706
3463
  <xsl:variable name="fmt_name">
3707
3464
  <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
3708
3465
  </xsl:variable>
3709
- <table id="{@id}" alt-text="{normalize-space($fmt_name)}">
3466
+ <mn:table id="{@id}" alt-text="{normalize-space($fmt_name)}">
3710
3467
  <xsl:copy-of select="$fmt_name"/>
3711
- </table>
3468
+ </mn:table>
3712
3469
  </xsl:when>
3713
3470
  <xsl:otherwise>
3714
- <table id="{@id}" alt-text="{*[local-name() = 'name']}">
3471
+ <mn:table id="{@id}" alt-text="{*[local-name() = 'name']}">
3715
3472
  <xsl:copy-of select="*[local-name() = 'name']"/>
3716
- </table>
3473
+ </mn:table>
3717
3474
  </xsl:otherwise>
3718
3475
  </xsl:choose>
3719
3476
  </xsl:for-each>
3720
- </tables>
3477
+ </mn:tables>
3721
3478
  </xsl:template>
3722
3479
 
3723
3480
  <xsl:template name="processFigures_Contents">
3724
- <figures>
3481
+ <mn:figures>
3725
3482
  <xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name'] and not(@unnumbered = 'true') and normalize-space(@id) != ''] | //*[@id and starts-with(*[local-name() = 'name'], 'Figure ') and normalize-space(@id) != '']">
3726
3483
  <xsl:choose>
3727
3484
  <xsl:when test="*[local-name() = 'fmt-name']">
3728
3485
  <xsl:variable name="fmt_name">
3729
3486
  <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
3730
3487
  </xsl:variable>
3731
- <figure id="{@id}" alt-text="{normalize-space($fmt_name)}">
3488
+ <mn:figure id="{@id}" alt-text="{normalize-space($fmt_name)}">
3732
3489
  <xsl:copy-of select="$fmt_name"/>
3733
- </figure>
3490
+ </mn:figure>
3734
3491
  </xsl:when>
3735
3492
  <xsl:otherwise>
3736
- <figure id="{@id}" alt-text="{*[local-name() = 'name']}">
3493
+ <mn:figure id="{@id}" alt-text="{*[local-name() = 'name']}">
3737
3494
  <xsl:copy-of select="*[local-name() = 'name']"/>
3738
- </figure>
3495
+ </mn:figure>
3739
3496
  </xsl:otherwise>
3740
3497
  </xsl:choose>
3741
3498
  </xsl:for-each>
3742
- </figures>
3499
+ </mn:figures>
3743
3500
  </xsl:template>
3744
3501
 
3745
3502
  <xsl:template name="processPrefaceSectionsDefault">
@@ -3758,7 +3515,6 @@
3758
3515
  <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
3759
3516
  <xsl:sort select="@displayorder" data-type="number"/>
3760
3517
  <xsl:apply-templates select="."/>
3761
-
3762
3518
  </xsl:for-each>
3763
3519
 
3764
3520
  <xsl:for-each select="/*/*[local-name()='annex']">
@@ -3865,7 +3621,6 @@
3865
3621
  <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
3866
3622
  <xsl:sort select="@displayorder" data-type="number"/>
3867
3623
  <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
3868
-
3869
3624
  </xsl:for-each>
3870
3625
  </xsl:element>
3871
3626
  </xsl:element>
@@ -3999,7 +3754,6 @@
3999
3754
  <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak">
4000
3755
  <xsl:with-param name="page_sequence_at_top">true</xsl:with-param>
4001
3756
  </xsl:apply-templates>
4002
-
4003
3757
  </xsl:for-each>
4004
3758
  </xsl:element>
4005
3759
 
@@ -4039,19 +3793,17 @@
4039
3793
  <xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
4040
3794
  <xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
4041
3795
  <xsl:template match="text()" name="text">
4042
-
4043
- <xsl:choose>
4044
- <xsl:when test="ancestor::*[local-name() = 'table']"><xsl:value-of select="."/></xsl:when>
4045
- <xsl:otherwise>
4046
- <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new(.),$regex_standard_reference,concat($tag_fo_inline_keep-together_within-line_open,'$1',$tag_fo_inline_keep-together_within-line_close))"/>
4047
- <xsl:call-template name="replace_fo_inline_tags">
4048
- <xsl:with-param name="tag_open" select="$tag_fo_inline_keep-together_within-line_open"/>
4049
- <xsl:with-param name="tag_close" select="$tag_fo_inline_keep-together_within-line_close"/>
4050
- <xsl:with-param name="text" select="$text"/>
4051
- </xsl:call-template>
4052
- </xsl:otherwise>
4053
- </xsl:choose>
4054
-
3796
+ <xsl:choose>
3797
+ <xsl:when test="ancestor::*[local-name() = 'table']"><xsl:value-of select="."/></xsl:when>
3798
+ <xsl:otherwise>
3799
+ <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new(.),$regex_standard_reference,concat($tag_fo_inline_keep-together_within-line_open,'$1',$tag_fo_inline_keep-together_within-line_close))"/>
3800
+ <xsl:call-template name="replace_fo_inline_tags">
3801
+ <xsl:with-param name="tag_open" select="$tag_fo_inline_keep-together_within-line_open"/>
3802
+ <xsl:with-param name="tag_close" select="$tag_fo_inline_keep-together_within-line_close"/>
3803
+ <xsl:with-param name="text" select="$text"/>
3804
+ </xsl:call-template>
3805
+ </xsl:otherwise>
3806
+ </xsl:choose>
4055
3807
  </xsl:template>
4056
3808
 
4057
3809
  <xsl:template name="replace_fo_inline_tags">
@@ -4105,7 +3857,7 @@
4105
3857
  <xsl:with-param name="keep_sep">true</xsl:with-param>
4106
3858
  </xsl:call-template>
4107
3859
  </xsl:variable>
4108
- <xsl:for-each select="xalan:nodeset($items)/item">
3860
+ <xsl:for-each select="xalan:nodeset($items)/mn:item">
4109
3861
  <xsl:choose>
4110
3862
  <xsl:when test=". = $sep">
4111
3863
  <xsl:value-of select="$sep"/><xsl:value-of select="$zero_width_space"/>
@@ -4134,17 +3886,13 @@
4134
3886
  </xsl:template> <!-- copyright-statement -->
4135
3887
 
4136
3888
  <xsl:template match="*[local-name()='copyright-statement']//*[local-name()='title']">
4137
-
4138
- <!-- process in the template 'title' -->
4139
- <xsl:call-template name="title"/>
4140
-
3889
+ <!-- process in the template 'title' -->
3890
+ <xsl:call-template name="title"/>
4141
3891
  </xsl:template> <!-- copyright-statement//title -->
4142
3892
 
4143
3893
  <xsl:template match="*[local-name()='copyright-statement']//*[local-name()='p']">
4144
-
4145
- <!-- process in the template 'paragraph' -->
4146
- <xsl:call-template name="paragraph"/>
4147
-
3894
+ <!-- process in the template 'paragraph' -->
3895
+ <xsl:call-template name="paragraph"/>
4148
3896
  </xsl:template> <!-- copyright-statement//p -->
4149
3897
 
4150
3898
  <xsl:template match="*[local-name()='license-statement']">
@@ -4154,42 +3902,34 @@
4154
3902
  </xsl:template> <!-- license-statement -->
4155
3903
 
4156
3904
  <xsl:template match="*[local-name()='license-statement']//*[local-name()='title']">
4157
-
4158
- <!-- process in the template 'title' -->
4159
- <xsl:call-template name="title"/>
4160
-
3905
+ <!-- process in the template 'title' -->
3906
+ <xsl:call-template name="title"/>
4161
3907
  </xsl:template> <!-- license-statement/title -->
4162
3908
 
4163
3909
  <xsl:template match="*[local-name()='license-statement']//*[local-name()='p']">
4164
-
4165
- <!-- process in the template 'paragraph' -->
4166
- <xsl:call-template name="paragraph"/>
4167
-
3910
+ <!-- process in the template 'paragraph' -->
3911
+ <xsl:call-template name="paragraph"/>
4168
3912
  </xsl:template> <!-- license-statement/p -->
4169
3913
 
4170
3914
  <xsl:template match="*[local-name()='legal-statement']">
4171
3915
  <xsl:param name="isLegacy">false</xsl:param>
4172
3916
  <fo:block xsl:use-attribute-sets="legal-statement-style">
4173
-
4174
3917
  <xsl:apply-templates/>
4175
3918
  </fo:block>
4176
3919
  </xsl:template> <!-- legal-statement -->
4177
3920
 
4178
3921
  <xsl:template match="*[local-name()='legal-statement']//*[local-name()='title']">
4179
-
4180
- <!-- process in the template 'title' -->
4181
- <xsl:call-template name="title"/>
3922
+ <!-- process in the template 'title' -->
3923
+ <xsl:call-template name="title"/>
4182
3924
 
4183
3925
  </xsl:template> <!-- legal-statement/title -->
4184
3926
 
4185
3927
  <xsl:template match="*[local-name()='legal-statement']//*[local-name()='p']">
4186
3928
  <xsl:param name="margin"/>
4187
-
4188
- <!-- process in the template 'paragraph' -->
4189
- <xsl:call-template name="paragraph">
4190
- <xsl:with-param name="margin" select="$margin"/>
4191
- </xsl:call-template>
4192
-
3929
+ <!-- process in the template 'paragraph' -->
3930
+ <xsl:call-template name="paragraph">
3931
+ <xsl:with-param name="margin" select="$margin"/>
3932
+ </xsl:call-template>
4193
3933
  </xsl:template> <!-- legal-statement/p -->
4194
3934
 
4195
3935
  <xsl:template match="*[local-name()='feedback-statement']">
@@ -4199,20 +3939,16 @@
4199
3939
  </xsl:template> <!-- feedback-statement -->
4200
3940
 
4201
3941
  <xsl:template match="*[local-name()='feedback-statement']//*[local-name()='title']">
4202
-
4203
- <!-- process in the template 'title' -->
4204
- <xsl:call-template name="title"/>
4205
-
3942
+ <!-- process in the template 'title' -->
3943
+ <xsl:call-template name="title"/>
4206
3944
  </xsl:template>
4207
3945
 
4208
3946
  <xsl:template match="*[local-name()='feedback-statement']//*[local-name()='p']">
4209
3947
  <xsl:param name="margin"/>
4210
-
4211
- <!-- process in the template 'paragraph' -->
4212
- <xsl:call-template name="paragraph">
4213
- <xsl:with-param name="margin" select="$margin"/>
4214
- </xsl:call-template>
4215
-
3948
+ <!-- process in the template 'paragraph' -->
3949
+ <xsl:call-template name="paragraph">
3950
+ <xsl:with-param name="margin" select="$margin"/>
3951
+ </xsl:call-template>
4216
3952
  </xsl:template>
4217
3953
 
4218
3954
  <!-- ================================= -->
@@ -4265,7 +4001,6 @@
4265
4001
  <xsl:template match="*[local-name()='table']" name="table">
4266
4002
 
4267
4003
  <xsl:variable name="table-preamble">
4268
-
4269
4004
  </xsl:variable>
4270
4005
 
4271
4006
  <xsl:variable name="table">
@@ -4283,10 +4018,8 @@
4283
4018
 
4284
4019
  <!-- Display table's name before table as standalone block -->
4285
4020
  <!-- $namespace = 'iso' or -->
4286
-
4287
- <xsl:apply-templates select="*[local-name()='name']"/> <!-- table's title rendered before table -->
4288
-
4289
- <xsl:call-template name="table_name_fn_display"/>
4021
+ <xsl:apply-templates select="*[local-name()='name']"/> <!-- table's title rendered before table -->
4022
+ <xsl:call-template name="table_name_fn_display"/>
4290
4023
 
4291
4024
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
4292
4025
 
@@ -4339,8 +4072,7 @@
4339
4072
 
4340
4073
  <xsl:variable name="table_width_default">100%</xsl:variable>
4341
4074
  <xsl:variable name="table_width">
4342
- <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
4343
- <xsl:value-of select="$table_width_default"/>
4075
+ <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) --><xsl:value-of select="$table_width_default"/>
4344
4076
  </xsl:variable>
4345
4077
 
4346
4078
  <xsl:variable name="table_attributes">
@@ -4444,8 +4176,7 @@
4444
4176
 
4445
4177
  <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
4446
4178
 
4447
- <!-- https://github.com/metanorma/metanorma-plateau/issues/171 -->
4448
- <!-- table footer after table -->
4179
+ <!-- https://github.com/metanorma/metanorma-plateau/issues/171 --><!-- table footer after table -->
4449
4180
 
4450
4181
  <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
4451
4182
  <xsl:call-template name="insertTableFooterInSeparateTable">
@@ -4484,27 +4215,25 @@
4484
4215
  <xsl:when test="@width and @width != 'full-page-width' and @width != 'text-width'">
4485
4216
 
4486
4217
  <!-- centered table when table name is centered (see table-name-style) -->
4487
-
4488
- <fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style" role="SKIP">
4489
-
4490
- <fo:table-column column-width="proportional-column-width(1)"/>
4491
- <fo:table-column column-width="{@width}"/>
4492
- <fo:table-column column-width="proportional-column-width(1)"/>
4493
- <fo:table-body role="SKIP">
4494
- <fo:table-row role="SKIP">
4495
- <fo:table-cell column-number="2" role="SKIP">
4496
- <xsl:copy-of select="$table-preamble"/>
4497
- <fo:block role="SKIP">
4498
- <xsl:call-template name="setTrackChangesStyles">
4499
- <xsl:with-param name="isAdded" select="$isAdded"/>
4500
- <xsl:with-param name="isDeleted" select="$isDeleted"/>
4501
- </xsl:call-template>
4502
- <xsl:copy-of select="$table"/>
4503
- </fo:block>
4504
- </fo:table-cell>
4505
- </fo:table-row>
4506
- </fo:table-body>
4507
- </fo:table>
4218
+ <fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style" role="SKIP">
4219
+ <fo:table-column column-width="proportional-column-width(1)"/>
4220
+ <fo:table-column column-width="{@width}"/>
4221
+ <fo:table-column column-width="proportional-column-width(1)"/>
4222
+ <fo:table-body role="SKIP">
4223
+ <fo:table-row role="SKIP">
4224
+ <fo:table-cell column-number="2" role="SKIP">
4225
+ <xsl:copy-of select="$table-preamble"/>
4226
+ <fo:block role="SKIP">
4227
+ <xsl:call-template name="setTrackChangesStyles">
4228
+ <xsl:with-param name="isAdded" select="$isAdded"/>
4229
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
4230
+ </xsl:call-template>
4231
+ <xsl:copy-of select="$table"/>
4232
+ </fo:block>
4233
+ </fo:table-cell>
4234
+ </fo:table-row>
4235
+ </fo:table-body>
4236
+ </fo:table>
4508
4237
 
4509
4238
  </xsl:when>
4510
4239
  <xsl:otherwise>
@@ -4530,7 +4259,6 @@
4530
4259
  </xsl:template>
4531
4260
 
4532
4261
  <xsl:template name="setBordersTableArray">
4533
-
4534
4262
  </xsl:template>
4535
4263
 
4536
4264
  <!-- table/name-->
@@ -4539,51 +4267,50 @@
4539
4267
  <xsl:param name="cols-count"/>
4540
4268
  <xsl:if test="normalize-space() != ''">
4541
4269
 
4542
- <fo:block xsl:use-attribute-sets="table-name-style">
4543
-
4544
- <xsl:call-template name="refine_table-name-style">
4545
- <xsl:with-param name="continued" select="$continued"/>
4546
- </xsl:call-template>
4270
+ <fo:block xsl:use-attribute-sets="table-name-style">
4547
4271
 
4548
- <xsl:choose>
4549
- <xsl:when test="$continued = 'true'">
4272
+ <xsl:call-template name="refine_table-name-style">
4273
+ <xsl:with-param name="continued" select="$continued"/>
4274
+ </xsl:call-template>
4550
4275
 
4551
- </xsl:when>
4552
- <xsl:otherwise>
4553
- <xsl:apply-templates/>
4554
- </xsl:otherwise>
4555
- </xsl:choose>
4276
+ <xsl:choose>
4277
+ <xsl:when test="$continued = 'true'">
4278
+ </xsl:when>
4279
+ <xsl:otherwise>
4280
+ <xsl:apply-templates/>
4281
+ </xsl:otherwise>
4282
+ </xsl:choose>
4556
4283
 
4557
- </fo:block>
4284
+ </fo:block>
4558
4285
 
4559
- <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
4560
- <xsl:if test="$continued = 'true'">
4286
+ <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
4287
+ <xsl:if test="$continued = 'true'">
4561
4288
 
4562
- <!-- to prevent the error 'THead element may contain only TR elements' -->
4289
+ <!-- to prevent the error 'THead element may contain only TR elements' -->
4563
4290
 
4564
- <xsl:choose>
4565
- <xsl:when test="string(number($cols-count)) != 'NaN'">
4566
- <fo:table width="100%" table-layout="fixed" role="SKIP">
4567
- <fo:table-body role="SKIP">
4568
- <fo:table-row>
4569
- <fo:table-cell role="TH" number-columns-spanned="{$cols-count}">
4570
- <fo:block text-align="right" role="SKIP">
4571
- <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
4572
- </fo:block>
4573
- </fo:table-cell>
4574
- </fo:table-row>
4575
- </fo:table-body>
4576
- </fo:table>
4577
- </xsl:when>
4578
- <xsl:otherwise>
4579
- <fo:block text-align="right">
4580
- <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
4581
- </fo:block>
4582
- </xsl:otherwise>
4583
- </xsl:choose>
4291
+ <xsl:choose>
4292
+ <xsl:when test="string(number($cols-count)) != 'NaN'">
4293
+ <fo:table width="100%" table-layout="fixed" role="SKIP">
4294
+ <fo:table-body role="SKIP">
4295
+ <fo:table-row>
4296
+ <fo:table-cell role="TH" number-columns-spanned="{$cols-count}">
4297
+ <fo:block text-align="right" role="SKIP">
4298
+ <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
4299
+ </fo:block>
4300
+ </fo:table-cell>
4301
+ </fo:table-row>
4302
+ </fo:table-body>
4303
+ </fo:table>
4304
+ </xsl:when>
4305
+ <xsl:otherwise>
4306
+ <fo:block text-align="right">
4307
+ <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
4308
+ </fo:block>
4309
+ </xsl:otherwise>
4310
+ </xsl:choose>
4584
4311
 
4585
- </xsl:if>
4586
- <!-- </xsl:if> -->
4312
+ </xsl:if>
4313
+ <!-- </xsl:if> -->
4587
4314
 
4588
4315
  </xsl:if>
4589
4316
  </xsl:template> <!-- table/name -->
@@ -4958,7 +4685,6 @@
4958
4685
  <xsl:template match="*[local-name()='thead']">
4959
4686
  <xsl:param name="cols-count"/>
4960
4687
  <fo:table-header>
4961
-
4962
4688
  <xsl:apply-templates/>
4963
4689
  </fo:table-header>
4964
4690
  </xsl:template> <!-- thead -->
@@ -4972,21 +4698,20 @@
4972
4698
 
4973
4699
  <xsl:call-template name="refine_table-header-title-style"/>
4974
4700
 
4975
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
4976
- <xsl:with-param name="continued">true</xsl:with-param>
4977
- <xsl:with-param name="cols-count" select="$cols-count"/>
4978
- </xsl:apply-templates>
4701
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
4702
+ <xsl:with-param name="continued">true</xsl:with-param>
4703
+ <xsl:with-param name="cols-count" select="$cols-count"/>
4704
+ </xsl:apply-templates>
4979
4705
 
4980
- <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
4981
- <fo:block role="SKIP"/>
4982
- </xsl:if>
4706
+ <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
4707
+ <fo:block role="SKIP"/>
4708
+ </xsl:if>
4983
4709
 
4984
4710
  </fo:table-cell>
4985
4711
  </fo:table-row>
4986
4712
  </xsl:template> <!-- table-header-title -->
4987
4713
 
4988
4714
  <xsl:template name="refine_table-header-title-style">
4989
-
4990
4715
  </xsl:template> <!-- refine_table-header-title-style -->
4991
4716
 
4992
4717
  <xsl:template match="*[local-name()='thead']" mode="process_tbody">
@@ -5016,7 +4741,6 @@
5016
4741
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'][not(@type = 'units')] or ../*[local-name()='example'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
5017
4742
 
5018
4743
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
5019
-
5020
4744
  </xsl:variable>
5021
4745
 
5022
4746
  <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
@@ -5078,36 +4802,26 @@
5078
4802
  <xsl:call-template name="setBordersTableArray"/>
5079
4803
 
5080
4804
  <!-- fn will be processed inside 'note' processing -->
5081
-
5082
- <!-- for BSI (not PAS) display Notes before footnotes -->
5083
-
5084
- <!-- except gb and bsi -->
5085
-
5086
- <xsl:apply-templates select="../*[local-name()='p']"/>
5087
- <xsl:apply-templates select="../*[local-name()='dl']"/>
5088
- <xsl:apply-templates select="../*[local-name()='note'][not(@type = 'units')]"/>
5089
- <xsl:apply-templates select="../*[local-name()='example']"/>
5090
- <xsl:apply-templates select="../*[local-name()='source']"/>
4805
+ <xsl:apply-templates select="../*[local-name()='p']"/>
4806
+ <xsl:apply-templates select="../*[local-name()='dl']"/>
4807
+ <xsl:apply-templates select="../*[local-name()='note'][not(@type = 'units')]"/>
4808
+ <xsl:apply-templates select="../*[local-name()='example']"/>
4809
+ <xsl:apply-templates select="../*[local-name()='source']"/>
5091
4810
 
5092
4811
  <xsl:variable name="isDisplayRowSeparator">
5093
-
5094
4812
  </xsl:variable>
5095
4813
 
5096
4814
  <!-- horizontal row separator -->
5097
4815
  <xsl:if test="normalize-space($isDisplayRowSeparator) = 'true'">
5098
4816
  <xsl:if test="(../*[local-name()='note'][not(@type = 'units')] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
5099
4817
  <fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
5100
-
5101
4818
  <xsl:call-template name="setBordersTableArray"/>
5102
4819
  <fo:block font-size="1pt"> </fo:block>
5103
4820
  </fo:block-container>
5104
4821
  </xsl:if>
5105
4822
  </xsl:if>
5106
4823
 
5107
- <!-- fn processing -->
5108
- <fo:block/><!-- display fn before 'source', see above -->
5109
-
5110
- <!-- for PAS display Notes after footnotes -->
4824
+ <!-- fn processing --><fo:block/><!-- display fn before 'source', see above -->
5111
4825
 
5112
4826
  </fo:table-cell>
5113
4827
  </fo:table-row>
@@ -5234,7 +4948,7 @@
5234
4948
  <xsl:with-param name="pText" select="$border_under_row_"/>
5235
4949
  </xsl:call-template>
5236
4950
  </xsl:variable>
5237
- <xsl:if test="xalan:nodeset($border_under_row)/item[. = normalize-space($row_num)]">
4951
+ <xsl:if test="xalan:nodeset($border_under_row)/mn:item[. = normalize-space($row_num)]">
5238
4952
  <xsl:attribute name="border-bottom"><xsl:value-of select="$table-border"/></xsl:attribute>
5239
4953
  </xsl:if>
5240
4954
  </xsl:when>
@@ -5351,7 +5065,7 @@
5351
5065
  </xsl:variable>
5352
5066
  <xsl:variable name="quot">"</xsl:variable>
5353
5067
  <xsl:variable name="styles_">
5354
- <xsl:for-each select="xalan:nodeset($styles__)/item">
5068
+ <xsl:for-each select="xalan:nodeset($styles__)/mn:item">
5355
5069
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
5356
5070
  <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
5357
5071
  <xsl:if test="$key = 'color' or $key = 'background-color' or $key = 'border' or $key = 'border-top' or $key = 'border-right' or $key = 'border-left' or $key = 'border-bottom' or $key = 'border-style' or $key = 'border-width' or $key = 'border-color' or $key = 'border-top-style' or $key = 'border-top-width' or $key = 'border-top-color' or $key = 'border-right-style' or $key = 'border-right-width' or $key = 'border-right-color' or $key = 'border-left-style' or $key = 'border-left-width' or $key = 'border-left-color' or $key = 'border-bottom-style' or $key = 'border-bottom-width' or $key = 'border-bottom-color'">
@@ -5401,9 +5115,7 @@
5401
5115
  <fo:block role="SKIP">
5402
5116
 
5403
5117
  <xsl:if test="$isGenerateTableIF = 'true'">
5404
-
5405
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
5406
-
5118
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
5407
5119
  </xsl:if>
5408
5120
 
5409
5121
  <xsl:apply-templates/>
@@ -5418,25 +5130,23 @@
5418
5130
 
5419
5131
  <!-- table/note, table/example, table/tfoot//note, table/tfoot//example -->
5420
5132
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example'] | *[local-name()='table']/*[local-name()='tfoot']//*[local-name()='note' or local-name() = 'example']" priority="2">
5133
+ <xsl:call-template name="setNamedDestination"/>
5134
+ <fo:block xsl:use-attribute-sets="table-note-style">
5135
+ <xsl:copy-of select="@id"/>
5421
5136
 
5422
- <xsl:call-template name="setNamedDestination"/>
5423
- <fo:block xsl:use-attribute-sets="table-note-style">
5424
- <xsl:copy-of select="@id"/>
5425
-
5426
- <xsl:call-template name="refine_table-note-style"/>
5427
-
5428
- <!-- Table's note/example name (NOTE, for example) -->
5429
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
5137
+ <xsl:call-template name="refine_table-note-style"/>
5430
5138
 
5431
- <xsl:call-template name="refine_table-note-name-style"/>
5139
+ <!-- Table's note/example name (NOTE, for example) -->
5140
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
5432
5141
 
5433
- <xsl:apply-templates select="*[local-name() = 'name']"/>
5142
+ <xsl:call-template name="refine_table-note-name-style"/>
5434
5143
 
5435
- </fo:inline>
5144
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
5436
5145
 
5437
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5438
- </fo:block>
5146
+ </fo:inline>
5439
5147
 
5148
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5149
+ </fo:block>
5440
5150
  </xsl:template> <!-- table/note -->
5441
5151
 
5442
5152
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name()='example']/*[local-name()='p'] | *[local-name()='table']/*[local-name()='tfoot']//*[local-name()='note' or local-name()='example']/*[local-name()='p']" priority="2">
@@ -5481,8 +5191,7 @@
5481
5191
  <xsl:variable name="current_fn_number" select="@reference"/>
5482
5192
 
5483
5193
  <xsl:variable name="current_fn_number_text">
5484
-
5485
- <xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
5194
+ <xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
5486
5195
 
5487
5196
  </xsl:variable>
5488
5197
 
@@ -5495,12 +5204,10 @@
5495
5204
  <xsl:choose>
5496
5205
  <xsl:when test="ancestor::*[local-name() = 'bibitem']">
5497
5206
  <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
5498
-
5499
5207
  </fn_styles>
5500
5208
  </xsl:when>
5501
5209
  <xsl:otherwise>
5502
5210
  <fn_styles xsl:use-attribute-sets="fn-num-style">
5503
-
5504
5211
  </fn_styles>
5505
5212
  </xsl:otherwise>
5506
5213
  </xsl:choose>
@@ -5518,7 +5225,6 @@
5518
5225
  <xsl:with-param name="element">
5519
5226
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}"> <!-- note: role="Lbl" removed in https://github.com/metanorma/mn2pdf/issues/291 -->
5520
5227
  <fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
5521
-
5522
5228
  <xsl:copy-of select="$current_fn_number_text"/>
5523
5229
 
5524
5230
  </fo:inline>
@@ -5556,10 +5262,9 @@
5556
5262
  <here><xsl:copy-of select="$footnotes"/></here> -->
5557
5263
  <xsl:apply-templates select="$footnotes/*[local-name() = 'fmt-fn-body'][@id = $ref_id]"/>
5558
5264
  </xsl:variable>
5559
-
5560
- <fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
5561
- <xsl:copy-of select="$fn_block"/>
5562
- </fo:block>
5265
+ <fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
5266
+ <xsl:copy-of select="$fn_block"/>
5267
+ </fo:block>
5563
5268
 
5564
5269
  </fo:block-container>
5565
5270
  </fo:footnote-body>
@@ -5636,21 +5341,20 @@
5636
5341
  <xsl:variable name="reference" select="@reference"/>
5637
5342
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> --> <!-- only unique reference puts in note-->
5638
5343
  <xsl:for-each select="..//*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body']">
5344
+ <fo:block xsl:use-attribute-sets="table-fn-style">
5345
+ <xsl:copy-of select="@id"/>
5346
+ <xsl:call-template name="refine_table-fn-style"/>
5639
5347
 
5640
- <fo:block xsl:use-attribute-sets="table-fn-style">
5641
- <xsl:copy-of select="@id"/>
5642
- <xsl:call-template name="refine_table-fn-style"/>
5643
-
5644
- <xsl:apply-templates select=".//*[local-name() = 'fmt-fn-label']">
5645
- <xsl:with-param name="process">true</xsl:with-param>
5646
- </xsl:apply-templates>
5348
+ <xsl:apply-templates select=".//*[local-name() = 'fmt-fn-label']">
5349
+ <xsl:with-param name="process">true</xsl:with-param>
5350
+ </xsl:apply-templates>
5647
5351
 
5648
- <fo:inline xsl:use-attribute-sets="table-fn-body-style">
5649
- <!-- <xsl:copy-of select="./node()"/> -->
5650
- <xsl:apply-templates/>
5651
- </fo:inline>
5352
+ <fo:inline xsl:use-attribute-sets="table-fn-body-style">
5353
+ <!-- <xsl:copy-of select="./node()"/> -->
5354
+ <xsl:apply-templates/>
5355
+ </fo:inline>
5652
5356
 
5653
- </fo:block>
5357
+ </fo:block>
5654
5358
 
5655
5359
  <!-- </xsl:if> -->
5656
5360
  </xsl:for-each>
@@ -5703,9 +5407,7 @@
5703
5407
  <xsl:param name="process">false</xsl:param>
5704
5408
  <xsl:if test="$process = 'true'">
5705
5409
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
5706
-
5707
- <xsl:attribute name="padding-right">2mm</xsl:attribute>
5708
-
5410
+ <xsl:attribute name="padding-right">2mm</xsl:attribute>
5709
5411
  </xsl:if>
5710
5412
  </xsl:template>
5711
5413
 
@@ -5789,7 +5491,6 @@
5789
5491
  <xsl:if test="xalan:nodeset($references)//*[local-name() = 'fmt-fn-body']">
5790
5492
 
5791
5493
  <xsl:variable name="key_iso">
5792
-
5793
5494
  </xsl:variable>
5794
5495
 
5795
5496
  <fo:block>
@@ -5835,7 +5536,6 @@
5835
5536
  <fo:table width="95%" table-layout="fixed">
5836
5537
  <xsl:if test="normalize-space($key_iso) = 'true'">
5837
5538
  <xsl:attribute name="font-size">10pt</xsl:attribute>
5838
-
5839
5539
  </xsl:if>
5840
5540
  <xsl:choose>
5841
5541
  <!-- if there 'dl', then set same columns width -->
@@ -5859,30 +5559,24 @@
5859
5559
  <fo:table-row>
5860
5560
  <fo:table-cell>
5861
5561
  <fo:block>
5862
-
5863
- <xsl:attribute name="margin-left"><xsl:value-of select="$tableAnnotationIndent"/></xsl:attribute>
5864
- <xsl:attribute name="font-weight">bold</xsl:attribute>
5865
-
5866
- <fo:inline id="{@id}">
5867
- <xsl:attribute name="padding-right">0mm</xsl:attribute>
5868
- <!-- <xsl:value-of select="@reference"/> -->
5869
- <!-- <xsl:value-of select="normalize-space(.//*[local-name() = 'fmt-fn-label'])"/> -->
5870
- <xsl:apply-templates select=".//*[local-name() = 'fmt-fn-label']/node()"/>
5871
- </fo:inline>
5562
+ <xsl:attribute name="margin-left"><xsl:value-of select="$tableAnnotationIndent"/></xsl:attribute>
5563
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
5564
+ <fo:inline id="{@id}">
5565
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
5566
+ <!-- <xsl:value-of select="@reference"/> -->
5567
+ <!-- <xsl:value-of select="normalize-space(.//*[local-name() = 'fmt-fn-label'])"/> -->
5568
+ <xsl:apply-templates select=".//*[local-name() = 'fmt-fn-label']/node()"/>
5569
+ </fo:inline>
5872
5570
 
5873
5571
  </fo:block>
5874
5572
  </fo:table-cell>
5875
5573
  <fo:table-cell>
5876
5574
  <fo:block xsl:use-attribute-sets="figure-fn-body-style">
5877
5575
  <xsl:if test="normalize-space($key_iso) = 'true'">
5878
-
5879
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
5880
-
5881
- </xsl:if>
5882
-
5883
- <xsl:attribute name="margin-left">5mm</xsl:attribute>
5884
5576
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
5885
-
5577
+ </xsl:if>
5578
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
5579
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
5886
5580
  <!-- <xsl:copy-of select="./node()"/> -->
5887
5581
  <xsl:apply-templates/>
5888
5582
  </fo:block>
@@ -5932,11 +5626,9 @@
5932
5626
  <!-- figure/dl[@key = 'true']/dt/p/sup -->
5933
5627
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'dl'][@key = 'true']/*[local-name() = 'dt']/ *[local-name() = 'p'][count(node()[normalize-space() != '']) = 1]/*[local-name() = 'sup']" priority="3">
5934
5628
  <xsl:variable name="key_iso">
5935
-
5936
5629
  </xsl:variable>
5937
5630
  <xsl:if test="normalize-space($key_iso) = 'true'">
5938
5631
  <xsl:attribute name="font-size">10pt</xsl:attribute>
5939
-
5940
5632
  </xsl:if>
5941
5633
  <fo:inline xsl:use-attribute-sets="figure-fn-number-style figure-fmt-fn-label-style"> <!-- id="{@id}" -->
5942
5634
  <!-- <xsl:value-of select="@reference"/> -->
@@ -5982,8 +5674,7 @@
5982
5674
  <xsl:text>※</xsl:text>
5983
5675
  </xsl:if> -->
5984
5676
  <!-- <xsl:value-of select="@reference"/> -->
5985
-
5986
- <xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
5677
+ <xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
5987
5678
 
5988
5679
  <!-- <xsl:if test="$namespace = 'bsi'">
5989
5680
  <xsl:text>)</xsl:text>
@@ -6055,15 +5746,13 @@
6055
5746
  </xsl:if>
6056
5747
 
6057
5748
  <xsl:call-template name="setBlockSpanAll"/>
6058
-
6059
- <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
6060
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
6061
- </xsl:if>
6062
-
6063
- <xsl:if test="@key = 'true' and (ancestor::*[local-name() = 'tfoot'] or parent::*[local-name() = 'figure'])">
6064
- <xsl:attribute name="margin-left"><xsl:value-of select="$tableAnnotationIndent"/></xsl:attribute>
6065
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
6066
- </xsl:if>
5749
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
5750
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
5751
+ </xsl:if>
5752
+ <xsl:if test="@key = 'true' and (ancestor::*[local-name() = 'tfoot'] or parent::*[local-name() = 'figure'])">
5753
+ <xsl:attribute name="margin-left"><xsl:value-of select="$tableAnnotationIndent"/></xsl:attribute>
5754
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
5755
+ </xsl:if>
6067
5756
 
6068
5757
  <xsl:if test="ancestor::*[local-name() = 'sourcecode']">
6069
5758
  <!-- set font-size as sourcecode font-size -->
@@ -6084,7 +5773,6 @@
6084
5773
  <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
6085
5774
  </xsl:choose>
6086
5775
  </xsl:attribute>
6087
-
6088
5776
  </xsl:if>
6089
5777
 
6090
5778
  <xsl:call-template name="setTrackChangesStyles">
@@ -6093,37 +5781,32 @@
6093
5781
  </xsl:call-template>
6094
5782
 
6095
5783
  <fo:block-container margin-left="0mm" role="SKIP">
6096
-
6097
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
5784
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
6098
5785
 
6099
5786
  <xsl:variable name="parent" select="local-name(..)"/>
6100
5787
 
6101
- <xsl:variable name="key_iso">
6102
- <!-- and (not(../@class) or ../@class !='pseudocode') -->
5788
+ <xsl:variable name="key_iso"> <!-- and (not(../@class) or ../@class !='pseudocode') -->
6103
5789
  </xsl:variable>
6104
5790
 
6105
5791
  <xsl:variable name="onlyOneComponent" select="normalize-space($parent = 'formula' and count(*[local-name()='dt']) = 1)"/>
6106
5792
 
6107
5793
  <xsl:choose>
6108
5794
  <xsl:when test="$onlyOneComponent = 'true'"> <!-- only one component -->
6109
-
6110
- <fo:block margin-bottom="12pt" text-align="left">
6111
-
6112
- <!-- <xsl:variable name="title-where">
5795
+ <fo:block margin-bottom="12pt" text-align="left">
5796
+ <!-- <xsl:variable name="title-where">
6113
5797
  <xsl:call-template name="getLocalizedString">
6114
5798
  <xsl:with-param name="key">where</xsl:with-param>
6115
5799
  </xsl:call-template>
6116
5800
  </xsl:variable>
6117
5801
  <xsl:value-of select="$title-where"/> -->
6118
- <xsl:apply-templates select="preceding-sibling::*[1][local-name() = 'p' and @keep-with-next = 'true']/node()"/>
6119
- <xsl:text> </xsl:text>
6120
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
6121
- <xsl:if test="*[local-name()='dd']/node()[normalize-space() != ''][1][self::text()]">
6122
- <xsl:text> </xsl:text>
6123
- </xsl:if>
6124
- <xsl:apply-templates select="*[local-name()='dd']/node()" mode="inline"/>
6125
- </fo:block>
6126
-
5802
+ <xsl:apply-templates select="preceding-sibling::*[1][local-name() = 'p' and @keep-with-next = 'true']/node()"/>
5803
+ <xsl:text> </xsl:text>
5804
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
5805
+ <xsl:if test="*[local-name()='dd']/node()[normalize-space() != ''][1][self::text()]">
5806
+ <xsl:text> </xsl:text>
5807
+ </xsl:if>
5808
+ <xsl:apply-templates select="*[local-name()='dd']/node()" mode="inline"/>
5809
+ </fo:block>
6127
5810
  </xsl:when> <!-- END: only one component -->
6128
5811
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
6129
5812
  <fo:block margin-bottom="12pt" text-align="left">
@@ -6143,19 +5826,17 @@
6143
5826
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
6144
5827
  <!-- Presentation XML contains 'Key' caption, https://github.com/metanorma/isodoc/issues/607 -->
6145
5828
  <xsl:if test="not(preceding-sibling::*[1][local-name() = 'p' and @keep-with-next])"> <!-- for old Presentation XML -->
5829
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
6146
5830
 
6147
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
6148
-
6149
- <xsl:call-template name="refine_figure_key_style"/>
6150
-
6151
- <xsl:variable name="title-key">
6152
- <xsl:call-template name="getLocalizedString">
6153
- <xsl:with-param name="key">key</xsl:with-param>
6154
- </xsl:call-template>
6155
- </xsl:variable>
6156
- <xsl:value-of select="$title-key"/>
6157
- </fo:block>
5831
+ <xsl:call-template name="refine_figure_key_style"/>
6158
5832
 
5833
+ <xsl:variable name="title-key">
5834
+ <xsl:call-template name="getLocalizedString">
5835
+ <xsl:with-param name="key">key</xsl:with-param>
5836
+ </xsl:call-template>
5837
+ </xsl:variable>
5838
+ <xsl:value-of select="$title-key"/>
5839
+ </fo:block>
6159
5840
  </xsl:if>
6160
5841
  </xsl:when> <!-- END: definition list in a figure -->
6161
5842
  </xsl:choose>
@@ -6188,12 +5869,10 @@
6188
5869
  <xsl:if test="$isGenerateTableIF = 'true'">
6189
5870
  <xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
6190
5871
  </xsl:if>
6191
-
6192
5872
  <xsl:choose>
6193
5873
  <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'"/>
6194
5874
  <xsl:when test="normalize-space($key_iso) = 'true'">
6195
5875
  <xsl:attribute name="font-size">10pt</xsl:attribute>
6196
-
6197
5876
  </xsl:when>
6198
5877
  </xsl:choose>
6199
5878
 
@@ -6298,46 +5977,44 @@
6298
5977
  <xsl:call-template name="getMaxLength_dt"/>
6299
5978
  </xsl:variable>
6300
5979
 
6301
- <xsl:variable name="isContainsKeepTogetherTag_">
6302
- false
5980
+ <xsl:variable name="isContainsKeepTogetherTag_">false
6303
5981
  </xsl:variable>
6304
5982
  <xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/>
6305
5983
  <!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> -->
6306
-
6307
- <xsl:choose>
6308
- <!-- https://github.com/metanorma/metanorma-plateau/issues/171 -->
6309
- <xsl:when test="@key = 'true' and (ancestor::*[local-name() = 'tfoot'] or parent::*[local-name() = 'figure'])"> <!-- and not(xalan:nodeset($colwidths)//column) -->
6310
- <xsl:variable name="dt_nodes">
6311
- <xsl:for-each select="*[local-name() = 'dt']">
6312
- <xsl:apply-templates select="." mode="dt_clean"/>
6313
- </xsl:for-each>
6314
- </xsl:variable>
6315
- <!-- <xsl:copy-of select="$dt_nodes"/> -->
6316
- <xsl:variable name="dt_length_max">
6317
- <xsl:for-each select="xalan:nodeset($dt_nodes)//*[local-name() = 'dt']">
6318
- <xsl:sort select="string-length(normalize-space())" data-type="number" order="descending"/>
6319
- <xsl:if test="position() = 1"><xsl:value-of select="string-length(normalize-space())"/></xsl:if>
6320
- </xsl:for-each>
6321
- </xsl:variable>
6322
- <xsl:variable name="col1_percent_" select="number($dt_length_max) + 1"/>
6323
- <xsl:variable name="col1_percent">
6324
- <xsl:choose>
6325
- <xsl:when test="$col1_percent_ &gt; 50">50</xsl:when>
6326
- <xsl:otherwise><xsl:value-of select="$col1_percent_"/></xsl:otherwise>
6327
- </xsl:choose>
6328
- </xsl:variable>
6329
- <fo:table-column column-width="{$col1_percent}%"/>
6330
- <fo:table-column column-width="{100 - $col1_percent}%"/>
6331
- </xsl:when>
6332
- <xsl:otherwise>
6333
- <xsl:call-template name="setColumnWidth_dl">
6334
- <xsl:with-param name="colwidths" select="$colwidths"/>
6335
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
6336
- <xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
6337
- </xsl:call-template>
6338
- </xsl:otherwise>
6339
- </xsl:choose>
6340
- <!-- $namespace = 'plateau' -->
5984
+ <xsl:choose>
5985
+ <!-- https://github.com/metanorma/metanorma-plateau/issues/171 -->
5986
+ <xsl:when test="@key = 'true' and (ancestor::*[local-name() = 'tfoot'] or parent::*[local-name() = 'figure'])"> <!-- and not(xalan:nodeset($colwidths)//column) -->
5987
+ <xsl:variable name="dt_nodes">
5988
+ <xsl:for-each select="*[local-name() = 'dt']">
5989
+ <xsl:apply-templates select="." mode="dt_clean"/>
5990
+ </xsl:for-each>
5991
+ </xsl:variable>
5992
+ <!-- <xsl:copy-of select="$dt_nodes"/> -->
5993
+ <xsl:variable name="dt_length_max">
5994
+ <xsl:for-each select="xalan:nodeset($dt_nodes)//*[local-name() = 'dt']">
5995
+ <xsl:sort select="string-length(normalize-space())" data-type="number" order="descending"/>
5996
+ <xsl:if test="position() = 1"><xsl:value-of select="string-length(normalize-space())"/></xsl:if>
5997
+ </xsl:for-each>
5998
+ </xsl:variable>
5999
+ <xsl:variable name="col1_percent_" select="number($dt_length_max) + 1"/>
6000
+ <xsl:variable name="col1_percent">
6001
+ <xsl:choose>
6002
+ <xsl:when test="$col1_percent_ &gt; 50">50</xsl:when>
6003
+ <xsl:otherwise><xsl:value-of select="$col1_percent_"/></xsl:otherwise>
6004
+ </xsl:choose>
6005
+ </xsl:variable>
6006
+ <fo:table-column column-width="{$col1_percent}%"/>
6007
+ <fo:table-column column-width="{100 - $col1_percent}%"/>
6008
+ </xsl:when>
6009
+ <xsl:otherwise>
6010
+ <xsl:call-template name="setColumnWidth_dl">
6011
+ <xsl:with-param name="colwidths" select="$colwidths"/>
6012
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
6013
+ <xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
6014
+ </xsl:call-template>
6015
+ </xsl:otherwise>
6016
+ </xsl:choose>
6017
+ <!-- $namespace = 'plateau' -->
6341
6018
 
6342
6019
  <fo:table-body>
6343
6020
 
@@ -6388,21 +6065,17 @@
6388
6065
  </xsl:template>
6389
6066
 
6390
6067
  <xsl:template name="refine_dl_formula_where_style">
6391
-
6392
6068
  </xsl:template> <!-- refine_dl_formula_where_style -->
6393
6069
 
6394
6070
  <xsl:template name="refine_figure_key_style">
6395
-
6396
6071
  </xsl:template> <!-- refine_figure_key_style -->
6397
6072
 
6398
6073
  <xsl:template name="refine_multicomponent_style">
6399
6074
  <xsl:variable name="parent" select="local-name(..)"/>
6400
-
6401
6075
  </xsl:template> <!-- refine_multicomponent_style -->
6402
6076
 
6403
6077
  <xsl:template name="refine_multicomponent_block_style">
6404
6078
  <xsl:variable name="parent" select="local-name(..)"/>
6405
-
6406
6079
  </xsl:template> <!-- refine_multicomponent_block_style -->
6407
6080
 
6408
6081
  <!-- ignore 'p' with 'where' in formula, before 'dl' -->
@@ -6413,12 +6086,11 @@
6413
6086
  <xsl:param name="process">false</xsl:param>
6414
6087
  <xsl:if test="$process = 'true'">
6415
6088
  <fo:block xsl:use-attribute-sets="dl-name-style">
6416
-
6417
- <xsl:if test="ancestor::*[local-name() = 'tfoot'] and ../@key = 'true'">
6418
- <xsl:attribute name="margin-left">-<xsl:value-of select="$tableAnnotationIndent"/></xsl:attribute>
6419
- <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
6420
- <xsl:attribute name="font-weight">bold</xsl:attribute>
6421
- </xsl:if>
6089
+ <xsl:if test="ancestor::*[local-name() = 'tfoot'] and ../@key = 'true'">
6090
+ <xsl:attribute name="margin-left">-<xsl:value-of select="$tableAnnotationIndent"/></xsl:attribute>
6091
+ <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
6092
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
6093
+ </xsl:if>
6422
6094
 
6423
6095
  <xsl:apply-templates/>
6424
6096
  </fo:block>
@@ -6595,14 +6267,11 @@
6595
6267
  <xsl:attribute name="id">
6596
6268
  <xsl:value-of select="concat($id,'@',$row_number,'_2')"/>
6597
6269
  </xsl:attribute>
6598
-
6599
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
6600
- <xsl:with-param name="process">true</xsl:with-param>
6601
- </xsl:apply-templates>
6602
-
6270
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
6271
+ <xsl:with-param name="process">true</xsl:with-param>
6272
+ </xsl:apply-templates>
6603
6273
  </td>
6604
6274
  </tr>
6605
-
6606
6275
  </xsl:template>
6607
6276
 
6608
6277
  <!-- Definition's term -->
@@ -6611,7 +6280,6 @@
6611
6280
  <xsl:param name="split_keep-within-line"/>
6612
6281
 
6613
6282
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
6614
-
6615
6283
  <xsl:call-template name="insert_dt_cell">
6616
6284
  <xsl:with-param name="key_iso" select="$key_iso"/>
6617
6285
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -6633,7 +6301,6 @@
6633
6301
  <!-- border is mandatory, to calculate real width -->
6634
6302
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
6635
6303
  <xsl:attribute name="text-align">left</xsl:attribute>
6636
-
6637
6304
  </xsl:if>
6638
6305
 
6639
6306
  <xsl:call-template name="refine_dt-cell-style"/>
@@ -6643,9 +6310,7 @@
6643
6310
 
6644
6311
  <xsl:choose>
6645
6312
  <xsl:when test="$isGenerateTableIF = 'true'">
6646
-
6647
- <xsl:copy-of select="@id"/>
6648
-
6313
+ <xsl:copy-of select="@id"/>
6649
6314
  </xsl:when>
6650
6315
  <xsl:otherwise>
6651
6316
  <xsl:copy-of select="@id"/>
@@ -6682,9 +6347,7 @@
6682
6347
  <fo:block role="SKIP">
6683
6348
 
6684
6349
  <xsl:if test="$isGenerateTableIF = 'true'">
6685
-
6686
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
6687
-
6350
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
6688
6351
  </xsl:if>
6689
6352
 
6690
6353
  <xsl:choose>
@@ -6832,7 +6495,6 @@
6832
6495
  </xsl:template>
6833
6496
 
6834
6497
  <xsl:template name="refine_italic_style">
6835
-
6836
6498
  </xsl:template>
6837
6499
 
6838
6500
  <xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
@@ -6848,7 +6510,6 @@
6848
6510
  </xsl:template>
6849
6511
 
6850
6512
  <xsl:template name="refine_strong_style">
6851
-
6852
6513
  <xsl:if test="ancestor::*['preferred']">
6853
6514
  <xsl:attribute name="role">SKIP</xsl:attribute>
6854
6515
  </xsl:if>
@@ -6873,10 +6534,7 @@
6873
6534
  <xsl:template match="*[local-name()='tt']">
6874
6535
  <fo:inline xsl:use-attribute-sets="tt-style">
6875
6536
 
6876
- <xsl:variable name="_font-size">
6877
-
6878
- <!-- inherit -->
6879
-
6537
+ <xsl:variable name="_font-size"> <!-- inherit -->
6880
6538
  </xsl:variable>
6881
6539
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
6882
6540
  <xsl:if test="$font-size != ''">
@@ -7092,8 +6750,7 @@
7092
6750
  </xsl:otherwise>
7093
6751
  </xsl:choose>
7094
6752
  </xsl:variable>
7095
- <xsl:variable name="ratio_">
7096
- 0.75
6753
+ <xsl:variable name="ratio_">0.75
7097
6754
  </xsl:variable>
7098
6755
  <xsl:variable name="ratio" select="number(normalize-space($ratio_))"/>
7099
6756
  <fo:inline font-size="{$ratio * 100}%" role="SKIP">
@@ -7183,7 +6840,7 @@
7183
6840
 
7184
6841
  <xsl:variable name="quot">"</xsl:variable>
7185
6842
  <xsl:variable name="styles_">
7186
- <xsl:for-each select="xalan:nodeset($styles__)/item">
6843
+ <xsl:for-each select="xalan:nodeset($styles__)/mn:item">
7187
6844
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
7188
6845
  <xsl:variable name="value_" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
7189
6846
  <xsl:variable name="value">
@@ -7195,7 +6852,7 @@
7195
6852
  </xsl:otherwise>
7196
6853
  </xsl:choose>
7197
6854
  </xsl:variable>
7198
- <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color'">
6855
+ <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color' or $key = 'baseline-shift'">
7199
6856
  <style name="{$key}"><xsl:value-of select="$value"/></style>
7200
6857
  </xsl:if>
7201
6858
  <xsl:if test="$key = 'text-indent'">
@@ -7209,7 +6866,6 @@
7209
6866
  <fo:inline>
7210
6867
  <xsl:for-each select="$styles/style">
7211
6868
  <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
7212
-
7213
6869
  </xsl:for-each>
7214
6870
  <xsl:apply-templates/>
7215
6871
  </fo:inline>
@@ -8196,10 +7852,9 @@
8196
7852
  <xsl:variable name="mathml_content">
8197
7853
  <xsl:apply-templates select="." mode="mathml_actual_text"/>
8198
7854
  </xsl:variable>
8199
-
8200
- <xsl:call-template name="mathml_instream_object">
8201
- <xsl:with-param name="mathml_content" select="$mathml_content"/>
8202
- </xsl:call-template>
7855
+ <xsl:call-template name="mathml_instream_object">
7856
+ <xsl:with-param name="mathml_content" select="$mathml_content"/>
7857
+ </xsl:call-template>
8203
7858
 
8204
7859
  </fo:inline>
8205
7860
  </xsl:template>
@@ -8233,7 +7888,6 @@
8233
7888
  <xsl:template name="getMathml_asciimath_text">
8234
7889
  <xsl:variable name="asciimath" select="../*[local-name() = 'asciimath']"/>
8235
7890
  <xsl:variable name="latexmath">
8236
-
8237
7891
  </xsl:variable>
8238
7892
  <xsl:variable name="asciimath_text_following">
8239
7893
  <xsl:choose>
@@ -8306,7 +7960,6 @@
8306
7960
  </xsl:template>
8307
7961
 
8308
7962
  <xsl:template name="refine_mathml_insteam_object_style">
8309
-
8310
7963
  </xsl:template> <!-- refine_mathml_insteam_object_style -->
8311
7964
 
8312
7965
  <xsl:template match="mathml:*" mode="mathml_actual_text">
@@ -8704,7 +8357,6 @@
8704
8357
  <xsl:variable name="annotation-id" select="@id"/>
8705
8358
  <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
8706
8359
  <fo:block id="{$annotation-id}" white-space="nowrap">
8707
-
8708
8360
  <fo:inline>
8709
8361
  <xsl:apply-templates>
8710
8362
  <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
@@ -8733,7 +8385,6 @@
8733
8385
  <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'])">
8734
8386
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
8735
8387
  </xsl:if>
8736
-
8737
8388
  <xsl:if test="parent::*[local-name() = 'add']">
8738
8389
  <xsl:call-template name="append_add-style"/>
8739
8390
  </xsl:if>
@@ -8744,8 +8395,7 @@
8744
8395
  </xsl:template>
8745
8396
 
8746
8397
  <!-- command between two xref points to non-standard bibitem -->
8747
- <xsl:template match="text()[. = ','][preceding-sibling::node()[1][local-name() = 'sup'][*[local-name() = 'xref'][@type = 'footnote']] and following-sibling::node()[1][local-name() = 'sup'][*[local-name() = 'xref'][@type = 'footnote']]]">
8748
- <xsl:value-of select="."/>
8398
+ <xsl:template match="text()[. = ','][preceding-sibling::node()[1][local-name() = 'sup'][*[local-name() = 'xref'][@type = 'footnote']] and following-sibling::node()[1][local-name() = 'sup'][*[local-name() = 'xref'][@type = 'footnote']]]"><xsl:value-of select="."/>
8749
8399
  </xsl:template>
8750
8400
 
8751
8401
  <!-- ====== -->
@@ -8760,7 +8410,6 @@
8760
8410
  <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
8761
8411
  </xsl:choose>
8762
8412
  </xsl:attribute>
8763
-
8764
8413
  </xsl:if>
8765
8414
  <fo:block-container margin-left="0mm" role="SKIP">
8766
8415
  <xsl:call-template name="setNamedDestination"/>
@@ -8850,57 +8499,52 @@
8850
8499
 
8851
8500
  <xsl:template match="*[local-name() = 'note']" name="note">
8852
8501
 
8853
- <xsl:call-template name="setNamedDestination"/>
8854
-
8855
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
8856
-
8857
- <xsl:call-template name="setBlockSpanAll"/>
8858
-
8859
- <xsl:call-template name="refine_note-style"/>
8502
+ <xsl:call-template name="setNamedDestination"/>
8860
8503
 
8861
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8504
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
8862
8505
 
8863
- <fo:block>
8506
+ <xsl:call-template name="setBlockSpanAll"/>
8864
8507
 
8865
- <xsl:call-template name="refine_note_block_style"/>
8508
+ <xsl:call-template name="refine_note-style"/>
8866
8509
 
8867
- <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
8510
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8511
+ <fo:block>
8868
8512
 
8869
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'tab']" mode="tab"/>
8513
+ <xsl:call-template name="refine_note_block_style"/>
8870
8514
 
8871
- <xsl:call-template name="refine_note-name-style"/>
8515
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
8872
8516
 
8873
- <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
8874
- <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
8875
- <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
8876
- <xsl:call-template name="append_add-style"/>
8877
- </xsl:if>
8517
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'tab']" mode="tab"/>
8878
8518
 
8879
- <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
8880
- <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8881
- <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8882
- <xsl:with-param name="skip">false</xsl:with-param>
8883
- </xsl:apply-templates>
8884
- </xsl:if>
8519
+ <xsl:call-template name="refine_note-name-style"/>
8885
8520
 
8886
- <xsl:apply-templates select="*[local-name() = 'name']"/>
8521
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
8522
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
8523
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
8524
+ <xsl:call-template name="append_add-style"/>
8525
+ </xsl:if>
8887
8526
 
8888
- </fo:inline>
8527
+ <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
8528
+ <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8529
+ <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8530
+ <xsl:with-param name="skip">false</xsl:with-param>
8531
+ </xsl:apply-templates>
8532
+ </xsl:if>
8889
8533
 
8890
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8891
- </fo:block>
8534
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
8892
8535
 
8893
- </fo:block-container>
8894
- </fo:block-container>
8536
+ </fo:inline>
8895
8537
 
8538
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8539
+ </fo:block>
8540
+ </fo:block-container>
8541
+ </fo:block-container>
8896
8542
  </xsl:template>
8897
8543
 
8898
8544
  <xsl:template name="refine_note_block_style">
8899
-
8900
- <xsl:if test="ancestor::*[local-name() = 'figure']">
8901
- <xsl:attribute name="margin-left"><xsl:value-of select="$tableAnnotationIndent"/></xsl:attribute>
8902
- </xsl:if>
8903
-
8545
+ <xsl:if test="ancestor::*[local-name() = 'figure']">
8546
+ <xsl:attribute name="margin-left"><xsl:value-of select="$tableAnnotationIndent"/></xsl:attribute>
8547
+ </xsl:if>
8904
8548
  </xsl:template> <!-- refine_note_block_style -->
8905
8549
 
8906
8550
  <xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
@@ -8953,7 +8597,6 @@
8953
8597
  <xsl:value-of select="$sfx"/>
8954
8598
  </xsl:when>
8955
8599
  <xsl:otherwise>
8956
-
8957
8600
  <!-- https://github.com/metanorma/isodoc/issues/607 -->
8958
8601
  <!-- <xsl:if test="$namespace = 'ieee'">
8959
8602
  <xsl:text>—</xsl:text> em dash &#x2014;
@@ -8961,7 +8604,6 @@
8961
8604
  <!-- <xsl:if test="$namespace = 'iho' or $namespace = 'gb' or $namespace = 'm3d' or $namespace = 'unece-rec' or $namespace = 'unece' or $namespace = 'rsd'">
8962
8605
  <xsl:text>:</xsl:text>
8963
8606
  </xsl:if> -->
8964
-
8965
8607
  <!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp'">
8966
8608
  <xsl:text> – </xsl:text> en dash &#x2013;
8967
8609
  </xsl:if> -->
@@ -8982,7 +8624,6 @@
8982
8624
  <xsl:value-of select="$sfx"/>
8983
8625
  </xsl:when>
8984
8626
  <xsl:otherwise>
8985
-
8986
8627
  <!-- https://github.com/metanorma/isodoc/issues/607 -->
8987
8628
  <!-- <xsl:if test="$namespace = 'ieee'">
8988
8629
  <xsl:text>—</xsl:text> em dash &#x2014;
@@ -9038,7 +8679,6 @@
9038
8679
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
9039
8680
 
9040
8681
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
9041
-
9042
8682
  </xsl:if>
9043
8683
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
9044
8684
  </fo:block>
@@ -9078,8 +8718,7 @@
9078
8718
  <!-- Example: Dimensions in millimeters -->
9079
8719
  <xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
9080
8720
 
9081
- <xsl:variable name="show_figure_key_in_block_container">
9082
- true
8721
+ <xsl:variable name="show_figure_key_in_block_container">true
9083
8722
  </xsl:variable>
9084
8723
 
9085
8724
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
@@ -9094,11 +8733,9 @@
9094
8733
  <xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
9095
8734
  <xsl:call-template name="showFigureKey"/>
9096
8735
  </xsl:if>
9097
-
9098
- <xsl:apply-templates select="*[local-name() = 'name']"/> <!-- show figure's name AFTER image -->
8736
+ <xsl:apply-templates select="*[local-name() = 'name']"/> <!-- show figure's name AFTER image -->
9099
8737
 
9100
8738
  </fo:block-container>
9101
-
9102
8739
  </xsl:template>
9103
8740
 
9104
8741
  <xsl:template name="showFigureKey">
@@ -9136,13 +8773,12 @@
9136
8773
  <!-- SOURCE: ... -->
9137
8774
  <!-- figure/source -->
9138
8775
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
9139
-
9140
- <xsl:call-template name="termsource"/>
9141
-
8776
+ <xsl:call-template name="termsource"/>
9142
8777
  </xsl:template>
9143
8778
 
9144
8779
  <xsl:template match="*[local-name() = 'image']">
9145
8780
  <xsl:param name="indent">0</xsl:param>
8781
+ <xsl:param name="logo_width"/>
9146
8782
  <xsl:variable name="isAdded" select="../@added"/>
9147
8783
  <xsl:variable name="isDeleted" select="../@deleted"/>
9148
8784
  <xsl:choose>
@@ -9164,9 +8800,18 @@
9164
8800
 
9165
8801
  <!-- debug scale='<xsl:value-of select="$scale"/>', indent='<xsl:value-of select="$indent"/>' -->
9166
8802
 
9167
- <!-- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/> -->
9168
8803
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle">
9169
8804
 
8805
+ <xsl:if test="parent::*[local-name() = 'logo']"> <!-- publisher's logo -->
8806
+ <xsl:attribute name="width">100%</xsl:attribute>
8807
+ <xsl:if test="normalize-space($logo_width) != ''">
8808
+ <xsl:attribute name="width"><xsl:value-of select="$logo_width"/></xsl:attribute>
8809
+ </xsl:if>
8810
+ <xsl:attribute name="content-height">100%</xsl:attribute>
8811
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
8812
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
8813
+ </xsl:if>
8814
+
9170
8815
  <xsl:variable name="width">
9171
8816
  <xsl:call-template name="setImageWidth"/>
9172
8817
  </xsl:variable>
@@ -9244,8 +8889,7 @@
9244
8889
  </xsl:call-template>
9245
8890
  </xsl:variable>
9246
8891
 
9247
- <xsl:variable name="scaleRatio">
9248
- 1
8892
+ <xsl:variable name="scaleRatio">1
9249
8893
  </xsl:variable>
9250
8894
 
9251
8895
  <xsl:if test="number($scale) &lt; 100">
@@ -9356,18 +9000,14 @@
9356
9000
  </xsl:variable>
9357
9001
 
9358
9002
  <xsl:variable name="image_width_effective">
9359
-
9360
- <xsl:value-of select="$width_effective - number($indent_left)"/>
9361
-
9003
+ <xsl:value-of select="$width_effective - number($indent_left)"/>
9362
9004
  </xsl:variable>
9363
9005
  <xsl:variable name="image_height_effective" select="$height_effective - number($indent_left)"/>
9364
9006
  <!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
9365
9007
  <xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
9366
9008
  <xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
9367
9009
  <xsl:variable name="scale">
9368
-
9369
- <xsl:value-of select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
9370
-
9010
+ <xsl:value-of select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
9371
9011
  </xsl:variable>
9372
9012
  <xsl:value-of select="$scale"/>
9373
9013
  </xsl:template>
@@ -9388,7 +9028,8 @@
9388
9028
  </xsl:when>
9389
9029
  <xsl:when test="not(starts-with(@src, 'data:'))">
9390
9030
  <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
9391
- <xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
9031
+ <xsl:variable name="file_protocol"><xsl:if test="not(starts-with($src_external, 'http:')) and not(starts-with($src_external, 'https:')) and not(starts-with($src_external, 'www.'))">file:///</xsl:if></xsl:variable>
9032
+ <xsl:value-of select="concat('url(', $file_protocol, $src_external, ')')"/>
9392
9033
  </xsl:when>
9393
9034
  <xsl:otherwise>
9394
9035
  <xsl:value-of select="@src"/>
@@ -9684,8 +9325,8 @@
9684
9325
  </xsl:call-template>
9685
9326
  </xsl:variable>
9686
9327
  <xsl:variable name="viewbox" select="xalan:nodeset($viewbox_)"/>
9687
- <xsl:variable name="width" select="normalize-space($viewbox//item[3])"/>
9688
- <xsl:variable name="height" select="normalize-space($viewbox//item[4])"/>
9328
+ <xsl:variable name="width" select="normalize-space($viewbox//mn:item[3])"/>
9329
+ <xsl:variable name="height" select="normalize-space($viewbox//mn:item[4])"/>
9689
9330
 
9690
9331
  <xsl:variable name="parent_image_width" select="normalize-space(ancestor::*[1][local-name() = 'image']/@width)"/>
9691
9332
  <xsl:variable name="parent_image_height" select="normalize-space(ancestor::*[1][local-name() = 'image']/@height)"/>
@@ -9757,8 +9398,8 @@
9757
9398
  </xsl:variable>
9758
9399
  <xsl:variable name="components" select="xalan:nodeset($components_)"/>
9759
9400
  <xsl:variable name="att_name" select="local-name()"/>
9760
- <xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
9761
- <xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
9401
+ <xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/mn:item[1], ',', $components/mn:item[2], ',', $components/mn:item[3], ')')"/></xsl:attribute>
9402
+ <xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/mn:item[4]"/></xsl:attribute>
9762
9403
  </xsl:template>
9763
9404
 
9764
9405
  <!-- ============== -->
@@ -9831,13 +9472,13 @@
9831
9472
  </xsl:call-template>
9832
9473
  </xsl:variable>
9833
9474
  <xsl:variable name="x_coords">
9834
- <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
9475
+ <xsl:for-each select="xalan:nodeset($points)//mn:item[position() mod 2 = 1]">
9835
9476
  <xsl:sort select="." data-type="number"/>
9836
9477
  <x><xsl:value-of select="."/></x>
9837
9478
  </xsl:for-each>
9838
9479
  </xsl:variable>
9839
9480
  <xsl:variable name="y_coords">
9840
- <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
9481
+ <xsl:for-each select="xalan:nodeset($points)//mn:item[position() mod 2 = 0]">
9841
9482
  <xsl:sort select="." data-type="number"/>
9842
9483
  <y><xsl:value-of select="."/></y>
9843
9484
  </xsl:for-each>
@@ -10042,11 +9683,11 @@
10042
9683
  <xsl:if test="ancestor-or-self::*[local-name() = 'annex']">annex</xsl:if>
10043
9684
  </xsl:variable>
10044
9685
 
10045
- <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}" display="{$display}">
10046
- <title>
9686
+ <mn:item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}" display="{$display}">
9687
+ <mn:title>
10047
9688
  <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
10048
- </title>
10049
- </item>
9689
+ </mn:title>
9690
+ </mn:item>
10050
9691
  </xsl:if>
10051
9692
  </xsl:template>
10052
9693
 
@@ -10117,12 +9758,12 @@
10117
9758
  <xsl:param name="contents"/>
10118
9759
  <xsl:param name="contents_addon"/>
10119
9760
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
10120
- <xsl:if test="$contents_nodes//item">
9761
+ <xsl:if test="$contents_nodes//mn:item">
10121
9762
  <fo:bookmark-tree>
10122
9763
  <xsl:choose>
10123
- <xsl:when test="$contents_nodes/doc">
9764
+ <xsl:when test="$contents_nodes/mn:doc">
10124
9765
  <xsl:choose>
10125
- <xsl:when test="count($contents_nodes/doc) &gt; 1">
9766
+ <xsl:when test="count($contents_nodes/mn:doc) &gt; 1">
10126
9767
 
10127
9768
  <xsl:if test="$contents_nodes/collection">
10128
9769
  <fo:bookmark internal-destination="{$contents/collection/@firstpage_id}">
@@ -10130,8 +9771,8 @@
10130
9771
  </fo:bookmark>
10131
9772
  </xsl:if>
10132
9773
 
10133
- <xsl:for-each select="$contents_nodes/doc">
10134
- <fo:bookmark internal-destination="{contents/item[@display = 'true'][1]/@id}" starting-state="hide">
9774
+ <xsl:for-each select="$contents_nodes/mn:doc">
9775
+ <fo:bookmark internal-destination="{contents/mn:item[@display = 'true'][1]/@id}" starting-state="hide">
10135
9776
  <xsl:if test="@bundle = 'true'">
10136
9777
  <xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
10137
9778
  </xsl:if>
@@ -10165,14 +9806,14 @@
10165
9806
  </xsl:choose>
10166
9807
  </fo:bookmark-title>
10167
9808
 
10168
- <xsl:apply-templates select="contents/item" mode="bookmark"/>
9809
+ <xsl:apply-templates select="contents/mn:item" mode="bookmark"/>
10169
9810
 
10170
9811
  <xsl:call-template name="insertFigureBookmarks">
10171
- <xsl:with-param name="contents" select="contents"/>
9812
+ <xsl:with-param name="contents" select="mn:contents"/>
10172
9813
  </xsl:call-template>
10173
9814
 
10174
9815
  <xsl:call-template name="insertTableBookmarks">
10175
- <xsl:with-param name="contents" select="contents"/>
9816
+ <xsl:with-param name="contents" select="mn:contents"/>
10176
9817
  <xsl:with-param name="lang" select="@lang"/>
10177
9818
  </xsl:call-template>
10178
9819
 
@@ -10181,16 +9822,16 @@
10181
9822
  </xsl:for-each>
10182
9823
  </xsl:when>
10183
9824
  <xsl:otherwise>
10184
- <xsl:for-each select="$contents_nodes/doc">
9825
+ <xsl:for-each select="$contents_nodes/mn:doc">
10185
9826
 
10186
- <xsl:apply-templates select="contents/item" mode="bookmark"/>
9827
+ <xsl:apply-templates select="mn:contents/mn:item" mode="bookmark"/>
10187
9828
 
10188
9829
  <xsl:call-template name="insertFigureBookmarks">
10189
- <xsl:with-param name="contents" select="contents"/>
9830
+ <xsl:with-param name="contents" select="mn:contents"/>
10190
9831
  </xsl:call-template>
10191
9832
 
10192
9833
  <xsl:call-template name="insertTableBookmarks">
10193
- <xsl:with-param name="contents" select="contents"/>
9834
+ <xsl:with-param name="contents" select="mn:contents"/>
10194
9835
  <xsl:with-param name="lang" select="@lang"/>
10195
9836
  </xsl:call-template>
10196
9837
 
@@ -10199,14 +9840,14 @@
10199
9840
  </xsl:choose>
10200
9841
  </xsl:when>
10201
9842
  <xsl:otherwise>
10202
- <xsl:apply-templates select="$contents_nodes/contents/item" mode="bookmark"/>
9843
+ <xsl:apply-templates select="$contents_nodes/mn:contents/mn:item" mode="bookmark"/>
10203
9844
 
10204
9845
  <xsl:call-template name="insertFigureBookmarks">
10205
- <xsl:with-param name="contents" select="$contents_nodes/contents"/>
9846
+ <xsl:with-param name="contents" select="$contents_nodes/mn:contents"/>
10206
9847
  </xsl:call-template>
10207
9848
 
10208
9849
  <xsl:call-template name="insertTableBookmarks">
10209
- <xsl:with-param name="contents" select="$contents_nodes/contents"/>
9850
+ <xsl:with-param name="contents" select="$contents_nodes/mn:contents"/>
10210
9851
  <xsl:with-param name="lang" select="@lang"/>
10211
9852
  </xsl:call-template>
10212
9853
 
@@ -10223,80 +9864,72 @@
10223
9864
  <xsl:template name="insertFigureBookmarks">
10224
9865
  <xsl:param name="contents"/>
10225
9866
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
10226
- <xsl:if test="$contents_nodes/figure">
10227
- <fo:bookmark internal-destination="{$contents_nodes/figure[1]/@id}" starting-state="hide">
9867
+ <xsl:if test="$contents_nodes/mn:figure">
9868
+ <fo:bookmark internal-destination="{$contents_nodes/mn:figure[1]/@id}" starting-state="hide">
10228
9869
  <fo:bookmark-title>Figures</fo:bookmark-title>
10229
- <xsl:for-each select="$contents_nodes/figure">
9870
+ <xsl:for-each select="$contents_nodes/mn:figure">
10230
9871
  <fo:bookmark internal-destination="{@id}">
10231
9872
  <fo:bookmark-title>
10232
- <xsl:value-of select="normalize-space(title)"/>
9873
+ <xsl:value-of select="normalize-space(mn:title)"/>
10233
9874
  </fo:bookmark-title>
10234
9875
  </fo:bookmark>
10235
9876
  </xsl:for-each>
10236
9877
  </fo:bookmark>
10237
9878
  </xsl:if>
9879
+ <xsl:if test="$contents_nodes//mn:figures/mn:figure">
9880
+ <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
10238
9881
 
10239
- <xsl:if test="$contents_nodes//figures/figure">
10240
- <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
10241
-
10242
- <xsl:variable name="bookmark-title">
10243
-
10244
- <xsl:value-of select="$title-list-figures"/>
10245
-
10246
- </xsl:variable>
10247
- <fo:bookmark-title><xsl:value-of select="normalize-space($bookmark-title)"/></fo:bookmark-title>
10248
- <xsl:for-each select="$contents_nodes//figures/figure">
10249
- <fo:bookmark internal-destination="{@id}">
10250
- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
10251
- </fo:bookmark>
10252
- </xsl:for-each>
9882
+ <xsl:variable name="bookmark-title">
9883
+ <xsl:value-of select="$title-list-figures"/>
9884
+ </xsl:variable>
9885
+ <fo:bookmark-title><xsl:value-of select="normalize-space($bookmark-title)"/></fo:bookmark-title>
9886
+ <xsl:for-each select="$contents_nodes//mn:figures/mn:figure">
9887
+ <fo:bookmark internal-destination="{@id}">
9888
+ <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
10253
9889
  </fo:bookmark>
10254
- </xsl:if>
10255
-
9890
+ </xsl:for-each>
9891
+ </fo:bookmark>
9892
+ </xsl:if>
10256
9893
  </xsl:template> <!-- insertFigureBookmarks -->
10257
9894
 
10258
9895
  <xsl:template name="insertTableBookmarks">
10259
9896
  <xsl:param name="contents"/>
10260
9897
  <xsl:param name="lang"/>
10261
9898
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
10262
- <xsl:if test="$contents_nodes/table">
10263
- <fo:bookmark internal-destination="{$contents_nodes/table[1]/@id}" starting-state="hide">
9899
+ <xsl:if test="$contents_nodes/mn:table">
9900
+ <fo:bookmark internal-destination="{$contents_nodes/mn:table[1]/@id}" starting-state="hide">
10264
9901
  <fo:bookmark-title>
10265
9902
  <xsl:choose>
10266
9903
  <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
10267
9904
  <xsl:otherwise>Tables</xsl:otherwise>
10268
9905
  </xsl:choose>
10269
9906
  </fo:bookmark-title>
10270
- <xsl:for-each select="$contents_nodes/table">
9907
+ <xsl:for-each select="$contents_nodes/mn:table">
10271
9908
  <fo:bookmark internal-destination="{@id}">
10272
9909
  <fo:bookmark-title>
10273
- <xsl:value-of select="normalize-space(title)"/>
9910
+ <xsl:value-of select="normalize-space(mn:title)"/>
10274
9911
  </fo:bookmark-title>
10275
9912
  </fo:bookmark>
10276
9913
  </xsl:for-each>
10277
9914
  </fo:bookmark>
10278
9915
  </xsl:if>
9916
+ <xsl:if test="$contents_nodes//mn:tables/mn:table">
9917
+ <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
10279
9918
 
10280
- <xsl:if test="$contents_nodes//tables/table">
10281
- <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
10282
-
10283
- <xsl:variable name="bookmark-title">
10284
-
10285
- <xsl:value-of select="$title-list-tables"/>
10286
-
10287
- </xsl:variable>
9919
+ <xsl:variable name="bookmark-title">
9920
+ <xsl:value-of select="$title-list-tables"/>
9921
+ </xsl:variable>
10288
9922
 
10289
- <fo:bookmark-title><xsl:value-of select="$bookmark-title"/></fo:bookmark-title>
9923
+ <fo:bookmark-title><xsl:value-of select="$bookmark-title"/></fo:bookmark-title>
10290
9924
 
10291
- <xsl:for-each select="$contents_nodes//tables/table">
10292
- <fo:bookmark internal-destination="{@id}">
10293
- <!-- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title> -->
10294
- <fo:bookmark-title><xsl:apply-templates mode="bookmark_clean"/></fo:bookmark-title>
10295
- </fo:bookmark>
10296
- </xsl:for-each>
9925
+ <xsl:for-each select="$contents_nodes//mn:tables/mn:table">
9926
+ <fo:bookmark internal-destination="{@id}">
9927
+ <!-- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title> -->
9928
+ <fo:bookmark-title><xsl:apply-templates mode="bookmark_clean"/></fo:bookmark-title>
10297
9929
  </fo:bookmark>
10298
- </xsl:if>
10299
-
9930
+ </xsl:for-each>
9931
+ </fo:bookmark>
9932
+ </xsl:if>
10300
9933
  </xsl:template> <!-- insertTableBookmarks -->
10301
9934
  <!-- End Bookmarks -->
10302
9935
 
@@ -10326,17 +9959,15 @@
10326
9959
  <xsl:param name="title" select="''"/>
10327
9960
  <xsl:choose>
10328
9961
  <xsl:when test="$lang = 'en'">
10329
-
10330
9962
  </xsl:when>
10331
9963
  <xsl:when test="$lang = 'fr'">
10332
-
10333
9964
  </xsl:when>
10334
9965
  <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
10335
9966
  <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
10336
9967
  </xsl:choose>
10337
9968
  </xsl:template>
10338
9969
 
10339
- <xsl:template match="item" mode="bookmark">
9970
+ <xsl:template match="mn:item" mode="bookmark">
10340
9971
  <xsl:choose>
10341
9972
  <xsl:when test="@id != ''">
10342
9973
  <fo:bookmark internal-destination="{@id}" starting-state="hide">
@@ -10346,7 +9977,7 @@
10346
9977
  <xsl:text> </xsl:text>
10347
9978
  </xsl:if>
10348
9979
  <xsl:variable name="title">
10349
- <xsl:for-each select="title/node()">
9980
+ <xsl:for-each select="mn:title/node()">
10350
9981
  <xsl:choose>
10351
9982
  <xsl:when test="local-name() = 'add' and starts-with(., $ace_tag)"><!-- skip --></xsl:when>
10352
9983
  <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
@@ -10364,7 +9995,7 @@
10364
9995
  </xsl:choose>
10365
9996
  </xsl:template>
10366
9997
 
10367
- <xsl:template match="title" mode="bookmark"/>
9998
+ <xsl:template match="mn:title" mode="bookmark"/>
10368
9999
  <xsl:template match="text()" mode="bookmark"/>
10369
10000
 
10370
10001
  <!-- figure/name -->
@@ -10593,9 +10224,9 @@
10593
10224
  <xsl:template match="text()" mode="contents_item">
10594
10225
  <xsl:variable name="text">
10595
10226
  <!-- to split by '_' and other chars -->
10596
- <text><xsl:call-template name="add-zero-spaces-java"/></text>
10227
+ <mn:text><xsl:call-template name="add-zero-spaces-java"/></mn:text>
10597
10228
  </xsl:variable>
10598
- <xsl:for-each select="xalan:nodeset($text)/text/text()">
10229
+ <xsl:for-each select="xalan:nodeset($text)/mn:text/text()">
10599
10230
  <xsl:call-template name="keep_together_standard_number"/>
10600
10231
  </xsl:for-each>
10601
10232
  </xsl:template>
@@ -10628,14 +10259,7 @@
10628
10259
 
10629
10260
  <xsl:template name="get_sourcecode_attributes">
10630
10261
  <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
10631
- <xsl:variable name="_font-size">
10632
-
10633
- <!-- inherit -->
10634
-
10635
- <!-- <xsl:if test="$namespace = 'ieee'">
10636
- <xsl:if test="$current_template = 'standard'">8</xsl:if>
10637
- </xsl:if> -->
10638
-
10262
+ <xsl:variable name="_font-size"><!-- inherit -->
10639
10263
  </xsl:variable>
10640
10264
 
10641
10265
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -10691,7 +10315,6 @@
10691
10315
  <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
10692
10316
  </xsl:choose>
10693
10317
  </xsl:attribute>
10694
-
10695
10318
  </xsl:if>
10696
10319
  <fo:block-container margin-left="0mm" role="SKIP">
10697
10320
 
@@ -10715,8 +10338,7 @@
10715
10338
  </fo:block>
10716
10339
 
10717
10340
  <xsl:apply-templates select="*[local-name() = 'dl']"/> <!-- Key table -->
10718
-
10719
- <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
10341
+ <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
10720
10342
 
10721
10343
  </fo:block-container>
10722
10344
  </fo:block-container>
@@ -10893,25 +10515,6 @@
10893
10515
  </xsl:choose>
10894
10516
  </xsl:template>
10895
10517
 
10896
- <!-- insert 'char' between each character in the string -->
10897
- <xsl:template name="interspers">
10898
- <xsl:param name="str"/>
10899
- <xsl:param name="char" select="$zero_width_space"/>
10900
- <xsl:if test="$str != ''">
10901
- <xsl:value-of select="substring($str, 1, 1)"/>
10902
-
10903
- <xsl:variable name="next_char" select="substring($str, 2, 1)"/>
10904
- <xsl:if test="not(contains(concat(' -.:=_— ', $char), $next_char))">
10905
- <xsl:value-of select="$char"/>
10906
- </xsl:if>
10907
-
10908
- <xsl:call-template name="interspers">
10909
- <xsl:with-param name="str" select="substring($str, 2)"/>
10910
- <xsl:with-param name="char" select="$char"/>
10911
- </xsl:call-template>
10912
- </xsl:if>
10913
- </xsl:template>
10914
-
10915
10518
  <xsl:template name="interspers-java">
10916
10519
  <xsl:param name="str"/>
10917
10520
  <xsl:param name="char" select="$zero_width_space"/>
@@ -11008,7 +10611,7 @@
11008
10611
  </xsl:variable>
11009
10612
  <xsl:variable name="classes" select="xalan:nodeset($classes_)"/>
11010
10613
 
11011
- <xsl:for-each select="$classes/item">
10614
+ <xsl:for-each select="$classes/*[local-name() = 'item']">
11012
10615
  <xsl:variable name="class_name" select="."/>
11013
10616
  <xsl:for-each select="$syntax_highlight_styles/style[@class = $class_name]/@*[not(local-name() = 'class')]">
11014
10617
  <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
@@ -11091,12 +10694,9 @@
11091
10694
 
11092
10695
  <xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']">
11093
10696
  <xsl:if test="normalize-space() != ''">
11094
-
11095
- <fo:block xsl:use-attribute-sets="permission-name-style">
11096
- <xsl:apply-templates/>
11097
-
11098
- </fo:block>
11099
-
10697
+ <fo:block xsl:use-attribute-sets="permission-name-style">
10698
+ <xsl:apply-templates/>
10699
+ </fo:block>
11100
10700
  </xsl:if>
11101
10701
  </xsl:template>
11102
10702
 
@@ -11125,12 +10725,9 @@
11125
10725
  <xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']">
11126
10726
  <xsl:if test="normalize-space() != ''">
11127
10727
 
11128
- <fo:block xsl:use-attribute-sets="requirement-name-style">
11129
-
11130
- <xsl:apply-templates/>
11131
-
11132
- </fo:block>
11133
-
10728
+ <fo:block xsl:use-attribute-sets="requirement-name-style">
10729
+ <xsl:apply-templates/>
10730
+ </fo:block>
11134
10731
  </xsl:if>
11135
10732
  </xsl:template>
11136
10733
 
@@ -11169,11 +10766,9 @@
11169
10766
  <xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']">
11170
10767
  <xsl:if test="normalize-space() != ''">
11171
10768
 
11172
- <fo:block xsl:use-attribute-sets="recommendation-name-style">
11173
- <xsl:apply-templates/>
11174
-
11175
- </fo:block>
11176
-
10769
+ <fo:block xsl:use-attribute-sets="recommendation-name-style">
10770
+ <xsl:apply-templates/>
10771
+ </fo:block>
11177
10772
  </xsl:if>
11178
10773
  </xsl:template>
11179
10774
 
@@ -11299,7 +10894,6 @@
11299
10894
 
11300
10895
  <xsl:if test="parent::*[local-name()='thead'] or starts-with(*[local-name()='td' or local-name()='th'][1], 'Requirement ') or starts-with(*[local-name()='td' or local-name()='th'][1], 'Recommendation ')">
11301
10896
  <xsl:attribute name="font-weight">bold</xsl:attribute>
11302
-
11303
10897
  </xsl:if>
11304
10898
 
11305
10899
  <xsl:apply-templates mode="requirement"/>
@@ -11344,7 +10938,6 @@
11344
10938
 
11345
10939
  <xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
11346
10940
  <fo:block font-size="11pt">
11347
-
11348
10941
  <xsl:apply-templates/>
11349
10942
  </fo:block>
11350
10943
  </xsl:template>
@@ -11384,7 +10977,6 @@
11384
10977
  <xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
11385
10978
  <xsl:variable name="element">inline
11386
10979
 
11387
-
11388
10980
  </xsl:variable>
11389
10981
  <xsl:choose>
11390
10982
  <xsl:when test="contains($element, 'block')">
@@ -11416,110 +11008,105 @@
11416
11008
  text line 2
11417
11009
  -->
11418
11010
  <xsl:template match="*[local-name() = 'example']" name="example">
11011
+ <xsl:call-template name="setNamedDestination"/>
11012
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
11419
11013
 
11420
- <xsl:call-template name="setNamedDestination"/>
11421
- <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
11014
+ <xsl:call-template name="setBlockSpanAll"/>
11422
11015
 
11423
- <xsl:call-template name="setBlockSpanAll"/>
11016
+ <xsl:call-template name="refine_example-style"/>
11424
11017
 
11425
- <xsl:call-template name="refine_example-style"/>
11018
+ <xsl:variable name="fo_element">
11019
+ <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>block
11020
+ </xsl:variable>
11426
11021
 
11427
- <xsl:variable name="fo_element">
11428
- <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
11429
- block
11430
- </xsl:variable>
11022
+ <fo:block-container margin-left="0mm" role="SKIP">
11431
11023
 
11432
- <fo:block-container margin-left="0mm" role="SKIP">
11024
+ <xsl:choose>
11433
11025
 
11434
- <xsl:choose>
11026
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
11435
11027
 
11436
- <xsl:when test="contains(normalize-space($fo_element), 'block')">
11028
+ <!-- display name 'EXAMPLE' in a separate block -->
11029
+ <fo:block>
11030
+ <xsl:apply-templates select="*[local-name()='name']">
11031
+ <xsl:with-param name="fo_element" select="$fo_element"/>
11032
+ </xsl:apply-templates>
11033
+ </fo:block>
11437
11034
 
11438
- <!-- display name 'EXAMPLE' in a separate block -->
11439
- <fo:block>
11440
- <xsl:apply-templates select="*[local-name()='name']">
11035
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
11036
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
11037
+ <xsl:variable name="example_body">
11038
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
11441
11039
  <xsl:with-param name="fo_element" select="$fo_element"/>
11442
11040
  </xsl:apply-templates>
11443
- </fo:block>
11444
-
11445
- <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
11446
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
11447
- <xsl:variable name="example_body">
11448
- <xsl:apply-templates select="node()[not(local-name() = 'name')]">
11449
- <xsl:with-param name="fo_element" select="$fo_element"/>
11450
- </xsl:apply-templates>
11451
- </xsl:variable>
11452
- <xsl:choose>
11453
- <xsl:when test="xalan:nodeset($example_body)/*">
11454
- <xsl:copy-of select="$example_body"/>
11455
- </xsl:when>
11456
- <xsl:otherwise><fo:block/><!-- prevent empty block-container --></xsl:otherwise>
11457
- </xsl:choose>
11458
- </fo:block-container>
11459
- </fo:block-container>
11460
- </xsl:when> <!-- end block -->
11461
-
11462
- <xsl:when test="contains(normalize-space($fo_element), 'list')">
11041
+ </xsl:variable>
11042
+ <xsl:choose>
11043
+ <xsl:when test="xalan:nodeset($example_body)/*">
11044
+ <xsl:copy-of select="$example_body"/>
11045
+ </xsl:when>
11046
+ <xsl:otherwise><fo:block/><!-- prevent empty block-container --></xsl:otherwise>
11047
+ </xsl:choose>
11048
+ </fo:block-container>
11049
+ </fo:block-container>
11050
+ </xsl:when> <!-- end block -->
11463
11051
 
11464
- <xsl:variable name="provisional_distance_between_starts_">
11465
- 7
11466
- </xsl:variable>
11467
- <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
11468
- <xsl:variable name="indent_">
11469
- 0
11470
- </xsl:variable>
11471
- <xsl:variable name="indent" select="normalize-space($indent_)"/>
11472
-
11473
- <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
11474
- <fo:list-item>
11475
- <fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
11476
- <fo:block>
11477
- <xsl:apply-templates select="*[local-name()='name']">
11478
- <xsl:with-param name="fo_element">block</xsl:with-param>
11479
- </xsl:apply-templates>
11480
- </fo:block>
11481
- </fo:list-item-label>
11482
- <fo:list-item-body start-indent="body-start()">
11483
- <fo:block>
11484
- <xsl:apply-templates select="node()[not(local-name() = 'name')]">
11485
- <xsl:with-param name="fo_element" select="$fo_element"/>
11486
- </xsl:apply-templates>
11487
- </fo:block>
11488
- </fo:list-item-body>
11489
- </fo:list-item>
11490
- </fo:list-block>
11491
- </xsl:when> <!-- end list -->
11052
+ <xsl:when test="contains(normalize-space($fo_element), 'list')">
11492
11053
 
11493
- <xsl:otherwise> <!-- inline -->
11054
+ <xsl:variable name="provisional_distance_between_starts_">7
11055
+ </xsl:variable>
11056
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
11057
+ <xsl:variable name="indent_">0
11058
+ </xsl:variable>
11059
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
11494
11060
 
11495
- <!-- display 'EXAMPLE' and first element in the same line -->
11496
- <fo:block>
11497
- <xsl:apply-templates select="*[local-name()='name']">
11498
- <xsl:with-param name="fo_element" select="$fo_element"/>
11499
- </xsl:apply-templates>
11500
- <fo:inline>
11501
- <xsl:apply-templates select="*[not(local-name() = 'name')][1]">
11061
+ <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
11062
+ <fo:list-item>
11063
+ <fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
11064
+ <fo:block>
11065
+ <xsl:apply-templates select="*[local-name()='name']">
11066
+ <xsl:with-param name="fo_element">block</xsl:with-param>
11067
+ </xsl:apply-templates>
11068
+ </fo:block>
11069
+ </fo:list-item-label>
11070
+ <fo:list-item-body start-indent="body-start()">
11071
+ <fo:block>
11072
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
11502
11073
  <xsl:with-param name="fo_element" select="$fo_element"/>
11503
11074
  </xsl:apply-templates>
11504
- </fo:inline>
11505
- </fo:block>
11075
+ </fo:block>
11076
+ </fo:list-item-body>
11077
+ </fo:list-item>
11078
+ </fo:list-block>
11079
+ </xsl:when> <!-- end list -->
11506
11080
 
11507
- <xsl:if test="*[not(local-name() = 'name')][position() &gt; 1]">
11508
- <!-- display further elements in blocks -->
11509
- <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
11510
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
11511
- <xsl:apply-templates select="*[not(local-name() = 'name')][position() &gt; 1]">
11512
- <xsl:with-param name="fo_element" select="'block'"/>
11513
- </xsl:apply-templates>
11514
- </fo:block-container>
11515
- </fo:block-container>
11516
- </xsl:if>
11517
- </xsl:otherwise> <!-- end inline -->
11081
+ <xsl:otherwise> <!-- inline -->
11518
11082
 
11519
- </xsl:choose>
11520
- </fo:block-container>
11521
- </fo:block-container>
11083
+ <!-- display 'EXAMPLE' and first element in the same line -->
11084
+ <fo:block>
11085
+ <xsl:apply-templates select="*[local-name()='name']">
11086
+ <xsl:with-param name="fo_element" select="$fo_element"/>
11087
+ </xsl:apply-templates>
11088
+ <fo:inline>
11089
+ <xsl:apply-templates select="*[not(local-name() = 'name')][1]">
11090
+ <xsl:with-param name="fo_element" select="$fo_element"/>
11091
+ </xsl:apply-templates>
11092
+ </fo:inline>
11093
+ </fo:block>
11522
11094
 
11095
+ <xsl:if test="*[not(local-name() = 'name')][position() &gt; 1]">
11096
+ <!-- display further elements in blocks -->
11097
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
11098
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
11099
+ <xsl:apply-templates select="*[not(local-name() = 'name')][position() &gt; 1]">
11100
+ <xsl:with-param name="fo_element" select="'block'"/>
11101
+ </xsl:apply-templates>
11102
+ </fo:block-container>
11103
+ </fo:block-container>
11104
+ </xsl:if>
11105
+ </xsl:otherwise> <!-- end inline -->
11106
+
11107
+ </xsl:choose>
11108
+ </fo:block-container>
11109
+ </fo:block-container>
11523
11110
  </xsl:template>
11524
11111
 
11525
11112
  <!-- example/name -->
@@ -11534,7 +11121,6 @@
11534
11121
  </xsl:when>
11535
11122
  <xsl:when test="contains(normalize-space($fo_element), 'block')">
11536
11123
  <fo:block xsl:use-attribute-sets="example-name-style">
11537
-
11538
11124
  <xsl:apply-templates/>
11539
11125
  </fo:block>
11540
11126
  </xsl:when>
@@ -11551,9 +11137,7 @@
11551
11137
  <!-- table/example/name, table/tfoot//example/name -->
11552
11138
  <xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'tfoot']//*[local-name() = 'example']/*[local-name() = 'name']">
11553
11139
  <fo:inline xsl:use-attribute-sets="example-name-style">
11554
-
11555
- <xsl:attribute name="font-weight">bold</xsl:attribute>
11556
-
11140
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
11557
11141
  <xsl:apply-templates/>
11558
11142
  </fo:inline>
11559
11143
  </xsl:template>
@@ -11563,7 +11147,6 @@
11563
11147
 
11564
11148
  <xsl:variable name="num"><xsl:number/></xsl:variable>
11565
11149
  <xsl:variable name="element">
11566
-
11567
11150
  <xsl:value-of select="$fo_element"/>
11568
11151
  </xsl:variable>
11569
11152
  <xsl:choose>
@@ -11681,7 +11264,7 @@
11681
11264
  </xsl:call-template>
11682
11265
  </xsl:variable>
11683
11266
 
11684
- <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
11267
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
11685
11268
  <xsl:choose>
11686
11269
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
11687
11270
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
@@ -11718,7 +11301,6 @@
11718
11301
  <xsl:attribute name="margin-left">5mm</xsl:attribute>
11719
11302
  </xsl:if>
11720
11303
  </xsl:if>
11721
-
11722
11304
  <fo:block-container margin-left="0mm" role="SKIP">
11723
11305
  <fo:block-container xsl:use-attribute-sets="quote-style" role="SKIP">
11724
11306
 
@@ -11801,7 +11383,6 @@
11801
11383
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
11802
11384
  <xsl:attribute name="vertical-align">super</xsl:attribute>
11803
11385
  <xsl:attribute name="font-size">80%</xsl:attribute>
11804
-
11805
11386
  </xsl:if>
11806
11387
 
11807
11388
  <xsl:call-template name="refine_eref-style"/>
@@ -11850,7 +11431,6 @@
11850
11431
  </xsl:template>
11851
11432
 
11852
11433
  <xsl:template name="refine_basic_link_style">
11853
-
11854
11434
  </xsl:template> <!-- refine_basic_link_style -->
11855
11435
 
11856
11436
  <!-- ====== -->
@@ -11867,7 +11447,6 @@
11867
11447
  </xsl:variable>
11868
11448
 
11869
11449
  <xsl:variable name="padding">
11870
-
11871
11450
  </xsl:variable>
11872
11451
 
11873
11452
  <xsl:variable name="padding-right">
@@ -11878,7 +11457,6 @@
11878
11457
  </xsl:otherwise>
11879
11458
  </xsl:choose>
11880
11459
  </xsl:variable>
11881
-
11882
11460
  <xsl:choose>
11883
11461
  <xsl:when test="$lang = 'zh'">
11884
11462
  <fo:inline role="SKIP"><xsl:value-of select="$tab_zh"/></fo:inline>
@@ -11902,7 +11480,6 @@
11902
11480
  <xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']/*[local-name() = 'tab']" priority="2"/>
11903
11481
 
11904
11482
  <xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']/*[local-name() = 'tab']" mode="tab">
11905
-
11906
11483
  </xsl:template>
11907
11484
 
11908
11485
  <xsl:template name="insertNonBreakSpaces">
@@ -11920,8 +11497,7 @@
11920
11497
  <xsl:variable name="level">
11921
11498
  <xsl:call-template name="getLevel"/>
11922
11499
  </xsl:variable>
11923
- <xsl:variable name="font-size">
11924
- inherit
11500
+ <xsl:variable name="font-size">inherit
11925
11501
  </xsl:variable>
11926
11502
  <xsl:variable name="levelTerm">
11927
11503
  <xsl:call-template name="getLevelTermName"/>
@@ -11973,11 +11549,9 @@
11973
11549
  </xsl:template>
11974
11550
 
11975
11551
  <xsl:template name="setStyle_preferred">
11976
-
11977
- <xsl:if test="*[local-name() = 'strong']">
11978
- <xsl:attribute name="font-weight">normal</xsl:attribute>
11979
- </xsl:if>
11980
-
11552
+ <xsl:if test="*[local-name() = 'strong']">
11553
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
11554
+ </xsl:if>
11981
11555
  </xsl:template>
11982
11556
 
11983
11557
  <!-- regarding ISO 10241-1:2011, If there is more than one preferred term, each preferred term follows the previous one on a new line. -->
@@ -12054,7 +11628,6 @@
12054
11628
 
12055
11629
  <!-- main sections -->
12056
11630
  <xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
12057
-
12058
11631
  <xsl:call-template name="setNamedDestination"/>
12059
11632
  <fo:block>
12060
11633
  <xsl:call-template name="setId"/>
@@ -12089,13 +11662,10 @@
12089
11662
  </xsl:template>
12090
11663
 
12091
11664
  <xsl:template name="sections_element_style">
12092
-
12093
11665
  </xsl:template> <!-- sections_element_style -->
12094
11666
 
12095
11667
  <xsl:template match="//*[local-name() = 'metanorma']/*[local-name() = 'preface']/*" priority="2" name="preface_node"> <!-- /*/*[local-name() = 'preface']/* -->
12096
-
12097
- <fo:block break-after="page"/>
12098
-
11668
+ <fo:block break-after="page"/>
12099
11669
  <xsl:call-template name="setNamedDestination"/>
12100
11670
  <fo:block>
12101
11671
  <xsl:call-template name="setId"/>
@@ -12144,7 +11714,6 @@
12144
11714
  </xsl:template>
12145
11715
 
12146
11716
  <xsl:template name="refine_clause_style">
12147
-
12148
11717
  </xsl:template> <!-- refine_clause_style -->
12149
11718
 
12150
11719
  <xsl:template match="*[local-name() = 'definitions']">
@@ -12184,7 +11753,6 @@
12184
11753
  </xsl:template>
12185
11754
 
12186
11755
  <xsl:template name="refine_annex_style">
12187
-
12188
11756
  </xsl:template>
12189
11757
 
12190
11758
  <!-- document text (not figures, or tables) footnotes -->
@@ -12288,16 +11856,14 @@
12288
11856
  <!-- Lists processing -->
12289
11857
  <!-- ===================================== -->
12290
11858
  <xsl:variable name="ul_labels_">
12291
-
12292
- <label level="1">-</label> <!-- full-width hyphen minus -->
12293
- <label level="2" font-size="130%" line-height="1.2">・</label> <!-- Katakana Middle Dot -->
11859
+ <label level="1">-</label> <!-- full-width hyphen minus -->
11860
+ <label level="2" font-size="130%" line-height="1.2">・</label> <!-- Katakana Middle Dot -->
12294
11861
 
12295
11862
  </xsl:variable>
12296
11863
  <xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/>
12297
11864
 
12298
11865
  <xsl:template name="setULLabel">
12299
- <xsl:variable name="list_level__">
12300
- <xsl:value-of select="count(ancestor::*[local-name() = 'ul'])"/>
11866
+ <xsl:variable name="list_level__"><xsl:value-of select="count(ancestor::*[local-name() = 'ul'])"/>
12301
11867
  </xsl:variable>
12302
11868
  <xsl:variable name="list_level_" select="number($list_level__)"/>
12303
11869
  <xsl:variable name="list_level">
@@ -12354,28 +11920,22 @@
12354
11920
  <xsl:variable name="label">
12355
11921
 
12356
11922
  <xsl:variable name="style_prefix_">
12357
- <xsl:if test="$type = 'roman'">
12358
- <!-- Example: (i) -->
11923
+ <xsl:if test="$type = 'roman'"> <!-- Example: (i) -->
12359
11924
  </xsl:if>
12360
11925
  <xsl:if test="$type = 'alphabet'">
12361
-
12362
11926
  </xsl:if>
12363
11927
  </xsl:variable>
12364
11928
  <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
12365
11929
 
12366
11930
  <xsl:variable name="style_suffix_">
12367
11931
  <xsl:choose>
12368
- <xsl:when test="$type = 'arabic'">
12369
- )
11932
+ <xsl:when test="$type = 'arabic'">)
12370
11933
  </xsl:when>
12371
- <xsl:when test="$type = 'alphabet' or $type = 'alphabetic'">
12372
- )
11934
+ <xsl:when test="$type = 'alphabet' or $type = 'alphabetic'">)
12373
11935
  </xsl:when>
12374
- <xsl:when test="$type = 'alphabet_upper' or $type = 'alphabetic_upper'">
12375
- .
11936
+ <xsl:when test="$type = 'alphabet_upper' or $type = 'alphabetic_upper'">.
12376
11937
  </xsl:when>
12377
- <xsl:when test="$type = 'roman'">
12378
- )
11938
+ <xsl:when test="$type = 'roman'">)
12379
11939
  </xsl:when>
12380
11940
  <xsl:when test="$type = 'roman_upper'">.</xsl:when> <!-- Example: I. -->
12381
11941
  </xsl:choose>
@@ -12392,8 +11952,7 @@
12392
11952
  <xsl:value-of select="$style_suffix"/>
12393
11953
  </xsl:if>
12394
11954
  </xsl:variable>
12395
-
12396
- <xsl:value-of select="normalize-space($label)"/>
11955
+ <xsl:value-of select="normalize-space($label)"/>
12397
11956
 
12398
11957
  </xsl:when>
12399
11958
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
@@ -12450,17 +12009,13 @@
12450
12009
 
12451
12010
  <xsl:variable name="format">
12452
12011
  <xsl:choose>
12453
- <xsl:when test="$type = 'arabic'">
12454
- 1)
12012
+ <xsl:when test="$type = 'arabic'">1)
12455
12013
  </xsl:when>
12456
- <xsl:when test="$type = 'alphabet' or $type = 'alphabetic'">
12457
- a)
12014
+ <xsl:when test="$type = 'alphabet' or $type = 'alphabetic'">a)
12458
12015
  </xsl:when>
12459
- <xsl:when test="$type = 'alphabet_upper' or $type = 'alphabetic_upper'">
12460
- A.
12016
+ <xsl:when test="$type = 'alphabet_upper' or $type = 'alphabetic_upper'">A.
12461
12017
  </xsl:when>
12462
- <xsl:when test="$type = 'roman'">
12463
- i)
12018
+ <xsl:when test="$type = 'roman'">i)
12464
12019
  </xsl:when>
12465
12020
  <xsl:when test="$type = 'roman_upper'">I.</xsl:when>
12466
12021
  <xsl:otherwise>1.</xsl:otherwise> <!-- for any case, if $type has non-determined value, not using -->
@@ -12497,26 +12052,24 @@
12497
12052
  </fo:block-container>
12498
12053
  </xsl:when>
12499
12054
  <xsl:otherwise>
12500
-
12501
- <fo:block-container role="SKIP">
12502
- <xsl:if test="local-name() = 'ol' and (ancestor::plateau:li)">
12503
- <xsl:attribute name="margin-left"><xsl:value-of select="count(ancestor::plateau:li) * 6 + 6"/>mm</xsl:attribute>
12504
- </xsl:if>
12505
- <fo:block-container margin-left="0mm" role="SKIP">
12506
- <fo:block>
12507
- <xsl:apply-templates select="." mode="list">
12508
- <xsl:with-param name="indent" select="$indent"/>
12509
- </xsl:apply-templates>
12510
- </fo:block>
12511
- </fo:block-container>
12512
- </fo:block-container>
12055
+ <fo:block-container role="SKIP">
12056
+ <xsl:if test="local-name() = 'ol' and (ancestor::plateau:li)">
12057
+ <xsl:attribute name="margin-left"><xsl:value-of select="count(ancestor::plateau:li) * 6 + 6"/>mm</xsl:attribute>
12058
+ </xsl:if>
12059
+ <fo:block-container margin-left="0mm" role="SKIP">
12060
+ <fo:block>
12061
+ <xsl:apply-templates select="." mode="list">
12062
+ <xsl:with-param name="indent" select="$indent"/>
12063
+ </xsl:apply-templates>
12064
+ </fo:block>
12065
+ </fo:block-container>
12066
+ </fo:block-container>
12513
12067
 
12514
12068
  </xsl:otherwise>
12515
12069
  </xsl:choose>
12516
12070
  </xsl:template>
12517
12071
 
12518
12072
  <xsl:template name="refine_list_container_style">
12519
-
12520
12073
  </xsl:template> <!-- refine_list_container_style -->
12521
12074
 
12522
12075
  <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
@@ -12580,7 +12133,6 @@
12580
12133
  </xsl:template>
12581
12134
 
12582
12135
  <xsl:template name="refine_list-style_provisional-distance-between-starts">
12583
-
12584
12136
  </xsl:template> <!-- refine_list-style_provisional-distance-between-starts -->
12585
12137
 
12586
12138
  <xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
@@ -12865,9 +12417,7 @@
12865
12417
  <xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
12866
12418
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
12867
12419
  <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
12868
-
12869
- <xsl:attribute name="space-after">12pt</xsl:attribute>
12870
-
12420
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
12871
12421
  <xsl:apply-templates/>
12872
12422
  </fo:block>
12873
12423
  </xsl:template>
@@ -12919,7 +12469,6 @@
12919
12469
  <fo:table-column column-width="15mm"/>
12920
12470
  <fo:table-body>
12921
12471
  <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
12922
-
12923
12472
  <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Date</fo:block></fo:table-cell>
12924
12473
  <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Type</fo:block></fo:table-cell>
12925
12474
  <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Change</fo:block></fo:table-cell>
@@ -12955,7 +12504,6 @@
12955
12504
  <xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/>
12956
12505
  <xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3">
12957
12506
  <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/>
12958
-
12959
12507
  </xsl:template>
12960
12508
  <!-- don't display bibitem with @id starts with '_hidden', that was introduced for references integrity -->
12961
12509
  <xsl:template match="*[local-name() = 'bibitem'][starts-with(@id, 'hidden_bibitem_')]" priority="3"/>
@@ -12966,16 +12514,13 @@
12966
12514
  <xsl:call-template name="setNamedDestination"/>
12967
12515
  <fo:block id="{@id}">
12968
12516
  <xsl:apply-templates/>
12969
-
12970
12517
  </fo:block>
12971
12518
  </xsl:template>
12972
12519
 
12973
12520
  <!-- Bibliography (non-normative references) -->
12974
12521
  <xsl:template match="*[local-name() = 'references']">
12975
12522
  <xsl:if test="not(ancestor::*[local-name() = 'annex'])">
12976
-
12977
- <fo:block break-after="page"/>
12978
-
12523
+ <fo:block break-after="page"/>
12979
12524
  </xsl:if>
12980
12525
 
12981
12526
  <!-- <xsl:if test="ancestor::*[local-name() = 'annex']">
@@ -12991,9 +12536,7 @@
12991
12536
 
12992
12537
  <fo:block xsl:use-attribute-sets="references-non-normative-style">
12993
12538
  <xsl:apply-templates select="node()[not(local-name() = 'title' and @columns = 1)]"/>
12994
-
12995
12539
  </fo:block>
12996
-
12997
12540
  </xsl:template> <!-- references -->
12998
12541
 
12999
12542
  <xsl:template match="*[local-name() = 'bibitem']">
@@ -13003,44 +12546,39 @@
13003
12546
  <!-- Normative references -->
13004
12547
  <xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
13005
12548
  <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
13006
-
13007
- <xsl:call-template name="setNamedDestination"/>
13008
- <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
13009
-
13010
- <xsl:call-template name="processBibitem"/>
13011
- </fo:block>
12549
+ <xsl:call-template name="setNamedDestination"/>
12550
+ <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
12551
+ <xsl:call-template name="processBibitem"/>
12552
+ </fo:block>
13012
12553
 
13013
12554
  </xsl:template> <!-- bibitem -->
13014
12555
 
13015
12556
  <!-- Bibliography (non-normative references) -->
13016
12557
  <xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" name="bibitem_non_normative" priority="2">
13017
- <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
13018
- <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'ieee' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
12558
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first --> <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'ieee' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
13019
12559
  $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
13020
- <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
13021
- <xsl:call-template name="setNamedDestination"/>
13022
- <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
13023
-
13024
- <fo:list-item>
13025
- <fo:list-item-label end-indent="label-end()">
13026
- <fo:block role="SKIP">
13027
- <fo:inline role="SKIP">
13028
-
13029
- <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
13030
- <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
13031
- </xsl:apply-templates>
13032
- </fo:inline>
13033
- </fo:block>
13034
- </fo:list-item-label>
13035
- <fo:list-item-body start-indent="body-start()">
13036
- <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
13037
- <xsl:call-template name="processBibitem">
13038
- <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
13039
- </xsl:call-template>
13040
- </fo:block>
13041
- </fo:list-item-body>
13042
- </fo:list-item>
13043
- </fo:list-block>
12560
+ <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
12561
+ <xsl:call-template name="setNamedDestination"/>
12562
+ <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
12563
+ <fo:list-item>
12564
+ <fo:list-item-label end-indent="label-end()">
12565
+ <fo:block role="SKIP">
12566
+ <fo:inline role="SKIP">
12567
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
12568
+ <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
12569
+ </xsl:apply-templates>
12570
+ </fo:inline>
12571
+ </fo:block>
12572
+ </fo:list-item-label>
12573
+ <fo:list-item-body start-indent="body-start()">
12574
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
12575
+ <xsl:call-template name="processBibitem">
12576
+ <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
12577
+ </xsl:call-template>
12578
+ </fo:block>
12579
+ </fo:list-item-body>
12580
+ </fo:list-item>
12581
+ </fo:list-block>
13044
12582
 
13045
12583
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
13046
12584
 
@@ -13050,7 +12588,6 @@
13050
12588
  <xsl:otherwise>
13051
12589
  <xsl:call-template name="setNamedDestination"/>
13052
12590
  <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
13053
-
13054
12591
  <fo:list-item-label end-indent="label-end()">
13055
12592
  <fo:block role="SKIP">
13056
12593
  <fo:inline role="SKIP">
@@ -13077,18 +12614,16 @@
13077
12614
 
13078
12615
  <xsl:template name="processBibitem">
13079
12616
  <xsl:param name="biblio_tag_part">both</xsl:param>
12617
+ <!-- start bibitem processing -->
12618
+ <xsl:if test=".//*[local-name() = 'fn']">
12619
+ <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
12620
+ </xsl:if>
13080
12621
 
13081
- <!-- start bibitem processing -->
13082
- <xsl:if test=".//*[local-name() = 'fn']">
13083
- <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
13084
- </xsl:if>
13085
-
13086
- <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
13087
- <xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
13088
- </xsl:apply-templates>
13089
- <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
13090
- <!-- end bibitem processing -->
13091
-
12622
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
12623
+ <xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
12624
+ </xsl:apply-templates>
12625
+ <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
12626
+ <!-- end bibitem processing -->
13092
12627
  </xsl:template> <!-- processBibitem (bibitem) -->
13093
12628
 
13094
12629
  <xsl:template match="*[local-name() = 'title']" mode="title">
@@ -13231,8 +12766,7 @@
13231
12766
  <xsl:choose>
13232
12767
  <xsl:when test="$pdftoclevels != ''"><xsl:value-of select="number($pdftoclevels)"/></xsl:when> <!-- if there is value in xml -->
13233
12768
  <xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
13234
- <xsl:otherwise><!-- default value -->
13235
- 2
12769
+ <xsl:otherwise><!-- default value -->2
13236
12770
  </xsl:otherwise>
13237
12771
  </xsl:choose>
13238
12772
  </xsl:variable>
@@ -13440,26 +12974,19 @@
13440
12974
  <!-- ================ -->
13441
12975
  <!-- Admonition -->
13442
12976
  <!-- ================ -->
13443
- <xsl:template match="*[local-name() = 'admonition']">
13444
-
13445
- <!-- text in the box -->
13446
- <xsl:call-template name="setNamedDestination"/>
13447
- <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
13448
-
13449
- <xsl:call-template name="setBlockSpanAll"/>
13450
-
13451
- <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
13452
-
13453
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
13454
- <fo:block>
13455
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
13456
- </fo:block>
13457
- </fo:block-container>
13458
-
13459
- </fo:block-container>
13460
-
13461
- </fo:block-container>
12977
+ <xsl:template match="*[local-name() = 'admonition']"> <!-- text in the box -->
12978
+ <xsl:call-template name="setNamedDestination"/>
12979
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
13462
12980
 
12981
+ <xsl:call-template name="setBlockSpanAll"/>
12982
+ <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
12983
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
12984
+ <fo:block>
12985
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
12986
+ </fo:block>
12987
+ </fo:block-container>
12988
+ </fo:block-container>
12989
+ </fo:block-container>
13463
12990
  </xsl:template>
13464
12991
 
13465
12992
  <xsl:template name="displayAdmonitionName">
@@ -13507,12 +13034,10 @@
13507
13034
  </xsl:template> -->
13508
13035
 
13509
13036
  <xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'p']">
13037
+ <fo:block xsl:use-attribute-sets="admonition-p-style">
13510
13038
 
13511
- <fo:block xsl:use-attribute-sets="admonition-p-style">
13512
-
13513
- <xsl:apply-templates/>
13514
- </fo:block>
13515
-
13039
+ <xsl:apply-templates/>
13040
+ </fo:block>
13516
13041
  </xsl:template>
13517
13042
 
13518
13043
  <!-- ================ -->
@@ -13548,10 +13073,9 @@
13548
13073
 
13549
13074
  <!-- STEP2: add 'fn' after 'eref' and 'origin', if referenced to bibitem with 'note' = Withdrawn.' or 'Cancelled and replaced...' -->
13550
13075
  <xsl:variable name="updated_xml_step2">
13551
-
13552
- <xsl:if test="$table_if = 'false'">
13553
- <xsl:apply-templates select="xalan:nodeset($updated_xml_step1)" mode="update_xml_step2"/>
13554
- </xsl:if>
13076
+ <xsl:if test="$table_if = 'false'">
13077
+ <xsl:apply-templates select="xalan:nodeset($updated_xml_step1)" mode="update_xml_step2"/>
13078
+ </xsl:if>
13555
13079
 
13556
13080
  </xsl:variable>
13557
13081
 
@@ -14027,7 +13551,6 @@
14027
13551
  </xsl:template>
14028
13552
 
14029
13553
  <xsl:template name="addNamedDestinationAttribute">
14030
-
14031
13554
  </xsl:template>
14032
13555
 
14033
13556
  <xsl:template match="*[local-name() = 'fmt-name']"/>
@@ -14482,58 +14005,57 @@
14482
14005
  <!-- =========================================================================== -->
14483
14006
  <!-- END STEP MOVE PAGEBREAK: move <pagebreak/> at top level under 'preface' and 'sections' -->
14484
14007
  <!-- =========================================================================== -->
14008
+ <!-- =========================================================================== -->
14009
+ <!-- STEP2: add 'fn' after 'eref' and 'origin', if referenced to bibitem with 'note' = Withdrawn.' or 'Cancelled and replaced...' -->
14010
+ <!-- =========================================================================== -->
14011
+ <xsl:template match="@*|node()" mode="update_xml_step2">
14012
+ <xsl:copy>
14013
+ <xsl:apply-templates select="@*|node()" mode="update_xml_step2"/>
14014
+ </xsl:copy>
14015
+ </xsl:template>
14485
14016
 
14486
- <!-- =========================================================================== -->
14487
- <!-- STEP2: add 'fn' after 'eref' and 'origin', if referenced to bibitem with 'note' = Withdrawn.' or 'Cancelled and replaced...' -->
14488
- <!-- =========================================================================== -->
14489
- <xsl:template match="@*|node()" mode="update_xml_step2">
14490
- <xsl:copy>
14491
- <xsl:apply-templates select="@*|node()" mode="update_xml_step2"/>
14492
- </xsl:copy>
14493
- </xsl:template>
14494
-
14495
- <xsl:variable name="localized_string_withdrawn">
14017
+ <xsl:variable name="localized_string_withdrawn">
14018
+ <xsl:call-template name="getLocalizedString">
14019
+ <xsl:with-param name="key">withdrawn</xsl:with-param>
14020
+ </xsl:call-template>
14021
+ </xsl:variable>
14022
+ <xsl:variable name="localized_string_cancelled_and_replaced">
14023
+ <xsl:variable name="str">
14496
14024
  <xsl:call-template name="getLocalizedString">
14497
- <xsl:with-param name="key">withdrawn</xsl:with-param>
14025
+ <xsl:with-param name="key">cancelled_and_replaced</xsl:with-param>
14498
14026
  </xsl:call-template>
14499
14027
  </xsl:variable>
14500
- <xsl:variable name="localized_string_cancelled_and_replaced">
14501
- <xsl:variable name="str">
14502
- <xsl:call-template name="getLocalizedString">
14503
- <xsl:with-param name="key">cancelled_and_replaced</xsl:with-param>
14504
- </xsl:call-template>
14505
- </xsl:variable>
14506
- <xsl:choose>
14507
- <xsl:when test="contains($str, '%')"><xsl:value-of select="substring-before($str, '%')"/></xsl:when>
14508
- <xsl:otherwise><xsl:value-of select="$str"/></xsl:otherwise>
14509
- </xsl:choose>
14510
- </xsl:variable>
14028
+ <xsl:choose>
14029
+ <xsl:when test="contains($str, '%')"><xsl:value-of select="substring-before($str, '%')"/></xsl:when>
14030
+ <xsl:otherwise><xsl:value-of select="$str"/></xsl:otherwise>
14031
+ </xsl:choose>
14032
+ </xsl:variable>
14511
14033
 
14512
- <!-- add 'fn' after eref and origin, to reference bibitem with note = 'Withdrawn.' or 'Cancelled and replaced...' -->
14513
- <xsl:template match="*[local-name() = 'eref'] | *[local-name() = 'origin']" mode="update_xml_step2">
14514
- <xsl:copy-of select="."/>
14034
+ <!-- add 'fn' after eref and origin, to reference bibitem with note = 'Withdrawn.' or 'Cancelled and replaced...' -->
14035
+ <xsl:template match="*[local-name() = 'eref'] | *[local-name() = 'origin']" mode="update_xml_step2">
14036
+ <xsl:copy-of select="."/>
14515
14037
 
14516
- <xsl:variable name="bibitemid" select="@bibitemid"/>
14517
- <xsl:variable name="local_name" select="local-name()"/>
14518
- <xsl:variable name="position"><xsl:number count="*[local-name() = $local_name][@bibitemid = $bibitemid]" level="any"/></xsl:variable>
14519
- <xsl:if test="normalize-space($position) = '1'">
14520
- <xsl:variable name="fn_text">
14521
- <!-- <xsl:copy-of select="key('bibitems', $bibitemid)[1]/*[local-name() = 'note'][not(@type='Unpublished-Status')][normalize-space() = $localized_string_withdrawn or starts-with(normalize-space(), $localized_string_cancelled_and_replaced)]/node()" /> -->
14522
- <xsl:copy-of select="$bibitems/*[local-name() ='bibitem'][@id = $bibitemid][1]/*[local-name() = 'note'][not(@type='Unpublished-Status')][normalize-space() = $localized_string_withdrawn or starts-with(normalize-space(), $localized_string_cancelled_and_replaced)]/node()"/>
14523
- </xsl:variable>
14524
- <xsl:if test="normalize-space($fn_text) != ''">
14525
- <xsl:element name="fn" namespace="{$namespace_full}">
14526
- <xsl:attribute name="reference">bibitem_<xsl:value-of select="$bibitemid"/></xsl:attribute>
14527
- <xsl:element name="p" namespace="{$namespace_full}">
14528
- <xsl:copy-of select="$fn_text"/>
14529
- </xsl:element>
14038
+ <xsl:variable name="bibitemid" select="@bibitemid"/>
14039
+ <xsl:variable name="local_name" select="local-name()"/>
14040
+ <xsl:variable name="position"><xsl:number count="*[local-name() = $local_name][@bibitemid = $bibitemid]" level="any"/></xsl:variable>
14041
+ <xsl:if test="normalize-space($position) = '1'">
14042
+ <xsl:variable name="fn_text">
14043
+ <!-- <xsl:copy-of select="key('bibitems', $bibitemid)[1]/*[local-name() = 'note'][not(@type='Unpublished-Status')][normalize-space() = $localized_string_withdrawn or starts-with(normalize-space(), $localized_string_cancelled_and_replaced)]/node()" /> -->
14044
+ <xsl:copy-of select="$bibitems/*[local-name() ='bibitem'][@id = $bibitemid][1]/*[local-name() = 'note'][not(@type='Unpublished-Status')][normalize-space() = $localized_string_withdrawn or starts-with(normalize-space(), $localized_string_cancelled_and_replaced)]/node()"/>
14045
+ </xsl:variable>
14046
+ <xsl:if test="normalize-space($fn_text) != ''">
14047
+ <xsl:element name="fn" namespace="{$namespace_full}">
14048
+ <xsl:attribute name="reference">bibitem_<xsl:value-of select="$bibitemid"/></xsl:attribute>
14049
+ <xsl:element name="p" namespace="{$namespace_full}">
14050
+ <xsl:copy-of select="$fn_text"/>
14530
14051
  </xsl:element>
14531
- </xsl:if>
14052
+ </xsl:element>
14532
14053
  </xsl:if>
14533
- </xsl:template>
14054
+ </xsl:if>
14055
+ </xsl:template>
14534
14056
 
14535
- <!-- add id for table without id (for autolayout algorithm) -->
14536
- <!-- <xsl:template match="*[local-name() = 'table'][not(@id)]" mode="update_xml_step2">
14057
+ <!-- add id for table without id (for autolayout algorithm) -->
14058
+ <!-- <xsl:template match="*[local-name() = 'table'][not(@id)]" mode="update_xml_step2">
14537
14059
  <xsl:copy>
14538
14060
  <xsl:apply-templates select="@*" mode="update_xml_step2"/>
14539
14061
  <xsl:attribute name="id">_abc<xsl:value-of select="generate-id()"/></xsl:attribute>
@@ -14542,17 +14064,17 @@
14542
14064
  </xsl:copy>
14543
14065
  </xsl:template> -->
14544
14066
 
14545
- <!-- add @reference for fn -->
14546
- <xsl:template match="*[local-name() = 'fn'][not(@reference)]" mode="update_xml_step2">
14547
- <xsl:copy>
14548
- <xsl:apply-templates select="@*" mode="update_xml_step2"/>
14549
- <xsl:attribute name="reference"><xsl:value-of select="generate-id(.)"/></xsl:attribute>
14550
- <xsl:apply-templates select="node()" mode="update_xml_step2"/>
14551
- </xsl:copy>
14552
- </xsl:template>
14067
+ <!-- add @reference for fn -->
14068
+ <xsl:template match="*[local-name() = 'fn'][not(@reference)]" mode="update_xml_step2">
14069
+ <xsl:copy>
14070
+ <xsl:apply-templates select="@*" mode="update_xml_step2"/>
14071
+ <xsl:attribute name="reference"><xsl:value-of select="generate-id(.)"/></xsl:attribute>
14072
+ <xsl:apply-templates select="node()" mode="update_xml_step2"/>
14073
+ </xsl:copy>
14074
+ </xsl:template>
14553
14075
 
14554
- <!-- add @reference for bibitem/note, similar to fn/reference -->
14555
- <!-- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" mode="update_xml_step2">
14076
+ <!-- add @reference for bibitem/note, similar to fn/reference -->
14077
+ <!-- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" mode="update_xml_step2">
14556
14078
  <xsl:copy>
14557
14079
  <xsl:apply-templates select="@*" mode="update_xml_step2"/>
14558
14080
 
@@ -14564,28 +14086,28 @@
14564
14086
  </xsl:copy>
14565
14087
  </xsl:template> -->
14566
14088
 
14567
- <!-- enclose sequence of 'char x' + 'combining char y' to <lang_none>xy</lang_none> -->
14568
- <xsl:variable name="regex_combining_chars">(.[̀-ͯ])</xsl:variable>
14569
- <xsl:variable name="element_name_lang_none">lang_none</xsl:variable>
14570
- <xsl:variable name="tag_element_name_lang_none_open">###<xsl:value-of select="$element_name_lang_none"/>###</xsl:variable>
14571
- <xsl:variable name="tag_element_name_lang_none_close">###/<xsl:value-of select="$element_name_lang_none"/>###</xsl:variable>
14572
-
14573
- <xsl:template match="text()" mode="update_xml_step2">
14574
- <xsl:variable name="text_" select="java:replaceAll(java:java.lang.String.new(.), $regex_combining_chars, concat($tag_element_name_lang_none_open,'$1',$tag_element_name_lang_none_close))"/>
14575
- <xsl:call-template name="replace_text_tags">
14576
- <xsl:with-param name="tag_open" select="$tag_element_name_lang_none_open"/>
14577
- <xsl:with-param name="tag_close" select="$tag_element_name_lang_none_close"/>
14578
- <xsl:with-param name="text" select="$text_"/>
14579
- </xsl:call-template>
14580
- </xsl:template>
14089
+ <!-- enclose sequence of 'char x' + 'combining char y' to <lang_none>xy</lang_none> -->
14090
+ <xsl:variable name="regex_combining_chars">(.[̀-ͯ])</xsl:variable>
14091
+ <xsl:variable name="element_name_lang_none">lang_none</xsl:variable>
14092
+ <xsl:variable name="tag_element_name_lang_none_open">###<xsl:value-of select="$element_name_lang_none"/>###</xsl:variable>
14093
+ <xsl:variable name="tag_element_name_lang_none_close">###/<xsl:value-of select="$element_name_lang_none"/>###</xsl:variable>
14094
+
14095
+ <xsl:template match="text()" mode="update_xml_step2">
14096
+ <xsl:variable name="text_" select="java:replaceAll(java:java.lang.String.new(.), $regex_combining_chars, concat($tag_element_name_lang_none_open,'$1',$tag_element_name_lang_none_close))"/>
14097
+ <xsl:call-template name="replace_text_tags">
14098
+ <xsl:with-param name="tag_open" select="$tag_element_name_lang_none_open"/>
14099
+ <xsl:with-param name="tag_close" select="$tag_element_name_lang_none_close"/>
14100
+ <xsl:with-param name="text" select="$text_"/>
14101
+ </xsl:call-template>
14102
+ </xsl:template>
14581
14103
 
14582
- <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_step2">
14583
- <xsl:copy-of select="."/>
14584
- </xsl:template>
14104
+ <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_step2">
14105
+ <xsl:copy-of select="."/>
14106
+ </xsl:template>
14585
14107
 
14586
- <!-- =========================================================================== -->
14587
- <!-- END STEP2: add 'fn' after 'eref' and 'origin', if referenced to bibitem with 'note' = Withdrawn.' or 'Cancelled and replaced...' -->
14588
- <!-- =========================================================================== -->
14108
+ <!-- =========================================================================== -->
14109
+ <!-- END STEP2: add 'fn' after 'eref' and 'origin', if referenced to bibitem with 'note' = Withdrawn.' or 'Cancelled and replaced...' -->
14110
+ <!-- =========================================================================== -->
14589
14111
 
14590
14112
  <!-- =========================================================================== -->
14591
14113
  <!-- XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
@@ -14626,7 +14148,6 @@
14626
14148
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
14627
14149
  <xsl:if test="not(ancestor::*[local-name() = 'table'])"><regex><xsl:value-of select="$regex_standard_reference"/></regex></xsl:if>
14628
14150
  <!-- if EXPRESS reference -->
14629
-
14630
14151
  <!-- keep-together_within-line for: a/b, aaa/b, a/bbb, /b -->
14631
14152
  <regex><xsl:value-of select="$regex_solidus_units"/></regex>
14632
14153
  <!-- keep-together_within-line for: a.b, aaa.b, a.bbb, .b in table's cell ONLY -->
@@ -14680,8 +14201,7 @@
14680
14201
 
14681
14202
  <xsl:variable name="text2">
14682
14203
  <xsl:element name="text" namespace="{$namespace_full}">
14683
- <xsl:for-each select="xalan:nodeset($text)/*[local-name() = 'text']/node()">
14684
- <xsl:copy-of select="."/>
14204
+ <xsl:for-each select="xalan:nodeset($text)/*[local-name() = 'text']/node()"><xsl:copy-of select="."/>
14685
14205
  </xsl:for-each>
14686
14206
  </xsl:element>
14687
14207
  </xsl:variable>
@@ -14973,11 +14493,10 @@
14973
14493
  </xsl:attribute>
14974
14494
  <xsl:variable name="skip_footnote_body_" select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
14975
14495
  <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
14976
-
14977
- <xsl:choose>
14978
- <xsl:when test="ancestor::*[local-name() = 'ul' or local-name() ='ol' or local-name() = 'bibitem' or local-name() = 'quote']">true</xsl:when>
14979
- <xsl:otherwise><xsl:value-of select="$skip_footnote_body_"/></xsl:otherwise>
14980
- </xsl:choose>
14496
+ <xsl:choose>
14497
+ <xsl:when test="ancestor::*[local-name() = 'ul' or local-name() ='ol' or local-name() = 'bibitem' or local-name() = 'quote']">true</xsl:when>
14498
+ <xsl:otherwise><xsl:value-of select="$skip_footnote_body_"/></xsl:otherwise>
14499
+ </xsl:choose>
14981
14500
 
14982
14501
  </xsl:attribute>
14983
14502
  <xsl:attribute name="ref_id">
@@ -15067,7 +14586,6 @@
15067
14586
 
15068
14587
  <xsl:template name="printEdition">
15069
14588
  <xsl:variable name="edition_i18n" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
15070
-
15071
14589
  <xsl:choose>
15072
14590
  <xsl:when test="$edition_i18n != ''">
15073
14591
  <!-- Example: <edition language="fr">deuxième édition</edition> -->
@@ -15296,16 +14814,32 @@
15296
14814
  <dc:title>
15297
14815
  <xsl:variable name="title">
15298
14816
  <xsl:for-each select="(//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']">
15299
-
15300
- <xsl:choose>
15301
- <xsl:when test="*[local-name() = 'title'][@language = $lang and @type = 'main']">
15302
- <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
15303
- </xsl:when>
15304
- <xsl:otherwise>
15305
- <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'title-main']"/>
15306
- </xsl:otherwise>
15307
- </xsl:choose>
15308
-
14817
+ <xsl:choose>
14818
+ <xsl:when test="*[local-name() = 'title'][@language = $lang and @type = 'main']">
14819
+ <!-- <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/> -->
14820
+ <xsl:variable name="bibdata_doctype" select="*[local-name() = 'ext']/*[local-name() = 'doctype']"/>
14821
+ <xsl:if test="$bibdata_doctype = 'amendment'">
14822
+ <xsl:variable name="bibdata_doctype_localized" select="*[local-name() = 'ext']/*[local-name() = 'doctype'][@language = $lang]"/>
14823
+ <xsl:variable name="bibdata_amendment_number" select="*[local-name() = 'ext']/*[local-name() = 'structuredidentifier']/*[local-name() = 'project-number']/@amendment"/>
14824
+ <xsl:value-of select="normalize-space(concat($bibdata_doctype_localized, ' ', $bibdata_amendment_number))"/>
14825
+ <xsl:text> — </xsl:text>
14826
+ </xsl:if>
14827
+ <xsl:variable name="partnumber" select="*[local-name() = 'ext']/*[local-name() = 'structuredidentifier']/*[local-name() = 'project-number']/@part"/>
14828
+ <xsl:for-each select="*[local-name() = 'title'][@language = $lang and @type = 'title-intro'] | *[local-name() = 'title'][@language = $lang and @type = 'title-main'] | *[local-name() = 'title'][@language = $lang and @type = 'title-complementary'] | *[local-name() = 'title'][@language = $lang and @type = 'title-part']">
14829
+ <xsl:if test="@type = 'title-part'">
14830
+ <xsl:call-template name="getLocalizedString"><xsl:with-param name="key">locality.part</xsl:with-param></xsl:call-template>
14831
+ <xsl:text> </xsl:text>
14832
+ <xsl:value-of select="$partnumber"/>
14833
+ <xsl:text>: </xsl:text>
14834
+ </xsl:if>
14835
+ <xsl:value-of select="."/>
14836
+ <xsl:if test="position() != last()"><xsl:text> — </xsl:text></xsl:if>
14837
+ </xsl:for-each>
14838
+ </xsl:when>
14839
+ <xsl:otherwise>
14840
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'title-main']"/>
14841
+ </xsl:otherwise>
14842
+ </xsl:choose>
15309
14843
  </xsl:for-each>
15310
14844
  </xsl:variable>
15311
14845
  <rdf:Alt>
@@ -15323,16 +14857,14 @@
15323
14857
  </dc:title>
15324
14858
  <xsl:variable name="dc_creator">
15325
14859
  <xsl:for-each select="(//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']">
15326
-
15327
- <rdf:Seq>
15328
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
15329
- <rdf:li>
15330
- <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
15331
- </rdf:li>
15332
- <!-- <xsl:if test="position() != last()">; </xsl:if> -->
15333
- </xsl:for-each>
15334
- </rdf:Seq>
15335
-
14860
+ <rdf:Seq>
14861
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role'][not(*[local-name() = 'description'])]/@type='author']">
14862
+ <rdf:li>
14863
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
14864
+ </rdf:li>
14865
+ <!-- <xsl:if test="position() != last()">; </xsl:if> -->
14866
+ </xsl:for-each>
14867
+ </rdf:Seq>
15336
14868
  </xsl:for-each>
15337
14869
  </xsl:variable>
15338
14870
  <xsl:if test="normalize-space($dc_creator) != ''">
@@ -15343,9 +14875,7 @@
15343
14875
 
15344
14876
  <xsl:variable name="dc_description">
15345
14877
  <xsl:variable name="abstract">
15346
-
15347
- <xsl:copy-of select="//*[local-name() = 'metanorma']/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'fmt-title']) and not(ancestor::*[local-name() = 'title']) and not(ancestor::*[local-name() = 'fmt-xref-label'])]"/>
15348
-
14878
+ <xsl:copy-of select="//*[local-name() = 'metanorma']/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'fmt-title']) and not(ancestor::*[local-name() = 'title']) and not(ancestor::*[local-name() = 'fmt-xref-label'])]"/>
15349
14879
  </xsl:variable>
15350
14880
  <rdf:Alt>
15351
14881
  <rdf:li xml:lang="x-default">
@@ -15410,7 +14940,9 @@
15410
14940
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
15411
14941
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
15412
14942
  <xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
15413
- <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
14943
+ <!-- <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/> -->
14944
+ <!-- See https://github.com/metanorma/metanorma-iso/issues/1369 -->
14945
+ <xsl:variable name="url" select="concat('url(file:///',$outputpdf_basepath, $attachment_path, ')')"/>
15414
14946
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
15415
14947
  <!-- Todo: need update -->
15416
14948
  <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
@@ -15575,7 +15107,7 @@
15575
15107
  <xsl:param name="normalize-space" select="'true'"/>
15576
15108
  <xsl:param name="keep_sep" select="'false'"/>
15577
15109
  <xsl:if test="string-length($pText) &gt;0">
15578
- <item>
15110
+ <xsl:element name="item" namespace="{$namespace_mn_xsl}">
15579
15111
  <xsl:choose>
15580
15112
  <xsl:when test="$normalize-space = 'true'">
15581
15113
  <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
@@ -15584,8 +15116,8 @@
15584
15116
  <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
15585
15117
  </xsl:otherwise>
15586
15118
  </xsl:choose>
15587
- </item>
15588
- <xsl:if test="$keep_sep = 'true' and contains($pText, $sep)"><item><xsl:value-of select="$sep"/></item></xsl:if>
15119
+ </xsl:element>
15120
+ <xsl:if test="$keep_sep = 'true' and contains($pText, $sep)"><xsl:element name="item" namespace="{$namespace_mn_xsl}"><xsl:value-of select="$sep"/></xsl:element></xsl:if>
15589
15121
  <xsl:call-template name="split">
15590
15122
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
15591
15123
  <xsl:with-param name="sep" select="$sep"/>
@@ -15603,28 +15135,6 @@
15603
15135
  <xsl:call-template name="getLang_fromCurrentNode"/><xsl:value-of select=".//*[local-name() = 'p'][1]/@id"/>
15604
15136
  </xsl:template>
15605
15137
 
15606
- <xsl:template name="namespaceCheck">
15607
- <xsl:variable name="documentNS" select="$namespace_full"/> <!-- namespace-uri(/*) -->
15608
- <xsl:variable name="XSLNS">
15609
-
15610
- </xsl:variable>
15611
- <!-- <xsl:if test="$documentNS != $XSLNS">
15612
- <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
15613
- </xsl:if> -->
15614
- </xsl:template> <!-- namespaceCheck -->
15615
-
15616
- <xsl:template name="getLanguage">
15617
- <xsl:param name="lang"/>
15618
- <xsl:variable name="language" select="java:toLowerCase(java:java.lang.String.new($lang))"/>
15619
- <xsl:choose>
15620
- <xsl:when test="$language = 'en'">English</xsl:when>
15621
- <xsl:when test="$language = 'fr'">French</xsl:when>
15622
- <xsl:when test="$language = 'de'">Deutsch</xsl:when>
15623
- <xsl:when test="$language = 'cn'">Chinese</xsl:when>
15624
- <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
15625
- </xsl:choose>
15626
- </xsl:template>
15627
-
15628
15138
  <xsl:template name="setId">
15629
15139
  <xsl:param name="prefix"/>
15630
15140
  <xsl:attribute name="id">