metanorma-iho 0.5.3 → 0.5.4

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: ee0ce9c8c2bd6d95f99e1a81307f83751cea7086046359bf0c98c4567ba3c8e3
4
- data.tar.gz: 0addeac4155072d4eed975211ad8ed40a3da6f3a6ff8f97c35f53be9422392ea
3
+ metadata.gz: fb1420f3aac9bfe4e2c2cac59d9cc6e208624c72152a59a5532d3a9ddff0d5de
4
+ data.tar.gz: d3ae99d63dd7fac2df165af9e2cb51c2a75f78742d5253736caa79d7a869b1cb
5
5
  SHA512:
6
- metadata.gz: 576967ae59fddeeadde1f4b18ecc7ac78f0fc32c3535920cd84164846534666a55e3104f0ba42d1f6a2a11c61ee379f22d1d7c71913974f5bbe9b870201219cf
7
- data.tar.gz: d3842b851ccc0f122b2b5cb0b631078a611d87a836d722bedfa0d46b7bd226b8adc95c126221c728964f7e12e768948e47257476634d49ee3a704cab09c5e408
6
+ metadata.gz: f56a3773a9bdbcd18758df578ef2433f50af7c5f59d54d9a01e36e37c7ab215131c7690bc57a549c4f2c171e7e3377b052cd9c46ed43a76aba085307f31bab39
7
+ data.tar.gz: 9a2a67a634abc5eaffe3525f26adcae10e84e79adb9f63e0bbb0ddcbe8d1cff95e85dc2710045691c5ce6d46fb937ec5714ccefe9887f6fb1119a2d4ea417fad
@@ -749,6 +749,10 @@
749
749
  <xsl:text>Édition </xsl:text>
750
750
  </title-edition>
751
751
 
752
+ <title-edition lang="ru">
753
+ <xsl:text>Издание </xsl:text>
754
+ </title-edition>
755
+
752
756
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
753
757
  <title-toc lang="en">
754
758
 
@@ -777,7 +781,11 @@
777
781
 
778
782
 
779
783
 
780
- </title-part>
784
+ </title-part>
785
+ <title-part lang="ru">
786
+
787
+
788
+ </title-part>
781
789
  <title-part lang="zh">第 # 部分:</title-part>
782
790
 
783
791
  <title-subpart lang="en">Sub-part #</title-subpart>
@@ -793,6 +801,7 @@
793
801
 
794
802
  <title-summary lang="en">Summary</title-summary>
795
803
 
804
+ <title-continued lang="ru">(продолжение)</title-continued>
796
805
  <title-continued lang="en">(continued)</title-continued>
797
806
  <title-continued lang="fr">(continué)</title-continued>
798
807
 
@@ -1539,13 +1548,19 @@
1539
1548
  </xsl:attribute-set><xsl:variable name="color-added-text">
1540
1549
  <xsl:text>rgb(0, 255, 0)</xsl:text>
1541
1550
  </xsl:variable><xsl:attribute-set name="add-style">
1542
- <xsl:attribute name="color">red</xsl:attribute>
1543
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1544
- <!-- <xsl:attribute name="color">black</xsl:attribute>
1545
- <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
1546
- <xsl:attribute name="padding-top">1mm</xsl:attribute>
1547
- <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
1548
- </xsl:attribute-set><xsl:variable name="color-deleted-text">
1551
+
1552
+ <xsl:attribute name="color">red</xsl:attribute>
1553
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1554
+ <!-- <xsl:attribute name="color">black</xsl:attribute>
1555
+ <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
1556
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
1557
+ <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
1558
+
1559
+ </xsl:attribute-set><xsl:variable name="add-style">
1560
+ <add-style xsl:use-attribute-sets="add-style"/>
1561
+ </xsl:variable><xsl:template name="append_add-style">
1562
+ <xsl:copy-of select="xalan:nodeset($add-style)/add-style/@*"/>
1563
+ </xsl:template><xsl:variable name="color-deleted-text">
1549
1564
  <xsl:text>red</xsl:text>
1550
1565
  </xsl:variable><xsl:attribute-set name="del-style">
1551
1566
  <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
@@ -1979,14 +1994,42 @@
1979
1994
 
1980
1995
 
1981
1996
  </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:variable name="ace_tag">ace-tag_</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
1997
+ <xsl:variable name="nodes_preface_">
1998
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
1999
+ <node id="{@id}"/>
2000
+ </xsl:for-each>
2001
+ </xsl:variable>
2002
+ <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
2003
+
1982
2004
  <xsl:for-each select="/*/*[local-name()='preface']/*">
1983
2005
  <xsl:sort select="@displayorder" data-type="number"/>
2006
+
2007
+ <!-- process Section's title -->
2008
+ <xsl:variable name="preceding-sibling_id" select="$nodes_preface/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
2009
+ <xsl:if test="$preceding-sibling_id != ''">
2010
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="contents_no_displayorder"/>
2011
+ </xsl:if>
2012
+
1984
2013
  <xsl:apply-templates select="." mode="contents"/>
1985
2014
  </xsl:for-each>
1986
2015
  </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1987
2016
 
2017
+ <xsl:variable name="nodes_sections_">
2018
+ <xsl:for-each select="/*/*[local-name()='sections']/*">
2019
+ <node id="{@id}"/>
2020
+ </xsl:for-each>
2021
+ </xsl:variable>
2022
+ <xsl:variable name="nodes_sections" select="xalan:nodeset($nodes_sections_)"/>
2023
+
1988
2024
  <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
1989
2025
  <xsl:sort select="@displayorder" data-type="number"/>
2026
+
2027
+ <!-- process Section's title -->
2028
+ <xsl:variable name="preceding-sibling_id" select="$nodes_sections/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
2029
+ <xsl:if test="$preceding-sibling_id != ''">
2030
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="contents_no_displayorder"/>
2031
+ </xsl:if>
2032
+
1990
2033
  <xsl:apply-templates select="." mode="contents"/>
1991
2034
  </xsl:for-each>
1992
2035
 
@@ -2125,7 +2168,7 @@
2125
2168
  </xsl:call-template>
2126
2169
  </xsl:if>
2127
2170
  </xsl:variable>
2128
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2171
+ <!-- DEBUG colwidths=<xsl:copy-of select="$colwidths"/> -->
2129
2172
 
2130
2173
 
2131
2174
  <xsl:variable name="margin-side">
@@ -2385,7 +2428,7 @@
2385
2428
  <!-- <xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/> -->
2386
2429
  <!-- 2009 thinspace -->
2387
2430
  <!-- <xsl:with-param name="text" select="translate(normalize-space($td_text),'- —:', ' ')"/> -->
2388
- <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '', ' '))"/>
2431
+ <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
2389
2432
  </xsl:call-template>
2390
2433
  </xsl:variable>
2391
2434
  <xsl:variable name="max_length">
@@ -4013,6 +4056,9 @@
4013
4056
  </fo:inline>
4014
4057
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
4015
4058
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
4059
+ <xsl:if test="parent::*[local-name() = 'add']">
4060
+ <xsl:call-template name="append_add-style"/>
4061
+ </xsl:if>
4016
4062
  <xsl:apply-templates/>
4017
4063
  </fo:basic-link>
4018
4064
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -4114,6 +4160,13 @@
4114
4160
 
4115
4161
 
4116
4162
 
4163
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
4164
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
4165
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
4166
+ <xsl:call-template name="append_add-style"/>
4167
+ </xsl:if>
4168
+
4169
+
4117
4170
  <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
4118
4171
  <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
4119
4172
  <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
@@ -4152,6 +4205,12 @@
4152
4205
 
4153
4206
 
4154
4207
 
4208
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
4209
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
4210
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
4211
+ <xsl:call-template name="append_add-style"/>
4212
+ </xsl:if>
4213
+
4155
4214
  <xsl:apply-templates select="*[local-name() = 'name']"/>
4156
4215
 
4157
4216
  </fo:inline>
@@ -4201,6 +4260,7 @@
4201
4260
  </fo:block>
4202
4261
  </xsl:template><xsl:template match="*[local-name() = 'term']">
4203
4262
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
4263
+
4204
4264
 
4205
4265
 
4206
4266
 
@@ -4637,7 +4697,11 @@
4637
4697
  <xsl:value-of select="."/>
4638
4698
  </xsl:template><xsl:template match="node()" mode="contents">
4639
4699
  <xsl:apply-templates mode="contents"/>
4640
- </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" mode="contents">
4700
+ </xsl:template><xsl:template match="*[local-name() = 'preface' or local-name() = 'sections']/*[local-name() = 'p'][@type = 'section-title' and not(@displayorder)]" priority="3" mode="contents"/><xsl:template match="*[local-name() = 'p'][@type = 'section-title' and not(@displayorder)]" mode="contents_no_displayorder">
4701
+ <xsl:call-template name="contents_section-title"/>
4702
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'section-title']" mode="contents_in_clause">
4703
+ <xsl:call-template name="contents_section-title"/>
4704
+ </xsl:template><xsl:template match="*[local-name() = 'clause']/*[local-name() = 'p'][@type = 'section-title' and (@depth != ../*[local-name() = 'title']/@depth or ../*[local-name() = 'title']/@depth = 1)]" priority="3" mode="contents"/><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" name="contents_section-title" mode="contents">
4641
4705
  <xsl:variable name="level">
4642
4706
  <xsl:call-template name="getLevel">
4643
4707
  <xsl:with-param name="depth" select="@depth"/>
@@ -5942,7 +6006,7 @@
5942
6006
 
5943
6007
 
5944
6008
 
5945
-
6009
+
5946
6010
  <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
5947
6011
  </fo:list-block>
5948
6012
  <!-- <xsl:for-each select="./iho:note">
@@ -5960,6 +6024,11 @@
5960
6024
 
5961
6025
 
5962
6026
 
6027
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6028
+ <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
6029
+ <xsl:call-template name="append_add-style"/>
6030
+ </xsl:if>
6031
+
5963
6032
  <xsl:call-template name="getListItemFormat"/>
5964
6033
  </fo:block>
5965
6034
  </fo:list-item-label>
@@ -7111,53 +7180,153 @@
7111
7180
  <xsl:param name="first"/>
7112
7181
  <xsl:if test="$number != ''">
7113
7182
  <xsl:variable name="words">
