metanorma-csa 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 +4 -4
- data/lib/isodoc/csa/csa.standard.xsl +272 -6
- data/lib/metanorma/csa/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2184d97c9a8c1557149239d93b3f6494a55f36d96ced20809e050bd86a735eaa
|
4
|
+
data.tar.gz: d0125b0fbb112f4912a4e4cb6e88d23a78dfc31c6a9185f88445a5064948b664
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf66ecb04c727773f03abab6381fe68d5fd95f632acc8d61e418c50fe53449e02dc4feea1a733b37433499d9bdd9d2fa52d39e0c3babbc211a5ebd8f22818935
|
7
|
+
data.tar.gz: 7efa80a1016c8491366ce957533b188ed3aa8677b3d716d66a5622a8f9dc0656eb97e1f3532a1312452d62266add79c6ba36a9f8e67c710a0794e260e0632f43
|
@@ -1342,6 +1342,7 @@
|
|
1342
1342
|
<xsl:attribute-set name="term-name-style">
|
1343
1343
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
1344
1344
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
1345
|
+
|
1345
1346
|
</xsl:attribute-set>
|
1346
1347
|
|
1347
1348
|
<xsl:attribute-set name="figure-block-style">
|
@@ -2305,7 +2306,7 @@
|
|
2305
2306
|
<xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
|
2306
2307
|
</xsl:when>
|
2307
2308
|
<xsl:otherwise>
|
2308
|
-
<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
|
2309
|
+
<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 -->
|
2309
2310
|
</xsl:otherwise>
|
2310
2311
|
</xsl:choose>
|
2311
2312
|
|
@@ -2808,7 +2809,7 @@
|
|
2808
2809
|
<xsl:param name="colwidths"/>
|
2809
2810
|
<xsl:param name="colgroup"/>
|
2810
2811
|
|
2811
|
-
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
2812
|
+
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
2812
2813
|
|
2813
2814
|
<xsl:variable name="isNoteOrFnExistShowAfterTable">
|
2814
2815
|
|
@@ -2876,6 +2877,7 @@
|
|
2876
2877
|
|
2877
2878
|
<!-- except gb and bsi -->
|
2878
2879
|
|
2880
|
+
<xsl:apply-templates select="../*[local-name()='dl']"/>
|
2879
2881
|
<xsl:apply-templates select="../*[local-name()='note']"/>
|
2880
2882
|
|
2881
2883
|
<xsl:variable name="isDisplayRowSeparator">
|
@@ -3001,7 +3003,7 @@
|
|
3001
3003
|
<!-- ===================== -->
|
3002
3004
|
<!-- Table's row processing -->
|
3003
3005
|
<!-- ===================== -->
|
3004
|
-
<!-- row in table header (thead) -->
|
3006
|
+
<!-- row in table header (thead) thead/tr -->
|
3005
3007
|
<xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
|
3006
3008
|
<fo:table-row xsl:use-attribute-sets="table-header-row-style">
|
3007
3009
|
|
@@ -3035,7 +3037,7 @@
|
|
3035
3037
|
</xsl:choose>
|
3036
3038
|
</xsl:template>
|
3037
3039
|
|
3038
|
-
<!-- row in table footer (tfoot) -->
|
3040
|
+
<!-- row in table footer (tfoot), tfoot/tr -->
|
3039
3041
|
<xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
|
3040
3042
|
<fo:table-row xsl:use-attribute-sets="table-footer-row-style">
|
3041
3043
|
|
@@ -3511,6 +3513,8 @@
|
|
3511
3513
|
<!-- <dl><xsl:copy-of select="."/></dl> -->
|
3512
3514
|
<fo:block-container>
|
3513
3515
|
|
3516
|
+
<xsl:call-template name="setBlockSpanAll"/>
|
3517
|
+
|
3514
3518
|
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
3515
3519
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
3516
3520
|
</xsl:if>
|
@@ -5575,13 +5579,17 @@
|
|
5575
5579
|
</xsl:template>
|
5576
5580
|
|
5577
5581
|
<xsl:template match="*[local-name() = 'callout']">
|
5578
|
-
<
|
5582
|
+
<xsl:choose>
|
5583
|
+
<xsl:when test="normalize-space(@target) = ''"><<xsl:apply-templates/>></xsl:when>
|
5584
|
+
<xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}"><<xsl:apply-templates/>></fo:basic-link></xsl:otherwise>
|
5585
|
+
</xsl:choose>
|
5579
5586
|
</xsl:template>
|
5580
5587
|
|
5581
5588
|
<xsl:template match="*[local-name() = 'annotation']">
|
5582
5589
|
<xsl:variable name="annotation-id" select="@id"/>
|
5583
5590
|
<xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
|
5584
5591
|
<fo:block id="{$annotation-id}" white-space="nowrap">
|
5592
|
+
|
5585
5593
|
<fo:inline>
|
5586
5594
|
<xsl:apply-templates>
|
5587
5595
|
<xsl:with-param name="callout" select="concat('<', $callout, '> ')"/>
|
@@ -5686,6 +5694,10 @@
|
|
5686
5694
|
<!-- ====== -->
|
5687
5695
|
<!-- ====== -->
|
5688
5696
|
|
5697
|
+
<xsl:template name="setBlockSpanAll">
|
5698
|
+
<xsl:if test="@columns = 1 or (local-name() = 'p' and *[@columns = 1])"><xsl:attribute name="span">all</xsl:attribute></xsl:if>
|
5699
|
+
</xsl:template>
|
5700
|
+
|
5689
5701
|
<!-- ====== -->
|
5690
5702
|
<!-- note -->
|
5691
5703
|
<!-- termnote -->
|
@@ -5695,6 +5707,8 @@
|
|
5695
5707
|
|
5696
5708
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
|
5697
5709
|
|
5710
|
+
<xsl:call-template name="setBlockSpanAll"/>
|
5711
|
+
|
5698
5712
|
<fo:block-container margin-left="0mm" margin-right="0mm">
|
5699
5713
|
|
5700
5714
|
<xsl:if test="ancestor::csa:ul or ancestor::csa:ol and not(ancestor::csa:note[1]/following-sibling::*)">
|
@@ -5749,6 +5763,8 @@
|
|
5749
5763
|
<xsl:template match="*[local-name() = 'termnote']">
|
5750
5764
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
5751
5765
|
|
5766
|
+
<xsl:call-template name="setBlockSpanAll"/>
|
5767
|
+
|
5752
5768
|
<fo:inline xsl:use-attribute-sets="termnote-name-style">
|
5753
5769
|
|
5754
5770
|
<xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
|
@@ -7658,6 +7674,9 @@
|
|
7658
7674
|
<!-- ====== -->
|
7659
7675
|
<xsl:template match="*[local-name() = 'termexample']">
|
7660
7676
|
<fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
|
7677
|
+
|
7678
|
+
<xsl:call-template name="setBlockSpanAll"/>
|
7679
|
+
|
7661
7680
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
7662
7681
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
7663
7682
|
</fo:block>
|
@@ -7709,6 +7728,8 @@
|
|
7709
7728
|
|
7710
7729
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="example-style">
|
7711
7730
|
|
7731
|
+
<xsl:call-template name="setBlockSpanAll"/>
|
7732
|
+
|
7712
7733
|
<xsl:variable name="fo_element">
|
7713
7734
|
<xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
|
7714
7735
|
block
|
@@ -7736,6 +7757,35 @@
|
|
7736
7757
|
</fo:block-container>
|
7737
7758
|
</xsl:when> <!-- end block -->
|
7738
7759
|
|
7760
|
+
<xsl:when test="contains(normalize-space($fo_element), 'list')">
|
7761
|
+
|
7762
|
+
<xsl:variable name="provisional_distance_between_starts">
|
7763
|
+
7
|
7764
|
+
</xsl:variable>
|
7765
|
+
<xsl:variable name="indent">
|
7766
|
+
0
|
7767
|
+
</xsl:variable>
|
7768
|
+
|
7769
|
+
<fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
|
7770
|
+
<fo:list-item>
|
7771
|
+
<fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
|
7772
|
+
<fo:block>
|
7773
|
+
<xsl:apply-templates select="*[local-name()='name']">
|
7774
|
+
<xsl:with-param name="fo_element">block</xsl:with-param>
|
7775
|
+
</xsl:apply-templates>
|
7776
|
+
</fo:block>
|
7777
|
+
</fo:list-item-label>
|
7778
|
+
<fo:list-item-body start-indent="body-start()">
|
7779
|
+
<fo:block>
|
7780
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]">
|
7781
|
+
<xsl:with-param name="fo_element" select="$fo_element"/>
|
7782
|
+
</xsl:apply-templates>
|
7783
|
+
</fo:block>
|
7784
|
+
</fo:list-item-body>
|
7785
|
+
</fo:list-item>
|
7786
|
+
</fo:list-block>
|
7787
|
+
</xsl:when> <!-- end list -->
|
7788
|
+
|
7739
7789
|
<xsl:otherwise> <!-- inline -->
|
7740
7790
|
|
7741
7791
|
<!-- display 'EXAMPLE' and first element in the same line -->
|
@@ -7811,6 +7861,11 @@
|
|
7811
7861
|
</fo:block>
|
7812
7862
|
</fo:block-container>
|
7813
7863
|
</xsl:when>
|
7864
|
+
<xsl:when test="starts-with(normalize-space($element), 'list')">
|
7865
|
+
<fo:block xsl:use-attribute-sets="example-p-style">
|
7866
|
+
<xsl:apply-templates/>
|
7867
|
+
</fo:block>
|
7868
|
+
</xsl:when>
|
7814
7869
|
<xsl:otherwise>
|
7815
7870
|
<fo:inline xsl:use-attribute-sets="example-p-style">
|
7816
7871
|
<xsl:apply-templates/>
|
@@ -7928,6 +7983,9 @@
|
|
7928
7983
|
<!-- ====== -->
|
7929
7984
|
<xsl:template match="*[local-name() = 'quote']">
|
7930
7985
|
<fo:block-container margin-left="0mm">
|
7986
|
+
|
7987
|
+
<xsl:call-template name="setBlockSpanAll"/>
|
7988
|
+
|
7931
7989
|
<xsl:if test="parent::*[local-name() = 'note']">
|
7932
7990
|
<xsl:if test="not(ancestor::*[local-name() = 'table'])">
|
7933
7991
|
<xsl:attribute name="margin-left">5mm</xsl:attribute>
|
@@ -8217,6 +8275,8 @@
|
|
8217
8275
|
<fo:block>
|
8218
8276
|
<xsl:call-template name="setId"/>
|
8219
8277
|
|
8278
|
+
<xsl:call-template name="setBlockSpanAll"/>
|
8279
|
+
|
8220
8280
|
<xsl:apply-templates/>
|
8221
8281
|
</fo:block>
|
8222
8282
|
</xsl:template>
|
@@ -8231,6 +8291,8 @@
|
|
8231
8291
|
<fo:block break-after="page"/>
|
8232
8292
|
<fo:block id="{@id}">
|
8233
8293
|
|
8294
|
+
<xsl:call-template name="setBlockSpanAll"/>
|
8295
|
+
|
8234
8296
|
</fo:block>
|
8235
8297
|
<xsl:apply-templates/>
|
8236
8298
|
</xsl:template>
|
@@ -9165,6 +9227,8 @@
|
|
9165
9227
|
<!-- text in the box -->
|
9166
9228
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
|
9167
9229
|
|
9230
|
+
<xsl:call-template name="setBlockSpanAll"/>
|
9231
|
+
|
9168
9232
|
<fo:block-container xsl:use-attribute-sets="admonition-container-style">
|
9169
9233
|
|
9170
9234
|
<fo:block-container margin-left="0mm" margin-right="0mm">
|
@@ -9339,6 +9403,16 @@
|
|
9339
9403
|
<xsl:apply-templates mode="update_xml_step1"/>
|
9340
9404
|
</xsl:copy>
|
9341
9405
|
</xsl:template>
|
9406
|
+
|
9407
|
+
<!-- remove semantic xml -->
|
9408
|
+
<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_step1"/>
|
9409
|
+
|
9410
|
+
<!-- remove image/emf -->
|
9411
|
+
<xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_step1"/>
|
9412
|
+
|
9413
|
+
<xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_step1">
|
9414
|
+
<xsl:copy-of select="."/>
|
9415
|
+
</xsl:template>
|
9342
9416
|
<!-- =========================================================================== -->
|
9343
9417
|
<!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
|
9344
9418
|
<!-- =========================================================================== -->
|
@@ -9360,7 +9434,7 @@
|
|
9360
9434
|
|
9361
9435
|
<xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
|
9362
9436
|
|
9363
|
-
<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">
|
9437
|
+
<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">
|
9364
9438
|
|
9365
9439
|
<!-- enclose standard's number into tag 'keep-together_within-line' -->
|
9366
9440
|
<xsl:variable name="tag_keep-together_within-line_open">###<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
|
@@ -9434,6 +9508,10 @@
|
|
9434
9508
|
|
9435
9509
|
</xsl:template>
|
9436
9510
|
|
9511
|
+
<xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_enclose_keep-together_within-line">
|
9512
|
+
<xsl:copy-of select="."/>
|
9513
|
+
</xsl:template>
|
9514
|
+
|
9437
9515
|
<xsl:template name="replace_text_tags">
|
9438
9516
|
<xsl:param name="tag_open"/>
|
9439
9517
|
<xsl:param name="tag_close"/>
|
@@ -9460,6 +9538,194 @@
|
|
9460
9538
|
<!-- END XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
|
9461
9539
|
<!-- ===================================== -->
|
9462
9540
|
|
9541
|
+
<!-- ===================================== -->
|
9542
|
+
<!-- ===================================== -->
|
9543
|
+
<!-- Make linear XML (need for landscape orientation) -->
|
9544
|
+
<!-- ===================================== -->
|
9545
|
+
<!-- ===================================== -->
|
9546
|
+
<xsl:template match="@*|node()" mode="linear_xml">
|
9547
|
+
<xsl:copy>
|
9548
|
+
<xsl:apply-templates select="@*|node()" mode="linear_xml"/>
|
9549
|
+
</xsl:copy>
|
9550
|
+
</xsl:template>
|
9551
|
+
|
9552
|
+
<xsl:template match="processing-instruction()" mode="linear_xml">
|
9553
|
+
<xsl:copy-of select="."/>
|
9554
|
+
</xsl:template>
|
9555
|
+
|
9556
|
+
<!-- From:
|
9557
|
+
<clause>
|
9558
|
+
<title>...</title>
|
9559
|
+
<p>...</p>
|
9560
|
+
</clause>
|
9561
|
+
To:
|
9562
|
+
<clause/>
|
9563
|
+
<title>...</title>
|
9564
|
+
<p>...</p>
|
9565
|
+
-->
|
9566
|
+
<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">
|
9567
|
+
|
9568
|
+
<xsl:copy>
|
9569
|
+
<xsl:apply-templates select="@*" mode="linear_xml"/>
|
9570
|
+
|
9571
|
+
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
9572
|
+
|
9573
|
+
<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'">
|
9574
|
+
<xsl:attribute name="mainsection">true</xsl:attribute>
|
9575
|
+
</xsl:if>
|
9576
|
+
</xsl:copy>
|
9577
|
+
|
9578
|
+
<xsl:apply-templates mode="linear_xml"/>
|
9579
|
+
</xsl:template>
|
9580
|
+
|
9581
|
+
<xsl:template match="*[local-name() = 'term']" mode="linear_xml" priority="2">
|
9582
|
+
<xsl:copy>
|
9583
|
+
<xsl:apply-templates select="@*" mode="linear_xml"/>
|
9584
|
+
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
9585
|
+
<xsl:variable name="level">
|
9586
|
+
<xsl:call-template name="getLevel"/>
|
9587
|
+
</xsl:variable>
|
9588
|
+
<xsl:attribute name="depth"><xsl:value-of select="$level"/></xsl:attribute>
|
9589
|
+
<xsl:attribute name="ancestor">sections</xsl:attribute>
|
9590
|
+
<xsl:apply-templates select="node()[not(local-name() = 'term')]" mode="linear_xml"/>
|
9591
|
+
</xsl:copy>
|
9592
|
+
<xsl:apply-templates select="*[local-name() = 'term']" mode="linear_xml"/>
|
9593
|
+
</xsl:template>
|
9594
|
+
|
9595
|
+
<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">
|
9596
|
+
<xsl:copy>
|
9597
|
+
<xsl:apply-templates select="@*" mode="linear_xml"/>
|
9598
|
+
|
9599
|
+
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
9600
|
+
|
9601
|
+
<xsl:variable name="level">
|
9602
|
+
<xsl:call-template name="getLevel"/>
|
9603
|
+
</xsl:variable>
|
9604
|
+
<xsl:attribute name="depth"><xsl:value-of select="$level"/></xsl:attribute>
|
9605
|
+
|
9606
|
+
<xsl:if test="parent::*[local-name() = 'annex']">
|
9607
|
+
<xsl:attribute name="depth">1</xsl:attribute>
|
9608
|
+
</xsl:if>
|
9609
|
+
|
9610
|
+
<xsl:if test="../@inline-header = 'true' and following-sibling::*[1][local-name() = 'p']">
|
9611
|
+
<xsl:copy-of select="../@inline-header"/>
|
9612
|
+
</xsl:if>
|
9613
|
+
|
9614
|
+
<xsl:attribute name="ancestor">
|
9615
|
+
<xsl:choose>
|
9616
|
+
<xsl:when test="ancestor::*[local-name() = 'foreword']">foreword</xsl:when>
|
9617
|
+
<xsl:when test="ancestor::*[local-name() = 'introduction']">introduction</xsl:when>
|
9618
|
+
<xsl:when test="ancestor::*[local-name() = 'sections']">sections</xsl:when>
|
9619
|
+
<xsl:when test="ancestor::*[local-name() = 'annex']">annex</xsl:when>
|
9620
|
+
<xsl:when test="ancestor::*[local-name() = 'bibliography']">bibliography</xsl:when>
|
9621
|
+
</xsl:choose>
|
9622
|
+
</xsl:attribute>
|
9623
|
+
|
9624
|
+
<xsl:apply-templates mode="linear_xml"/>
|
9625
|
+
</xsl:copy>
|
9626
|
+
</xsl:template>
|
9627
|
+
|
9628
|
+
<!-- add @to = figure, table, clause -->
|
9629
|
+
<!-- add @depth = from -->
|
9630
|
+
<xsl:template match="*[local-name() = 'xref']" mode="linear_xml">
|
9631
|
+
<xsl:copy>
|
9632
|
+
<xsl:apply-templates select="@*" mode="linear_xml"/>
|
9633
|
+
<xsl:variable name="target" select="@target"/>
|
9634
|
+
<xsl:attribute name="to">
|
9635
|
+
<xsl:value-of select="local-name(//*[@id = current()/@target][1])"/>
|
9636
|
+
</xsl:attribute>
|
9637
|
+
<xsl:attribute name="depth">
|
9638
|
+
<xsl:value-of select="//*[@id = current()/@target][1]/*[local-name() = 'title']/@depth"/>
|
9639
|
+
</xsl:attribute>
|
9640
|
+
<xsl:apply-templates select="node()" mode="linear_xml"/>
|
9641
|
+
</xsl:copy>
|
9642
|
+
</xsl:template>
|
9643
|
+
|
9644
|
+
<xsl:template match="*[not(ancestor::*[local-name() = 'sourcecode'])]/*[local-name() = 'p' or local-name() = 'strong' or local-name() = 'em']/text()" mode="linear_xml">
|
9645
|
+
<xsl:choose>
|
9646
|
+
<xsl:when test="contains(., $non_breaking_hyphen)">
|
9647
|
+
<xsl:call-template name="replaceChar">
|
9648
|
+
<xsl:with-param name="text" select="."/>
|
9649
|
+
<xsl:with-param name="replace" select="$non_breaking_hyphen"/>
|
9650
|
+
<xsl:with-param name="by" select="'-'"/>
|
9651
|
+
</xsl:call-template>
|
9652
|
+
</xsl:when>
|
9653
|
+
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
|
9654
|
+
</xsl:choose>
|
9655
|
+
</xsl:template>
|
9656
|
+
|
9657
|
+
<xsl:template name="replaceChar">
|
9658
|
+
<xsl:param name="text"/>
|
9659
|
+
<xsl:param name="replace"/>
|
9660
|
+
<xsl:param name="by"/>
|
9661
|
+
<xsl:choose>
|
9662
|
+
<xsl:when test="$text = '' or $replace = '' or not($replace)">
|
9663
|
+
<xsl:value-of select="$text"/>
|
9664
|
+
</xsl:when>
|
9665
|
+
<xsl:when test="contains($text, $replace)">
|
9666
|
+
<xsl:value-of select="substring-before($text,$replace)"/>
|
9667
|
+
<xsl:element name="inlineChar" namespace="https://www.metanorma.org/ns/jis"><xsl:value-of select="$by"/></xsl:element>
|
9668
|
+
<xsl:call-template name="replaceChar">
|
9669
|
+
<xsl:with-param name="text" select="substring-after($text,$replace)"/>
|
9670
|
+
<xsl:with-param name="replace" select="$replace"/>
|
9671
|
+
<xsl:with-param name="by" select="$by"/>
|
9672
|
+
</xsl:call-template>
|
9673
|
+
</xsl:when>
|
9674
|
+
<xsl:otherwise>
|
9675
|
+
<xsl:value-of select="$text"/>
|
9676
|
+
</xsl:otherwise>
|
9677
|
+
</xsl:choose>
|
9678
|
+
</xsl:template>
|
9679
|
+
|
9680
|
+
<xsl:template match="*[local-name() = 'inlineChar']">
|
9681
|
+
<fo:inline><xsl:value-of select="."/></fo:inline>
|
9682
|
+
</xsl:template>
|
9683
|
+
|
9684
|
+
<!-- change @reference to actual value, and add skip_footnote_body="true" for repeatable (2nd, 3rd, ...) -->
|
9685
|
+
<!--
|
9686
|
+
<fn reference="1">
|
9687
|
+
<p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
|
9688
|
+
</fn>
|
9689
|
+
-->
|
9690
|
+
<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">
|
9691
|
+
<xsl:variable name="p_fn_">
|
9692
|
+
<xsl:call-template name="get_fn_list"/>
|
9693
|
+
</xsl:variable>
|
9694
|
+
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
9695
|
+
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
9696
|
+
<xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
9697
|
+
<xsl:variable name="reference" select="@reference"/>
|
9698
|
+
<!-- fn sequence number in document -->
|
9699
|
+
<xsl:variable name="current_fn_number" select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
|
9700
|
+
|
9701
|
+
<xsl:copy>
|
9702
|
+
<xsl:apply-templates select="@*" mode="linear_xml"/>
|
9703
|
+
<!-- put actual reference number -->
|
9704
|
+
<xsl:attribute name="current_fn_number">
|
9705
|
+
<xsl:value-of select="$current_fn_number"/>
|
9706
|
+
</xsl:attribute>
|
9707
|
+
<xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
|
9708
|
+
<xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
|
9709
|
+
</xsl:attribute>
|
9710
|
+
<xsl:apply-templates select="node()" mode="linear_xml"/>
|
9711
|
+
</xsl:copy>
|
9712
|
+
</xsl:template>
|
9713
|
+
|
9714
|
+
<xsl:template match="*[local-name() = 'p'][@type = 'section-title']" priority="3" mode="linear_xml">
|
9715
|
+
<xsl:copy>
|
9716
|
+
<xsl:apply-templates select="@*" mode="linear_xml"/>
|
9717
|
+
<xsl:if test="@depth = '1'">
|
9718
|
+
<xsl:attribute name="mainsection">true</xsl:attribute>
|
9719
|
+
</xsl:if>
|
9720
|
+
<xsl:apply-templates select="node()" mode="linear_xml"/>
|
9721
|
+
</xsl:copy>
|
9722
|
+
</xsl:template>
|
9723
|
+
<!-- ===================================== -->
|
9724
|
+
<!-- ===================================== -->
|
9725
|
+
<!-- END: Make linear XML (need for landscape orientation) -->
|
9726
|
+
<!-- ===================================== -->
|
9727
|
+
<!-- ===================================== -->
|
9728
|
+
|
9463
9729
|
<!-- for correct rendering combining chars -->
|
9464
9730
|
<xsl:template match="*[local-name() = 'lang_none']">
|
9465
9731
|
<fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-csa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
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-
|
11
|
+
date: 2023-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-generic
|