metanorma-iec 2.5.4 → 2.5.6

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: f918d2d4de755bfda4e2a14f98d9b99204aa777ed615c517ea873176593b810a
4
- data.tar.gz: 8520e503f38b00d06ac8ad6758e79104e80350b1ee2b1282fcedfc521e729b92
3
+ metadata.gz: 78359e2ac02b91e944cc5f6ca43a5f75bb7815bbec9b12095904b7e0b2b03c92
4
+ data.tar.gz: 5aafa118815a882f6d6b77d0d92f8a3810973e1823d244edf8d8aa5a46763df6
5
5
  SHA512:
6
- metadata.gz: c097a715deb9e05a1c6ca0b9ea5fe80aad4f070c6db5cf5714034d5a6fa9add0287e71fb203498c75fd4e899c250a4774e2dd9408c9558a33a2ab41093f1a043
7
- data.tar.gz: 2af3c2050c896f922e6a8bca89fc0867981965dcdcb00d7ff0bebf4b6577d62317358394270651355e9286e5a5b2e1614155389be4f4bbfd1af78f59112b0b46
6
+ metadata.gz: 752e4dd0e8170ac2b9d890df5d3a8703cbf76d63c1598df38381a7118129d51bbc75cf1f2b86d00892f35d92df483ff7030b9dfeb3f148135d5b0af48cb24cb8
7
+ data.tar.gz: 056c959058c619cb27330f33a3430ed8b4dcb4ea812381fc4dc9953f088a21b27d85b5a793c09381264082ab292ae1002fa808786df24af3c8c6a4963d39e8ac
@@ -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
 
@@ -5651,10 +5658,14 @@
5651
5658
  <xsl:variable name="fn_styles">
5652
5659
  <xsl:choose>
5653
5660
  <xsl:when test="ancestor::*[local-name() = 'bibitem']">
5654
- <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
5661
+ <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
5662
+
5663
+ </fn_styles>
5655
5664
  </xsl:when>
5656
5665
  <xsl:otherwise>
5657
- <fn_styles xsl:use-attribute-sets="fn-num-style"/>
5666
+ <fn_styles xsl:use-attribute-sets="fn-num-style">
5667
+
5668
+ </fn_styles>
5658
5669
  </xsl:otherwise>
5659
5670
  </xsl:choose>
5660
5671
  </xsl:variable>
@@ -5669,8 +5680,10 @@
5669
5680
 
5670
5681
  <xsl:call-template name="insert_basic_link">
5671
5682
  <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"/>
5683
+ <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 -->
5684
+ <fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
5685
+ <xsl:copy-of select="$current_fn_number_text"/>
5686
+ </fo:inline>
5674
5687
  </fo:basic-link>
5675
5688
  </xsl:with-param>
5676
5689
  </xsl:call-template>
@@ -5951,7 +5964,7 @@
5951
5964
 
5952
5965
  <xsl:call-template name="refine_fn-reference-style"/>
5953
5966
 
5954
- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5967
+ <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5955
5968
  <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
5956
5969
  <xsl:attribute name="internal-destination">
5957
5970
  <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
@@ -6963,9 +6976,19 @@
6963
6976
  </fo:inline>
6964
6977
  </xsl:template>
6965
6978
 
6966
- <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
6979
+ <xsl:template match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
6980
+ <xsl:param name="txt"/>
6967
6981
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
6968
- <xsl:variable name="text" select="."/>
6982
+ <xsl:variable name="text">
6983
+ <xsl:choose>
6984
+ <xsl:when test="$txt != ''">
6985
+ <xsl:value-of select="$txt"/>
6986
+ </xsl:when>
6987
+ <xsl:otherwise>
6988
+ <xsl:value-of select="."/>
6989
+ </xsl:otherwise>
6990
+ </xsl:choose>
6991
+ </xsl:variable>
6969
6992
  <xsl:variable name="ratio_">
6970
6993
  0.75
6971
6994
  </xsl:variable>
@@ -8482,9 +8505,12 @@
8482
8505
  <xsl:apply-templates/>
8483
8506
  </xsl:when>
8484
8507
  <xsl:otherwise>
8508
+ <xsl:variable name="alt_text">
8509
+ <xsl:call-template name="getAltText"/>
8510
+ </xsl:variable>
8485
8511
  <xsl:call-template name="insert_basic_link">
8486
8512
  <xsl:with-param name="element">
8487
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
8513
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$alt_text}">
8488
8514
  <xsl:if test="$isLinkToEmbeddedFile = 'true'">
8489
8515
  <xsl:attribute name="role">Annot</xsl:attribute>
8490
8516
  </xsl:if>
@@ -8511,6 +8537,14 @@
8511
8537
  </fo:inline>
8512
8538
  </xsl:template> <!-- link -->
8513
8539
 
8540
+ <xsl:template name="getAltText">
8541
+ <xsl:choose>
8542
+ <xsl:when test="normalize-space(.) = ''"><xsl:value-of select="@target"/></xsl:when>
8543
+ <xsl:otherwise><xsl:value-of select="normalize-space(translate(normalize-space(), ' —', ' -'))"/></xsl:otherwise>
8544
+ <!-- <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise> -->
8545
+ </xsl:choose>
8546
+ </xsl:template>
8547
+
8514
8548
  <!-- ======================== -->
8515
8549
  <!-- Appendix processing -->
8516
8550
  <!-- ======================== -->
@@ -8541,7 +8575,7 @@
8541
8575
  <xsl:template match="*[local-name() = 'callout']">
8542
8576
  <xsl:choose>
8543
8577
  <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>
8578
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{normalize-space()}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
8545
8579
  </xsl:choose>
8546
8580
  </xsl:template>
8547
8581
 
@@ -8570,10 +8604,14 @@
8570
8604
  <xsl:template match="*[local-name() = 'xref']">
8571
8605
  <xsl:call-template name="insert_basic_link">
8572
8606
  <xsl:with-param name="element">
8573
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
8607
+ <xsl:variable name="alt_text">
8608
+ <xsl:call-template name="getAltText"/>
8609
+ </xsl:variable>
8610
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
8574
8611
  <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
8612
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
8576
8613
  </xsl:if>
8614
+
8577
8615
  <xsl:if test="parent::*[local-name() = 'add']">
8578
8616
  <xsl:call-template name="append_add-style"/>
8579
8617
  </xsl:if>
@@ -8682,44 +8720,44 @@
8682
8720
 
8683
8721
  <xsl:template match="*[local-name() = 'note']" name="note">
8684
8722
 
8685
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
8723
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
8686
8724
 
8687
- <xsl:call-template name="setBlockSpanAll"/>
8725
+ <xsl:call-template name="setBlockSpanAll"/>
8688
8726
 
8689
- <xsl:call-template name="refine_note-style"/>
8727
+ <xsl:call-template name="refine_note-style"/>
8690
8728
 
8691
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8729
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8692
8730
 
8693
- <fo:block>
8731
+ <fo:block>
8694
8732
 
8695
- <xsl:call-template name="refine_note_block_style"/>
8733
+ <xsl:call-template name="refine_note_block_style"/>
8696
8734
 
8697
- <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
8735
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
8698
8736
 
8699
- <xsl:call-template name="refine_note-name-style"/>
8737
+ <xsl:call-template name="refine_note-name-style"/>
8700
8738
 
8701
- <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
8702
- <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
8703
- <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
8704
- <xsl:call-template name="append_add-style"/>
8705
- </xsl:if>
8739
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
8740
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
8741
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
8742
+ <xsl:call-template name="append_add-style"/>
8743
+ </xsl:if>
8706
8744
 
8707
- <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
8708
- <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8709
- <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8710
- <xsl:with-param name="skip">false</xsl:with-param>
8711
- </xsl:apply-templates>
8712
- </xsl:if>
8745
+ <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
8746
+ <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8747
+ <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8748
+ <xsl:with-param name="skip">false</xsl:with-param>
8749
+ </xsl:apply-templates>
8750
+ </xsl:if>
8713
8751
 
8714
- <xsl:apply-templates select="*[local-name() = 'name']"/>
8752
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
8715
8753
 
8716
- </fo:inline>
8754
+ </fo:inline>
8717
8755
 
8718
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8719
- </fo:block>
8756
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8757
+ </fo:block>
8720
8758
 
8721
- </fo:block-container>
8722
- </fo:block-container>
8759
+ </fo:block-container>
8760
+ </fo:block-container>
8723
8761
 
8724
8762
  </xsl:template>
8725
8763
 
@@ -11071,12 +11109,14 @@
11071
11109
 
11072
11110
  <xsl:when test="contains(normalize-space($fo_element), 'list')">
11073
11111
 
11074
- <xsl:variable name="provisional_distance_between_starts">
11112
+ <xsl:variable name="provisional_distance_between_starts_">
11075
11113
  7
11076
11114
  </xsl:variable>
11077
- <xsl:variable name="indent">
11115
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
11116
+ <xsl:variable name="indent_">
11078
11117
  0
11079
11118
  </xsl:variable>
11119
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
11080
11120
 
11081
11121
  <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
11082
11122
  <fo:list-item>
@@ -11140,6 +11180,7 @@
11140
11180
  </xsl:when>
11141
11181
  <xsl:when test="contains(normalize-space($fo_element), 'block')">
11142
11182
  <fo:block xsl:use-attribute-sets="example-name-style">
11183
+
11143
11184
  <xsl:apply-templates/>
11144
11185
  </fo:block>
11145
11186
  </xsl:when>
@@ -11155,6 +11196,7 @@
11155
11196
 
11156
11197
  <xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name']">
11157
11198
  <fo:inline xsl:use-attribute-sets="example-name-style">
11199
+
11158
11200
  <xsl:apply-templates/>
11159
11201
  </fo:inline>
11160
11202
  </xsl:template>
@@ -11529,12 +11571,14 @@
11529
11571
 
11530
11572
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
11531
11573
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
11574
+
11532
11575
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
11533
11576
  </fo:block>
11534
11577
  </xsl:if>
11535
11578
 
11536
11579
  <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
11537
11580
  <xsl:call-template name="setStyle_preferred"/>
11581
+
11538
11582
  <xsl:apply-templates/>
11539
11583
  </fo:block>
11540
11584
  </fo:block>
@@ -11800,14 +11844,17 @@
11800
11844
  </xsl:when>
11801
11845
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
11802
11846
 
11803
- <xsl:variable name="label">
11847
+ <xsl:variable name="type" select="../@type"/>
11804
11848
 
11805
- <xsl:variable name="type" select="../@type"/>
11849
+ <xsl:variable name="label">
11806
11850
 
11807
11851
  <xsl:variable name="style_prefix_">
11808
11852
  <xsl:if test="$type = 'roman'">
11809
11853
  <!-- Example: (i) -->
11810
11854
  </xsl:if>
11855
+ <xsl:if test="$type = 'alphabet'">
11856
+
11857
+ </xsl:if>
11811
11858
  </xsl:variable>
11812
11859
  <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
11813
11860
 
@@ -11833,13 +11880,15 @@
11833
11880
  <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
11834
11881
  <xsl:value-of select="$style_prefix"/>
11835
11882
  </xsl:if>
11883
+
11836
11884
  <xsl:value-of select="@label"/>
11885
+
11837
11886
  <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
11838
11887
  <xsl:value-of select="$style_suffix"/>
11839
11888
  </xsl:if>
11840
11889
  </xsl:variable>
11841
11890
 
11842
- <xsl:value-of select="normalize-space($label)"/>
11891
+ <xsl:value-of select="normalize-space($label)"/>
11843
11892
 
11844
11893
  </xsl:when>
11845
11894
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
@@ -14045,7 +14094,8 @@
14045
14094
  <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
14046
14095
  <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
14047
14096
  <!-- Todo: need update -->
14048
- <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
14097
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
14098
+ <xsl:variable name="volatile" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
14049
14099
 
14050
14100
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
14051
14101
  <xsl:attribute name="src">
@@ -14066,6 +14116,9 @@
14066
14116
  <xsl:if test="$afrelationship != ''">
14067
14117
  <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
14068
14118
  </xsl:if>
14119
+ <xsl:if test="$volatile != ''">
14120
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
14121
+ </xsl:if>
14069
14122
  </pdf:embedded-file>
14070
14123
  </xsl:for-each>
14071
14124
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
@@ -14076,14 +14129,18 @@
14076
14129
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
14077
14130
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
14078
14131
  <!-- Todo: need update -->
14079
- <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
14132
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
14133
+ <xsl:variable name="volatile" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
14080
14134
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
14081
14135
  <xsl:if test="$description != ''">
14082
14136
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
14083
14137
  </xsl:if>
14084
14138
  <xsl:if test="$afrelationship != ''">
14085
- <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
14086
- </xsl:if>
14139
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
14140
+ </xsl:if>
14141
+ <xsl:if test="$volatile != ''">
14142
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
14143
+ </xsl:if>
14087
14144
  </pdf:embedded-file>
14088
14145
  </xsl:for-each>
14089
14146
  </xsl:if>
@@ -14130,10 +14187,31 @@
14130
14187
  <xsl:value-of select="$level_total - 2"/>
14131
14188
  </xsl:when>
14132
14189
  <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)"/>
14190
+ <!-- determine 'depth' depends on upper clause with title/@depth -->
14191
+ <!-- <xsl:message>title=<xsl:value-of select="."/></xsl:message> -->
14192
+ <xsl:variable name="clause_with_depth_depth" select="ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/*[local-name() = 'title']/@depth"/>
14193
+ <!-- <xsl:message>clause_with_depth_depth=<xsl:value-of select="$clause_with_depth_depth"/></xsl:message> -->
14194
+ <xsl:variable name="clause_with_depth_level" select="count(ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/ancestor::*)"/>
14195
+ <!-- <xsl:message>clause_with_depth_level=<xsl:value-of select="$clause_with_depth_level"/></xsl:message> -->
14196
+ <xsl:variable name="curr_level" select="count(ancestor::*) - 1"/>
14197
+ <!-- <xsl:message>curr_level=<xsl:value-of select="$curr_level"/></xsl:message> -->
14198
+ <!-- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/> -->
14199
+ <xsl:variable name="curr_clause_depth" select="number($clause_with_depth_depth) + (number($curr_level) - number($clause_with_depth_level)) "/>
14200
+ <!-- <xsl:message>curr_clause_depth=<xsl:value-of select="$curr_clause_depth"/></xsl:message> -->
14134
14201
  <xsl:choose>
14135
- <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
14136
- <xsl:value-of select="number($upper_clause_depth + 1)"/>
14202
+ <xsl:when test="string(number($curr_clause_depth)) != 'NaN'">
14203
+ <xsl:value-of select="number($curr_clause_depth)"/>
14204
+ </xsl:when>
14205
+ <xsl:otherwise>
14206
+ <xsl:value-of select="$level_total - 2"/>
14207
+ </xsl:otherwise>
14208
+ </xsl:choose>
14209
+ </xsl:when>
14210
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'name'] and parent::*[local-name() = 'term']">
14211
+ <xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::*[local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
14212
+ <xsl:choose>
14213
+ <xsl:when test="string(number($upper_terms_depth)) != 'NaN'">
14214
+ <xsl:value-of select="number($upper_terms_depth + 1)"/>
14137
14215
  </xsl:when>
14138
14216
  <xsl:otherwise>
14139
14217
  <xsl:value-of select="$level_total - 2"/>
@@ -14141,7 +14219,7 @@
14141
14219
  </xsl:choose>
14142
14220
  </xsl:when>
14143
14221
  <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)"/>
14222
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause' or local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
14145
14223
  <xsl:choose>
14146
14224
  <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
14147
14225
  <xsl:value-of select="number($upper_clause_depth + 1)"/>
@@ -14458,9 +14536,10 @@
14458
14536
  <xsl:template name="insertBackgroundPageImage">
14459
14537
  <xsl:param name="number">1</xsl:param>
14460
14538
  <xsl:param name="name">coverpage-image</xsl:param>
14539
+ <xsl:param name="suffix"/>
14461
14540
  <xsl:variable name="num" select="number($number)"/>
14462
14541
  <!-- background image -->
14463
- <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage_{$name}_{$number}_{generate-id()}">
14542
+ <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
14464
14543
  <fo:block>
14465
14544
  <xsl:for-each select="/*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = $name][1]/*[local-name() = 'value']/*[local-name() = 'image'][$num]">
14466
14545
  <xsl:choose>
@@ -14526,16 +14605,29 @@
14526
14605
 
14527
14606
  <!-- END: insert cover page image -->
14528
14607
 
14608
+ <xsl:variable name="regex_ja_spec">[\uFF08\uFF09]</xsl:variable>
14529
14609
  <xsl:template name="insertVerticalChar">
14530
14610
  <xsl:param name="str"/>
14611
+ <xsl:param name="writing-mode">lr-tb</xsl:param>
14612
+ <xsl:param name="reference-orientation">90</xsl:param>
14531
14613
  <xsl:if test="string-length($str) &gt; 0">
14532
- <fo:inline-container writing-mode="lr-tb" text-align="center" alignment-baseline="central" reference-orientation="90" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
14614
+ <fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
14615
+ <xsl:if test="normalize-space($writing-mode) != ''">
14616
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
14617
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
14618
+ </xsl:if>
14619
+ <xsl:variable name="char" select="substring($str,1,1)"/>
14620
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
14621
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
14622
+ </xsl:if>
14533
14623
  <fo:block-container width="1em">
14534
- <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
14624
+ <fo:block line-height="1em"><xsl:value-of select="$char"/></fo:block>
14535
14625
  </fo:block-container>
14536
14626
  </fo:inline-container>
14537
14627
  <xsl:call-template name="insertVerticalChar">
14538
14628
  <xsl:with-param name="str" select="substring($str, 2)"/>
14629
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
14630
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
14539
14631
  </xsl:call-template>
14540
14632
  </xsl:if>
14541
14633
  </xsl:template>
@@ -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.6".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.6
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-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso