metanorma-iho 0.7.13 → 0.8.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: 7e27d20ae86209f35cb6af7e706a439b38a896b427f7b81c9f48a2a0de22d765
4
- data.tar.gz: c901938d5097999b399159c6095c99e5847f830435832aa399223a68d8e33a3d
3
+ metadata.gz: 6e745ee37c741e2fbb8ad9398012b6211c61ed73e585ec78272538295fd23005
4
+ data.tar.gz: 0f9688d8696eaa1417ebb7d25053b902dcde60f316a5c87637f656d8355f7afa
5
5
  SHA512:
6
- metadata.gz: fb07bf84448e8d7c6b5c5a0b6dcf284e70698d9e517104832a0e8ebe935c5f5990d83cbb73226b93c6057ea4ddf48b8dd40bf542e68db83974eac39aabf634d2
7
- data.tar.gz: eca0d7f5411f90409085a8454216bc506707a5d5db746cab6af734375dc377e3cd084a49c85d9307a08b4f2d48d62ff7d4eacf2aba506b5cd32238a1d5286f67
6
+ metadata.gz: 9c798099b130b2d7a6810aed66b1c553da76fbd9f8c9fbfe3018a8db05460b93073937502b89bfd2bee3e810b31910ffa0cf3619badf33b800ed01e6fb1ba5a2
7
+ data.tar.gz: dec07c7dd9ded93dd4eff6758eb699964967bc88a18a9d1bbac62a97d09851fc337baa8bbf4ebd7e1f3bcb7ac0820297cd2271c947df763d03a0543adf8e4524
@@ -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
 
@@ -679,7 +683,7 @@ ol {
679
683
  ul li {
680
684
  list-style: none; }
681
685
 
682
- ul > li:before {
686
+ ul > li::before {
683
687
  content: "\2014";
684
688
  display: inline-block;
685
689
  width: 1em;
@@ -703,7 +707,7 @@ ol ul > li:first-child {
703
707
  #toc-list li {
704
708
  list-style-type: none; }
705
709
 
706
- #toc li:before {
710
+ #toc li::before {
707
711
  content: " ";
708
712
  display: none; }
709
713
 
@@ -299,7 +299,7 @@ ul li {
299
299
  list-style: none;
300
300
  }
301
301
 
302
- ul>li:before {
302
+ ul>li::before {
303
303
  content: "\2014";
304
304
  display: inline-block;
305
305
  width: 1em;
@@ -329,7 +329,7 @@ ol ul > li:first-child {
329
329
  list-style-type: none;
330
330
  }
331
331
 
332
- #toc li:before {
332
+ #toc li::before {
333
333
  content: " ";
334
334
  display: none;
335
335
  }
@@ -12,23 +12,6 @@ module IsoDoc
12
12
  Metanorma::IHO.configuration
13
13
  end
14
14
 
15
- =begin
16
- def make_body3(body, docxml)
17
- body.div **{ class: "main-section" } do |div3|
18
- boilerplate docxml, div3
19
- preface_block docxml, div3
20
- abstract docxml, div3
21
- foreword docxml, div3
22
- introduction docxml, div3
23
- preface docxml, div3
24
- acknowledgements docxml, div3
25
- middle docxml, div3
26
- footnotes div3
27
- comments div3
28
- end
29
- end
30
- =end
31
-
32
15
  include BaseConvert
33
16
  include Init
34
17
  end
@@ -980,21 +980,32 @@
980
980
  <xsl:variable name="titles_">
981
981
 
982
982
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
983
- <title-toc lang="en">
984
-
983
+ <!-- <title-toc lang="en">
984
+ <xsl:if test="$namespace = 'csd' or $namespace = 'ieee' or $namespace = 'iho' or $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'unece-rec'">
985
985
  <xsl:text>Contents</xsl:text>
986
-
987
- </title-toc>
988
- <title-toc lang="fr">
986
+ </xsl:if>
987
+ <xsl:if test="$namespace = 'csa' or $namespace = 'm3d' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper'">
988
+ <xsl:text>Table of Contents</xsl:text>
989
+ </xsl:if>
990
+ <xsl:if test="$namespace = 'gb'">
991
+ <xsl:text>Table of contents</xsl:text>
992
+ </xsl:if>
993
+ </title-toc> -->
994
+ <title-toc lang="en">Table of contents</title-toc>
995
+ <!-- <title-toc lang="fr">
989
996
  <xsl:text>Sommaire</xsl:text>
990
- </title-toc>
991
- <title-toc lang="zh">
992
-
997
+ </title-toc> -->
998
+ <!-- <title-toc lang="zh">
999
+ <xsl:choose>
1000
+ <xsl:when test="$namespace = 'gb'">
1001
+ <xsl:text>目次</xsl:text>
1002
+ </xsl:when>
1003
+ <xsl:otherwise>
993
1004
  <xsl:text>Contents</xsl:text>
994
-
995
- </title-toc>
996
-
997
- <title-descriptors lang="en">Descriptors</title-descriptors>
1005
+ </xsl:otherwise>
1006
+ </xsl:choose>
1007
+ </title-toc> -->
1008
+ <title-toc lang="zh">目次</title-toc>
998
1009
 
999
1010
  <title-part lang="en">
1000
1011
 
@@ -1010,20 +1021,6 @@
1010
1021
  <title-subpart lang="en">Sub-part #</title-subpart>
1011
1022
  <title-subpart lang="fr">Partie de sub #</title-subpart>
1012
1023
 
1013
- <title-list-tables lang="en">List of Tables</title-list-tables>
1014
-
1015
- <title-list-figures lang="en">List of Figures</title-list-figures>
1016
-
1017
- <title-table-figures lang="en">Table of Figures</title-table-figures>
1018
-
1019
- <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
1020
-
1021
- <title-summary lang="en">Summary</title-summary>
1022
-
1023
- <title-continued lang="ru">(продолжение)</title-continued>
1024
- <title-continued lang="en">(continued)</title-continued>
1025
- <title-continued lang="fr">(continué)</title-continued>
1026
-
1027
1024
  </xsl:variable>
1028
1025
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
1029
1026
 
@@ -1031,8 +1028,8 @@
1031
1028
  <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
1032
1029
  <xsl:value-of select="$toc_table_title"/>
1033
1030
  <xsl:if test="normalize-space($toc_table_title) = ''">
1034
- <xsl:call-template name="getTitle">
1035
- <xsl:with-param name="name" select="'title-list-tables'"/>
1031
+ <xsl:call-template name="getLocalizedString">
1032
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
1036
1033
  </xsl:call-template>
1037
1034
  </xsl:if>
1038
1035
  </xsl:variable>
@@ -1041,8 +1038,8 @@
1041
1038
  <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
1042
1039
  <xsl:value-of select="$toc_figure_title"/>
1043
1040
  <xsl:if test="normalize-space($toc_figure_title) = ''">
1044
- <xsl:call-template name="getTitle">
1045
- <xsl:with-param name="name" select="'title-list-figures'"/>
1041
+ <xsl:call-template name="getLocalizedString">
1042
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
1046
1043
  </xsl:call-template>
1047
1044
  </xsl:if>
1048
1045
  </xsl:variable>
@@ -1051,8 +1048,8 @@
1051
1048
  <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
1052
1049
  <xsl:value-of select="$toc_requirement_title"/>
1053
1050
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
1054
- <xsl:call-template name="getTitle">
1055
- <xsl:with-param name="name" select="'title-list-recommendations'"/>
1051
+ <xsl:call-template name="getLocalizedString">
1052
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
1056
1053
  </xsl:call-template>
1057
1054
  </xsl:if>
1058
1055
  </xsl:variable>
@@ -4765,6 +4762,9 @@
4765
4762
  <!-- END Definition List -->
4766
4763
  <!-- ===================== -->
4767
4764
 
4765
+ <!-- default: ignore title in sections/p -->
4766
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
4767
+
4768
4768
  <!-- ========================= -->
4769
4769
  <!-- Rich text formatting -->
4770
4770
  <!-- ========================= -->
@@ -4841,7 +4841,7 @@
4841
4841
  <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
4842
4842
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
4843
4843
  <xsl:choose>
4844
- <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
4844
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), $regex_url_start, '$2') != ''">
4845
4845
  <!-- url -->
4846
4846
  <xsl:call-template name="add-zero-spaces-link-java"/>
4847
4847
  </xsl:when>
@@ -5374,10 +5374,13 @@
5374
5374
  </xsl:choose>
5375
5375
  </xsl:variable>
5376
5376
 
5377
+ <!-- replace sequence #x200B to one &#x200B -->
5378
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b{2,}', '​')"/>
5379
+
5377
5380
  <!-- replace sequence #x200B and space TO space -->
5378
- <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
5381
+ <xsl:variable name="text11" select="java:replaceAll(java:java.lang.String.new($text10), '\u200b ', ' ')"/>
5379
5382
 
5380
- <xsl:value-of select="$text10"/>
5383
+ <xsl:value-of select="$text11"/>
5381
5384
  </xsl:template>
5382
5385
 
5383
5386
  <xsl:template name="add-zero-spaces-link-java">
@@ -5387,8 +5390,12 @@
5387
5390
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
5388
5391
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, comma, slash, @ -->
5389
5392
  <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/|@)','$1​')"/>
5393
+
5394
+ <!-- replace sequence #x200B to one &#x200B -->
5395
+ <xsl:variable name="url2" select="java:replaceAll(java:java.lang.String.new($url), '\u200b{2,}', '​')"/>
5396
+
5390
5397
  <!-- remove zero-width space at the end -->
5391
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
5398
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url2), '​$', '')"/>
5392
5399
  </xsl:template>
5393
5400
 
5394
5401
  <!-- add zero space after dash character (for table's entries) -->
@@ -6651,7 +6658,7 @@
6651
6658
 
6652
6659
  <xsl:call-template name="refine_note_block_style"/>
6653
6660
 
6654
- <fo:inline xsl:use-attribute-sets="note-name-style">
6661
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
6655
6662
 
6656
6663
  <xsl:call-template name="refine_note-name-style"/>
6657
6664
 
@@ -6688,12 +6695,12 @@
6688
6695
  <xsl:variable name="num"><xsl:number/></xsl:variable>
6689
6696
  <xsl:choose>
6690
6697
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
6691
- <fo:inline xsl:use-attribute-sets="note-p-style">
6698
+ <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
6692
6699
  <xsl:apply-templates/>
6693
6700
  </fo:inline>
6694
6701
  </xsl:when>
6695
6702
  <xsl:otherwise>
6696
- <fo:block xsl:use-attribute-sets="note-p-style">
6703
+ <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
6697
6704
  <xsl:apply-templates/>
6698
6705
  </fo:block>
6699
6706
  </xsl:otherwise>
@@ -6910,25 +6917,45 @@
6910
6917
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
6911
6918
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
6912
6919
 
6913
- <xsl:variable name="img_src">
6914
- <xsl:choose>
6915
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6916
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6917
- </xsl:choose>
6918
- </xsl:variable>
6920
+ <xsl:if test="@width != '' and @width != 'auto'">
6921
+ <xsl:attribute name="width">
6922
+ <xsl:value-of select="@width"/>
6923
+ </xsl:attribute>
6924
+ </xsl:if>
6925
+
6926
+ <xsl:if test="@height != '' and @height != 'auto'">
6927
+ <xsl:attribute name="height">
6928
+ <xsl:value-of select="@height"/>
6929
+ </xsl:attribute>
6930
+ </xsl:if>
6931
+
6932
+ <xsl:choose>
6933
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
6934
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
6935
+ </xsl:when>
6936
+ <xsl:otherwise>
6919
6937
 
6920
- <xsl:variable name="image_width_effective">
6938
+ <xsl:variable name="img_src">
6939
+ <xsl:choose>
6940
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6941
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6942
+ </xsl:choose>
6943
+ </xsl:variable>
6921
6944
 
6922
- <xsl:value-of select="$width_effective"/>
6945
+ <xsl:variable name="image_width_effective">
6923
6946
 
6924
- </xsl:variable>
6947
+ <xsl:value-of select="$width_effective"/>
6925
6948
 
6926
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6927
- <xsl:if test="number($scale) &lt; 100">
6949
+ </xsl:variable>
6928
6950
 
6929
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6951
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6952
+ <xsl:if test="number($scale) &lt; 100">
6930
6953
 
6931
- </xsl:if>
6954
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6955
+
6956
+ </xsl:if>
6957
+ </xsl:otherwise>
6958
+ </xsl:choose>
6932
6959
 
6933
6960
  </xsl:if>
6934
6961
 
@@ -10582,7 +10609,7 @@
10582
10609
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
10583
10610
  <xsl:apply-templates mode="update_xml_step1"/>
10584
10611
  </xsl:template>
10585
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
10612
+ <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">
10586
10613
  <xsl:copy>
10587
10614
  <xsl:copy-of select="@*"/>
10588
10615
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -980,21 +980,32 @@
980
980
  <xsl:variable name="titles_">
981
981
 
982
982
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
983
- <title-toc lang="en">
984
-
983
+ <!-- <title-toc lang="en">
984
+ <xsl:if test="$namespace = 'csd' or $namespace = 'ieee' or $namespace = 'iho' or $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'unece-rec'">
985
985
  <xsl:text>Contents</xsl:text>
986
-
987
- </title-toc>
988
- <title-toc lang="fr">
986
+ </xsl:if>
987
+ <xsl:if test="$namespace = 'csa' or $namespace = 'm3d' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper'">
988
+ <xsl:text>Table of Contents</xsl:text>
989
+ </xsl:if>
990
+ <xsl:if test="$namespace = 'gb'">
991
+ <xsl:text>Table of contents</xsl:text>
992
+ </xsl:if>
993
+ </title-toc> -->
994
+ <title-toc lang="en">Table of contents</title-toc>
995
+ <!-- <title-toc lang="fr">
989
996
  <xsl:text>Sommaire</xsl:text>
990
- </title-toc>
991
- <title-toc lang="zh">
992
-
997
+ </title-toc> -->
998
+ <!-- <title-toc lang="zh">
999
+ <xsl:choose>
1000
+ <xsl:when test="$namespace = 'gb'">
1001
+ <xsl:text>目次</xsl:text>
1002
+ </xsl:when>
1003
+ <xsl:otherwise>
993
1004
  <xsl:text>Contents</xsl:text>
994
-
995
- </title-toc>
996
-
997
- <title-descriptors lang="en">Descriptors</title-descriptors>
1005
+ </xsl:otherwise>
1006
+ </xsl:choose>
1007
+ </title-toc> -->
1008
+ <title-toc lang="zh">目次</title-toc>
998
1009
 
999
1010
  <title-part lang="en">
1000
1011
 
@@ -1010,20 +1021,6 @@
1010
1021
  <title-subpart lang="en">Sub-part #</title-subpart>
1011
1022
  <title-subpart lang="fr">Partie de sub #</title-subpart>
1012
1023
 
1013
- <title-list-tables lang="en">List of Tables</title-list-tables>
1014
-
1015
- <title-list-figures lang="en">List of Figures</title-list-figures>
1016
-
1017
- <title-table-figures lang="en">Table of Figures</title-table-figures>
1018
-
1019
- <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
1020
-
1021
- <title-summary lang="en">Summary</title-summary>
1022
-
1023
- <title-continued lang="ru">(продолжение)</title-continued>
1024
- <title-continued lang="en">(continued)</title-continued>
1025
- <title-continued lang="fr">(continué)</title-continued>
1026
-
1027
1024
  </xsl:variable>
1028
1025
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
1029
1026
 
@@ -1031,8 +1028,8 @@
1031
1028
  <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
1032
1029
  <xsl:value-of select="$toc_table_title"/>
1033
1030
  <xsl:if test="normalize-space($toc_table_title) = ''">
1034
- <xsl:call-template name="getTitle">
1035
- <xsl:with-param name="name" select="'title-list-tables'"/>
1031
+ <xsl:call-template name="getLocalizedString">
1032
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
1036
1033
  </xsl:call-template>
1037
1034
  </xsl:if>
1038
1035
  </xsl:variable>
@@ -1041,8 +1038,8 @@
1041
1038
  <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
1042
1039
  <xsl:value-of select="$toc_figure_title"/>
1043
1040
  <xsl:if test="normalize-space($toc_figure_title) = ''">
1044
- <xsl:call-template name="getTitle">
1045
- <xsl:with-param name="name" select="'title-list-figures'"/>
1041
+ <xsl:call-template name="getLocalizedString">
1042
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
1046
1043
  </xsl:call-template>
1047
1044
  </xsl:if>
1048
1045
  </xsl:variable>
@@ -1051,8 +1048,8 @@
1051
1048
  <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
1052
1049
  <xsl:value-of select="$toc_requirement_title"/>
1053
1050
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
1054
- <xsl:call-template name="getTitle">
1055
- <xsl:with-param name="name" select="'title-list-recommendations'"/>
1051
+ <xsl:call-template name="getLocalizedString">
1052
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
1056
1053
  </xsl:call-template>
1057
1054
  </xsl:if>
1058
1055
  </xsl:variable>
@@ -4765,6 +4762,9 @@
4765
4762
  <!-- END Definition List -->
4766
4763
  <!-- ===================== -->
4767
4764
 
4765
+ <!-- default: ignore title in sections/p -->
4766
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
4767
+
4768
4768
  <!-- ========================= -->
4769
4769
  <!-- Rich text formatting -->
4770
4770
  <!-- ========================= -->
@@ -4841,7 +4841,7 @@
4841
4841
  <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
4842
4842
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
4843
4843
  <xsl:choose>
4844
- <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
4844
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), $regex_url_start, '$2') != ''">
4845
4845
  <!-- url -->
4846
4846
  <xsl:call-template name="add-zero-spaces-link-java"/>
4847
4847
  </xsl:when>
@@ -5374,10 +5374,13 @@
5374
5374
  </xsl:choose>
5375
5375
  </xsl:variable>
5376
5376
 
5377
+ <!-- replace sequence #x200B to one &#x200B -->
5378
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b{2,}', '​')"/>
5379
+
5377
5380
  <!-- replace sequence #x200B and space TO space -->
5378
- <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
5381
+ <xsl:variable name="text11" select="java:replaceAll(java:java.lang.String.new($text10), '\u200b ', ' ')"/>
5379
5382
 
5380
- <xsl:value-of select="$text10"/>
5383
+ <xsl:value-of select="$text11"/>
5381
5384
  </xsl:template>
5382
5385
 
5383
5386
  <xsl:template name="add-zero-spaces-link-java">
@@ -5387,8 +5390,12 @@
5387
5390
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
5388
5391
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, comma, slash, @ -->
5389
5392
  <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/|@)','$1​')"/>
5393
+
5394
+ <!-- replace sequence #x200B to one &#x200B -->
5395
+ <xsl:variable name="url2" select="java:replaceAll(java:java.lang.String.new($url), '\u200b{2,}', '​')"/>
5396
+
5390
5397
  <!-- remove zero-width space at the end -->
5391
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
5398
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url2), '​$', '')"/>
5392
5399
  </xsl:template>
5393
5400
 
5394
5401
  <!-- add zero space after dash character (for table's entries) -->
@@ -6651,7 +6658,7 @@
6651
6658
 
6652
6659
  <xsl:call-template name="refine_note_block_style"/>
6653
6660
 
6654
- <fo:inline xsl:use-attribute-sets="note-name-style">
6661
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
6655
6662
 
6656
6663
  <xsl:call-template name="refine_note-name-style"/>
6657
6664
 
@@ -6688,12 +6695,12 @@
6688
6695
  <xsl:variable name="num"><xsl:number/></xsl:variable>
6689
6696
  <xsl:choose>
6690
6697
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
6691
- <fo:inline xsl:use-attribute-sets="note-p-style">
6698
+ <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
6692
6699
  <xsl:apply-templates/>
6693
6700
  </fo:inline>
6694
6701
  </xsl:when>
6695
6702
  <xsl:otherwise>
6696
- <fo:block xsl:use-attribute-sets="note-p-style">
6703
+ <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
6697
6704
  <xsl:apply-templates/>
6698
6705
  </fo:block>
6699
6706
  </xsl:otherwise>
@@ -6910,25 +6917,45 @@
6910
6917
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
6911
6918
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
6912
6919
 
6913
- <xsl:variable name="img_src">
6914
- <xsl:choose>
6915
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6916
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6917
- </xsl:choose>
6918
- </xsl:variable>
6920
+ <xsl:if test="@width != '' and @width != 'auto'">
6921
+ <xsl:attribute name="width">
6922
+ <xsl:value-of select="@width"/>
6923
+ </xsl:attribute>
6924
+ </xsl:if>
6925
+
6926
+ <xsl:if test="@height != '' and @height != 'auto'">
6927
+ <xsl:attribute name="height">
6928
+ <xsl:value-of select="@height"/>
6929
+ </xsl:attribute>
6930
+ </xsl:if>
6931
+
6932
+ <xsl:choose>
6933
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
6934
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
6935
+ </xsl:when>
6936
+ <xsl:otherwise>
6919
6937
 
6920
- <xsl:variable name="image_width_effective">
6938
+ <xsl:variable name="img_src">
6939
+ <xsl:choose>
6940
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6941
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6942
+ </xsl:choose>
6943
+ </xsl:variable>
6921
6944
 
6922
- <xsl:value-of select="$width_effective"/>
6945
+ <xsl:variable name="image_width_effective">
6923
6946
 
6924
- </xsl:variable>
6947
+ <xsl:value-of select="$width_effective"/>
6925
6948
 
6926
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6927
- <xsl:if test="number($scale) &lt; 100">
6949
+ </xsl:variable>
6928
6950
 
6929
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6951
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6952
+ <xsl:if test="number($scale) &lt; 100">
6930
6953
 
6931
- </xsl:if>
6954
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6955
+
6956
+ </xsl:if>
6957
+ </xsl:otherwise>
6958
+ </xsl:choose>
6932
6959
 
6933
6960
  </xsl:if>
6934
6961
 
@@ -10582,7 +10609,7 @@
10582
10609
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
10583
10610
  <xsl:apply-templates mode="update_xml_step1"/>
10584
10611
  </xsl:template>
10585
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
10612
+ <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">
10586
10613
  <xsl:copy>
10587
10614
  <xsl:copy-of select="@*"/>
10588
10615
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -19,6 +19,8 @@ _bib)
19
19
  "[#{ordinal}]<tab/>"
20
20
  end
21
21
 
22
+ def middle_title(docxml); end
23
+
22
24
  def preface_rearrange(doc)
23
25
  preface_move(doc.at(ns("//preface/abstract")),
24
26
  %w(foreword executivesummary introduction clause acknowledgements), doc)
@@ -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 IHO
3
- VERSION = "0.7.13".freeze
3
+ VERSION = "0.8.0".freeze
4
4
  end
5
5
  end
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.require_paths = ["lib"]
28
28
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
29
29
 
30
- spec.add_dependency "metanorma-generic", "~> 2.4.1"
30
+ spec.add_dependency "metanorma-generic", "~> 2.5.0"
31
31
 
32
32
  spec.add_development_dependency "debug"
33
33
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.13
4
+ version: 0.8.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: metanorma-generic
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.4.1
19
+ version: 2.5.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.4.1
26
+ version: 2.5.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement