metanorma-iec 2.5.4 → 2.5.5

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: f918d2d4de755bfda4e2a14f98d9b99204aa777ed615c517ea873176593b810a
4
- data.tar.gz: 8520e503f38b00d06ac8ad6758e79104e80350b1ee2b1282fcedfc521e729b92
3
+ metadata.gz: 0def60c7fba66d712bd162183c4085c2ecda4ef3cf89b45f0c5bf45f7c591136
4
+ data.tar.gz: 4f00862617ced725fd8a597a1defa7ef46e894b2cd451551ce61bd897efb1cba
5
5
  SHA512:
6
- metadata.gz: c097a715deb9e05a1c6ca0b9ea5fe80aad4f070c6db5cf5714034d5a6fa9add0287e71fb203498c75fd4e899c250a4774e2dd9408c9558a33a2ab41093f1a043
7
- data.tar.gz: 2af3c2050c896f922e6a8bca89fc0867981965dcdcb00d7ff0bebf4b6577d62317358394270651355e9286e5a5b2e1614155389be4f4bbfd1af78f59112b0b46
6
+ metadata.gz: 430e64c30a07c13fc4d66afa564a036013568928ad7e83a29d8c60802bfc0ad665bc3a4d9345ab1481d731da89a25f7993be87da1c99cfcf6a7609cf98b9fbd7
7
+ data.tar.gz: d60935042f7e8d05196696dedea20260c3ec807994cca127a12e26c1662402aedf90b31755ee22b21624d2782ff1271450fc4397292fbb1984778a2a334322e3
@@ -1245,61 +1245,64 @@
1245
1245
  <xsl:attribute name="space-before">5pt</xsl:attribute>
1246
1246
  </xsl:if>
1247
1247
 
1248
- <fo:list-block>
1249
- <xsl:attribute name="margin-left">
1250
- <xsl:choose>
1251
- <xsl:when test="title/@variant-title = 'true'">0mm</xsl:when>
1252
- <xsl:when test="@level = 2">8mm</xsl:when>
1253
- <xsl:when test="@level &gt;= 3"><xsl:value-of select="(@level - 2) * 23"/>mm</xsl:when>
1254
- <xsl:otherwise>0mm</xsl:otherwise>
1255
- </xsl:choose>
1256
- </xsl:attribute>
1257
- <xsl:attribute name="provisional-distance-between-starts">
1258
- <xsl:choose>
1259
- <xsl:when test="@section = ''">0mm</xsl:when>
1260
- <xsl:when test="@level = 1">8mm</xsl:when>
1261
- <xsl:when test="@level = 2">15mm</xsl:when>
1262
- <xsl:when test="@level &gt;= 3"><xsl:value-of select="(@level - 2) * 19"/>mm</xsl:when>
1263
- <xsl:otherwise>0mm</xsl:otherwise>
1264
- </xsl:choose>
1265
- </xsl:attribute>
1266
- <fo:list-item>
1267
- <fo:list-item-label end-indent="label-end()">
1268
- <fo:block>
1269
- <xsl:value-of select="@section"/>
1270
- </fo:block>
1271
- </fo:list-item-label>
1272
- <fo:list-item-body start-indent="body-start()">
1273
- <fo:block text-align-last="justify">
1274
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
1275
- <xsl:variable name="title">
1276
- <xsl:apply-templates select="title"/>
1277
- </xsl:variable>
1278
- <xsl:call-template name="addLetterSpacing">
1279
- <xsl:with-param name="text" select="$title"/>
1280
- </xsl:call-template>
1281
- <xsl:text> </xsl:text>
1282
- <fo:inline keep-together.within-line="always">
1283
- <fo:leader leader-pattern="dots"/>
1284
- <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
1285
- </fo:inline>
1286
- </fo:basic-link>
1287
- </fo:block>
1288
- </fo:list-item-body>
1289
- </fo:list-item>
1290
- </fo:list-block>
1248
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{@section} {title}"> <!-- link at this level needs for PDF structure tags -->
1249
+
1250
+ <fo:list-block role="SKIP">
1251
+ <xsl:attribute name="margin-left">
1252
+ <xsl:choose>
1253
+ <xsl:when test="title/@variant-title = 'true'">0mm</xsl:when>
1254
+ <xsl:when test="@level = 2">8mm</xsl:when>
1255
+ <xsl:when test="@level &gt;= 3"><xsl:value-of select="(@level - 2) * 23"/>mm</xsl:when>
1256
+ <xsl:otherwise>0mm</xsl:otherwise>
1257
+ </xsl:choose>
1258
+ </xsl:attribute>
1259
+ <xsl:attribute name="provisional-distance-between-starts">
1260
+ <xsl:choose>
1261
+ <xsl:when test="@section = ''">0mm</xsl:when>
1262
+ <xsl:when test="@level = 1">8mm</xsl:when>
1263
+ <xsl:when test="@level = 2">15mm</xsl:when>
1264
+ <xsl:when test="@level &gt;= 3"><xsl:value-of select="(@level - 2) * 19"/>mm</xsl:when>
1265
+ <xsl:otherwise>0mm</xsl:otherwise>
1266
+ </xsl:choose>
1267
+ </xsl:attribute>
1268
+ <fo:list-item role="SKIP">
1269
+ <fo:list-item-label end-indent="label-end()" role="SKIP">
1270
+ <fo:block>
1271
+ <xsl:value-of select="@section"/>
1272
+ </fo:block>
1273
+ </fo:list-item-label>
1274
+ <fo:list-item-body start-indent="body-start()" role="SKIP">
1275
+ <fo:block text-align-last="justify" role="SKIP">
1276
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}" role="SKIP">
1277
+ <xsl:variable name="title">
1278
+ <xsl:apply-templates select="title"/>
1279
+ </xsl:variable>
1280
+ <xsl:call-template name="addLetterSpacing">
1281
+ <xsl:with-param name="text" select="$title"/>
1282
+ </xsl:call-template>
1283
+ <xsl:text> </xsl:text>
1284
+ <fo:inline keep-together.within-line="always" role="SKIP">
1285
+ <fo:leader leader-pattern="dots"/>
1286
+ <fo:inline role="SKIP"><fo:wrapper role="artifact"><fo:page-number-citation ref-id="{@id}"/></fo:wrapper></fo:inline>
1287
+ </fo:inline>
1288
+ </fo:basic-link>
1289
+ </fo:block>
1290
+ </fo:list-item-body>
1291
+ </fo:list-item>
1292
+ </fo:list-block>
1293
+ </fo:basic-link>
1291
1294
  </fo:block>
1292
1295
  </xsl:for-each>
1293
1296
 
1294
1297
  <xsl:if test="$contents//figures/figure">
1295
- <fo:block margin-bottom="5pt"> </fo:block>
1298
+ <fo:block margin-bottom="5pt" role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block>
1296
1299
  <xsl:for-each select="$contents//figures/figure">
1297
1300
  <xsl:call-template name="insertListOf_Item"/>
1298
1301
  </xsl:for-each>
1299
1302
  </xsl:if>
1300
1303
 
1301
1304
  <xsl:if test="$contents//tables/table">
1302
- <fo:block margin-bottom="5pt"> </fo:block>
1305
+ <fo:block margin-bottom="5pt" role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block>
1303
1306
  <xsl:for-each select="$contents//tables/table">
1304
1307
  <xsl:call-template name="insertListOf_Item"/>
1305
1308
  </xsl:for-each>
@@ -1311,11 +1314,14 @@
1311
1314
 
1312
1315
  <xsl:template name="insertListOf_Item">
1313
1316
  <fo:block text-align-last="justify" margin-bottom="5pt" margin-left="8mm" text-indent="-8mm" role="TOCI">
1314
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{local-name()} {@id}">
1317
+ <xsl:variable name="alt_text" select="normalize-space(translate(normalize-space(*[local-name() = 'name']), ' —', ' -'))"/>
1318
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{$alt_text}"> <!-- {local-name()} {@id} -->
1315
1319
  <xsl:apply-templates select="." mode="contents"/>
1316
- <fo:inline keep-together.within-line="always">
1320
+ <fo:inline keep-together.within-line="always" role="SKIP">
1317
1321
  <fo:leader leader-pattern="dots"/>
1318
- <fo:page-number-citation ref-id="{@id}"/>
1322
+ <fo:wrapper role="artifact">
1323
+ <fo:page-number-citation ref-id="{@id}"/>
1324
+ </fo:wrapper>
1319
1325
  </fo:inline>
1320
1326
  </fo:basic-link>
1321
1327
  </fo:block>
@@ -5633,7 +5639,8 @@
5633
5639
  </xsl:choose>
5634
5640
  </xsl:variable>
5635
5641
  <xsl:variable name="current_fn_number_text">
5636
- <xsl:value-of select="$current_fn_number"/>
5642
+
5643
+ <xsl:value-of select="$current_fn_number"/>
5637
5644
 
5638
5645
  </xsl:variable>
5639
5646
 
@@ -5669,8 +5676,10 @@
5669
5676
 
5670
5677
  <xsl:call-template name="insert_basic_link">
5671
5678
  <xsl:with-param name="element">
5672
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
5673
- <xsl:copy-of select="$current_fn_number_text"/>
5679
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}"> <!-- note: role="Lbl" removed in https://github.com/metanorma/mn2pdf/issues/291 -->
5680
+ <fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
5681
+ <xsl:copy-of select="$current_fn_number_text"/>
5682
+ </fo:inline>
5674
5683
  </fo:basic-link>
5675
5684
  </xsl:with-param>
5676
5685
  </xsl:call-template>
@@ -5951,7 +5960,7 @@
5951
5960
 
5952
5961
  <xsl:call-template name="refine_fn-reference-style"/>
5953
5962
 
5954
- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5963
+ <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5955
5964
  <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
5956
5965
  <xsl:attribute name="internal-destination">
5957
5966
  <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
@@ -6963,9 +6972,19 @@
6963
6972
  </fo:inline>
6964
6973
  </xsl:template>
6965
6974
 
6966
- <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
6975
+ <xsl:template match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
6976
+ <xsl:param name="txt"/>
6967
6977
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
6968
- <xsl:variable name="text" select="."/>
6978
+ <xsl:variable name="text">
6979
+ <xsl:choose>
6980
+ <xsl:when test="$txt != ''">
6981
+ <xsl:value-of select="$txt"/>
6982
+ </xsl:when>
6983
+ <xsl:otherwise>
6984
+ <xsl:value-of select="."/>
6985
+ </xsl:otherwise>
6986
+ </xsl:choose>
6987
+ </xsl:variable>
6969
6988
  <xsl:variable name="ratio_">
6970
6989
  0.75
6971
6990
  </xsl:variable>
@@ -8482,9 +8501,12 @@
8482
8501
  <xsl:apply-templates/>
8483
8502
  </xsl:when>
8484
8503
  <xsl:otherwise>
8504
+ <xsl:variable name="alt_text">
8505
+ <xsl:call-template name="getAltText"/>
8506
+ </xsl:variable>
8485
8507
  <xsl:call-template name="insert_basic_link">
8486
8508
  <xsl:with-param name="element">
8487
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
8509
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$alt_text}">
8488
8510
  <xsl:if test="$isLinkToEmbeddedFile = 'true'">
8489
8511
  <xsl:attribute name="role">Annot</xsl:attribute>
8490
8512
  </xsl:if>
@@ -8511,6 +8533,14 @@
8511
8533
  </fo:inline>
8512
8534
  </xsl:template> <!-- link -->
8513
8535
 
8536
+ <xsl:template name="getAltText">
8537
+ <xsl:choose>
8538
+ <xsl:when test="normalize-space(.) = ''"><xsl:value-of select="@target"/></xsl:when>
8539
+ <xsl:otherwise><xsl:value-of select="normalize-space(translate(normalize-space(), ' —', ' -'))"/></xsl:otherwise>
8540
+ <!-- <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise> -->
8541
+ </xsl:choose>
8542
+ </xsl:template>
8543
+
8514
8544
  <!-- ======================== -->
8515
8545
  <!-- Appendix processing -->
8516
8546
  <!-- ======================== -->
@@ -8541,7 +8571,7 @@
8541
8571
  <xsl:template match="*[local-name() = 'callout']">
8542
8572
  <xsl:choose>
8543
8573
  <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
8544
- <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
8574
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{normalize-space()}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
8545
8575
  </xsl:choose>
8546
8576
  </xsl:template>
8547
8577
 
@@ -8570,7 +8600,10 @@
8570
8600
  <xsl:template match="*[local-name() = 'xref']">
8571
8601
  <xsl:call-template name="insert_basic_link">
8572
8602
  <xsl:with-param name="element">
8573
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
8603
+ <xsl:variable name="alt_text">
8604
+ <xsl:call-template name="getAltText"/>
8605
+ </xsl:variable>
8606
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
8574
8607
  <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[local-name() = 'table' or local-name() = 'dl'])">
8575
8608
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
8576
8609
  </xsl:if>
@@ -11071,12 +11104,14 @@
11071
11104
 
11072
11105
  <xsl:when test="contains(normalize-space($fo_element), 'list')">
11073
11106
 
11074
- <xsl:variable name="provisional_distance_between_starts">
11107
+ <xsl:variable name="provisional_distance_between_starts_">
11075
11108
  7
11076
11109
  </xsl:variable>
11077
- <xsl:variable name="indent">
11110
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
11111
+ <xsl:variable name="indent_">
11078
11112
  0
11079
11113
  </xsl:variable>
11114
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
11080
11115
 
11081
11116
  <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
11082
11117
  <fo:list-item>
@@ -11800,14 +11835,17 @@
11800
11835
  </xsl:when>
11801
11836
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
11802
11837
 
11803
- <xsl:variable name="label">
11838
+ <xsl:variable name="type" select="../@type"/>
11804
11839
 
11805
- <xsl:variable name="type" select="../@type"/>
11840
+ <xsl:variable name="label">
11806
11841
 
11807
11842
  <xsl:variable name="style_prefix_">
11808
11843
  <xsl:if test="$type = 'roman'">
11809
11844
  <!-- Example: (i) -->
11810
11845
  </xsl:if>
11846
+ <xsl:if test="$type = 'alphabet'">
11847
+
11848
+ </xsl:if>
11811
11849
  </xsl:variable>
11812
11850
  <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
11813
11851
 
@@ -11833,13 +11871,15 @@
11833
11871
  <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
11834
11872
  <xsl:value-of select="$style_prefix"/>
11835
11873
  </xsl:if>
11874
+
11836
11875
  <xsl:value-of select="@label"/>
11876
+
11837
11877
  <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
11838
11878
  <xsl:value-of select="$style_suffix"/>
11839
11879
  </xsl:if>
11840
11880
  </xsl:variable>
11841
11881
 
11842
- <xsl:value-of select="normalize-space($label)"/>
11882
+ <xsl:value-of select="normalize-space($label)"/>
11843
11883
 
11844
11884
  </xsl:when>
11845
11885
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
@@ -14045,7 +14085,8 @@
14045
14085
  <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
14046
14086
  <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
14047
14087
  <!-- Todo: need update -->
14048
- <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
14088
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
14089
+ <xsl:variable name="volatile" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
14049
14090
 
14050
14091
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
14051
14092
  <xsl:attribute name="src">
@@ -14066,6 +14107,9 @@
14066
14107
  <xsl:if test="$afrelationship != ''">
14067
14108
  <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
14068
14109
  </xsl:if>
14110
+ <xsl:if test="$volatile != ''">
14111
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
14112
+ </xsl:if>
14069
14113
  </pdf:embedded-file>
14070
14114
  </xsl:for-each>
14071
14115
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
@@ -14076,14 +14120,18 @@
14076
14120
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
14077
14121
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
14078
14122
  <!-- Todo: need update -->
14079
- <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
14123
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
14124
+ <xsl:variable name="volatile" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
14080
14125
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
14081
14126
  <xsl:if test="$description != ''">
14082
14127
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
14083
14128
  </xsl:if>
14084
14129
  <xsl:if test="$afrelationship != ''">
14085
- <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
14086
- </xsl:if>
14130
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
14131
+ </xsl:if>
14132
+ <xsl:if test="$volatile != ''">
14133
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
14134
+ </xsl:if>
14087
14135
  </pdf:embedded-file>
14088
14136
  </xsl:for-each>
14089
14137
  </xsl:if>
@@ -14130,10 +14178,31 @@
14130
14178
  <xsl:value-of select="$level_total - 2"/>
14131
14179
  </xsl:when>
14132
14180
  <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
14133
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
14181
+ <!-- determine 'depth' depends on upper clause with title/@depth -->
14182
+ <!-- <xsl:message>title=<xsl:value-of select="."/></xsl:message> -->
14183
+ <xsl:variable name="clause_with_depth_depth" select="ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/*[local-name() = 'title']/@depth"/>
14184
+ <!-- <xsl:message>clause_with_depth_depth=<xsl:value-of select="$clause_with_depth_depth"/></xsl:message> -->
14185
+ <xsl:variable name="clause_with_depth_level" select="count(ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/ancestor::*)"/>
14186
+ <!-- <xsl:message>clause_with_depth_level=<xsl:value-of select="$clause_with_depth_level"/></xsl:message> -->
14187
+ <xsl:variable name="curr_level" select="count(ancestor::*) - 1"/>
14188
+ <!-- <xsl:message>curr_level=<xsl:value-of select="$curr_level"/></xsl:message> -->
14189
+ <!-- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/> -->
14190
+ <xsl:variable name="curr_clause_depth" select="number($clause_with_depth_depth) + (number($curr_level) - number($clause_with_depth_level)) "/>
14191
+ <!-- <xsl:message>curr_clause_depth=<xsl:value-of select="$curr_clause_depth"/></xsl:message> -->
14134
14192
  <xsl:choose>
14135
- <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
14136
- <xsl:value-of select="number($upper_clause_depth + 1)"/>
14193
+ <xsl:when test="string(number($curr_clause_depth)) != 'NaN'">
14194
+ <xsl:value-of select="number($curr_clause_depth)"/>
14195
+ </xsl:when>
14196
+ <xsl:otherwise>
14197
+ <xsl:value-of select="$level_total - 2"/>
14198
+ </xsl:otherwise>
14199
+ </xsl:choose>
14200
+ </xsl:when>
14201
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'name'] and parent::*[local-name() = 'term']">
14202
+ <xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::*[local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
14203
+ <xsl:choose>
14204
+ <xsl:when test="string(number($upper_terms_depth)) != 'NaN'">
14205
+ <xsl:value-of select="number($upper_terms_depth + 1)"/>
14137
14206
  </xsl:when>
14138
14207
  <xsl:otherwise>
14139
14208
  <xsl:value-of select="$level_total - 2"/>
@@ -14141,7 +14210,7 @@
14141
14210
  </xsl:choose>
14142
14211
  </xsl:when>
14143
14212
  <xsl:when test="ancestor::*[local-name() = 'sections']">
14144
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
14213
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause' or local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
14145
14214
  <xsl:choose>
14146
14215
  <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
14147
14216
  <xsl:value-of select="number($upper_clause_depth + 1)"/>
@@ -72,6 +72,9 @@ standards defining organization, and that is rendered in a distinct manner</a:do
72
72
  from other documents in the same doctype</a:documentation>
73
73
  </ref>
74
74
  </optional>
75
+ <ref name="flavor">
76
+ <a:documentation>Flavour of Metanorma used to process this document</a:documentation>
77
+ </ref>
75
78
  <optional>
76
79
  <ref name="editorialgroup">
77
80
  <a:documentation>Groups associated with the production of the standards document, typically within
@@ -113,6 +116,16 @@ a standards definition organization</a:documentation>
113
116
  <define name="DocumentSubtype">
114
117
  <text/>
115
118
  </define>
119
+ <define name="flavor">
120
+ <element name="flavor">
121
+ <ref name="MetanormaFlavor"/>
122
+ </element>
123
+ </define>
124
+ <define name="MetanormaFlavor">
125
+ <a:documentation>This is in fact an enum, as of this writing: standoc iso generic ietf ieee itu nist ogc csa cc iho ribose jis iec bsi bipm plateau.
126
+ However we prefer not to hardcode it, given ongoing extension.</a:documentation>
127
+ <text/>
128
+ </define>
116
129
  <define name="editorialgroup">
117
130
  <a:documentation>A group associated with the production of the standards document, typically within
118
131
  a standards definition organization</a:documentation>
@@ -1382,18 +1382,7 @@ Applies whether the resource has already been created or not, and whether it is
1382
1382
  <define name="bdate">
1383
1383
  <a:documentation>Significant date in the lifecycle of the bibliographic item, including its production and its access</a:documentation>
1384
1384
  <element name="date">
1385
- <attribute name="type">
1386
- <a:documentation>The phase of the production of or access to a bibliographic item</a:documentation>
1387
- <choice>
1388
- <ref name="BibliographicDateType"/>
1389
- <text/>
1390
- </choice>
1391
- </attribute>
1392
- <optional>
1393
- <attribute name="text">
1394
- <a:documentation>An optional textual description of the date, especially when a Gregorian date is not applicable</a:documentation>
1395
- </attribute>
1396
- </optional>
1385
+ <ref name="bDateAttributes"/>
1397
1386
  <optional>
1398
1387
  <choice>
1399
1388
  <group>
@@ -1416,6 +1405,20 @@ Applies whether the resource has already been created or not, and whether it is
1416
1405
  </optional>
1417
1406
  </element>
1418
1407
  </define>
1408
+ <define name="bDateAttributes">
1409
+ <attribute name="type">
1410
+ <a:documentation>The phase of the production of or access to a bibliographic item</a:documentation>
1411
+ <choice>
1412
+ <ref name="BibliographicDateType"/>
1413
+ <text/>
1414
+ </choice>
1415
+ </attribute>
1416
+ <optional>
1417
+ <attribute name="text">
1418
+ <a:documentation>An optional textual description of the date, especially when a Gregorian date is not applicable</a:documentation>
1419
+ </attribute>
1420
+ </optional>
1421
+ </define>
1419
1422
  <define name="docidentifier">
1420
1423
  <a:documentation>An identifier of a bibliographic item in an international standard scheme</a:documentation>
1421
1424
  <element name="docidentifier">
@@ -1884,6 +1887,10 @@ Detailed in https://www.relaton.org/model/relations/</a:documentation>
1884
1887
  <value>hasAnnotation</value>
1885
1888
  <value>draftOf</value>
1886
1889
  <value>hasDraft</value>
1890
+ <value>preliminaryDraftOf</value>
1891
+ <value>hasPreliminaryDraft</value>
1892
+ <value>revisionDraftOf</value>
1893
+ <value>hasRevisionDraft</value>
1887
1894
  <value>editionOf</value>
1888
1895
  <value>hasEdition</value>
1889
1896
  <value>updates</value>
@@ -5,7 +5,7 @@ require_relative "front"
5
5
 
6
6
  module Metanorma
7
7
  module Iec
8
- class Converter < ISO::Converter
8
+ class Converter < Iso::Converter
9
9
  XML_ROOT_TAG = "iec-standard".freeze
10
10
  XML_NAMESPACE = "https://www.metanorma.org/ns/iec".freeze
11
11
 
@@ -2,7 +2,7 @@ require "pubid-iec"
2
2
 
3
3
  module Metanorma
4
4
  module Iec
5
- class Converter < ISO::Converter
5
+ class Converter < Iso::Converter
6
6
  def default_publisher
7
7
  "IEC"
8
8
  end
@@ -9,6 +9,7 @@
9
9
  <optional>
10
10
  <ref name="docsubtype"/>
11
11
  </optional>
12
+ <ref name="flavor"/>
12
13
  <optional>
13
14
  <ref name="horizontal"/>
14
15
  </optional>
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "2.5.4".freeze
3
+ VERSION = "2.5.5".freeze
4
4
  end
5
5
  end
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.4
4
+ version: 2.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-30 00:00:00.000000000 Z
11
+ date: 2024-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso