metanorma-itu 2.3.0 → 2.3.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd7cb2a16590fe04f51e162637b7fc1be2b6e7b403d04118e8c82b2ad0e4eb66
4
- data.tar.gz: 35a5dd96771972460f80fc0f0a83f4c6610b59bd659b08c771b89405ca719e62
3
+ metadata.gz: b485ec959d83220ae57c71e774e12136e823013c8c5ba41042a56fa03d477496
4
+ data.tar.gz: 7467e85568f8ffa7d421bed9a1213c2b3c86e2ac210868bd37f99c449aab8980
5
5
  SHA512:
6
- metadata.gz: 78896c795984c2999c194e6cb21546880ed1df41cbabe7082f773d5086c1f354f5d342eec07f7ae697dd21ab9848aee3b035d4047db3af3c1c4efc9296ccf10f
7
- data.tar.gz: 53894e2251b8a69d8c4ff9c37789b600b18907c8a718ac9a5dde34e351e4e36b7b27c1ae40b3808bc885dfa7d1b7cf458d2e3a0ca43474a9ec341bd07760cae8
6
+ metadata.gz: 613b74c11bd22d589f90f020d7bd848fa6e9e9a1b89c08f9b12f7e4084013970537508119c36c33e2f2c87135e7f060a143e21487d8a5d34cf39b56f95dab226
7
+ data.tar.gz: 1fab3d12d67a9a5f6c7f84706d935cc60096b0dc0db24ccfb2ae07767a4a5f27ba4201584983ecbaa6c12f0e5b88cdb4a152640b9121cc63179d343a6782d229
@@ -2491,11 +2491,26 @@
2491
2491
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
2492
2492
  </xsl:if>
2493
2493
 
2494
- <xsl:value-of select="."/>
2494
+ <xsl:variable name="font_family" select="."/>
2495
2495
 
2496
- <xsl:if test="$additional_fonts != ''">
2497
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2498
- </xsl:if>
2496
+ <xsl:choose>
2497
+ <xsl:when test="$additional_fonts = ''">
2498
+ <xsl:value-of select="$font_family"/>
2499
+ </xsl:when>
2500
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
2501
+ <xsl:choose>
2502
+ <xsl:when test="contains($font_family, ',')">
2503
+ <xsl:value-of select="substring-before($font_family, ',')"/>
2504
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2505
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
2506
+ </xsl:when>
2507
+ <xsl:otherwise>
2508
+ <xsl:value-of select="$font_family"/>
2509
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2510
+ </xsl:otherwise>
2511
+ </xsl:choose>
2512
+ </xsl:otherwise>
2513
+ </xsl:choose>
2499
2514
  </xsl:attribute>
2500
2515
  </xsl:when>
2501
2516
  <xsl:otherwise>
@@ -5057,21 +5072,21 @@
5057
5072
 
5058
5073
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
5059
5074
 
5060
- <fo:block xsl:use-attribute-sets="table-note-style">
5075
+ <fo:block xsl:use-attribute-sets="table-note-style">
5061
5076
 
5062
- <xsl:call-template name="refine_table-note-style"/>
5077
+ <xsl:call-template name="refine_table-note-style"/>
5063
5078
 
5064
- <!-- Table's note/example name (NOTE, for example) -->
5065
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
5079
+ <!-- Table's note/example name (NOTE, for example) -->
5080
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
5066
5081
 
5067
- <xsl:call-template name="refine_table-note-name-style"/>
5082
+ <xsl:call-template name="refine_table-note-name-style"/>
5068
5083
 
5069
- <xsl:apply-templates select="*[local-name() = 'name']"/>
5084
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
5070
5085
 
5071
- </fo:inline>
5086
+ </fo:inline>
5072
5087
 
5073
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5074
- </fo:block>
5088
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5089
+ </fo:block>
5075
5090
 
5076
5091
  </xsl:template> <!-- table/note -->
5077
5092
 
@@ -8209,8 +8224,12 @@
8209
8224
  <xsl:variable name="isAdded" select="../@added"/>
8210
8225
  <xsl:variable name="isDeleted" select="../@deleted"/>
8211
8226
  <xsl:choose>
8212
- <xsl:when test="ancestor::*[local-name() = 'title']">
8227
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
8213
8228
  <fo:inline padding-left="1mm" padding-right="1mm">
8229
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
8230
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
8231
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
8232
+ </xsl:if>
8214
8233
  <xsl:variable name="src">
8215
8234
  <xsl:call-template name="image_src"/>
8216
8235
  </xsl:variable>
@@ -8243,7 +8262,7 @@
8243
8262
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
8244
8263
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
8245
8264
 
8246
- <xsl:if test="@width != '' and @width != 'auto'">
8265
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
8247
8266
  <xsl:attribute name="width">
8248
8267
  <xsl:value-of select="@width"/>
8249
8268
  </xsl:attribute>
@@ -2491,11 +2491,26 @@
2491
2491
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
2492
2492
  </xsl:if>
2493
2493
 
2494
- <xsl:value-of select="."/>
2494
+ <xsl:variable name="font_family" select="."/>
2495
2495
 
2496
- <xsl:if test="$additional_fonts != ''">
2497
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2498
- </xsl:if>
2496
+ <xsl:choose>
2497
+ <xsl:when test="$additional_fonts = ''">
2498
+ <xsl:value-of select="$font_family"/>
2499
+ </xsl:when>
2500
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
2501
+ <xsl:choose>
2502
+ <xsl:when test="contains($font_family, ',')">
2503
+ <xsl:value-of select="substring-before($font_family, ',')"/>
2504
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2505
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
2506
+ </xsl:when>
2507
+ <xsl:otherwise>
2508
+ <xsl:value-of select="$font_family"/>
2509
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2510
+ </xsl:otherwise>
2511
+ </xsl:choose>
2512
+ </xsl:otherwise>
2513
+ </xsl:choose>
2499
2514
  </xsl:attribute>
2500
2515
  </xsl:when>
2501
2516
  <xsl:otherwise>
@@ -5057,21 +5072,21 @@
5057
5072
 
5058
5073
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
5059
5074
 
5060
- <fo:block xsl:use-attribute-sets="table-note-style">
5075
+ <fo:block xsl:use-attribute-sets="table-note-style">
5061
5076
 
5062
- <xsl:call-template name="refine_table-note-style"/>
5077
+ <xsl:call-template name="refine_table-note-style"/>
5063
5078
 
5064
- <!-- Table's note/example name (NOTE, for example) -->
5065
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
5079
+ <!-- Table's note/example name (NOTE, for example) -->
5080
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
5066
5081
 
5067
- <xsl:call-template name="refine_table-note-name-style"/>
5082
+ <xsl:call-template name="refine_table-note-name-style"/>
5068
5083
 
5069
- <xsl:apply-templates select="*[local-name() = 'name']"/>
5084
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
5070
5085
 
5071
- </fo:inline>
5086
+ </fo:inline>
5072
5087
 
5073
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5074
- </fo:block>
5088
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5089
+ </fo:block>
5075
5090
 
5076
5091
  </xsl:template> <!-- table/note -->
5077
5092
 
@@ -8209,8 +8224,12 @@
8209
8224
  <xsl:variable name="isAdded" select="../@added"/>
8210
8225
  <xsl:variable name="isDeleted" select="../@deleted"/>
8211
8226
  <xsl:choose>
8212
- <xsl:when test="ancestor::*[local-name() = 'title']">
8227
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
8213
8228
  <fo:inline padding-left="1mm" padding-right="1mm">
8229
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
8230
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
8231
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
8232
+ </xsl:if>
8214
8233
  <xsl:variable name="src">
8215
8234
  <xsl:call-template name="image_src"/>
8216
8235
  </xsl:variable>
@@ -8243,7 +8262,7 @@
8243
8262
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
8244
8263
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
8245
8264
 
8246
- <xsl:if test="@width != '' and @width != 'auto'">
8265
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
8247
8266
  <xsl:attribute name="width">
8248
8267
  <xsl:value-of select="@width"/>
8249
8268
  </xsl:attribute>
@@ -2491,11 +2491,26 @@
2491
2491
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
2492
2492
  </xsl:if>
2493
2493
 
2494
- <xsl:value-of select="."/>
2494
+ <xsl:variable name="font_family" select="."/>
2495
2495
 
2496
- <xsl:if test="$additional_fonts != ''">
2497
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2498
- </xsl:if>
2496
+ <xsl:choose>
2497
+ <xsl:when test="$additional_fonts = ''">
2498
+ <xsl:value-of select="$font_family"/>
2499
+ </xsl:when>
2500
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
2501
+ <xsl:choose>
2502
+ <xsl:when test="contains($font_family, ',')">
2503
+ <xsl:value-of select="substring-before($font_family, ',')"/>
2504
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2505
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
2506
+ </xsl:when>
2507
+ <xsl:otherwise>
2508
+ <xsl:value-of select="$font_family"/>
2509
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2510
+ </xsl:otherwise>
2511
+ </xsl:choose>
2512
+ </xsl:otherwise>
2513
+ </xsl:choose>
2499
2514
  </xsl:attribute>
2500
2515
  </xsl:when>
2501
2516
  <xsl:otherwise>
@@ -5057,21 +5072,21 @@
5057
5072
 
5058
5073
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
5059
5074
 
5060
- <fo:block xsl:use-attribute-sets="table-note-style">
5075
+ <fo:block xsl:use-attribute-sets="table-note-style">
5061
5076
 
5062
- <xsl:call-template name="refine_table-note-style"/>
5077
+ <xsl:call-template name="refine_table-note-style"/>
5063
5078
 
5064
- <!-- Table's note/example name (NOTE, for example) -->
5065
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
5079
+ <!-- Table's note/example name (NOTE, for example) -->
5080
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
5066
5081
 
5067
- <xsl:call-template name="refine_table-note-name-style"/>
5082
+ <xsl:call-template name="refine_table-note-name-style"/>
5068
5083
 
5069
- <xsl:apply-templates select="*[local-name() = 'name']"/>
5084
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
5070
5085
 
5071
- </fo:inline>
5086
+ </fo:inline>
5072
5087
 
5073
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5074
- </fo:block>
5088
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5089
+ </fo:block>
5075
5090
 
5076
5091
  </xsl:template> <!-- table/note -->
5077
5092
 
@@ -8209,8 +8224,12 @@
8209
8224
  <xsl:variable name="isAdded" select="../@added"/>
8210
8225
  <xsl:variable name="isDeleted" select="../@deleted"/>
8211
8226
  <xsl:choose>
8212
- <xsl:when test="ancestor::*[local-name() = 'title']">
8227
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
8213
8228
  <fo:inline padding-left="1mm" padding-right="1mm">
8229
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
8230
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
8231
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
8232
+ </xsl:if>
8214
8233
  <xsl:variable name="src">
8215
8234
  <xsl:call-template name="image_src"/>
8216
8235
  </xsl:variable>
@@ -8243,7 +8262,7 @@
8243
8262
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
8244
8263
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
8245
8264
 
8246
- <xsl:if test="@width != '' and @width != 'auto'">
8265
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
8247
8266
  <xsl:attribute name="width">
8248
8267
  <xsl:value-of select="@width"/>
8249
8268
  </xsl:attribute>
@@ -2491,11 +2491,26 @@
2491
2491
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
2492
2492
  </xsl:if>
2493
2493
 
2494
- <xsl:value-of select="."/>
2494
+ <xsl:variable name="font_family" select="."/>
2495
2495
 
2496
- <xsl:if test="$additional_fonts != ''">
2497
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2498
- </xsl:if>
2496
+ <xsl:choose>
2497
+ <xsl:when test="$additional_fonts = ''">
2498
+ <xsl:value-of select="$font_family"/>
2499
+ </xsl:when>
2500
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
2501
+ <xsl:choose>
2502
+ <xsl:when test="contains($font_family, ',')">
2503
+ <xsl:value-of select="substring-before($font_family, ',')"/>
2504
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2505
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
2506
+ </xsl:when>
2507
+ <xsl:otherwise>
2508
+ <xsl:value-of select="$font_family"/>
2509
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2510
+ </xsl:otherwise>
2511
+ </xsl:choose>
2512
+ </xsl:otherwise>
2513
+ </xsl:choose>
2499
2514
  </xsl:attribute>
2500
2515
  </xsl:when>
2501
2516
  <xsl:otherwise>
@@ -5057,21 +5072,21 @@
5057
5072
 
5058
5073
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
5059
5074
 
5060
- <fo:block xsl:use-attribute-sets="table-note-style">
5075
+ <fo:block xsl:use-attribute-sets="table-note-style">
5061
5076
 
5062
- <xsl:call-template name="refine_table-note-style"/>
5077
+ <xsl:call-template name="refine_table-note-style"/>
5063
5078
 
5064
- <!-- Table's note/example name (NOTE, for example) -->
5065
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
5079
+ <!-- Table's note/example name (NOTE, for example) -->
5080
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
5066
5081
 
5067
- <xsl:call-template name="refine_table-note-name-style"/>
5082
+ <xsl:call-template name="refine_table-note-name-style"/>
5068
5083
 
5069
- <xsl:apply-templates select="*[local-name() = 'name']"/>
5084
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
5070
5085
 
5071
- </fo:inline>
5086
+ </fo:inline>
5072
5087
 
5073
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5074
- </fo:block>
5088
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5089
+ </fo:block>
5075
5090
 
5076
5091
  </xsl:template> <!-- table/note -->
5077
5092
 
@@ -8209,8 +8224,12 @@
8209
8224
  <xsl:variable name="isAdded" select="../@added"/>
8210
8225
  <xsl:variable name="isDeleted" select="../@deleted"/>
8211
8226
  <xsl:choose>
8212
- <xsl:when test="ancestor::*[local-name() = 'title']">
8227
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
8213
8228
  <fo:inline padding-left="1mm" padding-right="1mm">
8229
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
8230
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
8231
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
8232
+ </xsl:if>
8214
8233
  <xsl:variable name="src">
8215
8234
  <xsl:call-template name="image_src"/>
8216
8235
  </xsl:variable>
@@ -8243,7 +8262,7 @@
8243
8262
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
8244
8263
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
8245
8264
 
8246
- <xsl:if test="@width != '' and @width != 'auto'">
8265
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
8247
8266
  <xsl:attribute name="width">
8248
8267
  <xsl:value-of select="@width"/>
8249
8268
  </xsl:attribute>
@@ -2491,11 +2491,26 @@
2491
2491
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
2492
2492
  </xsl:if>
2493
2493
 
2494
- <xsl:value-of select="."/>
2494
+ <xsl:variable name="font_family" select="."/>
2495
2495
 
2496
- <xsl:if test="$additional_fonts != ''">
2497
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2498
- </xsl:if>
2496
+ <xsl:choose>
2497
+ <xsl:when test="$additional_fonts = ''">
2498
+ <xsl:value-of select="$font_family"/>
2499
+ </xsl:when>
2500
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
2501
+ <xsl:choose>
2502
+ <xsl:when test="contains($font_family, ',')">
2503
+ <xsl:value-of select="substring-before($font_family, ',')"/>
2504
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2505
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
2506
+ </xsl:when>
2507
+ <xsl:otherwise>
2508
+ <xsl:value-of select="$font_family"/>
2509
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2510
+ </xsl:otherwise>
2511
+ </xsl:choose>
2512
+ </xsl:otherwise>
2513
+ </xsl:choose>
2499
2514
  </xsl:attribute>
2500
2515
  </xsl:when>
2501
2516
  <xsl:otherwise>
@@ -5057,21 +5072,21 @@
5057
5072
 
5058
5073
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
5059
5074
 
5060
- <fo:block xsl:use-attribute-sets="table-note-style">
5075
+ <fo:block xsl:use-attribute-sets="table-note-style">
5061
5076
 
5062
- <xsl:call-template name="refine_table-note-style"/>
5077
+ <xsl:call-template name="refine_table-note-style"/>
5063
5078
 
5064
- <!-- Table's note/example name (NOTE, for example) -->
5065
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
5079
+ <!-- Table's note/example name (NOTE, for example) -->
5080
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
5066
5081
 
5067
- <xsl:call-template name="refine_table-note-name-style"/>
5082
+ <xsl:call-template name="refine_table-note-name-style"/>
5068
5083
 
5069
- <xsl:apply-templates select="*[local-name() = 'name']"/>
5084
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
5070
5085
 
5071
- </fo:inline>
5086
+ </fo:inline>
5072
5087
 
5073
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5074
- </fo:block>
5088
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5089
+ </fo:block>
5075
5090
 
5076
5091
  </xsl:template> <!-- table/note -->
5077
5092
 
@@ -8209,8 +8224,12 @@
8209
8224
  <xsl:variable name="isAdded" select="../@added"/>
8210
8225
  <xsl:variable name="isDeleted" select="../@deleted"/>
8211
8226
  <xsl:choose>
8212
- <xsl:when test="ancestor::*[local-name() = 'title']">
8227
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
8213
8228
  <fo:inline padding-left="1mm" padding-right="1mm">
8229
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
8230
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
8231
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
8232
+ </xsl:if>
8214
8233
  <xsl:variable name="src">
8215
8234
  <xsl:call-template name="image_src"/>
8216
8235
  </xsl:variable>
@@ -8243,7 +8262,7 @@
8243
8262
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
8244
8263
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
8245
8264
 
8246
- <xsl:if test="@width != '' and @width != 'auto'">
8265
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
8247
8266
  <xsl:attribute name="width">
8248
8267
  <xsl:value-of select="@width"/>
8249
8268
  </xsl:attribute>
@@ -2491,11 +2491,26 @@
2491
2491
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
2492
2492
  </xsl:if>
2493
2493
 
2494
- <xsl:value-of select="."/>
2494
+ <xsl:variable name="font_family" select="."/>
2495
2495
 
2496
- <xsl:if test="$additional_fonts != ''">
2497
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2498
- </xsl:if>
2496
+ <xsl:choose>
2497
+ <xsl:when test="$additional_fonts = ''">
2498
+ <xsl:value-of select="$font_family"/>
2499
+ </xsl:when>
2500
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
2501
+ <xsl:choose>
2502
+ <xsl:when test="contains($font_family, ',')">
2503
+ <xsl:value-of select="substring-before($font_family, ',')"/>
2504
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2505
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
2506
+ </xsl:when>
2507
+ <xsl:otherwise>
2508
+ <xsl:value-of select="$font_family"/>
2509
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2510
+ </xsl:otherwise>
2511
+ </xsl:choose>
2512
+ </xsl:otherwise>
2513
+ </xsl:choose>
2499
2514
  </xsl:attribute>
2500
2515
  </xsl:when>
2501
2516
  <xsl:otherwise>
@@ -5057,21 +5072,21 @@
5057
5072
 
5058
5073
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
5059
5074
 
5060
- <fo:block xsl:use-attribute-sets="table-note-style">
5075
+ <fo:block xsl:use-attribute-sets="table-note-style">
5061
5076
 
5062
- <xsl:call-template name="refine_table-note-style"/>
5077
+ <xsl:call-template name="refine_table-note-style"/>
5063
5078
 
5064
- <!-- Table's note/example name (NOTE, for example) -->
5065
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
5079
+ <!-- Table's note/example name (NOTE, for example) -->
5080
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
5066
5081
 
5067
- <xsl:call-template name="refine_table-note-name-style"/>
5082
+ <xsl:call-template name="refine_table-note-name-style"/>
5068
5083
 
5069
- <xsl:apply-templates select="*[local-name() = 'name']"/>
5084
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
5070
5085
 
5071
- </fo:inline>
5086
+ </fo:inline>
5072
5087
 
5073
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5074
- </fo:block>
5088
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5089
+ </fo:block>
5075
5090
 
5076
5091
  </xsl:template> <!-- table/note -->
5077
5092
 
@@ -8209,8 +8224,12 @@
8209
8224
  <xsl:variable name="isAdded" select="../@added"/>
8210
8225
  <xsl:variable name="isDeleted" select="../@deleted"/>
8211
8226
  <xsl:choose>
8212
- <xsl:when test="ancestor::*[local-name() = 'title']">
8227
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
8213
8228
  <fo:inline padding-left="1mm" padding-right="1mm">
8229
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
8230
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
8231
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
8232
+ </xsl:if>
8214
8233
  <xsl:variable name="src">
8215
8234
  <xsl:call-template name="image_src"/>
8216
8235
  </xsl:variable>
@@ -8243,7 +8262,7 @@
8243
8262
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
8244
8263
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
8245
8264
 
8246
- <xsl:if test="@width != '' and @width != 'auto'">
8265
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
8247
8266
  <xsl:attribute name="width">
8248
8267
  <xsl:value-of select="@width"/>
8249
8268
  </xsl:attribute>
@@ -2491,11 +2491,26 @@
2491
2491
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
2492
2492
  </xsl:if>
2493
2493
 
2494
- <xsl:value-of select="."/>
2494
+ <xsl:variable name="font_family" select="."/>
2495
2495
 
2496
- <xsl:if test="$additional_fonts != ''">
2497
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2498
- </xsl:if>
2496
+ <xsl:choose>
2497
+ <xsl:when test="$additional_fonts = ''">
2498
+ <xsl:value-of select="$font_family"/>
2499
+ </xsl:when>
2500
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
2501
+ <xsl:choose>
2502
+ <xsl:when test="contains($font_family, ',')">
2503
+ <xsl:value-of select="substring-before($font_family, ',')"/>
2504
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2505
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
2506
+ </xsl:when>
2507
+ <xsl:otherwise>
2508
+ <xsl:value-of select="$font_family"/>
2509
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2510
+ </xsl:otherwise>
2511
+ </xsl:choose>
2512
+ </xsl:otherwise>
2513
+ </xsl:choose>
2499
2514
  </xsl:attribute>
2500
2515
  </xsl:when>
2501
2516
  <xsl:otherwise>
@@ -5057,21 +5072,21 @@
5057
5072
 
5058
5073
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
5059
5074
 
5060
- <fo:block xsl:use-attribute-sets="table-note-style">
5075
+ <fo:block xsl:use-attribute-sets="table-note-style">
5061
5076
 
5062
- <xsl:call-template name="refine_table-note-style"/>
5077
+ <xsl:call-template name="refine_table-note-style"/>
5063
5078
 
5064
- <!-- Table's note/example name (NOTE, for example) -->
5065
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
5079
+ <!-- Table's note/example name (NOTE, for example) -->
5080
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
5066
5081
 
5067
- <xsl:call-template name="refine_table-note-name-style"/>
5082
+ <xsl:call-template name="refine_table-note-name-style"/>
5068
5083
 
5069
- <xsl:apply-templates select="*[local-name() = 'name']"/>
5084
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
5070
5085
 
5071
- </fo:inline>
5086
+ </fo:inline>
5072
5087
 
5073
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5074
- </fo:block>
5088
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5089
+ </fo:block>
5075
5090
 
5076
5091
  </xsl:template> <!-- table/note -->
5077
5092
 
@@ -8209,8 +8224,12 @@
8209
8224
  <xsl:variable name="isAdded" select="../@added"/>
8210
8225
  <xsl:variable name="isDeleted" select="../@deleted"/>
8211
8226
  <xsl:choose>
8212
- <xsl:when test="ancestor::*[local-name() = 'title']">
8227
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
8213
8228
  <fo:inline padding-left="1mm" padding-right="1mm">
8229
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
8230
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
8231
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
8232
+ </xsl:if>
8214
8233
  <xsl:variable name="src">
8215
8234
  <xsl:call-template name="image_src"/>
8216
8235
  </xsl:variable>
@@ -8243,7 +8262,7 @@
8243
8262
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
8244
8263
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
8245
8264
 
8246
- <xsl:if test="@width != '' and @width != 'auto'">
8265
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
8247
8266
  <xsl:attribute name="width">
8248
8267
  <xsl:value-of select="@width"/>
8249
8268
  </xsl:attribute>
@@ -2491,11 +2491,26 @@
2491
2491
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
2492
2492
  </xsl:if>
2493
2493
 
2494
- <xsl:value-of select="."/>
2494
+ <xsl:variable name="font_family" select="."/>
2495
2495
 
2496
- <xsl:if test="$additional_fonts != ''">
2497
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2498
- </xsl:if>
2496
+ <xsl:choose>
2497
+ <xsl:when test="$additional_fonts = ''">
2498
+ <xsl:value-of select="$font_family"/>
2499
+ </xsl:when>
2500
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
2501
+ <xsl:choose>
2502
+ <xsl:when test="contains($font_family, ',')">
2503
+ <xsl:value-of select="substring-before($font_family, ',')"/>
2504
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2505
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
2506
+ </xsl:when>
2507
+ <xsl:otherwise>
2508
+ <xsl:value-of select="$font_family"/>
2509
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2510
+ </xsl:otherwise>
2511
+ </xsl:choose>
2512
+ </xsl:otherwise>
2513
+ </xsl:choose>
2499
2514
  </xsl:attribute>
2500
2515
  </xsl:when>
2501
2516
  <xsl:otherwise>
@@ -5057,21 +5072,21 @@
5057
5072
 
5058
5073
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
5059
5074
 
5060
- <fo:block xsl:use-attribute-sets="table-note-style">
5075
+ <fo:block xsl:use-attribute-sets="table-note-style">
5061
5076
 
5062
- <xsl:call-template name="refine_table-note-style"/>
5077
+ <xsl:call-template name="refine_table-note-style"/>
5063
5078
 
5064
- <!-- Table's note/example name (NOTE, for example) -->
5065
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
5079
+ <!-- Table's note/example name (NOTE, for example) -->
5080
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
5066
5081
 
5067
- <xsl:call-template name="refine_table-note-name-style"/>
5082
+ <xsl:call-template name="refine_table-note-name-style"/>
5068
5083
 
5069
- <xsl:apply-templates select="*[local-name() = 'name']"/>
5084
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
5070
5085
 
5071
- </fo:inline>
5086
+ </fo:inline>
5072
5087
 
5073
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5074
- </fo:block>
5088
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5089
+ </fo:block>
5075
5090
 
5076
5091
  </xsl:template> <!-- table/note -->
5077
5092
 
@@ -8209,8 +8224,12 @@
8209
8224
  <xsl:variable name="isAdded" select="../@added"/>
8210
8225
  <xsl:variable name="isDeleted" select="../@deleted"/>
8211
8226
  <xsl:choose>
8212
- <xsl:when test="ancestor::*[local-name() = 'title']">
8227
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
8213
8228
  <fo:inline padding-left="1mm" padding-right="1mm">
8229
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
8230
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
8231
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
8232
+ </xsl:if>
8214
8233
  <xsl:variable name="src">
8215
8234
  <xsl:call-template name="image_src"/>
8216
8235
  </xsl:variable>
@@ -8243,7 +8262,7 @@
8243
8262
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
8244
8263
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
8245
8264
 
8246
- <xsl:if test="@width != '' and @width != 'auto'">
8265
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
8247
8266
  <xsl:attribute name="width">
8248
8267
  <xsl:value-of select="@width"/>
8249
8268
  </xsl:attribute>
@@ -2491,11 +2491,26 @@
2491
2491
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
2492
2492
  </xsl:if>
2493
2493
 
2494
- <xsl:value-of select="."/>
2494
+ <xsl:variable name="font_family" select="."/>
2495
2495
 
2496
- <xsl:if test="$additional_fonts != ''">
2497
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2498
- </xsl:if>
2496
+ <xsl:choose>
2497
+ <xsl:when test="$additional_fonts = ''">
2498
+ <xsl:value-of select="$font_family"/>
2499
+ </xsl:when>
2500
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
2501
+ <xsl:choose>
2502
+ <xsl:when test="contains($font_family, ',')">
2503
+ <xsl:value-of select="substring-before($font_family, ',')"/>
2504
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2505
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
2506
+ </xsl:when>
2507
+ <xsl:otherwise>
2508
+ <xsl:value-of select="$font_family"/>
2509
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2510
+ </xsl:otherwise>
2511
+ </xsl:choose>
2512
+ </xsl:otherwise>
2513
+ </xsl:choose>
2499
2514
  </xsl:attribute>
2500
2515
  </xsl:when>
2501
2516
  <xsl:otherwise>
@@ -5057,21 +5072,21 @@
5057
5072
 
5058
5073
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
5059
5074
 
5060
- <fo:block xsl:use-attribute-sets="table-note-style">
5075
+ <fo:block xsl:use-attribute-sets="table-note-style">
5061
5076
 
5062
- <xsl:call-template name="refine_table-note-style"/>
5077
+ <xsl:call-template name="refine_table-note-style"/>
5063
5078
 
5064
- <!-- Table's note/example name (NOTE, for example) -->
5065
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
5079
+ <!-- Table's note/example name (NOTE, for example) -->
5080
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
5066
5081
 
5067
- <xsl:call-template name="refine_table-note-name-style"/>
5082
+ <xsl:call-template name="refine_table-note-name-style"/>
5068
5083
 
5069
- <xsl:apply-templates select="*[local-name() = 'name']"/>
5084
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
5070
5085
 
5071
- </fo:inline>
5086
+ </fo:inline>
5072
5087
 
5073
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5074
- </fo:block>
5088
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5089
+ </fo:block>
5075
5090
 
5076
5091
  </xsl:template> <!-- table/note -->
5077
5092
 
@@ -8209,8 +8224,12 @@
8209
8224
  <xsl:variable name="isAdded" select="../@added"/>
8210
8225
  <xsl:variable name="isDeleted" select="../@deleted"/>
8211
8226
  <xsl:choose>
8212
- <xsl:when test="ancestor::*[local-name() = 'title']">
8227
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
8213
8228
  <fo:inline padding-left="1mm" padding-right="1mm">
8229
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
8230
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
8231
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
8232
+ </xsl:if>
8214
8233
  <xsl:variable name="src">
8215
8234
  <xsl:call-template name="image_src"/>
8216
8235
  </xsl:variable>
@@ -8243,7 +8262,7 @@
8243
8262
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
8244
8263
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
8245
8264
 
8246
- <xsl:if test="@width != '' and @width != 'auto'">
8265
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
8247
8266
  <xsl:attribute name="width">
8248
8267
  <xsl:value-of select="@width"/>
8249
8268
  </xsl:attribute>
@@ -83,7 +83,6 @@ module IsoDoc
83
83
  "resolution" or return super
84
84
  %w(sections bibliography).include? elem.parent.name or return super
85
85
  @suppressheadingnumbers || elem["unnumbered"] and return
86
-
87
86
  t = elem.at(ns("./title")) and t["depth"] = "1"
88
87
  lbl = @xrefs.anchor(elem["id"], :label, false) or return
89
88
  elem.previous =
@@ -94,7 +93,6 @@ module IsoDoc
94
93
  def annex1(elem)
95
94
  elem.at(ns("//bibdata/ext/doctype"))&.text == "resolution" or
96
95
  return super
97
-
98
96
  elem.elements.first.previous = annex1_supertitle(elem)
99
97
  t = elem.at(ns("./title")) and
100
98
  t.children = "<strong>#{to_xml(t.children)}</strong>"
@@ -1,6 +1,6 @@
1
1
  require "isodoc"
2
2
  require "fileutils"
3
- require_relative "./xref_section"
3
+ require_relative "xref_section"
4
4
 
5
5
  module IsoDoc
6
6
  module ITU
@@ -20,59 +20,10 @@ module IsoDoc
20
20
  @hierarchical_assets = options[:hierarchicalassets]
21
21
  end
22
22
 
23
- def back_anchor_names(docxml)
24
- super
25
- if @parse_settings.empty? || @parse_settings[:clauses]
26
- if annexid = docxml
27
- .at(ns("//bibdata/ext/structuredidentifier/annexid"))&.text
28
- docxml.xpath(ns("//annex")).each { |c| annex_names(c, annexid) }
29
- else
30
- informative_annex_names(docxml)
31
- normative_annex_names(docxml)
32
- end
33
- end
34
- end
35
-
36
- def informative_annex_names(docxml)
37
- i = Counter.new(0, numerals: :roman)
38
- docxml.xpath(ns("//annex[@obligation = 'informative']"))
39
- .each do |c|
40
- i.increment(c)
41
- annex_names(c, i.print.upcase)
42
- end
43
- end
44
-
45
- def normative_annex_names(docxml)
46
- i = Counter.new("@", skip_i: true)
47
- docxml.xpath(ns("//annex[not(@obligation = 'informative')]"))
48
- .each do |c|
49
- i.increment(c)
50
- annex_names(c, i.print)
51
- end
52
- end
53
-
54
- def initial_anchor_names(doc)
55
- @doctype = doc&.at(ns("//bibdata/ext/doctype"))&.text
56
- if @parse_settings.empty? || @parse_settings[:clauses]
57
- doc.xpath(ns("//boilerplate//clause")).each { |c| preface_names(c) }
58
- doc.xpath("//xmlns:preface/child::*").each { |c| preface_names(c) }
59
- end
60
- if @parse_settings.empty? || @parse_settings[:clauses]
61
- n = Counter.new
62
- n = section_names(doc.at(ns("//clause[@type = 'scope']")), n, 1)
63
- n = section_names(doc.at(ns(@klass.norm_ref_xpath)), n, 1)
64
- n = section_names(
65
- doc.at(ns("//sections/terms | //sections/clause[descendant::terms]")), n, 1
66
- )
67
- n = section_names(doc.at(ns("//sections/definitions")), n, 1)
68
- clause_names(doc, n)
69
- end
70
- end
71
-
72
23
  def middle_sections
73
24
  "//clause[@type = 'scope'] | " \
74
- "//foreword | //introduction | //acknowledgements | " \
75
- " #{@klass.norm_ref_xpath} | " \
25
+ "//foreword | //introduction | //acknowledgements | " \
26
+ "#{@klass.norm_ref_xpath} | " \
76
27
  "//sections/terms | //preface/clause | " \
77
28
  "//sections/definitions | //clause[parent::sections]"
78
29
  end
@@ -90,8 +41,7 @@ module IsoDoc
90
41
  end
91
42
 
92
43
  def middle_section_asset_names(doc)
93
- return super unless @hierarchical_assets
94
-
44
+ @hierarchical_assets or return super
95
45
  doc.xpath(ns(middle_sections)).each do |c|
96
46
  hierarchical_asset_names(c, @anchors[c["id"]][:label])
97
47
  end
@@ -1,6 +1,45 @@
1
1
  module IsoDoc
2
2
  module ITU
3
3
  class Xref < IsoDoc::Xref
4
+ def clause_order_annex(docxml)
5
+ if docxml.at(ns("//bibdata/ext/structuredidentifier/annexid"))
6
+ [{ path: "//annex", multi: true }]
7
+ else
8
+ [{ path: "//annex[not(@obligation = 'informative')]", multi: true },
9
+ { path: "//annex[@obligation = 'informative']", multi: true }]
10
+ end
11
+ end
12
+
13
+ def annex_anchor_names(xml)
14
+ t = clause_order_annex(xml)
15
+ if annexid = xml.at(ns("//bibdata/ext/structuredidentifier/annexid"))
16
+ xml.xpath(ns(t[0][:path])).each do |c|
17
+ annex_names(c, annexid.text)
18
+ end
19
+ else
20
+ annex_names_with_counter(xml, t[0][:path],
21
+ Counter.new("@", skip_i: true))
22
+ annex_names_with_counter(xml, t[1][:path],
23
+ Counter.new(0, numerals: :roman))
24
+ end
25
+ end
26
+
27
+ def annex_names_with_counter(docxml, xpath, counter)
28
+ docxml.xpath(ns(xpath)).each do |c|
29
+ annex_names(c, counter.increment(c).print.upcase)
30
+ end
31
+ end
32
+
33
+ def clause_order_preface(_docxml)
34
+ [{ path: "//boilerplate/*", multi: true },
35
+ { path: "//preface/*", multi: true }]
36
+ end
37
+
38
+ def initial_anchor_names(doc)
39
+ @doctype = doc&.at(ns("//bibdata/ext/doctype"))&.text
40
+ super
41
+ end
42
+
4
43
  def annextype(clause)
5
44
  if clause["obligation"] == "informative" then @labels["appendix"]
6
45
  else @labels["annex"]
@@ -38,19 +77,21 @@ module IsoDoc
38
77
  end
39
78
  end
40
79
 
41
- def clause_names(docxml, sect_num)
42
- docxml.xpath(ns("//sections/clause[not(@unnumbered = 'true')]" \
43
- "[not(@type = 'scope')][not(descendant::terms)]"))
44
- .each do |c|
45
- section_names(c, sect_num, 1)
46
- end
47
- docxml.xpath(ns("//sections/clause[@unnumbered = 'true']")).each do |c|
48
- unnumbered_section_names(c, 1)
80
+ def main_anchor_names(xml)
81
+ n = Counter.new
82
+ clause_order_main(xml).each do |a|
83
+ xml.xpath(ns(a[:path])).each do |c|
84
+ section_names(c, n, 1)
85
+ a[:multi] or break
86
+ end
49
87
  end
50
88
  end
51
89
 
52
90
  def section_names(clause, num, lvl)
53
- return num if clause.nil?
91
+ clause.nil? and return num
92
+ clause["unnumbered"] == "true" and return unnumbered_section_names(
93
+ clause, 1
94
+ )
54
95
 
55
96
  num.increment(clause)
56
97
  lbl = @doctype == "resolution" ? @labels["section"] : @labels["clause"]
@@ -79,11 +120,11 @@ module IsoDoc
79
120
  end
80
121
 
81
122
  def unnumbered_section_names(clause, lvl)
82
- return if clause.nil?
83
-
123
+ clause.nil? and return
84
124
  lbl = clause&.at(ns("./title"))&.text || "[#{clause['id']}]"
85
125
  @anchors[clause["id"]] =
86
- { label: lbl, xref: l10n(%{"#{lbl}"}), level: lvl, type: "clause" }
126
+ { label: lbl, xref: l10n(%{"#{lbl}"}), level: lvl,
127
+ type: "clause" }
87
128
  clause.xpath(ns(SUBCLAUSES)).each do |c|
88
129
  unnumbered_section_names1(c, lvl + 1)
89
130
  end
@@ -92,7 +133,8 @@ module IsoDoc
92
133
  def unnumbered_section_names1(clause, level)
93
134
  lbl = clause&.at(ns("./title"))&.text || "[#{clause['id']}]"
94
135
  @anchors[clause["id"]] =
95
- { label: lbl, xref: l10n(%{"#{lbl}"}), level: level, type: "clause" }
136
+ { label: lbl, xref: l10n(%{"#{lbl}"}), level: level,
137
+ type: "clause" }
96
138
  clause.xpath(ns(SUBCLAUSES)).each do |c|
97
139
  unnumbered_section_names1(c, level + 1)
98
140
  end
@@ -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.3 -->
20
+ <!-- VERSION v1.2.4 -->
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">
@@ -2068,6 +2068,9 @@
2068
2068
  </define>
2069
2069
  <define name="termdefinition">
2070
2070
  <element name="definition">
2071
+ <optional>
2072
+ <attribute name="type"/>
2073
+ </optional>
2071
2074
  <choice>
2072
2075
  <ref name="verbaldefinition"/>
2073
2076
  <ref name="nonverbalrep"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ITU
3
- VERSION = "2.3.0".freeze
3
+ VERSION = "2.3.1".freeze
4
4
  end
5
5
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
27
27
 
28
28
  spec.add_dependency "htmlentities", "~> 4.3.4"
29
- spec.add_dependency "metanorma-standoc", "~> 2.5.0"
29
+ spec.add_dependency "metanorma-standoc", "~> 2.5.4"
30
30
  spec.add_dependency "ruby-jing"
31
31
  spec.add_dependency "twitter_cldr", ">= 3.0.0"
32
32
  spec.add_dependency "tzinfo-data" # we need this for windows only
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.3.0
4
+ version: 2.3.1
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-08-07 00:00:00.000000000 Z
11
+ date: 2023-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.5.0
33
+ version: 2.5.4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.5.0
40
+ version: 2.5.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: ruby-jing
43
43
  requirement: !ruby/object:Gem::Requirement