metanorma-un 0.8.3 → 0.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -851,6 +851,10 @@
851
851
  <xsl:text>Édition </xsl:text>
852
852
  </title-edition>
853
853
 
854
+ <title-edition lang="ru">
855
+ <xsl:text>Издание </xsl:text>
856
+ </title-edition>
857
+
854
858
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
855
859
  <title-toc lang="en">
856
860
 
@@ -877,7 +881,11 @@
877
881
 
878
882
 
879
883
 
880
- </title-part>
884
+ </title-part>
885
+ <title-part lang="ru">
886
+
887
+
888
+ </title-part>
881
889
  <title-part lang="zh">第 # 部分:</title-part>
882
890
 
883
891
  <title-subpart lang="en">Sub-part #</title-subpart>
@@ -893,6 +901,7 @@
893
901
 
894
902
  <title-summary lang="en">Summary</title-summary>
895
903
 
904
+ <title-continued lang="ru">(продолжение)</title-continued>
896
905
  <title-continued lang="en">(continued)</title-continued>
897
906
  <title-continued lang="fr">(continué)</title-continued>
898
907
 
@@ -1619,13 +1628,19 @@
1619
1628
  </xsl:attribute-set><xsl:variable name="color-added-text">
1620
1629
  <xsl:text>rgb(0, 255, 0)</xsl:text>
1621
1630
  </xsl:variable><xsl:attribute-set name="add-style">
1622
- <xsl:attribute name="color">red</xsl:attribute>
1623
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1624
- <!-- <xsl:attribute name="color">black</xsl:attribute>
1625
- <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
1626
- <xsl:attribute name="padding-top">1mm</xsl:attribute>
1627
- <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
1628
- </xsl:attribute-set><xsl:variable name="color-deleted-text">
1631
+
1632
+ <xsl:attribute name="color">red</xsl:attribute>
1633
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1634
+ <!-- <xsl:attribute name="color">black</xsl:attribute>
1635
+ <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
1636
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
1637
+ <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
1638
+
1639
+ </xsl:attribute-set><xsl:variable name="add-style">
1640
+ <add-style xsl:use-attribute-sets="add-style"/>
1641
+ </xsl:variable><xsl:template name="append_add-style">
1642
+ <xsl:copy-of select="xalan:nodeset($add-style)/add-style/@*"/>
1643
+ </xsl:template><xsl:variable name="color-deleted-text">
1629
1644
  <xsl:text>red</xsl:text>
1630
1645
  </xsl:variable><xsl:attribute-set name="del-style">
1631
1646
  <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
@@ -2054,14 +2069,42 @@
2054
2069
 
2055
2070
 
2056
2071
  </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">
2072
+ <xsl:variable name="nodes_preface_">
2073
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
2074
+ <node id="{@id}"/>
2075
+ </xsl:for-each>
2076
+ </xsl:variable>
2077
+ <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
2078
+
2057
2079
  <xsl:for-each select="/*/*[local-name()='preface']/*">
2058
2080
  <xsl:sort select="@displayorder" data-type="number"/>
2081
+
2082
+ <!-- process Section's title -->
2083
+ <xsl:variable name="preceding-sibling_id" select="$nodes_preface/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
2084
+ <xsl:if test="$preceding-sibling_id != ''">
2085
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="contents_no_displayorder"/>
2086
+ </xsl:if>
2087
+
2059
2088
  <xsl:apply-templates select="." mode="contents"/>
2060
2089
  </xsl:for-each>
2061
2090
  </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
2062
2091
 
2092
+ <xsl:variable name="nodes_sections_">
2093
+ <xsl:for-each select="/*/*[local-name()='sections']/*">
2094
+ <node id="{@id}"/>
2095
+ </xsl:for-each>
2096
+ </xsl:variable>
2097
+ <xsl:variable name="nodes_sections" select="xalan:nodeset($nodes_sections_)"/>
2098
+
2063
2099
  <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']]">
2064
2100
  <xsl:sort select="@displayorder" data-type="number"/>
2101
+
2102
+ <!-- process Section's title -->
2103
+ <xsl:variable name="preceding-sibling_id" select="$nodes_sections/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
2104
+ <xsl:if test="$preceding-sibling_id != ''">
2105
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="contents_no_displayorder"/>
2106
+ </xsl:if>
2107
+
2065
2108
  <xsl:apply-templates select="." mode="contents"/>
2066
2109
  </xsl:for-each>
2067
2110
 
@@ -2200,7 +2243,7 @@
2200
2243
  </xsl:call-template>
2201
2244
  </xsl:if>
2202
2245
  </xsl:variable>
2203
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2246
+ <!-- DEBUG colwidths=<xsl:copy-of select="$colwidths"/> -->
2204
2247
 
2205
2248
 
2206
2249
  <xsl:variable name="margin-side">
@@ -2468,7 +2511,7 @@
2468
2511
  <!-- <xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/> -->
2469
2512
  <!-- 2009 thinspace -->
2470
2513
  <!-- <xsl:with-param name="text" select="translate(normalize-space($td_text),'- —:', ' ')"/> -->
2471
- <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '', ' '))"/>
2514
+ <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
2472
2515
  </xsl:call-template>
2473
2516
  </xsl:variable>
2474
2517
  <xsl:variable name="max_length">
@@ -4100,6 +4143,9 @@
4100
4143
  </fo:inline>
4101
4144
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
4102
4145
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
4146
+ <xsl:if test="parent::*[local-name() = 'add']">
4147
+ <xsl:call-template name="append_add-style"/>
4148
+ </xsl:if>
4103
4149
  <xsl:apply-templates/>
4104
4150
  </fo:basic-link>
4105
4151
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -4211,6 +4257,13 @@
4211
4257
 
4212
4258
 
4213
4259
 
4260
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
4261
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
4262
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
4263
+ <xsl:call-template name="append_add-style"/>
4264
+ </xsl:if>
4265
+
4266
+
4214
4267
  <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
4215
4268
  <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
4216
4269
  <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
@@ -4249,6 +4302,12 @@
4249
4302
 
4250
4303
 
4251
4304
 
4305
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
4306
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
4307
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
4308
+ <xsl:call-template name="append_add-style"/>
4309
+ </xsl:if>
4310
+
4252
4311
  <xsl:apply-templates select="*[local-name() = 'name']"/>
4253
4312
 
4254
4313
  </fo:inline>
@@ -4302,6 +4361,7 @@
4302
4361
  </fo:block>
4303
4362
  </xsl:template><xsl:template match="*[local-name() = 'term']">
4304
4363
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
4364
+
4305
4365
 
4306
4366
 
4307
4367
 
@@ -4738,7 +4798,11 @@
4738
4798
  <xsl:value-of select="."/>
4739
4799
  </xsl:template><xsl:template match="node()" mode="contents">
4740
4800
  <xsl:apply-templates mode="contents"/>
4741
- </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" mode="contents">
4801
+ </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">
4802
+ <xsl:call-template name="contents_section-title"/>
4803
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'section-title']" mode="contents_in_clause">
4804
+ <xsl:call-template name="contents_section-title"/>
4805
+ </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">
4742
4806
  <xsl:variable name="level">
4743
4807
  <xsl:call-template name="getLevel">
4744
4808
  <xsl:with-param name="depth" select="@depth"/>
@@ -6055,7 +6119,7 @@
6055
6119
 
6056
6120
 
6057
6121
 
6058
-
6122
+
6059
6123
  <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
6060
6124
  </fo:list-block>
6061
6125
  <!-- <xsl:for-each select="./iho:note">
@@ -6073,6 +6137,11 @@
6073
6137
 
6074
6138
 
6075
6139
 
6140
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6141
+ <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
6142
+ <xsl:call-template name="append_add-style"/>
6143
+ </xsl:if>
6144
+
6076
6145
  <xsl:call-template name="getListItemFormat"/>
6077
6146
  </fo:block>
6078
6147
  </fo:list-item-label>
@@ -7127,53 +7196,153 @@
7127
7196
  <xsl:param name="first"/>
7128
7197
  <xsl:if test="$number != ''">
7129
7198
  <xsl:variable name="words">
7130
- <words>
7131
- <word cardinal="1">One-</word>
7132
- <word ordinal="1">First </word>
7133
- <word cardinal="2">Two-</word>
7134
- <word ordinal="2">Second </word>
7135
- <word cardinal="3">Three-</word>
7136
- <word ordinal="3">Third </word>
7137
- <word cardinal="4">Four-</word>
7138
- <word ordinal="4">Fourth </word>
7139
- <word cardinal="5">Five-</word>
7140
- <word ordinal="5">Fifth </word>
7141
- <word cardinal="6">Six-</word>
7142
- <word ordinal="6">Sixth </word>
7143
- <word cardinal="7">Seven-</word>
7144
- <word ordinal="7">Seventh </word>
7145
- <word cardinal="8">Eight-</word>
7146
- <word ordinal="8">Eighth </word>
7147
- <word cardinal="9">Nine-</word>
7148
- <word ordinal="9">Ninth </word>
7149
- <word ordinal="10">Tenth </word>
7150
- <word ordinal="11">Eleventh </word>
7151
- <word ordinal="12">Twelfth </word>
7152
- <word ordinal="13">Thirteenth </word>
7153
- <word ordinal="14">Fourteenth </word>
7154
- <word ordinal="15">Fifteenth </word>
7155
- <word ordinal="16">Sixteenth </word>
7156
- <word ordinal="17">Seventeenth </word>
7157
- <word ordinal="18">Eighteenth </word>
7158
- <word ordinal="19">Nineteenth </word>
7159
- <word cardinal="20">Twenty-</word>
7160
- <word ordinal="20">Twentieth </word>
7161
- <word cardinal="30">Thirty-</word>
7162
- <word ordinal="30">Thirtieth </word>
7163
- <word cardinal="40">Forty-</word>
7164
- <word ordinal="40">Fortieth </word>
7165
- <word cardinal="50">Fifty-</word>
7166
- <word ordinal="50">Fiftieth </word>
7167
- <word cardinal="60">Sixty-</word>
7168
- <word ordinal="60">Sixtieth </word>
7169
- <word cardinal="70">Seventy-</word>
7170
- <word ordinal="70">Seventieth </word>
7171
- <word cardinal="80">Eighty-</word>
7172
- <word ordinal="80">Eightieth </word>
7173
- <word cardinal="90">Ninety-</word>
7174
- <word ordinal="90">Ninetieth </word>
7175
- <word cardinal="100">Hundred-</word>
7176
- <word ordinal="100">Hundredth </word>
7199
+ <words>
7200
+ <xsl:choose>
7201
+ <xsl:when test="$lang = 'fr'"> <!-- https://en.wiktionary.org/wiki/Appendix:French_numbers -->
7202
+ <word cardinal="1">Une-</word>
7203
+ <word ordinal="1">Première </word>
7204
+ <word cardinal="2">Deux-</word>
7205
+ <word ordinal="2">Seconde </word>
7206
+ <word cardinal="3">Trois-</word>
7207
+ <word ordinal="3">Tierce </word>
7208
+ <word cardinal="4">Quatre-</word>
7209
+ <word ordinal="4">Quatrième </word>
7210
+ <word cardinal="5">Cinq-</word>
7211
+ <word ordinal="5">Cinquième </word>
7212
+ <word cardinal="6">Six-</word>
7213
+ <word ordinal="6">Sixième </word>
7214
+ <word cardinal="7">Sept-</word>
7215
+ <word ordinal="7">Septième </word>
7216
+ <word cardinal="8">Huit-</word>
7217
+ <word ordinal="8">Huitième </word>
7218
+ <word cardinal="9">Neuf-</word>
7219
+ <word ordinal="9">Neuvième </word>
7220
+ <word ordinal="10">Dixième </word>
7221
+ <word ordinal="11">Onzième </word>
7222
+ <word ordinal="12">Douzième </word>
7223
+ <word ordinal="13">Treizième </word>
7224
+ <word ordinal="14">Quatorzième </word>
7225
+ <word ordinal="15">Quinzième </word>
7226
+ <word ordinal="16">Seizième </word>
7227
+ <word ordinal="17">Dix-septième </word>
7228
+ <word ordinal="18">Dix-huitième </word>
7229
+ <word ordinal="19">Dix-neuvième </word>
7230
+ <word cardinal="20">Vingt-</word>
7231
+ <word ordinal="20">Vingtième </word>
7232
+ <word cardinal="30">Trente-</word>
7233
+ <word ordinal="30">Trentième </word>
7234
+ <word cardinal="40">Quarante-</word>
7235
+ <word ordinal="40">Quarantième </word>
7236
+ <word cardinal="50">Cinquante-</word>
7237
+ <word ordinal="50">Cinquantième </word>
7238
+ <word cardinal="60">Soixante-</word>
7239
+ <word ordinal="60">Soixantième </word>
7240
+ <word cardinal="70">Septante-</word>
7241
+ <word ordinal="70">Septantième </word>
7242
+ <word cardinal="80">Huitante-</word>
7243
+ <word ordinal="80">Huitantième </word>
7244
+ <word cardinal="90">Nonante-</word>
7245
+ <word ordinal="90">Nonantième </word>
7246
+ <word cardinal="100">Cent-</word>
7247
+ <word ordinal="100">Centième </word>
7248
+ </xsl:when>
7249
+ <xsl:when test="$lang = 'ru'">
7250
+ <word cardinal="1">Одна-</word>
7251
+ <word ordinal="1">Первое </word>
7252
+ <word cardinal="2">Две-</word>
7253
+ <word ordinal="2">Второе </word>
7254
+ <word cardinal="3">Три-</word>
7255
+ <word ordinal="3">Третье </word>
7256
+ <word cardinal="4">Четыре-</word>
7257
+ <word ordinal="4">Четвертое </word>
7258
+ <word cardinal="5">Пять-</word>
7259
+ <word ordinal="5">Пятое </word>
7260
+ <word cardinal="6">Шесть-</word>
7261
+ <word ordinal="6">Шестое </word>
7262
+ <word cardinal="7">Семь-</word>
7263
+ <word ordinal="7">Седьмое </word>
7264
+ <word cardinal="8">Восемь-</word>
7265
+ <word ordinal="8">Восьмое </word>
7266
+ <word cardinal="9">Девять-</word>
7267
+ <word ordinal="9">Девятое </word>
7268
+ <word ordinal="10">Десятое </word>
7269
+ <word ordinal="11">Одиннадцатое </word>
7270
+ <word ordinal="12">Двенадцатое </word>
7271
+ <word ordinal="13">Тринадцатое </word>
7272
+ <word ordinal="14">Четырнадцатое </word>
7273
+ <word ordinal="15">Пятнадцатое </word>
7274
+ <word ordinal="16">Шестнадцатое </word>
7275
+ <word ordinal="17">Семнадцатое </word>
7276
+ <word ordinal="18">Восемнадцатое </word>
7277
+ <word ordinal="19">Девятнадцатое </word>
7278
+ <word cardinal="20">Двадцать-</word>
7279
+ <word ordinal="20">Двадцатое </word>
7280
+ <word cardinal="30">Тридцать-</word>
7281
+ <word ordinal="30">Тридцатое </word>
7282
+ <word cardinal="40">Сорок-</word>
7283
+ <word ordinal="40">Сороковое </word>
7284
+ <word cardinal="50">Пятьдесят-</word>
7285
+ <word ordinal="50">Пятидесятое </word>
7286
+ <word cardinal="60">Шестьдесят-</word>
7287
+ <word ordinal="60">Шестидесятое </word>
7288
+ <word cardinal="70">Семьдесят-</word>
7289
+ <word ordinal="70">Семидесятое </word>
7290
+ <word cardinal="80">Восемьдесят-</word>
7291
+ <word ordinal="80">Восьмидесятое </word>
7292
+ <word cardinal="90">Девяносто-</word>
7293
+ <word ordinal="90">Девяностое </word>
7294
+ <word cardinal="100">Сто-</word>
7295
+ <word ordinal="100">Сотое </word>
7296
+ </xsl:when>
7297
+ <xsl:otherwise> <!-- default english -->
7298
+ <word cardinal="1">One-</word>
7299
+ <word ordinal="1">First </word>
7300
+ <word cardinal="2">Two-</word>
7301
+ <word ordinal="2">Second </word>
7302
+ <word cardinal="3">Three-</word>
7303
+ <word ordinal="3">Third </word>
7304
+ <word cardinal="4">Four-</word>
7305
+ <word ordinal="4">Fourth </word>
7306
+ <word cardinal="5">Five-</word>
7307
+ <word ordinal="5">Fifth </word>
7308
+ <word cardinal="6">Six-</word>
7309
+ <word ordinal="6">Sixth </word>
7310
+ <word cardinal="7">Seven-</word>
7311
+ <word ordinal="7">Seventh </word>
7312
+ <word cardinal="8">Eight-</word>
7313
+ <word ordinal="8">Eighth </word>
7314
+ <word cardinal="9">Nine-</word>
7315
+ <word ordinal="9">Ninth </word>
7316
+ <word ordinal="10">Tenth </word>
7317
+ <word ordinal="11">Eleventh </word>
7318
+ <word ordinal="12">Twelfth </word>
7319
+ <word ordinal="13">Thirteenth </word>
7320
+ <word ordinal="14">Fourteenth </word>
7321
+ <word ordinal="15">Fifteenth </word>
7322
+ <word ordinal="16">Sixteenth </word>
7323
+ <word ordinal="17">Seventeenth </word>
7324
+ <word ordinal="18">Eighteenth </word>
7325
+ <word ordinal="19">Nineteenth </word>
7326
+ <word cardinal="20">Twenty-</word>
7327
+ <word ordinal="20">Twentieth </word>
7328
+ <word cardinal="30">Thirty-</word>
7329
+ <word ordinal="30">Thirtieth </word>
7330
+ <word cardinal="40">Forty-</word>
7331
+ <word ordinal="40">Fortieth </word>
7332
+ <word cardinal="50">Fifty-</word>
7333
+ <word ordinal="50">Fiftieth </word>
7334
+ <word cardinal="60">Sixty-</word>
7335
+ <word ordinal="60">Sixtieth </word>
7336
+ <word cardinal="70">Seventy-</word>
7337
+ <word ordinal="70">Seventieth </word>
7338
+ <word cardinal="80">Eighty-</word>
7339
+ <word ordinal="80">Eightieth </word>
7340
+ <word cardinal="90">Ninety-</word>
7341
+ <word ordinal="90">Ninetieth </word>
7342
+ <word cardinal="100">Hundred-</word>
7343
+ <word ordinal="100">Hundredth </word>
7344
+ </xsl:otherwise>
7345
+ </xsl:choose>
7177
7346
  </words>
7178
7347
  </xsl:variable>
7179
7348
 
@@ -7247,4 +7416,18 @@
7247
7416
  <xsl:otherwise>_</xsl:otherwise>
7248
7417
  </xsl:choose>
7249
7418
  </xsl:attribute>
7419
+ </xsl:template><xsl:template name="substring-after-last">
7420
+ <xsl:param name="value"/>
7421
+ <xsl:param name="delimiter"/>
7422
+ <xsl:choose>
7423
+ <xsl:when test="contains($value, $delimiter)">
7424
+ <xsl:call-template name="substring-after-last">
7425
+ <xsl:with-param name="value" select="substring-after($value, $delimiter)"/>
7426
+ <xsl:with-param name="delimiter" select="$delimiter"/>
7427
+ </xsl:call-template>
7428
+ </xsl:when>
7429
+ <xsl:otherwise>
7430
+ <xsl:value-of select="$value"/>
7431
+ </xsl:otherwise>
7432
+ </xsl:choose>
7250
7433
  </xsl:template></xsl:stylesheet>