metanorma-ogc 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,8 +9,6 @@
9
9
 
10
10
  <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
11
11
 
12
- <xsl:variable name="pageWidth" select="215.9"/>
13
- <xsl:variable name="pageHeight" select="279.4"/>
14
12
  <xsl:variable name="marginLeftRight1" select="35"/>
15
13
  <xsl:variable name="marginLeftRight2" select="17"/>
16
14
  <xsl:variable name="marginTop" select="16.5"/>
@@ -323,12 +321,35 @@
323
321
  <fo:inline font-weight="bold">Publication Date: </fo:inline>
324
322
  <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:date[@type = 'published']/ogc:on"/>
325
323
  </fo:block>
326
- <fo:block margin-bottom="12pt">
327
- <fo:inline font-weight="bold">Editor: </fo:inline>
328
- <xsl:for-each select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='editor']/ogc:person/ogc:name/ogc:completename">
329
- <xsl:value-of select="."/>
330
- <xsl:if test="position() != last()">, </xsl:if>
331
- </xsl:for-each>
324
+
325
+ <fo:block margin-bottom="12pt">
326
+ <xsl:if test="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author']/ogc:person/ogc:name/ogc:completename">
327
+ <fo:block>
328
+ <fo:inline font-weight="bold">Author: </fo:inline>
329
+ <xsl:for-each select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author']/ogc:person/ogc:name/ogc:completename">
330
+ <xsl:value-of select="."/>
331
+ <xsl:if test="position() != last()">, </xsl:if>
332
+ </xsl:for-each>
333
+ </fo:block>
334
+ </xsl:if>
335
+ <xsl:if test="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='editor']/ogc:person/ogc:name/ogc:completename">
336
+ <fo:block>
337
+ <fo:inline font-weight="bold">Editor: </fo:inline>
338
+ <xsl:for-each select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='editor']/ogc:person/ogc:name/ogc:completename">
339
+ <xsl:value-of select="."/>
340
+ <xsl:if test="position() != last()">, </xsl:if>
341
+ </xsl:for-each>
342
+ </fo:block>
343
+ </xsl:if>
344
+ <xsl:if test="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='contributor']/ogc:person/ogc:name/ogc:completename">
345
+ <fo:block>
346
+ <fo:inline font-weight="bold">Contributor: </fo:inline>
347
+ <xsl:for-each select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='contributor']/ogc:person/ogc:name/ogc:completename">
348
+ <xsl:value-of select="."/>
349
+ <xsl:if test="position() != last()">, </xsl:if>
350
+ </xsl:for-each>
351
+ </fo:block>
352
+ </xsl:if>
332
353
  </fo:block>
333
354
  </fo:block>
334
355
 
@@ -841,46 +862,11 @@
841
862
  </fo:block>
842
863
  </xsl:template>
843
864
 
844
- <xsl:template match="ogc:license-statement | ogc:feedback-statement | ogc:copyright-statement">
845
- <fo:block font-size="8pt" line-height="125%">
846
- <xsl:apply-templates/>
847
- </fo:block>
848
- </xsl:template>
849
-
850
- <xsl:template match="ogc:license-statement//ogc:title">
851
- <xsl:variable name="level">
852
- <xsl:call-template name="getLevel"/>
853
- </xsl:variable>
854
- <fo:block font-weight="bold" color="{$color_blue}" role="H{$level}">
855
- <xsl:apply-templates/>
856
- </fo:block>
857
- </xsl:template>
858
-
859
- <xsl:template match="ogc:copyright-statement//ogc:title">
860
- <xsl:variable name="level">
861
- <xsl:call-template name="getLevel"/>
862
- </xsl:variable>
863
- <fo:block font-weight="bold" color="{$color_blue}" margin-top="24pt" role="H{$level}">
864
- <xsl:apply-templates/>
865
- </fo:block>
866
- </xsl:template>
867
-
868
- <xsl:template match="ogc:license-statement//ogc:p | ogc:feedback-statement//ogc:p | ogc:copyright-statement//ogc:p">
869
- <fo:block margin-top="6pt">
870
- <xsl:apply-templates/>
871
- </fo:block>
872
- </xsl:template>
873
-
874
- <xsl:template match="ogc:legal-statement">
875
- <fo:block font-size="8pt">
876
- <xsl:apply-templates/>
877
- </fo:block>
878
- </xsl:template>
879
-
880
- <xsl:template match="ogc:legal-statement//ogc:title">
865
+ <xsl:template match="ogc:legal-statement//ogc:title" priority="2">
881
866
  <xsl:variable name="level">
882
867
  <xsl:call-template name="getLevel"/>
883
868
  </xsl:variable>
869
+ <!-- inline title -->
884
870
  <fo:inline font-weight="bold" role="H{$level}">
885
871
  <xsl:apply-templates/><xsl:text>: </xsl:text>
886
872
  </fo:inline>
@@ -892,8 +878,8 @@
892
878
  </xsl:call-template>
893
879
  </xsl:template>
894
880
 
895
-
896
- <xsl:template match="ogc:legal-statement//ogc:p">
881
+
882
+ <xsl:template match="ogc:legal-statement//ogc:p" priority="2">
897
883
  <fo:inline>
898
884
  <xsl:apply-templates/>
899
885
  </fo:inline>
@@ -1030,7 +1016,7 @@
1030
1016
  <!-- ====== -->
1031
1017
  <!-- ====== -->
1032
1018
 
1033
- <xsl:template match="ogc:p">
1019
+ <xsl:template match="ogc:p" name="paragraph">
1034
1020
  <xsl:param name="inline" select="'false'"/>
1035
1021
  <xsl:variable name="previous-element" select="local-name(preceding-sibling::*[1])"/>
1036
1022
  <xsl:variable name="element-name">
@@ -1283,11 +1269,6 @@
1283
1269
  </fo:block-container>
1284
1270
  </xsl:template>
1285
1271
 
1286
- <xsl:template match="ogc:pagebreak">
1287
- <fo:block break-after="page"/>
1288
- <fo:block> </fo:block>
1289
- <fo:block break-after="page"/>
1290
- </xsl:template>
1291
1272
 
1292
1273
  <xsl:template name="insertHeaderFooter">
1293
1274
  <xsl:param name="color" select="$color_blue"/>
@@ -1593,7 +1574,11 @@
1593
1574
  </fo:static-content>
1594
1575
  </xsl:template>
1595
1576
 
1596
- <xsl:variable name="titles_">
1577
+ <xsl:variable name="pageWidth_">
1578
+ 215.9
1579
+ </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_">
1580
+ 279.4
1581
+ </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="titles_">
1597
1582
 
1598
1583
  <title-edition lang="en">
1599
1584
 
@@ -1699,6 +1684,77 @@
1699
1684
 
1700
1685
 
1701
1686
 
1687
+ </xsl:attribute-set><xsl:attribute-set name="copyright-statement-style">
1688
+
1689
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
1690
+ <xsl:attribute name="line-height">125%</xsl:attribute>
1691
+
1692
+ </xsl:attribute-set><xsl:attribute-set name="copyright-statement-title-style">
1693
+
1694
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1695
+ <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
1696
+ <xsl:attribute name="margin-top">24pt</xsl:attribute>
1697
+
1698
+
1699
+ </xsl:attribute-set><xsl:attribute-set name="copyright-statement-p-style">
1700
+
1701
+
1702
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1703
+
1704
+
1705
+ </xsl:attribute-set><xsl:attribute-set name="license-statement-style">
1706
+
1707
+
1708
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
1709
+ <xsl:attribute name="line-height">125%</xsl:attribute>
1710
+
1711
+ </xsl:attribute-set><xsl:attribute-set name="license-statement-title-style">
1712
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1713
+
1714
+
1715
+
1716
+
1717
+
1718
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1719
+ <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
1720
+
1721
+
1722
+ </xsl:attribute-set><xsl:attribute-set name="license-statement-p-style">
1723
+
1724
+
1725
+
1726
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1727
+
1728
+
1729
+ </xsl:attribute-set><xsl:attribute-set name="legal-statement-style">
1730
+
1731
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
1732
+
1733
+
1734
+
1735
+ </xsl:attribute-set><xsl:attribute-set name="legal-statement-title-style">
1736
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1737
+
1738
+
1739
+
1740
+
1741
+
1742
+ </xsl:attribute-set><xsl:attribute-set name="legal-statement-p-style">
1743
+
1744
+ </xsl:attribute-set><xsl:attribute-set name="feedback-statement-style">
1745
+
1746
+
1747
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
1748
+ <xsl:attribute name="line-height">125%</xsl:attribute>
1749
+
1750
+ </xsl:attribute-set><xsl:attribute-set name="feedback-statement-title-style">
1751
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1752
+
1753
+ </xsl:attribute-set><xsl:attribute-set name="feedback-statement-p-style">
1754
+
1755
+
1756
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1757
+
1702
1758
  </xsl:attribute-set><xsl:attribute-set name="link-style">
1703
1759
 
1704
1760
 
@@ -2609,6 +2665,7 @@
2609
2665
  </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-list-body-style">
2610
2666
 
2611
2667
 
2668
+
2612
2669
  </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-style">
2613
2670
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
2614
2671
  <xsl:attribute name="font-size">65%</xsl:attribute>
@@ -2718,6 +2775,86 @@
2718
2775
  <xsl:value-of select="."/>
2719
2776
  </xsl:template><xsl:template match="*[local-name()='br']">
2720
2777
  <xsl:value-of select="$linebreak"/>
2778
+ </xsl:template><xsl:template match="*[local-name()='copyright-statement']">
2779
+ <fo:block xsl:use-attribute-sets="copyright-statement-style">
2780
+ <xsl:apply-templates/>
2781
+ </fo:block>
2782
+ </xsl:template><xsl:template match="*[local-name()='copyright-statement']//*[local-name()='title']">
2783
+
2784
+ <xsl:variable name="level">
2785
+ <xsl:call-template name="getLevel"/>
2786
+ </xsl:variable>
2787
+ <fo:block role="H{$level}" xsl:use-attribute-sets="copyright-statement-title-style">
2788
+ <xsl:apply-templates/>
2789
+ </fo:block>
2790
+
2791
+ </xsl:template><xsl:template match="*[local-name()='copyright-statement']//*[local-name()='p']">
2792
+
2793
+
2794
+ <fo:block xsl:use-attribute-sets="copyright-statement-p-style">
2795
+
2796
+
2797
+
2798
+
2799
+
2800
+ <xsl:apply-templates/>
2801
+ </fo:block>
2802
+
2803
+
2804
+ </xsl:template><xsl:template match="*[local-name()='license-statement']">
2805
+ <fo:block xsl:use-attribute-sets="license-statement-style">
2806
+ <xsl:apply-templates/>
2807
+ </fo:block>
2808
+ </xsl:template><xsl:template match="*[local-name()='license-statement']//*[local-name()='title']">
2809
+
2810
+ <xsl:variable name="level">
2811
+ <xsl:call-template name="getLevel"/>
2812
+ </xsl:variable>
2813
+ <fo:block role="H{$level}" xsl:use-attribute-sets="license-statement-title-style">
2814
+ <xsl:apply-templates/>
2815
+ </fo:block>
2816
+
2817
+ </xsl:template><xsl:template match="*[local-name()='license-statement']//*[local-name()='p']">
2818
+
2819
+ <fo:block xsl:use-attribute-sets="license-statement-p-style">
2820
+
2821
+
2822
+
2823
+
2824
+
2825
+ <xsl:apply-templates/>
2826
+ </fo:block>
2827
+
2828
+ </xsl:template><xsl:template match="*[local-name()='legal-statement']">
2829
+ <fo:block xsl:use-attribute-sets="legal-statement-style">
2830
+ <xsl:apply-templates/>
2831
+ </fo:block>
2832
+ </xsl:template><xsl:template match="*[local-name()='legal-statement']//*[local-name()='title']">
2833
+
2834
+ <!-- process in the template 'title' -->
2835
+ <xsl:call-template name="title"/>
2836
+
2837
+
2838
+ </xsl:template><xsl:template match="*[local-name()='legal-statement']//*[local-name()='p']">
2839
+
2840
+ <!-- process in the template 'paragraph' -->
2841
+ <xsl:call-template name="paragraph"/>
2842
+
2843
+ </xsl:template><xsl:template match="*[local-name()='feedback-statement']">
2844
+ <fo:block xsl:use-attribute-sets="feedback-statement-style">
2845
+ <xsl:apply-templates/>
2846
+ </fo:block>
2847
+ </xsl:template><xsl:template match="*[local-name()='feedback-statement']//*[local-name()='title']">
2848
+
2849
+ <!-- process in the template 'title' -->
2850
+ <xsl:call-template name="title"/>
2851
+
2852
+ </xsl:template><xsl:template match="*[local-name()='feedback-statement']//*[local-name()='p']">
2853
+
2854
+ <fo:block xsl:use-attribute-sets="feedback-statement-p-style">
2855
+ <xsl:apply-templates/>
2856
+ </fo:block>
2857
+
2721
2858
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
2722
2859
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
2723
2860
  <xsl:call-template name="add-zero-spaces-java"/>
@@ -2867,7 +3004,7 @@
2867
3004
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2868
3005
  </xsl:when>
2869
3006
  <xsl:otherwise>
2870
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3007
+ <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 -->
2871
3008
  </xsl:otherwise>
2872
3009
  </xsl:choose>
2873
3010
 
@@ -3081,7 +3218,7 @@
3081
3218
 
3082
3219
  <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
3083
3220
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
3084
- </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
3221
+ </xsl:template><xsl:template match="*[local-name()='thead']">
3085
3222
  <xsl:param name="cols-count"/>
3086
3223
  <fo:table-header>
3087
3224
 
@@ -3106,13 +3243,13 @@
3106
3243
  <fo:table-body>
3107
3244
  <xsl:apply-templates/>
3108
3245
  </fo:table-body>
3109
- </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
3246
+ </xsl:template><xsl:template match="*[local-name()='tfoot']">
3110
3247
  <xsl:apply-templates/>
3111
3248
  </xsl:template><xsl:template name="insertTableFooter">
3112
3249
  <xsl:param name="cols-count"/>
3113
3250
  <xsl:if test="../*[local-name()='tfoot']">
3114
3251
  <fo:table-footer>
3115
- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
3252
+ <xsl:apply-templates select="../*[local-name()='tfoot']"/>
3116
3253
  </fo:table-footer>
3117
3254
  </xsl:if>
3118
3255
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
@@ -3198,7 +3335,7 @@
3198
3335
 
3199
3336
  <!-- except gb and bsi -->
3200
3337
 
3201
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
3338
+ <xsl:apply-templates select="../*[local-name()='note']"/>
3202
3339
 
3203
3340
 
3204
3341
 
@@ -3236,7 +3373,7 @@
3236
3373
 
3237
3374
 
3238
3375
 
3239
- <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
3376
+ <xsl:apply-templates select="../*[local-name()='thead']">
3240
3377
  <xsl:with-param name="cols-count" select="$cols-count"/>
3241
3378
  </xsl:apply-templates>
3242
3379
 
@@ -3383,7 +3520,7 @@
3383
3520
  <xsl:apply-templates/>
3384
3521
  </fo:block>
3385
3522
  </fo:table-cell>
3386
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
3523
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2">
3387
3524
 
3388
3525
  <fo:block xsl:use-attribute-sets="table-note-style">
3389
3526
 
@@ -3406,10 +3543,10 @@
3406
3543
 
3407
3544
 
3408
3545
 
3409
- <xsl:apply-templates select="node()[not(local-name() = 'name')]" mode="process"/>
3546
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3410
3547
  </fo:block>
3411
3548
 
3412
- </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">
3549
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" priority="2">
3413
3550
  <xsl:apply-templates/>
3414
3551
  </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">
3415
3552
 
@@ -3949,7 +4086,9 @@
3949
4086
  </td>
3950
4087
  <td>
3951
4088
 
3952
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
4089
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
4090
+ <xsl:with-param name="process">true</xsl:with-param>
4091
+ </xsl:apply-templates>
3953
4092
 
3954
4093
  </td>
3955
4094
  </tr>
@@ -3976,15 +4115,20 @@
3976
4115
  <fo:block>
3977
4116
 
3978
4117
 
3979
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
4118
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
4119
+ <xsl:with-param name="process">true</xsl:with-param>
4120
+ </xsl:apply-templates>
3980
4121
  </fo:block>
3981
4122
  </fo:table-cell>
3982
4123
  </fo:table-row>
3983
4124
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
3984
4125
  <xsl:apply-templates/>
3985
- </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
3986
- <xsl:apply-templates select="@language"/>
3987
- <xsl:apply-templates/>
4126
+ </xsl:template><xsl:template match="*[local-name()='dd']">
4127
+ <xsl:param name="process">false</xsl:param>
4128
+ <xsl:if test="$process = 'true'">
4129
+ <xsl:apply-templates select="@language"/>
4130
+ <xsl:apply-templates/>
4131
+ </xsl:if>
3988
4132
  </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
3989
4133
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
3990
4134
  </xsl:template><xsl:template match="*[local-name()='em']">
@@ -4159,7 +4303,11 @@
4159
4303
  <xsl:with-param name="text" select="substring($text,2)"/>
4160
4304
  </xsl:call-template>
4161
4305
  </xsl:if>
4162
- </xsl:template><xsl:template name="tokenize">
4306
+ </xsl:template><xsl:template match="*[local-name() = 'pagebreak']">
4307
+ <fo:block break-after="page"/>
4308
+ <fo:block> </fo:block>
4309
+ <fo:block break-after="page"/>
4310
+ </xsl:template><xsl:template name="tokenize">
4163
4311
  <xsl:param name="text"/>
4164
4312
  <xsl:param name="separator" select="' '"/>
4165
4313
  <xsl:choose>
@@ -4591,10 +4739,10 @@
4591
4739
  </fo:inline>
4592
4740
  </xsl:template><xsl:template match="*[local-name()='appendix']">
4593
4741
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
4594
- <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
4742
+ <xsl:apply-templates select="*[local-name()='title']"/>
4595
4743
  </fo:block>
4596
- <xsl:apply-templates/>
4597
- </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
4744
+ <xsl:apply-templates select="node()[not(local-name()='title')]"/>
4745
+ </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" priority="2">
4598
4746
  <xsl:variable name="level">
4599
4747
  <xsl:call-template name="getLevel"/>
4600
4748
  </xsl:variable>
@@ -5222,7 +5370,7 @@
5222
5370
  <xsl:value-of select="."/>
5223
5371
  </xsl:template><xsl:template match="node()" mode="contents">
5224
5372
  <xsl:apply-templates mode="contents"/>
5225
- </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="2" mode="contents">
5373
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" mode="contents">
5226
5374
  <xsl:variable name="level">
5227
5375
  <xsl:call-template name="getLevel">
5228
5376
  <xsl:with-param name="depth" select="@depth"/>
@@ -5230,10 +5378,15 @@
5230
5378
  </xsl:variable>
5231
5379
 
5232
5380
  <xsl:variable name="section">
5233
- <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
5381
+ <xsl:choose>
5382
+ <xsl:when test="@type = 'section-title'"/>
5383
+ <xsl:otherwise>
5384
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
5385
+ </xsl:otherwise>
5386
+ </xsl:choose>
5234
5387
  </xsl:variable>
5235
5388
 
5236
- <xsl:variable name="type">floating-title</xsl:variable>
5389
+ <xsl:variable name="type"><xsl:value-of select="@type"/></xsl:variable>
5237
5390
 
5238
5391
  <xsl:variable name="display">
5239
5392
  <xsl:choose>
@@ -5250,7 +5403,16 @@
5250
5403
  <xsl:variable name="title">
5251
5404
  <xsl:choose>
5252
5405
  <xsl:when test="*[local-name() = 'tab']">
5253
- <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
5406
+ <xsl:choose>
5407
+ <xsl:when test="@type = 'section-title'">
5408
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
5409
+ <xsl:text>: </xsl:text>
5410
+ <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
5411
+ </xsl:when>
5412
+ <xsl:otherwise>
5413
+ <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
5414
+ </xsl:otherwise>
5415
+ </xsl:choose>
5254
5416
  </xsl:when>
5255
5417
  <xsl:otherwise>
5256
5418
  <xsl:copy-of select="node()"/>
@@ -7035,7 +7197,7 @@
7035
7197
  </fo:inline>
7036
7198
  </xsl:template><xsl:template match="@language">
7037
7199
  <xsl:copy-of select="."/>
7038
- </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="4">
7200
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="4">
7039
7201
  <xsl:call-template name="title"/>
7040
7202
  </xsl:template><xsl:template match="*[local-name() = 'admonition']">
7041
7203
 
@@ -7100,27 +7262,17 @@
7100
7262
  <xsl:variable name="month" select="substring($date, 6, 2)"/>
7101
7263
  <xsl:variable name="day" select="substring($date, 9, 2)"/>
7102
7264
  <xsl:variable name="monthStr">
7103
- <xsl:choose>
7104
- <xsl:when test="$month = '01'">january</xsl:when>
7105
- <xsl:when test="$month = '02'">february</xsl:when>
7106
- <xsl:when test="$month = '03'">march</xsl:when>
7107
- <xsl:when test="$month = '04'">april</xsl:when>
7108
- <xsl:when test="$month = '05'">may</xsl:when>
7109
- <xsl:when test="$month = '06'">june</xsl:when>
7110
- <xsl:when test="$month = '07'">july</xsl:when>
7111
- <xsl:when test="$month = '08'">august</xsl:when>
7112
- <xsl:when test="$month = '09'">september</xsl:when>
7113
- <xsl:when test="$month = '10'">october</xsl:when>
7114
- <xsl:when test="$month = '11'">november</xsl:when>
7115
- <xsl:when test="$month = '12'">december</xsl:when>
7116
- </xsl:choose>
7265
+ <xsl:call-template name="getMonthByNum">
7266
+ <xsl:with-param name="num" select="$month"/>
7267
+ <xsl:with-param name="lowercase" select="'true'"/>
7268
+ </xsl:call-template>
7117
7269
  </xsl:variable>
7118
7270
  <xsl:variable name="monthStr_localized">
7119
7271
  <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>
7120
7272
  </xsl:variable>
7121
7273
  <xsl:variable name="result">
7122
7274
  <xsl:choose>
7123
- <xsl:when test="$format = 'ddMMyyyy'">
7275
+ <xsl:when test="$format = 'ddMMyyyy'"> <!-- convert date from format 2007-04-01 to 1 April 2007 -->
7124
7276
  <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
7125
7277
  <xsl:text> </xsl:text>
7126
7278
  <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ' , $year))"/>
@@ -7133,11 +7285,57 @@
7133
7285
  <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $year))"/>
7134
7286
  </xsl:when>
7135
7287
  <xsl:otherwise>
7136
- <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $day, ', ' , $year))"/>
7288
+ <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $day, ', ' , $year))"/> <!-- January 01, 2022 -->
7137
7289
  </xsl:otherwise>
7138
7290
  </xsl:choose>
7139
7291
  </xsl:variable>
7140
7292
  <xsl:value-of select="$result"/>
7293
+ </xsl:template><xsl:template name="getMonthByNum">
7294
+ <xsl:param name="num"/>
7295
+ <xsl:param name="lang">en</xsl:param>
7296
+ <xsl:param name="lowercase">false</xsl:param> <!-- return 'january' instead of 'January' -->
7297
+ <xsl:variable name="monthStr_">
7298
+ <xsl:choose>
7299
+ <xsl:when test="$lang = 'fr'">
7300
+ <xsl:choose>
7301
+ <xsl:when test="$num = '01'">Janvier</xsl:when>
7302
+ <xsl:when test="$num = '02'">Février</xsl:when>
7303
+ <xsl:when test="$num = '03'">Mars</xsl:when>
7304
+ <xsl:when test="$num = '04'">Avril</xsl:when>
7305
+ <xsl:when test="$num = '05'">Mai</xsl:when>
7306
+ <xsl:when test="$num = '06'">Juin</xsl:when>
7307
+ <xsl:when test="$num = '07'">Juillet</xsl:when>
7308
+ <xsl:when test="$num = '08'">Août</xsl:when>
7309
+ <xsl:when test="$num = '09'">Septembre</xsl:when>
7310
+ <xsl:when test="$num = '10'">Octobre</xsl:when>
7311
+ <xsl:when test="$num = '11'">Novembre</xsl:when>
7312
+ <xsl:when test="$num = '12'">Décembre</xsl:when>
7313
+ </xsl:choose>
7314
+ </xsl:when>
7315
+ <xsl:otherwise>
7316
+ <xsl:choose>
7317
+ <xsl:when test="$num = '01'">January</xsl:when>
7318
+ <xsl:when test="$num = '02'">February</xsl:when>
7319
+ <xsl:when test="$num = '03'">March</xsl:when>
7320
+ <xsl:when test="$num = '04'">April</xsl:when>
7321
+ <xsl:when test="$num = '05'">May</xsl:when>
7322
+ <xsl:when test="$num = '06'">June</xsl:when>
7323
+ <xsl:when test="$num = '07'">July</xsl:when>
7324
+ <xsl:when test="$num = '08'">August</xsl:when>
7325
+ <xsl:when test="$num = '09'">September</xsl:when>
7326
+ <xsl:when test="$num = '10'">October</xsl:when>
7327
+ <xsl:when test="$num = '11'">November</xsl:when>
7328
+ <xsl:when test="$num = '12'">December</xsl:when>
7329
+ </xsl:choose>
7330
+ </xsl:otherwise>
7331
+ </xsl:choose>
7332
+ </xsl:variable>
7333
+ <xsl:choose>
7334
+ <xsl:when test="normalize-space($lowercase) = 'true'">
7335
+ <xsl:value-of select="java:toLowerCase(java:java.lang.String.new($monthStr_))"/>
7336
+ </xsl:when>
7337
+ <xsl:otherwise><xsl:value-of select="$monthStr_"/></xsl:otherwise>
7338
+ </xsl:choose>
7141
7339
  </xsl:template><xsl:template name="insertKeywords">
7142
7340
  <xsl:param name="sorting" select="'true'"/>
7143
7341
  <xsl:param name="charAtEnd" select="'.'"/>
@@ -7598,6 +7796,25 @@
7598
7796
  </xsl:otherwise>
7599
7797
  </xsl:choose>
7600
7798
  </xsl:if>
7799
+ </xsl:template><xsl:template name="number-to-ordinal">
7800
+ <xsl:param name="number"/>
7801
+ <xsl:param name="curr_lang"/>
7802
+ <xsl:choose>
7803
+ <xsl:when test="$curr_lang = 'fr'">
7804
+ <xsl:choose>
7805
+ <xsl:when test="$number = '1'">re</xsl:when>
7806
+ <xsl:otherwise>e</xsl:otherwise>
7807
+ </xsl:choose>
7808
+ </xsl:when>
7809
+ <xsl:otherwise>
7810
+ <xsl:choose>
7811
+ <xsl:when test="$number = 1">st</xsl:when>
7812
+ <xsl:when test="$number = 2">nd</xsl:when>
7813
+ <xsl:when test="$number = 3">rd</xsl:when>
7814
+ <xsl:otherwise>th</xsl:otherwise>
7815
+ </xsl:choose>
7816
+ </xsl:otherwise>
7817
+ </xsl:choose>
7601
7818
  </xsl:template><xsl:template name="setAltText">
7602
7819
  <xsl:param name="value"/>
7603
7820
  <xsl:attribute name="fox:alt-text">