7114
- <words>
7115
- <word cardinal="1">One-</word>
7116
- <word ordinal="1">First </word>
7117
- <word cardinal="2">Two-</word>
7118
- <word ordinal="2">Second </word>
7119
- <word cardinal="3">Three-</word>
7120
- <word ordinal="3">Third </word>
7121
- <word cardinal="4">Four-</word>
7122
- <word ordinal="4">Fourth </word>
7123
- <word cardinal="5">Five-</word>
7124
- <word ordinal="5">Fifth </word>
7125
- <word cardinal="6">Six-</word>
7126
- <word ordinal="6">Sixth </word>
7127
- <word cardinal="7">Seven-</word>
7128
- <word ordinal="7">Seventh </word>
7129
- <word cardinal="8">Eight-</word>
7130
- <word ordinal="8">Eighth </word>
7131
- <word cardinal="9">Nine-</word>
7132
- <word ordinal="9">Ninth </word>
7133
- <word ordinal="10">Tenth </word>
7134
- <word ordinal="11">Eleventh </word>
7135
- <word ordinal="12">Twelfth </word>
7136
- <word ordinal="13">Thirteenth </word>
7137
- <word ordinal="14">Fourteenth </word>
7138
- <word ordinal="15">Fifteenth </word>
7139
- <word ordinal="16">Sixteenth </word>
7140
- <word ordinal="17">Seventeenth </word>
7141
- <word ordinal="18">Eighteenth </word>
7142
- <word ordinal="19">Nineteenth </word>
7143
- <word cardinal="20">Twenty-</word>
7144
- <word ordinal="20">Twentieth </word>
7145
- <word cardinal="30">Thirty-</word>
7146
- <word ordinal="30">Thirtieth </word>
7147
- <word cardinal="40">Forty-</word>
7148
- <word ordinal="40">Fortieth </word>
7149
- <word cardinal="50">Fifty-</word>
7150
- <word ordinal="50">Fiftieth </word>
7151
- <word cardinal="60">Sixty-</word>
7152
- <word ordinal="60">Sixtieth </word>
7153
- <word cardinal="70">Seventy-</word>
7154
- <word ordinal="70">Seventieth </word>
7155
- <word cardinal="80">Eighty-</word>
7156
- <word ordinal="80">Eightieth </word>
7157
- <word cardinal="90">Ninety-</word>
7158
- <word ordinal="90">Ninetieth </word>
7159
- <word cardinal="100">Hundred-</word>
7160
- <word ordinal="100">Hundredth </word>
7183
+ <words>
7184
+ <xsl:choose>
7185
+ <xsl:when test="$lang = 'fr'"> <!-- https://en.wiktionary.org/wiki/Appendix:French_numbers -->
7186
+ <word cardinal="1">Une-</word>
7187
+ <word ordinal="1">Première </word>
7188
+ <word cardinal="2">Deux-</word>
7189
+ <word ordinal="2">Seconde </word>
7190
+ <word cardinal="3">Trois-</word>
7191
+ <word ordinal="3">Tierce </word>
7192
+ <word cardinal="4">Quatre-</word>
7193
+ <word ordinal="4">Quatrième </word>
7194
+ <word cardinal="5">Cinq-</word>
7195
+ <word ordinal="5">Cinquième </word>
7196
+ <word cardinal="6">Six-</word>
7197
+ <word ordinal="6">Sixième </word>
7198
+ <word cardinal="7">Sept-</word>
7199
+ <word ordinal="7">Septième </word>
7200
+ <word cardinal="8">Huit-</word>
7201
+ <word ordinal="8">Huitième </word>
7202
+ <word cardinal="9">Neuf-</word>
7203
+ <word ordinal="9">Neuvième </word>
7204
+ <word ordinal="10">Dixième </word>
7205
+ <word ordinal="11">Onzième </word>
7206
+ <word ordinal="12">Douzième </word>
7207
+ <word ordinal="13">Treizième </word>
7208
+ <word ordinal="14">Quatorzième </word>
7209
+ <word ordinal="15">Quinzième </word>
7210
+ <word ordinal="16">Seizième </word>
7211
+ <word ordinal="17">Dix-septième </word>
7212
+ <word ordinal="18">Dix-huitième </word>
7213
+ <word ordinal="19">Dix-neuvième </word>
7214
+ <word cardinal="20">Vingt-</word>
7215
+ <word ordinal="20">Vingtième </word>
7216
+ <word cardinal="30">Trente-</word>
7217
+ <word ordinal="30">Trentième </word>
7218
+ <word cardinal="40">Quarante-</word>
7219
+ <word ordinal="40">Quarantième </word>
7220
+ <word cardinal="50">Cinquante-</word>
7221
+ <word ordinal="50">Cinquantième </word>
7222
+ <word cardinal="60">Soixante-</word>
7223
+ <word ordinal="60">Soixantième </word>
7224
+ <word cardinal="70">Septante-</word>
7225
+ <word ordinal="70">Septantième </word>
7226
+ <word cardinal="80">Huitante-</word>
7227
+ <word ordinal="80">Huitantième </word>
7228
+ <word cardinal="90">Nonante-</word>
7229
+ <word ordinal="90">Nonantième </word>
7230
+ <word cardinal="100">Cent-</word>
7231
+ <word ordinal="100">Centième </word>
7232
+ </xsl:when>
7233
+ <xsl:when test="$lang = 'ru'">
7234
+ <word cardinal="1">Одна-</word>
7235
+ <word ordinal="1">Первое </word>
7236
+ <word cardinal="2">Две-</word>
7237
+ <word ordinal="2">Второе </word>
7238
+ <word cardinal="3">Три-</word>
7239
+ <word ordinal="3">Третье </word>
7240
+ <word cardinal="4">Четыре-</word>
7241
+ <word ordinal="4">Четвертое </word>
7242
+ <word cardinal="5">Пять-</word>
7243
+ <word ordinal="5">Пятое </word>
7244
+ <word cardinal="6">Шесть-</word>
7245
+ <word ordinal="6">Шестое </word>
7246
+ <word cardinal="7">Семь-</word>
7247
+ <word ordinal="7">Седьмое </word>
7248
+ <word cardinal="8">Восемь-</word>
7249
+ <word ordinal="8">Восьмое </word>
7250
+ <word cardinal="9">Девять-</word>
7251
+ <word ordinal="9">Девятое </word>
7252
+ <word ordinal="10">Десятое </word>
7253
+ <word ordinal="11">Одиннадцатое </word>
7254
+ <word ordinal="12">Двенадцатое </word>
7255
+ <word ordinal="13">Тринадцатое </word>
7256
+ <word ordinal="14">Четырнадцатое </word>
7257
+ <word ordinal="15">Пятнадцатое </word>
7258
+ <word ordinal="16">Шестнадцатое </word>
7259
+ <word ordinal="17">Семнадцатое </word>
7260
+ <word ordinal="18">Восемнадцатое </word>
7261
+ <word ordinal="19">Девятнадцатое </word>
7262
+ <word cardinal="20">Двадцать-</word>
7263
+ <word ordinal="20">Двадцатое </word>
7264
+ <word cardinal="30">Тридцать-</word>
7265
+ <word ordinal="30">Тридцатое </word>
7266
+ <word cardinal="40">Сорок-</word>
7267
+ <word ordinal="40">Сороковое </word>
7268
+ <word cardinal="50">Пятьдесят-</word>
7269
+ <word ordinal="50">Пятидесятое </word>
7270
+ <word cardinal="60">Шестьдесят-</word>
7271
+ <word ordinal="60">Шестидесятое </word>
7272
+ <word cardinal="70">Семьдесят-</word>
7273
+ <word ordinal="70">Семидесятое </word>
7274
+ <word cardinal="80">Восемьдесят-</word>
7275
+ <word ordinal="80">Восьмидесятое </word>
7276
+ <word cardinal="90">Девяносто-</word>
7277
+ <word ordinal="90">Девяностое </word>
7278
+ <word cardinal="100">Сто-</word>
7279
+ <word ordinal="100">Сотое </word>
7280
+ </xsl:when>
7281
+ <xsl:otherwise> <!-- default english -->
7282
+ <word cardinal="1">One-</word>
7283
+ <word ordinal="1">First </word>
7284
+ <word cardinal="2">Two-</word>
7285
+ <word ordinal="2">Second </word>
7286
+ <word cardinal="3">Three-</word>
7287
+ <word ordinal="3">Third </word>
7288
+ <word cardinal="4">Four-</word>
7289
+ <word ordinal="4">Fourth </word>
7290
+ <word cardinal="5">Five-</word>
7291
+ <word ordinal="5">Fifth </word>
7292
+ <word cardinal="6">Six-</word>
7293
+ <word ordinal="6">Sixth </word>
7294
+ <word cardinal="7">Seven-</word>
7295
+ <word ordinal="7">Seventh </word>
7296
+ <word cardinal="8">Eight-</word>
7297
+ <word ordinal="8">Eighth </word>
7298
+ <word cardinal="9">Nine-</word>
7299
+ <word ordinal="9">Ninth </word>
7300
+ <word ordinal="10">Tenth </word>
7301
+ <word ordinal="11">Eleventh </word>
7302
+ <word ordinal="12">Twelfth </word>
7303
+ <word ordinal="13">Thirteenth </word>
7304
+ <word ordinal="14">Fourteenth </word>
7305
+ <word ordinal="15">Fifteenth </word>
7306
+ <word ordinal="16">Sixteenth </word>
7307
+ <word ordinal="17">Seventeenth </word>
7308
+ <word ordinal="18">Eighteenth </word>
7309
+ <word ordinal="19">Nineteenth </word>
7310
+ <word cardinal="20">Twenty-</word>
7311
+ <word ordinal="20">Twentieth </word>
7312
+ <word cardinal="30">Thirty-</word>
7313
+ <word ordinal="30">Thirtieth </word>
7314
+ <word cardinal="40">Forty-</word>
7315
+ <word ordinal="40">Fortieth </word>
7316
+ <word cardinal="50">Fifty-</word>
7317
+ <word ordinal="50">Fiftieth </word>
7318
+ <word cardinal="60">Sixty-</word>
7319
+ <word ordinal="60">Sixtieth </word>
7320
+ <word cardinal="70">Seventy-</word>
7321
+ <word ordinal="70">Seventieth </word>
7322
+ <word cardinal="80">Eighty-</word>
7323
+ <word ordinal="80">Eightieth </word>
7324
+ <word cardinal="90">Ninety-</word>
7325
+ <word ordinal="90">Ninetieth </word>
7326
+ <word cardinal="100">Hundred-</word>
7327
+ <word ordinal="100">Hundredth </word>
7328
+ </xsl:otherwise>
7329
+ </xsl:choose>
7161
7330
  </words>
7162
7331
  </xsl:variable>
7163
7332
 
@@ -7231,4 +7400,18 @@
7231
7400
  <xsl:otherwise>_</xsl:otherwise>
7232
7401
  </xsl:choose>
7233
7402
  </xsl:attribute>
7403
+ </xsl:template><xsl:template name="substring-after-last">
7404
+ <xsl:param name="value"/>
7405
+ <xsl:param name="delimiter"/>
7406
+ <xsl:choose>
7407
+ <xsl:when test="contains($value, $delimiter)">
7408
+ <xsl:call-template name="substring-after-last">
7409
+ <xsl:with-param name="value" select="substring-after($value, $delimiter)"/>
7410
+ <xsl:with-param name="delimiter" select="$delimiter"/>
7411
+ </xsl:call-template>
7412
+ </xsl:when>
7413
+ <xsl:otherwise>
7414
+ <xsl:value-of select="$value"/>
7415
+ </xsl:otherwise>
7416
+ </xsl:choose>
7234
7417
  </xsl:template></xsl:stylesheet>
@@ -749,6 +749,10 @@
749
749
  <xsl:text>Édition </xsl:text>
750
750
  </title-edition>
751
751
 
752
+ <title-edition lang="ru">
753
+ <xsl:text>Издание </xsl:text>
754
+ </title-edition>
755
+
752
756
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
753
757
  <title-toc lang="en">
754
758
 
@@ -777,7 +781,11 @@
777
781
 
778
782
 
779
783
 
780
- </title-part>
784
+ </title-part>
785
+ <title-part lang="ru">
786
+
787
+
788
+ </title-part>
781
789
  <title-part lang="zh">第 # 部分:</title-part>
782
790
 
783
791
  <title-subpart lang="en">Sub-part #</title-subpart>
@@ -793,6 +801,7 @@
793
801
 
794
802
  <title-summary lang="en">Summary</title-summary>
795
803
 
804
+ <title-continued lang="ru">(продолжение)</title-continued>
796
805
  <title-continued lang="en">(continued)</title-continued>
797
806
  <title-continued lang="fr">(continué)</title-continued>
798
807
 
@@ -1539,13 +1548,19 @@
1539
1548
  </xsl:attribute-set><xsl:variable name="color-added-text">
1540
1549
  <xsl:text>rgb(0, 255, 0)</xsl:text>
1541
1550
  </xsl:variable><xsl:attribute-set name="add-style">
1542
- <xsl:attribute name="color">red</xsl:attribute>
1543
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1544
- <!-- <xsl:attribute name="color">black</xsl:attribute>
1545
- <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
1546
- <xsl:attribute name="padding-top">1mm</xsl:attribute>
1547
- <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
1548
- </xsl:attribute-set><xsl:variable name="color-deleted-text">
1551
+
1552
+ <xsl:attribute name="color">red</xsl:attribute>
1553
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1554
+ <!-- <xsl:attribute name="color">black</xsl:attribute>
1555
+ <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
1556
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
1557
+ <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
1558
+
1559
+ </xsl:attribute-set><xsl:variable name="add-style">
1560
+ <add-style xsl:use-attribute-sets="add-style"/>
1561
+ </xsl:variable><xsl:template name="append_add-style">
1562
+ <xsl:copy-of select="xalan:nodeset($add-style)/add-style/@*"/>
1563
+ </xsl:template><xsl:variable name="color-deleted-text">
1549
1564
  <xsl:text>red</xsl:text>
1550
1565
  </xsl:variable><xsl:attribute-set name="del-style">
1551
1566
  <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
@@ -1979,14 +1994,42 @@
1979
1994
 
1980
1995
 
1981
1996
  </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:variable name="ace_tag">ace-tag_</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
1997
+ <xsl:variable name="nodes_preface_">
1998
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
1999
+ <node id="{@id}"/>
2000
+ </xsl:for-each>
2001
+ </xsl:variable>
2002
+ <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
2003
+
1982
2004
  <xsl:for-each select="/*/*[local-name()='preface']/*">
1983
2005
  <xsl:sort select="@displayorder" data-type="number"/>
2006
+
2007
+ <!-- process Section's title -->
2008
+ <xsl:variable name="preceding-sibling_id" select="$nodes_preface/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
2009
+ <xsl:if test="$preceding-sibling_id != ''">
2010
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="contents_no_displayorder"/>
2011
+ </xsl:if>
2012
+
1984
2013
  <xsl:apply-templates select="." mode="contents"/>
1985
2014
  </xsl:for-each>
1986
2015
  </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1987
2016
 
2017
+ <xsl:variable name="nodes_sections_">
2018
+ <xsl:for-each select="/*/*[local-name()='sections']/*">
2019
+ <node id="{@id}"/>
2020
+ </xsl:for-each>
2021
+ </xsl:variable>
2022
+ <xsl:variable name="nodes_sections" select="xalan:nodeset($nodes_sections_)"/>
2023
+
1988
2024
  <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
1989
2025
  <xsl:sort select="@displayorder" data-type="number"/>
2026
+
2027
+ <!-- process Section's title -->
2028
+ <xsl:variable name="preceding-sibling_id" select="$nodes_sections/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
2029
+ <xsl:if test="$preceding-sibling_id != ''">
2030
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="contents_no_displayorder"/>
2031
+ </xsl:if>
2032
+
1990
2033
  <xsl:apply-templates select="." mode="contents"/>
1991
2034
  </xsl:for-each>
1992
2035
 
@@ -2125,7 +2168,7 @@
2125
2168
  </xsl:call-template>
2126
2169
  </xsl:if>
2127
2170
  </xsl:variable>
2128
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2171
+ <!-- DEBUG colwidths=<xsl:copy-of select="$colwidths"/> -->
2129
2172
 
2130
2173
 
2131
2174
  <xsl:variable name="margin-side">
@@ -2385,7 +2428,7 @@
2385
2428
  <!-- <xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/> -->
2386
2429
  <!-- 2009 thinspace -->
2387
2430
  <!-- <xsl:with-param name="text" select="translate(normalize-space($td_text),'- —:', ' ')"/> -->
2388
- <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '', ' '))"/>
2431
+ <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
2389
2432
  </xsl:call-template>
2390
2433
  </xsl:variable>
2391
2434
  <xsl:variable name="max_length">
@@ -4013,6 +4056,9 @@
4013
4056
  </fo:inline>
4014
4057
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
4015
4058
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
4059
+ <xsl:if test="parent::*[local-name() = 'add']">
4060
+ <xsl:call-template name="append_add-style"/>
4061
+ </xsl:if>
4016
4062
  <xsl:apply-templates/>
4017
4063
  </fo:basic-link>
4018
4064
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -4114,6 +4160,13 @@
4114
4160
 
4115
4161
 
4116
4162
 
4163
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
4164
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
4165
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
4166
+ <xsl:call-template name="append_add-style"/>
4167
+ </xsl:if>
4168
+
4169
+
4117
4170
  <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
4118
4171
  <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
4119
4172
  <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
@@ -4152,6 +4205,12 @@
4152
4205
 
4153
4206
 
4154
4207
 
4208
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
4209
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
4210
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
4211
+ <xsl:call-template name="append_add-style"/>
4212
+ </xsl:if>
4213
+
4155
4214
  <xsl:apply-templates select="*[local-name() = 'name']"/>
4156
4215
 
4157
4216
  </fo:inline>
@@ -4201,6 +4260,7 @@
4201
4260
  </fo:block>
4202
4261
  </xsl:template><xsl:template match="*[local-name() = 'term']">
4203
4262
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
4263
+
4204
4264
 
4205
4265
 
4206
4266
 
@@ -4637,7 +4697,11 @@
4637
4697
  <xsl:value-of select="."/>
4638
4698
  </xsl:template><xsl:template match="node()" mode="contents">
4639
4699
  <xsl:apply-templates mode="contents"/>
4640
- </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" mode="contents">
4700
+ </xsl:template><xsl:template match="*[local-name() = 'preface' or local-name() = 'sections']/*[local-name() = 'p'][@type = 'section-title' and not(@displayorder)]" priority="3" mode="contents"/><xsl:template match="*[local-name() = 'p'][@type = 'section-title' and not(@displayorder)]" mode="contents_no_displayorder">
4701
+ <xsl:call-template name="contents_section-title"/>
4702
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'section-title']" mode="contents_in_clause">
4703
+ <xsl:call-template name="contents_section-title"/>
4704
+ </xsl:template><xsl:template match="*[local-name() = 'clause']/*[local-name() = 'p'][@type = 'section-title' and (@depth != ../*[local-name() = 'title']/@depth or ../*[local-name() = 'title']/@depth = 1)]" priority="3" mode="contents"/><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" name="contents_section-title" mode="contents">
4641
4705
  <xsl:variable name="level">
4642
4706
  <xsl:call-template name="getLevel">
4643
4707
  <xsl:with-param name="depth" select="@depth"/>
@@ -5942,7 +6006,7 @@
5942
6006
 
5943
6007
 
5944
6008
 
5945
-
6009
+
5946
6010
  <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
5947
6011
  </fo:list-block>
5948
6012
  <!-- <xsl:for-each select="./iho:note">
@@ -5960,6 +6024,11 @@
5960
6024
 
5961
6025
 
5962
6026
 
6027
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6028
+ <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
6029
+ <xsl:call-template name="append_add-style"/>
6030
+ </xsl:if>
6031
+
5963
6032
  <xsl:call-template name="getListItemFormat"/>
5964
6033
  </fo:block>
5965
6034
  </fo:list-item-label>
@@ -7111,53 +7180,153 @@
7111
7180
  <xsl:param name="first"/>
7112
7181
  <xsl:if test="$number != ''">
7113
7182
  <xsl:variable name="words">
