metanorma-un 0.10.12 → 0.11.0

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: 586884ec696f72e729ba9a9502bde8b410bc029842332ab1e6895a41af645c43
4
- data.tar.gz: 7c9cc667331ae0f51c96b6550aed79bcf4d5b8e4ac3dce11f770bb4f50b70e2f
3
+ metadata.gz: 633ea5daa3f540bef45566dd48c57acf9b736477bb2b4264faea2c30cab0c3b3
4
+ data.tar.gz: d1b1f2e6fc90eeb24bf51be943dc0cfcd1afa7730d0d37539b24d70bf297078e
5
5
  SHA512:
6
- metadata.gz: 29e01f51a7ad2a42be4f8eca3b025b6d951653ce989630ffbd34bc95de3b0884cfac3fb2f9145171f7551b0213a4f40e90249de465bd71731553eaffe937e615
7
- data.tar.gz: 076af55bea40298a002c290c29966242483aa235b5885b729dd68604bebaa5f7688160e630a04384e12570606f7bdfad84600392432d9b3fcaac9676ca76ca10
6
+ metadata.gz: dd675bedc775517e9483799880bf57c31c967788938d62bbe32eb7a975837c973b1849e6f867841763b9e3f2027ad039fbb51981d729487087b3e654894c7a39
7
+ data.tar.gz: dac9c0da31d353fdc028dd018d6273e4506ebacd5223e212baa0b72c814f0a243cd7644099afbf2fba0ad9ed3ff3410026ff34c70c2e04c7a412ad51f25a567d
@@ -7,6 +7,15 @@ module IsoDoc
7
7
  "//clause[parent::sections]"
8
8
  end
9
9
 
10
+ def norm_ref_xpath
11
+ "//null"
12
+ end
13
+
14
+ def bibliography_xpath
15
+ "//bibliography/clause[.//references] | " \
16
+ "//bibliography/references"
17
+ end
18
+
10
19
  def admonition_parse(node, out)
11
20
  name = node.at(ns("./name"))
12
21
  out.div **admonition_attrs(node) do |t|
@@ -18,7 +27,7 @@ module IsoDoc
18
27
  end
19
28
 
20
29
  def inline_header_title(out, _node, title)
21
- out.span **{ class: "zzMoveToFollowing" } do |s|
30
+ out.span class: "zzMoveToFollowing" do |s|
22
31
  title&.children&.each { |c2| parse(c2, s) }
23
32
  clausedelimspace(_node, out) if /\S/.match?(title&.text)
24
33
  end
@@ -32,6 +41,10 @@ module IsoDoc
32
41
  false
33
42
  end
34
43
 
44
+ def norm_ref(node, out)
45
+ bibliography(node, out)
46
+ end
47
+
35
48
  def convert_i18n_init1(docxml)
36
49
  super
37
50
  docxml.xpath(ns("//bibdata/language")).size > 1 and @lang = "en"
@@ -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
 
@@ -751,7 +755,7 @@ ol ul > li:first-child {
751
755
  #toc-list li {
752
756
  list-style-type: none; }
753
757
 
754
- #toc li:before {
758
+ #toc li::before {
755
759
  content: " ";
756
760
  display: none; }
757
761
 
@@ -424,7 +424,7 @@ ol ul > li:first-child {
424
424
  list-style-type: none;
425
425
  }
426
426
 
427
- #toc li:before {
427
+ #toc li::before {
428
428
  content: " ";
429
429
  display: none;
430
430
  }
@@ -65,23 +65,6 @@ module IsoDoc
65
65
  end
66
66
  end
67
67
 
68
- def make_body3(body, docxml)
69
- body.div class: "main-section" do |div3|
70
- boilerplate docxml, div3
71
- front docxml, div3
72
- middle docxml, div3
73
- footnotes div3
74
- comments div3
75
- end
76
- end
77
-
78
- def middle(isoxml, out)
79
- middle_admonitions(isoxml, out)
80
- clause isoxml, out
81
- annex isoxml, out
82
- bibliography isoxml, out
83
- end
84
-
85
68
  def introduction(clause, out)
86
69
  page_break(out)
87
70
  out.div class: "Section3", id: clause["id"] do |div|
@@ -1,3 +1,4 @@
1
1
  admonition: Box
2
2
  abstract: Summary
3
3
  paragraph: paragraph
4
+ table_of_contents: Contents
@@ -9,6 +9,8 @@ module IsoDoc
9
9
  @toc = options[:toc]
10
10
  end
11
11
 
12
+ def middle_title(docxml); end
13
+
12
14
  def note1(elem)
13
15
  return if elem.parent.name == "bibitem"
14
16
  return if elem["type"] == "title-footnote"
@@ -871,19 +871,32 @@
871
871
  <xsl:variable name="titles_">
872
872
 
873
873
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
874
- <title-toc lang="en">
875
-
876
- </title-toc>
877
- <title-toc lang="fr">
874
+ <!-- <title-toc lang="en">
875
+ <xsl:if test="$namespace = 'csd' or $namespace = 'ieee' or $namespace = 'iho' or $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'unece-rec'">
876
+ <xsl:text>Contents</xsl:text>
877
+ </xsl:if>
878
+ <xsl:if test="$namespace = 'csa' or $namespace = 'm3d' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper'">
879
+ <xsl:text>Table of Contents</xsl:text>
880
+ </xsl:if>
881
+ <xsl:if test="$namespace = 'gb'">
882
+ <xsl:text>Table of contents</xsl:text>
883
+ </xsl:if>
884
+ </title-toc> -->
885
+ <title-toc lang="en">Table of contents</title-toc>
886
+ <!-- <title-toc lang="fr">
878
887
  <xsl:text>Sommaire</xsl:text>
879
- </title-toc>
880
- <title-toc lang="zh">
881
-
888
+ </title-toc> -->
889
+ <!-- <title-toc lang="zh">
890
+ <xsl:choose>
891
+ <xsl:when test="$namespace = 'gb'">
892
+ <xsl:text>目次</xsl:text>
893
+ </xsl:when>
894
+ <xsl:otherwise>
882
895
  <xsl:text>Contents</xsl:text>
883
-
884
- </title-toc>
885
-
886
- <title-descriptors lang="en">Descriptors</title-descriptors>
896
+ </xsl:otherwise>
897
+ </xsl:choose>
898
+ </title-toc> -->
899
+ <title-toc lang="zh">目次</title-toc>
887
900
 
888
901
  <title-part lang="en">
889
902
 
@@ -899,20 +912,6 @@
899
912
  <title-subpart lang="en">Sub-part #</title-subpart>
900
913
  <title-subpart lang="fr">Partie de sub #</title-subpart>
901
914
 
902
- <title-list-tables lang="en">List of Tables</title-list-tables>
903
-
904
- <title-list-figures lang="en">List of Figures</title-list-figures>
905
-
906
- <title-table-figures lang="en">Table of Figures</title-table-figures>
907
-
908
- <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
909
-
910
- <title-summary lang="en">Summary</title-summary>
911
-
912
- <title-continued lang="ru">(продолжение)</title-continued>
913
- <title-continued lang="en">(continued)</title-continued>
914
- <title-continued lang="fr">(continué)</title-continued>
915
-
916
915
  </xsl:variable>
917
916
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
918
917
 
@@ -920,8 +919,8 @@
920
919
  <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
921
920
  <xsl:value-of select="$toc_table_title"/>
922
921
  <xsl:if test="normalize-space($toc_table_title) = ''">
923
- <xsl:call-template name="getTitle">
924
- <xsl:with-param name="name" select="'title-list-tables'"/>
922
+ <xsl:call-template name="getLocalizedString">
923
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
925
924
  </xsl:call-template>
926
925
  </xsl:if>
927
926
  </xsl:variable>
@@ -930,8 +929,8 @@
930
929
  <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
931
930
  <xsl:value-of select="$toc_figure_title"/>
932
931
  <xsl:if test="normalize-space($toc_figure_title) = ''">
933
- <xsl:call-template name="getTitle">
934
- <xsl:with-param name="name" select="'title-list-figures'"/>
932
+ <xsl:call-template name="getLocalizedString">
933
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
935
934
  </xsl:call-template>
936
935
  </xsl:if>
937
936
  </xsl:variable>
@@ -940,8 +939,8 @@
940
939
  <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
941
940
  <xsl:value-of select="$toc_requirement_title"/>
942
941
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
943
- <xsl:call-template name="getTitle">
944
- <xsl:with-param name="name" select="'title-list-recommendations'"/>
942
+ <xsl:call-template name="getLocalizedString">
943
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
945
944
  </xsl:call-template>
946
945
  </xsl:if>
947
946
  </xsl:variable>
@@ -4629,6 +4628,9 @@
4629
4628
  <!-- END Definition List -->
4630
4629
  <!-- ===================== -->
4631
4630
 
4631
+ <!-- default: ignore title in sections/p -->
4632
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
4633
+
4632
4634
  <!-- ========================= -->
4633
4635
  <!-- Rich text formatting -->
4634
4636
  <!-- ========================= -->
@@ -4704,7 +4706,7 @@
4704
4706
  <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
4705
4707
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
4706
4708
  <xsl:choose>
4707
- <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
4709
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), $regex_url_start, '$2') != ''">
4708
4710
  <!-- url -->
4709
4711
  <xsl:call-template name="add-zero-spaces-link-java"/>
4710
4712
  </xsl:when>
@@ -5166,10 +5168,13 @@
5166
5168
  </xsl:choose>
5167
5169
  </xsl:variable>
5168
5170
 
5171
+ <!-- replace sequence #x200B to one &#x200B -->
5172
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b{2,}', '​')"/>
5173
+
5169
5174
  <!-- replace sequence #x200B and space TO space -->
5170
- <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
5175
+ <xsl:variable name="text11" select="java:replaceAll(java:java.lang.String.new($text10), '\u200b ', ' ')"/>
5171
5176
 
5172
- <xsl:value-of select="$text10"/>
5177
+ <xsl:value-of select="$text11"/>
5173
5178
  </xsl:template>
5174
5179
 
5175
5180
  <xsl:template name="add-zero-spaces-link-java">
@@ -5179,8 +5184,12 @@
5179
5184
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
5180
5185
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, comma, slash, @ -->
5181
5186
  <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/|@)','$1​')"/>
5187
+
5188
+ <!-- replace sequence #x200B to one &#x200B -->
5189
+ <xsl:variable name="url2" select="java:replaceAll(java:java.lang.String.new($url), '\u200b{2,}', '​')"/>
5190
+
5182
5191
  <!-- remove zero-width space at the end -->
5183
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
5192
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url2), '​$', '')"/>
5184
5193
  </xsl:template>
5185
5194
 
5186
5195
  <!-- add zero space after dash character (for table's entries) -->
@@ -6443,7 +6452,7 @@
6443
6452
 
6444
6453
  <xsl:call-template name="refine_note_block_style"/>
6445
6454
 
6446
- <fo:inline xsl:use-attribute-sets="note-name-style">
6455
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
6447
6456
 
6448
6457
  <xsl:call-template name="refine_note-name-style"/>
6449
6458
 
@@ -6489,12 +6498,12 @@
6489
6498
  <xsl:variable name="num"><xsl:number/></xsl:variable>
6490
6499
  <xsl:choose>
6491
6500
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
6492
- <fo:inline xsl:use-attribute-sets="note-p-style">
6501
+ <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
6493
6502
  <xsl:apply-templates/>
6494
6503
  </fo:inline>
6495
6504
  </xsl:when>
6496
6505
  <xsl:otherwise>
6497
- <fo:block xsl:use-attribute-sets="note-p-style">
6506
+ <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
6498
6507
  <xsl:apply-templates/>
6499
6508
  </fo:block>
6500
6509
  </xsl:otherwise>
@@ -6713,25 +6722,45 @@
6713
6722
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
6714
6723
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
6715
6724
 
6716
- <xsl:variable name="img_src">
6717
- <xsl:choose>
6718
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6719
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6720
- </xsl:choose>
6721
- </xsl:variable>
6725
+ <xsl:if test="@width != '' and @width != 'auto'">
6726
+ <xsl:attribute name="width">
6727
+ <xsl:value-of select="@width"/>
6728
+ </xsl:attribute>
6729
+ </xsl:if>
6722
6730
 
6723
- <xsl:variable name="image_width_effective">
6731
+ <xsl:if test="@height != '' and @height != 'auto'">
6732
+ <xsl:attribute name="height">
6733
+ <xsl:value-of select="@height"/>
6734
+ </xsl:attribute>
6735
+ </xsl:if>
6724
6736
 
6725
- <xsl:value-of select="$width_effective"/>
6737
+ <xsl:choose>
6738
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
6739
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
6740
+ </xsl:when>
6741
+ <xsl:otherwise>
6726
6742
 
6727
- </xsl:variable>
6743
+ <xsl:variable name="img_src">
6744
+ <xsl:choose>
6745
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6746
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6747
+ </xsl:choose>
6748
+ </xsl:variable>
6728
6749
 
6729
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6730
- <xsl:if test="number($scale) &lt; 100">
6750
+ <xsl:variable name="image_width_effective">
6731
6751
 
6732
- <xsl:attribute name="content-width"><xsl:value-of select="$scale * 0.985"/>%</xsl:attribute><!-- 0.985 due border around image -->
6752
+ <xsl:value-of select="$width_effective"/>
6733
6753
 
6734
- </xsl:if>
6754
+ </xsl:variable>
6755
+
6756
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6757
+ <xsl:if test="number($scale) &lt; 100">
6758
+
6759
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale * 0.985"/>%</xsl:attribute><!-- 0.985 due border around image -->
6760
+
6761
+ </xsl:if>
6762
+ </xsl:otherwise>
6763
+ </xsl:choose>
6735
6764
 
6736
6765
  </xsl:if>
6737
6766
 
@@ -10374,7 +10403,7 @@
10374
10403
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
10375
10404
  <xsl:apply-templates mode="update_xml_step1"/>
10376
10405
  </xsl:template>
10377
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
10406
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
10378
10407
  <xsl:copy>
10379
10408
  <xsl:copy-of select="@*"/>
10380
10409
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -871,19 +871,32 @@
871
871
  <xsl:variable name="titles_">
872
872
 
873
873
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
874
- <title-toc lang="en">
875
-
876
- </title-toc>
877
- <title-toc lang="fr">
874
+ <!-- <title-toc lang="en">
875
+ <xsl:if test="$namespace = 'csd' or $namespace = 'ieee' or $namespace = 'iho' or $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'unece-rec'">
876
+ <xsl:text>Contents</xsl:text>
877
+ </xsl:if>
878
+ <xsl:if test="$namespace = 'csa' or $namespace = 'm3d' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper'">
879
+ <xsl:text>Table of Contents</xsl:text>
880
+ </xsl:if>
881
+ <xsl:if test="$namespace = 'gb'">
882
+ <xsl:text>Table of contents</xsl:text>
883
+ </xsl:if>
884
+ </title-toc> -->
885
+ <title-toc lang="en">Table of contents</title-toc>
886
+ <!-- <title-toc lang="fr">
878
887
  <xsl:text>Sommaire</xsl:text>
879
- </title-toc>
880
- <title-toc lang="zh">
881
-
888
+ </title-toc> -->
889
+ <!-- <title-toc lang="zh">
890
+ <xsl:choose>
891
+ <xsl:when test="$namespace = 'gb'">
892
+ <xsl:text>目次</xsl:text>
893
+ </xsl:when>
894
+ <xsl:otherwise>
882
895
  <xsl:text>Contents</xsl:text>
883
-
884
- </title-toc>
885
-
886
- <title-descriptors lang="en">Descriptors</title-descriptors>
896
+ </xsl:otherwise>
897
+ </xsl:choose>
898
+ </title-toc> -->
899
+ <title-toc lang="zh">目次</title-toc>
887
900
 
888
901
  <title-part lang="en">
889
902
 
@@ -899,20 +912,6 @@
899
912
  <title-subpart lang="en">Sub-part #</title-subpart>
900
913
  <title-subpart lang="fr">Partie de sub #</title-subpart>
901
914
 
902
- <title-list-tables lang="en">List of Tables</title-list-tables>
903
-
904
- <title-list-figures lang="en">List of Figures</title-list-figures>
905
-
906
- <title-table-figures lang="en">Table of Figures</title-table-figures>
907
-
908
- <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
909
-
910
- <title-summary lang="en">Summary</title-summary>
911
-
912
- <title-continued lang="ru">(продолжение)</title-continued>
913
- <title-continued lang="en">(continued)</title-continued>
914
- <title-continued lang="fr">(continué)</title-continued>
915
-
916
915
  </xsl:variable>
917
916
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
918
917
 
@@ -920,8 +919,8 @@
920
919
  <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
921
920
  <xsl:value-of select="$toc_table_title"/>
922
921
  <xsl:if test="normalize-space($toc_table_title) = ''">
923
- <xsl:call-template name="getTitle">
924
- <xsl:with-param name="name" select="'title-list-tables'"/>
922
+ <xsl:call-template name="getLocalizedString">
923
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
925
924
  </xsl:call-template>
926
925
  </xsl:if>
927
926
  </xsl:variable>
@@ -930,8 +929,8 @@
930
929
  <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
931
930
  <xsl:value-of select="$toc_figure_title"/>
932
931
  <xsl:if test="normalize-space($toc_figure_title) = ''">
933
- <xsl:call-template name="getTitle">
934
- <xsl:with-param name="name" select="'title-list-figures'"/>
932
+ <xsl:call-template name="getLocalizedString">
933
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
935
934
  </xsl:call-template>
936
935
  </xsl:if>
937
936
  </xsl:variable>
@@ -940,8 +939,8 @@
940
939
  <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
941
940
  <xsl:value-of select="$toc_requirement_title"/>
942
941
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
943
- <xsl:call-template name="getTitle">
944
- <xsl:with-param name="name" select="'title-list-recommendations'"/>
942
+ <xsl:call-template name="getLocalizedString">
943
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
945
944
  </xsl:call-template>
946
945
  </xsl:if>
947
946
  </xsl:variable>
@@ -4629,6 +4628,9 @@
4629
4628
  <!-- END Definition List -->
4630
4629
  <!-- ===================== -->
4631
4630
 
4631
+ <!-- default: ignore title in sections/p -->
4632
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
4633
+
4632
4634
  <!-- ========================= -->
4633
4635
  <!-- Rich text formatting -->
4634
4636
  <!-- ========================= -->
@@ -4704,7 +4706,7 @@
4704
4706
  <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
4705
4707
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
4706
4708
  <xsl:choose>
4707
- <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
4709
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), $regex_url_start, '$2') != ''">
4708
4710
  <!-- url -->
4709
4711
  <xsl:call-template name="add-zero-spaces-link-java"/>
4710
4712
  </xsl:when>
@@ -5166,10 +5168,13 @@
5166
5168
  </xsl:choose>
5167
5169
  </xsl:variable>
5168
5170
 
5171
+ <!-- replace sequence #x200B to one &#x200B -->
5172
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b{2,}', '​')"/>
5173
+
5169
5174
  <!-- replace sequence #x200B and space TO space -->
5170
- <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
5175
+ <xsl:variable name="text11" select="java:replaceAll(java:java.lang.String.new($text10), '\u200b ', ' ')"/>
5171
5176
 
5172
- <xsl:value-of select="$text10"/>
5177
+ <xsl:value-of select="$text11"/>
5173
5178
  </xsl:template>
5174
5179
 
5175
5180
  <xsl:template name="add-zero-spaces-link-java">
@@ -5179,8 +5184,12 @@
5179
5184
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
5180
5185
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, comma, slash, @ -->
5181
5186
  <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/|@)','$1​')"/>
5187
+
5188
+ <!-- replace sequence #x200B to one &#x200B -->
5189
+ <xsl:variable name="url2" select="java:replaceAll(java:java.lang.String.new($url), '\u200b{2,}', '​')"/>
5190
+
5182
5191
  <!-- remove zero-width space at the end -->
5183
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
5192
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url2), '​$', '')"/>
5184
5193
  </xsl:template>
5185
5194
 
5186
5195
  <!-- add zero space after dash character (for table's entries) -->
@@ -6443,7 +6452,7 @@
6443
6452
 
6444
6453
  <xsl:call-template name="refine_note_block_style"/>
6445
6454
 
6446
- <fo:inline xsl:use-attribute-sets="note-name-style">
6455
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
6447
6456
 
6448
6457
  <xsl:call-template name="refine_note-name-style"/>
6449
6458
 
@@ -6489,12 +6498,12 @@
6489
6498
  <xsl:variable name="num"><xsl:number/></xsl:variable>
6490
6499
  <xsl:choose>
6491
6500
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
6492
- <fo:inline xsl:use-attribute-sets="note-p-style">
6501
+ <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
6493
6502
  <xsl:apply-templates/>
6494
6503
  </fo:inline>
6495
6504
  </xsl:when>
6496
6505
  <xsl:otherwise>
6497
- <fo:block xsl:use-attribute-sets="note-p-style">
6506
+ <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
6498
6507
  <xsl:apply-templates/>
6499
6508
  </fo:block>
6500
6509
  </xsl:otherwise>
@@ -6713,25 +6722,45 @@
6713
6722
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
6714
6723
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
6715
6724
 
6716
- <xsl:variable name="img_src">
6717
- <xsl:choose>
6718
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6719
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6720
- </xsl:choose>
6721
- </xsl:variable>
6725
+ <xsl:if test="@width != '' and @width != 'auto'">
6726
+ <xsl:attribute name="width">
6727
+ <xsl:value-of select="@width"/>
6728
+ </xsl:attribute>
6729
+ </xsl:if>
6722
6730
 
6723
- <xsl:variable name="image_width_effective">
6731
+ <xsl:if test="@height != '' and @height != 'auto'">
6732
+ <xsl:attribute name="height">
6733
+ <xsl:value-of select="@height"/>
6734
+ </xsl:attribute>
6735
+ </xsl:if>
6724
6736
 
6725
- <xsl:value-of select="$width_effective"/>
6737
+ <xsl:choose>
6738
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
6739
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
6740
+ </xsl:when>
6741
+ <xsl:otherwise>
6726
6742
 
6727
- </xsl:variable>
6743
+ <xsl:variable name="img_src">
6744
+ <xsl:choose>
6745
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6746
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6747
+ </xsl:choose>
6748
+ </xsl:variable>
6728
6749
 
6729
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6730
- <xsl:if test="number($scale) &lt; 100">
6750
+ <xsl:variable name="image_width_effective">
6731
6751
 
6732
- <xsl:attribute name="content-width"><xsl:value-of select="$scale * 0.985"/>%</xsl:attribute><!-- 0.985 due border around image -->
6752
+ <xsl:value-of select="$width_effective"/>
6733
6753
 
6734
- </xsl:if>
6754
+ </xsl:variable>
6755
+
6756
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6757
+ <xsl:if test="number($scale) &lt; 100">
6758
+
6759
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale * 0.985"/>%</xsl:attribute><!-- 0.985 due border around image -->
6760
+
6761
+ </xsl:if>
6762
+ </xsl:otherwise>
6763
+ </xsl:choose>
6735
6764
 
6736
6765
  </xsl:if>
6737
6766
 
@@ -10374,7 +10403,7 @@
10374
10403
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
10375
10404
  <xsl:apply-templates mode="update_xml_step1"/>
10376
10405
  </xsl:template>
10377
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
10406
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
10378
10407
  <xsl:copy>
10379
10408
  <xsl:copy-of select="@*"/>
10380
10409
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -977,21 +977,32 @@
977
977
  <xsl:variable name="titles_">
978
978
 
979
979
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
980
- <title-toc lang="en">
981
-
980
+ <!-- <title-toc lang="en">
981
+ <xsl:if test="$namespace = 'csd' or $namespace = 'ieee' or $namespace = 'iho' or $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'unece-rec'">
982
982
  <xsl:text>Contents</xsl:text>
983
-
984
- </title-toc>
985
- <title-toc lang="fr">
983
+ </xsl:if>
984
+ <xsl:if test="$namespace = 'csa' or $namespace = 'm3d' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper'">
985
+ <xsl:text>Table of Contents</xsl:text>
986
+ </xsl:if>
987
+ <xsl:if test="$namespace = 'gb'">
988
+ <xsl:text>Table of contents</xsl:text>
989
+ </xsl:if>
990
+ </title-toc> -->
991
+ <title-toc lang="en">Table of contents</title-toc>
992
+ <!-- <title-toc lang="fr">
986
993
  <xsl:text>Sommaire</xsl:text>
987
- </title-toc>
988
- <title-toc lang="zh">
989
-
994
+ </title-toc> -->
995
+ <!-- <title-toc lang="zh">
996
+ <xsl:choose>
997
+ <xsl:when test="$namespace = 'gb'">
998
+ <xsl:text>目次</xsl:text>
999
+ </xsl:when>
1000
+ <xsl:otherwise>
990
1001
  <xsl:text>Contents</xsl:text>
991
-
992
- </title-toc>
993
-
994
- <title-descriptors lang="en">Descriptors</title-descriptors>
1002
+ </xsl:otherwise>
1003
+ </xsl:choose>
1004
+ </title-toc> -->
1005
+ <title-toc lang="zh">目次</title-toc>
995
1006
 
996
1007
  <title-part lang="en">
997
1008
 
@@ -1007,20 +1018,6 @@
1007
1018
  <title-subpart lang="en">Sub-part #</title-subpart>
1008
1019
  <title-subpart lang="fr">Partie de sub #</title-subpart>
1009
1020
 
1010
- <title-list-tables lang="en">List of Tables</title-list-tables>
1011
-
1012
- <title-list-figures lang="en">List of Figures</title-list-figures>
1013
-
1014
- <title-table-figures lang="en">Table of Figures</title-table-figures>
1015
-
1016
- <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
1017
-
1018
- <title-summary lang="en">Summary</title-summary>
1019
-
1020
- <title-continued lang="ru">(продолжение)</title-continued>
1021
- <title-continued lang="en">(continued)</title-continued>
1022
- <title-continued lang="fr">(continué)</title-continued>
1023
-
1024
1021
  </xsl:variable>
1025
1022
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
1026
1023
 
@@ -1028,8 +1025,8 @@
1028
1025
  <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
1029
1026
  <xsl:value-of select="$toc_table_title"/>
1030
1027
  <xsl:if test="normalize-space($toc_table_title) = ''">
1031
- <xsl:call-template name="getTitle">
1032
- <xsl:with-param name="name" select="'title-list-tables'"/>
1028
+ <xsl:call-template name="getLocalizedString">
1029
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
1033
1030
  </xsl:call-template>
1034
1031
  </xsl:if>
1035
1032
  </xsl:variable>
@@ -1038,8 +1035,8 @@
1038
1035
  <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
1039
1036
  <xsl:value-of select="$toc_figure_title"/>
1040
1037
  <xsl:if test="normalize-space($toc_figure_title) = ''">
1041
- <xsl:call-template name="getTitle">
1042
- <xsl:with-param name="name" select="'title-list-figures'"/>
1038
+ <xsl:call-template name="getLocalizedString">
1039
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
1043
1040
  </xsl:call-template>
1044
1041
  </xsl:if>
1045
1042
  </xsl:variable>
@@ -1048,8 +1045,8 @@
1048
1045
  <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
1049
1046
  <xsl:value-of select="$toc_requirement_title"/>
1050
1047
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
1051
- <xsl:call-template name="getTitle">
1052
- <xsl:with-param name="name" select="'title-list-recommendations'"/>
1048
+ <xsl:call-template name="getLocalizedString">
1049
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
1053
1050
  </xsl:call-template>
1054
1051
  </xsl:if>
1055
1052
  </xsl:variable>
@@ -4758,6 +4755,9 @@
4758
4755
  <!-- END Definition List -->
4759
4756
  <!-- ===================== -->
4760
4757
 
4758
+ <!-- default: ignore title in sections/p -->
4759
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
4760
+
4761
4761
  <!-- ========================= -->
4762
4762
  <!-- Rich text formatting -->
4763
4763
  <!-- ========================= -->
@@ -4833,7 +4833,7 @@
4833
4833
  <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
4834
4834
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
4835
4835
  <xsl:choose>
4836
- <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
4836
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), $regex_url_start, '$2') != ''">
4837
4837
  <!-- url -->
4838
4838
  <xsl:call-template name="add-zero-spaces-link-java"/>
4839
4839
  </xsl:when>
@@ -5295,10 +5295,13 @@
5295
5295
  </xsl:choose>
5296
5296
  </xsl:variable>
5297
5297
 
5298
+ <!-- replace sequence #x200B to one &#x200B -->
5299
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b{2,}', '​')"/>
5300
+
5298
5301
  <!-- replace sequence #x200B and space TO space -->
5299
- <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
5302
+ <xsl:variable name="text11" select="java:replaceAll(java:java.lang.String.new($text10), '\u200b ', ' ')"/>
5300
5303
 
5301
- <xsl:value-of select="$text10"/>
5304
+ <xsl:value-of select="$text11"/>
5302
5305
  </xsl:template>
5303
5306
 
5304
5307
  <xsl:template name="add-zero-spaces-link-java">
@@ -5308,8 +5311,12 @@
5308
5311
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
5309
5312
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, comma, slash, @ -->
5310
5313
  <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/|@)','$1​')"/>
5314
+
5315
+ <!-- replace sequence #x200B to one &#x200B -->
5316
+ <xsl:variable name="url2" select="java:replaceAll(java:java.lang.String.new($url), '\u200b{2,}', '​')"/>
5317
+
5311
5318
  <!-- remove zero-width space at the end -->
5312
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
5319
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url2), '​$', '')"/>
5313
5320
  </xsl:template>
5314
5321
 
5315
5322
  <!-- add zero space after dash character (for table's entries) -->
@@ -6572,7 +6579,7 @@
6572
6579
 
6573
6580
  <xsl:call-template name="refine_note_block_style"/>
6574
6581
 
6575
- <fo:inline xsl:use-attribute-sets="note-name-style">
6582
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
6576
6583
 
6577
6584
  <xsl:call-template name="refine_note-name-style"/>
6578
6585
 
@@ -6618,12 +6625,12 @@
6618
6625
  <xsl:variable name="num"><xsl:number/></xsl:variable>
6619
6626
  <xsl:choose>
6620
6627
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
6621
- <fo:inline xsl:use-attribute-sets="note-p-style">
6628
+ <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
6622
6629
  <xsl:apply-templates/>
6623
6630
  </fo:inline>
6624
6631
  </xsl:when>
6625
6632
  <xsl:otherwise>
6626
- <fo:block xsl:use-attribute-sets="note-p-style">
6633
+ <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
6627
6634
  <xsl:apply-templates/>
6628
6635
  </fo:block>
6629
6636
  </xsl:otherwise>
@@ -6842,25 +6849,45 @@
6842
6849
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
6843
6850
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
6844
6851
 
6845
- <xsl:variable name="img_src">
6846
- <xsl:choose>
6847
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6848
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6849
- </xsl:choose>
6850
- </xsl:variable>
6852
+ <xsl:if test="@width != '' and @width != 'auto'">
6853
+ <xsl:attribute name="width">
6854
+ <xsl:value-of select="@width"/>
6855
+ </xsl:attribute>
6856
+ </xsl:if>
6851
6857
 
6852
- <xsl:variable name="image_width_effective">
6858
+ <xsl:if test="@height != '' and @height != 'auto'">
6859
+ <xsl:attribute name="height">
6860
+ <xsl:value-of select="@height"/>
6861
+ </xsl:attribute>
6862
+ </xsl:if>
6853
6863
 
6854
- <xsl:value-of select="$width_effective"/>
6864
+ <xsl:choose>
6865
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
6866
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
6867
+ </xsl:when>
6868
+ <xsl:otherwise>
6855
6869
 
6856
- </xsl:variable>
6870
+ <xsl:variable name="img_src">
6871
+ <xsl:choose>
6872
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6873
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6874
+ </xsl:choose>
6875
+ </xsl:variable>
6857
6876
 
6858
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6859
- <xsl:if test="number($scale) &lt; 100">
6877
+ <xsl:variable name="image_width_effective">
6860
6878
 
6861
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6879
+ <xsl:value-of select="$width_effective"/>
6862
6880
 
6863
- </xsl:if>
6881
+ </xsl:variable>
6882
+
6883
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6884
+ <xsl:if test="number($scale) &lt; 100">
6885
+
6886
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6887
+
6888
+ </xsl:if>
6889
+ </xsl:otherwise>
6890
+ </xsl:choose>
6864
6891
 
6865
6892
  </xsl:if>
6866
6893
 
@@ -10504,7 +10531,7 @@
10504
10531
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
10505
10532
  <xsl:apply-templates mode="update_xml_step1"/>
10506
10533
  </xsl:template>
10507
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
10534
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
10508
10535
  <xsl:copy>
10509
10536
  <xsl:copy-of select="@*"/>
10510
10537
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -73,34 +73,21 @@ module IsoDoc
73
73
  end
74
74
  end
75
75
 
76
- def make_body2(body, docxml)
77
- body.div class: "WordSection2" do |div2|
78
- info docxml, div2
79
- boilerplate docxml, div2
80
- front docxml, div2
81
- div2.p { |p| p << "&#xa0;" } # placeholder
82
- end
83
- section_break(body)
84
- end
85
-
86
- ENDLINE = <<~END.freeze
76
+ ENDLINE = <<~ENDLINE.freeze
87
77
  <v:line
88
78
  alt="" style='position:absolute;left:0;text-align:left;z-index:251662848;
89
79
  mso-wrap-edited:f;mso-width-percent:0;mso-height-percent:0;
90
80
  mso-width-percent:0;mso-height-percent:0'
91
81
  from="6.375cm,20.95pt" to="10.625cm,20.95pt"
92
82
  strokeweight="1.5pt"/>
93
- END
83
+ ENDLINE
94
84
 
95
85
  def end_line(_isoxml, out)
96
86
  out.parent.add_child(ENDLINE)
97
87
  end
98
88
 
99
- def middle(isoxml, out)
100
- middle_admonitions(isoxml, out)
101
- clause isoxml, out
102
- annex isoxml, out
103
- bibliography isoxml, out
89
+ def make_body3(out, isoxml)
90
+ super
104
91
  end_line(isoxml, out)
105
92
  end
106
93
 
@@ -108,7 +95,7 @@ module IsoDoc
108
95
  out.div class: "Section3", id: clause["id"] do |div|
109
96
  page_break(out)
110
97
  div.p(class: "IntroTitle") do |h1|
111
- clause&.at(ns("./title"))&.children&.each { |n| parse(n, h1) }
98
+ clause.at(ns("./title"))&.children&.each { |n| parse(n, h1) }
112
99
  end
113
100
  clause.elements.each do |e|
114
101
  parse(e, div) unless e.name == "title"
@@ -120,7 +107,7 @@ module IsoDoc
120
107
  out.div **attr_code(id: clause["id"]) do |s|
121
108
  page_break(out)
122
109
  s.p(class: "ForewordTitle") do |h1|
123
- clause&.at(ns("./title"))&.children&.each { |n| parse(n, h1) }
110
+ clause.at(ns("./title"))&.children&.each { |n| parse(n, h1) }
124
111
  end
125
112
  clause.elements.each { |e| parse(e, s) unless e.name == "title" }
126
113
  end
@@ -137,7 +124,7 @@ module IsoDoc
137
124
  abstract.parent = (abstractbox || preface_container) if abstract &&
138
125
  (abstractbox || preface_container)
139
126
  abstractbox and abstract&.xpath(".//p/br")&.each do |a|
140
- a.parent.remove if /page-break-before:always/.match?(a["style"])
127
+ a.parent.remove if a["style"].include?("page-break-before:always")
141
128
  end
142
129
  docxml&.at("//p[@class = 'AbstractTitle']")&.remove if abstractbox
143
130
  foreword.parent = preface_container if foreword && preface_container
@@ -157,7 +144,7 @@ module IsoDoc
157
144
  out.div **attr_code(id: clause["id"]) do |s|
158
145
  page_break(out)
159
146
  s.p(class: "AbstractTitle") do |h1|
160
- clause&.at(ns("./title"))&.children&.each { |n| parse(n, h1) }
147
+ clause.at(ns("./title"))&.children&.each { |n| parse(n, h1) }
161
148
  end
162
149
  clause.elements.each { |e| parse(e, s) unless e.name == "title" }
163
150
  end
@@ -167,7 +154,7 @@ module IsoDoc
167
154
  super
168
155
  a = docxml.at("//div[@id = 'boilerplate-ECEhdr']") and
169
156
  a["class"] = "boilerplate-ECEhdr"
170
- docxml&.at("//div[@class = 'authority']")&.remove
157
+ docxml.at("//div[@class = 'authority']")&.remove
171
158
  end
172
159
 
173
160
  include BaseConvert
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <!-- VERSION v1.2.2 -->
20
+ <!-- VERSION v1.2.3 -->
21
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
22
22
  <include href="reqt.rng"/>
23
23
  <include href="basicdoc.rng">
@@ -192,9 +192,11 @@
192
192
  </attribute>
193
193
  </optional>
194
194
  <attribute name="citeas"/>
195
- <attribute name="type">
196
- <ref name="ReferenceFormat"/>
197
- </attribute>
195
+ <optional>
196
+ <attribute name="type">
197
+ <ref name="ReferenceFormat"/>
198
+ </attribute>
199
+ </optional>
198
200
  <optional>
199
201
  <attribute name="alt"/>
200
202
  </optional>
@@ -836,6 +838,26 @@
836
838
  <ref name="paragraph"/>
837
839
  </element>
838
840
  </define>
841
+ <define name="stem">
842
+ <element name="stem">
843
+ <attribute name="type">
844
+ <choice>
845
+ <value>MathML</value>
846
+ <value>AsciiMath</value>
847
+ <value>LatexMath</value>
848
+ </choice>
849
+ </attribute>
850
+ <attribute name="block">
851
+ <data type="boolean"/>
852
+ </attribute>
853
+ <oneOrMore>
854
+ <choice>
855
+ <text/>
856
+ <ref name="AnyElement"/>
857
+ </choice>
858
+ </oneOrMore>
859
+ </element>
860
+ </define>
839
861
  <define name="em">
840
862
  <element name="em">
841
863
  <zeroOrMore>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module UN
3
- VERSION = "0.10.12".freeze
3
+ VERSION = "0.11.0".freeze
4
4
  end
5
5
  end
data/metanorma-un.gemspec CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_dependency "roman-numerals"
32
32
  spec.add_dependency "twitter_cldr"
33
33
 
34
- spec.add_dependency "metanorma-standoc", "~> 2.4.2"
34
+ spec.add_dependency "metanorma-standoc", "~> 2.5.0"
35
35
 
36
36
  spec.add_development_dependency "debug"
37
37
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-un
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.12
4
+ version: 0.11.0
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-07-07 00:00:00.000000000 Z
11
+ date: 2023-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iso-639
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 2.4.2
61
+ version: 2.5.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 2.4.2
68
+ version: 2.5.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: debug
71
71
  requirement: !ruby/object:Gem::Requirement