metanorma-iso 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,8 +16,7 @@
16
16
 
17
17
 
18
18
  <xsl:variable name="debug">false</xsl:variable>
19
- <xsl:variable name="pageWidth" select="210"/>
20
- <xsl:variable name="pageHeight" select="297"/>
19
+
21
20
  <xsl:variable name="marginLeftRight1" select="25"/>
22
21
  <xsl:variable name="marginLeftRight2" select="12.5"/>
23
22
  <xsl:variable name="marginTop" select="27.4"/>
@@ -1439,26 +1438,7 @@
1439
1438
 
1440
1439
  <!-- ============================= -->
1441
1440
  <!-- ============================= -->
1442
-
1443
-
1444
- <xsl:template match="iso:license-statement//iso:title">
1445
- <xsl:variable name="level">
1446
- <xsl:call-template name="getLevel"/>
1447
- </xsl:variable>
1448
- <fo:block text-align="center" font-weight="bold" role="H{$level}">
1449
- <xsl:apply-templates/>
1450
- </fo:block>
1451
- </xsl:template>
1452
-
1453
- <xsl:template match="iso:license-statement//iso:p">
1454
- <fo:block margin-left="1.5mm" margin-right="1.5mm">
1455
- <xsl:if test="following-sibling::iso:p">
1456
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
1457
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1458
- </xsl:if>
1459
- <xsl:apply-templates/>
1460
- </fo:block>
1461
- </xsl:template>
1441
+
1462
1442
 
1463
1443
  <!-- <fo:block margin-bottom="12pt">© ISO 2019, Published in Switzerland.</fo:block>
1464
1444
  <fo:block font-size="10pt" margin-bottom="12pt">All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting on the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address below or ISO’s member body in the country of the requester.</fo:block>
@@ -1472,7 +1452,7 @@
1472
1452
  <fo:block>www.iso.org</fo:block>
1473
1453
  </fo:block> -->
1474
1454
 
1475
- <xsl:template match="iso:copyright-statement/iso:clause[1]/iso:title">
1455
+ <xsl:template match="iso:copyright-statement/iso:clause[1]/iso:title" priority="2">
1476
1456
  <fo:block margin-bottom="3mm" role="H1">
1477
1457
  <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Attention))}" width="14mm" content-height="13mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/>
1478
1458
  <!-- <fo:inline padding-left="6mm" font-size="12pt" font-weight="bold">COPYRIGHT PROTECTED DOCUMENT</fo:inline> -->
@@ -1480,17 +1460,12 @@
1480
1460
  </fo:block>
1481
1461
  </xsl:template>
1482
1462
 
1483
- <xsl:template match="iso:copyright-statement//iso:p">
1463
+ <xsl:template match="iso:copyright-statement//iso:p" priority="2">
1484
1464
  <fo:block>
1485
- <xsl:if test="preceding-sibling::iso:p">
1486
- <!-- <xsl:attribute name="font-size">10pt</xsl:attribute> -->
1487
- </xsl:if>
1488
1465
  <xsl:if test="following-sibling::iso:p">
1489
- <!-- <xsl:attribute name="margin-bottom">12pt</xsl:attribute> -->
1490
1466
  <xsl:attribute name="margin-bottom">3pt</xsl:attribute>
1491
1467
  </xsl:if>
1492
- <xsl:if test="contains(@id, 'address')"> <!-- not(following-sibling::iso:p) -->
1493
- <!-- <xsl:attribute name="margin-left">7.1mm</xsl:attribute> -->
1468
+ <xsl:if test="contains(@id, 'address')">
1494
1469
  <xsl:attribute name="margin-left">4mm</xsl:attribute>
1495
1470
  </xsl:if>
1496
1471
  <xsl:apply-templates/>
@@ -1693,15 +1668,13 @@
1693
1668
 
1694
1669
  <xsl:template match="iso:ul | iso:ol" mode="ul_ol">
1695
1670
  <fo:list-block provisional-distance-between-starts="7mm" margin-top="8pt"> <!-- margin-bottom="8pt" -->
1696
- <xsl:apply-templates/>
1671
+ <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
1697
1672
  </fo:list-block>
1698
1673
  <xsl:for-each select="./iso:note">
1699
1674
  <xsl:call-template name="note"/>
1700
1675
  </xsl:for-each>
1701
1676
  </xsl:template>
1702
1677
 
1703
- <xsl:template match="iso:ul/iso:note | iso:ol/iso:note | iso:ul/iso:li/iso:note | iso:ol/iso:li/iso:note" priority="2"/>
1704
-
1705
1678
  <xsl:template match="iso:li">
1706
1679
  <fo:list-item id="{@id}">
1707
1680
  <fo:list-item-label end-indent="label-end()">
@@ -1711,8 +1684,8 @@
1711
1684
  </fo:list-item-label>
1712
1685
  <fo:list-item-body start-indent="body-start()">
1713
1686
  <fo:block>
1714
- <xsl:apply-templates/>
1715
- <!-- <xsl:apply-templates select=".//iso:note" mode="process"/> -->
1687
+ <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
1688
+
1716
1689
  <xsl:for-each select="./iso:note">
1717
1690
  <xsl:call-template name="note"/>
1718
1691
  </xsl:for-each>
@@ -1721,13 +1694,6 @@
1721
1694
  </fo:list-item>
1722
1695
  </xsl:template>
1723
1696
 
1724
- <xsl:template match="iso:note" mode="process">
1725
- <xsl:call-template name="note"/>
1726
- </xsl:template>
1727
-
1728
- <xsl:template match="*" mode="process">
1729
- <xsl:apply-templates select="."/>
1730
- </xsl:template>
1731
1697
 
1732
1698
  <xsl:template match="iso:preferred">
1733
1699
  <xsl:variable name="levelTerm">
@@ -2017,7 +1983,11 @@
2017
1983
  </xsl:template>
2018
1984
 
2019
1985
 
2020
- <xsl:variable name="titles_">
1986
+ <xsl:variable name="pageWidth_">
1987
+ 210
1988
+ </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_">
1989
+ 297
1990
+ </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="titles_">
2021
1991
 
2022
1992
  <title-edition lang="en">
2023
1993
 
@@ -2124,6 +2094,58 @@
2124
2094
 
2125
2095
 
2126
2096
 
2097
+ </xsl:attribute-set><xsl:attribute-set name="copyright-statement-style">
2098
+
2099
+ </xsl:attribute-set><xsl:attribute-set name="copyright-statement-title-style">
2100
+
2101
+
2102
+ </xsl:attribute-set><xsl:attribute-set name="copyright-statement-p-style">
2103
+
2104
+
2105
+
2106
+ </xsl:attribute-set><xsl:attribute-set name="license-statement-style">
2107
+
2108
+
2109
+ </xsl:attribute-set><xsl:attribute-set name="license-statement-title-style">
2110
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2111
+
2112
+
2113
+ <xsl:attribute name="text-align">center</xsl:attribute>
2114
+
2115
+
2116
+
2117
+
2118
+
2119
+ </xsl:attribute-set><xsl:attribute-set name="license-statement-p-style">
2120
+
2121
+
2122
+ <xsl:attribute name="margin-left">1.5mm</xsl:attribute>
2123
+ <xsl:attribute name="margin-right">1.5mm</xsl:attribute>
2124
+
2125
+
2126
+
2127
+ </xsl:attribute-set><xsl:attribute-set name="legal-statement-style">
2128
+
2129
+
2130
+
2131
+ </xsl:attribute-set><xsl:attribute-set name="legal-statement-title-style">
2132
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2133
+
2134
+
2135
+
2136
+
2137
+
2138
+ </xsl:attribute-set><xsl:attribute-set name="legal-statement-p-style">
2139
+
2140
+ </xsl:attribute-set><xsl:attribute-set name="feedback-statement-style">
2141
+
2142
+
2143
+ </xsl:attribute-set><xsl:attribute-set name="feedback-statement-title-style">
2144
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2145
+
2146
+ </xsl:attribute-set><xsl:attribute-set name="feedback-statement-p-style">
2147
+
2148
+
2127
2149
  </xsl:attribute-set><xsl:attribute-set name="link-style">
2128
2150
 
2129
2151
 
@@ -2971,6 +2993,7 @@
2971
2993
  </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-list-body-style">
2972
2994
 
2973
2995
 
2996
+
2974
2997
  </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-style">
2975
2998
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
2976
2999
  <xsl:attribute name="font-size">65%</xsl:attribute>
@@ -3081,6 +3104,79 @@
3081
3104
  <xsl:value-of select="."/>
3082
3105
  </xsl:template><xsl:template match="*[local-name()='br']">
3083
3106
  <xsl:value-of select="$linebreak"/>
3107
+ </xsl:template><xsl:template match="*[local-name()='copyright-statement']">
3108
+ <fo:block xsl:use-attribute-sets="copyright-statement-style">
3109
+ <xsl:apply-templates/>
3110
+ </fo:block>
3111
+ </xsl:template><xsl:template match="*[local-name()='copyright-statement']//*[local-name()='title']">
3112
+
3113
+ <!-- process in the template 'title' -->
3114
+ <xsl:call-template name="title"/>
3115
+
3116
+ </xsl:template><xsl:template match="*[local-name()='copyright-statement']//*[local-name()='p']">
3117
+
3118
+
3119
+ <!-- process in the template 'paragraph' -->
3120
+ <xsl:call-template name="paragraph"/>
3121
+
3122
+ </xsl:template><xsl:template match="*[local-name()='license-statement']">
3123
+ <fo:block xsl:use-attribute-sets="license-statement-style">
3124
+ <xsl:apply-templates/>
3125
+ </fo:block>
3126
+ </xsl:template><xsl:template match="*[local-name()='license-statement']//*[local-name()='title']">
3127
+
3128
+ <xsl:variable name="level">
3129
+ <xsl:call-template name="getLevel"/>
3130
+ </xsl:variable>
3131
+ <fo:block role="H{$level}" xsl:use-attribute-sets="license-statement-title-style">
3132
+ <xsl:apply-templates/>
3133
+ </fo:block>
3134
+
3135
+ </xsl:template><xsl:template match="*[local-name()='license-statement']//*[local-name()='p']">
3136
+
3137
+ <fo:block xsl:use-attribute-sets="license-statement-p-style">
3138
+
3139
+
3140
+ <xsl:if test="following-sibling::*[local-name() = 'p']">
3141
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
3142
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3143
+ </xsl:if>
3144
+
3145
+
3146
+
3147
+
3148
+ <xsl:apply-templates/>
3149
+ </fo:block>
3150
+
3151
+ </xsl:template><xsl:template match="*[local-name()='legal-statement']">
3152
+ <fo:block xsl:use-attribute-sets="legal-statement-style">
3153
+ <xsl:apply-templates/>
3154
+ </fo:block>
3155
+ </xsl:template><xsl:template match="*[local-name()='legal-statement']//*[local-name()='title']">
3156
+
3157
+ <!-- process in the template 'title' -->
3158
+ <xsl:call-template name="title"/>
3159
+
3160
+
3161
+ </xsl:template><xsl:template match="*[local-name()='legal-statement']//*[local-name()='p']">
3162
+
3163
+ <!-- process in the template 'paragraph' -->
3164
+ <xsl:call-template name="paragraph"/>
3165
+
3166
+ </xsl:template><xsl:template match="*[local-name()='feedback-statement']">
3167
+ <fo:block xsl:use-attribute-sets="feedback-statement-style">
3168
+ <xsl:apply-templates/>
3169
+ </fo:block>
3170
+ </xsl:template><xsl:template match="*[local-name()='feedback-statement']//*[local-name()='title']">
3171
+
3172
+ <!-- process in the template 'title' -->
3173
+ <xsl:call-template name="title"/>
3174
+
3175
+ </xsl:template><xsl:template match="*[local-name()='feedback-statement']//*[local-name()='p']">
3176
+
3177
+ <!-- process in the template 'paragraph' -->
3178
+ <xsl:call-template name="paragraph"/>
3179
+
3084
3180
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
3085
3181
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
3086
3182
  <xsl:call-template name="add-zero-spaces-java"/>
