metanorma-iec 2.6.4 → 2.6.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: d645d0456c36e2e19ebbd941038de52eec9fc67290d093ff6dac57d07f405daa
4
- data.tar.gz: d9e0901468f752d0de9ad4643f0cc5098f61ea729b4f88ec0af158a391ce03b3
3
+ metadata.gz: 1296b9053330a3b20cefbc335eb85773cb810eb652e415ab82aed00b36231208
4
+ data.tar.gz: cbcf40905e7062594c8ce45ceb430127157143bb1351094fe1fa53204f239dbe
5
5
  SHA512:
6
- metadata.gz: bbcb2ffa1835118482ed4887ac89e7f3ff444df83cbf3ef6a8c51b2e7e4ec4951b788b545b26bce6ff50b28bbd12791491acf147d72e0ba039b4ac89220136f4
7
- data.tar.gz: e1b0276f83a63434a4dad3dbd7bfcb3854b41c37e256d1473ad61591f6e4f1dc8a484bf94e323455c04e6bf9eaf3cd2f7ca2bfdebbdeba643081bbadc820d2ef
6
+ metadata.gz: b5026b5f035412c6041511f06ea96446e2c89939eac79789addbf7233b3fe5b95d6fab06c1b3658132492592cfe082a4992214e60786c2fbfd709c568603b282
7
+ data.tar.gz: b204e598e33cea5f76b94000fbd863ec43d4c25a76dd7d774bac57d1186d44a4ddbc555770b781f3492dc27bb0b8fa0844599e5d9982bacbcde4e6d9d33ceaff
@@ -4568,8 +4568,14 @@
4568
4568
  </xsl:choose>
4569
4569
  </xsl:variable>
4570
4570
 
4571
+ <xsl:call-template name="setNamedDestination"/>
4572
+
4571
4573
  <fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
4572
4574
 
4575
+ <xsl:for-each select="*[local-name() = 'name']">
4576
+ <xsl:call-template name="setIDforNamedDestination"/>
4577
+ </xsl:for-each>
4578
+
4573
4579
  <xsl:call-template name="refine_table-container-style">
4574
4580
  <xsl:with-param name="margin-side" select="$margin-side"/>
4575
4581
  </xsl:call-template>
@@ -4779,6 +4785,7 @@
4779
4785
  <!-- table/name-->
4780
4786
  <xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
4781
4787
  <xsl:param name="continued"/>
4788
+ <xsl:param name="cols-count"/>
4782
4789
  <xsl:if test="normalize-space() != ''">
4783
4790
 
4784
4791
  <fo:block xsl:use-attribute-sets="table-name-style">
@@ -4810,9 +4817,30 @@
4810
4817
 
4811
4818
  <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
4812
4819
  <xsl:if test="$continued = 'true'">
4813
- <fo:block text-align="right">
4814
- <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
4815
- </fo:block>
4820
+
4821
+ <!-- to prevent the error 'THead element may contain only TR elements' -->
4822
+
4823
+ <xsl:choose>
4824
+ <xsl:when test="string(number($cols-count)) != 'NaN'">
4825
+ <fo:table width="100%" table-layout="fixed" role="SKIP">
4826
+ <fo:table-body role="SKIP">
4827
+ <fo:table-row>
4828
+ <fo:table-cell role="TH" number-columns-spanned="{$cols-count}">
4829
+ <fo:block text-align="right" role="SKIP">
4830
+ <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
4831
+ </fo:block>
4832
+ </fo:table-cell>
4833
+ </fo:table-row>
4834
+ </fo:table-body>
4835
+ </fo:table>
4836
+ </xsl:when>
4837
+ <xsl:otherwise>
4838
+ <fo:block text-align="right">
4839
+ <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
4840
+ </fo:block>
4841
+ </xsl:otherwise>
4842
+ </xsl:choose>
4843
+
4816
4844
  </xsl:if>
4817
4845
  <!-- </xsl:if> -->
4818
4846
 
@@ -5209,6 +5237,7 @@
5209
5237
 
5210
5238
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
5211
5239
  <xsl:with-param name="continued">true</xsl:with-param>
5240
+ <xsl:with-param name="cols-count" select="$cols-count"/>
5212
5241
  </xsl:apply-templates>
5213
5242
 
5214
5243
  <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
@@ -5388,7 +5417,8 @@
5388
5417
 
5389
5418
  <!-- if there isn't 'thead' and there is a table's title -->
5390
5419
  <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='thead']) and ancestor::*[local-name()='table']/*[local-name()='name']">
5391
- <fo:table-header role="Caption">
5420
+ <fo:table-header>
5421
+
5392
5422
  <xsl:call-template name="table-header-title">
5393
5423
  <xsl:with-param name="cols-count" select="$cols-count"/>
5394
5424
  </xsl:call-template>
@@ -5645,8 +5675,8 @@
5645
5675
  <xsl:for-each select="xalan:nodeset($styles__)/item">
5646
5676
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
5647
5677
  <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
5648
- <xsl:if test="$key = 'color' or $key = 'background-color'">
5649
- <style name="{$key}"><xsl:value-of select="$value"/></style>
5678
+ <xsl:if test="$key = 'color' or $key = 'background-color' or $key = 'border' or $key = 'border-top' or $key = 'border-right' or $key = 'border-left' or $key = 'border-bottom' or $key = 'border-style' or $key = 'border-width' or $key = 'border-color' or $key = 'border-top-style' or $key = 'border-top-width' or $key = 'border-top-color' or $key = 'border-right-style' or $key = 'border-right-width' or $key = 'border-right-color' or $key = 'border-left-style' or $key = 'border-left-width' or $key = 'border-left-color' or $key = 'border-bottom-style' or $key = 'border-bottom-width' or $key = 'border-bottom-color'">
5679
+ <style name="{$key}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($value), 'currentColor', 'inherit')"/></style>
5650
5680
  </xsl:if>
5651
5681
  </xsl:for-each>
5652
5682
  </xsl:variable>
@@ -5710,6 +5740,7 @@
5710
5740
  <!-- table/note, table/example, table/tfoot//note, table/tfoot//example -->
5711
5741
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example'] | *[local-name()='table']/*[local-name()='tfoot']//*[local-name()='note' or local-name() = 'example']" priority="2">
5712
5742
 
5743
+ <xsl:call-template name="setNamedDestination"/>
5713
5744
  <fo:block xsl:use-attribute-sets="table-note-style">
5714
5745
  <xsl:copy-of select="@id"/>
5715
5746
 
@@ -6237,7 +6268,7 @@
6237
6268
  <xsl:variable name="target" select="@target"/>
6238
6269
  <xsl:choose>
6239
6270
  <!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
6240
- <xsl:when test="not(ancestor::*[local-name() = 'table'][1]/*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body'][@id = $target]) and $footnotes/*[local-name() = 'fmt-fn-body'][@id = $target]">
6271
+ <xsl:when test="not(ancestor::*[local-name() = 'table'][1]//*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body'][@id = $target]) and $footnotes/*[local-name() = 'fmt-fn-body'][@id = $target]">
6241
6272
  <xsl:call-template name="fn">
6242
6273
  <xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
6243
6274
  </xsl:call-template>
@@ -6333,6 +6364,10 @@
6333
6364
  <!-- <dl><xsl:copy-of select="."/></dl> -->
6334
6365
  <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
6335
6366
 
6367
+ <xsl:if test="@key = 'true' and ancestor::*[local-name() = 'figure']">
6368
+ <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
6369
+ </xsl:if>
6370
+
6336
6371
  <xsl:call-template name="setBlockSpanAll"/>
6337
6372
 
6338
6373
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
@@ -6633,7 +6668,7 @@
6633
6668
 
6634
6669
  <!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
6635
6670
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
6636
- <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
6671
+ <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always" keep-with-previous="always">
6637
6672
  <xsl:call-template name="refine_figure_key_style"/>
6638
6673
  <xsl:apply-templates/>
6639
6674
  </fo:block>
@@ -6889,6 +6924,7 @@
6889
6924
 
6890
6925
  <xsl:call-template name="refine_dt-cell-style"/>
6891
6926
 
6927
+ <xsl:call-template name="setNamedDestination"/>
6892
6928
  <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
6893
6929
 
6894
6930
  <xsl:choose>
@@ -7325,7 +7361,7 @@
7325
7361
  <!-- ================= -->
7326
7362
 
7327
7363
  <!-- highlight text -->
7328
- <xsl:template match="*[local-name()='hi']">
7364
+ <xsl:template match="*[local-name()='hi'] | *[local-name() = 'span'][@class = 'fmt-hi']" priority="3">
7329
7365
  <fo:inline background-color="yellow">
7330
7366
  <xsl:apply-templates/>
7331
7367
  </fo:inline>
@@ -8991,6 +9027,7 @@
8991
9027
  <!-- Appendix processing -->
8992
9028
  <!-- ======================== -->
8993
9029
  <xsl:template match="*[local-name()='appendix']">
9030
+ <xsl:call-template name="setNamedDestination"/>
8994
9031
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
8995
9032
  <xsl:apply-templates select="*[local-name()='title']"/>
8996
9033
  </fo:block>
@@ -9001,13 +9038,14 @@
9001
9038
  <xsl:variable name="level">
9002
9039
  <xsl:call-template name="getLevel"/>
9003
9040
  </xsl:variable>
9004
- <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
9041
+ <fo:inline role="H{$level}"><xsl:call-template name="setIDforNamedDestination"/><xsl:apply-templates/></fo:inline>
9005
9042
  </xsl:template>
9006
9043
  <!-- ======================== -->
9007
9044
  <!-- END Appendix processing -->
9008
9045
  <!-- ======================== -->
9009
9046
 
9010
9047
  <xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
9048
+ <xsl:call-template name="setNamedDestination"/>
9011
9049
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
9012
9050
  <xsl:apply-templates select="*[local-name()='name']"/>
9013
9051
  </fo:block>
@@ -9037,6 +9075,7 @@
9037
9075
  <xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
9038
9076
  <xsl:param name="callout"/>
9039
9077
  <fo:inline id="{@id}">
9078
+ <xsl:call-template name="setNamedDestination"/>
9040
9079
  <!-- for first p in annotation, put <x> -->
9041
9080
  <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
9042
9081
  <xsl:apply-templates/>
@@ -9083,6 +9122,7 @@
9083
9122
 
9084
9123
  </xsl:if>
9085
9124
  <fo:block-container margin-left="0mm" role="SKIP">
9125
+ <xsl:call-template name="setNamedDestination"/>
9086
9126
  <fo:block id="{@id}">
9087
9127
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
9088
9128
  </fo:block>
@@ -9128,8 +9168,13 @@
9128
9168
  </fo:block>
9129
9169
  </fo:table-cell>
9130
9170
  <fo:table-cell display-align="center">
9171
+
9131
9172
  <fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
9132
9173
 
9174
+ <xsl:for-each select="../*[local-name() = 'name']">
9175
+ <xsl:call-template name="setIDforNamedDestination"/>
9176
+ </xsl:for-each>
9177
+
9133
9178
  <xsl:call-template name="refine_formula-stem-number-style"/>
9134
9179
 
9135
9180
  <xsl:apply-templates select="../*[local-name() = 'name']"/>
@@ -9164,6 +9209,8 @@
9164
9209
 
9165
9210
  <xsl:template match="*[local-name() = 'note']" name="note">
9166
9211
 
9212
+ <xsl:call-template name="setNamedDestination"/>
9213
+
9167
9214
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
9168
9215
 
9169
9216
  <xsl:call-template name="setBlockSpanAll"/>
@@ -9228,6 +9275,7 @@
9228
9275
  </xsl:template>
9229
9276
 
9230
9277
  <xsl:template match="*[local-name() = 'termnote']">
9278
+ <xsl:call-template name="setNamedDestination"/>
9231
9279
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
9232
9280
 
9233
9281
  <xsl:call-template name="setBlockSpanAll"/>
@@ -9334,12 +9382,14 @@
9334
9382
 
9335
9383
  <xsl:template match="*[local-name() = 'terms']">
9336
9384
  <!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
9385
+ <xsl:call-template name="setNamedDestination"/>
9337
9386
  <fo:block id="{@id}">
9338
9387
  <xsl:apply-templates/>
9339
9388
  </fo:block>
9340
9389
  </xsl:template>
9341
9390
 
9342
9391
  <xsl:template match="*[local-name() = 'term']">
9392
+ <xsl:call-template name="setNamedDestination"/>
9343
9393
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
9344
9394
 
9345
9395
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
@@ -9371,6 +9421,7 @@
9371
9421
  <xsl:template match="*[local-name() = 'figure']" name="figure">
9372
9422
  <xsl:variable name="isAdded" select="@added"/>
9373
9423
  <xsl:variable name="isDeleted" select="@deleted"/>
9424
+ <xsl:call-template name="setNamedDestination"/>
9374
9425
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
9375
9426
  <xsl:call-template name="refine_figure-block-style"/>
9376
9427
 
@@ -9387,6 +9438,11 @@
9387
9438
  </xsl:variable>
9388
9439
 
9389
9440
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
9441
+
9442
+ <xsl:for-each select="*[local-name() = 'name']"> <!-- set context -->
9443
+ <xsl:call-template name="setIDforNamedDestination"/>
9444
+ </xsl:for-each>
9445
+
9390
9446
  <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
9391
9447
  </fo:block>
9392
9448
 
@@ -9419,6 +9475,7 @@
9419
9475
  </xsl:template>
9420
9476
 
9421
9477
  <xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
9478
+ <xsl:call-template name="setNamedDestination"/>
9422
9479
  <fo:block id="{@id}">
9423
9480
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
9424
9481
  </fo:block>
@@ -9432,6 +9489,7 @@
9432
9489
  </xsl:template>
9433
9490
 
9434
9491
  <!-- SOURCE: ... -->
9492
+ <!-- figure/source -->
9435
9493
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
9436
9494
 
9437
9495
  <fo:block xsl:use-attribute-sets="figure-source-style">
@@ -10677,6 +10735,7 @@
10677
10735
  <xsl:template match="title" mode="bookmark"/>
10678
10736
  <xsl:template match="text()" mode="bookmark"/>
10679
10737
 
10738
+ <!-- figure/name -->
10680
10739
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']">
10681
10740
  <xsl:if test="normalize-space() != ''">
10682
10741
  <fo:block xsl:use-attribute-sets="figure-name-style">
@@ -11393,6 +11452,7 @@
11393
11452
  <!-- permission -->
11394
11453
  <!-- ========== -->
11395
11454
  <xsl:template match="*[local-name() = 'permission']">
11455
+ <xsl:call-template name="setNamedDestination"/>
11396
11456
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
11397
11457
  <xsl:apply-templates select="*[local-name()='name']"/>
11398
11458
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
@@ -11401,10 +11461,12 @@
11401
11461
 
11402
11462
  <xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']">
11403
11463
  <xsl:if test="normalize-space() != ''">
11404
- <fo:block xsl:use-attribute-sets="permission-name-style">
11405
- <xsl:apply-templates/>
11406
11464
 
11407
- </fo:block>
11465
+ <fo:block xsl:use-attribute-sets="permission-name-style">
11466
+ <xsl:apply-templates/>
11467
+
11468
+ </fo:block>
11469
+
11408
11470
  </xsl:if>
11409
11471
  </xsl:template>
11410
11472
 
@@ -11420,6 +11482,7 @@
11420
11482
  <!-- requirement -->
11421
11483
  <!-- ========== -->
11422
11484
  <xsl:template match="*[local-name() = 'requirement']">
11485
+ <xsl:call-template name="setNamedDestination"/>
11423
11486
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
11424
11487
  <xsl:apply-templates select="*[local-name()='name']"/>
11425
11488
  <xsl:apply-templates select="*[local-name()='label']"/>
@@ -11431,11 +11494,13 @@
11431
11494
 
11432
11495
  <xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']">
11433
11496
  <xsl:if test="normalize-space() != ''">
11434
- <fo:block xsl:use-attribute-sets="requirement-name-style">
11435
11497
 
11436
- <xsl:apply-templates/>
11498
+ <fo:block xsl:use-attribute-sets="requirement-name-style">
11499
+
11500
+ <xsl:apply-templates/>
11501
+
11502
+ </fo:block>
11437
11503
 
11438
- </fo:block>
11439
11504
  </xsl:if>
11440
11505
  </xsl:template>
11441
11506
 
@@ -11464,6 +11529,7 @@
11464
11529
  <!-- recommendation -->
11465
11530
  <!-- ========== -->
11466
11531
  <xsl:template match="*[local-name() = 'recommendation']">
11532
+ <xsl:call-template name="setNamedDestination"/>
11467
11533
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
11468
11534
  <xsl:apply-templates select="*[local-name()='name']"/>
11469
11535
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
@@ -11472,10 +11538,12 @@
11472
11538
 
11473
11539
  <xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']">
11474
11540
  <xsl:if test="normalize-space() != ''">
11475
- <fo:block xsl:use-attribute-sets="recommendation-name-style">
11476
- <xsl:apply-templates/>
11477
11541
 
11478
- </fo:block>
11542
+ <fo:block xsl:use-attribute-sets="recommendation-name-style">
11543
+ <xsl:apply-templates/>
11544
+
11545
+ </fo:block>
11546
+
11479
11547
  </xsl:if>
11480
11548
  </xsl:template>
11481
11549
 
@@ -11554,6 +11622,7 @@
11554
11622
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
11555
11623
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
11556
11624
  </xsl:if>
11625
+ <xsl:call-template name="setNamedDestination"/>
11557
11626
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
11558
11627
  <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
11559
11628
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -11663,6 +11732,7 @@
11663
11732
  <!-- termexample -->
11664
11733
  <!-- ====== -->
11665
11734
  <xsl:template match="*[local-name() = 'termexample']">
11735
+ <xsl:call-template name="setNamedDestination"/>
11666
11736
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
11667
11737
  <xsl:call-template name="refine_termexample-style"/>
11668
11738
  <xsl:call-template name="setBlockSpanAll"/>
@@ -11717,6 +11787,7 @@
11717
11787
  -->
11718
11788
  <xsl:template match="*[local-name() = 'example']" name="example">
11719
11789
 
11790
+ <xsl:call-template name="setNamedDestination"/>
11720
11791
  <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
11721
11792
 
11722
11793
  <xsl:call-template name="setBlockSpanAll"/>
@@ -12245,8 +12316,13 @@
12245
12316
  </xsl:if>
12246
12317
 
12247
12318
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
12319
+
12248
12320
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
12249
12321
 
12322
+ <xsl:for-each select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"><!-- change context -->
12323
+ <xsl:call-template name="setIDforNamedDestination"/>
12324
+ </xsl:for-each>
12325
+
12250
12326
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
12251
12327
  </fo:block>
12252
12328
  </xsl:if>
@@ -12366,6 +12442,7 @@
12366
12442
  <!-- main sections -->
12367
12443
  <xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
12368
12444
 
12445
+ <xsl:call-template name="setNamedDestination"/>
12369
12446
  <fo:block>
12370
12447
  <xsl:call-template name="setId"/>
12371
12448
 
@@ -12406,6 +12483,7 @@
12406
12483
 
12407
12484
  <fo:block break-after="page"/>
12408
12485
 
12486
+ <xsl:call-template name="setNamedDestination"/>
12409
12487
  <fo:block>
12410
12488
  <xsl:call-template name="setId"/>
12411
12489
  <xsl:call-template name="addReviewHelper"/>
@@ -12434,6 +12512,7 @@
12434
12512
  </xsl:template>
12435
12513
 
12436
12514
  <xsl:template match="*[local-name() = 'clause'][normalize-space() != '' or *[local-name() = 'figure'] or @id]" name="template_clause"> <!-- if clause isn't empty -->
12515
+ <xsl:call-template name="setNamedDestination"/>
12437
12516
  <fo:block>
12438
12517
  <xsl:if test="parent::*[local-name() = 'copyright-statement']">
12439
12518
  <xsl:attribute name="role">SKIP</xsl:attribute>
@@ -12456,6 +12535,7 @@
12456
12535
  </xsl:template> <!-- refine_clause_style -->
12457
12536
 
12458
12537
  <xsl:template match="*[local-name() = 'definitions']">
12538
+ <xsl:call-template name="setNamedDestination"/>
12459
12539
  <fo:block id="{@id}">
12460
12540
  <xsl:apply-templates/>
12461
12541
  </fo:block>
@@ -12471,6 +12551,8 @@
12471
12551
  <xsl:otherwise>
12472
12552
 
12473
12553
  <fo:block break-after="page"/>
12554
+ <xsl:call-template name="setNamedDestination"/>
12555
+
12474
12556
  <fo:block id="{@id}">
12475
12557
 
12476
12558
  <xsl:call-template name="setBlockSpanAll"/>
@@ -12542,6 +12624,7 @@
12542
12624
  <!-- following-sibling::node()[1][local-name() = 'bookmark'][@id = $source] and
12543
12625
  following-sibling::node()[2][local-name() = 'fmt-review-end'][@source = $source] -->
12544
12626
  <!-- <fo:block id="{$source}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$source}" fox:alt-text="Annot___{$source}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block> -->
12627
+ <xsl:call-template name="setNamedDestination"/>
12545
12628
  <fo:block id="{@id}" font-size="1pt" role="SKIP" keep-with-next="always" line-height="0.1"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
12546
12629
  <!-- </xsl:if> -->
12547
12630
  </xsl:if>
@@ -13263,6 +13346,7 @@
13263
13346
  <!-- Normative references -->
13264
13347
  <xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2">
13265
13348
 
13349
+ <xsl:call-template name="setNamedDestination"/>
13266
13350
  <fo:block id="{@id}">
13267
13351
  <xsl:apply-templates/>
13268
13352
 
@@ -13283,6 +13367,7 @@
13283
13367
  </xsl:if>
13284
13368
  </xsl:if> -->
13285
13369
 
13370
+ <xsl:call-template name="setNamedDestination"/>
13286
13371
  <fo:block id="{@id}"/>
13287
13372
 
13288
13373
  <xsl:apply-templates select="*[local-name() = 'title'][@columns = 1]"/>
@@ -13307,6 +13392,7 @@
13307
13392
  <xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
13308
13393
  <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
13309
13394
 
13395
+ <xsl:call-template name="setNamedDestination"/>
13310
13396
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
13311
13397
 
13312
13398
  <xsl:call-template name="processBibitem"/>
@@ -13320,6 +13406,7 @@
13320
13406
  <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'ieee' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
13321
13407
  $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
13322
13408
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
13409
+ <xsl:call-template name="setNamedDestination"/>
13323
13410
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
13324
13411
 
13325
13412
  <fo:list-item>
@@ -13349,6 +13436,7 @@
13349
13436
  <xsl:choose>
13350
13437
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
13351
13438
  <xsl:otherwise>
13439
+ <xsl:call-template name="setNamedDestination"/>
13352
13440
  <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
13353
13441
 
13354
13442
  <fo:list-item-label end-indent="label-end()">
@@ -13743,6 +13831,7 @@
13743
13831
  <xsl:template match="*[local-name() = 'admonition']">
13744
13832
 
13745
13833
  <!-- text in the box -->
13834
+ <xsl:call-template name="setNamedDestination"/>
13746
13835
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
13747
13836
 
13748
13837
  <xsl:call-template name="setBlockSpanAll"/>
@@ -13998,7 +14087,7 @@
13998
14087
  </xsl:template>
13999
14088
 
14000
14089
  <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
14001
- <xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear' or @class = 'horizontal' or @class = 'norotate' or @class = 'halffontsize']" mode="update_xml_step1" priority="2">
14090
+ <xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear' or @class = 'fmt-hi' or @class = 'horizontal' or @class = 'norotate' or @class = 'halffontsize']" mode="update_xml_step1" priority="2">
14002
14091
  <xsl:copy>
14003
14092
  <xsl:copy-of select="@*"/>
14004
14093
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -14030,28 +14119,56 @@
14030
14119
  <xsl:template match="*[local-name() = 'stem']" mode="update_xml_step1"/>
14031
14120
  <xsl:template match="*[local-name() = 'stem']" mode="update_xml_pres"/>
14032
14121
 
14033
- <xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_step1">
14122
+ <xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_step1">
14034
14123
  <xsl:element name="stem" namespace="{$namespace_full}">
14035
14124
  <xsl:copy-of select="@*"/>
14036
14125
  <xsl:choose>
14037
14126
  <xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
14038
- <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
14127
+ <xsl:choose>
14128
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
14129
+ <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
14130
+ </xsl:when>
14131
+ <xsl:otherwise>
14132
+ <xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_step1"/>
14133
+ </xsl:otherwise>
14134
+ </xsl:choose>
14039
14135
  </xsl:when>
14040
14136
  <xsl:otherwise>
14041
- <xsl:copy-of select="node()"/>
14137
+ <xsl:choose>
14138
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
14139
+ <xsl:copy-of select="node()"/>
14140
+ </xsl:when>
14141
+ <xsl:otherwise>
14142
+ <xsl:apply-templates select="node()" mode="update_xml_step1"/>
14143
+ </xsl:otherwise>
14144
+ </xsl:choose>
14042
14145
  </xsl:otherwise>
14043
14146
  </xsl:choose>
14044
14147
  </xsl:element>
14045
14148
  </xsl:template>
14046
- <xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_pres">
14149
+ <xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_pres">
14047
14150
  <xsl:element name="stem" namespace="{$namespace_full}">
14048
14151
  <xsl:copy-of select="@*"/>
14049
14152
  <xsl:choose>
14050
14153
  <xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
14051
- <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
14154
+ <xsl:choose>
14155
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
14156
+ <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
14157
+ </xsl:when>
14158
+ <xsl:otherwise>
14159
+ <xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_pres"/>
14160
+ </xsl:otherwise>
14161
+ </xsl:choose>
14052
14162
  </xsl:when>
14053
14163
  <xsl:otherwise>
14054
- <xsl:copy-of select="node()"/>
14164
+ <xsl:choose>
14165
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
14166
+ <xsl:copy-of select="node()"/>
14167
+ </xsl:when>
14168
+ <xsl:otherwise>
14169
+ <xsl:apply-templates select="node()" mode="update_xml_pres"/>
14170
+ </xsl:otherwise>
14171
+ </xsl:choose>
14055
14172
  </xsl:otherwise>
14056
14173
  </xsl:choose>
14057
14174
  </xsl:element>
@@ -14280,16 +14397,24 @@
14280
14397
  <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
14281
14398
  <xsl:element name="title" namespace="{$namespace_full}">
14282
14399
  <xsl:copy-of select="@*"/>
14400
+ <xsl:call-template name="addNamedDestinationAttribute"/>
14401
+
14283
14402
  <xsl:apply-templates mode="update_xml_step1"/>
14284
14403
  </xsl:element>
14285
14404
  </xsl:template>
14286
14405
  <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
14287
14406
  <xsl:element name="title" namespace="{$namespace_full}">
14288
14407
  <xsl:copy-of select="@*"/>
14408
+ <xsl:call-template name="addNamedDestinationAttribute"/>
14409
+
14289
14410
  <xsl:apply-templates mode="update_xml_pres"/>
14290
14411
  </xsl:element>
14291
14412
  </xsl:template>
14292
14413
 
14414
+ <xsl:template name="addNamedDestinationAttribute">
14415
+
14416
+ </xsl:template>
14417
+
14293
14418
  <xsl:template match="*[local-name() = 'fmt-name']"/>
14294
14419
  <xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
14295
14420
  <xsl:choose>
@@ -14299,6 +14424,8 @@
14299
14424
  <xsl:otherwise>
14300
14425
  <xsl:element name="name" namespace="{$namespace_full}">
14301
14426
  <xsl:copy-of select="@*"/>
14427
+ <xsl:call-template name="addNamedDestinationAttribute"/>
14428
+
14302
14429
  <xsl:apply-templates mode="update_xml_step1"/>
14303
14430
  </xsl:element>
14304
14431
  </xsl:otherwise>
@@ -14312,6 +14439,8 @@
14312
14439
  <xsl:otherwise>
14313
14440
  <xsl:element name="name" namespace="{$namespace_full}">
14314
14441
  <xsl:copy-of select="@*"/>
14442
+ <xsl:call-template name="addNamedDestinationAttribute"/>
14443
+
14315
14444
  <xsl:apply-templates mode="update_xml_pres"/>
14316
14445
  </xsl:element>
14317
14446
  </xsl:otherwise>
@@ -15776,6 +15905,24 @@
15776
15905
  </xsl:attribute>
15777
15906
  </xsl:template>
15778
15907
 
15908
+ <xsl:template name="setIDforNamedDestination">
15909
+ <xsl:if test="@named_dest">
15910
+ <xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
15911
+ </xsl:if>
15912
+ </xsl:template>
15913
+
15914
+ <xsl:template name="setNamedDestination">
15915
+ <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
15916
+ <xsl:if test="@id and normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}')) = 'false'">
15917
+ <fox:destination internal-destination="{@id}"/>
15918
+ </xsl:if>
15919
+ <xsl:for-each select=". | *[local-name() = 'title'] | *[local-name() = 'name']">
15920
+ <xsl:if test="@named_dest">
15921
+ <fox:destination internal-destination="{@named_dest}"/>
15922
+ </xsl:if>
15923
+ </xsl:for-each>
15924
+ </xsl:template>
15925
+
15779
15926
  <xsl:template name="add-letter-spacing">
15780
15927
  <xsl:param name="text"/>
15781
15928
  <xsl:param name="letter-spacing" select="'0.15'"/>
@@ -1,8 +1,7 @@
1
1
  module IsoDoc
2
2
  module Iec
3
3
  class PresentationXMLConvert < IsoDoc::Iso::PresentationXMLConvert
4
- def termclause1(elem)
5
- @is_iev or return clause1(elem)
4
+ def iev_termclause1(elem)
6
5
  @suppressheadingnumbers || elem["unnumbered"] or
7
6
  lbl = @xrefs.anchor(elem["id"], :label, true)
8
7
  if lbl
@@ -14,21 +14,18 @@ module IsoDoc
14
14
  @i18n_lg["default"] = @i18n
15
15
  end
16
16
 
17
- def clause(docxml)
18
- docxml.xpath(ns("//clause | //definitions | //references | //appendix | " \
19
- "//introduction | //foreword | //preface/abstract | " \
20
- "//acknowledgements | //colophon | //indexsect "))
21
- .each do |f|
22
- f.parent.name == "annex" &&
23
- @xrefs.klass.single_term_clause?(f.parent) and next
24
- clause1(f)
25
- end
17
+ # KILL
18
+ def clausex(docxml)
19
+ super
26
20
  docxml.xpath(ns("//terms")).each { |f| termclause1(f) }
27
21
  end
28
22
 
29
23
  def clause1(elem)
24
+ if elem.name == "terms" && @is_iev then iev_termclause1(elem)
25
+ else
30
26
  IsoDoc::PresentationXMLConvert.instance_method(:clause1).bind(self)
31
27
  .call(elem)
28
+ end
32
29
  end
33
30
 
34
31
  DICT_PATHS = { doctype_dict: "./ext/doctype",
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <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">
3
- <!-- VERSION v2.0.3 -->
3
+ <!-- VERSION v2.0.4 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -1328,6 +1328,7 @@ numbers</a:documentation>
1328
1328
  <ref name="foreword"/>
1329
1329
  <ref name="introduction"/>
1330
1330
  <ref name="acknowledgements"/>
1331
+ <ref name="executivesummary"/>
1331
1332
  </choice>
1332
1333
  </oneOrMore>
1333
1334
  </element>
@@ -1351,6 +1352,11 @@ numbers</a:documentation>
1351
1352
  <ref name="Content-Section"/>
1352
1353
  </element>
1353
1354
  </define>
1355
+ <define name="executivesummary">
1356
+ <element name="executivesummary">
1357
+ <ref name="Content-Section"/>
1358
+ </element>
1359
+ </define>
1354
1360
  <define name="indexsect">
1355
1361
  <element name="indexsect">
1356
1362
  <ref name="Content-Section"/>
@@ -1576,6 +1582,15 @@ used in document amendments</a:documentation>
1576
1582
  <define name="annex">
1577
1583
  <element name="annex">
1578
1584
  <ref name="Annex-Section"/>
1585
+ <zeroOrMore>
1586
+ <ref name="annex-appendix"/>
1587
+ </zeroOrMore>
1588
+ </element>
1589
+ </define>
1590
+ <define name="annex-appendix">
1591
+ <a:documentation>Appendix, distinct subclause type for annexes (annex to annex, rather than subclause to annex)</a:documentation>
1592
+ <element name="appendix">
1593
+ <ref name="Clause-Section"/>
1579
1594
  </element>
1580
1595
  </define>
1581
1596
  <define name="terms">
@@ -162,9 +162,4 @@
162
162
  </zeroOrMore>
163
163
  </element>
164
164
  </define>
165
- <define name="annex-appendix">
166
- <element name="appendix">
167
- <ref name="Clause-Section"/>
168
- </element>
169
- </define>
170
165
  </grammar>
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "2.6.4".freeze
3
+ VERSION = "2.6.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.6.4
4
+ version: 2.6.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: 2025-04-14 00:00:00.000000000 Z
11
+ date: 2025-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso