metanorma-un 0.10.5 → 0.10.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1582,6 +1582,7 @@
1582
1582
  <xsl:attribute-set name="term-name-style">
1583
1583
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1584
1584
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1585
+
1585
1586
  </xsl:attribute-set>
1586
1587
 
1587
1588
  <xsl:attribute-set name="figure-block-style">
@@ -2550,7 +2551,7 @@
2550
2551
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2551
2552
  </xsl:when>
2552
2553
  <xsl:otherwise>
2553
- <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 -->
2554
+ <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 -->
2554
2555
  </xsl:otherwise>
2555
2556
  </xsl:choose>
2556
2557
 
@@ -3050,7 +3051,7 @@
3050
3051
  <xsl:param name="colwidths"/>
3051
3052
  <xsl:param name="colgroup"/>
3052
3053
 
3053
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3054
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3054
3055
 
3055
3056
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3056
3057
 
@@ -3118,6 +3119,7 @@
3118
3119
 
3119
3120
  <!-- except gb and bsi -->
3120
3121
 
3122
+ <xsl:apply-templates select="../*[local-name()='dl']"/>
3121
3123
  <xsl:apply-templates select="../*[local-name()='note']"/>
3122
3124
 
3123
3125
  <xsl:variable name="isDisplayRowSeparator">
@@ -3243,7 +3245,7 @@
3243
3245
  <!-- ===================== -->
3244
3246
  <!-- Table's row processing -->
3245
3247
  <!-- ===================== -->
3246
- <!-- row in table header (thead) -->
3248
+ <!-- row in table header (thead) thead/tr -->
3247
3249
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
3248
3250
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
3249
3251
 
@@ -3277,7 +3279,7 @@
3277
3279
  </xsl:choose>
3278
3280
  </xsl:template>
3279
3281
 
3280
- <!-- row in table footer (tfoot) -->
3282
+ <!-- row in table footer (tfoot), tfoot/tr -->
3281
3283
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
3282
3284
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
3283
3285
 
@@ -3777,6 +3779,8 @@
3777
3779
  <!-- <dl><xsl:copy-of select="."/></dl> -->
3778
3780
  <fo:block-container>
3779
3781
 
3782
+ <xsl:call-template name="setBlockSpanAll"/>
3783
+
3780
3784
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
3781
3785
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
3782
3786
  </xsl:if>
@@ -5839,13 +5843,17 @@
5839
5843
  </xsl:template>
5840
5844
 
5841
5845
  <xsl:template match="*[local-name() = 'callout']">
5842
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
5846
+ <xsl:choose>
5847
+ <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
5848
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
5849
+ </xsl:choose>
5843
5850
  </xsl:template>
5844
5851
 
5845
5852
  <xsl:template match="*[local-name() = 'annotation']">
5846
5853
  <xsl:variable name="annotation-id" select="@id"/>
5847
5854
  <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
5848
5855
  <fo:block id="{$annotation-id}" white-space="nowrap">
5856
+
5849
5857
  <fo:inline>
5850
5858
  <xsl:apply-templates>
5851
5859
  <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
@@ -5955,6 +5963,10 @@
5955
5963
  <!-- ====== -->
5956
5964
  <!-- ====== -->
5957
5965
 
5966
+ <xsl:template name="setBlockSpanAll">
5967
+ <xsl:if test="@columns = 1 or (local-name() = 'p' and *[@columns = 1])"><xsl:attribute name="span">all</xsl:attribute></xsl:if>
5968
+ </xsl:template>
5969
+
5958
5970
  <!-- ====== -->
5959
5971
  <!-- note -->
5960
5972
  <!-- termnote -->
@@ -5964,6 +5976,8 @@
5964
5976
 
5965
5977
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
5966
5978
 
5979
+ <xsl:call-template name="setBlockSpanAll"/>
5980
+
5967
5981
  <xsl:if test="../@type = 'source' or ../@type = 'abbreviation'">
5968
5982
  <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
5969
5983
  </xsl:if>
@@ -6027,6 +6041,8 @@
6027
6041
  <xsl:template match="*[local-name() = 'termnote']">
6028
6042
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
6029
6043
 
6044
+ <xsl:call-template name="setBlockSpanAll"/>
6045
+
6030
6046
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
6031
6047
 
6032
6048
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
@@ -7944,6 +7960,9 @@
7944
7960
  <!-- ====== -->
7945
7961
  <xsl:template match="*[local-name() = 'termexample']">
7946
7962
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
7963
+
7964
+ <xsl:call-template name="setBlockSpanAll"/>
7965
+
7947
7966
  <xsl:apply-templates select="*[local-name()='name']"/>
7948
7967
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7949
7968
  </fo:block>
@@ -7995,6 +8014,8 @@
7995
8014
 
7996
8015
  <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style">
7997
8016
 
8017
+ <xsl:call-template name="setBlockSpanAll"/>
8018
+
7998
8019
  <xsl:variable name="fo_element">
7999
8020
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
8000
8021
  block
@@ -8022,6 +8043,35 @@
8022
8043
  </fo:block-container>
8023
8044
  </xsl:when> <!-- end block -->
8024
8045
 
8046
+ <xsl:when test="contains(normalize-space($fo_element), 'list')">
8047
+
8048
+ <xsl:variable name="provisional_distance_between_starts">
8049
+ 7
8050
+ </xsl:variable>
8051
+ <xsl:variable name="indent">
8052
+ 0
8053
+ </xsl:variable>
8054
+
8055
+ <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
8056
+ <fo:list-item>
8057
+ <fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
8058
+ <fo:block>
8059
+ <xsl:apply-templates select="*[local-name()='name']">
8060
+ <xsl:with-param name="fo_element">block</xsl:with-param>
8061
+ </xsl:apply-templates>
8062
+ </fo:block>
8063
+ </fo:list-item-label>
8064
+ <fo:list-item-body start-indent="body-start()">
8065
+ <fo:block>
8066
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
8067
+ <xsl:with-param name="fo_element" select="$fo_element"/>
8068
+ </xsl:apply-templates>
8069
+ </fo:block>
8070
+ </fo:list-item-body>
8071
+ </fo:list-item>
8072
+ </fo:list-block>
8073
+ </xsl:when> <!-- end list -->
8074
+
8025
8075
  <xsl:otherwise> <!-- inline -->
8026
8076
 
8027
8077
  <!-- display 'EXAMPLE' and first element in the same line -->
@@ -8101,6 +8151,11 @@
8101
8151
  </fo:block>
8102
8152
  </fo:block-container>
8103
8153
  </xsl:when>
8154
+ <xsl:when test="starts-with(normalize-space($element), 'list')">
8155
+ <fo:block xsl:use-attribute-sets="example-p-style">
8156
+ <xsl:apply-templates/>
8157
+ </fo:block>
8158
+ </xsl:when>
8104
8159
  <xsl:otherwise>
8105
8160
  <fo:inline xsl:use-attribute-sets="example-p-style">
8106
8161
  <xsl:apply-templates/>
@@ -8218,6 +8273,9 @@
8218
8273
  <!-- ====== -->
8219
8274
  <xsl:template match="*[local-name() = 'quote']">
8220
8275
  <fo:block-container margin-left="0mm">
8276
+
8277
+ <xsl:call-template name="setBlockSpanAll"/>
8278
+
8221
8279
  <xsl:if test="parent::*[local-name() = 'note']">
8222
8280
  <xsl:if test="not(ancestor::*[local-name() = 'table'])">
8223
8281
  <xsl:attribute name="margin-left">5mm</xsl:attribute>
@@ -8507,6 +8565,8 @@
8507
8565
  <fo:block>
8508
8566
  <xsl:call-template name="setId"/>
8509
8567
 
8568
+ <xsl:call-template name="setBlockSpanAll"/>
8569
+
8510
8570
  <xsl:apply-templates/>
8511
8571
  </fo:block>
8512
8572
  </xsl:template>
@@ -8521,6 +8581,8 @@
8521
8581
  <fo:block break-after="page"/>
8522
8582
  <fo:block id="{@id}">
8523
8583
 
8584
+ <xsl:call-template name="setBlockSpanAll"/>
8585
+
8524
8586
  <xsl:variable name="num"><xsl:number/></xsl:variable>
8525
8587
  <xsl:if test="$num = 1">
8526
8588
  <xsl:attribute name="margin-top">3pt</xsl:attribute>
@@ -9461,6 +9523,8 @@
9461
9523
  <!-- text in the box -->
9462
9524
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
9463
9525
 
9526
+ <xsl:call-template name="setBlockSpanAll"/>
9527
+
9464
9528
  <fo:block xsl:use-attribute-sets="admonition-name-style">
9465
9529
  <xsl:call-template name="displayAdmonitionName"/>
9466
9530
  </fo:block>
@@ -9642,6 +9706,16 @@
9642
9706
  <xsl:apply-templates mode="update_xml_step1"/>
9643
9707
  </xsl:copy>
9644
9708
  </xsl:template>
9709
+
9710
+ <!-- remove semantic xml -->
9711
+ <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_step1"/>
9712
+
9713
+ <!-- remove image/emf -->
9714
+ <xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_step1"/>
9715
+
9716
+ <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_step1">
9717
+ <xsl:copy-of select="."/>
9718
+ </xsl:template>
9645
9719
  <!-- =========================================================================== -->
9646
9720
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
9647
9721
  <!-- =========================================================================== -->
@@ -9663,7 +9737,7 @@
9663
9737
 
9664
9738
  <xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
9665
9739
 
9666
- <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">
9740
+ <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">
9667
9741
 
9668
9742
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
9669
9743
  <xsl:variable name="tag_keep-together_within-line_open">###<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
@@ -9737,6 +9811,10 @@
9737
9811
 
9738
9812
  </xsl:template>
9739
9813
 
9814
+ <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_enclose_keep-together_within-line">
9815
+ <xsl:copy-of select="."/>
9816
+ </xsl:template>
9817
+
9740
9818
  <xsl:template name="replace_text_tags">
9741
9819
  <xsl:param name="tag_open"/>
9742
9820
  <xsl:param name="tag_close"/>
@@ -9763,6 +9841,194 @@
9763
9841
  <!-- END XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
9764
9842
  <!-- ===================================== -->
9765
9843
 
9844
+ <!-- ===================================== -->
9845
+ <!-- ===================================== -->
9846
+ <!-- Make linear XML (need for landscape orientation) -->
9847
+ <!-- ===================================== -->
9848
+ <!-- ===================================== -->
9849
+ <xsl:template match="@*|node()" mode="linear_xml">
9850
+ <xsl:copy>
9851
+ <xsl:apply-templates select="@*|node()" mode="linear_xml"/>
9852
+ </xsl:copy>
9853
+ </xsl:template>
9854
+
9855
+ <xsl:template match="processing-instruction()" mode="linear_xml">
9856
+ <xsl:copy-of select="."/>
9857
+ </xsl:template>
9858
+
9859
+ <!-- From:
9860
+ <clause>
9861
+ <title>...</title>
9862
+ <p>...</p>
9863
+ </clause>
9864
+ To:
9865
+ <clause/>
9866
+ <title>...</title>
9867
+ <p>...</p>
9868
+ -->
9869
+ <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">
9870
+
9871
+ <xsl:copy>
9872
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
9873
+
9874
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
9875
+
9876
+ <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'">
9877
+ <xsl:attribute name="mainsection">true</xsl:attribute>
9878
+ </xsl:if>
9879
+ </xsl:copy>
9880
+
9881
+ <xsl:apply-templates mode="linear_xml"/>
9882
+ </xsl:template>
9883
+
9884
+ <xsl:template match="*[local-name() = 'term']" mode="linear_xml" priority="2">
9885
+ <xsl:copy>
9886
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
9887
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
9888
+ <xsl:variable name="level">
9889
+ <xsl:call-template name="getLevel"/>
9890
+ </xsl:variable>
9891
+ <xsl:attribute name="depth"><xsl:value-of select="$level"/></xsl:attribute>
9892
+ <xsl:attribute name="ancestor">sections</xsl:attribute>
9893
+ <xsl:apply-templates select="node()[not(local-name() = 'term')]" mode="linear_xml"/>
9894
+ </xsl:copy>
9895
+ <xsl:apply-templates select="*[local-name() = 'term']" mode="linear_xml"/>
9896
+ </xsl:template>
9897
+
9898
+ <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">
9899
+ <xsl:copy>
9900
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
9901
+
9902
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
9903
+
9904
+ <xsl:variable name="level">
9905
+ <xsl:call-template name="getLevel"/>
9906
+ </xsl:variable>
9907
+ <xsl:attribute name="depth"><xsl:value-of select="$level"/></xsl:attribute>
9908
+
9909
+ <xsl:if test="parent::*[local-name() = 'annex']">
9910
+ <xsl:attribute name="depth">1</xsl:attribute>
9911
+ </xsl:if>
9912
+
9913
+ <xsl:if test="../@inline-header = 'true' and following-sibling::*[1][local-name() = 'p']">
9914
+ <xsl:copy-of select="../@inline-header"/>
9915
+ </xsl:if>
9916
+
9917
+ <xsl:attribute name="ancestor">
9918
+ <xsl:choose>
9919
+ <xsl:when test="ancestor::*[local-name() = 'foreword']">foreword</xsl:when>
9920
+ <xsl:when test="ancestor::*[local-name() = 'introduction']">introduction</xsl:when>
9921
+ <xsl:when test="ancestor::*[local-name() = 'sections']">sections</xsl:when>
9922
+ <xsl:when test="ancestor::*[local-name() = 'annex']">annex</xsl:when>
9923
+ <xsl:when test="ancestor::*[local-name() = 'bibliography']">bibliography</xsl:when>
9924
+ </xsl:choose>
9925
+ </xsl:attribute>
9926
+
9927
+ <xsl:apply-templates mode="linear_xml"/>
9928
+ </xsl:copy>
9929
+ </xsl:template>
9930
+
9931
+ <!-- add @to = figure, table, clause -->
9932
+ <!-- add @depth = from -->
9933
+ <xsl:template match="*[local-name() = 'xref']" mode="linear_xml">
9934
+ <xsl:copy>
9935
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
9936
+ <xsl:variable name="target" select="@target"/>
9937
+ <xsl:attribute name="to">
9938
+ <xsl:value-of select="local-name(//*[@id = current()/@target][1])"/>
9939
+ </xsl:attribute>
9940
+ <xsl:attribute name="depth">
9941
+ <xsl:value-of select="//*[@id = current()/@target][1]/*[local-name() = 'title']/@depth"/>
9942
+ </xsl:attribute>
9943
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
9944
+ </xsl:copy>
9945
+ </xsl:template>
9946
+
9947
+ <xsl:template match="*[not(ancestor::*[local-name() = 'sourcecode'])]/*[local-name() = 'p' or local-name() = 'strong' or local-name() = 'em']/text()" mode="linear_xml">
9948
+ <xsl:choose>
9949
+ <xsl:when test="contains(., $non_breaking_hyphen)">
9950
+ <xsl:call-template name="replaceChar">
9951
+ <xsl:with-param name="text" select="."/>
9952
+ <xsl:with-param name="replace" select="$non_breaking_hyphen"/>
9953
+ <xsl:with-param name="by" select="'-'"/>
9954
+ </xsl:call-template>
9955
+ </xsl:when>
9956
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
9957
+ </xsl:choose>
9958
+ </xsl:template>
9959
+
9960
+ <xsl:template name="replaceChar">
9961
+ <xsl:param name="text"/>
9962
+ <xsl:param name="replace"/>
9963
+ <xsl:param name="by"/>
9964
+ <xsl:choose>
9965
+ <xsl:when test="$text = '' or $replace = '' or not($replace)">
9966
+ <xsl:value-of select="$text"/>
9967
+ </xsl:when>
9968
+ <xsl:when test="contains($text, $replace)">
9969
+ <xsl:value-of select="substring-before($text,$replace)"/>
9970
+ <xsl:element name="inlineChar" namespace="https://www.metanorma.org/ns/jis"><xsl:value-of select="$by"/></xsl:element>
9971
+ <xsl:call-template name="replaceChar">
9972
+ <xsl:with-param name="text" select="substring-after($text,$replace)"/>
9973
+ <xsl:with-param name="replace" select="$replace"/>
9974
+ <xsl:with-param name="by" select="$by"/>
9975
+ </xsl:call-template>
9976
+ </xsl:when>
9977
+ <xsl:otherwise>
9978
+ <xsl:value-of select="$text"/>
9979
+ </xsl:otherwise>
9980
+ </xsl:choose>
9981
+ </xsl:template>
9982
+
9983
+ <xsl:template match="*[local-name() = 'inlineChar']">
9984
+ <fo:inline><xsl:value-of select="."/></fo:inline>
9985
+ </xsl:template>
9986
+
9987
+ <!-- change @reference to actual value, and add skip_footnote_body="true" for repeatable (2nd, 3rd, ...) -->
9988
+ <!--
9989
+ <fn reference="1">
9990
+ <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
9991
+ </fn>
9992
+ -->
9993
+ <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">
9994
+ <xsl:variable name="p_fn_">
9995
+ <xsl:call-template name="get_fn_list"/>
9996
+ </xsl:variable>
9997
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
9998
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
9999
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
10000
+ <xsl:variable name="reference" select="@reference"/>
10001
+ <!-- fn sequence number in document -->
10002
+ <xsl:variable name="current_fn_number" select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
10003
+
10004
+ <xsl:copy>
10005
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
10006
+ <!-- put actual reference number -->
10007
+ <xsl:attribute name="current_fn_number">
10008
+ <xsl:value-of select="$current_fn_number"/>
10009
+ </xsl:attribute>
10010
+ <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
10011
+ <xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
10012
+ </xsl:attribute>
10013
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
10014
+ </xsl:copy>
10015
+ </xsl:template>
10016
+
10017
+ <xsl:template match="*[local-name() = 'p'][@type = 'section-title']" priority="3" mode="linear_xml">
10018
+ <xsl:copy>
10019
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
10020
+ <xsl:if test="@depth = '1'">
10021
+ <xsl:attribute name="mainsection">true</xsl:attribute>
10022
+ </xsl:if>
10023
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
10024
+ </xsl:copy>
10025
+ </xsl:template>
10026
+ <!-- ===================================== -->
10027
+ <!-- ===================================== -->
10028
+ <!-- END: Make linear XML (need for landscape orientation) -->
10029
+ <!-- ===================================== -->
10030
+ <!-- ===================================== -->
10031
+
9766
10032
  <!-- for correct rendering combining chars -->
9767
10033
  <xsl:template match="*[local-name() = 'lang_none']">
9768
10034
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module UN
3
- VERSION = "0.10.5".freeze
3
+ VERSION = "0.10.6".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-un
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.5
4
+ version: 0.10.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: iso-639