@@ -3223,7 +3319,7 @@
3223
3319
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3224
3320
  </xsl:when>
3225
3321
  <xsl:otherwise>
3226
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3322
+ <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 -->
3227
3323
  </xsl:otherwise>
3228
3324
  </xsl:choose>
3229
3325
 
@@ -3442,7 +3538,7 @@
3442
3538
 
3443
3539
  <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
3444
3540
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
3445
- </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
3541
+ </xsl:template><xsl:template match="*[local-name()='thead']">
3446
3542
  <xsl:param name="cols-count"/>
3447
3543
  <fo:table-header>
3448
3544
 
@@ -3480,13 +3576,13 @@
3480
3576
  <fo:table-body>
3481
3577
  <xsl:apply-templates/>
3482
3578
  </fo:table-body>
3483
- </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
3579
+ </xsl:template><xsl:template match="*[local-name()='tfoot']">
3484
3580
  <xsl:apply-templates/>
3485
3581
  </xsl:template><xsl:template name="insertTableFooter">
3486
3582
  <xsl:param name="cols-count"/>
3487
3583
  <xsl:if test="../*[local-name()='tfoot']">
3488
3584
  <fo:table-footer>
3489
- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
3585
+ <xsl:apply-templates select="../*[local-name()='tfoot']"/>
3490
3586
  </fo:table-footer>
3491
3587
  </xsl:if>
3492
3588
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
@@ -3572,7 +3668,7 @@
3572
3668
 
3573
3669
  <!-- except gb and bsi -->
3574
3670
 
3575
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
3671
+ <xsl:apply-templates select="../*[local-name()='note']"/>
3576
3672
 
3577
3673
 
3578
3674
 
@@ -3619,7 +3715,7 @@
3619
3715
  </xsl:if>
3620
3716
 
3621
3717
 
3622
- <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
3718
+ <xsl:apply-templates select="../*[local-name()='thead']">
3623
3719
  <xsl:with-param name="cols-count" select="$cols-count"/>
3624
3720
  </xsl:apply-templates>
3625
3721
 
@@ -3812,7 +3908,7 @@
3812
3908
  <xsl:apply-templates/>
3813
3909
  </fo:block>
3814
3910
  </fo:table-cell>
3815
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
3911
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2">
3816
3912
 
3817
3913
  <fo:block xsl:use-attribute-sets="table-note-style">
3818
3914
 
@@ -3835,10 +3931,10 @@
3835
3931
 
3836
3932
 
3837
3933
 
3838
- <xsl:apply-templates select="node()[not(local-name() = 'name')]" mode="process"/>
3934
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3839
3935
  </fo:block>
3840
3936
 
3841
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
3937
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" priority="2">
3842
3938
  <xsl:apply-templates/>
3843
3939
  </xsl:template><xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn">
3844
3940
 
@@ -4388,7 +4484,9 @@
4388
4484
  </td>
4389
4485
  <td>
4390
4486
 
4391
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
4487
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
4488
+ <xsl:with-param name="process">true</xsl:with-param>
4489
+ </xsl:apply-templates>
4392
4490
 
4393
4491
  </td>
4394
4492
  </tr>
@@ -4415,15 +4513,20 @@
4415
4513
  <fo:block>
4416
4514
 
4417
4515
 
4418
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
4516
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
4517
+ <xsl:with-param name="process">true</xsl:with-param>
4518
+ </xsl:apply-templates>
4419
4519
  </fo:block>
4420
4520
  </fo:table-cell>
4421
4521
  </fo:table-row>
4422
4522
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
4423
4523
  <xsl:apply-templates/>
4424
- </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
4425
- <xsl:apply-templates select="@language"/>
4426
- <xsl:apply-templates/>
4524
+ </xsl:template><xsl:template match="*[local-name()='dd']">
4525
+ <xsl:param name="process">false</xsl:param>
4526
+ <xsl:if test="$process = 'true'">
4527
+ <xsl:apply-templates select="@language"/>
4528
+ <xsl:apply-templates/>
4529
+ </xsl:if>
4427
4530
  </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
4428
4531
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
4429
4532
  </xsl:template><xsl:template match="*[local-name()='em']">
@@ -4598,7 +4701,11 @@
4598
4701
  <xsl:with-param name="text" select="substring($text,2)"/>
4599
4702
  </xsl:call-template>
4600
4703
  </xsl:if>
4601
- </xsl:template><xsl:template name="tokenize">
4704
+ </xsl:template><xsl:template match="*[local-name() = 'pagebreak']">
4705
+ <fo:block break-after="page"/>
4706
+ <fo:block> </fo:block>
4707
+ <fo:block break-after="page"/>
4708
+ </xsl:template><xsl:template name="tokenize">
4602
4709
  <xsl:param name="text"/>
4603
4710
  <xsl:param name="separator" select="' '"/>
4604
4711
  <xsl:choose>
@@ -5037,10 +5144,10 @@
5037
5144
  </fo:inline>
5038
5145
  </xsl:template><xsl:template match="*[local-name()='appendix']">
5039
5146
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
5040
- <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
5147
+ <xsl:apply-templates select="*[local-name()='title']"/>
5041
5148
  </fo:block>
5042
- <xsl:apply-templates/>
5043
- </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
5149
+ <xsl:apply-templates select="node()[not(local-name()='title')]"/>
5150
+ </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" priority="2">
5044
5151
  <xsl:variable name="level">
5045
5152
  <xsl:call-template name="getLevel"/>
5046
5153
  </xsl:variable>
@@ -5662,7 +5769,7 @@
5662
5769
  <xsl:value-of select="."/>
5663
5770
  </xsl:template><xsl:template match="node()" mode="contents">
5664
5771
  <xsl:apply-templates mode="contents"/>
5665
- </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="2" mode="contents">
5772
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" mode="contents">
5666
5773
  <xsl:variable name="level">
5667
5774
  <xsl:call-template name="getLevel">
5668
5775
  <xsl:with-param name="depth" select="@depth"/>
@@ -5670,10 +5777,15 @@
5670
5777
  </xsl:variable>
5671
5778
 
5672
5779
  <xsl:variable name="section">
5673
- <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
5780
+ <xsl:choose>
5781
+ <xsl:when test="@type = 'section-title'"/>
5782
+ <xsl:otherwise>
5783
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
5784
+ </xsl:otherwise>
5785
+ </xsl:choose>
5674
5786
  </xsl:variable>
5675
5787
 
5676
- <xsl:variable name="type">floating-title</xsl:variable>
5788
+ <xsl:variable name="type"><xsl:value-of select="@type"/></xsl:variable>
5677
5789
 
5678
5790
  <xsl:variable name="display">
5679
5791
  <xsl:choose>
@@ -5690,7 +5802,16 @@
5690
5802
  <xsl:variable name="title">
5691
5803
  <xsl:choose>
5692
5804
  <xsl:when test="*[local-name() = 'tab']">
5693
- <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
5805
+ <xsl:choose>
5806
+ <xsl:when test="@type = 'section-title'">
5807
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
5808
+ <xsl:text>: </xsl:text>
5809
+ <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
5810
+ </xsl:when>
5811
+ <xsl:otherwise>
5812
+ <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
5813
+ </xsl:otherwise>
5814
+ </xsl:choose>
5694
5815
  </xsl:when>
