metanorma-itu 2.3.0 → 2.3.2

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: dd7cb2a16590fe04f51e162637b7fc1be2b6e7b403d04118e8c82b2ad0e4eb66
4
- data.tar.gz: 35a5dd96771972460f80fc0f0a83f4c6610b59bd659b08c771b89405ca719e62
3
+ metadata.gz: e4a2af7108e4cc46b5baae30adab35ca6b676562ac34fb83a4ad575a75c0af3f
4
+ data.tar.gz: 409987853945566a26ce6b68b90135dd3430fa4ce7b3d564d0103ad795547f01
5
5
  SHA512:
6
- metadata.gz: 78896c795984c2999c194e6cb21546880ed1df41cbabe7082f773d5086c1f354f5d342eec07f7ae697dd21ab9848aee3b035d4047db3af3c1c4efc9296ccf10f
7
- data.tar.gz: 53894e2251b8a69d8c4ff9c37789b600b18907c8a718ac9a5dde34e351e4e36b7b27c1ae40b3808bc885dfa7d1b7cf458d2e3a0ca43474a9ec341bd07760cae8
6
+ metadata.gz: 6731878ecfb46064d3094c58558bb865b5dd9819a012d2c01f0cfe6e9b63d51b69702860f332b3edaf4581a65d41daecf5a1a301dd298857039b712cf25b5a47
7
+ data.tar.gz: b9ee173f2d18f21355540173d566fa3b4eb348147e2947c27316f5e0f38778ec0e94015c98aab0aface77e2ae218d45141e3b8198e91c437bb9dbe90c493532b
@@ -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>
@@ -75,12 +75,12 @@ module IsoDoc
75
75
  %i(affiliations addresses emails faxes phones).each { |i| set(i, []) }
76
76
  authors.each do |a|
77
77
  append(:affiliations,
78
- a&.at(ns("./affiliation/organization/name"))&.text)
79
- append(:addresses, a&.at(ns("./affiliation/organization/address/" \
80
- "formattedAddress"))&.text)
81
- append(:emails, a&.at(ns("./email"))&.text)
82
- append(:faxes, a&.at(ns("./phone[@type = 'fax']"))&.text)
83
- append(:phones, a&.at(ns("./phone[not(@type = 'fax')]"))&.text)
78
+ a.at(ns("./affiliation/organization/name"))&.text)
79
+ append(:addresses, a.at(ns("./affiliation/organization/address/" \
80
+ "formattedAddress"))&.text)
81
+ append(:emails, a.at(ns("./email"))&.text)
82
+ append(:faxes, a.at(ns("./phone[@type = 'fax']"))&.text)
83
+ append(:phones, a.at(ns("./phone[not(@type = 'fax')]"))&.text)
84
84
  end
85
85
  end
86
86
 
@@ -117,7 +117,7 @@ module IsoDoc
117
117
  pubdate and
118
118
  set(:placedate_year,
119
119
  @labels["placedate"]
120
- .sub(/%/, pubdate.text.sub(/^(\d\d\d\d).*$/, "\\1")))
120
+ .sub("%", pubdate.text.sub(/^(\d\d\d\d).*$/, "\\1")))
121
121
  end
122
122
 
123
123
  def monthyr(isodate)
@@ -142,7 +142,7 @@ module IsoDoc
142
142
  else super
143
143
  end
144
144
  d = get[:doctype] and
145
- set(:draft_new_doctype, @labels["draft_new"].sub(/%/, d))
145
+ set(:draft_new_doctype, @labels["draft_new"].sub("%", d))
146
146
  end
147
147
 
148
148
  def ip_notice_received(isoxml, _out)
@@ -187,27 +187,27 @@ module IsoDoc
187
187
  end
188
188
 
189
189
  def techreport(isoxml, _out)
190
- if a = isoxml&.at(ns("//bibdata/ext/meeting"))&.text
190
+ if a = isoxml.at(ns("//bibdata/ext/meeting"))&.text
191
191
  set(:meeting, a)
192
192
  set(:meeting_acronym, a)
193
193
  end
194
- a = isoxml&.at(ns("//bibdata/ext/meeting/@acronym"))&.text and
194
+ a = isoxml.at(ns("//bibdata/ext/meeting/@acronym"))&.text and
195
195
  set(:meeting_acronym, a)
196
- a = isoxml&.at(ns("//bibdata/ext/meeting-place"))&.text and
196
+ a = isoxml.at(ns("//bibdata/ext/meeting-place"))&.text and
197
197
  set(:meeting_place, a)
198
- a = isoxml&.at(ns("//bibdata/ext/intended-type"))&.text and
198
+ a = isoxml.at(ns("//bibdata/ext/intended-type"))&.text and
199
199
  set(:intended_type, a)
200
- a = isoxml&.at(ns("//bibdata/ext/source"))&.text and set(:source, a)
200
+ a = isoxml.at(ns("//bibdata/ext/source"))&.text and set(:source, a)
201
201
  meeting(isoxml)
202
202
  end
203
203
 
204
204
  def meeting(isoxml)
205
205
  resolution =
206
- isoxml&.at(ns("//bibdata/ext/doctype"))&.text == "resolution"
207
- if o = isoxml&.at(ns("//bibdata/ext/meeting-date/on"))&.text
206
+ isoxml.at(ns("//bibdata/ext/doctype"))&.text == "resolution"
207
+ if o = isoxml.at(ns("//bibdata/ext/meeting-date/on"))&.text
208
208
  set(:meeting_date, resolution ? ddMMMMYYYY(o, nil) : ddMMMYYYY(o))
209
- elsif f = isoxml&.at(ns("//bibdata/ext/meeting-date/from"))&.text
210
- t = isoxml&.at(ns("//bibdata/ext/meeting-date/to"))&.text
209
+ elsif f = isoxml.at(ns("//bibdata/ext/meeting-date/from"))&.text
210
+ t = isoxml.at(ns("//bibdata/ext/meeting-date/to"))&.text
211
211
  set(:meeting_date,
212
212
  resolution ? ddMMMMYYYY(f, t) : "#{ddMMMYYYY(f)}/#{ddMMMYYYY(t)}")
213
213
  end
@@ -12,9 +12,8 @@ module IsoDoc
12
12
  super
13
13
  end
14
14
 
15
- def pdf_stylesheet(docxml)
16
- doctype = docxml&.at(ns("//bibdata/ext/doctype"))&.text
17
- if File.exist?(File.join(@libdir, "itu.#{doctype}.xsl"))
15
+ def pdf_stylesheet(_docxml)
16
+ if File.exist?(File.join(@libdir, "itu.#{@doctype}.xsl"))
18
17
  "itu.#{doctype}.xsl"
19
18
  else
20
19
  "itu.recommendation.xsl"
@@ -79,11 +79,9 @@ module IsoDoc
79
79
  end
80
80
 
81
81
  def clause1(elem)
82
- elem.at(ns("//bibdata/ext/doctype"))&.text ==
83
- "resolution" or return super
82
+ @doctype == "resolution" or return super
84
83
  %w(sections bibliography).include? elem.parent.name or return super
85
84
  @suppressheadingnumbers || elem["unnumbered"] and return
86
-
87
85
  t = elem.at(ns("./title")) and t["depth"] = "1"
88
86
  lbl = @xrefs.anchor(elem["id"], :label, false) or return
89
87
  elem.previous =
@@ -92,9 +90,7 @@ module IsoDoc
92
90
  end
93
91
 
94
92
  def annex1(elem)
95
- elem.at(ns("//bibdata/ext/doctype"))&.text == "resolution" or
96
- return super
97
-
93
+ @doctype == "resolution" or return super
98
94
  elem.elements.first.previous = annex1_supertitle(elem)
99
95
  t = elem.at(ns("./title")) and
100
96
  t.children = "<strong>#{to_xml(t.children)}</strong>"
@@ -143,8 +139,7 @@ module IsoDoc
143
139
  end
144
140
 
145
141
  def toc_title(docxml)
146
- doctype = docxml.at(ns("//bibdata/ext/doctype"))
147
- doctype&.text == "resolution" and return
142
+ @doctype == "resolution" and return
148
143
  super
149
144
  end
150
145
 
@@ -42,7 +42,7 @@ module IsoDoc
42
42
  end
43
43
 
44
44
  def convert1(docxml, filename, dir)
45
- if docxml&.at(ns("//bibdata/ext/doctype"))&.text == "service-publication"
45
+ if @doctype == "service-publication"
46
46
  @wordcoverpage = html_doc_path("word_itu_titlepage_sp.html")
47
47
  options[:bodyfont] = "Arial"
48
48
  options[:headerfont] = "Arial"
@@ -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,40 @@
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
+
4
38
  def annextype(clause)
5
39
  if clause["obligation"] == "informative" then @labels["appendix"]
6
40
  else @labels["annex"]
@@ -38,19 +72,21 @@ module IsoDoc
38
72
  end
39
73
  end
40
74
 
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)
75
+ def main_anchor_names(xml)
76
+ n = Counter.new
77
+ clause_order_main(xml).each do |a|
78
+ xml.xpath(ns(a[:path])).each do |c|
79
+ section_names(c, n, 1)
80
+ a[:multi] or break
81
+ end
49
82
  end
50
83
  end
51
84
 
52
85
  def section_names(clause, num, lvl)
53
- return num if clause.nil?
86
+ clause.nil? and return num
87
+ clause["unnumbered"] == "true" and return unnumbered_section_names(
88
+ clause, 1
89
+ )
54
90
 
55
91
  num.increment(clause)
56
92
  lbl = @doctype == "resolution" ? @labels["section"] : @labels["clause"]
@@ -79,11 +115,11 @@ module IsoDoc
79
115
  end
80
116
 
81
117
  def unnumbered_section_names(clause, lvl)
82
- return if clause.nil?
83
-
118
+ clause.nil? and return
84
119
  lbl = clause&.at(ns("./title"))&.text || "[#{clause['id']}]"
85
120
  @anchors[clause["id"]] =
86
- { label: lbl, xref: l10n(%{"#{lbl}"}), level: lvl, type: "clause" }
121
+ { label: lbl, xref: l10n(%{"#{lbl}"}), level: lvl,
122
+ type: "clause" }
87
123
  clause.xpath(ns(SUBCLAUSES)).each do |c|
88
124
  unnumbered_section_names1(c, lvl + 1)
89
125
  end
@@ -92,7 +128,8 @@ module IsoDoc
92
128
  def unnumbered_section_names1(clause, level)
93
129
  lbl = clause&.at(ns("./title"))&.text || "[#{clause['id']}]"
94
130
  @anchors[clause["id"]] =
95
- { label: lbl, xref: l10n(%{"#{lbl}"}), level: level, type: "clause" }
131
+ { label: lbl, xref: l10n(%{"#{lbl}"}), level: level,
132
+ type: "clause" }
96
133
  clause.xpath(ns(SUBCLAUSES)).each do |c|
97
134
  unnumbered_section_names1(c, level + 1)
98
135
  end
@@ -9,8 +9,7 @@ module Metanorma
9
9
  end
10
10
 
11
11
  def resolution_inline_header(xml)
12
- return unless xml&.at("//bibdata/ext/doctype")&.text == "resolution"
13
-
12
+ @doctype == "resolution" or return
14
13
  xml.xpath("//clause//clause").each do |c|
15
14
  next if (title = c.at("./title")) && !title&.text&.empty?
16
15
 
@@ -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"/>
@@ -7,13 +7,12 @@ module Metanorma
7
7
  end
8
8
 
9
9
  def doctype_validate(xmldoc)
10
- doctype = xmldoc&.at("//bibdata/ext/doctype")&.text
11
10
  %w(recommendation recommendation-supplement recommendation-amendment
12
11
  recommendation-corrigendum recommendation-errata recommendation-annex
13
12
  focus-group implementers-guide technical-paper technical-report
14
- joint-itu-iso-iec service-publication).include? doctype or
13
+ joint-itu-iso-iec service-publication).include? @doctype or
15
14
  @log.add("Document Attributes", nil,
16
- "#{doctype} is not a recognised document type")
15
+ "#{@doctype} is not a recognised document type")
17
16
  end
18
17
 
19
18
  def stage_validate(xmldoc)
@@ -111,9 +110,8 @@ module Metanorma
111
110
  end
112
111
 
113
112
  def unnumbered_check(xmldoc)
114
- doctype = xmldoc&.at("//bibdata/ext/doctype")&.text
115
113
  xmldoc.xpath("//clause[@unnumbered = 'true']").each do |c|
116
- next if (doctype == "resolution") && (c.parent.name == "sections") &&
114
+ next if (@doctype == "resolution") && (c.parent.name == "sections") &&
117
115
  !c.at("./preceding-sibling::clause")
118
116
 
119
117
  @log.add("Style", c, "Unnumbered clause out of place")
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ITU
3
- VERSION = "2.3.0".freeze
3
+ VERSION = "2.3.2".freeze
4
4
  end
5
5
  end
@@ -25,8 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.require_paths = ["lib"]
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
27
27
 
28
- spec.add_dependency "htmlentities", "~> 4.3.4"
29
- spec.add_dependency "metanorma-standoc", "~> 2.5.0"
28
+ spec.add_dependency "metanorma-standoc", "~> 2.6.0"
30
29
  spec.add_dependency "ruby-jing"
31
30
  spec.add_dependency "twitter_cldr", ">= 3.0.0"
32
31
  spec.add_dependency "tzinfo-data" # we need this for windows only
metadata CHANGED
@@ -1,43 +1,29 @@
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.2
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-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: htmlentities
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: 4.3.4
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: 4.3.4
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: metanorma-standoc
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
17
  - - "~>"
32
18
  - !ruby/object:Gem::Version
33
- version: 2.5.0
19
+ version: 2.6.0
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
24
  - - "~>"
39
25
  - !ruby/object:Gem::Version
40
- version: 2.5.0
26
+ version: 2.6.0
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: ruby-jing
43
29
  requirement: !ruby/object:Gem::Requirement