7114
- <words>
7115
- <word cardinal="1">One-</word>
7116
- <word ordinal="1">First </word>
7117
- <word cardinal="2">Two-</word>
7118
- <word ordinal="2">Second </word>
7119
- <word cardinal="3">Three-</word>
7120
- <word ordinal="3">Third </word>
7121
- <word cardinal="4">Four-</word>
7122
- <word ordinal="4">Fourth </word>
7123
- <word cardinal="5">Five-</word>
7124
- <word ordinal="5">Fifth </word>
7125
- <word cardinal="6">Six-</word>
7126
- <word ordinal="6">Sixth </word>
7127
- <word cardinal="7">Seven-</word>
7128
- <word ordinal="7">Seventh </word>
7129
- <word cardinal="8">Eight-</word>
7130
- <word ordinal="8">Eighth </word>
7131
- <word cardinal="9">Nine-</word>
7132
- <word ordinal="9">Ninth </word>
7133
- <word ordinal="10">Tenth </word>
7134
- <word ordinal="11">Eleventh </word>
7135
- <word ordinal="12">Twelfth </word>
7136
- <word ordinal="13">Thirteenth </word>
7137
- <word ordinal="14">Fourteenth </word>
7138
- <word ordinal="15">Fifteenth </word>
7139
- <word ordinal="16">Sixteenth </word>
7140
- <word ordinal="17">Seventeenth </word>
7141
- <word ordinal="18">Eighteenth </word>
7142
- <word ordinal="19">Nineteenth </word>
7143
- <word cardinal="20">Twenty-</word>
7144
- <word ordinal="20">Twentieth </word>
7145
- <word cardinal="30">Thirty-</word>
7146
- <word ordinal="30">Thirtieth </word>
7147
- <word cardinal="40">Forty-</word>
7148
- <word ordinal="40">Fortieth </word>
7149
- <word cardinal="50">Fifty-</word>
7150
- <word ordinal="50">Fiftieth </word>
7151
- <word cardinal="60">Sixty-</word>
7152
- <word ordinal="60">Sixtieth </word>
7153
- <word cardinal="70">Seventy-</word>
7154
- <word ordinal="70">Seventieth </word>
7155
- <word cardinal="80">Eighty-</word>
7156
- <word ordinal="80">Eightieth </word>
7157
- <word cardinal="90">Ninety-</word>
7158
- <word ordinal="90">Ninetieth </word>
7159
- <word cardinal="100">Hundred-</word>
7160
- <word ordinal="100">Hundredth </word>
7183
+ <words>
7184
+ <xsl:choose>
7185
+ <xsl:when test="$lang = 'fr'"> <!-- https://en.wiktionary.org/wiki/Appendix:French_numbers -->
7186
+ <word cardinal="1">Une-</word>
7187
+ <word ordinal="1">Première </word>
7188
+ <word cardinal="2">Deux-</word>
7189
+ <word ordinal="2">Seconde </word>
7190
+ <word cardinal="3">Trois-</word>
7191
+ <word ordinal="3">Tierce </word>
7192
+ <word cardinal="4">Quatre-</word>
7193
+ <word ordinal="4">Quatrième </word>
7194
+ <word cardinal="5">Cinq-</word>
7195
+ <word ordinal="5">Cinquième </word>
7196
+ <word cardinal="6">Six-</word>
7197
+ <word ordinal="6">Sixième </word>
7198
+ <word cardinal="7">Sept-</word>
7199
+ <word ordinal="7">Septième </word>
7200
+ <word cardinal="8">Huit-</word>
7201
+ <word ordinal="8">Huitième </word>
7202
+ <word cardinal="9">Neuf-</word>
7203
+ <word ordinal="9">Neuvième </word>
7204
+ <word ordinal="10">Dixième </word>
7205
+ <word ordinal="11">Onzième </word>
7206
+ <word ordinal="12">Douzième </word>
7207
+ <word ordinal="13">Treizième </word>
7208
+ <word ordinal="14">Quatorzième </word>
7209
+ <word ordinal="15">Quinzième </word>
7210
+ <word ordinal="16">Seizième </word>
7211
+ <word ordinal="17">Dix-septième </word>
7212
+ <word ordinal="18">Dix-huitième </word>
7213
+ <word ordinal="19">Dix-neuvième </word>
7214
+ <word cardinal="20">Vingt-</word>
7215
+ <word ordinal="20">Vingtième </word>
7216
+ <word cardinal="30">Trente-</word>
7217
+ <word ordinal="30">Trentième </word>
7218
+ <word cardinal="40">Quarante-</word>
7219
+ <word ordinal="40">Quarantième </word>
7220
+ <word cardinal="50">Cinquante-</word>
7221
+ <word ordinal="50">Cinquantième </word>
7222
+ <word cardinal="60">Soixante-</word>
7223
+ <word ordinal="60">Soixantième </word>
7224
+ <word cardinal="70">Septante-</word>
7225
+ <word ordinal="70">Septantième </word>
7226
+ <word cardinal="80">Huitante-</word>
7227
+ <word ordinal="80">Huitantième </word>
7228
+ <word cardinal="90">Nonante-</word>
7229
+ <word ordinal="90">Nonantième </word>
7230
+ <word cardinal="100">Cent-</word>
7231
+ <word ordinal="100">Centième </word>
7232
+ </xsl:when>
7233
+ <xsl:when test="$lang = 'ru'">
7234
+ <word cardinal="1">Одна-</word>
7235
+ <word ordinal="1">Первое </word>
7236
+ <word cardinal="2">Две-</word>
7237
+ <word ordinal="2">Второе </word>
7238
+ <word cardinal="3">Три-</word>
7239
+ <word ordinal="3">Третье </word>
7240
+ <word cardinal="4">Четыре-</word>
7241
+ <word ordinal="4">Четвертое </word>
7242
+ <word cardinal="5">Пять-</word>
7243
+ <word ordinal="5">Пятое </word>
7244
+ <word cardinal="6">Шесть-</word>
7245
+ <word ordinal="6">Шестое </word>
7246
+ <word cardinal="7">Семь-</word>
7247
+ <word ordinal="7">Седьмое </word>
7248
+ <word cardinal="8">Восемь-</word>
7249
+ <word ordinal="8">Восьмое </word>
7250
+ <word cardinal="9">Девять-</word>
7251
+ <word ordinal="9">Девятое </word>
7252
+ <word ordinal="10">Десятое </word>
7253
+ <word ordinal="11">Одиннадцатое </word>
7254
+ <word ordinal="12">Двенадцатое </word>
7255
+ <word ordinal="13">Тринадцатое </word>
7256
+ <word ordinal="14">Четырнадцатое </word>
7257
+ <word ordinal="15">Пятнадцатое </word>
7258
+ <word ordinal="16">Шестнадцатое </word>
7259
+ <word ordinal="17">Семнадцатое </word>
7260
+ <word ordinal="18">Восемнадцатое </word>
7261
+ <word ordinal="19">Девятнадцатое </word>
7262
+ <word cardinal="20">Двадцать-</word>
7263
+ <word ordinal="20">Двадцатое </word>
7264
+ <word cardinal="30">Тридцать-</word>
7265
+ <word ordinal="30">Тридцатое </word>
7266
+ <word cardinal="40">Сорок-</word>
7267
+ <word ordinal="40">Сороковое </word>
7268
+ <word cardinal="50">Пятьдесят-</word>
7269
+ <word ordinal="50">Пятидесятое </word>
7270
+ <word cardinal="60">Шестьдесят-</word>
7271
+ <word ordinal="60">Шестидесятое </word>
7272
+ <word cardinal="70">Семьдесят-</word>
7273
+ <word ordinal="70">Семидесятое </word>
7274
+ <word cardinal="80">Восемьдесят-</word>
7275
+ <word ordinal="80">Восьмидесятое </word>
7276
+ <word cardinal="90">Девяносто-</word>
7277
+ <word ordinal="90">Девяностое </word>
7278
+ <word cardinal="100">Сто-</word>
7279
+ <word ordinal="100">Сотое </word>
7280
+ </xsl:when>
7281
+ <xsl:otherwise> <!-- default english -->
7282
+ <word cardinal="1">One-</word>
7283
+ <word ordinal="1">First </word>
7284
+ <word cardinal="2">Two-</word>
7285
+ <word ordinal="2">Second </word>
7286
+ <word cardinal="3">Three-</word>
7287
+ <word ordinal="3">Third </word>
7288
+ <word cardinal="4">Four-</word>
7289
+ <word ordinal="4">Fourth </word>
7290
+ <word cardinal="5">Five-</word>
7291
+ <word ordinal="5">Fifth </word>
7292
+ <word cardinal="6">Six-</word>
7293
+ <word ordinal="6">Sixth </word>
7294
+ <word cardinal="7">Seven-</word>
7295
+ <word ordinal="7">Seventh </word>
7296
+ <word cardinal="8">Eight-</word>
7297
+ <word ordinal="8">Eighth </word>
7298
+ <word cardinal="9">Nine-</word>
7299
+ <word ordinal="9">Ninth </word>
7300
+ <word ordinal="10">Tenth </word>
7301
+ <word ordinal="11">Eleventh </word>
7302
+ <word ordinal="12">Twelfth </word>
7303
+ <word ordinal="13">Thirteenth </word>
7304
+ <word ordinal="14">Fourteenth </word>
7305
+ <word ordinal="15">Fifteenth </word>
7306
+ <word ordinal="16">Sixteenth </word>
7307
+ <word ordinal="17">Seventeenth </word>
7308
+ <word ordinal="18">Eighteenth </word>
7309
+ <word ordinal="19">Nineteenth </word>
7310
+ <word cardinal="20">Twenty-</word>
7311
+ <word ordinal="20">Twentieth </word>
7312
+ <word cardinal="30">Thirty-</word>
7313
+ <word ordinal="30">Thirtieth </word>
7314
+ <word cardinal="40">Forty-</word>
7315
+ <word ordinal="40">Fortieth </word>
7316
+ <word cardinal="50">Fifty-</word>
7317
+ <word ordinal="50">Fiftieth </word>
7318
+ <word cardinal="60">Sixty-</word>
7319
+ <word ordinal="60">Sixtieth </word>
7320
+ <word cardinal="70">Seventy-</word>
7321
+ <word ordinal="70">Seventieth </word>
7322
+ <word cardinal="80">Eighty-</word>
7323
+ <word ordinal="80">Eightieth </word>
7324
+ <word cardinal="90">Ninety-</word>
7325
+ <word ordinal="90">Ninetieth </word>
7326
+ <word cardinal="100">Hundred-</word>
7327
+ <word ordinal="100">Hundredth </word>
7328
+ </xsl:otherwise>
7329
+ </xsl:choose>
7161
7330
  </words>
7162
7331
  </xsl:variable>
7163
7332
 
@@ -7231,4 +7400,18 @@
7231
7400
  <xsl:otherwise>_</xsl:otherwise>
7232
7401
  </xsl:choose>
7233
7402
  </xsl:attribute>
7403
+ </xsl:template><xsl:template name="substring-after-last">
7404
+ <xsl:param name="value"/>
7405
+ <xsl:param name="delimiter"/>
7406
+ <xsl:choose>
7407
+ <xsl:when test="contains($value, $delimiter)">
7408
+ <xsl:call-template name="substring-after-last">
7409
+ <xsl:with-param name="value" select="substring-after($value, $delimiter)"/>
7410
+ <xsl:with-param name="delimiter" select="$delimiter"/>
7411
+ </xsl:call-template>
7412
+ </xsl:when>
7413
+ <xsl:otherwise>
7414
+ <xsl:value-of select="$value"/>
7415
+ </xsl:otherwise>
7416
+ </xsl:choose>
7234
7417
  </xsl:template></xsl:stylesheet>
@@ -6,25 +6,27 @@ module IsoDoc
6
6
  end
7
7
 
8
8
  class Xref < IsoDoc::Generic::Xref
9
+ def annexlbl(cond)
10
+ cond ? @labels["appendix"] : @labels["annex"]
11
+ end
12
+
9
13
  def annex_name_lbl(clause, num)
10
- lbl = clause["obligation"] == "informative" ?
11
- @labels["appendix"] : @labels["annex"]
14
+ lbl = annexlbl(clause["obligation"] == "informative")
12
15
  l10n("<strong>#{lbl} #{num}</strong>")
13
16
  end
14
17
 
15
18
  def annex_names(clause, num)
16
19
  appendix_names(clause, num)
17
- lbl = clause["obligation"] == "informative" ?
18
- @labels["appendix"] : @labels["annex"]
20
+ lbl = annexlbl(clause["obligation"] == "informative")
19
21
  @anchors[clause["id"]] =
20
- { label: annex_name_lbl(clause, num), type: "clause",
21
- xref: l10n("#{lbl} #{num}"), level: 1, value: lbl }
22
+ { label: annex_name_lbl(clause, num), type: "clause", elem: lbl,
23
+ xref: l10n("#{lbl} #{num}"), level: 1, value: num }
22
24
  if a = single_annex_special_section(clause)
23
- annex_names1(a, "#{num}", 1)
25
+ annex_names1(a, num.to_s, 1)
24
26
  else
25
27
  i = Counter.new
26
- clause.xpath(ns("./clause | ./references | ./terms | ./definitions")).
27
- each do |c|
28
+ clause.xpath(ns("./clause | ./references | ./terms | ./definitions"))
29
+ .each do |c|
28
30
  i.increment(c)
29
31
  annex_names1(c, "#{num}.#{i.print}", 2)
30
32
  end
@@ -35,36 +37,36 @@ module IsoDoc
35
37
  def back_anchor_names(docxml)
36
38
  super
37
39
  i = Counter.new
38
- docxml.xpath(ns("//annex[@obligation = 'informative']")).
39
- each do |c|
40
+ docxml.xpath(ns("//annex[@obligation = 'informative']"))
41
+ .each do |c|
40
42
  i.increment(c)
41
43
  annex_names(c, i.print)
42
44
  end
43
45
  i = Counter.new("@", skip_i: true)
44
- docxml.xpath(ns("//annex[not(@obligation = 'informative')]")).
45
- each do |c|
46
+ docxml.xpath(ns("//annex[not(@obligation = 'informative')]"))
47
+ .each do |c|
46
48
  i.increment(c)
47
49
  annex_names(c, i.print)
48
50
  end
49
51
  end
50
52
 
51
53
  def annex_names1(clause, num, level)
52
- lbl = clause.at("./ancestor::xmlns:annex/@obligation").
53
- text == "informative" ? @labels["appendix"] : @labels["annex"]
54
+ lbl = annexlbl(clause.at("./ancestor::xmlns:annex/@obligation")
55
+ .text == "informative")
54
56
  @anchors[clause["id"]] =
55
57
  { label: num, xref: l10n("#{lbl} #{num}"),
56
58
  level: level, type: "clause" }
57
- i = Counter.new
58
- clause.xpath(ns("./clause | ./references | ./terms | ./definitions")).
59
- each do |c|
59
+ i = Counter.new
60
+ clause.xpath(ns("./clause | ./references | ./terms | ./definitions"))
61
+ .each do |c|
60
62
  i.increment(c)
61
63
  annex_names1(c, "#{num}.#{i.print}", level + 1)
62
64
  end
63
65
  end
64
66
 
65
- def appendix_names(clause, num)
66
- i = Counter.new
67
- clause.xpath(ns("./appendix")).each_with_index do |c|
67
+ def appendix_names(clause, _num)
68
+ i = Counter.new
69
+ clause.xpath(ns("./appendix")).each do |c|
68
70
  i.increment(c)
69
71
  @anchors[c["id"]] =
70
72
  anchor_struct(i.print, nil, @labels["appendix"], "clause")
@@ -73,16 +75,17 @@ module IsoDoc
73
75
  end
74
76
  end
75
77
 
76
- def section_names1(clause, num, level)
77
- @anchors[clause["id"]] =
78
- { label: num, level: level, xref: l10n("#{@labels["subclause"]} #{num}"),
79
- type: "clause" }
80
- i = Counter.new
81
- clause.xpath(ns(SUBCLAUSES)).each_with_index do |c|
82
- i.increment(c)
83
- section_names1(c, "#{num}.#{i.print}", level + 1)
78
+ def section_names1(clause, num, level)
79
+ @anchors[clause["id"]] =
80
+ { label: num, level: level,
81
+ xref: l10n("#{@labels['subclause']} #{num}"),
82
+ type: "clause", elem: @labels["subclause"] }
83
+ i = Counter.new
84
+ clause.xpath(ns(SUBCLAUSES)).each do |c|
85
+ i.increment(c)
86
+ section_names1(c, "#{num}.#{i.print}", level + 1)
87
+ end
84
88
  end
85
89
  end
86
- end
87
90
  end
88
91
  end
@@ -152,9 +152,7 @@
152
152
  <data type="boolean"/>
153
153
  </attribute>
154
154
  </optional>
155
- <oneOrMore>
156
- <ref name="PureTextElement"/>
157
- </oneOrMore>
155
+ <ref name="XrefBody"/>
158
156
  </element>
159
157
  </define>
160
158
  <define name="erefType">
@@ -188,6 +186,42 @@
188
186
  <ref name="PureTextElement"/>
189
187
  </oneOrMore>
190
188
  </define>
189
+ <define name="localityStack">
190
+ <element name="localityStack">
191
+ <optional>
192
+ <attribute name="connective">
193
+ <choice>
194
+ <value>and</value>
195
+ <value>or</value>
196
+ <value>from</value>
197
+ <value>to</value>
198
+ <value/>
199
+ </choice>
200
+ </attribute>
201
+ </optional>
202
+ <zeroOrMore>
203
+ <ref name="locality"/>
204
+ </zeroOrMore>
205
+ </element>
206
+ </define>
207
+ <define name="sourceLocalityStack">
208
+ <element name="sourceLocalityStack">
209
+ <optional>
210
+ <attribute name="connective">
211
+ <choice>
212
+ <value>and</value>
213
+ <value>or</value>
214
+ <value>from</value>
215
+ <value>to</value>
216
+ <value/>
217
+ </choice>
218
+ </attribute>
219
+ </optional>
220
+ <zeroOrMore>
221
+ <ref name="sourceLocality"/>
222
+ </zeroOrMore>
223
+ </element>
224
+ </define>
191
225
  <define name="ul">
192
226
  <element name="ul">
193
227
  <attribute name="id">
@@ -1098,6 +1132,16 @@
1098
1132
  </define>
1099
1133
  </include>
1100
1134
  <!-- end overrides -->
1135
+ <define name="image" combine="choice">
1136
+ <element name="svg">
1137
+ <oneOrMore>
1138
+ <choice>
1139
+ <text/>
1140
+ <ref name="AnyElement"/>
1141
+ </choice>
1142
+ </oneOrMore>
1143
+ </element>
1144
+ </define>
1101
1145
  <define name="MultilingualRenderingType">
1102
1146
  <choice>
1103
1147
  <value>common</value>
@@ -2631,4 +2675,30 @@
2631
2675
  </zeroOrMore>
2632
2676
  </element>
2633
2677
  </define>
2678
+ <define name="XrefBody">
2679
+ <zeroOrMore>
2680
+ <ref name="XrefTarget"/>
2681
+ </zeroOrMore>
2682
+ <oneOrMore>
2683
+ <ref name="PureTextElement"/>
2684
+ </oneOrMore>
2685
+ </define>
2686
+ <define name="XrefTarget">
2687
+ <element name="location">
2688
+ <attribute name="target">
2689
+ <data type="string">
2690
+ <param name="pattern">\i\c*|\c+#\c+</param>
2691
+ </data>
2692
+ </attribute>
2693
+ <attribute name="connective">
2694
+ <choice>
2695
+ <value>and</value>
2696
+ <value>or</value>
2697
+ <value>from</value>
2698
+ <value>to</value>
2699
+ <value/>
2700
+ </choice>
2701
+ </attribute>
2702
+ </element>
2703
+ </define>
2634
2704
  </grammar>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IHO
3
- VERSION = "0.5.3".freeze
3
+ VERSION = "0.5.4".freeze
4
4
  end
5
5
  end
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.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-07 00:00:00.000000000 Z
11
+ date: 2022-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities