metanorma-bipm 2.2.6 → 2.2.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -2504,6 +2504,7 @@
2504
2504
  <xsl:attribute-set name="term-name-style">
2505
2505
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2506
2506
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2507
+
2507
2508
  </xsl:attribute-set>
2508
2509
 
2509
2510
  <xsl:attribute-set name="figure-block-style">
@@ -3453,7 +3454,7 @@
3453
3454
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3454
3455
  </xsl:when>
3455
3456
  <xsl:otherwise>
3456
- <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 -->
3457
+ <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 -->
3457
3458
  </xsl:otherwise>
3458
3459
  </xsl:choose>
3459
3460
 
@@ -3971,7 +3972,7 @@
3971
3972
  <xsl:param name="colwidths"/>
3972
3973
  <xsl:param name="colgroup"/>
3973
3974
 
3974
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3975
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3975
3976
 
3976
3977
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3977
3978
 
@@ -4039,6 +4040,7 @@
4039
4040
 
4040
4041
  <!-- except gb and bsi -->
4041
4042
 
4043
+ <xsl:apply-templates select="../*[local-name()='dl']"/>
4042
4044
  <xsl:apply-templates select="../*[local-name()='note']"/>
4043
4045
 
4044
4046
  <xsl:variable name="isDisplayRowSeparator">
@@ -4205,7 +4207,7 @@
4205
4207
  <!-- ===================== -->
4206
4208
  <!-- Table's row processing -->
4207
4209
  <!-- ===================== -->
4208
- <!-- row in table header (thead) -->
4210
+ <!-- row in table header (thead) thead/tr -->
4209
4211
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
4210
4212
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
4211
4213
 
@@ -4250,7 +4252,7 @@
4250
4252
  </xsl:choose>
4251
4253
  </xsl:template>
4252
4254
 
4253
- <!-- row in table footer (tfoot) -->
4255
+ <!-- row in table footer (tfoot), tfoot/tr -->
4254
4256
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
4255
4257
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
4256
4258
 
@@ -4738,6 +4740,8 @@
4738
4740
  <!-- <dl><xsl:copy-of select="."/></dl> -->
4739
4741
  <fo:block-container>
4740
4742
 
4743
+ <xsl:call-template name="setBlockSpanAll"/>
4744
+
4741
4745
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
4742
4746
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
4743
4747
  </xsl:if>
@@ -6824,13 +6828,17 @@
6824
6828
  </xsl:template>
6825
6829
 
6826
6830
  <xsl:template match="*[local-name() = 'callout']">
6827
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
6831
+ <xsl:choose>
6832
+ <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
6833
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
6834
+ </xsl:choose>
6828
6835
  </xsl:template>
6829
6836
 
6830
6837
  <xsl:template match="*[local-name() = 'annotation']">
6831
6838
  <xsl:variable name="annotation-id" select="@id"/>
6832
6839
  <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
6833
6840
  <fo:block id="{$annotation-id}" white-space="nowrap">
6841
+
6834
6842
  <fo:inline>
6835
6843
  <xsl:apply-templates>
6836
6844
  <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
@@ -6935,6 +6943,10 @@
6935
6943
  <!-- ====== -->
6936
6944
  <!-- ====== -->
6937
6945
 
6946
+ <xsl:template name="setBlockSpanAll">
6947
+ <xsl:if test="@columns = 1 or (local-name() = 'p' and *[@columns = 1])"><xsl:attribute name="span">all</xsl:attribute></xsl:if>
6948
+ </xsl:template>
6949
+
6938
6950
  <!-- ====== -->
6939
6951
  <!-- note -->
6940
6952
  <!-- termnote -->
@@ -6944,6 +6956,8 @@
6944
6956
 
6945
6957
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
6946
6958
 
6959
+ <xsl:call-template name="setBlockSpanAll"/>
6960
+
6947
6961
  <fo:block-container margin-left="0mm" margin-right="0mm">
6948
6962
 
6949
6963
  <fo:block>
@@ -6994,6 +7008,8 @@
6994
7008
  <xsl:template match="*[local-name() = 'termnote']">
6995
7009
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
6996
7010
 
7011
+ <xsl:call-template name="setBlockSpanAll"/>
7012
+
6997
7013
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
6998
7014
 
6999
7015
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
@@ -8904,6 +8920,9 @@
8904
8920
  <!-- ====== -->
8905
8921
  <xsl:template match="*[local-name() = 'termexample']">
8906
8922
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
8923
+
8924
+ <xsl:call-template name="setBlockSpanAll"/>
8925
+
8907
8926
  <xsl:apply-templates select="*[local-name()='name']"/>
8908
8927
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8909
8928
  </fo:block>
@@ -8955,6 +8974,8 @@
8955
8974
 
8956
8975
  <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style">
8957
8976
 
8977
+ <xsl:call-template name="setBlockSpanAll"/>
8978
+
8958
8979
  <xsl:variable name="fo_element">
8959
8980
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
8960
8981
  inline
@@ -8982,6 +9003,35 @@
8982
9003
  </fo:block-container>
8983
9004
  </xsl:when> <!-- end block -->
8984
9005
 
9006
+ <xsl:when test="contains(normalize-space($fo_element), 'list')">
9007
+
9008
+ <xsl:variable name="provisional_distance_between_starts">
9009
+ 7
9010
+ </xsl:variable>
9011
+ <xsl:variable name="indent">
9012
+ 0
9013
+ </xsl:variable>
9014
+
9015
+ <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
9016
+ <fo:list-item>
9017
+ <fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
9018
+ <fo:block>
9019
+ <xsl:apply-templates select="*[local-name()='name']">
9020
+ <xsl:with-param name="fo_element">block</xsl:with-param>
9021
+ </xsl:apply-templates>
9022
+ </fo:block>
9023
+ </fo:list-item-label>
9024
+ <fo:list-item-body start-indent="body-start()">
9025
+ <fo:block>
9026
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
9027
+ <xsl:with-param name="fo_element" select="$fo_element"/>
9028
+ </xsl:apply-templates>
9029
+ </fo:block>
9030
+ </fo:list-item-body>
9031
+ </fo:list-item>
9032
+ </fo:list-block>
9033
+ </xsl:when> <!-- end list -->
9034
+
8985
9035
  <xsl:otherwise> <!-- inline -->
8986
9036
 
8987
9037
  <!-- display 'EXAMPLE' and first element in the same line -->
@@ -9062,6 +9112,11 @@
9062
9112
  </fo:block>
9063
9113
  </fo:block-container>
9064
9114
  </xsl:when>
9115
+ <xsl:when test="starts-with(normalize-space($element), 'list')">
9116
+ <fo:block xsl:use-attribute-sets="example-p-style">
9117
+ <xsl:apply-templates/>
9118
+ </fo:block>
9119
+ </xsl:when>
9065
9120
  <xsl:otherwise>
9066
9121
  <fo:inline xsl:use-attribute-sets="example-p-style">
9067
9122
  <xsl:apply-templates/>
@@ -9179,6 +9234,9 @@
9179
9234
  <!-- ====== -->
9180
9235
  <xsl:template match="*[local-name() = 'quote']">
9181
9236
  <fo:block-container margin-left="0mm">
9237
+
9238
+ <xsl:call-template name="setBlockSpanAll"/>
9239
+
9182
9240
  <xsl:if test="parent::*[local-name() = 'note']">
9183
9241
  <xsl:if test="not(ancestor::*[local-name() = 'table'])">
9184
9242
  <xsl:attribute name="margin-left">5mm</xsl:attribute>
@@ -9476,6 +9534,8 @@
9476
9534
  <fo:block>
9477
9535
  <xsl:call-template name="setId"/>
9478
9536
 
9537
+ <xsl:call-template name="setBlockSpanAll"/>
9538
+
9479
9539
  <xsl:if test="@inline-header='true'">
9480
9540
  <xsl:attribute name="text-align">justify</xsl:attribute>
9481
9541
  </xsl:if>
@@ -9494,6 +9554,8 @@
9494
9554
  <fo:block break-after="page"/>
9495
9555
  <fo:block id="{@id}">
9496
9556
 
9557
+ <xsl:call-template name="setBlockSpanAll"/>
9558
+
9497
9559
  </fo:block>
9498
9560
  <xsl:apply-templates/>
9499
9561
  </xsl:template>
@@ -9532,6 +9594,8 @@
9532
9594
  <label level="2">−</label><!-- minus sign -->
9533
9595
  <label level="3" font-size="75%">o</label> <!-- white circle -->
9534
9596
 
9597
+ <label>-</label> <!-- full-width hyphen minus -->
9598
+
9535
9599
  </xsl:variable>
9536
9600
  <xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/>
9537
9601
 
@@ -10450,6 +10514,8 @@
10450
10514
 
10451
10515
  <fo:block xsl:use-attribute-sets="admonition-style">
10452
10516
 
10517
+ <xsl:call-template name="setBlockSpanAll"/>
10518
+
10453
10519
  <xsl:if test="@type = 'editorial'">
10454
10520
  <xsl:attribute name="color">green</xsl:attribute>
10455
10521
  <xsl:attribute name="font-weight">normal</xsl:attribute>
@@ -10633,6 +10699,16 @@
10633
10699
  <xsl:apply-templates mode="update_xml_step1"/>
10634
10700
  </xsl:copy>
10635
10701
  </xsl:template>
10702
+
10703
+ <!-- remove semantic xml -->
10704
+ <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_step1"/>
10705
+
10706
+ <!-- remove image/emf -->
10707
+ <xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_step1"/>
10708
+
10709
+ <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_step1">
10710
+ <xsl:copy-of select="."/>
10711
+ </xsl:template>
10636
10712
  <!-- =========================================================================== -->
10637
10713
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10638
10714
  <!-- =========================================================================== -->
@@ -10654,7 +10730,7 @@
10654
10730
 
10655
10731
  <xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
10656
10732
 
10657
- <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">
10733
+ <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">
10658
10734
 
10659
10735
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
10660
10736
  <xsl:variable name="tag_keep-together_within-line_open">###<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
@@ -10728,6 +10804,10 @@
10728
10804
 
10729
10805
  </xsl:template>
10730
10806
 
10807
+ <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_enclose_keep-together_within-line">
10808
+ <xsl:copy-of select="."/>
10809
+ </xsl:template>
10810
+
10731
10811
  <xsl:template name="replace_text_tags">
10732
10812
  <xsl:param name="tag_open"/>
10733
10813
  <xsl:param name="tag_close"/>
@@ -10754,6 +10834,194 @@
10754
10834
  <!-- END XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
10755
10835
  <!-- ===================================== -->
10756
10836
 
10837
+ <!-- ===================================== -->
10838
+ <!-- ===================================== -->
10839
+ <!-- Make linear XML (need for landscape orientation) -->
10840
+ <!-- ===================================== -->
10841
+ <!-- ===================================== -->
10842
+ <xsl:template match="@*|node()" mode="linear_xml">
10843
+ <xsl:copy>
10844
+ <xsl:apply-templates select="@*|node()" mode="linear_xml"/>
10845
+ </xsl:copy>
10846
+ </xsl:template>
10847
+
10848
+ <xsl:template match="processing-instruction()" mode="linear_xml">
10849
+ <xsl:copy-of select="."/>
10850
+ </xsl:template>
10851
+
10852
+ <!-- From:
10853
+ <clause>
10854
+ <title>...</title>
10855
+ <p>...</p>
10856
+ </clause>
10857
+ To:
10858
+ <clause/>
10859
+ <title>...</title>
10860
+ <p>...</p>
10861
+ -->
10862
+ <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">
10863
+
10864
+ <xsl:copy>
10865
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
10866
+
10867
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
10868
+
10869
+ <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'">
10870
+ <xsl:attribute name="mainsection">true</xsl:attribute>
10871
+ </xsl:if>
10872
+ </xsl:copy>
10873
+
10874
+ <xsl:apply-templates mode="linear_xml"/>
10875
+ </xsl:template>
10876
+
10877
+ <xsl:template match="*[local-name() = 'term']" mode="linear_xml" priority="2">
10878
+ <xsl:copy>
10879
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
10880
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
10881
+ <xsl:variable name="level">
10882
+ <xsl:call-template name="getLevel"/>
10883
+ </xsl:variable>
10884
+ <xsl:attribute name="depth"><xsl:value-of select="$level"/></xsl:attribute>
10885
+ <xsl:attribute name="ancestor">sections</xsl:attribute>
10886
+ <xsl:apply-templates select="node()[not(local-name() = 'term')]" mode="linear_xml"/>
10887
+ </xsl:copy>
10888
+ <xsl:apply-templates select="*[local-name() = 'term']" mode="linear_xml"/>
10889
+ </xsl:template>
10890
+
10891
+ <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">
10892
+ <xsl:copy>
10893
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
10894
+
10895
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
10896
+
10897
+ <xsl:variable name="level">
10898
+ <xsl:call-template name="getLevel"/>
10899
+ </xsl:variable>
10900
+ <xsl:attribute name="depth"><xsl:value-of select="$level"/></xsl:attribute>
10901
+
10902
+ <xsl:if test="parent::*[local-name() = 'annex']">
10903
+ <xsl:attribute name="depth">1</xsl:attribute>
10904
+ </xsl:if>
10905
+
10906
+ <xsl:if test="../@inline-header = 'true' and following-sibling::*[1][local-name() = 'p']">
10907
+ <xsl:copy-of select="../@inline-header"/>
10908
+ </xsl:if>
10909
+
10910
+ <xsl:attribute name="ancestor">
10911
+ <xsl:choose>
10912
+ <xsl:when test="ancestor::*[local-name() = 'foreword']">foreword</xsl:when>
10913
+ <xsl:when test="ancestor::*[local-name() = 'introduction']">introduction</xsl:when>
10914
+ <xsl:when test="ancestor::*[local-name() = 'sections']">sections</xsl:when>
10915
+ <xsl:when test="ancestor::*[local-name() = 'annex']">annex</xsl:when>
10916
+ <xsl:when test="ancestor::*[local-name() = 'bibliography']">bibliography</xsl:when>
10917
+ </xsl:choose>
10918
+ </xsl:attribute>
10919
+
10920
+ <xsl:apply-templates mode="linear_xml"/>
10921
+ </xsl:copy>
10922
+ </xsl:template>
10923
+
10924
+ <!-- add @to = figure, table, clause -->
10925
+ <!-- add @depth = from -->
10926
+ <xsl:template match="*[local-name() = 'xref']" mode="linear_xml">
10927
+ <xsl:copy>
10928
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
10929
+ <xsl:variable name="target" select="@target"/>
10930
+ <xsl:attribute name="to">
10931
+ <xsl:value-of select="local-name(//*[@id = current()/@target][1])"/>
10932
+ </xsl:attribute>
10933
+ <xsl:attribute name="depth">
10934
+ <xsl:value-of select="//*[@id = current()/@target][1]/*[local-name() = 'title']/@depth"/>
10935
+ </xsl:attribute>
10936
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
10937
+ </xsl:copy>
10938
+ </xsl:template>
10939
+
10940
+ <xsl:template match="*[not(ancestor::*[local-name() = 'sourcecode'])]/*[local-name() = 'p' or local-name() = 'strong' or local-name() = 'em']/text()" mode="linear_xml">
10941
+ <xsl:choose>
10942
+ <xsl:when test="contains(., $non_breaking_hyphen)">
10943
+ <xsl:call-template name="replaceChar">
10944
+ <xsl:with-param name="text" select="."/>
10945
+ <xsl:with-param name="replace" select="$non_breaking_hyphen"/>
10946
+ <xsl:with-param name="by" select="'-'"/>
10947
+ </xsl:call-template>
10948
+ </xsl:when>
10949
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
10950
+ </xsl:choose>
10951
+ </xsl:template>
10952
+
10953
+ <xsl:template name="replaceChar">
10954
+ <xsl:param name="text"/>
10955
+ <xsl:param name="replace"/>
10956
+ <xsl:param name="by"/>
10957
+ <xsl:choose>
10958
+ <xsl:when test="$text = '' or $replace = '' or not($replace)">
10959
+ <xsl:value-of select="$text"/>
10960
+ </xsl:when>
10961
+ <xsl:when test="contains($text, $replace)">
10962
+ <xsl:value-of select="substring-before($text,$replace)"/>
10963
+ <xsl:element name="inlineChar" namespace="https://www.metanorma.org/ns/jis"><xsl:value-of select="$by"/></xsl:element>
10964
+ <xsl:call-template name="replaceChar">
10965
+ <xsl:with-param name="text" select="substring-after($text,$replace)"/>
10966
+ <xsl:with-param name="replace" select="$replace"/>
10967
+ <xsl:with-param name="by" select="$by"/>
10968
+ </xsl:call-template>
10969
+ </xsl:when>
10970
+ <xsl:otherwise>
10971
+ <xsl:value-of select="$text"/>
10972
+ </xsl:otherwise>
10973
+ </xsl:choose>
10974
+ </xsl:template>
10975
+
10976
+ <xsl:template match="*[local-name() = 'inlineChar']">
10977
+ <fo:inline><xsl:value-of select="."/></fo:inline>
10978
+ </xsl:template>
10979
+
10980
+ <!-- change @reference to actual value, and add skip_footnote_body="true" for repeatable (2nd, 3rd, ...) -->
10981
+ <!--
10982
+ <fn reference="1">
10983
+ <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
10984
+ </fn>
10985
+ -->
10986
+ <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">
10987
+ <xsl:variable name="p_fn_">
10988
+ <xsl:call-template name="get_fn_list"/>
10989
+ </xsl:variable>
10990
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
10991
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
10992
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
10993
+ <xsl:variable name="reference" select="@reference"/>
10994
+ <!-- fn sequence number in document -->
10995
+ <xsl:variable name="current_fn_number" select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
10996
+
10997
+ <xsl:copy>
10998
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
10999
+ <!-- put actual reference number -->
11000
+ <xsl:attribute name="current_fn_number">
11001
+ <xsl:value-of select="$current_fn_number"/>
11002
+ </xsl:attribute>
11003
+ <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
11004
+ <xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
11005
+ </xsl:attribute>
11006
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
11007
+ </xsl:copy>
11008
+ </xsl:template>
11009
+
11010
+ <xsl:template match="*[local-name() = 'p'][@type = 'section-title']" priority="3" mode="linear_xml">
11011
+ <xsl:copy>
11012
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
11013
+ <xsl:if test="@depth = '1'">
11014
+ <xsl:attribute name="mainsection">true</xsl:attribute>
11015
+ </xsl:if>
11016
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
11017
+ </xsl:copy>
11018
+ </xsl:template>
11019
+ <!-- ===================================== -->
11020
+ <!-- ===================================== -->
11021
+ <!-- END: Make linear XML (need for landscape orientation) -->
11022
+ <!-- ===================================== -->
11023
+ <!-- ===================================== -->
11024
+
10757
11025
  <!-- for correct rendering combining chars -->
10758
11026
  <xsl:template match="*[local-name() = 'lang_none']">
10759
11027
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module BIPM
3
- VERSION = "2.2.6".freeze
3
+ VERSION = "2.2.7".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-bipm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.6
4
+ version: 2.2.7
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