metanorma-ribose 2.2.5 → 2.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6569f96ac8899474552e44500006cf02b8c2e4c3e1da5b9548dbc03d17e1617
4
- data.tar.gz: 1c71fcf61463fdde5a8c40cc1177373d2ca03ab5bd6c428685244b6eacc8a678
3
+ metadata.gz: ae1e08fd6979e8b7f5cff2aaeb00f6fe5d9322869ce7f1da3a9e5a565ac1ee83
4
+ data.tar.gz: 81a7d80ec099d88f73e23af6c54ef92a0ffc095015b583a47a06dfebd3934fd8
5
5
  SHA512:
6
- metadata.gz: 66968b01642c0b65450b61e359e0e7e17c80447b0d729f114518d89c585e9188ba86af499a7b8c20636625d2901a90815df9757f8adf1bc8ca99d4f49e192956
7
- data.tar.gz: 8f0d4ab655b1592aa400c0c7844a96e905e9a67c93458380e09c358955e8e4c26762dcda3043302a9b6b0c791ae9e9921ef12320491c2c4dcb8e8107c137e8d4
6
+ metadata.gz: 5a31631f232705210512e777fee5af9c84d0724e34f28b97b3148553042c50f51ebce9758776155a325d6b8e0b4781733f75f0037883d28390c164c8a5807275
7
+ data.tar.gz: 3f97800ccb9d8812abf2699a862a930ddf9e7040fc256d85250817faa21b3d503b84451ba92682e3b9a07066f5c1dd9d61b6bbd8110bb37c7f71686e76161a7b
@@ -2026,6 +2026,7 @@
2026
2026
  <xsl:attribute-set name="term-name-style">
2027
2027
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2028
2028
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2029
+
2029
2030
  </xsl:attribute-set>
2030
2031
 
2031
2032
  <xsl:attribute-set name="figure-block-style">
@@ -3016,7 +3017,7 @@
3016
3017
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3017
3018
  </xsl:when>
3018
3019
  <xsl:otherwise>
3019
- <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer and note that renders separaterely -->
3020
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note and dl which render separaterely -->
3020
3021
  </xsl:otherwise>
3021
3022
  </xsl:choose>
3022
3023
 
@@ -3519,7 +3520,7 @@
3519
3520
  <xsl:param name="colwidths"/>
3520
3521
  <xsl:param name="colgroup"/>
3521
3522
 
3522
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3523
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3523
3524
 
3524
3525
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3525
3526
 
@@ -3587,6 +3588,7 @@
3587
3588
 
3588
3589
  <!-- except gb and bsi -->
3589
3590
 
3591
+ <xsl:apply-templates select="../*[local-name()='dl']"/>
3590
3592
  <xsl:apply-templates select="../*[local-name()='note']"/>
3591
3593
 
3592
3594
  <xsl:variable name="isDisplayRowSeparator">
@@ -3712,7 +3714,7 @@
3712
3714
  <!-- ===================== -->
3713
3715
  <!-- Table's row processing -->
3714
3716
  <!-- ===================== -->
3715
- <!-- row in table header (thead) -->
3717
+ <!-- row in table header (thead) thead/tr -->
3716
3718
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
3717
3719
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
3718
3720
 
@@ -3746,7 +3748,7 @@
3746
3748
  </xsl:choose>
3747
3749
  </xsl:template>
3748
3750
 
3749
- <!-- row in table footer (tfoot) -->
3751
+ <!-- row in table footer (tfoot), tfoot/tr -->
3750
3752
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
3751
3753
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
3752
3754
 
@@ -4227,6 +4229,8 @@
4227
4229
  <!-- <dl><xsl:copy-of select="."/></dl> -->
4228
4230
  <fo:block-container>
4229
4231
 
4232
+ <xsl:call-template name="setBlockSpanAll"/>
4233
+
4230
4234
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
4231
4235
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
4232
4236
  </xsl:if>
@@ -6308,13 +6312,17 @@
6308
6312
  </xsl:template>
6309
6313
 
6310
6314
  <xsl:template match="*[local-name() = 'callout']">
6311
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
6315
+ <xsl:choose>
6316
+ <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
6317
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
6318
+ </xsl:choose>
6312
6319
  </xsl:template>
6313
6320
 
6314
6321
  <xsl:template match="*[local-name() = 'annotation']">
6315
6322
  <xsl:variable name="annotation-id" select="@id"/>
6316
6323
  <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
6317
6324
  <fo:block id="{$annotation-id}" white-space="nowrap">
6325
+
6318
6326
  <fo:inline>
6319
6327
  <xsl:apply-templates>
6320
6328
  <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
@@ -6419,6 +6427,10 @@
6419
6427
  <!-- ====== -->
6420
6428
  <!-- ====== -->
6421
6429
 
6430
+ <xsl:template name="setBlockSpanAll">
6431
+ <xsl:if test="@columns = 1 or (local-name() = 'p' and *[@columns = 1])"><xsl:attribute name="span">all</xsl:attribute></xsl:if>
6432
+ </xsl:template>
6433
+
6422
6434
  <!-- ====== -->
6423
6435
  <!-- note -->
6424
6436
  <!-- termnote -->
@@ -6428,6 +6440,8 @@
6428
6440
 
6429
6441
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
6430
6442
 
6443
+ <xsl:call-template name="setBlockSpanAll"/>
6444
+
6431
6445
  <xsl:if test="ancestor::rsd:ul or ancestor::rsd:ol and not(ancestor::rsd:note[1]/following-sibling::*)">
6432
6446
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
6433
6447
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -6483,6 +6497,8 @@
6483
6497
  <xsl:template match="*[local-name() = 'termnote']">
6484
6498
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
6485
6499
 
6500
+ <xsl:call-template name="setBlockSpanAll"/>
6501
+
6486
6502
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
6487
6503
 
6488
6504
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
@@ -8414,6 +8430,9 @@
8414
8430
  <!-- ====== -->
8415
8431
  <xsl:template match="*[local-name() = 'termexample']">
8416
8432
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
8433
+
8434
+ <xsl:call-template name="setBlockSpanAll"/>
8435
+
8417
8436
  <xsl:apply-templates select="*[local-name()='name']"/>
8418
8437
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8419
8438
  </fo:block>
@@ -8465,6 +8484,8 @@
8465
8484
 
8466
8485
  <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style">
8467
8486
 
8487
+ <xsl:call-template name="setBlockSpanAll"/>
8488
+
8468
8489
  <xsl:if test="ancestor::rsd:ul or ancestor::rsd:ol">
8469
8490
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
8470
8491
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -8497,6 +8518,35 @@
8497
8518
  </fo:block-container>
8498
8519
  </xsl:when> <!-- end block -->
8499
8520
 
8521
+ <xsl:when test="contains(normalize-space($fo_element), 'list')">
8522
+
8523
+ <xsl:variable name="provisional_distance_between_starts">
8524
+ 7
8525
+ </xsl:variable>
8526
+ <xsl:variable name="indent">
8527
+ 0
8528
+ </xsl:variable>
8529
+
8530
+ <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
8531
+ <fo:list-item>
8532
+ <fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
8533
+ <fo:block>
8534
+ <xsl:apply-templates select="*[local-name()='name']">
8535
+ <xsl:with-param name="fo_element">block</xsl:with-param>
8536
+ </xsl:apply-templates>
8537
+ </fo:block>
8538
+ </fo:list-item-label>
8539
+ <fo:list-item-body start-indent="body-start()">
8540
+ <fo:block>
8541
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
8542
+ <xsl:with-param name="fo_element" select="$fo_element"/>
8543
+ </xsl:apply-templates>
8544
+ </fo:block>
8545
+ </fo:list-item-body>
8546
+ </fo:list-item>
8547
+ </fo:list-block>
8548
+ </xsl:when> <!-- end list -->
8549
+
8500
8550
  <xsl:otherwise> <!-- inline -->
8501
8551
 
8502
8552
  <!-- display 'EXAMPLE' and first element in the same line -->
@@ -8577,6 +8627,11 @@
8577
8627
  </fo:block>
8578
8628
  </fo:block-container>
8579
8629
  </xsl:when>
8630
+ <xsl:when test="starts-with(normalize-space($element), 'list')">
8631
+ <fo:block xsl:use-attribute-sets="example-p-style">
8632
+ <xsl:apply-templates/>
8633
+ </fo:block>
8634
+ </xsl:when>
8580
8635
  <xsl:otherwise>
8581
8636
  <fo:inline xsl:use-attribute-sets="example-p-style">
8582
8637
  <xsl:apply-templates/>
@@ -8694,6 +8749,9 @@
8694
8749
  <!-- ====== -->
8695
8750
  <xsl:template match="*[local-name() = 'quote']">
8696
8751
  <fo:block-container margin-left="0mm">
8752
+
8753
+ <xsl:call-template name="setBlockSpanAll"/>
8754
+
8697
8755
  <xsl:if test="parent::*[local-name() = 'note']">
8698
8756
  <xsl:if test="not(ancestor::*[local-name() = 'table'])">
8699
8757
  <xsl:attribute name="margin-left">5mm</xsl:attribute>
@@ -8979,6 +9037,8 @@
8979
9037
  <fo:block>
8980
9038
  <xsl:call-template name="setId"/>
8981
9039
 
9040
+ <xsl:call-template name="setBlockSpanAll"/>
9041
+
8982
9042
  <xsl:apply-templates/>
8983
9043
  </fo:block>
8984
9044
  </xsl:template>
@@ -8993,6 +9053,8 @@
8993
9053
  <fo:block break-after="page"/>
8994
9054
  <fo:block id="{@id}">
8995
9055
 
9056
+ <xsl:call-template name="setBlockSpanAll"/>
9057
+
8996
9058
  </fo:block>
8997
9059
  <xsl:apply-templates/>
8998
9060
  </xsl:template>
@@ -9941,6 +10003,8 @@
9941
10003
  <!-- text in the box -->
9942
10004
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
9943
10005
 
10006
+ <xsl:call-template name="setBlockSpanAll"/>
10007
+
9944
10008
  <fo:block-container xsl:use-attribute-sets="admonition-container-style">
9945
10009
 
9946
10010
  <fo:block xsl:use-attribute-sets="admonition-name-style">
@@ -10119,6 +10183,16 @@
10119
10183
  <xsl:apply-templates mode="update_xml_step1"/>
10120
10184
  </xsl:copy>
10121
10185
  </xsl:template>
10186
+
10187
+ <!-- remove semantic xml -->
10188
+ <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_step1"/>
10189
+
10190
+ <!-- remove image/emf -->
10191
+ <xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_step1"/>
10192
+
10193
+ <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_step1">
10194
+ <xsl:copy-of select="."/>
10195
+ </xsl:template>
10122
10196
  <!-- =========================================================================== -->
10123
10197
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10124
10198
  <!-- =========================================================================== -->
@@ -10140,7 +10214,7 @@
10140
10214
 
10141
10215
  <xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
10142
10216
 
10143
- <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
10217
+ <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
10144
10218
 
10145
10219
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
10146
10220
  <xsl:variable name="tag_keep-together_within-line_open">###<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
@@ -10214,6 +10288,10 @@
10214
10288
 
10215
10289
  </xsl:template>
10216
10290
 
10291
+ <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_enclose_keep-together_within-line">
10292
+ <xsl:copy-of select="."/>
10293
+ </xsl:template>
10294
+
10217
10295
  <xsl:template name="replace_text_tags">
10218
10296
  <xsl:param name="tag_open"/>
10219
10297
  <xsl:param name="tag_close"/>
@@ -10240,6 +10318,194 @@
10240
10318
  <!-- END XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
10241
10319
  <!-- ===================================== -->
10242
10320
 
10321
+ <!-- ===================================== -->
10322
+ <!-- ===================================== -->
10323
+ <!-- Make linear XML (need for landscape orientation) -->
10324
+ <!-- ===================================== -->
10325
+ <!-- ===================================== -->
10326
+ <xsl:template match="@*|node()" mode="linear_xml">
10327
+ <xsl:copy>
10328
+ <xsl:apply-templates select="@*|node()" mode="linear_xml"/>
10329
+ </xsl:copy>
10330
+ </xsl:template>
10331
+
10332
+ <xsl:template match="processing-instruction()" mode="linear_xml">
10333
+ <xsl:copy-of select="."/>
10334
+ </xsl:template>
10335
+
10336
+ <!-- From:
10337
+ <clause>
10338
+ <title>...</title>
10339
+ <p>...</p>
10340
+ </clause>
10341
+ To:
10342
+ <clause/>
10343
+ <title>...</title>
10344
+ <p>...</p>
10345
+ -->
10346
+ <xsl:template match="*[local-name() = 'foreword'] | *[local-name() = 'foreword']//*[local-name() = 'clause'] | *[local-name() = 'preface']//*[local-name() = 'clause'][not(@type = 'corrigenda') and not(@type = 'policy') and not(@type = 'related-refs')] | *[local-name() = 'introduction'] | *[local-name() = 'introduction']//*[local-name() = 'clause'] | *[local-name() = 'sections']//*[local-name() = 'clause'] | *[local-name() = 'annex'] | *[local-name() = 'annex']//*[local-name() = 'clause'] | *[local-name() = 'references'][not(@hidden = 'true')] | *[local-name() = 'bibliography']/*[local-name() = 'clause'] | *[local-name() = 'colophon'] | *[local-name() = 'colophon']//*[local-name() = 'clause'] | *[local-name()='sections']//*[local-name()='terms'] | *[local-name()='sections']//*[local-name()='definitions'] | *[local-name()='annex']//*[local-name()='definitions']" mode="linear_xml" name="clause_linear">
10347
+
10348
+ <xsl:copy>
10349
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
10350
+
10351
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
10352
+
10353
+ <xsl:if test="local-name() = 'foreword' or local-name() = 'introduction' or local-name(..) = 'preface' or local-name(..) = 'sections' or (local-name() = 'references' and parent::*[local-name() = 'bibliography']) or (local-name() = 'clause' and parent::*[local-name() = 'bibliography']) or local-name() = 'annex' or local-name(..) = 'annex' or local-name(..) = 'colophon'">
10354
+ <xsl:attribute name="mainsection">true</xsl:attribute>
10355
+ </xsl:if>
10356
+ </xsl:copy>
10357
+
10358
+ <xsl:apply-templates mode="linear_xml"/>
10359
+ </xsl:template>
10360
+
10361
+ <xsl:template match="*[local-name() = 'term']" mode="linear_xml" priority="2">
10362
+ <xsl:copy>
10363
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
10364
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
10365
+ <xsl:variable name="level">
10366
+ <xsl:call-template name="getLevel"/>
10367
+ </xsl:variable>
10368
+ <xsl:attribute name="depth"><xsl:value-of select="$level"/></xsl:attribute>
10369
+ <xsl:attribute name="ancestor">sections</xsl:attribute>
10370
+ <xsl:apply-templates select="node()[not(local-name() = 'term')]" mode="linear_xml"/>
10371
+ </xsl:copy>
10372
+ <xsl:apply-templates select="*[local-name() = 'term']" mode="linear_xml"/>
10373
+ </xsl:template>
10374
+
10375
+ <xsl:template match="*[local-name() = 'introduction']//*[local-name() = 'title'] | *[local-name() = 'foreword']//*[local-name() = 'title'] | *[local-name() = 'sections']//*[local-name() = 'title'] | *[local-name() = 'annex']//*[local-name() = 'title'] | *[local-name() = 'bibliography']/*[local-name() = 'clause']/*[local-name() = 'title'] | *[local-name() = 'references']/*[local-name() = 'title'] | *[local-name() = 'colophon']//*[local-name() = 'title']" mode="linear_xml" priority="2">
10376
+ <xsl:copy>
10377
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
10378
+
10379
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
10380
+
10381
+ <xsl:variable name="level">
10382
+ <xsl:call-template name="getLevel"/>
10383
+ </xsl:variable>
10384
+ <xsl:attribute name="depth"><xsl:value-of select="$level"/></xsl:attribute>
10385
+
10386
+ <xsl:if test="parent::*[local-name() = 'annex']">
10387
+ <xsl:attribute name="depth">1</xsl:attribute>
10388
+ </xsl:if>
10389
+
10390
+ <xsl:if test="../@inline-header = 'true' and following-sibling::*[1][local-name() = 'p']">
10391
+ <xsl:copy-of select="../@inline-header"/>
10392
+ </xsl:if>
10393
+
10394
+ <xsl:attribute name="ancestor">
10395
+ <xsl:choose>
10396
+ <xsl:when test="ancestor::*[local-name() = 'foreword']">foreword</xsl:when>
10397
+ <xsl:when test="ancestor::*[local-name() = 'introduction']">introduction</xsl:when>
10398
+ <xsl:when test="ancestor::*[local-name() = 'sections']">sections</xsl:when>
10399
+ <xsl:when test="ancestor::*[local-name() = 'annex']">annex</xsl:when>
10400
+ <xsl:when test="ancestor::*[local-name() = 'bibliography']">bibliography</xsl:when>
10401
+ </xsl:choose>
10402
+ </xsl:attribute>
10403
+
10404
+ <xsl:apply-templates mode="linear_xml"/>
10405
+ </xsl:copy>
10406
+ </xsl:template>
10407
+
10408
+ <!-- add @to = figure, table, clause -->
10409
+ <!-- add @depth = from -->
10410
+ <xsl:template match="*[local-name() = 'xref']" mode="linear_xml">
10411
+ <xsl:copy>
10412
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
10413
+ <xsl:variable name="target" select="@target"/>
10414
+ <xsl:attribute name="to">
10415
+ <xsl:value-of select="local-name(//*[@id = current()/@target][1])"/>
10416
+ </xsl:attribute>
10417
+ <xsl:attribute name="depth">
10418
+ <xsl:value-of select="//*[@id = current()/@target][1]/*[local-name() = 'title']/@depth"/>
10419
+ </xsl:attribute>
10420
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
10421
+ </xsl:copy>
10422
+ </xsl:template>
10423
+
10424
+ <xsl:template match="*[not(ancestor::*[local-name() = 'sourcecode'])]/*[local-name() = 'p' or local-name() = 'strong' or local-name() = 'em']/text()" mode="linear_xml">
10425
+ <xsl:choose>
10426
+ <xsl:when test="contains(., $non_breaking_hyphen)">
10427
+ <xsl:call-template name="replaceChar">
10428
+ <xsl:with-param name="text" select="."/>
10429
+ <xsl:with-param name="replace" select="$non_breaking_hyphen"/>
10430
+ <xsl:with-param name="by" select="'-'"/>
10431
+ </xsl:call-template>
10432
+ </xsl:when>
10433
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
10434
+ </xsl:choose>
10435
+ </xsl:template>
10436
+
10437
+ <xsl:template name="replaceChar">
10438
+ <xsl:param name="text"/>
10439
+ <xsl:param name="replace"/>
10440
+ <xsl:param name="by"/>
10441
+ <xsl:choose>
10442
+ <xsl:when test="$text = '' or $replace = '' or not($replace)">
10443
+ <xsl:value-of select="$text"/>
10444
+ </xsl:when>
10445
+ <xsl:when test="contains($text, $replace)">
10446
+ <xsl:value-of select="substring-before($text,$replace)"/>
10447
+ <xsl:element name="inlineChar" namespace="https://www.metanorma.org/ns/jis"><xsl:value-of select="$by"/></xsl:element>
10448
+ <xsl:call-template name="replaceChar">
10449
+ <xsl:with-param name="text" select="substring-after($text,$replace)"/>
10450
+ <xsl:with-param name="replace" select="$replace"/>
10451
+ <xsl:with-param name="by" select="$by"/>
10452
+ </xsl:call-template>
10453
+ </xsl:when>
10454
+ <xsl:otherwise>
10455
+ <xsl:value-of select="$text"/>
10456
+ </xsl:otherwise>
10457
+ </xsl:choose>
10458
+ </xsl:template>
10459
+
10460
+ <xsl:template match="*[local-name() = 'inlineChar']">
10461
+ <fo:inline><xsl:value-of select="."/></fo:inline>
10462
+ </xsl:template>
10463
+
10464
+ <!-- change @reference to actual value, and add skip_footnote_body="true" for repeatable (2nd, 3rd, ...) -->
10465
+ <!--
10466
+ <fn reference="1">
10467
+ <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
10468
+ </fn>
10469
+ -->
10470
+ <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" mode="linear_xml" name="linear_xml_fn">
10471
+ <xsl:variable name="p_fn_">
10472
+ <xsl:call-template name="get_fn_list"/>
10473
+ </xsl:variable>
10474
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
10475
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
10476
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
10477
+ <xsl:variable name="reference" select="@reference"/>
10478
+ <!-- fn sequence number in document -->
10479
+ <xsl:variable name="current_fn_number" select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
10480
+
10481
+ <xsl:copy>
10482
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
10483
+ <!-- put actual reference number -->
10484
+ <xsl:attribute name="current_fn_number">
10485
+ <xsl:value-of select="$current_fn_number"/>
10486
+ </xsl:attribute>
10487
+ <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
10488
+ <xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
10489
+ </xsl:attribute>
10490
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
10491
+ </xsl:copy>
10492
+ </xsl:template>
10493
+
10494
+ <xsl:template match="*[local-name() = 'p'][@type = 'section-title']" priority="3" mode="linear_xml">
10495
+ <xsl:copy>
10496
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
10497
+ <xsl:if test="@depth = '1'">
10498
+ <xsl:attribute name="mainsection">true</xsl:attribute>
10499
+ </xsl:if>
10500
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
10501
+ </xsl:copy>
10502
+ </xsl:template>
10503
+ <!-- ===================================== -->
10504
+ <!-- ===================================== -->
10505
+ <!-- END: Make linear XML (need for landscape orientation) -->
10506
+ <!-- ===================================== -->
10507
+ <!-- ===================================== -->
10508
+
10243
10509
  <!-- for correct rendering combining chars -->
10244
10510
  <xsl:template match="*[local-name() = 'lang_none']">
10245
10511
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ribose
3
- VERSION = "2.2.5".freeze
3
+ VERSION = "2.2.6".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ribose
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.5
4
+ version: 2.2.6
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-03-13 00:00:00.000000000 Z
11
+ date: 2023-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic