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.
@@ -1076,7 +1076,7 @@
1076
1076
  <xsl:call-template name="getLevelTermName"/>
1077
1077
  </xsl:variable>
1078
1078
  <fo:block space-before="36pt" margin-bottom="10pt" keep-with-next="always" role="H{$levelTerm}">
1079
- <fo:list-block color="{$color_blue}" keep-with-next="always" provisional-distance-between-starts="{string-length()*3.2}mm">
1079
+ <fo:list-block color="{$color_blue}" keep-with-next="always" provisional-distance-between-starts="{string-length()*3.25}mm">
1080
1080
  <fo:list-item>
1081
1081
  <fo:list-item-label end-indent="label-end()">
1082
1082
  <fo:block><fo:inline font-size="18pt"><xsl:apply-templates/></fo:inline></fo:block> <!-- padding-right="1mm" -->
@@ -2327,6 +2327,7 @@
2327
2327
  <xsl:attribute-set name="term-name-style">
2328
2328
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2329
2329
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2330
+
2330
2331
  </xsl:attribute-set>
2331
2332
 
2332
2333
  <xsl:attribute-set name="figure-block-style">
@@ -3314,7 +3315,7 @@
3314
3315
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3315
3316
  </xsl:when>
3316
3317
  <xsl:otherwise>
3317
- <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 -->
3318
+ <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 -->
3318
3319
  </xsl:otherwise>
3319
3320
  </xsl:choose>
3320
3321
 
@@ -3814,7 +3815,7 @@
3814
3815
  <xsl:param name="colwidths"/>
3815
3816
  <xsl:param name="colgroup"/>
3816
3817
 
3817
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3818
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3818
3819
 
3819
3820
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3820
3821
 
@@ -3882,6 +3883,7 @@
3882
3883
 
3883
3884
  <!-- except gb and bsi -->
3884
3885
 
3886
+ <xsl:apply-templates select="../*[local-name()='dl']"/>
3885
3887
  <xsl:apply-templates select="../*[local-name()='note']"/>
3886
3888
 
3887
3889
  <xsl:variable name="isDisplayRowSeparator">
@@ -4007,7 +4009,7 @@
4007
4009
  <!-- ===================== -->
4008
4010
  <!-- Table's row processing -->
4009
4011
  <!-- ===================== -->
4010
- <!-- row in table header (thead) -->
4012
+ <!-- row in table header (thead) thead/tr -->
4011
4013
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
4012
4014
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
4013
4015
 
@@ -4041,7 +4043,7 @@
4041
4043
  </xsl:choose>
4042
4044
  </xsl:template>
4043
4045
 
4044
- <!-- row in table footer (tfoot) -->
4046
+ <!-- row in table footer (tfoot), tfoot/tr -->
4045
4047
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
4046
4048
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
4047
4049
 
@@ -4542,6 +4544,8 @@
4542
4544
  <!-- <dl><xsl:copy-of select="."/></dl> -->
4543
4545
  <fo:block-container>
4544
4546
 
4547
+ <xsl:call-template name="setBlockSpanAll"/>
4548
+
4545
4549
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
4546
4550
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
4547
4551
  </xsl:if>
@@ -6609,13 +6613,21 @@
6609
6613
  </xsl:template>
6610
6614
 
6611
6615
  <xsl:template match="*[local-name() = 'callout']">
6612
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
6616
+ <xsl:choose>
6617
+ <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
6618
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
6619
+ </xsl:choose>
6613
6620
  </xsl:template>
6614
6621
 
6615
6622
  <xsl:template match="*[local-name() = 'annotation']">
6616
6623
  <xsl:variable name="annotation-id" select="@id"/>
6617
6624
  <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
6618
6625
  <fo:block id="{$annotation-id}" white-space="nowrap">
6626
+
6627
+ <xsl:if test="not(preceding-sibling::*[local-name() = 'annotation'])">
6628
+ <xsl:attribute name="space-before">6pt</xsl:attribute>
6629
+ </xsl:if>
6630
+
6619
6631
  <fo:inline>
6620
6632
  <xsl:apply-templates>
6621
6633
  <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
@@ -6720,6 +6732,10 @@
6720
6732
  <!-- ====== -->
6721
6733
  <!-- ====== -->
6722
6734
 
6735
+ <xsl:template name="setBlockSpanAll">
6736
+ <xsl:if test="@columns = 1 or (local-name() = 'p' and *[@columns = 1])"><xsl:attribute name="span">all</xsl:attribute></xsl:if>
6737
+ </xsl:template>
6738
+
6723
6739
  <!-- ====== -->
6724
6740
  <!-- note -->
6725
6741
  <!-- termnote -->
@@ -6729,6 +6745,8 @@
6729
6745
 
6730
6746
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
6731
6747
 
6748
+ <xsl:call-template name="setBlockSpanAll"/>
6749
+
6732
6750
  <xsl:if test="ancestor::ogc:ul or ancestor::ogc:ol and not(ancestor::ogc:note[1]/following-sibling::*)">
6733
6751
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
6734
6752
  </xsl:if>
@@ -6783,6 +6801,8 @@
6783
6801
  <xsl:template match="*[local-name() = 'termnote']">
6784
6802
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
6785
6803
 
6804
+ <xsl:call-template name="setBlockSpanAll"/>
6805
+
6786
6806
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
6787
6807
 
6788
6808
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
@@ -8751,6 +8771,9 @@
8751
8771
  <!-- ====== -->
8752
8772
  <xsl:template match="*[local-name() = 'termexample']">
8753
8773
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
8774
+
8775
+ <xsl:call-template name="setBlockSpanAll"/>
8776
+
8754
8777
  <xsl:apply-templates select="*[local-name()='name']"/>
8755
8778
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8756
8779
  </fo:block>
@@ -8802,6 +8825,8 @@
8802
8825
 
8803
8826
  <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style">
8804
8827
 
8828
+ <xsl:call-template name="setBlockSpanAll"/>
8829
+
8805
8830
  <xsl:variable name="fo_element">
8806
8831
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
8807
8832
  inline
@@ -8829,6 +8854,35 @@
8829
8854
  </fo:block-container>
8830
8855
  </xsl:when> <!-- end block -->
8831
8856
 
8857
+ <xsl:when test="contains(normalize-space($fo_element), 'list')">
8858
+
8859
+ <xsl:variable name="provisional_distance_between_starts">
8860
+ 7
8861
+ </xsl:variable>
8862
+ <xsl:variable name="indent">
8863
+ 0
8864
+ </xsl:variable>
8865
+
8866
+ <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
8867
+ <fo:list-item>
8868
+ <fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
8869
+ <fo:block>
8870
+ <xsl:apply-templates select="*[local-name()='name']">
8871
+ <xsl:with-param name="fo_element">block</xsl:with-param>
8872
+ </xsl:apply-templates>
8873
+ </fo:block>
8874
+ </fo:list-item-label>
8875
+ <fo:list-item-body start-indent="body-start()">
8876
+ <fo:block>
8877
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
8878
+ <xsl:with-param name="fo_element" select="$fo_element"/>
8879
+ </xsl:apply-templates>
8880
+ </fo:block>
8881
+ </fo:list-item-body>
8882
+ </fo:list-item>
8883
+ </fo:list-block>
8884
+ </xsl:when> <!-- end list -->
8885
+
8832
8886
  <xsl:otherwise> <!-- inline -->
8833
8887
 
8834
8888
  <!-- display 'EXAMPLE' and first element in the same line -->
@@ -8904,6 +8958,11 @@
8904
8958
  </fo:block>
8905
8959
  </fo:block-container>
8906
8960
  </xsl:when>
8961
+ <xsl:when test="starts-with(normalize-space($element), 'list')">
8962
+ <fo:block xsl:use-attribute-sets="example-p-style">
8963
+ <xsl:apply-templates/>
8964
+ </fo:block>
8965
+ </xsl:when>
8907
8966
  <xsl:otherwise>
8908
8967
  <fo:inline xsl:use-attribute-sets="example-p-style">
8909
8968
  <xsl:apply-templates/>
@@ -9021,6 +9080,9 @@
9021
9080
  <!-- ====== -->
9022
9081
  <xsl:template match="*[local-name() = 'quote']">
9023
9082
  <fo:block-container margin-left="0mm">
9083
+
9084
+ <xsl:call-template name="setBlockSpanAll"/>
9085
+
9024
9086
  <xsl:if test="parent::*[local-name() = 'note']">
9025
9087
  <xsl:if test="not(ancestor::*[local-name() = 'table'])">
9026
9088
  <xsl:attribute name="margin-left">5mm</xsl:attribute>
@@ -9309,6 +9371,8 @@
9309
9371
  <fo:block>
9310
9372
  <xsl:call-template name="setId"/>
9311
9373
 
9374
+ <xsl:call-template name="setBlockSpanAll"/>
9375
+
9312
9376
  <xsl:apply-templates/>
9313
9377
  </fo:block>
9314
9378
  </xsl:template>
@@ -9323,6 +9387,8 @@
9323
9387
  <fo:block break-after="page"/>
9324
9388
  <fo:block id="{@id}">
9325
9389
 
9390
+ <xsl:call-template name="setBlockSpanAll"/>
9391
+
9326
9392
  </fo:block>
9327
9393
  <xsl:apply-templates/>
9328
9394
  </xsl:template>
@@ -10281,6 +10347,8 @@
10281
10347
  <!-- text in the box -->
10282
10348
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
10283
10349
 
10350
+ <xsl:call-template name="setBlockSpanAll"/>
10351
+
10284
10352
  <fo:block-container xsl:use-attribute-sets="admonition-container-style">
10285
10353
 
10286
10354
  <fo:block xsl:use-attribute-sets="admonition-name-style">
@@ -10459,6 +10527,16 @@
10459
10527
  <xsl:apply-templates mode="update_xml_step1"/>
10460
10528
  </xsl:copy>
10461
10529
  </xsl:template>
10530
+
10531
+ <!-- remove semantic xml -->
10532
+ <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_step1"/>
10533
+
10534
+ <!-- remove image/emf -->
10535
+ <xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_step1"/>
10536
+
10537
+ <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_step1">
10538
+ <xsl:copy-of select="."/>
10539
+ </xsl:template>
10462
10540
  <!-- =========================================================================== -->
10463
10541
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10464
10542
  <!-- =========================================================================== -->
@@ -10480,7 +10558,7 @@
10480
10558
 
10481
10559
  <xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
10482
10560
 
10483
- <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">
10561
+ <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">
10484
10562
 
10485
10563
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
10486
10564
  <xsl:variable name="tag_keep-together_within-line_open">###<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
@@ -10554,6 +10632,10 @@
10554
10632
 
10555
10633
  </xsl:template>
10556
10634
 
10635
+ <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_enclose_keep-together_within-line">
10636
+ <xsl:copy-of select="."/>
10637
+ </xsl:template>
10638
+
10557
10639
  <xsl:template name="replace_text_tags">
10558
10640
  <xsl:param name="tag_open"/>
10559
10641
  <xsl:param name="tag_close"/>
@@ -10580,6 +10662,194 @@
10580
10662
  <!-- END XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
10581
10663
  <!-- ===================================== -->
10582
10664
 
10665
+ <!-- ===================================== -->
10666
+ <!-- ===================================== -->
10667
+ <!-- Make linear XML (need for landscape orientation) -->
10668
+ <!-- ===================================== -->
10669
+ <!-- ===================================== -->
10670
+ <xsl:template match="@*|node()" mode="linear_xml">
10671
+ <xsl:copy>
10672
+ <xsl:apply-templates select="@*|node()" mode="linear_xml"/>
10673
+ </xsl:copy>
10674
+ </xsl:template>
10675
+
10676
+ <xsl:template match="processing-instruction()" mode="linear_xml">
10677
+ <xsl:copy-of select="."/>
10678
+ </xsl:template>
10679
+
10680
+ <!-- From:
10681
+ <clause>
10682
+ <title>...</title>
10683
+ <p>...</p>
10684
+ </clause>
10685
+ To:
10686
+ <clause/>
10687
+ <title>...</title>
10688
+ <p>...</p>
10689
+ -->
10690
+ <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">
10691
+
10692
+ <xsl:copy>
10693
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
10694
+
10695
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
10696
+
10697
+ <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'">
10698
+ <xsl:attribute name="mainsection">true</xsl:attribute>
10699
+ </xsl:if>
10700
+ </xsl:copy>
10701
+
10702
+ <xsl:apply-templates mode="linear_xml"/>
10703
+ </xsl:template>
10704
+
10705
+ <xsl:template match="*[local-name() = 'term']" mode="linear_xml" priority="2">
10706
+ <xsl:copy>
10707
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
10708
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
10709
+ <xsl:variable name="level">
10710
+ <xsl:call-template name="getLevel"/>
10711
+ </xsl:variable>
10712
+ <xsl:attribute name="depth"><xsl:value-of select="$level"/></xsl:attribute>
10713
+ <xsl:attribute name="ancestor">sections</xsl:attribute>
10714
+ <xsl:apply-templates select="node()[not(local-name() = 'term')]" mode="linear_xml"/>
10715
+ </xsl:copy>
10716
+ <xsl:apply-templates select="*[local-name() = 'term']" mode="linear_xml"/>
10717
+ </xsl:template>
10718
+
10719
+ <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">
10720
+ <xsl:copy>
10721
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
10722
+
10723
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
10724
+
10725
+ <xsl:variable name="level">
10726
+ <xsl:call-template name="getLevel"/>
10727
+ </xsl:variable>
10728
+ <xsl:attribute name="depth"><xsl:value-of select="$level"/></xsl:attribute>
10729
+
10730
+ <xsl:if test="parent::*[local-name() = 'annex']">
10731
+ <xsl:attribute name="depth">1</xsl:attribute>
10732
+ </xsl:if>
10733
+
10734
+ <xsl:if test="../@inline-header = 'true' and following-sibling::*[1][local-name() = 'p']">
10735
+ <xsl:copy-of select="../@inline-header"/>
10736
+ </xsl:if>
10737
+
10738
+ <xsl:attribute name="ancestor">
10739
+ <xsl:choose>
10740
+ <xsl:when test="ancestor::*[local-name() = 'foreword']">foreword</xsl:when>
10741
+ <xsl:when test="ancestor::*[local-name() = 'introduction']">introduction</xsl:when>
10742
+ <xsl:when test="ancestor::*[local-name() = 'sections']">sections</xsl:when>
10743
+ <xsl:when test="ancestor::*[local-name() = 'annex']">annex</xsl:when>
10744
+ <xsl:when test="ancestor::*[local-name() = 'bibliography']">bibliography</xsl:when>
10745
+ </xsl:choose>
10746
+ </xsl:attribute>
10747
+
10748
+ <xsl:apply-templates mode="linear_xml"/>
10749
+ </xsl:copy>
10750
+ </xsl:template>
10751
+
10752
+ <!-- add @to = figure, table, clause -->
10753
+ <!-- add @depth = from -->
10754
+ <xsl:template match="*[local-name() = 'xref']" mode="linear_xml">
10755
+ <xsl:copy>
10756
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
10757
+ <xsl:variable name="target" select="@target"/>
10758
+ <xsl:attribute name="to">
10759
+ <xsl:value-of select="local-name(//*[@id = current()/@target][1])"/>
10760
+ </xsl:attribute>
10761
+ <xsl:attribute name="depth">
10762
+ <xsl:value-of select="//*[@id = current()/@target][1]/*[local-name() = 'title']/@depth"/>
10763
+ </xsl:attribute>
10764
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
10765
+ </xsl:copy>
10766
+ </xsl:template>
10767
+
10768
+ <xsl:template match="*[not(ancestor::*[local-name() = 'sourcecode'])]/*[local-name() = 'p' or local-name() = 'strong' or local-name() = 'em']/text()" mode="linear_xml">
10769
+ <xsl:choose>
10770
+ <xsl:when test="contains(., $non_breaking_hyphen)">
10771
+ <xsl:call-template name="replaceChar">
10772
+ <xsl:with-param name="text" select="."/>
10773
+ <xsl:with-param name="replace" select="$non_breaking_hyphen"/>
10774
+ <xsl:with-param name="by" select="'-'"/>
10775
+ </xsl:call-template>
10776
+ </xsl:when>
10777
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
10778
+ </xsl:choose>
10779
+ </xsl:template>
10780
+
10781
+ <xsl:template name="replaceChar">
10782
+ <xsl:param name="text"/>
10783
+ <xsl:param name="replace"/>
10784
+ <xsl:param name="by"/>
10785
+ <xsl:choose>
10786
+ <xsl:when test="$text = '' or $replace = '' or not($replace)">
10787
+ <xsl:value-of select="$text"/>
10788
+ </xsl:when>
10789
+ <xsl:when test="contains($text, $replace)">
10790
+ <xsl:value-of select="substring-before($text,$replace)"/>
10791
+ <xsl:element name="inlineChar" namespace="https://www.metanorma.org/ns/jis"><xsl:value-of select="$by"/></xsl:element>
10792
+ <xsl:call-template name="replaceChar">
10793
+ <xsl:with-param name="text" select="substring-after($text,$replace)"/>
10794
+ <xsl:with-param name="replace" select="$replace"/>
10795
+ <xsl:with-param name="by" select="$by"/>
10796
+ </xsl:call-template>
10797
+ </xsl:when>
10798
+ <xsl:otherwise>
10799
+ <xsl:value-of select="$text"/>
10800
+ </xsl:otherwise>
10801
+ </xsl:choose>
10802
+ </xsl:template>
10803
+
10804
+ <xsl:template match="*[local-name() = 'inlineChar']">
10805
+ <fo:inline><xsl:value-of select="."/></fo:inline>
10806
+ </xsl:template>
10807
+
10808
+ <!-- change @reference to actual value, and add skip_footnote_body="true" for repeatable (2nd, 3rd, ...) -->
10809
+ <!--
10810
+ <fn reference="1">
10811
+ <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
10812
+ </fn>
10813
+ -->
10814
+ <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">
10815
+ <xsl:variable name="p_fn_">
10816
+ <xsl:call-template name="get_fn_list"/>
10817
+ </xsl:variable>
10818
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
10819
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
10820
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
10821
+ <xsl:variable name="reference" select="@reference"/>
10822
+ <!-- fn sequence number in document -->
10823
+ <xsl:variable name="current_fn_number" select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
10824
+
10825
+ <xsl:copy>
10826
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
10827
+ <!-- put actual reference number -->
10828
+ <xsl:attribute name="current_fn_number">
10829
+ <xsl:value-of select="$current_fn_number"/>
10830
+ </xsl:attribute>
10831
+ <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
10832
+ <xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
10833
+ </xsl:attribute>
10834
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
10835
+ </xsl:copy>
10836
+ </xsl:template>
10837
+
10838
+ <xsl:template match="*[local-name() = 'p'][@type = 'section-title']" priority="3" mode="linear_xml">
10839
+ <xsl:copy>
10840
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
10841
+ <xsl:if test="@depth = '1'">
10842
+ <xsl:attribute name="mainsection">true</xsl:attribute>
10843
+ </xsl:if>
10844
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
10845
+ </xsl:copy>
10846
+ </xsl:template>
10847
+ <!-- ===================================== -->
10848
+ <!-- ===================================== -->
10849
+ <!-- END: Make linear XML (need for landscape orientation) -->
10850
+ <!-- ===================================== -->
10851
+ <!-- ===================================== -->
10852
+
10583
10853
  <!-- for correct rendering combining chars -->
10584
10854
  <xsl:template match="*[local-name() = 'lang_none']">
10585
10855
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>