5695
5816
  <xsl:otherwise>
5696
5817
  <xsl:copy-of select="node()"/>
@@ -7268,7 +7389,7 @@
7268
7389
  </fo:inline>
7269
7390
  </xsl:template><xsl:template match="@language">
7270
7391
  <xsl:copy-of select="."/>
7271
- </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="4">
7392
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="4">
7272
7393
  <xsl:call-template name="title"/>
7273
7394
  </xsl:template><xsl:template match="*[local-name() = 'admonition']">
7274
7395
 
@@ -7322,27 +7443,17 @@
7322
7443
  <xsl:variable name="month" select="substring($date, 6, 2)"/>
7323
7444
  <xsl:variable name="day" select="substring($date, 9, 2)"/>
7324
7445
  <xsl:variable name="monthStr">
7325
- <xsl:choose>
7326
- <xsl:when test="$month = '01'">january</xsl:when>
7327
- <xsl:when test="$month = '02'">february</xsl:when>
7328
- <xsl:when test="$month = '03'">march</xsl:when>
7329
- <xsl:when test="$month = '04'">april</xsl:when>
7330
- <xsl:when test="$month = '05'">may</xsl:when>
7331
- <xsl:when test="$month = '06'">june</xsl:when>
7332
- <xsl:when test="$month = '07'">july</xsl:when>
7333
- <xsl:when test="$month = '08'">august</xsl:when>
7334
- <xsl:when test="$month = '09'">september</xsl:when>
7335
- <xsl:when test="$month = '10'">october</xsl:when>
7336
- <xsl:when test="$month = '11'">november</xsl:when>
7337
- <xsl:when test="$month = '12'">december</xsl:when>
7338
- </xsl:choose>
7446
+ <xsl:call-template name="getMonthByNum">
7447
+ <xsl:with-param name="num" select="$month"/>
7448
+ <xsl:with-param name="lowercase" select="'true'"/>
7449
+ </xsl:call-template>
7339
7450
  </xsl:variable>
7340
7451
  <xsl:variable name="monthStr_localized">
7341
7452
  <xsl:if test="normalize-space($monthStr) != ''"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_<xsl:value-of select="$monthStr"/></xsl:with-param></xsl:call-template></xsl:if>
7342
7453
  </xsl:variable>
7343
7454
  <xsl:variable name="result">
7344
7455
  <xsl:choose>
7345
- <xsl:when test="$format = 'ddMMyyyy'">
7456
+ <xsl:when test="$format = 'ddMMyyyy'"> <!-- convert date from format 2007-04-01 to 1 April 2007 -->
7346
7457
  <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
7347
7458
  <xsl:text> </xsl:text>
7348
7459
  <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ' , $year))"/>
@@ -7355,11 +7466,57 @@
7355
7466
  <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $year))"/>
7356
7467
  </xsl:when>
7357
7468
  <xsl:otherwise>
7358
- <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $day, ', ' , $year))"/>
7469
+ <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $day, ', ' , $year))"/> <!-- January 01, 2022 -->
7359
7470
  </xsl:otherwise>
7360
7471
  </xsl:choose>
7361
7472
  </xsl:variable>
7362
7473
  <xsl:value-of select="$result"/>
7474
+ </xsl:template><xsl:template name="getMonthByNum">
7475
+ <xsl:param name="num"/>
7476
+ <xsl:param name="lang">en</xsl:param>
7477
+ <xsl:param name="lowercase">false</xsl:param> <!-- return 'january' instead of 'January' -->
7478
+ <xsl:variable name="monthStr_">
7479
+ <xsl:choose>
7480
+ <xsl:when test="$lang = 'fr'">
7481
+ <xsl:choose>
7482
+ <xsl:when test="$num = '01'">Janvier</xsl:when>
7483
+ <xsl:when test="$num = '02'">Février</xsl:when>
7484
+ <xsl:when test="$num = '03'">Mars</xsl:when>
7485
+ <xsl:when test="$num = '04'">Avril</xsl:when>
7486
+ <xsl:when test="$num = '05'">Mai</xsl:when>
7487
+ <xsl:when test="$num = '06'">Juin</xsl:when>
7488
+ <xsl:when test="$num = '07'">Juillet</xsl:when>
7489
+ <xsl:when test="$num = '08'">Août</xsl:when>
7490
+ <xsl:when test="$num = '09'">Septembre</xsl:when>
7491
+ <xsl:when test="$num = '10'">Octobre</xsl:when>
7492
+ <xsl:when test="$num = '11'">Novembre</xsl:when>
7493
+ <xsl:when test="$num = '12'">Décembre</xsl:when>
7494
+ </xsl:choose>
7495
+ </xsl:when>
7496
+ <xsl:otherwise>
7497
+ <xsl:choose>
7498
+ <xsl:when test="$num = '01'">January</xsl:when>
7499
+ <xsl:when test="$num = '02'">February</xsl:when>
7500
+ <xsl:when test="$num = '03'">March</xsl:when>
7501
+ <xsl:when test="$num = '04'">April</xsl:when>
7502
+ <xsl:when test="$num = '05'">May</xsl:when>
7503
+ <xsl:when test="$num = '06'">June</xsl:when>
7504
+ <xsl:when test="$num = '07'">July</xsl:when>
7505
+ <xsl:when test="$num = '08'">August</xsl:when>
7506
+ <xsl:when test="$num = '09'">September</xsl:when>
7507
+ <xsl:when test="$num = '10'">October</xsl:when>
7508
+ <xsl:when test="$num = '11'">November</xsl:when>
7509
+ <xsl:when test="$num = '12'">December</xsl:when>
7510
+ </xsl:choose>
7511
+ </xsl:otherwise>
7512
+ </xsl:choose>
7513
+ </xsl:variable>
7514
+ <xsl:choose>
7515
+ <xsl:when test="normalize-space($lowercase) = 'true'">
7516
+ <xsl:value-of select="java:toLowerCase(java:java.lang.String.new($monthStr_))"/>
7517
+ </xsl:when>
7518
+ <xsl:otherwise><xsl:value-of select="$monthStr_"/></xsl:otherwise>
7519
+ </xsl:choose>
7363
7520
  </xsl:template><xsl:template name="insertKeywords">
7364
7521
  <xsl:param name="sorting" select="'true'"/>
7365
7522
  <xsl:param name="charAtEnd" select="'.'"/>
@@ -7820,6 +7977,25 @@
7820
7977
  </xsl:otherwise>
7821
7978
  </xsl:choose>
7822
7979
  </xsl:if>
7980
+ </xsl:template><xsl:template name="number-to-ordinal">
7981
+ <xsl:param name="number"/>
7982
+ <xsl:param name="curr_lang"/>
7983
+ <xsl:choose>
7984
+ <xsl:when test="$curr_lang = 'fr'">
7985
+ <xsl:choose>
7986
+ <xsl:when test="$number = '1'">re</xsl:when>
7987
+ <xsl:otherwise>e</xsl:otherwise>
7988
+ </xsl:choose>
7989
+ </xsl:when>
7990
+ <xsl:otherwise>
7991
+ <xsl:choose>
7992
+ <xsl:when test="$number = 1">st</xsl:when>
7993
+ <xsl:when test="$number = 2">nd</xsl:when>
7994
+ <xsl:when test="$number = 3">rd</xsl:when>
7995
+ <xsl:otherwise>th</xsl:otherwise>
7996
+ </xsl:choose>
7997
+ </xsl:otherwise>
7998
+ </xsl:choose>
7823
7999
  </xsl:template><xsl:template name="setAltText">
7824
8000
  <xsl:param name="value"/>
7825
8001
  <xsl:attribute name="fox:alt-text">