metanorma-cc 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: c63fc41e6751e3067d668e9b3bbd2a3fba140ac7dfc419011a57497de2c241c4
4
- data.tar.gz: 76ee7f5bb6098975736b76c00e78fa7d1a1715d196647ad74d0a2cc9109bb9be
3
+ metadata.gz: ca924ed1b04ed0db465ce3b0d15845a2fad37b9b942b0429bf82380ed1fa3511
4
+ data.tar.gz: 2170d651b35dd1c4f341805d96f65430424e58ad80fae6e85e1da3c7e4fab9bf
5
5
  SHA512:
6
- metadata.gz: d40f01895625c4723b48e80059ed7fcf290df29f68b9dbc414845dbeda1ec2850c16f915562670cfeaa9dd88692ad94818affc0f66400cfaaa2709d5fdcb3ee9
7
- data.tar.gz: c714d0766e783387085fbb7c9f2485af68f10993f31db1610b65d9f24687a1b21f02cc508264715c1a9013bf3d1ce10a115852e62ee6dc9d54c493afeab657b0
6
+ metadata.gz: 1b4d9c8b2eca7227fb5fa400ac53a61dda8416460a5d3b79aa37bf30f1b0e81cfcee493da3ad0cd11ef161b11cb5c51078b1ab30132ae79531ee80c1171ed68e
7
+ data.tar.gz: b59ed84661aa32bf4e8b290bf9c89bd27fbb39bd910886da55f452f4f1c6d7e5d0cb3c1052c3733ee421b4a69d3585c4248f0189806ba86e9e56efc04c9dcfbf
@@ -2940,8 +2940,14 @@
2940
2940
  </xsl:choose>
2941
2941
  </xsl:variable>
2942
2942
 
2943
+ <xsl:call-template name="setNamedDestination"/>
2944
+
2943
2945
  <fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
2944
2946
 
2947
+ <xsl:for-each select="*[local-name() = 'name']">
2948
+ <xsl:call-template name="setIDforNamedDestination"/>
2949
+ </xsl:for-each>
2950
+
2945
2951
  <xsl:call-template name="refine_table-container-style">
2946
2952
  <xsl:with-param name="margin-side" select="$margin-side"/>
2947
2953
  </xsl:call-template>
@@ -3146,6 +3152,7 @@
3146
3152
  <!-- table/name-->
3147
3153
  <xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
3148
3154
  <xsl:param name="continued"/>
3155
+ <xsl:param name="cols-count"/>
3149
3156
  <xsl:if test="normalize-space() != ''">
3150
3157
 
3151
3158
  <fo:block xsl:use-attribute-sets="table-name-style">
@@ -3167,9 +3174,30 @@
3167
3174
 
3168
3175
  <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
3169
3176
  <xsl:if test="$continued = 'true'">
3170
- <fo:block text-align="right">
3171
- <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
3172
- </fo:block>
3177
+
3178
+ <!-- to prevent the error 'THead element may contain only TR elements' -->
3179
+
3180
+ <xsl:choose>
3181
+ <xsl:when test="string(number($cols-count)) != 'NaN'">
3182
+ <fo:table width="100%" table-layout="fixed" role="SKIP">
3183
+ <fo:table-body role="SKIP">
3184
+ <fo:table-row>
3185
+ <fo:table-cell role="TH" number-columns-spanned="{$cols-count}">
3186
+ <fo:block text-align="right" role="SKIP">
3187
+ <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
3188
+ </fo:block>
3189
+ </fo:table-cell>
3190
+ </fo:table-row>
3191
+ </fo:table-body>
3192
+ </fo:table>
3193
+ </xsl:when>
3194
+ <xsl:otherwise>
3195
+ <fo:block text-align="right">
3196
+ <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
3197
+ </fo:block>
3198
+ </xsl:otherwise>
3199
+ </xsl:choose>
3200
+
3173
3201
  </xsl:if>
3174
3202
  <!-- </xsl:if> -->
3175
3203
 
@@ -3562,6 +3590,7 @@
3562
3590
 
3563
3591
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
3564
3592
  <xsl:with-param name="continued">true</xsl:with-param>
3593
+ <xsl:with-param name="cols-count" select="$cols-count"/>
3565
3594
  </xsl:apply-templates>
3566
3595
 
3567
3596
  <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
@@ -3943,8 +3972,8 @@
3943
3972
  <xsl:for-each select="xalan:nodeset($styles__)/item">
3944
3973
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
3945
3974
  <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
3946
- <xsl:if test="$key = 'color' or $key = 'background-color'">
3947
- <style name="{$key}"><xsl:value-of select="$value"/></style>
3975
+ <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'">
3976
+ <style name="{$key}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($value), 'currentColor', 'inherit')"/></style>
3948
3977
  </xsl:if>
3949
3978
  </xsl:for-each>
3950
3979
  </xsl:variable>
@@ -4008,6 +4037,7 @@
4008
4037
  <!-- table/note, table/example, table/tfoot//note, table/tfoot//example -->
4009
4038
  <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">
4010
4039
 
4040
+ <xsl:call-template name="setNamedDestination"/>
4011
4041
  <fo:block xsl:use-attribute-sets="table-note-style">
4012
4042
  <xsl:copy-of select="@id"/>
4013
4043
 
@@ -4533,7 +4563,7 @@
4533
4563
  <xsl:variable name="target" select="@target"/>
4534
4564
  <xsl:choose>
4535
4565
  <!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
4536
- <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]">
4566
+ <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]">
4537
4567
  <xsl:call-template name="fn">
4538
4568
  <xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
4539
4569
  </xsl:call-template>
@@ -4629,6 +4659,10 @@
4629
4659
  <!-- <dl><xsl:copy-of select="."/></dl> -->
4630
4660
  <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
4631
4661
 
4662
+ <xsl:if test="@key = 'true' and ancestor::*[local-name() = 'figure']">
4663
+ <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
4664
+ </xsl:if>
4665
+
4632
4666
  <xsl:call-template name="setBlockSpanAll"/>
4633
4667
 
4634
4668
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
@@ -4922,7 +4956,7 @@
4922
4956
 
4923
4957
  <!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
4924
4958
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
4925
- <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
4959
+ <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always" keep-with-previous="always">
4926
4960
  <xsl:call-template name="refine_figure_key_style"/>
4927
4961
  <xsl:apply-templates/>
4928
4962
  </fo:block>
@@ -5173,6 +5207,7 @@
5173
5207
 
5174
5208
  <xsl:call-template name="refine_dt-cell-style"/>
5175
5209
 
5210
+ <xsl:call-template name="setNamedDestination"/>
5176
5211
  <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
5177
5212
 
5178
5213
  <xsl:choose>
@@ -5610,7 +5645,7 @@
5610
5645
  <!-- ================= -->
5611
5646
 
5612
5647
  <!-- highlight text -->
5613
- <xsl:template match="*[local-name()='hi']">
5648
+ <xsl:template match="*[local-name()='hi'] | *[local-name() = 'span'][@class = 'fmt-hi']" priority="3">
5614
5649
  <fo:inline background-color="yellow">
5615
5650
  <xsl:apply-templates/>
5616
5651
  </fo:inline>
@@ -7205,6 +7240,7 @@
7205
7240
  <!-- Appendix processing -->
7206
7241
  <!-- ======================== -->
7207
7242
  <xsl:template match="*[local-name()='appendix']">
7243
+ <xsl:call-template name="setNamedDestination"/>
7208
7244
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
7209
7245
  <xsl:apply-templates select="*[local-name()='title']"/>
7210
7246
  </fo:block>
@@ -7215,13 +7251,14 @@
7215
7251
  <xsl:variable name="level">
7216
7252
  <xsl:call-template name="getLevel"/>
7217
7253
  </xsl:variable>
7218
- <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
7254
+ <fo:inline role="H{$level}"><xsl:call-template name="setIDforNamedDestination"/><xsl:apply-templates/></fo:inline>
7219
7255
  </xsl:template>
7220
7256
  <!-- ======================== -->
7221
7257
  <!-- END Appendix processing -->
7222
7258
  <!-- ======================== -->
7223
7259
 
7224
7260
  <xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
7261
+ <xsl:call-template name="setNamedDestination"/>
7225
7262
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
7226
7263
  <xsl:apply-templates select="*[local-name()='name']"/>
7227
7264
  </fo:block>
@@ -7251,6 +7288,7 @@
7251
7288
  <xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
7252
7289
  <xsl:param name="callout"/>
7253
7290
  <fo:inline id="{@id}">
7291
+ <xsl:call-template name="setNamedDestination"/>
7254
7292
  <!-- for first p in annotation, put <x> -->
7255
7293
  <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
7256
7294
  <xsl:apply-templates/>
@@ -7297,6 +7335,7 @@
7297
7335
 
7298
7336
  </xsl:if>
7299
7337
  <fo:block-container margin-left="0mm" role="SKIP">
7338
+ <xsl:call-template name="setNamedDestination"/>
7300
7339
  <fo:block id="{@id}">
7301
7340
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
7302
7341
  </fo:block>
@@ -7342,8 +7381,13 @@
7342
7381
  </fo:block>
7343
7382
  </fo:table-cell>
7344
7383
  <fo:table-cell display-align="center">
7384
+
7345
7385
  <fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
7346
7386
 
7387
+ <xsl:for-each select="../*[local-name() = 'name']">
7388
+ <xsl:call-template name="setIDforNamedDestination"/>
7389
+ </xsl:for-each>
7390
+
7347
7391
  <xsl:call-template name="refine_formula-stem-number-style"/>
7348
7392
 
7349
7393
  <xsl:apply-templates select="../*[local-name() = 'name']"/>
@@ -7378,6 +7422,8 @@
7378
7422
 
7379
7423
  <xsl:template match="*[local-name() = 'note']" name="note">
7380
7424
 
7425
+ <xsl:call-template name="setNamedDestination"/>
7426
+
7381
7427
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
7382
7428
 
7383
7429
  <xsl:call-template name="setBlockSpanAll"/>
@@ -7442,6 +7488,7 @@
7442
7488
  </xsl:template>
7443
7489
 
7444
7490
  <xsl:template match="*[local-name() = 'termnote']">
7491
+ <xsl:call-template name="setNamedDestination"/>
7445
7492
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
7446
7493
 
7447
7494
  <xsl:call-template name="setBlockSpanAll"/>
@@ -7548,12 +7595,14 @@
7548
7595
 
7549
7596
  <xsl:template match="*[local-name() = 'terms']">
7550
7597
  <!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
7598
+ <xsl:call-template name="setNamedDestination"/>
7551
7599
  <fo:block id="{@id}">
7552
7600
  <xsl:apply-templates/>
7553
7601
  </fo:block>
7554
7602
  </xsl:template>
7555
7603
 
7556
7604
  <xsl:template match="*[local-name() = 'term']">
7605
+ <xsl:call-template name="setNamedDestination"/>
7557
7606
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
7558
7607
 
7559
7608
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
@@ -7585,6 +7634,7 @@
7585
7634
  <xsl:template match="*[local-name() = 'figure']" name="figure">
7586
7635
  <xsl:variable name="isAdded" select="@added"/>
7587
7636
  <xsl:variable name="isDeleted" select="@deleted"/>
7637
+ <xsl:call-template name="setNamedDestination"/>
7588
7638
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
7589
7639
  <xsl:call-template name="refine_figure-block-style"/>
7590
7640
 
@@ -7601,6 +7651,11 @@
7601
7651
  </xsl:variable>
7602
7652
 
7603
7653
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
7654
+
7655
+ <xsl:for-each select="*[local-name() = 'name']"> <!-- set context -->
7656
+ <xsl:call-template name="setIDforNamedDestination"/>
7657
+ </xsl:for-each>
7658
+
7604
7659
  <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
7605
7660
  </fo:block>
7606
7661
 
@@ -7633,6 +7688,7 @@
7633
7688
  </xsl:template>
7634
7689
 
7635
7690
  <xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
7691
+ <xsl:call-template name="setNamedDestination"/>
7636
7692
  <fo:block id="{@id}">
7637
7693
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7638
7694
  </fo:block>
@@ -7646,6 +7702,7 @@
7646
7702
  </xsl:template>
7647
7703
 
7648
7704
  <!-- SOURCE: ... -->
7705
+ <!-- figure/source -->
7649
7706
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
7650
7707
 
7651
7708
  <xsl:call-template name="termsource"/>
@@ -8878,6 +8935,7 @@
8878
8935
  <xsl:template match="title" mode="bookmark"/>
8879
8936
  <xsl:template match="text()" mode="bookmark"/>
8880
8937
 
8938
+ <!-- figure/name -->
8881
8939
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']">
8882
8940
  <xsl:if test="normalize-space() != ''">
8883
8941
  <fo:block xsl:use-attribute-sets="figure-name-style">
@@ -9595,6 +9653,7 @@
9595
9653
  <!-- permission -->
9596
9654
  <!-- ========== -->
9597
9655
  <xsl:template match="*[local-name() = 'permission']">
9656
+ <xsl:call-template name="setNamedDestination"/>
9598
9657
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
9599
9658
  <xsl:apply-templates select="*[local-name()='name']"/>
9600
9659
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
@@ -9603,10 +9662,12 @@
9603
9662
 
9604
9663
  <xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']">
9605
9664
  <xsl:if test="normalize-space() != ''">
9606
- <fo:block xsl:use-attribute-sets="permission-name-style">
9607
- <xsl:apply-templates/>
9608
9665
 
9609
- </fo:block>
9666
+ <fo:block xsl:use-attribute-sets="permission-name-style">
9667
+ <xsl:apply-templates/>
9668
+
9669
+ </fo:block>
9670
+
9610
9671
  </xsl:if>
9611
9672
  </xsl:template>
9612
9673
 
@@ -9622,6 +9683,7 @@
9622
9683
  <!-- requirement -->
9623
9684
  <!-- ========== -->
9624
9685
  <xsl:template match="*[local-name() = 'requirement']">
9686
+ <xsl:call-template name="setNamedDestination"/>
9625
9687
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
9626
9688
  <xsl:apply-templates select="*[local-name()='name']"/>
9627
9689
  <xsl:apply-templates select="*[local-name()='label']"/>
@@ -9633,11 +9695,13 @@
9633
9695
 
9634
9696
  <xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']">
9635
9697
  <xsl:if test="normalize-space() != ''">
9636
- <fo:block xsl:use-attribute-sets="requirement-name-style">
9637
9698
 
9638
- <xsl:apply-templates/>
9699
+ <fo:block xsl:use-attribute-sets="requirement-name-style">
9700
+
9701
+ <xsl:apply-templates/>
9702
+
9703
+ </fo:block>
9639
9704
 
9640
- </fo:block>
9641
9705
  </xsl:if>
9642
9706
  </xsl:template>
9643
9707
 
@@ -9666,6 +9730,7 @@
9666
9730
  <!-- recommendation -->
9667
9731
  <!-- ========== -->
9668
9732
  <xsl:template match="*[local-name() = 'recommendation']">
9733
+ <xsl:call-template name="setNamedDestination"/>
9669
9734
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
9670
9735
  <xsl:apply-templates select="*[local-name()='name']"/>
9671
9736
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
@@ -9674,10 +9739,12 @@
9674
9739
 
9675
9740
  <xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']">
9676
9741
  <xsl:if test="normalize-space() != ''">
9677
- <fo:block xsl:use-attribute-sets="recommendation-name-style">
9678
- <xsl:apply-templates/>
9679
9742
 
9680
- </fo:block>
9743
+ <fo:block xsl:use-attribute-sets="recommendation-name-style">
9744
+ <xsl:apply-templates/>
9745
+
9746
+ </fo:block>
9747
+
9681
9748
  </xsl:if>
9682
9749
  </xsl:template>
9683
9750
 
@@ -9756,6 +9823,7 @@
9756
9823
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
9757
9824
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
9758
9825
  </xsl:if>
9826
+ <xsl:call-template name="setNamedDestination"/>
9759
9827
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
9760
9828
  <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
9761
9829
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -9865,6 +9933,7 @@
9865
9933
  <!-- termexample -->
9866
9934
  <!-- ====== -->
9867
9935
  <xsl:template match="*[local-name() = 'termexample']">
9936
+ <xsl:call-template name="setNamedDestination"/>
9868
9937
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
9869
9938
  <xsl:call-template name="refine_termexample-style"/>
9870
9939
  <xsl:call-template name="setBlockSpanAll"/>
@@ -9919,6 +9988,7 @@
9919
9988
  -->
9920
9989
  <xsl:template match="*[local-name() = 'example']" name="example">
9921
9990
 
9991
+ <xsl:call-template name="setNamedDestination"/>
9922
9992
  <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
9923
9993
 
9924
9994
  <xsl:call-template name="setBlockSpanAll"/>
@@ -10444,8 +10514,13 @@
10444
10514
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
10445
10515
 
10446
10516
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
10517
+
10447
10518
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
10448
10519
 
10520
+ <xsl:for-each select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"><!-- change context -->
10521
+ <xsl:call-template name="setIDforNamedDestination"/>
10522
+ </xsl:for-each>
10523
+
10449
10524
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
10450
10525
  </fo:block>
10451
10526
  </xsl:if>
@@ -10565,6 +10640,7 @@
10565
10640
  <!-- main sections -->
10566
10641
  <xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
10567
10642
 
10643
+ <xsl:call-template name="setNamedDestination"/>
10568
10644
  <fo:block>
10569
10645
  <xsl:call-template name="setId"/>
10570
10646
 
@@ -10610,6 +10686,7 @@
10610
10686
 
10611
10687
  <fo:block break-after="page"/>
10612
10688
 
10689
+ <xsl:call-template name="setNamedDestination"/>
10613
10690
  <fo:block>
10614
10691
  <xsl:call-template name="setId"/>
10615
10692
  <xsl:call-template name="addReviewHelper"/>
@@ -10638,6 +10715,7 @@
10638
10715
  </xsl:template>
10639
10716
 
10640
10717
  <xsl:template match="*[local-name() = 'clause'][normalize-space() != '' or *[local-name() = 'figure'] or @id]" name="template_clause"> <!-- if clause isn't empty -->
10718
+ <xsl:call-template name="setNamedDestination"/>
10641
10719
  <fo:block>
10642
10720
  <xsl:if test="parent::*[local-name() = 'copyright-statement']">
10643
10721
  <xsl:attribute name="role">SKIP</xsl:attribute>
@@ -10660,6 +10738,7 @@
10660
10738
  </xsl:template> <!-- refine_clause_style -->
10661
10739
 
10662
10740
  <xsl:template match="*[local-name() = 'definitions']">
10741
+ <xsl:call-template name="setNamedDestination"/>
10663
10742
  <fo:block id="{@id}">
10664
10743
  <xsl:apply-templates/>
10665
10744
  </fo:block>
@@ -10675,6 +10754,8 @@
10675
10754
  <xsl:otherwise>
10676
10755
 
10677
10756
  <fo:block break-after="page"/>
10757
+ <xsl:call-template name="setNamedDestination"/>
10758
+
10678
10759
  <fo:block id="{@id}">
10679
10760
 
10680
10761
  <xsl:call-template name="setBlockSpanAll"/>
@@ -10746,6 +10827,7 @@
10746
10827
  <!-- following-sibling::node()[1][local-name() = 'bookmark'][@id = $source] and
10747
10828
  following-sibling::node()[2][local-name() = 'fmt-review-end'][@source = $source] -->
10748
10829
  <!-- <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> -->
10830
+ <xsl:call-template name="setNamedDestination"/>
10749
10831
  <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>
10750
10832
  <!-- </xsl:if> -->
10751
10833
  </xsl:if>
@@ -11461,6 +11543,7 @@
11461
11543
  <!-- Normative references -->
11462
11544
  <xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2">
11463
11545
 
11546
+ <xsl:call-template name="setNamedDestination"/>
11464
11547
  <fo:block id="{@id}">
11465
11548
  <xsl:apply-templates/>
11466
11549
 
@@ -11481,6 +11564,7 @@
11481
11564
  </xsl:if>
11482
11565
  </xsl:if> -->
11483
11566
 
11567
+ <xsl:call-template name="setNamedDestination"/>
11484
11568
  <fo:block id="{@id}"/>
11485
11569
 
11486
11570
  <xsl:apply-templates select="*[local-name() = 'title'][@columns = 1]"/>
@@ -11500,6 +11584,7 @@
11500
11584
  <xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
11501
11585
  <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
11502
11586
 
11587
+ <xsl:call-template name="setNamedDestination"/>
11503
11588
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
11504
11589
 
11505
11590
  <xsl:call-template name="processBibitem"/>
@@ -11513,6 +11598,7 @@
11513
11598
  <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'ieee' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
11514
11599
  $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
11515
11600
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
11601
+ <xsl:call-template name="setNamedDestination"/>
11516
11602
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
11517
11603
 
11518
11604
  <fo:list-item>
@@ -11542,6 +11628,7 @@
11542
11628
  <xsl:choose>
11543
11629
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
11544
11630
  <xsl:otherwise>
11631
+ <xsl:call-template name="setNamedDestination"/>
11545
11632
  <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
11546
11633
 
11547
11634
  <fo:list-item-label end-indent="label-end()">
@@ -12196,7 +12283,7 @@
12196
12283
  </xsl:template>
12197
12284
 
12198
12285
  <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
12199
- <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">
12286
+ <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">
12200
12287
  <xsl:copy>
12201
12288
  <xsl:copy-of select="@*"/>
12202
12289
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -12228,28 +12315,56 @@
12228
12315
  <xsl:template match="*[local-name() = 'stem']" mode="update_xml_step1"/>
12229
12316
  <xsl:template match="*[local-name() = 'stem']" mode="update_xml_pres"/>
12230
12317
 
12231
- <xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_step1">
12318
+ <xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_step1">
12232
12319
  <xsl:element name="stem" namespace="{$namespace_full}">
12233
12320
  <xsl:copy-of select="@*"/>
12234
12321
  <xsl:choose>
12235
12322
  <xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
12236
- <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
12323
+ <xsl:choose>
12324
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
12325
+ <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
12326
+ </xsl:when>
12327
+ <xsl:otherwise>
12328
+ <xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_step1"/>
12329
+ </xsl:otherwise>
12330
+ </xsl:choose>
12237
12331
  </xsl:when>
12238
12332
  <xsl:otherwise>
12239
- <xsl:copy-of select="node()"/>
12333
+ <xsl:choose>
12334
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
12335
+ <xsl:copy-of select="node()"/>
12336
+ </xsl:when>
12337
+ <xsl:otherwise>
12338
+ <xsl:apply-templates select="node()" mode="update_xml_step1"/>
12339
+ </xsl:otherwise>
12340
+ </xsl:choose>
12240
12341
  </xsl:otherwise>
12241
12342
  </xsl:choose>
12242
12343
  </xsl:element>
12243
12344
  </xsl:template>
12244
- <xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_pres">
12345
+ <xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_pres">
12245
12346
  <xsl:element name="stem" namespace="{$namespace_full}">
12246
12347
  <xsl:copy-of select="@*"/>
12247
12348
  <xsl:choose>
12248
12349
  <xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
12249
- <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
12350
+ <xsl:choose>
12351
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
12352
+ <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
12353
+ </xsl:when>
12354
+ <xsl:otherwise>
12355
+ <xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_pres"/>
12356
+ </xsl:otherwise>
12357
+ </xsl:choose>
12250
12358
  </xsl:when>
12251
12359
  <xsl:otherwise>
12252
- <xsl:copy-of select="node()"/>
12360
+ <xsl:choose>
12361
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
12362
+ <xsl:copy-of select="node()"/>
12363
+ </xsl:when>
12364
+ <xsl:otherwise>
12365
+ <xsl:apply-templates select="node()" mode="update_xml_pres"/>
12366
+ </xsl:otherwise>
12367
+ </xsl:choose>
12253
12368
  </xsl:otherwise>
12254
12369
  </xsl:choose>
12255
12370
  </xsl:element>
@@ -12478,16 +12593,24 @@
12478
12593
  <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
12479
12594
  <xsl:element name="title" namespace="{$namespace_full}">
12480
12595
  <xsl:copy-of select="@*"/>
12596
+ <xsl:call-template name="addNamedDestinationAttribute"/>
12597
+
12481
12598
  <xsl:apply-templates mode="update_xml_step1"/>
12482
12599
  </xsl:element>
12483
12600
  </xsl:template>
12484
12601
  <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
12485
12602
  <xsl:element name="title" namespace="{$namespace_full}">
12486
12603
  <xsl:copy-of select="@*"/>
12604
+ <xsl:call-template name="addNamedDestinationAttribute"/>
12605
+
12487
12606
  <xsl:apply-templates mode="update_xml_pres"/>
12488
12607
  </xsl:element>
12489
12608
  </xsl:template>
12490
12609
 
12610
+ <xsl:template name="addNamedDestinationAttribute">
12611
+
12612
+ </xsl:template>
12613
+
12491
12614
  <xsl:template match="*[local-name() = 'fmt-name']"/>
12492
12615
  <xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
12493
12616
  <xsl:choose>
@@ -12497,6 +12620,8 @@
12497
12620
  <xsl:otherwise>
12498
12621
  <xsl:element name="name" namespace="{$namespace_full}">
12499
12622
  <xsl:copy-of select="@*"/>
12623
+ <xsl:call-template name="addNamedDestinationAttribute"/>
12624
+
12500
12625
  <xsl:apply-templates mode="update_xml_step1"/>
12501
12626
  </xsl:element>
12502
12627
  </xsl:otherwise>
@@ -12510,6 +12635,8 @@
12510
12635
  <xsl:otherwise>
12511
12636
  <xsl:element name="name" namespace="{$namespace_full}">
12512
12637
  <xsl:copy-of select="@*"/>
12638
+ <xsl:call-template name="addNamedDestinationAttribute"/>
12639
+
12513
12640
  <xsl:apply-templates mode="update_xml_pres"/>
12514
12641
  </xsl:element>
12515
12642
  </xsl:otherwise>
@@ -13967,6 +14094,24 @@
13967
14094
  </xsl:attribute>
13968
14095
  </xsl:template>
13969
14096
 
14097
+ <xsl:template name="setIDforNamedDestination">
14098
+ <xsl:if test="@named_dest">
14099
+ <xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
14100
+ </xsl:if>
14101
+ </xsl:template>
14102
+
14103
+ <xsl:template name="setNamedDestination">
14104
+ <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
14105
+ <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'">
14106
+ <fox:destination internal-destination="{@id}"/>
14107
+ </xsl:if>
14108
+ <xsl:for-each select=". | *[local-name() = 'title'] | *[local-name() = 'name']">
14109
+ <xsl:if test="@named_dest">
14110
+ <fox:destination internal-destination="{@named_dest}"/>
14111
+ </xsl:if>
14112
+ </xsl:for-each>
14113
+ </xsl:template>
14114
+
13970
14115
  <xsl:template name="add-letter-spacing">
13971
14116
  <xsl:param name="text"/>
13972
14117
  <xsl:param name="letter-spacing" select="'0.15'"/>
@@ -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">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Cc
3
- VERSION = "2.6.4".freeze
3
+ VERSION = "2.6.5".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-cc
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: exe
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-generic