metanorma-ogc 2.3.5 → 2.3.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1501,6 +1501,7 @@
1501
1501
  <xsl:attribute-set name="term-name-style">
1502
1502
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1503
1503
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1504
+
1504
1505
  </xsl:attribute-set>
1505
1506
 
1506
1507
  <xsl:attribute-set name="figure-block-style">
@@ -2504,7 +2505,7 @@
2504
2505
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2505
2506
  </xsl:when>
2506
2507
  <xsl:otherwise>
2507
- <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 -->
2508
+ <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 -->
2508
2509
  </xsl:otherwise>
2509
2510
  </xsl:choose>
2510
2511
 
@@ -3006,7 +3007,7 @@
3006
3007
  <xsl:param name="colwidths"/>
3007
3008
  <xsl:param name="colgroup"/>
3008
3009
 
3009
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3010
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3010
3011
 
3011
3012
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3012
3013
 
@@ -3074,6 +3075,7 @@
3074
3075
 
3075
3076
  <!-- except gb and bsi -->
3076
3077
 
3078
+ <xsl:apply-templates select="../*[local-name()='dl']"/>
3077
3079
  <xsl:apply-templates select="../*[local-name()='note']"/>
3078
3080
 
3079
3081
  <xsl:variable name="isDisplayRowSeparator">
@@ -3199,7 +3201,7 @@
3199
3201
  <!-- ===================== -->
3200
3202
  <!-- Table's row processing -->
3201
3203
  <!-- ===================== -->
3202
- <!-- row in table header (thead) -->
3204
+ <!-- row in table header (thead) thead/tr -->
3203
3205
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
3204
3206
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
3205
3207
 
@@ -3233,7 +3235,7 @@
3233
3235
  </xsl:choose>
3234
3236
  </xsl:template>
3235
3237
 
3236
- <!-- row in table footer (tfoot) -->
3238
+ <!-- row in table footer (tfoot), tfoot/tr -->
3237
3239
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
3238
3240
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
3239
3241
 
@@ -3720,6 +3722,8 @@
3720
3722
  <!-- <dl><xsl:copy-of select="."/></dl> -->
3721
3723
  <fo:block-container>
3722
3724
 
3725
+ <xsl:call-template name="setBlockSpanAll"/>
3726
+
3723
3727
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
3724
3728
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
3725
3729
  </xsl:if>
@@ -5787,13 +5791,17 @@
5787
5791
  </xsl:template>
5788
5792
 
5789
5793
  <xsl:template match="*[local-name() = 'callout']">
5790
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
5794
+ <xsl:choose>
5795
+ <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
5796
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
5797
+ </xsl:choose>
5791
5798
  </xsl:template>
5792
5799
 
5793
5800
  <xsl:template match="*[local-name() = 'annotation']">
5794
5801
  <xsl:variable name="annotation-id" select="@id"/>
5795
5802
  <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
5796
5803
  <fo:block id="{$annotation-id}" white-space="nowrap">
5804
+
5797
5805
  <fo:inline>
5798
5806
  <xsl:apply-templates>
5799
5807
  <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
@@ -5898,6 +5906,10 @@
5898
5906
  <!-- ====== -->
5899
5907
  <!-- ====== -->
5900
5908
 
5909
+ <xsl:template name="setBlockSpanAll">
5910
+ <xsl:if test="@columns = 1 or (local-name() = 'p' and *[@columns = 1])"><xsl:attribute name="span">all</xsl:attribute></xsl:if>
5911
+ </xsl:template>
5912
+
5901
5913
  <!-- ====== -->
5902
5914
  <!-- note -->
5903
5915
  <!-- termnote -->
@@ -5907,6 +5919,8 @@
5907
5919
 
5908
5920
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
5909
5921
 
5922
+ <xsl:call-template name="setBlockSpanAll"/>
5923
+
5910
5924
  <xsl:if test="ancestor::ogc:ul or ancestor::ogc:ol and not(ancestor::ogc:note[1]/following-sibling::*)">
5911
5925
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
5912
5926
  </xsl:if>
@@ -5961,6 +5975,8 @@
5961
5975
  <xsl:template match="*[local-name() = 'termnote']">
5962
5976
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
5963
5977
 
5978
+ <xsl:call-template name="setBlockSpanAll"/>
5979
+
5964
5980
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
5965
5981
 
5966
5982
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
@@ -7892,6 +7908,9 @@
7892
7908
  <!-- ====== -->
7893
7909
  <xsl:template match="*[local-name() = 'termexample']">
7894
7910
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
7911
+
7912
+ <xsl:call-template name="setBlockSpanAll"/>
7913
+
7895
7914
  <xsl:apply-templates select="*[local-name()='name']"/>
7896
7915
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7897
7916
  </fo:block>
@@ -7943,6 +7962,8 @@
7943
7962
 
7944
7963
  <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style">
7945
7964
 
7965
+ <xsl:call-template name="setBlockSpanAll"/>
7966
+
7946
7967
  <xsl:variable name="fo_element">
7947
7968
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
7948
7969
  block
@@ -7970,6 +7991,35 @@
7970
7991
  </fo:block-container>
7971
7992
  </xsl:when> <!-- end block -->
7972
7993
 
7994
+ <xsl:when test="contains(normalize-space($fo_element), 'list')">
7995
+
7996
+ <xsl:variable name="provisional_distance_between_starts">
7997
+ 7
7998
+ </xsl:variable>
7999
+ <xsl:variable name="indent">
8000
+ 0
8001
+ </xsl:variable>
8002
+
8003
+ <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
8004
+ <fo:list-item>
8005
+ <fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
8006
+ <fo:block>
8007
+ <xsl:apply-templates select="*[local-name()='name']">
8008
+ <xsl:with-param name="fo_element">block</xsl:with-param>
8009
+ </xsl:apply-templates>
8010
+ </fo:block>
8011
+ </fo:list-item-label>
8012
+ <fo:list-item-body start-indent="body-start()">
8013
+ <fo:block>
8014
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
8015
+ <xsl:with-param name="fo_element" select="$fo_element"/>
8016
+ </xsl:apply-templates>
8017
+ </fo:block>
8018
+ </fo:list-item-body>
8019
+ </fo:list-item>
8020
+ </fo:list-block>
8021
+ </xsl:when> <!-- end list -->
8022
+
7973
8023
  <xsl:otherwise> <!-- inline -->
7974
8024
 
7975
8025
  <!-- display 'EXAMPLE' and first element in the same line -->
@@ -8045,6 +8095,11 @@
8045
8095
  </fo:block>
8046
8096
  </fo:block-container>
8047
8097
  </xsl:when>
8098
+ <xsl:when test="starts-with(normalize-space($element), 'list')">
8099
+ <fo:block xsl:use-attribute-sets="example-p-style">
8100
+ <xsl:apply-templates/>
8101
+ </fo:block>
8102
+ </xsl:when>
8048
8103
  <xsl:otherwise>
8049
8104
  <fo:inline xsl:use-attribute-sets="example-p-style">
8050
8105
  <xsl:apply-templates/>
@@ -8162,6 +8217,9 @@
8162
8217
  <!-- ====== -->
8163
8218
  <xsl:template match="*[local-name() = 'quote']">
8164
8219
  <fo:block-container margin-left="0mm">
8220
+
8221
+ <xsl:call-template name="setBlockSpanAll"/>
8222
+
8165
8223
  <xsl:if test="parent::*[local-name() = 'note']">
8166
8224
  <xsl:if test="not(ancestor::*[local-name() = 'table'])">
8167
8225
  <xsl:attribute name="margin-left">5mm</xsl:attribute>
@@ -8462,6 +8520,8 @@
8462
8520
  <fo:block>
8463
8521
  <xsl:call-template name="setId"/>
8464
8522
 
8523
+ <xsl:call-template name="setBlockSpanAll"/>
8524
+
8465
8525
  <xsl:apply-templates/>
8466
8526
  </fo:block>
8467
8527
  </xsl:template>
@@ -8476,6 +8536,8 @@
8476
8536
  <fo:block break-after="page"/>
8477
8537
  <fo:block id="{@id}">
8478
8538
 
8539
+ <xsl:call-template name="setBlockSpanAll"/>
8540
+
8479
8541
  </fo:block>
8480
8542
  <xsl:apply-templates/>
8481
8543
  </xsl:template>
@@ -9426,6 +9488,8 @@
9426
9488
  <!-- text in the box -->
9427
9489
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
9428
9490
 
9491
+ <xsl:call-template name="setBlockSpanAll"/>
9492
+
9429
9493
  <fo:block-container xsl:use-attribute-sets="admonition-container-style">
9430
9494
 
9431
9495
  <fo:block xsl:use-attribute-sets="admonition-name-style">
@@ -9604,6 +9668,16 @@
9604
9668
  <xsl:apply-templates mode="update_xml_step1"/>
9605
9669
  </xsl:copy>
9606
9670
  </xsl:template>
9671
+
9672
+ <!-- remove semantic xml -->
9673
+ <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_step1"/>
9674
+
9675
+ <!-- remove image/emf -->
9676
+ <xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_step1"/>
9677
+
9678
+ <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_step1">
9679
+ <xsl:copy-of select="."/>
9680
+ </xsl:template>
9607
9681
  <!-- =========================================================================== -->
9608
9682
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
9609
9683
  <!-- =========================================================================== -->
@@ -9625,7 +9699,7 @@
9625
9699
 
9626
9700
  <xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
9627
9701
 
9628
- <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">
9702
+ <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">
9629
9703
 
9630
9704
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
9631
9705
  <xsl:variable name="tag_keep-together_within-line_open">###<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
@@ -9699,6 +9773,10 @@
9699
9773
 
9700
9774
  </xsl:template>
9701
9775
 
9776
+ <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_enclose_keep-together_within-line">
9777
+ <xsl:copy-of select="."/>
9778
+ </xsl:template>
9779
+
9702
9780
  <xsl:template name="replace_text_tags">
9703
9781
  <xsl:param name="tag_open"/>
9704
9782
  <xsl:param name="tag_close"/>
@@ -9725,6 +9803,194 @@
9725
9803
  <!-- END XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
9726
9804
  <!-- ===================================== -->
9727
9805
 
9806
+ <!-- ===================================== -->
9807
+ <!-- ===================================== -->
9808
+ <!-- Make linear XML (need for landscape orientation) -->
9809
+ <!-- ===================================== -->
9810
+ <!-- ===================================== -->
9811
+ <xsl:template match="@*|node()" mode="linear_xml">
9812
+ <xsl:copy>
9813
+ <xsl:apply-templates select="@*|node()" mode="linear_xml"/>
9814
+ </xsl:copy>
9815
+ </xsl:template>
9816
+
9817
+ <xsl:template match="processing-instruction()" mode="linear_xml">
9818
+ <xsl:copy-of select="."/>
9819
+ </xsl:template>
9820
+
9821
+ <!-- From:
9822
+ <clause>
9823
+ <title>...</title>
9824
+ <p>...</p>
9825
+ </clause>
9826
+ To:
9827
+ <clause/>
9828
+ <title>...</title>
9829
+ <p>...</p>
9830
+ -->
9831
+ <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">
9832
+
9833
+ <xsl:copy>
9834
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
9835
+
9836
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
9837
+
9838
+ <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'">
9839
+ <xsl:attribute name="mainsection">true</xsl:attribute>
9840
+ </xsl:if>
9841
+ </xsl:copy>
9842
+
9843
+ <xsl:apply-templates mode="linear_xml"/>
9844
+ </xsl:template>
9845
+
9846
+ <xsl:template match="*[local-name() = 'term']" mode="linear_xml" priority="2">
9847
+ <xsl:copy>
9848
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
9849
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
9850
+ <xsl:variable name="level">
9851
+ <xsl:call-template name="getLevel"/>
9852
+ </xsl:variable>
9853
+ <xsl:attribute name="depth"><xsl:value-of select="$level"/></xsl:attribute>
9854
+ <xsl:attribute name="ancestor">sections</xsl:attribute>
9855
+ <xsl:apply-templates select="node()[not(local-name() = 'term')]" mode="linear_xml"/>
9856
+ </xsl:copy>
9857
+ <xsl:apply-templates select="*[local-name() = 'term']" mode="linear_xml"/>
9858
+ </xsl:template>
9859
+
9860
+ <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">
9861
+ <xsl:copy>
9862
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
9863
+
9864
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
9865
+
9866
+ <xsl:variable name="level">
9867
+ <xsl:call-template name="getLevel"/>
9868
+ </xsl:variable>
9869
+ <xsl:attribute name="depth"><xsl:value-of select="$level"/></xsl:attribute>
9870
+
9871
+ <xsl:if test="parent::*[local-name() = 'annex']">
9872
+ <xsl:attribute name="depth">1</xsl:attribute>
9873
+ </xsl:if>
9874
+
9875
+ <xsl:if test="../@inline-header = 'true' and following-sibling::*[1][local-name() = 'p']">
9876
+ <xsl:copy-of select="../@inline-header"/>
9877
+ </xsl:if>
9878
+
9879
+ <xsl:attribute name="ancestor">
9880
+ <xsl:choose>
9881
+ <xsl:when test="ancestor::*[local-name() = 'foreword']">foreword</xsl:when>
9882
+ <xsl:when test="ancestor::*[local-name() = 'introduction']">introduction</xsl:when>
9883
+ <xsl:when test="ancestor::*[local-name() = 'sections']">sections</xsl:when>
9884
+ <xsl:when test="ancestor::*[local-name() = 'annex']">annex</xsl:when>
9885
+ <xsl:when test="ancestor::*[local-name() = 'bibliography']">bibliography</xsl:when>
9886
+ </xsl:choose>
9887
+ </xsl:attribute>
9888
+
9889
+ <xsl:apply-templates mode="linear_xml"/>
9890
+ </xsl:copy>
9891
+ </xsl:template>
9892
+
9893
+ <!-- add @to = figure, table, clause -->
9894
+ <!-- add @depth = from -->
9895
+ <xsl:template match="*[local-name() = 'xref']" mode="linear_xml">
9896
+ <xsl:copy>
9897
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
9898
+ <xsl:variable name="target" select="@target"/>
9899
+ <xsl:attribute name="to">
9900
+ <xsl:value-of select="local-name(//*[@id = current()/@target][1])"/>
9901
+ </xsl:attribute>
9902
+ <xsl:attribute name="depth">
9903
+ <xsl:value-of select="//*[@id = current()/@target][1]/*[local-name() = 'title']/@depth"/>
9904
+ </xsl:attribute>
9905
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
9906
+ </xsl:copy>
9907
+ </xsl:template>
9908
+
9909
+ <xsl:template match="*[not(ancestor::*[local-name() = 'sourcecode'])]/*[local-name() = 'p' or local-name() = 'strong' or local-name() = 'em']/text()" mode="linear_xml">
9910
+ <xsl:choose>
9911
+ <xsl:when test="contains(., $non_breaking_hyphen)">
9912
+ <xsl:call-template name="replaceChar">
9913
+ <xsl:with-param name="text" select="."/>
9914
+ <xsl:with-param name="replace" select="$non_breaking_hyphen"/>
9915
+ <xsl:with-param name="by" select="'-'"/>
9916
+ </xsl:call-template>
9917
+ </xsl:when>
9918
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
9919
+ </xsl:choose>
9920
+ </xsl:template>
9921
+
9922
+ <xsl:template name="replaceChar">
9923
+ <xsl:param name="text"/>
9924
+ <xsl:param name="replace"/>
9925
+ <xsl:param name="by"/>
9926
+ <xsl:choose>
9927
+ <xsl:when test="$text = '' or $replace = '' or not($replace)">
9928
+ <xsl:value-of select="$text"/>
9929
+ </xsl:when>
9930
+ <xsl:when test="contains($text, $replace)">
9931
+ <xsl:value-of select="substring-before($text,$replace)"/>
9932
+ <xsl:element name="inlineChar" namespace="https://www.metanorma.org/ns/jis"><xsl:value-of select="$by"/></xsl:element>
9933
+ <xsl:call-template name="replaceChar">
9934
+ <xsl:with-param name="text" select="substring-after($text,$replace)"/>
9935
+ <xsl:with-param name="replace" select="$replace"/>
9936
+ <xsl:with-param name="by" select="$by"/>
9937
+ </xsl:call-template>
9938
+ </xsl:when>
9939
+ <xsl:otherwise>
9940
+ <xsl:value-of select="$text"/>
9941
+ </xsl:otherwise>
9942
+ </xsl:choose>
9943
+ </xsl:template>
9944
+
9945
+ <xsl:template match="*[local-name() = 'inlineChar']">
9946
+ <fo:inline><xsl:value-of select="."/></fo:inline>
9947
+ </xsl:template>
9948
+
9949
+ <!-- change @reference to actual value, and add skip_footnote_body="true" for repeatable (2nd, 3rd, ...) -->
9950
+ <!--
9951
+ <fn reference="1">
9952
+ <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
9953
+ </fn>
9954
+ -->
9955
+ <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">
9956
+ <xsl:variable name="p_fn_">
9957
+ <xsl:call-template name="get_fn_list"/>
9958
+ </xsl:variable>
9959
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
9960
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
9961
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
9962
+ <xsl:variable name="reference" select="@reference"/>
9963
+ <!-- fn sequence number in document -->
9964
+ <xsl:variable name="current_fn_number" select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
9965
+
9966
+ <xsl:copy>
9967
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
9968
+ <!-- put actual reference number -->
9969
+ <xsl:attribute name="current_fn_number">
9970
+ <xsl:value-of select="$current_fn_number"/>
9971
+ </xsl:attribute>
9972
+ <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
9973
+ <xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
9974
+ </xsl:attribute>
9975
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
9976
+ </xsl:copy>
9977
+ </xsl:template>
9978
+
9979
+ <xsl:template match="*[local-name() = 'p'][@type = 'section-title']" priority="3" mode="linear_xml">
9980
+ <xsl:copy>
9981
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
9982
+ <xsl:if test="@depth = '1'">
9983
+ <xsl:attribute name="mainsection">true</xsl:attribute>
9984
+ </xsl:if>
9985
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
9986
+ </xsl:copy>
9987
+ </xsl:template>
9988
+ <!-- ===================================== -->
9989
+ <!-- ===================================== -->
9990
+ <!-- END: Make linear XML (need for landscape orientation) -->
9991
+ <!-- ===================================== -->
9992
+ <!-- ===================================== -->
9993
+
9728
9994
  <!-- for correct rendering combining chars -->
9729
9995
  <xsl:template match="*[local-name() = 'lang_none']">
9730
9996
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ogc
3
- VERSION = "2.3.5".freeze
3
+ VERSION = "2.3.7".freeze
4
4
  end
5
5
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
27
27
 
28
28
  spec.add_dependency "iso-639"
29
- spec.add_dependency "metanorma-standoc", "~> 2.3.0"
29
+ spec.add_dependency "metanorma-standoc", "~> 2.4.0"
30
30
 
31
31
  spec.add_development_dependency "debug"
32
32
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ogc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.5
4
+ version: 2.3.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: iso-639
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.3.0
33
+ version: 2.4.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.3.0
40
+ version: 2.4.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: debug
43
43
  requirement: !ruby/object:Gem::Requirement