metanorma-itu 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -2090,6 +2090,10 @@
2090
2090
  <xsl:text>Édition </xsl:text>
2091
2091
  </title-edition>
2092
2092
 
2093
+ <title-edition lang="ru">
2094
+ <xsl:text>Издание </xsl:text>
2095
+ </title-edition>
2096
+
2093
2097
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
2094
2098
  <title-toc lang="en">
2095
2099
 
@@ -2116,7 +2120,11 @@
2116
2120
 
2117
2121
 
2118
2122
 
2119
- </title-part>
2123
+ </title-part>
2124
+ <title-part lang="ru">
2125
+
2126
+
2127
+ </title-part>
2120
2128
  <title-part lang="zh">第 # 部分:</title-part>
2121
2129
 
2122
2130
  <title-subpart lang="en">Sub-part #</title-subpart>
@@ -2132,6 +2140,7 @@
2132
2140
 
2133
2141
  <title-summary lang="en">Summary</title-summary>
2134
2142
 
2143
+ <title-continued lang="ru">(продолжение)</title-continued>
2135
2144
  <title-continued lang="en">(continued)</title-continued>
2136
2145
  <title-continued lang="fr">(continué)</title-continued>
2137
2146
 
@@ -2862,13 +2871,19 @@
2862
2871
  </xsl:attribute-set><xsl:variable name="color-added-text">
2863
2872
  <xsl:text>rgb(0, 255, 0)</xsl:text>
2864
2873
  </xsl:variable><xsl:attribute-set name="add-style">
2865
- <xsl:attribute name="color">red</xsl:attribute>
2866
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
2867
- <!-- <xsl:attribute name="color">black</xsl:attribute>
2868
- <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
2869
- <xsl:attribute name="padding-top">1mm</xsl:attribute>
2870
- <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
2871
- </xsl:attribute-set><xsl:variable name="color-deleted-text">
2874
+
2875
+ <xsl:attribute name="color">red</xsl:attribute>
2876
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
2877
+ <!-- <xsl:attribute name="color">black</xsl:attribute>
2878
+ <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
2879
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
2880
+ <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
2881
+
2882
+ </xsl:attribute-set><xsl:variable name="add-style">
2883
+ <add-style xsl:use-attribute-sets="add-style"/>
2884
+ </xsl:variable><xsl:template name="append_add-style">
2885
+ <xsl:copy-of select="xalan:nodeset($add-style)/add-style/@*"/>
2886
+ </xsl:template><xsl:variable name="color-deleted-text">
2872
2887
  <xsl:text>red</xsl:text>
2873
2888
  </xsl:variable><xsl:attribute-set name="del-style">
2874
2889
  <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
@@ -3295,14 +3310,42 @@
3295
3310
 
3296
3311
 
3297
3312
  </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">
3313
+ <xsl:variable name="nodes_preface_">
3314
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
3315
+ <node id="{@id}"/>
3316
+ </xsl:for-each>
3317
+ </xsl:variable>
3318
+ <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
3319
+
3298
3320
  <xsl:for-each select="/*/*[local-name()='preface']/*">
3299
3321
  <xsl:sort select="@displayorder" data-type="number"/>
3322
+
3323
+ <!-- process Section's title -->
3324
+ <xsl:variable name="preceding-sibling_id" select="$nodes_preface/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
3325
+ <xsl:if test="$preceding-sibling_id != ''">
3326
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="contents_no_displayorder"/>
3327
+ </xsl:if>
3328
+
3300
3329
  <xsl:apply-templates select="." mode="contents"/>
3301
3330
  </xsl:for-each>
3302
3331
  </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
3303
3332
 
3333
+ <xsl:variable name="nodes_sections_">
3334
+ <xsl:for-each select="/*/*[local-name()='sections']/*">
3335
+ <node id="{@id}"/>
3336
+ </xsl:for-each>
3337
+ </xsl:variable>
3338
+ <xsl:variable name="nodes_sections" select="xalan:nodeset($nodes_sections_)"/>
3339
+
3304
3340
  <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']]">
3305
3341
  <xsl:sort select="@displayorder" data-type="number"/>
3342
+
3343
+ <!-- process Section's title -->
3344
+ <xsl:variable name="preceding-sibling_id" select="$nodes_sections/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
3345
+ <xsl:if test="$preceding-sibling_id != ''">
3346
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="contents_no_displayorder"/>
3347
+ </xsl:if>
3348
+
3306
3349
  <xsl:apply-templates select="." mode="contents"/>
3307
3350
  </xsl:for-each>
3308
3351
 
@@ -3454,7 +3497,7 @@
3454
3497
  </xsl:call-template>
3455
3498
  </xsl:if>
3456
3499
  </xsl:variable>
3457
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
3500
+ <!-- DEBUG colwidths=<xsl:copy-of select="$colwidths"/> -->
3458
3501
 
3459
3502
 
3460
3503
  <xsl:variable name="margin-side">
@@ -3722,7 +3765,7 @@
3722
3765
  <!-- <xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/> -->
3723
3766
  <!-- 2009 thinspace -->
3724
3767
  <!-- <xsl:with-param name="text" select="translate(normalize-space($td_text),'- —:', ' ')"/> -->
3725
- <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '', ' '))"/>
3768
+ <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
3726
3769
  </xsl:call-template>
3727
3770
  </xsl:variable>
3728
3771
  <xsl:variable name="max_length">
@@ -5418,6 +5461,9 @@
5418
5461
  </fo:inline>
5419
5462
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
5420
5463
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
5464
+ <xsl:if test="parent::*[local-name() = 'add']">
5465
+ <xsl:call-template name="append_add-style"/>
5466
+ </xsl:if>
5421
5467
  <xsl:apply-templates/>
5422
5468
  </fo:basic-link>
5423
5469
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -5519,6 +5565,13 @@
5519
5565
 
5520
5566
 
5521
5567
 
5568
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
5569
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
5570
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
5571
+ <xsl:call-template name="append_add-style"/>
5572
+ </xsl:if>
5573
+
5574
+
5522
5575
  <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
5523
5576
  <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
5524
5577
  <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
@@ -5557,6 +5610,12 @@
5557
5610
 
5558
5611
 
5559
5612
 
5613
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
5614
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
5615
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
5616
+ <xsl:call-template name="append_add-style"/>
5617
+ </xsl:if>
5618
+
5560
5619
  <xsl:apply-templates select="*[local-name() = 'name']"/>
5561
5620
 
5562
5621
  </fo:inline>
@@ -5610,6 +5669,7 @@
5610
5669
  </fo:block>
5611
5670
  </xsl:template><xsl:template match="*[local-name() = 'term']">
5612
5671
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
5672
+
5613
5673
 
5614
5674
 
5615
5675
 
@@ -6046,7 +6106,11 @@
6046
6106
  <xsl:value-of select="."/>
6047
6107
  </xsl:template><xsl:template match="node()" mode="contents">
6048
6108
  <xsl:apply-templates mode="contents"/>
6049
- </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" mode="contents">
6109
+ </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">
6110
+ <xsl:call-template name="contents_section-title"/>
6111
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'section-title']" mode="contents_in_clause">
6112
+ <xsl:call-template name="contents_section-title"/>
6113
+ </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">
6050
6114
  <xsl:variable name="level">
6051
6115
  <xsl:call-template name="getLevel">
6052
6116
  <xsl:with-param name="depth" select="@depth"/>
@@ -7363,7 +7427,7 @@
7363
7427
 
7364
7428
 
7365
7429
 
7366
-
7430
+
7367
7431
  <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
7368
7432
  </fo:list-block>
7369
7433
  <!-- <xsl:for-each select="./iho:note">
@@ -7381,6 +7445,11 @@
7381
7445
 
7382
7446
 
7383
7447
 
7448
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
7449
+ <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
7450
+ <xsl:call-template name="append_add-style"/>
7451
+ </xsl:if>
7452
+
7384
7453
  <xsl:call-template name="getListItemFormat"/>
7385
7454
  </fo:block>
7386
7455
  </fo:list-item-label>
@@ -8486,53 +8555,153 @@
8486
8555
  <xsl:param name="first"/>
8487
8556
  <xsl:if test="$number != ''">
8488
8557
  <xsl:variable name="words">
8489
- <words>
8490
- <word cardinal="1">One-</word>
8491
- <word ordinal="1">First </word>
8492
- <word cardinal="2">Two-</word>
8493
- <word ordinal="2">Second </word>
8494
- <word cardinal="3">Three-</word>
8495
- <word ordinal="3">Third </word>
8496
- <word cardinal="4">Four-</word>
8497
- <word ordinal="4">Fourth </word>
8498
- <word cardinal="5">Five-</word>
8499
- <word ordinal="5">Fifth </word>
8500
- <word cardinal="6">Six-</word>
8501
- <word ordinal="6">Sixth </word>
8502
- <word cardinal="7">Seven-</word>
8503
- <word ordinal="7">Seventh </word>
8504
- <word cardinal="8">Eight-</word>
8505
- <word ordinal="8">Eighth </word>
8506
- <word cardinal="9">Nine-</word>
8507
- <word ordinal="9">Ninth </word>
8508
- <word ordinal="10">Tenth </word>
8509
- <word ordinal="11">Eleventh </word>
8510
- <word ordinal="12">Twelfth </word>
8511
- <word ordinal="13">Thirteenth </word>
8512
- <word ordinal="14">Fourteenth </word>
8513
- <word ordinal="15">Fifteenth </word>
8514
- <word ordinal="16">Sixteenth </word>
8515
- <word ordinal="17">Seventeenth </word>
8516
- <word ordinal="18">Eighteenth </word>
8517
- <word ordinal="19">Nineteenth </word>
8518
- <word cardinal="20">Twenty-</word>
8519
- <word ordinal="20">Twentieth </word>
8520
- <word cardinal="30">Thirty-</word>
8521
- <word ordinal="30">Thirtieth </word>
8522
- <word cardinal="40">Forty-</word>
8523
- <word ordinal="40">Fortieth </word>
8524
- <word cardinal="50">Fifty-</word>
8525
- <word ordinal="50">Fiftieth </word>
8526
- <word cardinal="60">Sixty-</word>
8527
- <word ordinal="60">Sixtieth </word>
8528
- <word cardinal="70">Seventy-</word>
8529
- <word ordinal="70">Seventieth </word>
8530
- <word cardinal="80">Eighty-</word>
8531
- <word ordinal="80">Eightieth </word>
8532
- <word cardinal="90">Ninety-</word>
8533
- <word ordinal="90">Ninetieth </word>
8534
- <word cardinal="100">Hundred-</word>
8535
- <word ordinal="100">Hundredth </word>
8558
+ <words>
8559
+ <xsl:choose>
8560
+ <xsl:when test="$lang = 'fr'"> <!-- https://en.wiktionary.org/wiki/Appendix:French_numbers -->
8561
+ <word cardinal="1">Une-</word>
8562
+ <word ordinal="1">Première </word>
8563
+ <word cardinal="2">Deux-</word>
8564
+ <word ordinal="2">Seconde </word>
8565
+ <word cardinal="3">Trois-</word>
8566
+ <word ordinal="3">Tierce </word>
8567
+ <word cardinal="4">Quatre-</word>
8568
+ <word ordinal="4">Quatrième </word>
8569
+ <word cardinal="5">Cinq-</word>
8570
+ <word ordinal="5">Cinquième </word>
8571
+ <word cardinal="6">Six-</word>
8572
+ <word ordinal="6">Sixième </word>
8573
+ <word cardinal="7">Sept-</word>
8574
+ <word ordinal="7">Septième </word>
8575
+ <word cardinal="8">Huit-</word>
8576
+ <word ordinal="8">Huitième </word>
8577
+ <word cardinal="9">Neuf-</word>
8578
+ <word ordinal="9">Neuvième </word>
8579
+ <word ordinal="10">Dixième </word>
8580
+ <word ordinal="11">Onzième </word>
8581
+ <word ordinal="12">Douzième </word>
8582
+ <word ordinal="13">Treizième </word>
8583
+ <word ordinal="14">Quatorzième </word>
8584
+ <word ordinal="15">Quinzième </word>
8585
+ <word ordinal="16">Seizième </word>
8586
+ <word ordinal="17">Dix-septième </word>
8587
+ <word ordinal="18">Dix-huitième </word>
8588
+ <word ordinal="19">Dix-neuvième </word>
8589
+ <word cardinal="20">Vingt-</word>
8590
+ <word ordinal="20">Vingtième </word>
8591
+ <word cardinal="30">Trente-</word>
8592
+ <word ordinal="30">Trentième </word>
8593
+ <word cardinal="40">Quarante-</word>
8594
+ <word ordinal="40">Quarantième </word>
8595
+ <word cardinal="50">Cinquante-</word>
8596
+ <word ordinal="50">Cinquantième </word>
8597
+ <word cardinal="60">Soixante-</word>
8598
+ <word ordinal="60">Soixantième </word>
8599
+ <word cardinal="70">Septante-</word>
8600
+ <word ordinal="70">Septantième </word>
8601
+ <word cardinal="80">Huitante-</word>
8602
+ <word ordinal="80">Huitantième </word>
8603
+ <word cardinal="90">Nonante-</word>
8604
+ <word ordinal="90">Nonantième </word>
8605
+ <word cardinal="100">Cent-</word>
8606
+ <word ordinal="100">Centième </word>
8607
+ </xsl:when>
8608
+ <xsl:when test="$lang = 'ru'">
8609
+ <word cardinal="1">Одна-</word>
8610
+ <word ordinal="1">Первое </word>
8611
+ <word cardinal="2">Две-</word>
8612
+ <word ordinal="2">Второе </word>
8613
+ <word cardinal="3">Три-</word>
8614
+ <word ordinal="3">Третье </word>
8615
+ <word cardinal="4">Четыре-</word>
8616
+ <word ordinal="4">Четвертое </word>
8617
+ <word cardinal="5">Пять-</word>
8618
+ <word ordinal="5">Пятое </word>
8619
+ <word cardinal="6">Шесть-</word>
8620
+ <word ordinal="6">Шестое </word>
8621
+ <word cardinal="7">Семь-</word>
8622
+ <word ordinal="7">Седьмое </word>
8623
+ <word cardinal="8">Восемь-</word>
8624
+ <word ordinal="8">Восьмое </word>
8625
+ <word cardinal="9">Девять-</word>
8626
+ <word ordinal="9">Девятое </word>
8627
+ <word ordinal="10">Десятое </word>
8628
+ <word ordinal="11">Одиннадцатое </word>
8629
+ <word ordinal="12">Двенадцатое </word>
8630
+ <word ordinal="13">Тринадцатое </word>
8631
+ <word ordinal="14">Четырнадцатое </word>
8632
+ <word ordinal="15">Пятнадцатое </word>
8633
+ <word ordinal="16">Шестнадцатое </word>
8634
+ <word ordinal="17">Семнадцатое </word>
8635
+ <word ordinal="18">Восемнадцатое </word>
8636
+ <word ordinal="19">Девятнадцатое </word>
8637
+ <word cardinal="20">Двадцать-</word>
8638
+ <word ordinal="20">Двадцатое </word>
8639
+ <word cardinal="30">Тридцать-</word>
8640
+ <word ordinal="30">Тридцатое </word>
8641
+ <word cardinal="40">Сорок-</word>
8642
+ <word ordinal="40">Сороковое </word>
8643
+ <word cardinal="50">Пятьдесят-</word>
8644
+ <word ordinal="50">Пятидесятое </word>
8645
+ <word cardinal="60">Шестьдесят-</word>
8646
+ <word ordinal="60">Шестидесятое </word>
8647
+ <word cardinal="70">Семьдесят-</word>
8648
+ <word ordinal="70">Семидесятое </word>
8649
+ <word cardinal="80">Восемьдесят-</word>
8650
+ <word ordinal="80">Восьмидесятое </word>
8651
+ <word cardinal="90">Девяносто-</word>
8652
+ <word ordinal="90">Девяностое </word>
8653
+ <word cardinal="100">Сто-</word>
8654
+ <word ordinal="100">Сотое </word>
8655
+ </xsl:when>
8656
+ <xsl:otherwise> <!-- default english -->
8657
+ <word cardinal="1">One-</word>
8658
+ <word ordinal="1">First </word>
8659
+ <word cardinal="2">Two-</word>
8660
+ <word ordinal="2">Second </word>
8661
+ <word cardinal="3">Three-</word>
8662
+ <word ordinal="3">Third </word>
8663
+ <word cardinal="4">Four-</word>
8664
+ <word ordinal="4">Fourth </word>
8665
+ <word cardinal="5">Five-</word>
8666
+ <word ordinal="5">Fifth </word>
8667
+ <word cardinal="6">Six-</word>
8668
+ <word ordinal="6">Sixth </word>
8669
+ <word cardinal="7">Seven-</word>
8670
+ <word ordinal="7">Seventh </word>
8671
+ <word cardinal="8">Eight-</word>
8672
+ <word ordinal="8">Eighth </word>
8673
+ <word cardinal="9">Nine-</word>
8674
+ <word ordinal="9">Ninth </word>
8675
+ <word ordinal="10">Tenth </word>
8676
+ <word ordinal="11">Eleventh </word>
8677
+ <word ordinal="12">Twelfth </word>
8678
+ <word ordinal="13">Thirteenth </word>
8679
+ <word ordinal="14">Fourteenth </word>
8680
+ <word ordinal="15">Fifteenth </word>
8681
+ <word ordinal="16">Sixteenth </word>
8682
+ <word ordinal="17">Seventeenth </word>
8683
+ <word ordinal="18">Eighteenth </word>
8684
+ <word ordinal="19">Nineteenth </word>
8685
+ <word cardinal="20">Twenty-</word>
8686
+ <word ordinal="20">Twentieth </word>
8687
+ <word cardinal="30">Thirty-</word>
8688
+ <word ordinal="30">Thirtieth </word>
8689
+ <word cardinal="40">Forty-</word>
8690
+ <word ordinal="40">Fortieth </word>
8691
+ <word cardinal="50">Fifty-</word>
8692
+ <word ordinal="50">Fiftieth </word>
8693
+ <word cardinal="60">Sixty-</word>
8694
+ <word ordinal="60">Sixtieth </word>
8695
+ <word cardinal="70">Seventy-</word>
8696
+ <word ordinal="70">Seventieth </word>
8697
+ <word cardinal="80">Eighty-</word>
8698
+ <word ordinal="80">Eightieth </word>
8699
+ <word cardinal="90">Ninety-</word>
8700
+ <word ordinal="90">Ninetieth </word>
8701
+ <word cardinal="100">Hundred-</word>
8702
+ <word ordinal="100">Hundredth </word>
8703
+ </xsl:otherwise>
8704
+ </xsl:choose>
8536
8705
  </words>
8537
8706
  </xsl:variable>
8538
8707
 
@@ -8606,4 +8775,18 @@
8606
8775
  <xsl:otherwise>_</xsl:otherwise>
8607
8776
  </xsl:choose>
8608
8777
  </xsl:attribute>
8778
+ </xsl:template><xsl:template name="substring-after-last">
8779
+ <xsl:param name="value"/>
8780
+ <xsl:param name="delimiter"/>
8781
+ <xsl:choose>
8782
+ <xsl:when test="contains($value, $delimiter)">
8783
+ <xsl:call-template name="substring-after-last">
8784
+ <xsl:with-param name="value" select="substring-after($value, $delimiter)"/>
8785
+ <xsl:with-param name="delimiter" select="$delimiter"/>
8786
+ </xsl:call-template>
8787
+ </xsl:when>
8788
+ <xsl:otherwise>
8789
+ <xsl:value-of select="$value"/>
8790
+ </xsl:otherwise>
8791
+ </xsl:choose>
8609
8792
  </xsl:template></xsl:stylesheet>
@@ -16,11 +16,16 @@ module IsoDoc
16
16
  end
17
17
  end
18
18
 
19
- def annex_names(clause, num)
19
+ def annex_name_anchors(clause, num)
20
20
  lbl = annextype(clause)
21
- @anchors[clause["id"]] =
22
- { label: annex_name_lbl(clause, num), type: "clause",
23
- xref: l10n("#{lbl} #{num}"), level: 1, value: num }
21
+ { label: annex_name_lbl(clause, num),
22
+ elem: lbl,
23
+ type: "clause", value: num.to_s, level: 1,
24
+ xref: l10n("#{lbl} #{num}") }
25
+ end
26
+
27
+ def annex_names(clause, num)
28
+ @anchors[clause["id"]] = annex_name_anchors(clause, num)
24
29
  if a = single_annex_special_section(clause)
25
30
  annex_names1(a, num.to_s, 1)
26
31
  else
@@ -36,7 +41,7 @@ module IsoDoc
36
41
 
37
42
  def annex_names1(clause, num, level)
38
43
  @anchors[clause["id"]] =
39
- { label: num,
44
+ { label: num, elem: @labels["annex_subclause"],
40
45
  xref: @doctype == "resolution" ? num : l10n("#{@labels['annex_subclause']} #{num}"),
41
46
  level: level, type: "clause" }
42
47
  i = Counter.new
@@ -65,7 +70,7 @@ module IsoDoc
65
70
  lbl = @doctype == "resolution" ? @labels["section"] : @labels["clause"]
66
71
  @anchors[clause["id"]] =
67
72
  { label: num.print, xref: l10n("#{lbl} #{num.print}"),
68
- level: lvl, type: "clause" }
73
+ level: lvl, type: "clause", elem: lbl }
69
74
  i = Counter.new
70
75
  clause.xpath(ns(SUBCLAUSES)).each do |c|
71
76
  i.increment(c)
@@ -77,6 +82,7 @@ module IsoDoc
77
82
  def section_names1(clause, num, level)
78
83
  @anchors[clause["id"]] =
79
84
  { label: num, level: level,
85
+ elem: @doctype == "resolution" ? "" : @labels["clause"],
80
86
  xref: @doctype == "resolution" ? num : l10n("#{@labels['clause']} #{num}") }
81
87
  i = Counter.new
82
88
  clause.xpath(ns(SUBCLAUSES)).each do |c|
@@ -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 ITU
3
- VERSION = "2.0.3".freeze
3
+ VERSION = "2.0.4".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-itu
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.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