metanorma-itu 2.2.7 → 2.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 729bbd5d03f38cfb999e2a2fa6199e6bfc5002b135c318246d9f43fd370815e3
4
- data.tar.gz: d3bf986aba6a18eaaa4ae9cc32a50cb74a51c64343181d85dee86a4313abd3c4
3
+ metadata.gz: 445ba87d63596d4fdf7e4d574f479da16fb1c39d3403219977dc1b4c26b20d55
4
+ data.tar.gz: 245242e1ef0b6a2459725af2ee27f3519cbf058ef5e66aa5b65c43d7b8c4148f
5
5
  SHA512:
6
- metadata.gz: 3d92163b9e871f5a2191b916145a0577a9acf70426be90c6cf87f54a841116da63dc13dd2411a3a81730097072dac05ef6038937252967c0555bc5e86b52316e
7
- data.tar.gz: 0d12e7589f48c12b00bf355ac1d4b4317e0d6749a13b3c6e63f7c9dd118df6c29dcc6e6a2b8b3201e81685fda9574e23fcb94e87ade6713b9dc0169ba7273f34
6
+ metadata.gz: f6c06789d6ad416c5971c2515f52a3daae2942b7673cb0fdfa53386a46a7b31cfcb2ecce093ec037dd754efbc776d0430a801590bfe3a803cd575c2fae4a0db0
7
+ data.tar.gz: dafc2854942bdc297170369b910e7e83d5eb54106ca78d4c01b256dbd3496a880573302a5a16f31d3a612e2421fc304818642da3029b217ca31f55d2150832ed
@@ -2887,6 +2887,7 @@
2887
2887
  <xsl:attribute-set name="term-name-style">
2888
2888
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2889
2889
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2890
+
2890
2891
  </xsl:attribute-set>
2891
2892
 
2892
2893
  <xsl:attribute-set name="figure-block-style">
@@ -3865,7 +3866,7 @@
3865
3866
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3866
3867
  </xsl:when>
3867
3868
  <xsl:otherwise>
3868
- <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 -->
3869
+ <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 -->
3869
3870
  </xsl:otherwise>
3870
3871
  </xsl:choose>
3871
3872
 
@@ -4368,7 +4369,7 @@
4368
4369
  <xsl:param name="colwidths"/>
4369
4370
  <xsl:param name="colgroup"/>
4370
4371
 
4371
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
4372
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
4372
4373
 
4373
4374
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
4374
4375
 
@@ -4455,6 +4456,7 @@
4455
4456
 
4456
4457
  <!-- except gb and bsi -->
4457
4458
 
4459
+ <xsl:apply-templates select="../*[local-name()='dl']"/>
4458
4460
  <xsl:apply-templates select="../*[local-name()='note']"/>
4459
4461
 
4460
4462
  <xsl:variable name="isDisplayRowSeparator">
@@ -4580,7 +4582,7 @@
4580
4582
  <!-- ===================== -->
4581
4583
  <!-- Table's row processing -->
4582
4584
  <!-- ===================== -->
4583
- <!-- row in table header (thead) -->
4585
+ <!-- row in table header (thead) thead/tr -->
4584
4586
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
4585
4587
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
4586
4588
 
@@ -4618,7 +4620,7 @@
4618
4620
  </xsl:choose>
4619
4621
  </xsl:template>
4620
4622
 
4621
- <!-- row in table footer (tfoot) -->
4623
+ <!-- row in table footer (tfoot), tfoot/tr -->
4622
4624
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
4623
4625
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
4624
4626
 
@@ -5127,6 +5129,8 @@
5127
5129
  <!-- <dl><xsl:copy-of select="."/></dl> -->
5128
5130
  <fo:block-container>
5129
5131
 
5132
+ <xsl:call-template name="setBlockSpanAll"/>
5133
+
5130
5134
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
5131
5135
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
5132
5136
  </xsl:if>
@@ -7205,13 +7209,17 @@
7205
7209
  </xsl:template>
7206
7210
 
7207
7211
  <xsl:template match="*[local-name() = 'callout']">
7208
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
7212
+ <xsl:choose>
7213
+ <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
7214
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
7215
+ </xsl:choose>
7209
7216
  </xsl:template>
7210
7217
 
7211
7218
  <xsl:template match="*[local-name() = 'annotation']">
7212
7219
  <xsl:variable name="annotation-id" select="@id"/>
7213
7220
  <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
7214
7221
  <fo:block id="{$annotation-id}" white-space="nowrap">
7222
+
7215
7223
  <fo:inline>
7216
7224
  <xsl:apply-templates>
7217
7225
  <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
@@ -7316,6 +7324,10 @@
7316
7324
  <!-- ====== -->
7317
7325
  <!-- ====== -->
7318
7326
 
7327
+ <xsl:template name="setBlockSpanAll">
7328
+ <xsl:if test="@columns = 1 or (local-name() = 'p' and *[@columns = 1])"><xsl:attribute name="span">all</xsl:attribute></xsl:if>
7329
+ </xsl:template>
7330
+
7319
7331
  <!-- ====== -->
7320
7332
  <!-- note -->
7321
7333
  <!-- termnote -->
@@ -7325,6 +7337,8 @@
7325
7337
 
7326
7338
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
7327
7339
 
7340
+ <xsl:call-template name="setBlockSpanAll"/>
7341
+
7328
7342
  <fo:block-container margin-left="0mm" margin-right="0mm">
7329
7343
 
7330
7344
  <fo:block>
@@ -7379,6 +7393,8 @@
7379
7393
  <xsl:template match="*[local-name() = 'termnote']">
7380
7394
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
7381
7395
 
7396
+ <xsl:call-template name="setBlockSpanAll"/>
7397
+
7382
7398
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
7383
7399
 
7384
7400
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
@@ -9292,6 +9308,9 @@
9292
9308
  <!-- ====== -->
9293
9309
  <xsl:template match="*[local-name() = 'termexample']">
9294
9310
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
9311
+
9312
+ <xsl:call-template name="setBlockSpanAll"/>
9313
+
9295
9314
  <xsl:apply-templates select="*[local-name()='name']"/>
9296
9315
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
9297
9316
  </fo:block>
@@ -9343,6 +9362,8 @@
9343
9362
 
9344
9363
  <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style">
9345
9364
 
9365
+ <xsl:call-template name="setBlockSpanAll"/>
9366
+
9346
9367
  <xsl:variable name="fo_element">
9347
9368
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
9348
9369
  block
@@ -9370,6 +9391,35 @@
9370
9391
  </fo:block-container>
9371
9392
  </xsl:when> <!-- end block -->
9372
9393
 
9394
+ <xsl:when test="contains(normalize-space($fo_element), 'list')">
9395
+
9396
+ <xsl:variable name="provisional_distance_between_starts">
9397
+ 7
9398
+ </xsl:variable>
9399
+ <xsl:variable name="indent">
9400
+ 0
9401
+ </xsl:variable>
9402
+
9403
+ <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
9404
+ <fo:list-item>
9405
+ <fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
9406
+ <fo:block>
9407
+ <xsl:apply-templates select="*[local-name()='name']">
9408
+ <xsl:with-param name="fo_element">block</xsl:with-param>
9409
+ </xsl:apply-templates>
9410
+ </fo:block>
9411
+ </fo:list-item-label>
9412
+ <fo:list-item-body start-indent="body-start()">
9413
+ <fo:block>
9414
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
9415
+ <xsl:with-param name="fo_element" select="$fo_element"/>
9416
+ </xsl:apply-templates>
9417
+ </fo:block>
9418
+ </fo:list-item-body>
9419
+ </fo:list-item>
9420
+ </fo:list-block>
9421
+ </xsl:when> <!-- end list -->
9422
+
9373
9423
  <xsl:otherwise> <!-- inline -->
9374
9424
 
9375
9425
  <!-- display 'EXAMPLE' and first element in the same line -->
@@ -9445,6 +9495,11 @@
9445
9495
  </fo:block>
9446
9496
  </fo:block-container>
9447
9497
  </xsl:when>
9498
+ <xsl:when test="starts-with(normalize-space($element), 'list')">
9499
+ <fo:block xsl:use-attribute-sets="example-p-style">
9500
+ <xsl:apply-templates/>
9501
+ </fo:block>
9502
+ </xsl:when>
9448
9503
  <xsl:otherwise>
9449
9504
  <fo:inline xsl:use-attribute-sets="example-p-style">
9450
9505
  <xsl:apply-templates/>
@@ -9562,6 +9617,9 @@
9562
9617
  <!-- ====== -->
9563
9618
  <xsl:template match="*[local-name() = 'quote']">
9564
9619
  <fo:block-container margin-left="0mm">
9620
+
9621
+ <xsl:call-template name="setBlockSpanAll"/>
9622
+
9565
9623
  <xsl:if test="parent::*[local-name() = 'note']">
9566
9624
  <xsl:if test="not(ancestor::*[local-name() = 'table'])">
9567
9625
  <xsl:attribute name="margin-left">5mm</xsl:attribute>
@@ -9854,6 +9912,8 @@
9854
9912
  <fo:block>
9855
9913
  <xsl:call-template name="setId"/>
9856
9914
 
9915
+ <xsl:call-template name="setBlockSpanAll"/>
9916
+
9857
9917
  <xsl:if test="@inline-header='true'">
9858
9918
  <xsl:attribute name="text-align">justify</xsl:attribute>
9859
9919
  </xsl:if>
@@ -9872,6 +9932,8 @@
9872
9932
  <fo:block break-after="page"/>
9873
9933
  <fo:block id="{@id}">
9874
9934
 
9935
+ <xsl:call-template name="setBlockSpanAll"/>
9936
+
9875
9937
  </fo:block>
9876
9938
  <xsl:apply-templates/>
9877
9939
  </xsl:template>
@@ -10852,6 +10914,8 @@
10852
10914
  <!-- text in the box -->
10853
10915
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
10854
10916
 
10917
+ <xsl:call-template name="setBlockSpanAll"/>
10918
+
10855
10919
  <fo:block-container xsl:use-attribute-sets="admonition-container-style">
10856
10920
 
10857
10921
  <fo:block xsl:use-attribute-sets="admonition-name-style">
@@ -11030,6 +11094,16 @@
11030
11094
  <xsl:apply-templates mode="update_xml_step1"/>
11031
11095
  </xsl:copy>
11032
11096
  </xsl:template>
11097
+
11098
+ <!-- remove semantic xml -->
11099
+ <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_step1"/>
11100
+
11101
+ <!-- remove image/emf -->
11102
+ <xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_step1"/>
11103
+
11104
+ <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_step1">
11105
+ <xsl:copy-of select="."/>
11106
+ </xsl:template>
11033
11107
  <!-- =========================================================================== -->
11034
11108
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
11035
11109
  <!-- =========================================================================== -->
@@ -11051,7 +11125,7 @@
11051
11125
 
11052
11126
  <xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
11053
11127
 
11054
- <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">
11128
+ <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">
11055
11129
 
11056
11130
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
11057
11131
  <xsl:variable name="tag_keep-together_within-line_open">###<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
@@ -11125,6 +11199,10 @@
11125
11199
 
11126
11200
  </xsl:template>
11127
11201
 
11202
+ <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_enclose_keep-together_within-line">
11203
+ <xsl:copy-of select="."/>
11204
+ </xsl:template>
11205
+
11128
11206
  <xsl:template name="replace_text_tags">
11129
11207
  <xsl:param name="tag_open"/>
11130
11208
  <xsl:param name="tag_close"/>
@@ -11151,6 +11229,194 @@
11151
11229
  <!-- END XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
11152
11230
  <!-- ===================================== -->
11153
11231
 
11232
+ <!-- ===================================== -->
11233
+ <!-- ===================================== -->
11234
+ <!-- Make linear XML (need for landscape orientation) -->
11235
+ <!-- ===================================== -->
11236
+ <!-- ===================================== -->
11237
+ <xsl:template match="@*|node()" mode="linear_xml">
11238
+ <xsl:copy>
11239
+ <xsl:apply-templates select="@*|node()" mode="linear_xml"/>
11240
+ </xsl:copy>
11241
+ </xsl:template>
11242
+
11243
+ <xsl:template match="processing-instruction()" mode="linear_xml">
11244
+ <xsl:copy-of select="."/>
11245
+ </xsl:template>
11246
+
11247
+ <!-- From:
11248
+ <clause>
11249
+ <title>...</title>
11250
+ <p>...</p>
11251
+ </clause>
11252
+ To:
11253
+ <clause/>
11254
+ <title>...</title>
11255
+ <p>...</p>
11256
+ -->
11257
+ <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">
11258
+
11259
+ <xsl:copy>
11260
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
11261
+
11262
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
11263
+
11264
+ <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'">
11265
+ <xsl:attribute name="mainsection">true</xsl:attribute>
11266
+ </xsl:if>
11267
+ </xsl:copy>
11268
+
11269
+ <xsl:apply-templates mode="linear_xml"/>
11270
+ </xsl:template>
11271
+
11272
+ <xsl:template match="*[local-name() = 'term']" mode="linear_xml" priority="2">
11273
+ <xsl:copy>
11274
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
11275
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
11276
+ <xsl:variable name="level">
11277
+ <xsl:call-template name="getLevel"/>
11278
+ </xsl:variable>
11279
+ <xsl:attribute name="depth"><xsl:value-of select="$level"/></xsl:attribute>
11280
+ <xsl:attribute name="ancestor">sections</xsl:attribute>
11281
+ <xsl:apply-templates select="node()[not(local-name() = 'term')]" mode="linear_xml"/>
11282
+ </xsl:copy>
11283
+ <xsl:apply-templates select="*[local-name() = 'term']" mode="linear_xml"/>
11284
+ </xsl:template>
11285
+
11286
+ <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">
11287
+ <xsl:copy>
11288
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
11289
+
11290
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
11291
+
11292
+ <xsl:variable name="level">
11293
+ <xsl:call-template name="getLevel"/>
11294
+ </xsl:variable>
11295
+ <xsl:attribute name="depth"><xsl:value-of select="$level"/></xsl:attribute>
11296
+
11297
+ <xsl:if test="parent::*[local-name() = 'annex']">
11298
+ <xsl:attribute name="depth">1</xsl:attribute>
11299
+ </xsl:if>
11300
+
11301
+ <xsl:if test="../@inline-header = 'true' and following-sibling::*[1][local-name() = 'p']">
11302
+ <xsl:copy-of select="../@inline-header"/>
11303
+ </xsl:if>
11304
+
11305
+ <xsl:attribute name="ancestor">
11306
+ <xsl:choose>
11307
+ <xsl:when test="ancestor::*[local-name() = 'foreword']">foreword</xsl:when>
11308
+ <xsl:when test="ancestor::*[local-name() = 'introduction']">introduction</xsl:when>
11309
+ <xsl:when test="ancestor::*[local-name() = 'sections']">sections</xsl:when>
11310
+ <xsl:when test="ancestor::*[local-name() = 'annex']">annex</xsl:when>
11311
+ <xsl:when test="ancestor::*[local-name() = 'bibliography']">bibliography</xsl:when>
11312
+ </xsl:choose>
11313
+ </xsl:attribute>
11314
+
11315
+ <xsl:apply-templates mode="linear_xml"/>
11316
+ </xsl:copy>
11317
+ </xsl:template>
11318
+
11319
+ <!-- add @to = figure, table, clause -->
11320
+ <!-- add @depth = from -->
11321
+ <xsl:template match="*[local-name() = 'xref']" mode="linear_xml">
11322
+ <xsl:copy>
11323
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
11324
+ <xsl:variable name="target" select="@target"/>
11325
+ <xsl:attribute name="to">
11326
+ <xsl:value-of select="local-name(//*[@id = current()/@target][1])"/>
11327
+ </xsl:attribute>
11328
+ <xsl:attribute name="depth">
11329
+ <xsl:value-of select="//*[@id = current()/@target][1]/*[local-name() = 'title']/@depth"/>
11330
+ </xsl:attribute>
11331
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
11332
+ </xsl:copy>
11333
+ </xsl:template>
11334
+
11335
+ <xsl:template match="*[not(ancestor::*[local-name() = 'sourcecode'])]/*[local-name() = 'p' or local-name() = 'strong' or local-name() = 'em']/text()" mode="linear_xml">
11336
+ <xsl:choose>
11337
+ <xsl:when test="contains(., $non_breaking_hyphen)">
11338
+ <xsl:call-template name="replaceChar">
11339
+ <xsl:with-param name="text" select="."/>
11340
+ <xsl:with-param name="replace" select="$non_breaking_hyphen"/>
11341
+ <xsl:with-param name="by" select="'-'"/>
11342
+ </xsl:call-template>
11343
+ </xsl:when>
11344
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
11345
+ </xsl:choose>
11346
+ </xsl:template>
11347
+
11348
+ <xsl:template name="replaceChar">
11349
+ <xsl:param name="text"/>
11350
+ <xsl:param name="replace"/>
11351
+ <xsl:param name="by"/>
11352
+ <xsl:choose>
11353
+ <xsl:when test="$text = '' or $replace = '' or not($replace)">
11354
+ <xsl:value-of select="$text"/>
11355
+ </xsl:when>
11356
+ <xsl:when test="contains($text, $replace)">
11357
+ <xsl:value-of select="substring-before($text,$replace)"/>
11358
+ <xsl:element name="inlineChar" namespace="https://www.metanorma.org/ns/jis"><xsl:value-of select="$by"/></xsl:element>
11359
+ <xsl:call-template name="replaceChar">
11360
+ <xsl:with-param name="text" select="substring-after($text,$replace)"/>
11361
+ <xsl:with-param name="replace" select="$replace"/>
11362
+ <xsl:with-param name="by" select="$by"/>
11363
+ </xsl:call-template>
11364
+ </xsl:when>
11365
+ <xsl:otherwise>
11366
+ <xsl:value-of select="$text"/>
11367
+ </xsl:otherwise>
11368
+ </xsl:choose>
11369
+ </xsl:template>
11370
+
11371
+ <xsl:template match="*[local-name() = 'inlineChar']">
11372
+ <fo:inline><xsl:value-of select="."/></fo:inline>
11373
+ </xsl:template>
11374
+
11375
+ <!-- change @reference to actual value, and add skip_footnote_body="true" for repeatable (2nd, 3rd, ...) -->
11376
+ <!--
11377
+ <fn reference="1">
11378
+ <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
11379
+ </fn>
11380
+ -->
11381
+ <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">
11382
+ <xsl:variable name="p_fn_">
11383
+ <xsl:call-template name="get_fn_list"/>
11384
+ </xsl:variable>
11385
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
11386
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
11387
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
11388
+ <xsl:variable name="reference" select="@reference"/>
11389
+ <!-- fn sequence number in document -->
11390
+ <xsl:variable name="current_fn_number" select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
11391
+
11392
+ <xsl:copy>
11393
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
11394
+ <!-- put actual reference number -->
11395
+ <xsl:attribute name="current_fn_number">
11396
+ <xsl:value-of select="$current_fn_number"/>
11397
+ </xsl:attribute>
11398
+ <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
11399
+ <xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
11400
+ </xsl:attribute>
11401
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
11402
+ </xsl:copy>
11403
+ </xsl:template>
11404
+
11405
+ <xsl:template match="*[local-name() = 'p'][@type = 'section-title']" priority="3" mode="linear_xml">
11406
+ <xsl:copy>
11407
+ <xsl:apply-templates select="@*" mode="linear_xml"/>
11408
+ <xsl:if test="@depth = '1'">
11409
+ <xsl:attribute name="mainsection">true</xsl:attribute>
11410
+ </xsl:if>
11411
+ <xsl:apply-templates select="node()" mode="linear_xml"/>
11412
+ </xsl:copy>
11413
+ </xsl:template>
11414
+ <!-- ===================================== -->
11415
+ <!-- ===================================== -->
11416
+ <!-- END: Make linear XML (need for landscape orientation) -->
11417
+ <!-- ===================================== -->
11418
+ <!-- ===================================== -->
11419
+
11154
11420
  <!-- for correct rendering combining chars -->
11155
11421
  <xsl:template match="*[local-name() = 'lang_none']">
11156
11422
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>