metanorma-iso 2.2.1 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/iso/html/header-dis.html +111 -29
  3. data/lib/isodoc/iso/html/isodoc-dis.css +65 -64
  4. data/lib/isodoc/iso/html/isodoc-dis.scss +65 -64
  5. data/lib/isodoc/iso/html/style-human.css +2 -3
  6. data/lib/isodoc/iso/html/style-human.scss +0 -1
  7. data/lib/isodoc/iso/html/style-iso.css +2 -3
  8. data/lib/isodoc/iso/html/style-iso.scss +0 -1
  9. data/lib/isodoc/iso/html/wordstyle-dis.css +10 -4
  10. data/lib/isodoc/iso/html/wordstyle-dis.scss +10 -4
  11. data/lib/isodoc/iso/i18n-en.yaml +13 -8
  12. data/lib/isodoc/iso/i18n-fr.yaml +9 -3
  13. data/lib/isodoc/iso/i18n-ru.yaml +9 -2
  14. data/lib/isodoc/iso/i18n-zh-Hans.yaml +1 -2
  15. data/lib/isodoc/iso/iso.amendment.xsl +226 -40
  16. data/lib/isodoc/iso/iso.international-standard.xsl +226 -40
  17. data/lib/isodoc/iso/presentation_bibdata.rb +13 -9
  18. data/lib/isodoc/iso/presentation_xml_convert.rb +5 -3
  19. data/lib/isodoc/iso/presentation_xref.rb +10 -7
  20. data/lib/isodoc/iso/sections.rb +1 -1
  21. data/lib/isodoc/iso/word_convert.rb +6 -4
  22. data/lib/isodoc/iso/word_dis_cleanup.rb +24 -3
  23. data/lib/isodoc/iso/word_dis_convert.rb +4 -1
  24. data/lib/metanorma/iso/base.rb +2 -1
  25. data/lib/metanorma/iso/basicdoc.rng +0 -27
  26. data/lib/metanorma/iso/biblio-standoc.rng +164 -0
  27. data/lib/metanorma/iso/biblio.rng +50 -18
  28. data/lib/metanorma/iso/isodoc.rng +68 -206
  29. data/lib/metanorma/iso/isostandard-amd.rng +3 -54
  30. data/lib/metanorma/iso/isostandard-compile.rng +7 -0
  31. data/lib/metanorma/iso/isostandard.rng +1 -195
  32. data/lib/metanorma/iso/relaton-iso.rng +225 -0
  33. data/lib/metanorma/iso/validate.rb +6 -6
  34. data/lib/metanorma/iso/version.rb +1 -1
  35. data/lib/metanorma/requirements/modspec.rb +22 -38
  36. data/metanorma-iso.gemspec +5 -2
  37. metadata +7 -86
  38. data/.github/workflows/rake.yml +0 -15
  39. data/.github/workflows/release.yml +0 -24
  40. data/.github/workflows/ubuntu.yml +0 -41
  41. data/Rakefile +0 -8
  42. data/bin/rspec +0 -17
  43. data/spec/assets/header.html +0 -7
  44. data/spec/assets/html.css +0 -2
  45. data/spec/assets/htmlcover.html +0 -4
  46. data/spec/assets/htmlintro.html +0 -5
  47. data/spec/assets/i18n.yaml +0 -2
  48. data/spec/assets/iso.adoc +0 -10
  49. data/spec/assets/iso.headless.html +0 -33
  50. data/spec/assets/iso.xml +0 -71
  51. data/spec/assets/rice_image1.png +0 -0
  52. data/spec/assets/scripts.html +0 -3
  53. data/spec/assets/std.css +0 -2
  54. data/spec/assets/word.css +0 -2
  55. data/spec/assets/wordcover.html +0 -3
  56. data/spec/assets/wordintro.html +0 -4
  57. data/spec/examples/103_01_02.html +0 -247
  58. data/spec/examples/english.yaml +0 -69
  59. data/spec/examples/iso_123_.xml +0 -45
  60. data/spec/examples/iso_123_all_parts.xml +0 -45
  61. data/spec/examples/iso_123_no_year_note.xml +0 -46
  62. data/spec/examples/iso_124_.xml +0 -41
  63. data/spec/examples/iso_216_.xml +0 -47
  64. data/spec/examples/iso_iec_12382_.xml +0 -48
  65. data/spec/examples/rice.adoc +0 -714
  66. data/spec/examples/rice.preview.html +0 -1870
  67. data/spec/examples/rice.sh +0 -4
  68. data/spec/examples/rice_img/1000-1_ed2amd3fig1a.png +0 -0
  69. data/spec/examples/rice_img/1000-1_ed2amd3fig1b.png +0 -0
  70. data/spec/examples/rice_img/1000-1_ed2amd3fig2.png +0 -0
  71. data/spec/examples/rice_img/1000-1_ed2amd3fig3.png +0 -0
  72. data/spec/examples/rice_img/1000-1_ed2amd3fig4.png +0 -0
  73. data/spec/examples/rice_img/1000-1_ed2amd3fig5_f.png +0 -0
  74. data/spec/examples/rice_img/1000-1_ed2amd3figA.png +0 -0
  75. data/spec/examples/rice_img/1000-1_ed2amd3figA1.png +0 -0
  76. data/spec/examples/rice_img/1000-1_ed2amd3figA2.png +0 -0
  77. data/spec/examples/rice_img/1000-1_ed2amd3figTab1.png +0 -0
  78. data/spec/examples/rice_img/1000-1_ed2amd3figTab2.png +0 -0
  79. data/spec/examples/rice_img/1001_ed2amd3fig1.png +0 -0
  80. data/spec/examples/rice_img/ISO_1213_1.png +0 -0
  81. data/spec/examples/rice_img/SL1000-1_ed2amd3fig1.png +0 -0
  82. data/spec/examples/rice_img/rice_image1.png +0 -0
  83. data/spec/examples/rice_img/rice_image2.png +0 -0
  84. data/spec/examples/rice_img/rice_image3_1.png +0 -0
  85. data/spec/examples/rice_img/rice_image3_2.png +0 -0
  86. data/spec/examples/rice_img/rice_image3_3.png +0 -0
  87. data/spec/isodoc/amd_spec.rb +0 -986
  88. data/spec/isodoc/blocks_spec.rb +0 -1174
  89. data/spec/isodoc/i18n_spec.rb +0 -1579
  90. data/spec/isodoc/inline_spec.rb +0 -1060
  91. data/spec/isodoc/iso_spec.rb +0 -255
  92. data/spec/isodoc/metadata_spec.rb +0 -701
  93. data/spec/isodoc/postproc_spec.rb +0 -1089
  94. data/spec/isodoc/ref_spec.rb +0 -439
  95. data/spec/isodoc/section_spec.rb +0 -998
  96. data/spec/isodoc/table_spec.rb +0 -420
  97. data/spec/isodoc/terms_spec.rb +0 -314
  98. data/spec/isodoc/word_dis_spec.rb +0 -2064
  99. data/spec/isodoc/xref_spec.rb +0 -1747
  100. data/spec/metanorma/amd_spec.rb +0 -724
  101. data/spec/metanorma/base_spec.rb +0 -1384
  102. data/spec/metanorma/blank_spec.rb +0 -38
  103. data/spec/metanorma/blocks_spec.rb +0 -624
  104. data/spec/metanorma/cleanup_spec.rb +0 -1645
  105. data/spec/metanorma/inline_spec.rb +0 -203
  106. data/spec/metanorma/lists_spec.rb +0 -197
  107. data/spec/metanorma/macros_spec.rb +0 -99
  108. data/spec/metanorma/processor_spec.rb +0 -161
  109. data/spec/metanorma/refs_spec.rb +0 -672
  110. data/spec/metanorma/section_spec.rb +0 -492
  111. data/spec/metanorma/table_spec.rb +0 -329
  112. data/spec/metanorma/validate_spec.rb +0 -2153
  113. data/spec/relaton/render_spec.rb +0 -568
  114. data/spec/requirements/requirement_components_spec.rb +0 -622
  115. data/spec/requirements/requirements_spec.rb +0 -1681
  116. data/spec/requirements/xref_spec.rb +0 -1211
  117. data/spec/spec_helper.rb +0 -313
  118. data/spec/vcr_cassettes/docrels.yml +0 -385
  119. data/spec/vcr_cassettes/withdrawn_iso.yml +0 -295
@@ -121,8 +121,8 @@
121
121
 
122
122
  <xsl:variable name="stagename-header-coverpage">
123
123
  <xsl:choose>
124
- <xsl:when test="$stage-abbreviation = 'DIS' or $stage-abbreviation = 'DAmd' or $stage-abbreviation = 'DAM'">DRAFT</xsl:when>
125
- <xsl:when test="$stage-abbreviation = 'FDIS' or $stage-abbreviation = 'FDAmd' or $stage-abbreviation = 'FDAM'">FINAL DRAFT</xsl:when>
124
+ <xsl:when test="$stage-abbreviation = 'DIS' or $stage-abbreviation = 'DAmd' or $stage-abbreviation = 'DAM' or starts-with($stage-abbreviation, 'DTS') or starts-with($stage-abbreviation, 'DTR')">DRAFT</xsl:when>
125
+ <xsl:when test="$stage-abbreviation = 'FDIS' or $stage-abbreviation = 'FDAmd' or $stage-abbreviation = 'FDAM' or starts-with($stage-abbreviation, 'FDTS') or starts-with($stage-abbreviation, 'FDTR')">FINAL DRAFT</xsl:when>
126
126
  <xsl:when test="$stage-abbreviation = 'PRF'"/>
127
127
  <xsl:when test="$stage-abbreviation = 'IS'"/>
128
128
  <xsl:otherwise>
@@ -980,9 +980,14 @@
980
980
  </fo:table>
981
981
  </fo:block-container>
982
982
  <fo:block-container position="absolute" left="60mm" top="222mm" height="25mm" display-align="after">
983
- <fo:block>
983
+ <fo:block margin-bottom="2mm">
984
984
  <xsl:if test="$stage-abbreviation = 'PRF'">
985
- <fo:block font-size="39pt" font-weight="bold"><xsl:value-of select="$proof-text"/></fo:block>
985
+ <fo:block font-size="36pt" font-weight="bold" margin-left="1mm">
986
+ <xsl:call-template name="add-letter-spacing">
987
+ <xsl:with-param name="text" select="$proof-text"/>
988
+ <xsl:with-param name="letter-spacing" select="0.65"/>
989
+ </xsl:call-template>
990
+ </fo:block>
986
991
  </xsl:if>
987
992
  </fo:block>
988
993
  </fo:block-container>
@@ -1456,7 +1461,7 @@
1456
1461
  <fo:block font-size="9pt"><xsl:value-of select="$copyrightText"/></fo:block>
1457
1462
  </fo:table-cell>
1458
1463
  <fo:table-cell>
1459
- <fo:block font-size="11pt" font-weight="bold" text-align="center">
1464
+ <fo:block font-size="10pt" font-weight="bold" text-align="center">
1460
1465
  <xsl:if test="$stage-abbreviation = 'PRF'">
1461
1466
  <xsl:value-of select="$proof-text"/>
1462
1467
  </xsl:if>
@@ -1676,6 +1681,7 @@
1676
1681
  <xsl:variable name="display">
1677
1682
  <xsl:choose>
1678
1683
  <xsl:when test="ancestor-or-self::iso:annex and $level &gt;= 2">false</xsl:when>
1684
+ <xsl:when test="ancestor-or-self::iso:introduction and $level &gt;= 2">false</xsl:when>
1679
1685
  <xsl:when test="$section = '' and $type = 'clause'">false</xsl:when>
1680
1686
  <xsl:when test="$level &lt;= $toc_level">true</xsl:when>
1681
1687
  <xsl:otherwise>false</xsl:otherwise>
@@ -1796,6 +1802,7 @@
1796
1802
  <xsl:choose>
1797
1803
  <xsl:when test="ancestor::iso:annex and $level = 2">13pt</xsl:when>
1798
1804
  <xsl:when test="ancestor::iso:annex and $level = 3">12pt</xsl:when>
1805
+ <xsl:when test="ancestor::iso:introduction and $level &gt;= 2">11pt</xsl:when>
1799
1806
  <xsl:when test="ancestor::iso:preface">16pt</xsl:when>
1800
1807
  <xsl:when test="$level = 2">12pt</xsl:when>
1801
1808
  <xsl:when test="$level &gt;= 3">11pt</xsl:when>
@@ -1822,19 +1829,30 @@
1822
1829
  <xsl:element name="{$element-name}">
1823
1830
  <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
1824
1831
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1825
- <xsl:attribute name="margin-top"> <!-- margin-top -->
1832
+ <xsl:variable name="attribute-name-before">
1826
1833
  <xsl:choose>
1834
+ <xsl:when test="ancestor::iso:preface and $level = 1">margin-top</xsl:when> <!-- for Foreword and Introduction titles -->
1835
+ <xsl:otherwise>space-before</xsl:otherwise>
1836
+ </xsl:choose>
1837
+ </xsl:variable>
1838
+ <xsl:attribute name="{$attribute-name-before}"> <!-- space-before or margin-top -->
1839
+ <xsl:choose>
1840
+ <xsl:when test="ancestor::iso:introduction and $level &gt;= 2 and ../preceding-sibling::iso:clause">30pt</xsl:when>
1827
1841
  <xsl:when test="ancestor::iso:preface">8pt</xsl:when>
1828
1842
  <xsl:when test="$level = 2 and ancestor::iso:annex">18pt</xsl:when>
1829
1843
  <xsl:when test="$level = 1">18pt</xsl:when>
1830
- <xsl:when test="$level &gt;= 3">3pt</xsl:when>
1831
- <xsl:when test="$level = ''">6pt</xsl:when><!-- 13.5pt -->
1844
+ <xsl:when test="($level = 2 or $level = 3) and not(../preceding-sibling::iso:clause)">14pt</xsl:when> <!-- first title in 3rd level clause -->
1845
+ <xsl:when test="$level = 3">14pt</xsl:when>
1846
+ <xsl:when test="$level &gt; 3">3pt</xsl:when>
1847
+ <xsl:when test="$level = ''">6pt</xsl:when>
1832
1848
  <xsl:otherwise>12pt</xsl:otherwise>
1833
1849
  </xsl:choose>
1834
1850
  </xsl:attribute>
1835
- <xsl:attribute name="margin-bottom">
1851
+ <xsl:attribute name="space-after"> <!-- margin-bottom -->
1836
1852
  <xsl:choose>
1853
+ <xsl:when test="ancestor::iso:introduction and $level &gt;= 2">8pt</xsl:when>
1837
1854
  <xsl:when test="ancestor::iso:preface">18pt</xsl:when>
1855
+ <xsl:when test="$level = 3">9pt</xsl:when>
1838
1856
  <!-- <xsl:otherwise>12pt</xsl:otherwise> -->
1839
1857
  <xsl:otherwise>8pt</xsl:otherwise>
1840
1858
  </xsl:choose>
@@ -1900,6 +1918,26 @@
1900
1918
  </xsl:choose>
1901
1919
  </xsl:attribute>
1902
1920
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1921
+ <xsl:if test="count(ancestor::iso:li) = 1 and not(ancestor::iso:li[1]/following-sibling::iso:li) and not(following-sibling::iso:p)">
1922
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
1923
+ </xsl:if>
1924
+ <xsl:if test="starts-with(ancestor::*[local-name() = 'table'][1]/@type, 'recommend') and not(following-sibling::*[local-name() = 'p'])">
1925
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
1926
+ </xsl:if>
1927
+ <xsl:if test="parent::*[local-name() = 'td' or local-name() = 'th']">
1928
+ <xsl:choose>
1929
+ <xsl:when test="not(following-sibling::*)"> <!-- last paragraph in table cell -->
1930
+ <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
1931
+ </xsl:when>
1932
+ <xsl:otherwise>
1933
+ <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
1934
+ </xsl:otherwise>
1935
+ </xsl:choose>
1936
+ <!-- Special case: if paragraph in 'strong', i.e. it's sub-header, then keeps with next -->
1937
+ <xsl:if test="count(node()) = count(*[local-name() = 'strong']) and following-sibling::*">
1938
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1939
+ </xsl:if>
1940
+ </xsl:if>
1903
1941
  <xsl:if test="@id">
1904
1942
  <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
1905
1943
  </xsl:if>
@@ -2058,7 +2096,7 @@
2058
2096
  <fo:block><fo:page-number/></fo:block>
2059
2097
  </fo:table-cell>
2060
2098
  <fo:table-cell display-align="center">
2061
- <fo:block font-size="11pt" font-weight="bold" text-align="center">
2099
+ <fo:block font-size="10pt" font-weight="bold" text-align="center">
2062
2100
  <xsl:if test="$stage-abbreviation = 'PRF'">
2063
2101
  <xsl:value-of select="$proof-text"/>
2064
2102
  </xsl:if>
@@ -2111,7 +2149,7 @@
2111
2149
  <fo:block><xsl:value-of select="$copyrightText"/></fo:block>
2112
2150
  </fo:table-cell>
2113
2151
  <fo:table-cell display-align="center">
2114
- <fo:block font-size="11pt" font-weight="bold" text-align="center">
2152
+ <fo:block font-size="10pt" font-weight="bold" text-align="center">
2115
2153
  <xsl:if test="$stage-abbreviation = 'PRF'">
2116
2154
  <xsl:value-of select="$proof-text"/>
2117
2155
  </xsl:if>
@@ -2586,6 +2624,14 @@
2586
2624
 
2587
2625
  </xsl:attribute-set>
2588
2626
 
2627
+ <xsl:attribute-set name="pre-style">
2628
+ <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
2629
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2630
+
2631
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2632
+
2633
+ </xsl:attribute-set>
2634
+
2589
2635
  <xsl:attribute-set name="permission-style">
2590
2636
 
2591
2637
  </xsl:attribute-set>
@@ -2707,9 +2753,15 @@
2707
2753
  <!-- ========================== -->
2708
2754
  <xsl:variable name="table-border_">
2709
2755
 
2756
+ 1pt solid black
2710
2757
  </xsl:variable>
2711
2758
  <xsl:variable name="table-border" select="normalize-space($table-border_)"/>
2712
2759
 
2760
+ <xsl:variable name="table-cell-border_">
2761
+ 0.5pt solid black
2762
+ </xsl:variable>
2763
+ <xsl:variable name="table-cell-border" select="normalize-space($table-cell-border_)"/>
2764
+
2713
2765
  <xsl:attribute-set name="table-container-style">
2714
2766
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2715
2767
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -2723,10 +2775,8 @@
2723
2775
  <xsl:attribute-set name="table-style">
2724
2776
  <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
2725
2777
  <xsl:attribute name="table-layout">fixed</xsl:attribute>
2726
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2727
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
2728
2778
 
2729
- <xsl:attribute name="border">1.5pt solid black</xsl:attribute>
2779
+ <xsl:attribute name="border"><xsl:value-of select="$table-border"/></xsl:attribute>
2730
2780
 
2731
2781
  </xsl:attribute-set><!-- table-style -->
2732
2782
 
@@ -2748,16 +2798,16 @@
2748
2798
  <xsl:attribute-set name="table-header-row-style" use-attribute-sets="table-row-style">
2749
2799
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2750
2800
 
2751
- <xsl:attribute name="border-top">solid black 1pt</xsl:attribute>
2752
- <xsl:attribute name="border-bottom">solid black 1pt</xsl:attribute>
2801
+ <xsl:attribute name="border-top"><xsl:value-of select="$table-border"/></xsl:attribute>
2802
+ <xsl:attribute name="border-bottom"><xsl:value-of select="$table-border"/></xsl:attribute>
2753
2803
 
2754
2804
  </xsl:attribute-set>
2755
2805
 
2756
2806
  <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
2757
2807
 
2758
2808
  <xsl:attribute name="font-size">9pt</xsl:attribute>
2759
- <xsl:attribute name="border-left">solid black 1pt</xsl:attribute>
2760
- <xsl:attribute name="border-right">solid black 1pt</xsl:attribute>
2809
+ <xsl:attribute name="border-left"><xsl:value-of select="$table-border"/></xsl:attribute>
2810
+ <xsl:attribute name="border-right"><xsl:value-of select="$table-border"/></xsl:attribute>
2761
2811
 
2762
2812
  </xsl:attribute-set>
2763
2813
 
@@ -2773,6 +2823,8 @@
2773
2823
  <xsl:attribute name="display-align">center</xsl:attribute>
2774
2824
 
2775
2825
  <xsl:attribute name="padding-top">1mm</xsl:attribute>
2826
+ <xsl:attribute name="border-left"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2827
+ <xsl:attribute name="border-right"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2776
2828
 
2777
2829
  </xsl:attribute-set> <!-- table-header-cell-style -->
2778
2830
 
@@ -2783,6 +2835,7 @@
2783
2835
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2784
2836
 
2785
2837
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2838
+ <xsl:attribute name="border"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2786
2839
 
2787
2840
  </xsl:attribute-set> <!-- table-cell-style -->
2788
2841
 
@@ -2792,6 +2845,7 @@
2792
2845
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2793
2846
  <xsl:attribute name="padding-top">1mm</xsl:attribute>
2794
2847
 
2848
+ <xsl:attribute name="border"><xsl:value-of select="$table-border"/></xsl:attribute>
2795
2849
  <xsl:attribute name="border-top">solid black 0pt</xsl:attribute>
2796
2850
 
2797
2851
  </xsl:attribute-set> <!-- table-footer-cell-style -->
@@ -3848,14 +3902,20 @@
3848
3902
  <xsl:variable name="table_attributes">
3849
3903
 
3850
3904
  <xsl:element name="table_attributes" use-attribute-sets="table-style">
3905
+
3906
+ <xsl:if test="$margin-side != 0">
3907
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3908
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3909
+ </xsl:if>
3910
+
3851
3911
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
3852
3912
 
3853
3913
  <xsl:if test="*[local-name()='thead']">
3854
- <xsl:attribute name="border-top">1pt solid black</xsl:attribute>
3914
+ <xsl:attribute name="border-top"><xsl:value-of select="$table-border"/></xsl:attribute>
3855
3915
  </xsl:if>
3856
3916
  <xsl:if test="ancestor::*[local-name() = 'table']">
3857
3917
  <!-- for internal table in table cell -->
3858
- <xsl:attribute name="border">0.5pt solid black</xsl:attribute>
3918
+ <xsl:attribute name="border"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
3859
3919
  </xsl:if>
3860
3920
 
3861
3921
  </xsl:element>
@@ -4390,6 +4450,12 @@
4390
4450
  <fo:table-row>
4391
4451
  <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
4392
4452
 
4453
+ <xsl:attribute name="border-left">1pt solid white</xsl:attribute>
4454
+ <xsl:attribute name="border-right">1pt solid white</xsl:attribute>
4455
+ <xsl:attribute name="border-top">1pt solid white</xsl:attribute>
4456
+ <!-- <xsl:attribute name="border-bottom">0.5pt solid white</xsl:attribute> -->
4457
+ <xsl:attribute name="border-bottom">none</xsl:attribute>
4458
+
4393
4459
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
4394
4460
  <xsl:with-param name="continued">true</xsl:with-param>
4395
4461
  </xsl:apply-templates>
@@ -4651,12 +4717,12 @@
4651
4717
 
4652
4718
  <xsl:choose>
4653
4719
  <xsl:when test="position() = 1">
4654
- <xsl:attribute name="border-top">solid black 1.5pt</xsl:attribute>
4655
- <xsl:attribute name="border-bottom">solid black 1pt</xsl:attribute>
4720
+ <xsl:attribute name="border-top"><xsl:value-of select="$table-border"/></xsl:attribute>
4721
+ <xsl:attribute name="border-bottom"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
4656
4722
  </xsl:when>
4657
4723
  <xsl:when test="position() = last()">
4658
- <xsl:attribute name="border-top">solid black 1pt</xsl:attribute>
4659
- <xsl:attribute name="border-bottom">solid black 1.5pt</xsl:attribute>
4724
+ <xsl:attribute name="border-top"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
4725
+ <xsl:attribute name="border-bottom"><xsl:value-of select="$table-border"/></xsl:attribute>
4660
4726
  </xsl:when>
4661
4727
  </xsl:choose>
4662
4728
 
@@ -4679,6 +4745,14 @@
4679
4745
  <xsl:template match="*[local-name()='tr']">
4680
4746
  <fo:table-row xsl:use-attribute-sets="table-body-row-style">
4681
4747
 
4748
+ <xsl:if test="*[local-name() = 'th']">
4749
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
4750
+ </xsl:if>
4751
+
4752
+ <xsl:if test="position() = 1 and not(ancestor::*[local-name() = 'table']/*[local-name() = 'thead'])">
4753
+ <xsl:attribute name="border-top"><xsl:value-of select="$table-border"/></xsl:attribute>
4754
+ </xsl:if>
4755
+
4682
4756
  <xsl:call-template name="setTableRowAttributes"/>
4683
4757
  <xsl:apply-templates/>
4684
4758
  </fo:table-row>
@@ -4698,6 +4772,11 @@
4698
4772
  <xsl:with-param name="default">center</xsl:with-param>
4699
4773
  </xsl:call-template>
4700
4774
 
4775
+ <xsl:if test="../parent::*[local-name() = 'tbody'] and (following-sibling::*[local-name() = 'td'] or preceding-sibling::*[local-name() = 'td'])">
4776
+ <xsl:attribute name="border-top"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
4777
+ <xsl:attribute name="border-bottom"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
4778
+ </xsl:if>
4779
+
4701
4780
  <xsl:if test="$lang = 'ar'">
4702
4781
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
4703
4782
  </xsl:if>
@@ -4753,6 +4832,13 @@
4753
4832
  <xsl:if test="ancestor::*[local-name() = 'tfoot']">
4754
4833
  <xsl:attribute name="border">solid black 0</xsl:attribute>
4755
4834
  </xsl:if>
4835
+ <xsl:if test="starts-with(ancestor::*[local-name() = 'table'][1]/@type, 'recommend')">
4836
+ <xsl:attribute name="display-align">before</xsl:attribute>
4837
+ </xsl:if>
4838
+ <xsl:if test="ancestor::*[local-name() = 'tbody'] and not(../preceding-sibling::*[local-name() = 'tr']) and ancestor::*[local-name() = 'table'][1]/*[local-name() = 'thead']"> <!-- cells in 1st row in the table body, and if thead exists -->
4839
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
4840
+ </xsl:if>
4841
+ <!-- <xsl:attribute name="page-break-inside">avoid</xsl:attribute> -->
4756
4842
 
4757
4843
  <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
4758
4844
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -5743,8 +5829,17 @@
5743
5829
  </fo:inline>
5744
5830
  </xsl:template> <!-- tt -->
5745
5831
 
5832
+ <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
5746
5833
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
5747
- <xsl:call-template name="add_spaces_to_sourcecode"/>
5834
+ <xsl:choose>
5835
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
5836
+ <!-- url -->
5837
+ <xsl:call-template name="add-zero-spaces-link-java"/>
5838
+ </xsl:when>
5839
+ <xsl:otherwise>
5840
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
5841
+ </xsl:otherwise>
5842
+ </xsl:choose>
5748
5843
  </xsl:template>
5749
5844
 
5750
5845
  <xsl:template match="*[local-name()='underline']">
@@ -6100,8 +6195,11 @@
6100
6195
 
6101
6196
  <xsl:template name="add-zero-spaces-link-java">
6102
6197
  <xsl:param name="text" select="."/>
6198
+
6199
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
6200
+ <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
6103
6201
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
6104
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
6202
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
6105
6203
  </xsl:template>
6106
6204
 
6107
6205
  <!-- add zero space after dash character (for table's entries) -->
@@ -6658,6 +6756,9 @@
6658
6756
  <xsl:value-of select="substring($str, 2)"/>
6659
6757
  </xsl:template>
6660
6758
 
6759
+ <!-- ======================================= -->
6760
+ <!-- math -->
6761
+ <!-- ======================================= -->
6661
6762
  <xsl:template match="mathml:math">
6662
6763
  <xsl:variable name="isAdded" select="@added"/>
6663
6764
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -6708,14 +6809,57 @@
6708
6809
  <xsl:value-of select="$comment_text"/>
6709
6810
  </xsl:template>
6710
6811
 
6812
+ <xsl:template match="*[local-name() = 'asciimath']">
6813
+ <xsl:param name="process" select="'false'"/>
6814
+ <xsl:if test="$process = 'true'">
6815
+ <xsl:apply-templates/>
6816
+ </xsl:if>
6817
+ </xsl:template>
6818
+
6819
+ <xsl:template match="*[local-name() = 'latexmath']"/>
6820
+
6821
+ <xsl:template name="getMathml_asciimath_text">
6822
+ <xsl:variable name="asciimath" select="../*[local-name() = 'asciimath']"/>
6823
+ <xsl:variable name="latexmath">
6824
+
6825
+ </xsl:variable>
6826
+ <xsl:variable name="asciimath_text_following">
6827
+ <xsl:choose>
6828
+ <xsl:when test="normalize-space($latexmath) != ''">
6829
+ <xsl:value-of select="$latexmath"/>
6830
+ </xsl:when>
6831
+ <xsl:when test="normalize-space($asciimath) != ''">
6832
+ <xsl:value-of select="$asciimath"/>
6833
+ </xsl:when>
6834
+ <xsl:otherwise>
6835
+ <xsl:value-of select="following-sibling::node()[1][self::comment()]"/>
6836
+ </xsl:otherwise>
6837
+ </xsl:choose>
6838
+ </xsl:variable>
6839
+ <xsl:variable name="asciimath_text_">
6840
+ <xsl:choose>
6841
+ <xsl:when test="normalize-space($asciimath_text_following) != ''">
6842
+ <xsl:value-of select="$asciimath_text_following"/>
6843
+ </xsl:when>
6844
+ <xsl:otherwise>
6845
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
6846
+ </xsl:otherwise>
6847
+ </xsl:choose>
6848
+ </xsl:variable>
6849
+ <xsl:variable name="asciimath_text_2" select="java:org.metanorma.fop.Util.unescape($asciimath_text_)"/>
6850
+ <xsl:variable name="asciimath_text" select="java:trim(java:java.lang.String.new($asciimath_text_2))"/>
6851
+ <xsl:value-of select="$asciimath_text"/>
6852
+ </xsl:template>
6853
+
6711
6854
  <xsl:template name="mathml_instream_object">
6712
- <xsl:param name="comment_text"/>
6855
+ <xsl:param name="asciimath_text"/>
6713
6856
  <xsl:param name="mathml_content"/>
6714
6857
 
6715
- <xsl:variable name="comment_text_">
6858
+ <xsl:variable name="asciimath_text_">
6716
6859
  <xsl:choose>
6717
- <xsl:when test="normalize-space($comment_text) != ''"><xsl:value-of select="$comment_text"/></xsl:when>
6718
- <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise>
6860
+ <xsl:when test="normalize-space($asciimath_text) != ''"><xsl:value-of select="$asciimath_text"/></xsl:when>
6861
+ <!-- <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise> -->
6862
+ <xsl:otherwise><xsl:call-template name="getMathml_asciimath_text"/></xsl:otherwise>
6719
6863
  </xsl:choose>
6720
6864
  </xsl:variable>
6721
6865
 
@@ -6739,10 +6883,10 @@
6739
6883
  </xsl:attribute>
6740
6884
 
6741
6885
  <!-- <xsl:if test="$add_math_as_text = 'true'"> -->
6742
- <xsl:if test="normalize-space($comment_text_) != ''">
6886
+ <xsl:if test="normalize-space($asciimath_text_) != ''">
6743
6887
  <!-- put Mathin Alternate Text -->
6744
6888
  <xsl:attribute name="fox:alt-text">
6745
- <xsl:value-of select="$comment_text_"/>
6889
+ <xsl:value-of select="$asciimath_text_"/>
6746
6890
  </xsl:attribute>
6747
6891
  </xsl:if>
6748
6892
  <!-- </xsl:if> -->
@@ -6815,6 +6959,29 @@
6815
6959
  <xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
6816
6960
  </xsl:template>
6817
6961
 
6962
+ <!-- Examples:
6963
+ <stem type="AsciiMath">x = 1</stem>
6964
+ <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
6965
+ <stem type="AsciiMath"><asciimath>x = 1</asciimath><latexmath>x = 1</latexmath></stem>
6966
+ -->
6967
+ <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
6968
+ <fo:inline xsl:use-attribute-sets="mathml-style">
6969
+
6970
+ <xsl:choose>
6971
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
6972
+ <xsl:otherwise>
6973
+ <xsl:apply-templates>
6974
+ <xsl:with-param name="process">true</xsl:with-param>
6975
+ </xsl:apply-templates>
6976
+ </xsl:otherwise>
6977
+ </xsl:choose>
6978
+
6979
+ </fo:inline>
6980
+ </xsl:template>
6981
+ <!-- ======================================= -->
6982
+ <!-- END: math -->
6983
+ <!-- ======================================= -->
6984
+
6818
6985
  <xsl:template match="*[local-name()='localityStack']"/>
6819
6986
 
6820
6987
  <xsl:template match="*[local-name()='link']" name="link">
@@ -8163,9 +8330,9 @@
8163
8330
  <xsl:apply-templates mode="contents_item"/>
8164
8331
  </xsl:template>
8165
8332
 
8166
- <!-- ====== -->
8167
- <!-- sourcecode -->
8168
- <!-- ====== -->
8333
+ <!-- =============== -->
8334
+ <!-- sourcecode -->
8335
+ <!-- =============== -->
8169
8336
  <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
8170
8337
 
8171
8338
  <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
@@ -8462,8 +8629,22 @@
8462
8629
  </fo:block>
8463
8630
  </xsl:if>
8464
8631
  </xsl:template>
8465
- <!-- ====== -->
8466
- <!-- ====== -->
8632
+ <!-- =============== -->
8633
+ <!-- END sourcecode -->
8634
+ <!-- =============== -->
8635
+
8636
+ <!-- =============== -->
8637
+ <!-- pre -->
8638
+ <!-- =============== -->
8639
+ <xsl:template match="*[local-name()='pre']" name="pre">
8640
+ <fo:block xsl:use-attribute-sets="pre-style">
8641
+ <xsl:copy-of select="@id"/>
8642
+ <xsl:apply-templates/>
8643
+ </fo:block>
8644
+ </xsl:template>
8645
+ <!-- =============== -->
8646
+ <!-- pre -->
8647
+ <!-- =============== -->
8467
8648
 
8468
8649
  <!-- ========== -->
8469
8650
  <!-- permission -->
@@ -9507,6 +9688,10 @@
9507
9688
 
9508
9689
  <fo:list-block xsl:use-attribute-sets="list-style">
9509
9690
 
9691
+ <xsl:if test="not(ancestor::*[local-name() = 'ul' or local-name() = 'ol'])">
9692
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
9693
+ </xsl:if>
9694
+
9510
9695
  <xsl:if test="*[local-name() = 'name']">
9511
9696
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
9512
9697
  </xsl:if>
@@ -10641,7 +10826,7 @@
10641
10826
 
10642
10827
  <xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
10643
10828
 
10644
- <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'])]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
10829
+ <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
10645
10830
 
10646
10831
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
10647
10832
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
@@ -11125,13 +11310,14 @@
11125
11310
  </xsl:template>
11126
11311
 
11127
11312
  <xsl:template name="setId">
11313
+ <xsl:param name="prefix"/>
11128
11314
  <xsl:attribute name="id">
11129
11315
  <xsl:choose>
11130
11316
  <xsl:when test="@id">
11131
- <xsl:value-of select="@id"/>
11317
+ <xsl:value-of select="concat($prefix, @id)"/>
11132
11318
  </xsl:when>
11133
11319
  <xsl:otherwise>
11134
- <xsl:value-of select="generate-id()"/>
11320
+ <xsl:value-of select="concat($prefix, generate-id())"/>
11135
11321
  </xsl:otherwise>
11136
11322
  </xsl:choose>
11137
11323
  </xsl:attribute>
@@ -10,23 +10,28 @@ module IsoDoc
10
10
  def warning_for_missing_metadata(docxml)
11
11
  return unless @meta.get[:unpublished]
12
12
 
13
+ ret = warning_for_missing_metadata_create(docxml)
14
+ return if ret.empty?
15
+
16
+ warning_for_missing_metadata_post(docxml, ret)
17
+ end
18
+
19
+ def warning_for_missing_metadata_create(docxml)
13
20
  ret = ""
14
21
  docxml.at(ns("//bibdata/ext//secretariat")) or
15
22
  ret += "<p>Secretariat is missing.</p>"
16
23
  docxml.at(ns("//bibdata/ext//editorialgroup")) or
17
24
  ret += "<p>Editorial groups are missing.</p>"
18
- docxml.at(ns("//bibdata/date[@type = 'published' or @type = 'issued' "\
25
+ docxml.at(ns("//bibdata/date[@type = 'published' or @type = 'issued' " \
19
26
  "or @type = 'created']")) ||
20
27
  docxml.at(ns("//bibdata/version/revision-date")) or
21
28
  ret += "<p>Document date is missing.</p>"
22
- return if ret.empty?
23
-
24
- warning_for_missing_metadata1(docxml, ret)
29
+ ret
25
30
  end
26
31
 
27
- def warning_for_missing_metadata1(docxml, ret)
32
+ def warning_for_missing_metadata_post(docxml, ret)
28
33
  id = UUIDTools::UUID.random_create
29
- ret = "<review date='#{Date.today}' reviewer='Metanorma' id='_#{id}'>"\
34
+ ret = "<review date='#{Date.today}' reviewer='Metanorma' id='_#{id}'>" \
30
35
  "<p><strong>Metadata warnings:<strong></p> #{ret}</review>"
31
36
  ins = docxml.at(ns("//sections//title")) or return
32
37
  ins.children.first.previous = ret
@@ -65,9 +70,8 @@ module IsoDoc
65
70
  i18n.get["stage_dict"][stage.text].is_a?(Hash) or
66
71
  return hash_translate(bib, i18n.get["stage_dict"],
67
72
  "./status/stage", lang)
68
- i18n.get["stage_dict"][stage.text][type&.text] and
69
- tag_translate(stage, lang,
70
- i18n.get["stage_dict"][stage.text][type&.text])
73
+ stagetype = i18n.get["stage_dict"][stage.text][type&.text] and
74
+ tag_translate(stage, lang, stagetype)
71
75
  end
72
76
  end
73
77
  end
@@ -76,9 +76,11 @@ module IsoDoc
76
76
  end
77
77
 
78
78
  def clause(docxml)
79
- docxml.xpath(ns("//clause[not(ancestor::annex)] | "\
80
- "//terms | //definitions | //references | "\
79
+ docxml.xpath(ns("//clause[not(ancestor::annex)] | " \
80
+ "//terms | //definitions | //references | " \
81
81
  "//preface/introduction[clause]")).each do |f|
82
+ f.parent.name == "annex" &&
83
+ @xrefs.klass.single_term_clause?(f.parent) and next
82
84
  clause1(f)
83
85
  end
84
86
  end
@@ -133,7 +135,7 @@ module IsoDoc
133
135
  i = display_order_at(docxml, "//clause[@type = 'scope']", i)
134
136
  i = display_order_at(docxml, @xrefs.klass.norm_ref_xpath, i)
135
137
  i = display_order_xpath(docxml,
136
- "//sections/clause[not(@type = 'scope')] | "\
138
+ "//sections/clause[not(@type = 'scope')] | " \
137
139
  "//sections/terms | //sections/definitions", i)
138
140
  i = display_order_xpath(docxml, "//annex", i)
139
141
  i = display_order_xpath(docxml, @xrefs.klass.bibliography_xpath, i)
@@ -104,15 +104,18 @@ module IsoDoc
104
104
  locality_span_wrap(ret, type)
105
105
  end
106
106
 
107
- def prefix_container(container, linkend, target)
107
+ def prefix_container(container, linkend, node, target)
108
108
  delim = ", "
109
- type = :xref
110
- if @xrefs.anchor(target, :type) == "listitem" &&
109
+ ref = if @xrefs.anchor(target, :type) == "listitem" &&
111
110
  !@xrefs.anchor(target, :refer_list)
112
- delim = " "
113
- type = :label # 7 a) not Clause 7 a), but Clause 7 List 1 a)
114
- end
115
- l10n(@xrefs.anchor(container, type) + delim + linkend)
111
+ delim = " "
112
+ @xrefs.anchor(container, :label)
113
+ # 7 a) : Clause 7 a), but Clause 7 List 1 a)
114
+ else
115
+ anchor_xref(node, container)
116
+ end
117
+
118
+ l10n(ref + delim + linkend)
116
119
  end
117
120
 
118
121
  def expand_citeas(text)
@@ -48,7 +48,7 @@ module IsoDoc
48
48
  end
49
49
 
50
50
  def foreword(isoxml, out)
51
- f = isoxml.at(ns("//foreword")) || return
51
+ f = isoxml.at(ns("//foreword")) or return
52
52
  @foreword = true
53
53
  page_break(out)
54
54
  out.div **attr_code(id: f["id"]) do |s|