metanorma-cc 2.2.7 → 2.2.8

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: 5192dc9cce37d02987f3bab06b15ae0e3c443445f95fd24bdc877102e6c5101c
4
- data.tar.gz: 3d495638ef0b8c2aab53fd0d15861be049c27986658b390123236e47a0c74196
3
+ metadata.gz: 9962f9287fd441fee8c3f00975e367e9a9e5ee8aed89e4a1f6c27036154ee35c
4
+ data.tar.gz: 71d90e7c27c7a10dfb445dda45e9c66bdfae4a1f1dab8fa645bc00d8b447c0e3
5
5
  SHA512:
6
- metadata.gz: fe10656b3cbccaf5d9b7fe6913a007979cb80bff505f96c56afd2955bf6777f24679795671b269eb96768538ec595700b19a17d1040ce30203fa9d670533c381
7
- data.tar.gz: dc90327c73898c498aab019fd4b1baa69ef900ce8231b9386c4a263282f5175c5b902e686b09306035cda679645cb35c81c5c7fe341f540b585c4458993cc61f
6
+ metadata.gz: af6ad89ffd8a096eac22cc9430bfc5d96fb70c9ebca2aeaa21f4ee973ffccb2bc38f9f238d8c594e63439d95b56b35835e4ff52959f219bdc110552731f25dca
7
+ data.tar.gz: 8bed035725149c2fef222f813cc62a431f46e4c6b1efa3ffdda626c4019f04f35ee19908c8e8edcd5e84b596b883eb96f17482b6100e5f70e3e1f696ad98aef5
@@ -494,13 +494,17 @@
494
494
  </xsl:template>
495
495
 
496
496
  <xsl:template match="csd:xref" priority="2">
497
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">
498
- <xsl:if test="not(starts-with(text(), 'Figure') or starts-with(text(), 'Table'))">
499
- <xsl:attribute name="color">blue</xsl:attribute>
500
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
501
- </xsl:if>
502
- <xsl:apply-templates/>
503
- </fo:basic-link>
497
+ <xsl:call-template name="insert_basic_link">
498
+ <xsl:with-param name="element">
499
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">
500
+ <xsl:if test="not(starts-with(text(), 'Figure') or starts-with(text(), 'Table'))">
501
+ <xsl:attribute name="color">blue</xsl:attribute>
502
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
503
+ </xsl:if>
504
+ <xsl:apply-templates/>
505
+ </fo:basic-link>
506
+ </xsl:with-param>
507
+ </xsl:call-template>
504
508
  </xsl:template>
505
509
 
506
510
  <xsl:template name="insertHeaderFooter">
@@ -1263,6 +1267,7 @@
1263
1267
  </xsl:attribute-set>
1264
1268
 
1265
1269
  <xsl:attribute-set name="xref-style">
1270
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
1266
1271
 
1267
1272
  </xsl:attribute-set>
1268
1273
 
@@ -3228,9 +3233,13 @@
3228
3233
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
3229
3234
  </xsl:if>
3230
3235
 
3231
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3232
- <xsl:value-of select="$current_fn_number_text"/>
3233
- </fo:basic-link>
3236
+ <xsl:call-template name="insert_basic_link">
3237
+ <xsl:with-param name="element">
3238
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3239
+ <xsl:value-of select="$current_fn_number_text"/>
3240
+ </fo:basic-link>
3241
+ </xsl:with-param>
3242
+ </xsl:call-template>
3234
3243
  </fo:inline>
3235
3244
  </xsl:variable>
3236
3245
 
@@ -3563,8 +3572,10 @@
3563
3572
  <xsl:apply-templates select="preceding-sibling::*[1][local-name() = 'p' and @keep-with-next = 'true']/node()"/>
3564
3573
  <xsl:text> </xsl:text>
3565
3574
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
3566
- <xsl:text/>
3567
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
3575
+ <xsl:if test="*[local-name()='dd']/node()[normalize-space() != ''][1][self::text()]">
3576
+ <xsl:text> </xsl:text>
3577
+ </xsl:if>
3578
+ <xsl:apply-templates select="*[local-name()='dd']/node()" mode="inline"/>
3568
3579
  </fo:block>
3569
3580
 
3570
3581
  </xsl:when> <!-- END: only one component -->
@@ -4051,8 +4062,18 @@
4051
4062
  </xsl:if>
4052
4063
  </xsl:template>
4053
4064
 
4054
- <xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
4055
- <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
4065
+ <xsl:template match="*[local-name()='dd']/*" mode="inline">
4066
+ <xsl:variable name="is_inline_element_after_where">
4067
+ <xsl:if test="(local-name() = 'p') and not(preceding-sibling::node()[normalize-space() != ''])">true</xsl:if>
4068
+ </xsl:variable>
4069
+ <xsl:choose>
4070
+ <xsl:when test="$is_inline_element_after_where = 'true'">
4071
+ <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
4072
+ </xsl:when>
4073
+ <xsl:otherwise>
4074
+ <xsl:apply-templates select="."/>
4075
+ </xsl:otherwise>
4076
+ </xsl:choose>
4056
4077
  </xsl:template>
4057
4078
 
4058
4079
  <!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
@@ -5483,6 +5504,79 @@
5483
5504
  <xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
5484
5505
  </xsl:template>
5485
5506
 
5507
+ <!-- special case for:
5508
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
5509
+ <mstyle displaystyle="true">
5510
+ <msup>
5511
+ <mi color="#00000000">C</mi>
5512
+ <mtext>R</mtext>
5513
+ </msup>
5514
+ <msubsup>
5515
+ <mtext>C</mtext>
5516
+ <mi>n</mi>
5517
+ <mi>k</mi>
5518
+ </msubsup>
5519
+ </mstyle>
5520
+ </math>
5521
+ -->
5522
+ <xsl:template match="mathml:msup/mathml:mi[. = '‌' or . = ''][not(preceding-sibling::*)][following-sibling::mathml:mtext]" mode="mathml">
5523
+ <xsl:copy>
5524
+ <xsl:copy-of select="@*"/>
5525
+ <xsl:variable name="next_mtext" select="ancestor::mathml:msup/following-sibling::*[1][self::mathml:msubsup or self::mathml:msub or self::mathml:msup]/mathml:mtext"/>
5526
+ <xsl:if test="string-length($next_mtext) != ''">
5527
+ <xsl:attribute name="color">#00000000</xsl:attribute>
5528
+ </xsl:if>
5529
+ <xsl:apply-templates/>
5530
+ <xsl:value-of select="$next_mtext"/>
5531
+ </xsl:copy>
5532
+ </xsl:template>
5533
+
5534
+ <!-- special case for:
5535
+ <msup>
5536
+ <mtext/>
5537
+ <mn>1</mn>
5538
+ </msup>
5539
+ convert to (add mspace after mtext and enclose them into mrow):
5540
+ <msup>
5541
+ <mrow>
5542
+ <mtext/>
5543
+ <mspace height="1.47ex"/>
5544
+ </mrow>
5545
+ <mn>1</mn>
5546
+ </msup>
5547
+ -->
5548
+ <xsl:template match="mathml:msup/mathml:mtext[not(preceding-sibling::*)]" mode="mathml">
5549
+ <mathml:mrow>
5550
+ <xsl:copy-of select="."/>
5551
+ <mathml:mspace height="1.47ex"/>
5552
+ </mathml:mrow>
5553
+ </xsl:template>
5554
+
5555
+ <!-- add space around vertical line -->
5556
+ <xsl:template match="mathml:mo[normalize-space(text()) = '|']" mode="mathml">
5557
+ <xsl:copy>
5558
+ <xsl:apply-templates select="@*" mode="mathml"/>
5559
+ <xsl:if test="not(@lspace)">
5560
+ <xsl:attribute name="lspace">0.4em</xsl:attribute>
5561
+ </xsl:if>
5562
+ <xsl:if test="not(@rspace)">
5563
+ <xsl:attribute name="rspace">0.4em</xsl:attribute>
5564
+ </xsl:if>
5565
+ <xsl:apply-templates mode="mathml"/>
5566
+ </xsl:copy>
5567
+ </xsl:template>
5568
+
5569
+ <!-- decrease fontsize for 'Circled Times' char -->
5570
+ <xsl:template match="mathml:mo[normalize-space(text()) = '⊗']" mode="mathml">
5571
+ <xsl:copy>
5572
+ <xsl:apply-templates select="@*" mode="mathml"/>
5573
+ <xsl:if test="not(@fontsize)">
5574
+ <xsl:attribute name="fontsize">55%</xsl:attribute>
5575
+ </xsl:if>
5576
+ <xsl:apply-templates mode="mathml"/>
5577
+ </xsl:copy>
5578
+ </xsl:template>
5579
+
5486
5580
  <!-- Examples:
5487
5581
  <stem type="AsciiMath">x = 1</stem>
5488
5582
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -5540,19 +5634,23 @@
5540
5634
  <xsl:apply-templates/>
5541
5635
  </xsl:when>
5542
5636
  <xsl:otherwise>
5543
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
5544
- <xsl:choose>
5545
- <xsl:when test="normalize-space(.) = ''">
5546
- <xsl:call-template name="add-zero-spaces-link-java">
5547
- <xsl:with-param name="text" select="$target_text"/>
5548
- </xsl:call-template>
5549
- </xsl:when>
5550
- <xsl:otherwise>
5551
- <!-- output text from <link>text</link> -->
5552
- <xsl:apply-templates/>
5553
- </xsl:otherwise>
5554
- </xsl:choose>
5555
- </fo:basic-link>
5637
+ <xsl:call-template name="insert_basic_link">
5638
+ <xsl:with-param name="element">
5639
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
5640
+ <xsl:choose>
5641
+ <xsl:when test="normalize-space(.) = ''">
5642
+ <xsl:call-template name="add-zero-spaces-link-java">
5643
+ <xsl:with-param name="text" select="$target_text"/>
5644
+ </xsl:call-template>
5645
+ </xsl:when>
5646
+ <xsl:otherwise>
5647
+ <!-- output text from <link>text</link> -->
5648
+ <xsl:apply-templates/>
5649
+ </xsl:otherwise>
5650
+ </xsl:choose>
5651
+ </fo:basic-link>
5652
+ </xsl:with-param>
5653
+ </xsl:call-template>
5556
5654
  </xsl:otherwise>
5557
5655
  </xsl:choose>
5558
5656
  </fo:inline>
@@ -5615,12 +5713,16 @@
5615
5713
  </xsl:template>
5616
5714
 
5617
5715
  <xsl:template match="*[local-name() = 'xref']">
5618
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
5619
- <xsl:if test="parent::*[local-name() = 'add']">
5620
- <xsl:call-template name="append_add-style"/>
5621
- </xsl:if>
5622
- <xsl:apply-templates/>
5623
- </fo:basic-link>
5716
+ <xsl:call-template name="insert_basic_link">
5717
+ <xsl:with-param name="element">
5718
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
5719
+ <xsl:if test="parent::*[local-name() = 'add']">
5720
+ <xsl:call-template name="append_add-style"/>
5721
+ </xsl:if>
5722
+ <xsl:apply-templates/>
5723
+ </fo:basic-link>
5724
+ </xsl:with-param>
5725
+ </xsl:call-template>
5624
5726
  </xsl:template>
5625
5727
 
5626
5728
  <!-- ====== -->
@@ -6001,7 +6103,7 @@
6001
6103
  <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
6002
6104
  </xsl:when>
6003
6105
  <xsl:when test="not(starts-with(@src, 'data:'))">
6004
- <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
6106
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
6005
6107
  </xsl:when>
6006
6108
  <xsl:otherwise>
6007
6109
  <xsl:value-of select="@src"/>
@@ -6023,7 +6125,7 @@
6023
6125
  </xsl:when>
6024
6126
  <xsl:when test="not(starts-with(@src, 'data:'))">
6025
6127
  <xsl:variable name="src">
6026
- <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
6128
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
6027
6129
  </xsl:variable>
6028
6130
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
6029
6131
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -6409,15 +6511,19 @@
6409
6511
  <xsl:param name="dest"/>
6410
6512
  <fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
6411
6513
  <fo:block font-size="1pt">
6412
- <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
6413
- <fo:inline-container inline-progression-dimension="100%">
6414
- <fo:block-container height="{$height - 1}px" width="100%">
6415
- <!-- DEBUG <xsl:if test="local-name()='polygon'">
6416
- <xsl:attribute name="background-color">magenta</xsl:attribute>
6417
- </xsl:if> -->
6418
- <fo:block> </fo:block></fo:block-container>
6419
- </fo:inline-container>
6420
- </fo:basic-link>
6514
+ <xsl:call-template name="insert_basic_link">
6515
+ <xsl:with-param name="element">
6516
+ <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
6517
+ <fo:inline-container inline-progression-dimension="100%">
6518
+ <fo:block-container height="{$height - 1}px" width="100%">
6519
+ <!-- DEBUG <xsl:if test="local-name()='polygon'">
6520
+ <xsl:attribute name="background-color">magenta</xsl:attribute>
6521
+ </xsl:if> -->
6522
+ <fo:block> </fo:block></fo:block-container>
6523
+ </fo:inline-container>
6524
+ </fo:basic-link>
6525
+ </xsl:with-param>
6526
+ </xsl:call-template>
6421
6527
  </fo:block>
6422
6528
  </fo:block-container>
6423
6529
  </xsl:template>
@@ -7964,14 +8070,18 @@
7964
8070
  </xsl:template>
7965
8071
 
7966
8072
  <xsl:template match="*[local-name() = 'origin']">
7967
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
7968
- <xsl:if test="normalize-space(@citeas) = ''">
7969
- <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
7970
- </xsl:if>
7971
- <fo:inline xsl:use-attribute-sets="origin-style">
7972
- <xsl:apply-templates/>
7973
- </fo:inline>
7974
- </fo:basic-link>
8073
+ <xsl:call-template name="insert_basic_link">
8074
+ <xsl:with-param name="element">
8075
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8076
+ <xsl:if test="normalize-space(@citeas) = ''">
8077
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
8078
+ </xsl:if>
8079
+ <fo:inline xsl:use-attribute-sets="origin-style">
8080
+ <xsl:apply-templates/>
8081
+ </fo:inline>
8082
+ </fo:basic-link>
8083
+ </xsl:with-param>
8084
+ </xsl:call-template>
7975
8085
  </xsl:template>
7976
8086
 
7977
8087
  <!-- not using, see https://github.com/glossarist/iev-document/issues/23 -->
@@ -8045,9 +8155,13 @@
8045
8155
  <xsl:if test="../*[local-name() = 'author']">
8046
8156
  <xsl:text>, </xsl:text>
8047
8157
  </xsl:if>
8048
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8049
- <xsl:apply-templates/>
8050
- </fo:basic-link>
8158
+ <xsl:call-template name="insert_basic_link">
8159
+ <xsl:with-param name="element">
8160
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8161
+ <xsl:apply-templates/>
8162
+ </fo:basic-link>
8163
+ </xsl:with-param>
8164
+ </xsl:call-template>
8051
8165
  </xsl:template>
8052
8166
 
8053
8167
  <xsl:template match="*[local-name() = 'author']">
@@ -8096,28 +8210,32 @@
8096
8210
  <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
8097
8211
  <xsl:variable name="text" select="normalize-space()"/>
8098
8212
 
8099
- <fo:basic-link fox:alt-text="{@citeas}">
8100
- <xsl:if test="normalize-space(@citeas) = ''">
8101
- <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
8102
- </xsl:if>
8103
- <xsl:if test="@type = 'inline'">
8213
+ <xsl:call-template name="insert_basic_link">
8214
+ <xsl:with-param name="element">
8215
+ <fo:basic-link fox:alt-text="{@citeas}">
8216
+ <xsl:if test="normalize-space(@citeas) = ''">
8217
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
8218
+ </xsl:if>
8219
+ <xsl:if test="@type = 'inline'">
8104
8220
 
8105
- <xsl:attribute name="color">blue</xsl:attribute>
8106
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
8221
+ <xsl:attribute name="color">blue</xsl:attribute>
8222
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
8107
8223
 
8108
- </xsl:if>
8224
+ </xsl:if>
8109
8225
 
8110
- <xsl:choose>
8111
- <xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
8112
- <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
8113
- </xsl:when>
8114
- <xsl:otherwise>
8115
- <xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
8116
- </xsl:otherwise>
8117
- </xsl:choose>
8226
+ <xsl:choose>
8227
+ <xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
8228
+ <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
8229
+ </xsl:when>
8230
+ <xsl:otherwise>
8231
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
8232
+ </xsl:otherwise>
8233
+ </xsl:choose>
8118
8234
 
8119
- <xsl:apply-templates/>
8120
- </fo:basic-link>
8235
+ <xsl:apply-templates/>
8236
+ </fo:basic-link>
8237
+ </xsl:with-param>
8238
+ </xsl:call-template>
8121
8239
 
8122
8240
  </fo:inline>
8123
8241
  </xsl:when>
@@ -8363,7 +8481,10 @@
8363
8481
  <xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/>
8364
8482
 
8365
8483
  <xsl:template name="setULLabel">
8366
- <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
8484
+ <xsl:variable name="list_level__">
8485
+ <xsl:value-of select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
8486
+ </xsl:variable>
8487
+ <xsl:variable name="list_level_" select="number($list_level__)"/>
8367
8488
  <xsl:variable name="list_level">
8368
8489
  <xsl:choose>
8369
8490
  <xsl:when test="$list_level_ &lt;= 3"><xsl:value-of select="$list_level_"/></xsl:when>
@@ -8496,9 +8617,11 @@
8496
8617
  </fo:block-container>
8497
8618
  </xsl:when>
8498
8619
  <xsl:otherwise>
8499
- <fo:block>
8500
- <xsl:apply-templates select="." mode="list"/>
8501
- </fo:block>
8620
+
8621
+ <fo:block>
8622
+ <xsl:apply-templates select="." mode="list"/>
8623
+ </fo:block>
8624
+
8502
8625
  </xsl:otherwise>
8503
8626
  </xsl:choose>
8504
8627
  </xsl:template>
@@ -9186,24 +9309,32 @@
9186
9309
  <xsl:for-each select="*[local-name() = 'tab']">
9187
9310
  <xsl:variable name="current_id" select="generate-id()"/>
9188
9311
  <fo:table-cell>
9189
- <fo:block>
9190
- <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
9191
- <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
9192
- <xsl:choose>
9193
- <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
9194
- <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
9195
- </xsl:choose>
9196
- </xsl:for-each>
9197
- </fo:basic-link>
9312
+ <fo:block line-height-shift-adjustment="disregard-shifts">
9313
+ <xsl:call-template name="insert_basic_link">
9314
+ <xsl:with-param name="element">
9315
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
9316
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
9317
+ <xsl:choose>
9318
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
9319
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
9320
+ </xsl:choose>
9321
+ </xsl:for-each>
9322
+ </fo:basic-link>
9323
+ </xsl:with-param>
9324
+ </xsl:call-template>
9198
9325
  </fo:block>
9199
9326
  </fo:table-cell>
9200
9327
  </xsl:for-each>
9201
9328
  <!-- last column - for page numbers -->
9202
9329
  <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
9203
9330
  <fo:block>
9204
- <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
9205
- <fo:page-number-citation ref-id="{$target}"/>
9206
- </fo:basic-link>
9331
+ <xsl:call-template name="insert_basic_link">
9332
+ <xsl:with-param name="element">
9333
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
9334
+ <fo:page-number-citation ref-id="{$target}"/>
9335
+ </fo:basic-link>
9336
+ </xsl:with-param>
9337
+ </xsl:call-template>
9207
9338
  </fo:block>
9208
9339
  </fo:table-cell>
9209
9340
  </xsl:template>
@@ -9245,6 +9376,27 @@
9245
9376
  <!-- End Table of Contents (ToC) processing -->
9246
9377
  <!-- =================== -->
9247
9378
 
9379
+ <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
9380
+ <xsl:template name="insert_basic_link">
9381
+ <xsl:param name="element"/>
9382
+ <xsl:variable name="element_node" select="xalan:nodeset($element)"/>
9383
+ <xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
9384
+ <xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
9385
+ <xsl:choose>
9386
+ <xsl:when test="$external-destination = 'true' or $internal-destination = 'true'">
9387
+ <xsl:copy-of select="$element_node"/>
9388
+ </xsl:when>
9389
+ <xsl:otherwise>
9390
+ <fo:inline>
9391
+ <xsl:for-each select="$element_node/fo:basic-link/@*[local-name() != 'external-destination' and local-name() != 'internal-destination' and local-name() != 'alt-text']">
9392
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
9393
+ </xsl:for-each>
9394
+ <xsl:copy-of select="$element_node/fo:basic-link/node()"/>
9395
+ </fo:inline>
9396
+ </xsl:otherwise>
9397
+ </xsl:choose>
9398
+ </xsl:template>
9399
+
9248
9400
  <xsl:template match="*[local-name() = 'variant-title']"/> <!-- [@type = 'sub'] -->
9249
9401
  <xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
9250
9402
  <fo:inline padding-right="5mm"> </fo:inline>
@@ -1,5 +1,4 @@
1
1
  <nav>
2
- <h1 id="content">Contents</h1>
3
2
  <div id="toc"></div>
4
3
 
5
4
  </nav>
@@ -14,6 +14,3 @@
14
14
 
15
15
  </div>
16
16
 
17
- <p class="zzContents" style='margin-top:0cm'><span lang="EN-GB">Contents</span></p>
18
-
19
- WORDTOC
@@ -1,6 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar ns="https://www.metanorma.org/ns/csd" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
2
+ <grammar ns='https://www.metanorma.org/ns/cc' xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
3
  <!--
4
+ VERSION v1.2.1
4
5
  default namespace = "http://riboseinc.com/csd"
5
6
  Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
6
7
  we cannot have a new default namespace: we will end up with a grammar with two different
@@ -60,13 +61,7 @@
60
61
  </include>
61
62
  <define name="csd-standard">
62
63
  <element name="csd-standard">
63
- <attribute name="version"/>
64
- <attribute name="type">
65
- <choice>
66
- <value>semantic</value>
67
- <value>presentation</value>
68
- </choice>
69
- </attribute>
64
+ <ref name="Root-Attributes"/>
70
65
  <ref name="bibdata"/>
71
66
  <zeroOrMore>
72
67
  <ref name="termdocsource"/>
@@ -17,6 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
+ <!-- VERSION v1.2.1 -->
20
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
21
22
  <include href="reqt.rng"/>
22
23
  <include href="basicdoc.rng">
@@ -1349,15 +1350,19 @@
1349
1350
  </choice>
1350
1351
  </element>
1351
1352
  </define>
1353
+ <define name="Root-Attributes">
1354
+ <attribute name="version"/>
1355
+ <attribute name="schema-version"/>
1356
+ <attribute name="type">
1357
+ <choice>
1358
+ <value>semantic</value>
1359
+ <value>presentation</value>
1360
+ </choice>
1361
+ </attribute>
1362
+ </define>
1352
1363
  <define name="standard-document">
1353
1364
  <element name="standard-document">
1354
- <attribute name="version"/>
1355
- <attribute name="type">
1356
- <choice>
1357
- <value>semantic</value>
1358
- <value>presentation</value>
1359
- </choice>
1360
- </attribute>
1365
+ <ref name="Root-Attributes"/>
1361
1366
  <ref name="bibdata"/>
1362
1367
  <optional>
1363
1368
  <ref name="misccontainer"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module CC
3
- VERSION = "2.2.7".freeze
3
+ VERSION = "2.2.8".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.2.7
4
+ version: 2.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-10 00:00:00.000000000 Z
11
+ date: 2023-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic