metanorma-cc 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: b9409829ee76874795daca563b1a53ce680be430a1bab2c173c6befb8dba8645
4
- data.tar.gz: '05784a026b5e1c1ea5699e25ecfd5c1949c3241e31de11dbc4352a771c58de5f'
3
+ metadata.gz: c89b2284f9823a6a9f9282947db3051b536a434be52cb0003e6704fe2aff7983
4
+ data.tar.gz: faf115d44576453efa7005ee323c74589dc3d4c59afe2aa1b7a4db57e7b8040c
5
5
  SHA512:
6
- metadata.gz: 57630940fdb5039b666c33a0494c1465734954995c8ba4f0bbf2e5d18b69bc9c30bc46f48dacc55d7e044ead8c667954c4036c7478deb703533cea17cf80f32e
7
- data.tar.gz: 9d14496986bf088b87a5a0995bc02497d23d96e2066ad5ef96c4675ebb30a06aeb82481c0a93d9bc987fe7a8a59b717e2eea354bb596016cc3588e3f67e8cbac
6
+ metadata.gz: 357c53a3d1d2b1191e6a6b7ac35b56738f2152d7d1364cd0b58f933192e02cf36f597a33f7d7c393e99afb0557fee750ebf301b77094fa1e150342ec45bf25fc
7
+ data.tar.gz: 1c92c580436ba4332f6cc59a35e68d41f595a24d8bdcd823e7f8e2eb582e30f9033758a0ce76f4b218d28a00579d246e97694e0b839ef1e40a83fdb6001d6bdc
@@ -1343,6 +1343,7 @@
1343
1343
  <xsl:attribute-set name="term-name-style">
1344
1344
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1345
1345
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1346
+
1346
1347
  </xsl:attribute-set>
1347
1348
 
1348
1349
  <xsl:attribute-set name="figure-block-style">
@@ -2279,7 +2280,7 @@
2279
2280
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2280
2281
  </xsl:when>
2281
2282
  <xsl:otherwise>
2282
- <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 -->
2283
+ <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 -->
2283
2284
  </xsl:otherwise>
2284
2285
  </xsl:choose>
2285
2286
 
@@ -2782,7 +2783,7 @@
2782
2783
  <xsl:param name="colwidths"/>
2783
2784
  <xsl:param name="colgroup"/>
2784
2785
 
2785
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2786
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2786
2787
 
2787
2788
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
2788
2789
 
@@ -2850,6 +2851,7 @@
2850
2851
 
2851
2852
  <!-- except gb and bsi -->
2852
2853
 
2854
+ <xsl:apply-templates select="../*[local-name()='dl']"/>
2853
2855
  <xsl:apply-templates select="../*[local-name()='note']"/>
2854
2856
 
2855
2857
  <xsl:variable name="isDisplayRowSeparator">
@@ -2975,7 +2977,7 @@
2975
2977
  <!-- ===================== -->
2976
2978
  <!-- Table's row processing -->
2977
2979
  <!-- ===================== -->
2978
- <!-- row in table header (thead) -->
2980
+ <!-- row in table header (thead) thead/tr -->
2979
2981
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
2980
2982
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
2981
2983
 
@@ -3009,7 +3011,7 @@
3009
3011
  </xsl:choose>
3010
3012
  </xsl:template>
3011
3013
 
3012
- <!-- row in table footer (tfoot) -->
3014
+ <!-- row in table footer (tfoot), tfoot/tr -->
3013
3015
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
3014
3016
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
3015
3017
 
@@ -3485,6 +3487,8 @@
3485
3487
  <!-- <dl><xsl:copy-of select="."/></dl> -->
3486
3488
  <fo:block-container>
3487
3489
 
3490
+ <xsl:call-template name="setBlockSpanAll"/>
3491
+
3488
3492
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
3489
3493
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
3490
3494
  </xsl:if>
@@ -5550,13 +5554,17 @@
5550
5554
  </xsl:template>
5551
5555
 
5552
5556
  <xsl:template match="*[local-name() = 'callout']">
5553
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
5557
+ <xsl:choose>
5558
+ <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
5559
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
5560
+ </xsl:choose>
5554
5561
  </xsl:template>
5555
5562
 
5556
5563
  <xsl:template match="*[local-name() = 'annotation']">
5557
5564
  <xsl:variable name="annotation-id" select="@id"/>
5558
5565
  <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
5559
5566
  <fo:block id="{$annotation-id}" white-space="nowrap">
5567
+
5560
5568
  <fo:inline>
5561
5569
  <xsl:apply-templates>
5562
5570
  <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
@@ -5661,6 +5669,10 @@
5661
5669
  <!-- ====== -->
5662
5670
  <!-- ====== -->
5663
5671
 
5672
+ <xsl:template name="setBlockSpanAll">
5673
+ <xsl:if test="@columns = 1 or (local-name() = 'p' and *[@columns = 1])"><xsl:attribute name="span">all</xsl:attribute></xsl:if>
5674
+ </xsl:template>
5675
+
5664
5676
  <!-- ====== -->
5665
5677
  <!-- note -->
5666
5678
  <!-- termnote -->
@@ -5670,6 +5682,8 @@
5670
5682
 
5671
5683
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
5672
5684
 
5685
+ <xsl:call-template name="setBlockSpanAll"/>
5686
+
5673
5687
  <fo:block-container margin-left="0mm" margin-right="0mm">
5674
5688
 
5675
5689
  <fo:block>
@@ -5720,6 +5734,8 @@
5720
5734
  <xsl:template match="*[local-name() = 'termnote']">
5721
5735
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
5722
5736
 
5737
+ <xsl:call-template name="setBlockSpanAll"/>
5738
+
5723
5739
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
5724
5740
 
5725
5741
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
@@ -7630,6 +7646,9 @@
7630
7646
  <!-- ====== -->
7631
7647
  <xsl:template match="*[local-name() = 'termexample']">
7632
7648
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
7649
+
7650
+ <xsl:call-template name="setBlockSpanAll"/>
7651
+
7633
7652
  <xsl:apply-templates select="*[local-name()='name']"/>
7634
7653
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7635
7654
  </fo:block>
@@ -7681,6 +7700,8 @@
7681
7700
 
7682
7701
  <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style">
7683
7702
 
7703
+ <xsl:call-template name="setBlockSpanAll"/>
7704
+
7684
7705
  <xsl:variable name="fo_element">
7685
7706
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
7686
7707
  block
@@ -7708,6 +7729,35 @@
7708
7729
  </fo:block-container>
7709
7730
  </xsl:when> <!-- end block -->
7710
7731
 
7732
+ <xsl:when test="contains(normalize-space($fo_element), 'list')">
7733
+
7734
+ <xsl:variable name="provisional_distance_between_starts">
7735
+ 7
7736
+ </xsl:variable>
7737
+ <xsl:variable name="indent">
7738
+ 0
7739
+ </xsl:variable>
7740
+
7741
+ <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
7742
+ <fo:list-item>
7743
+ <fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
7744
+ <fo:block>
7745
+ <xsl:apply-templates select="*[local-name()='name']">
7746
+ <xsl:with-param name="fo_element">block</xsl:with-param>
7747
+ </xsl:apply-templates>
7748
+ </fo:block>
7749
+ </fo:list-item-label>
7750
+ <fo:list-item-body start-indent="body-start()">
7751
+ <fo:block>
7752
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
7753
+ <xsl:with-param name="fo_element" select="$fo_element"/>
7754
+ </xsl:apply-templates>
7755
+ </fo:block>
7756
+ </fo:list-item-body>
7757
+ </fo:list-item>
7758
+ </fo:list-block>
7759
+ </xsl:when> <!-- end list -->
7760
+
7711
7761
  <xsl:otherwise> <!-- inline -->
7712
7762
 
7713
7763
  <!-- display 'EXAMPLE' and first element in the same line -->
@@ -7783,6 +7833,11 @@
7783
7833
  </fo:block>
7784
7834
  </fo:block-container>
7785
7835
  </xsl:when>
7836
+ <xsl:when test="starts-with(normalize-space($element), 'list')">
7837
+ <fo:block xsl:use-attribute-sets="example-p-style">
7838
+ <xsl:apply-templates/>
7839
+ </fo:block>
7840
+ </xsl:when>
7786
7841
  <xsl:otherwise>
7787
7842
  <fo:inline xsl:use-attribute-sets="example-p-style">
7788
7843
  <xsl:apply-templates/>
@@ -7900,6 +7955,9 @@
7900
7955
  <!-- ====== -->
7901
7956
  <xsl:template match="*[local-name() = 'quote']">
7902
7957
  <fo:block-container margin-left="0mm">
7958
+
7959
+ <xsl:call-template name="setBlockSpanAll"/>
7960
+
7903
7961
  <xsl:if test="parent::*[local-name() = 'note']">
7904
7962
  <xsl:if test="not(ancestor::*[local-name() = 'table'])">
7905
7963
  <xsl:attribute name="margin-left">5mm</xsl:attribute>
@@ -8196,6 +8254,8 @@
8196
8254
  <fo:block>
8197
8255
  <xsl:call-template name="setId"/>
8198
8256
 
8257
+ <xsl:call-template name="setBlockSpanAll"/>
8258
+
8199
8259
  <xsl:apply-templates/>
8200
8260
  </fo:block>
8201
8261
  </xsl:template>
@@ -8210,6 +8270,8 @@
8210
8270
  <fo:block break-after="page"/>
8211
8271
  <fo:block id="{@id}">
8212
8272
 
8273
+ <xsl:call-template name="setBlockSpanAll"/>
8274
+
8213
8275
  </fo:block>
8214
8276
  <xsl:apply-templates/>
8215
8277
  </xsl:template>
@@ -9163,6 +9225,8 @@
9163
9225
 
9164
9226
  <fo:block xsl:use-attribute-sets="admonition-style">
9165
9227
 
9228
+ <xsl:call-template name="setBlockSpanAll"/>
9229
+
9166
9230
  <xsl:if test="@type = 'editorial'">
9167
9231
  <xsl:attribute name="color">green</xsl:attribute>
9168
9232
  <xsl:attribute name="font-weight">normal</xsl:attribute>
@@ -9346,6 +9410,16 @@
9346
9410
  <xsl:apply-templates mode="update_xml_step1"/>
9347
9411
  </xsl:copy>
9348
9412
  </xsl:template>
9413
+
9414
+ <!-- remove semantic xml -->
9415
+ <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_step1"/>
9416
+
9417
+ <!-- remove image/emf -->
9418
+ <xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_step1"/>
9419
+
9420
+ <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_step1">
9421
+ <xsl:copy-of select="."/>
9422
+ </xsl:template>
9349
9423
  <!-- =========================================================================== -->
9350
9424
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
9351
9425
  <!-- =========================================================================== -->
@@ -9367,7 +9441,7 @@
9367
9441
 
9368
9442
  <xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
9369
9443
 
9370
- <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">
9444
+ <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">
9371
9445
 
9372
9446
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
9373
9447
  <xsl:variable name="tag_keep-together_within-line_open">###<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
@@ -9441,6 +9515,10 @@
9441
9515
 
9442
9516
  </xsl:template>
9443
9517
 
9518
+ <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_enclose_keep-together_within-line">
9519
+ <xsl:copy-of select="."/>
9520
+ </xsl:template>
9521
+
9444
9522
  <xsl:template name="replace_text_tags">
9445
9523
  <xsl:param name="tag_open"/>
9446
9524
  <xsl:param name="tag_close"/>
@@ -9467,6 +9545,194 @@
9467
9545
  <!-- END XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
9468
9546
  <!-- ===================================== -->
9469
9547
 
9548
+ <!-- ===================================== -->
9549
+ <!-- ===================================== -->
9550
+ <!-- Make linear XML (need for landscape orientation) -->
9551
+ <!-- ===================================== -->
9552
+ <!-- ===================================== -->
9553
+ <xsl:template match="@*|node()" mode="linear_xml">
9554
+ <xsl:copy>
9555
+ <xsl:apply-templates select="@*|node()" mode="linear_xml"/>
9556
+ </xsl:copy>
9557
+ </xsl:template>
9558
+
9559
+ <xsl:template match="processing-instruction()" mode="linear_xml">
9560
+ <xsl:copy-of select="."/>
9561
+ </xsl:template>
9562
+
9563
+ <!-- From:
9564
+ <clause>
9565
+ <title>...</title>
9566
+ <p>...</p>
9567
+ </clause>
9568
+ To:
9569
+ <clause/>
9570
+ <title>...</title>
9571
+ <p>...</p>
9572
+ -->
9573
+ <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">
9574
+
9575
+ <xsl:copy>
9576
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
9577
+
9578
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
9579
+
9580
+ <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'">
9581
+ <xsl:attribute name="mainsection">true</xsl:attribute>
9582
+ </xsl:if>
9583
+ </xsl:copy>
9584
+
9585
+ <xsl:apply-templates mode="linear_xml"/>
9586
+ </xsl:template>
9587
+
9588
+ <xsl:template match="*[local-name() = 'term']" mode="linear_xml" priority="2">
9589
+ <xsl:copy>
9590
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
9591
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
9592
+ <xsl:variable name="level">
9593
+ <xsl:call-template name="getLevel"/>
9594
+ </xsl:variable>
9595
+ <xsl:attribute name="depth"><xsl:value-of select="$level"/></xsl:attribute>
9596
+ <xsl:attribute name="ancestor">sections</xsl:attribute>
9597
+ <xsl:apply-templates select="node()[not(local-name() = 'term')]" mode="linear_xml"/>
9598
+ </xsl:copy>
9599
+ <xsl:apply-templates select="*[local-name() = 'term']" mode="linear_xml"/>
9600
+ </xsl:template>
9601
+
9602
+ <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">
9603
+ <xsl:copy>
9604
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
9605
+
9606
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
9607
+
9608
+ <xsl:variable name="level">
9609
+ <xsl:call-template name="getLevel"/>
9610
+ </xsl:variable>
9611
+ <xsl:attribute name="depth"><xsl:value-of select="$level"/></xsl:attribute>
9612
+
9613
+ <xsl:if test="parent::*[local-name() = 'annex']">
9614
+ <xsl:attribute name="depth">1</xsl:attribute>
9615
+ </xsl:if>
9616
+
9617
+ <xsl:if test="../@inline-header = 'true' and following-sibling::*[1][local-name() = 'p']">
9618
+ <xsl:copy-of select="../@inline-header"/>
9619
+ </xsl:if>
9620
+
9621
+ <xsl:attribute name="ancestor">
9622
+ <xsl:choose>
9623
+ <xsl:when test="ancestor::*[local-name() = 'foreword']">foreword</xsl:when>
9624
+ <xsl:when test="ancestor::*[local-name() = 'introduction']">introduction</xsl:when>
9625
+ <xsl:when test="ancestor::*[local-name() = 'sections']">sections</xsl:when>
9626
+ <xsl:when test="ancestor::*[local-name() = 'annex']">annex</xsl:when>
9627
+ <xsl:when test="ancestor::*[local-name() = 'bibliography']">bibliography</xsl:when>
9628
+ </xsl:choose>
9629
+ </xsl:attribute>
9630
+
9631
+ <xsl:apply-templates mode="linear_xml"/>
9632
+ </xsl:copy>
9633
+ </xsl:template>
9634
+
9635
+ <!-- add @to = figure, table, clause -->
9636
+ <!-- add @depth = from -->
9637
+ <xsl:template match="*[local-name() = 'xref']" mode="linear_xml">
9638
+ <xsl:copy>
9639
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
9640
+ <xsl:variable name="target" select="@target"/>
9641
+ <xsl:attribute name="to">
9642
+ <xsl:value-of select="local-name(//*[@id = current()/@target][1])"/>
9643
+ </xsl:attribute>
9644
+ <xsl:attribute name="depth">
9645
+ <xsl:value-of select="//*[@id = current()/@target][1]/*[local-name() = 'title']/@depth"/>
9646
+ </xsl:attribute>
9647
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
9648
+ </xsl:copy>
9649
+ </xsl:template>
9650
+
9651
+ <xsl:template match="*[not(ancestor::*[local-name() = 'sourcecode'])]/*[local-name() = 'p' or local-name() = 'strong' or local-name() = 'em']/text()" mode="linear_xml">
9652
+ <xsl:choose>
9653
+ <xsl:when test="contains(., $non_breaking_hyphen)">
9654
+ <xsl:call-template name="replaceChar">
9655
+ <xsl:with-param name="text" select="."/>
9656
+ <xsl:with-param name="replace" select="$non_breaking_hyphen"/>
9657
+ <xsl:with-param name="by" select="'-'"/>
9658
+ </xsl:call-template>
9659
+ </xsl:when>
9660
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
9661
+ </xsl:choose>
9662
+ </xsl:template>
9663
+
9664
+ <xsl:template name="replaceChar">
9665
+ <xsl:param name="text"/>
9666
+ <xsl:param name="replace"/>
9667
+ <xsl:param name="by"/>
9668
+ <xsl:choose>
9669
+ <xsl:when test="$text = '' or $replace = '' or not($replace)">
9670
+ <xsl:value-of select="$text"/>
9671
+ </xsl:when>
9672
+ <xsl:when test="contains($text, $replace)">
9673
+ <xsl:value-of select="substring-before($text,$replace)"/>
9674
+ <xsl:element name="inlineChar" namespace="https://www.metanorma.org/ns/jis"><xsl:value-of select="$by"/></xsl:element>
9675
+ <xsl:call-template name="replaceChar">
9676
+ <xsl:with-param name="text" select="substring-after($text,$replace)"/>
9677
+ <xsl:with-param name="replace" select="$replace"/>
9678
+ <xsl:with-param name="by" select="$by"/>
9679
+ </xsl:call-template>
9680
+ </xsl:when>
9681
+ <xsl:otherwise>
9682
+ <xsl:value-of select="$text"/>
9683
+ </xsl:otherwise>
9684
+ </xsl:choose>
9685
+ </xsl:template>
9686
+
9687
+ <xsl:template match="*[local-name() = 'inlineChar']">
9688
+ <fo:inline><xsl:value-of select="."/></fo:inline>
9689
+ </xsl:template>
9690
+
9691
+ <!-- change @reference to actual value, and add skip_footnote_body="true" for repeatable (2nd, 3rd, ...) -->
9692
+ <!--
9693
+ <fn reference="1">
9694
+ <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
9695
+ </fn>
9696
+ -->
9697
+ <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">
9698
+ <xsl:variable name="p_fn_">
9699
+ <xsl:call-template name="get_fn_list"/>
9700
+ </xsl:variable>
9701
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
9702
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
9703
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
9704
+ <xsl:variable name="reference" select="@reference"/>
9705
+ <!-- fn sequence number in document -->
9706
+ <xsl:variable name="current_fn_number" select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
9707
+
9708
+ <xsl:copy>
9709
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
9710
+ <!-- put actual reference number -->
9711
+ <xsl:attribute name="current_fn_number">
9712
+ <xsl:value-of select="$current_fn_number"/>
9713
+ </xsl:attribute>
9714
+ <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
9715
+ <xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
9716
+ </xsl:attribute>
9717
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
9718
+ </xsl:copy>
9719
+ </xsl:template>
9720
+
9721
+ <xsl:template match="*[local-name() = 'p'][@type = 'section-title']" priority="3" mode="linear_xml">
9722
+ <xsl:copy>
9723
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
9724
+ <xsl:if test="@depth = '1'">
9725
+ <xsl:attribute name="mainsection">true</xsl:attribute>
9726
+ </xsl:if>
9727
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
9728
+ </xsl:copy>
9729
+ </xsl:template>
9730
+ <!-- ===================================== -->
9731
+ <!-- ===================================== -->
9732
+ <!-- END: Make linear XML (need for landscape orientation) -->
9733
+ <!-- ===================================== -->
9734
+ <!-- ===================================== -->
9735
+
9470
9736
  <!-- for correct rendering combining chars -->
9471
9737
  <xsl:template match="*[local-name() = 'lang_none']">
9472
9738
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module CC
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-cc
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