metanorma-csa 2.2.11 → 2.2.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0354818d41d11101f7b6c8887da47415bc21aa1ea6d09401ca2327123653042d'
4
- data.tar.gz: ef4b3538d19b0dad0a4e690b6d54bccf94038afb4ccc7b4eb59a3e1ada381f0c
3
+ metadata.gz: e185c17483eec127fe20cfd1b0ea0e4c9af95e42cd8da478c52a8c1852c486ce
4
+ data.tar.gz: 2336dd2fef9192488767b301b5a5a02b7808adfa51cf044bc8993d27476fc0ed
5
5
  SHA512:
6
- metadata.gz: df2b1c575115cc72dee940c2f299507562733521fa3ca4885de4cd493e3db6ef437a3d9975eed9264d693e0a3cbcf3b31fccc747900dad16d5d8f23c77e130e9
7
- data.tar.gz: 320844b64ebad5514704255397a55f818ba32a80a63b402f4590ba8ac100a3d141930fbe1f8f0e69b67439bbe3df27da4b3841e78b32adc439dcccf437654ddf
6
+ metadata.gz: 10eb7a7144c6321fb40a157fb867d9d2e8c637ae7bc06b13cf04425b024caca863562055235c7a310cd921bebe43e833fc081b09dbf4b1bc428b5927a9c4a93f
7
+ data.tar.gz: 64f0601f7e26dfb7fd6e4825c0a8ad9bf40b27997720442c3876225219c00c457c301d8745879d7e920eaf3966af76fbcfda93e71d1966a275b8da99f39e7f72
@@ -317,12 +317,9 @@
317
317
  </xsl:template>
318
318
 
319
319
  <xsl:template match="csa:preface/csa:clause[@type = 'toc']/csa:title" priority="3">
320
- <xsl:variable name="title-toc">
321
- <xsl:call-template name="getTitle">
322
- <xsl:with-param name="name" select="'title-toc'"/>
323
- </xsl:call-template>
324
- </xsl:variable>
325
- <fo:block font-size="26pt" color="black" margin-top="2pt" margin-bottom="30pt" role="H1"><xsl:value-of select="$title-toc"/></fo:block>
320
+ <fo:block font-size="26pt" color="black" margin-top="2pt" margin-bottom="30pt" role="H1">
321
+ <xsl:apply-templates/>
322
+ </fo:block>
326
323
  </xsl:template>
327
324
 
328
325
  <xsl:template match="node()">
@@ -719,21 +716,32 @@
719
716
  <xsl:variable name="titles_">
720
717
 
721
718
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
722
- <title-toc lang="en">
723
-
719
+ <!-- <title-toc lang="en">
720
+ <xsl:if test="$namespace = 'csd' or $namespace = 'ieee' or $namespace = 'iho' or $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'unece-rec'">
721
+ <xsl:text>Contents</xsl:text>
722
+ </xsl:if>
723
+ <xsl:if test="$namespace = 'csa' or $namespace = 'm3d' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper'">
724
724
  <xsl:text>Table of Contents</xsl:text>
725
-
726
- </title-toc>
727
- <title-toc lang="fr">
725
+ </xsl:if>
726
+ <xsl:if test="$namespace = 'gb'">
727
+ <xsl:text>Table of contents</xsl:text>
728
+ </xsl:if>
729
+ </title-toc> -->
730
+ <title-toc lang="en">Table of contents</title-toc>
731
+ <!-- <title-toc lang="fr">
728
732
  <xsl:text>Sommaire</xsl:text>
729
- </title-toc>
730
- <title-toc lang="zh">
731
-
733
+ </title-toc> -->
734
+ <!-- <title-toc lang="zh">
735
+ <xsl:choose>
736
+ <xsl:when test="$namespace = 'gb'">
737
+ <xsl:text>目次</xsl:text>
738
+ </xsl:when>
739
+ <xsl:otherwise>
732
740
  <xsl:text>Contents</xsl:text>
733
-
734
- </title-toc>
735
-
736
- <title-descriptors lang="en">Descriptors</title-descriptors>
741
+ </xsl:otherwise>
742
+ </xsl:choose>
743
+ </title-toc> -->
744
+ <title-toc lang="zh">目次</title-toc>
737
745
 
738
746
  <title-part lang="en">
739
747
 
@@ -749,20 +757,6 @@
749
757
  <title-subpart lang="en">Sub-part #</title-subpart>
750
758
  <title-subpart lang="fr">Partie de sub #</title-subpart>
751
759
 
752
- <title-list-tables lang="en">List of Tables</title-list-tables>
753
-
754
- <title-list-figures lang="en">List of Figures</title-list-figures>
755
-
756
- <title-table-figures lang="en">Table of Figures</title-table-figures>
757
-
758
- <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
759
-
760
- <title-summary lang="en">Summary</title-summary>
761
-
762
- <title-continued lang="ru">(продолжение)</title-continued>
763
- <title-continued lang="en">(continued)</title-continued>
764
- <title-continued lang="fr">(continué)</title-continued>
765
-
766
760
  </xsl:variable>
767
761
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
768
762
 
@@ -770,8 +764,8 @@
770
764
  <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
771
765
  <xsl:value-of select="$toc_table_title"/>
772
766
  <xsl:if test="normalize-space($toc_table_title) = ''">
773
- <xsl:call-template name="getTitle">
774
- <xsl:with-param name="name" select="'title-list-tables'"/>
767
+ <xsl:call-template name="getLocalizedString">
768
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
775
769
  </xsl:call-template>
776
770
  </xsl:if>
777
771
  </xsl:variable>
@@ -780,8 +774,8 @@
780
774
  <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
781
775
  <xsl:value-of select="$toc_figure_title"/>
782
776
  <xsl:if test="normalize-space($toc_figure_title) = ''">
783
- <xsl:call-template name="getTitle">
784
- <xsl:with-param name="name" select="'title-list-figures'"/>
777
+ <xsl:call-template name="getLocalizedString">
778
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
785
779
  </xsl:call-template>
786
780
  </xsl:if>
787
781
  </xsl:variable>
@@ -790,8 +784,8 @@
790
784
  <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
791
785
  <xsl:value-of select="$toc_requirement_title"/>
792
786
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
793
- <xsl:call-template name="getTitle">
794
- <xsl:with-param name="name" select="'title-list-recommendations'"/>
787
+ <xsl:call-template name="getLocalizedString">
788
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
795
789
  </xsl:call-template>
796
790
  </xsl:if>
797
791
  </xsl:variable>
@@ -1507,6 +1501,7 @@
1507
1501
  </xsl:attribute-set>
1508
1502
 
1509
1503
  <xsl:attribute-set name="figure-block-style">
1504
+ <xsl:attribute name="role">SKIP</xsl:attribute>
1510
1505
 
1511
1506
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1512
1507
 
@@ -1517,6 +1512,7 @@
1517
1512
  </xsl:attribute-set>
1518
1513
 
1519
1514
  <xsl:attribute-set name="figure-name-style">
1515
+ <xsl:attribute name="role">Caption</xsl:attribute>
1520
1516
 
1521
1517
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1522
1518
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -1565,6 +1561,7 @@
1565
1561
  </xsl:template>
1566
1562
 
1567
1563
  <xsl:attribute-set name="image-style">
1564
+ <xsl:attribute name="role">SKIP</xsl:attribute>
1568
1565
  <xsl:attribute name="text-align">center</xsl:attribute>
1569
1566
 
1570
1567
  </xsl:attribute-set>
@@ -1841,6 +1838,11 @@
1841
1838
 
1842
1839
  </xsl:attribute-set> <!-- bibitem-non-normative-list-style -->
1843
1840
 
1841
+ <xsl:attribute-set name="bibitem-non-normative-list-item-style">
1842
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1843
+
1844
+ </xsl:attribute-set>
1845
+
1844
1846
  <!-- bibitem in bibliography section (references/@normative="false"), list body -->
1845
1847
  <xsl:attribute-set name="bibitem-normative-list-body-style">
1846
1848
 
@@ -2237,14 +2239,14 @@
2237
2239
  <xsl:value-of select="$sep"/><xsl:value-of select="$zero_width_space"/>
2238
2240
  </xsl:when>
2239
2241
  <xsl:otherwise>
2240
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2242
+ <fo:inline keep-together.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
2241
2243
  </xsl:otherwise>
2242
2244
  </xsl:choose>
2243
2245
  </xsl:for-each>
2244
2246
  </xsl:when>
2245
2247
 
2246
2248
  <xsl:otherwise>
2247
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2249
+ <fo:inline keep-together.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
2248
2250
  </xsl:otherwise>
2249
2251
 
2250
2252
  </xsl:choose>
@@ -2254,7 +2256,7 @@
2254
2256
  <!-- Preface boilerplate sections processing -->
2255
2257
  <!-- ================================= -->
2256
2258
  <xsl:template match="*[local-name()='copyright-statement']">
2257
- <fo:block xsl:use-attribute-sets="copyright-statement-style">
2259
+ <fo:block xsl:use-attribute-sets="copyright-statement-style" role="SKIP">
2258
2260
  <xsl:apply-templates/>
2259
2261
  </fo:block>
2260
2262
  </xsl:template> <!-- copyright-statement -->
@@ -2422,7 +2424,7 @@
2422
2424
  </xsl:choose>
2423
2425
  </xsl:variable>
2424
2426
 
2425
- <fo:block-container xsl:use-attribute-sets="table-container-style">
2427
+ <fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
2426
2428
 
2427
2429
  <xsl:call-template name="refine_table-container-style">
2428
2430
  <xsl:with-param name="margin-side" select="$margin-side"/>
@@ -3455,7 +3457,7 @@
3455
3457
  </xsl:choose>
3456
3458
  </xsl:variable>
3457
3459
  <xsl:variable name="footnote_inline">
3458
- <fo:inline>
3460
+ <fo:inline role="Reference">
3459
3461
 
3460
3462
  <xsl:variable name="fn_styles">
3461
3463
  <xsl:choose>
@@ -3478,7 +3480,7 @@
3478
3480
 
3479
3481
  <xsl:call-template name="insert_basic_link">
3480
3482
  <xsl:with-param name="element">
3481
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3483
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
3482
3484
  <xsl:copy-of select="$current_fn_number_text"/>
3483
3485
  </fo:basic-link>
3484
3486
  </xsl:with-param>
@@ -3491,17 +3493,17 @@
3491
3493
  <xsl:copy-of select="$footnote_inline"/>
3492
3494
  </xsl:when>
3493
3495
  <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
3494
- <fo:footnote xsl:use-attribute-sets="fn-style">
3496
+ <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
3495
3497
  <xsl:copy-of select="$footnote_inline"/>
3496
- <fo:footnote-body>
3498
+ <fo:footnote-body role="Note">
3497
3499
 
3498
- <fo:block-container xsl:use-attribute-sets="fn-container-body-style">
3500
+ <fo:block-container xsl:use-attribute-sets="fn-container-body-style" role="SKIP">
3499
3501
 
3500
- <fo:block xsl:use-attribute-sets="fn-body-style">
3502
+ <fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
3501
3503
 
3502
3504
  <xsl:call-template name="refine_fn-body-style"/>
3503
3505
 
3504
- <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
3506
+ <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style" role="Lbl">
3505
3507
 
3506
3508
  <xsl:call-template name="refine_fn-body-num-style"/>
3507
3509
 
@@ -3763,11 +3765,11 @@
3763
3765
  </xsl:template>
3764
3766
 
3765
3767
  <xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
3766
- <fo:inline><xsl:value-of select="."/></fo:inline>
3768
+ <fo:inline role="SKIP"><xsl:value-of select="."/></fo:inline>
3767
3769
  </xsl:template>
3768
3770
 
3769
3771
  <xsl:template match="*[local-name()='fn']//*[local-name()='p']">
3770
- <fo:inline>
3772
+ <fo:inline role="P">
3771
3773
  <xsl:apply-templates/>
3772
3774
  </fo:inline>
3773
3775
  </xsl:template>
@@ -3782,7 +3784,7 @@
3782
3784
  <xsl:variable name="isAdded" select="@added"/>
3783
3785
  <xsl:variable name="isDeleted" select="@deleted"/>
3784
3786
  <!-- <dl><xsl:copy-of select="."/></dl> -->
3785
- <fo:block-container xsl:use-attribute-sets="dl-block-style">
3787
+ <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
3786
3788
 
3787
3789
  <xsl:call-template name="setBlockSpanAll"/>
3788
3790
 
@@ -3817,7 +3819,7 @@
3817
3819
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
3818
3820
  </xsl:call-template>
3819
3821
 
3820
- <fo:block-container margin-left="0mm">
3822
+ <fo:block-container margin-left="0mm" role="SKIP">
3821
3823
 
3822
3824
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
3823
3825
 
@@ -3882,7 +3884,7 @@
3882
3884
 
3883
3885
  <!-- a few components -->
3884
3886
  <xsl:if test="$onlyOneComponent = 'false'">
3885
- <fo:block>
3887
+ <fo:block role="SKIP">
3886
3888
 
3887
3889
  <xsl:call-template name="refine_multicomponent_style"/>
3888
3890
 
@@ -3890,7 +3892,7 @@
3890
3892
  <xsl:attribute name="margin-top">0</xsl:attribute>
3891
3893
  </xsl:if>
3892
3894
 
3893
- <fo:block>
3895
+ <fo:block role="SKIP">
3894
3896
 
3895
3897
  <xsl:call-template name="refine_multicomponent_block_style"/>
3896
3898
 
@@ -4485,6 +4487,9 @@
4485
4487
 
4486
4488
  <xsl:template name="refine_strong_style">
4487
4489
 
4490
+ <xsl:if test="ancestor::*['preferred']">
4491
+ <xsl:attribute name="role">SKIP</xsl:attribute>
4492
+ </xsl:if>
4488
4493
  </xsl:template>
4489
4494
 
4490
4495
  <xsl:template match="*[local-name()='padding']">
@@ -4531,7 +4536,7 @@
4531
4536
  <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
4532
4537
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
4533
4538
  <xsl:choose>
4534
- <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
4539
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), $regex_url_start, '$2') != ''">
4535
4540
  <!-- url -->
4536
4541
  <xsl:call-template name="add-zero-spaces-link-java"/>
4537
4542
  </xsl:when>
@@ -4993,10 +4998,13 @@
4993
4998
  </xsl:choose>
4994
4999
  </xsl:variable>
4995
5000
 
5001
+ <!-- replace sequence #x200B to one &#x200B -->
5002
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b{2,}', '​')"/>
5003
+
4996
5004
  <!-- replace sequence #x200B and space TO space -->
4997
- <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
5005
+ <xsl:variable name="text11" select="java:replaceAll(java:java.lang.String.new($text10), '\u200b ', ' ')"/>
4998
5006
 
4999
- <xsl:value-of select="$text10"/>
5007
+ <xsl:value-of select="$text11"/>
5000
5008
  </xsl:template>
5001
5009
 
5002
5010
  <xsl:template name="add-zero-spaces-link-java">
@@ -5006,8 +5014,12 @@
5006
5014
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
5007
5015
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, comma, slash, @ -->
5008
5016
  <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/|@)','$1​')"/>
5017
+
5018
+ <!-- replace sequence #x200B to one &#x200B -->
5019
+ <xsl:variable name="url2" select="java:replaceAll(java:java.lang.String.new($url), '\u200b{2,}', '​')"/>
5020
+
5009
5021
  <!-- remove zero-width space at the end -->
5010
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
5022
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url2), '​$', '')"/>
5011
5023
  </xsl:template>
5012
5024
 
5013
5025
  <!-- add zero space after dash character (for table's entries) -->
@@ -5418,6 +5430,18 @@
5418
5430
  </xsl:copy>
5419
5431
  </xsl:template>
5420
5432
 
5433
+ <xsl:variable name="font_main_root_style">
5434
+ <root-style xsl:use-attribute-sets="root-style">
5435
+ </root-style>
5436
+ </xsl:variable>
5437
+ <xsl:variable name="font_main_root_style_font_family" select="xalan:nodeset($font_main_root_style)/root-style/@font-family"/>
5438
+ <xsl:variable name="font_main">
5439
+ <xsl:choose>
5440
+ <xsl:when test="contains($font_main_root_style_font_family, ',')"><xsl:value-of select="substring-before($font_main_root_style_font_family, ',')"/></xsl:when>
5441
+ <xsl:otherwise><xsl:value-of select="$font_main_root_style_font_family"/></xsl:otherwise>
5442
+ </xsl:choose>
5443
+ </xsl:variable>
5444
+
5421
5445
  <xsl:template match="*[local-name()='th' or local-name()='td']" mode="simple-table-id">
5422
5446
  <xsl:param name="id"/>
5423
5447
  <xsl:copy>
@@ -5456,6 +5480,33 @@
5456
5480
 
5457
5481
  <!-- td_text='<xsl:copy-of select="$td_text"/>' -->
5458
5482
 
5483
+ <xsl:variable name="words_with_width">
5484
+ <!-- calculate width for 'word' which contain text only (without formatting tags inside) -->
5485
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != ''][not(*)]">
5486
+ <xsl:copy>
5487
+ <xsl:copy-of select="@*"/>
5488
+ <xsl:attribute name="width">
5489
+ <xsl:value-of select="java:org.metanorma.fop.Util.getStringWidth(., $font_main)"/> <!-- Example: 'Times New Roman' -->
5490
+ </xsl:attribute>
5491
+ <xsl:copy-of select="node()"/>
5492
+ </xsl:copy>
5493
+ </xsl:for-each>
5494
+ </xsl:variable>
5495
+
5496
+ <xsl:variable name="words_with_width_sorted">
5497
+ <xsl:for-each select="xalan:nodeset($words_with_width)//*[local-name() = 'word']">
5498
+ <xsl:sort select="@width" data-type="number" order="descending"/>
5499
+ <!-- select word maximal width only -->
5500
+ <xsl:if test="position() = 1">
5501
+ <xsl:copy-of select="."/>
5502
+ </xsl:if>
5503
+ </xsl:for-each>
5504
+ <!-- add 'word' with formatting tags inside -->
5505
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != ''][*]">
5506
+ <xsl:copy-of select="."/>
5507
+ </xsl:for-each>
5508
+ </xsl:variable>
5509
+
5459
5510
  <xsl:variable name="words">
5460
5511
  <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
5461
5512
  <word>
@@ -5463,9 +5514,12 @@
5463
5514
  </word>
5464
5515
  </xsl:for-each>
5465
5516
 
5466
- <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
5517
+ <xsl:for-each select="xalan:nodeset($words_with_width_sorted)//*[local-name() = 'word'][normalize-space() != '']">
5467
5518
  <xsl:copy-of select="."/>
5468
5519
  </xsl:for-each>
5520
+ <!-- <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
5521
+ <xsl:copy-of select="."/>
5522
+ </xsl:for-each> -->
5469
5523
 
5470
5524
  </xsl:variable>
5471
5525
 
@@ -5926,10 +5980,10 @@
5926
5980
  <xsl:copy>
5927
5981
  <xsl:apply-templates select="@*" mode="mathml"/>
5928
5982
  <xsl:if test="not(@lspace)">
5929
- <xsl:attribute name="lspace">0.4em</xsl:attribute>
5983
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
5930
5984
  </xsl:if>
5931
- <xsl:if test="not(@rspace)">
5932
- <xsl:attribute name="rspace">0.4em</xsl:attribute>
5985
+ <xsl:if test="not(@rspace) and not(following-sibling::*[1][self::mathml:mo and normalize-space(text()) = '|'])">
5986
+ <xsl:attribute name="rspace">0.2em</xsl:attribute>
5933
5987
  </xsl:if>
5934
5988
  <xsl:apply-templates mode="mathml"/>
5935
5989
  </xsl:copy>
@@ -5946,6 +6000,27 @@
5946
6000
  </xsl:copy>
5947
6001
  </xsl:template>
5948
6002
 
6003
+ <!-- increase space before '(' -->
6004
+ <xsl:template match="mathml:mo[normalize-space(text()) = '(']" mode="mathml">
6005
+ <xsl:copy>
6006
+ <xsl:apply-templates select="@*" mode="mathml"/>
6007
+ <xsl:if test="(preceding-sibling::* and not(preceding-sibling::*[1][self::mathml:mo])) or (../preceding-sibling::* and not(../preceding-sibling::*[1][self::mathml:mo]))">
6008
+ <xsl:if test="not(@lspace)">
6009
+ <xsl:attribute name="lspace">0.4em</xsl:attribute>
6010
+ <xsl:choose>
6011
+ <xsl:when test="preceding-sibling::*[1][self::mathml:mi or self::mathml:mstyle]">
6012
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
6013
+ </xsl:when>
6014
+ <xsl:when test="../preceding-sibling::*[1][self::mathml:mi or self::mathml:mstyle]">
6015
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
6016
+ </xsl:when>
6017
+ </xsl:choose>
6018
+ </xsl:if>
6019
+ </xsl:if>
6020
+ <xsl:apply-templates mode="mathml"/>
6021
+ </xsl:copy>
6022
+ </xsl:template>
6023
+
5949
6024
  <!-- Examples:
5950
6025
  <stem type="AsciiMath">x = 1</stem>
5951
6026
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -6105,7 +6180,7 @@
6105
6180
  <!-- formula -->
6106
6181
  <!-- ====== -->
6107
6182
  <xsl:template match="*[local-name() = 'formula']" name="formula">
6108
- <fo:block-container margin-left="0mm">
6183
+ <fo:block-container margin-left="0mm" role="SKIP">
6109
6184
  <xsl:if test="parent::*[local-name() = 'note']">
6110
6185
  <xsl:attribute name="margin-left">
6111
6186
  <xsl:choose>
@@ -6115,7 +6190,7 @@
6115
6190
  </xsl:attribute>
6116
6191
 
6117
6192
  </xsl:if>
6118
- <fo:block-container margin-left="0mm">
6193
+ <fo:block-container margin-left="0mm" role="SKIP">
6119
6194
  <fo:block id="{@id}">
6120
6195
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
6121
6196
  </fo:block>
@@ -6195,13 +6270,13 @@
6195
6270
 
6196
6271
  <xsl:template match="*[local-name() = 'note']" name="note">
6197
6272
 
6198
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
6273
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
6199
6274
 
6200
6275
  <xsl:call-template name="setBlockSpanAll"/>
6201
6276
 
6202
6277
  <xsl:call-template name="refine_note-style"/>
6203
6278
 
6204
- <fo:block-container margin-left="0mm" margin-right="0mm">
6279
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
6205
6280
 
6206
6281
  <xsl:if test="ancestor::csa:ul or ancestor::csa:ol and not(ancestor::csa:note[1]/following-sibling::*)">
6207
6282
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
@@ -6211,7 +6286,7 @@
6211
6286
 
6212
6287
  <xsl:call-template name="refine_note_block_style"/>
6213
6288
 
6214
- <fo:inline xsl:use-attribute-sets="note-name-style">
6289
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
6215
6290
 
6216
6291
  <xsl:call-template name="refine_note-name-style"/>
6217
6292
 
@@ -6248,12 +6323,12 @@
6248
6323
  <xsl:variable name="num"><xsl:number/></xsl:variable>
6249
6324
  <xsl:choose>
6250
6325
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
6251
- <fo:inline xsl:use-attribute-sets="note-p-style">
6326
+ <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
6252
6327
  <xsl:apply-templates/>
6253
6328
  </fo:inline>
6254
6329
  </xsl:when>
6255
6330
  <xsl:otherwise>
6256
- <fo:block xsl:use-attribute-sets="note-p-style">
6331
+ <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
6257
6332
  <xsl:apply-templates/>
6258
6333
  </fo:block>
6259
6334
  </xsl:otherwise>
@@ -6367,12 +6442,13 @@
6367
6442
 
6368
6443
  <xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']">
6369
6444
  <xsl:if test="normalize-space() != ''">
6370
- <xsl:variable name="level">
6445
+ <!-- <xsl:variable name="level">
6371
6446
  <xsl:call-template name="getLevelTermName"/>
6372
6447
  </xsl:variable>
6373
6448
  <fo:inline role="H{$level}">
6374
- <xsl:apply-templates/>
6375
- </fo:inline>
6449
+ <xsl:apply-templates />
6450
+ </fo:inline> -->
6451
+ <xsl:apply-templates/>
6376
6452
  </xsl:if>
6377
6453
  </xsl:template>
6378
6454
  <!-- ====== -->
@@ -6396,7 +6472,7 @@
6396
6472
  <!-- Example: Dimensions in millimeters -->
6397
6473
  <xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
6398
6474
 
6399
- <fo:block xsl:use-attribute-sets="figure-style">
6475
+ <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
6400
6476
  <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
6401
6477
  </fo:block>
6402
6478
  <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
@@ -7531,7 +7607,7 @@
7531
7607
  </xsl:when>
7532
7608
 
7533
7609
  <xsl:otherwise>
7534
- <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
7610
+ <fo:block-container xsl:use-attribute-sets="sourcecode-container-style" role="SKIP">
7535
7611
 
7536
7612
  <xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
7537
7613
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
@@ -7552,7 +7628,7 @@
7552
7628
  </xsl:attribute>
7553
7629
 
7554
7630
  </xsl:if>
7555
- <fo:block-container margin-left="0mm">
7631
+ <fo:block-container margin-left="0mm" role="SKIP">
7556
7632
 
7557
7633
  <fo:block xsl:use-attribute-sets="sourcecode-style">
7558
7634
 
@@ -8098,11 +8174,11 @@
8098
8174
  <!-- requirement, recommendation, permission table -->
8099
8175
  <!-- ========== -->
8100
8176
  <xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
8101
- <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
8177
+ <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt" role="SKIP">
8102
8178
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
8103
8179
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8104
8180
  </xsl:if>
8105
- <fo:block-container margin-left="0mm" margin-right="0mm">
8181
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8106
8182
  <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
8107
8183
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
8108
8184
  <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
@@ -8264,7 +8340,7 @@
8264
8340
  -->
8265
8341
  <xsl:template match="*[local-name() = 'example']">
8266
8342
 
8267
- <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style">
8343
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
8268
8344
 
8269
8345
  <xsl:call-template name="setBlockSpanAll"/>
8270
8346
 
@@ -8275,7 +8351,7 @@
8275
8351
  block
8276
8352
  </xsl:variable>
8277
8353
 
8278
- <fo:block-container margin-left="0mm">
8354
+ <fo:block-container margin-left="0mm" role="SKIP">
8279
8355
 
8280
8356
  <xsl:choose>
8281
8357
 
@@ -8288,8 +8364,8 @@
8288
8364
  </xsl:apply-templates>
8289
8365
  </fo:block>
8290
8366
 
8291
- <fo:block-container xsl:use-attribute-sets="example-body-style">
8292
- <fo:block-container margin-left="0mm" margin-right="0mm">
8367
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
8368
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8293
8369
  <xsl:apply-templates select="node()[not(local-name() = 'name')]">
8294
8370
  <xsl:with-param name="fo_element" select="$fo_element"/>
8295
8371
  </xsl:apply-templates>
@@ -8342,8 +8418,8 @@
8342
8418
 
8343
8419
  <xsl:if test="*[not(local-name() = 'name')][position() &gt; 1]">
8344
8420
  <!-- display further elements in blocks -->
8345
- <fo:block-container xsl:use-attribute-sets="example-body-style">
8346
- <fo:block-container margin-left="0mm" margin-right="0mm">
8421
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
8422
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8347
8423
  <xsl:apply-templates select="*[not(local-name() = 'name')][position() &gt; 1]">
8348
8424
  <xsl:with-param name="fo_element" select="'block'"/>
8349
8425
  </xsl:apply-templates>
@@ -8396,7 +8472,7 @@
8396
8472
  </xsl:variable>
8397
8473
  <xsl:choose>
8398
8474
  <xsl:when test="starts-with(normalize-space($element), 'block')">
8399
- <fo:block-container>
8475
+ <fo:block-container role="SKIP">
8400
8476
  <xsl:if test="ancestor::*[local-name() = 'li'] and contains(normalize-space($fo_element), 'block')">
8401
8477
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
8402
8478
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -8537,7 +8613,7 @@
8537
8613
  <!-- author -->
8538
8614
  <!-- ====== -->
8539
8615
  <xsl:template match="*[local-name() = 'quote']">
8540
- <fo:block-container margin-left="0mm">
8616
+ <fo:block-container margin-left="0mm" role="SKIP">
8541
8617
 
8542
8618
  <xsl:call-template name="setBlockSpanAll"/>
8543
8619
 
@@ -8547,12 +8623,12 @@
8547
8623
  </xsl:if>
8548
8624
  </xsl:if>
8549
8625
 
8550
- <fo:block-container margin-left="0mm">
8551
- <fo:block-container xsl:use-attribute-sets="quote-style">
8626
+ <fo:block-container margin-left="0mm" role="SKIP">
8627
+ <fo:block-container xsl:use-attribute-sets="quote-style" role="SKIP">
8552
8628
 
8553
8629
  <xsl:call-template name="refine_quote-style"/>
8554
8630
 
8555
- <fo:block-container margin-left="0mm" margin-right="0mm">
8631
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8556
8632
  <fo:block role="BlockQuote">
8557
8633
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
8558
8634
  </fo:block>
@@ -8705,10 +8781,10 @@
8705
8781
 
8706
8782
  <xsl:choose>
8707
8783
  <xsl:when test="$lang = 'zh'">
8708
- <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
8784
+ <fo:inline role="SKIP"><xsl:value-of select="$tab_zh"/></fo:inline>
8709
8785
  </xsl:when>
8710
8786
  <xsl:when test="../../@inline-header = 'true'">
8711
- <fo:inline font-size="90%">
8787
+ <fo:inline font-size="90%" role="SKIP">
8712
8788
  <xsl:call-template name="insertNonBreakSpaces">
8713
8789
  <xsl:with-param name="count" select="$padding-right"/>
8714
8790
  </xsl:call-template>
@@ -8716,7 +8792,7 @@
8716
8792
  </xsl:when>
8717
8793
  <xsl:otherwise>
8718
8794
  <xsl:variable name="direction"><xsl:if test="$lang = 'ar'"><xsl:value-of select="$RLM"/></xsl:if></xsl:variable>
8719
- <fo:inline padding-right="{$padding-right}mm"><xsl:value-of select="$direction"/>​</fo:inline>
8795
+ <fo:inline padding-right="{$padding-right}mm" role="SKIP"><xsl:value-of select="$direction"/>​</fo:inline>
8720
8796
  </xsl:otherwise>
8721
8797
  </xsl:choose>
8722
8798
 
@@ -8751,12 +8827,12 @@
8751
8827
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
8752
8828
 
8753
8829
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
8754
- <fo:block xsl:use-attribute-sets="term-name-style">
8830
+ <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
8755
8831
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
8756
8832
  </fo:block>
8757
8833
  </xsl:if>
8758
8834
 
8759
- <fo:block xsl:use-attribute-sets="preferred-term-style">
8835
+ <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
8760
8836
  <xsl:call-template name="setStyle_preferred"/>
8761
8837
  <xsl:apply-templates/>
8762
8838
  </fo:block>
@@ -8797,7 +8873,7 @@
8797
8873
  <!-- definition -->
8798
8874
  <!-- ========== -->
8799
8875
  <xsl:template match="*[local-name() = 'definition']">
8800
- <fo:block xsl:use-attribute-sets="definition-style">
8876
+ <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
8801
8877
  <xsl:apply-templates/>
8802
8878
  </fo:block>
8803
8879
  </xsl:template>
@@ -8845,6 +8921,10 @@
8845
8921
 
8846
8922
  <xsl:template match="*[local-name() = 'clause']">
8847
8923
  <fo:block>
8924
+ <xsl:if test="parent::*[local-name() = 'copyright-statement']">
8925
+ <xsl:attribute name="role">SKIP</xsl:attribute>
8926
+ </xsl:if>
8927
+
8848
8928
  <xsl:call-template name="setId"/>
8849
8929
 
8850
8930
  <xsl:call-template name="setBlockSpanAll"/>
@@ -9083,7 +9163,7 @@
9083
9163
  <xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
9084
9164
  <xsl:choose>
9085
9165
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
9086
- <fo:block-container>
9166
+ <fo:block-container role="SKIP">
9087
9167
  <xsl:attribute name="margin-left">
9088
9168
  <xsl:choose>
9089
9169
  <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
@@ -9093,7 +9173,7 @@
9093
9173
 
9094
9174
  <xsl:call-template name="refine_list_container_style"/>
9095
9175
 
9096
- <fo:block-container margin-left="0mm">
9176
+ <fo:block-container margin-left="0mm" role="SKIP">
9097
9177
  <fo:block>
9098
9178
  <xsl:apply-templates select="." mode="list"/>
9099
9179
  </fo:block>
@@ -9102,7 +9182,7 @@
9102
9182
  </xsl:when>
9103
9183
  <xsl:otherwise>
9104
9184
 
9105
- <fo:block>
9185
+ <fo:block role="SKIP">
9106
9186
  <xsl:apply-templates select="." mode="list"/>
9107
9187
  </fo:block>
9108
9188
 
@@ -9520,7 +9600,10 @@
9520
9600
  <!-- Reference sections (Normative References and Bibliography) -->
9521
9601
  <!-- ========================================================== -->
9522
9602
  <xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/>
9523
- <xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/>
9603
+ <xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3">
9604
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/>
9605
+
9606
+ </xsl:template>
9524
9607
  <!-- don't display bibitem with @id starts with '_hidden', that was introduced for references integrity -->
9525
9608
  <xsl:template match="*[local-name() = 'bibitem'][starts-with(@id, 'hidden_bibitem_')]" priority="3"/>
9526
9609
 
@@ -9569,6 +9652,7 @@
9569
9652
 
9570
9653
  <!-- Bibliography (non-normative references) -->
9571
9654
  <xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" name="bibitem_non_normative" priority="2">
9655
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
9572
9656
 
9573
9657
  <!-- start CSA bibitem processing -->
9574
9658
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-style">
@@ -9579,6 +9663,35 @@
9579
9663
 
9580
9664
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
9581
9665
 
9666
+ <xsl:template name="insertListItem_Bibitem">
9667
+ <xsl:choose>
9668
+ <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
9669
+ <xsl:otherwise>
9670
+ <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
9671
+ <fo:list-item-label end-indent="label-end()">
9672
+ <fo:block role="SKIP">
9673
+ <fo:inline role="SKIP">
9674
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
9675
+ <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
9676
+ </xsl:apply-templates>
9677
+ </fo:inline>
9678
+ </fo:block>
9679
+ </fo:list-item-label>
9680
+ <fo:list-item-body start-indent="body-start()">
9681
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
9682
+ <xsl:call-template name="processBibitem">
9683
+ <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
9684
+ </xsl:call-template>
9685
+ </fo:block>
9686
+ </fo:list-item-body>
9687
+ </fo:list-item>
9688
+ </xsl:otherwise>
9689
+ </xsl:choose>
9690
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'bibitem']">
9691
+ <xsl:with-param name="skip">false</xsl:with-param>
9692
+ </xsl:apply-templates>
9693
+ </xsl:template>
9694
+
9582
9695
  <xsl:template name="processBibitem">
9583
9696
  <xsl:param name="biblio_tag_part">both</xsl:param>
9584
9697
 
@@ -9912,9 +10025,9 @@
9912
10025
 
9913
10026
  <xsl:call-template name="setBlockSpanAll"/>
9914
10027
 
9915
- <fo:block-container xsl:use-attribute-sets="admonition-container-style">
10028
+ <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
9916
10029
 
9917
- <fo:block-container margin-left="0mm" margin-right="0mm">
10030
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
9918
10031
  <fo:block>
9919
10032
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
9920
10033
  </fo:block>
@@ -97,7 +97,7 @@ h1, h2, h3, h4, h5, h6 {
97
97
 
98
98
  blockquote, q {
99
99
  quotes: none; }
100
- blockquote:before, blockquote:after, q:before, q:after {
100
+ blockquote::before, blockquote::after, q::before, q::after {
101
101
  content: '';
102
102
  content: none; }
103
103
 
@@ -120,14 +120,18 @@ b, strong {
120
120
  div.document-stage-band, div.document-type-band {
121
121
  background-color: #333333; }
122
122
 
123
- a.FootnoteRef + a.FootnoteRef:before {
123
+ a.FootnoteRef + a.FootnoteRef::before {
124
124
  content: ", ";
125
125
  vertical-align: super; }
126
126
 
127
- a.TableFootnoteRef + a.TableFootnoteRef:before {
127
+ a.TableFootnoteRef + a.TableFootnoteRef::before {
128
128
  content: ", ";
129
129
  vertical-align: super; }
130
130
 
131
+ a.TableFootnoteRef, span.TableFootnoteRef,
132
+ a.FootnoteRef, span.FootnoteRef {
133
+ vertical-align: super; }
134
+
131
135
  .addition {
132
136
  color: blue; }
133
137
 
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Csa
3
- VERSION = "2.2.11".freeze
3
+ VERSION = "2.2.13".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-csa
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.11
4
+ version: 2.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-19 00:00:00.000000000 Z
11
+ date: 2023-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic