metanorma-iho 0.5.2 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,11 +2,6 @@
2
2
 
3
3
  <xsl:output method="xml" encoding="UTF-8" indent="no"/>
4
4
 
5
- <xsl:param name="svg_images"/>
6
- <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
7
- <xsl:variable name="images" select="document($svg_images)"/>
8
- <xsl:param name="basepath"/>
9
-
10
5
 
11
6
 
12
7
  <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"/>
@@ -15,30 +10,25 @@
15
10
 
16
11
  <xsl:variable name="debug">false</xsl:variable>
17
12
 
18
- <xsl:variable name="marginLeftRight1" select="25.4"/>
19
- <xsl:variable name="marginLeftRight2" select="25.4"/>
20
- <xsl:variable name="marginTop" select="25.4"/>
21
- <xsl:variable name="marginBottom" select="25.4"/>
22
-
23
-
13
+
24
14
  <xsl:variable name="title-en" select="/iho:iho-standard/iho:bibdata/iho:title[@language = 'en']"/>
25
15
  <xsl:variable name="docidentifier" select="/iho:iho-standard/iho:bibdata/iho:docidentifier[@type = 'IHO']"/>
26
16
  <xsl:variable name="copyrightText" select="concat('© International Hydrographic Association ', /iho:iho-standard/iho:bibdata/iho:copyright/iho:from ,' – All rights reserved')"/>
27
17
 
28
- <xsl:variable name="lang">
29
- <xsl:call-template name="getLang"/>
30
- </xsl:variable>
31
18
 
32
19
  <!-- Example:
33
20
  <item level="1" id="Foreword" display="true">Foreword</item>
34
21
  <item id="term-script" display="false">3.2</item>
35
22
  -->
36
- <xsl:variable name="contents">
23
+ <xsl:variable name="contents_">
37
24
  <contents>
38
25
  <xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
39
- <xsl:call-template name="processMainSectionsDefault_Contents"/>
26
+ <xsl:call-template name="processMainSectionsDefault_Contents"/>
27
+
28
+ <xsl:call-template name="processTablesFigures_Contents"/>
40
29
  </contents>
41
30
  </xsl:variable>
31
+ <xsl:variable name="contents" select="xalan:nodeset($contents_)"/>
42
32
 
43
33
  <xsl:template match="/">
44
34
 
@@ -225,11 +215,11 @@
225
215
  <xsl:if test="$debug = 'true'">
226
216
  <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
227
217
  DEBUG
228
- contents=<xsl:copy-of select="xalan:nodeset($contents)"/>
218
+ contents=<xsl:copy-of select="$contents"/>
229
219
  <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
230
220
  </xsl:if>
231
221
 
232
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
222
+ <xsl:for-each select="$contents//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
233
223
  <fo:block role="TOCI">
234
224
  <xsl:if test="@level = 1">
235
225
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -269,6 +259,27 @@
269
259
  </fo:block>
270
260
 
271
261
  </xsl:for-each>
262
+
263
+ <!-- List of Tables -->
264
+ <xsl:if test="$contents//tables/table">
265
+ <xsl:call-template name="insertListOf_Title">
266
+ <xsl:with-param name="title" select="$title-list-tables"/>
267
+ </xsl:call-template>
268
+ <xsl:for-each select="$contents//tables/table">
269
+ <xsl:call-template name="insertListOf_Item"/>
270
+ </xsl:for-each>
271
+ </xsl:if>
272
+
273
+ <!-- List of Figures -->
274
+ <xsl:if test="$contents//figures/figure">
275
+ <xsl:call-template name="insertListOf_Title">
276
+ <xsl:with-param name="title" select="$title-list-figures"/>
277
+ </xsl:call-template>
278
+ <xsl:for-each select="$contents//figures/figure">
279
+ <xsl:call-template name="insertListOf_Item"/>
280
+ </xsl:for-each>
281
+ </xsl:if>
282
+
272
283
  </fo:block>
273
284
  </fo:block-container>
274
285
  </fo:block-container>
@@ -358,6 +369,28 @@
358
369
 
359
370
  </xsl:template>
360
371
 
372
+ <xsl:template name="insertListOf_Title">
373
+ <xsl:param name="title"/>
374
+ <fo:block role="TOCI" font-weight="bold" margin-top="6pt" keep-with-next="always">
375
+ <xsl:value-of select="$title"/>
376
+ </fo:block>
377
+ </xsl:template>
378
+
379
+ <xsl:template name="insertListOf_Item">
380
+ <fo:block role="TOCI" text-align-last="justify" margin-left="12mm" text-indent="-12mm">
381
+ <fo:basic-link internal-destination="{@id}">
382
+ <xsl:call-template name="setAltText">
383
+ <xsl:with-param name="value" select="@alt-text"/>
384
+ </xsl:call-template>
385
+ <xsl:apply-templates select="." mode="contents"/>
386
+ <fo:inline keep-together.within-line="always">
387
+ <fo:leader font-size="9pt" font-weight="normal" leader-pattern="dots"/>
388
+ <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
389
+ </fo:inline>
390
+ </fo:basic-link>
391
+ </fo:block>
392
+ </xsl:template>
393
+
361
394
  <!-- ============================= -->
362
395
  <!-- CONTENTS -->
363
396
  <!-- ============================= -->
@@ -573,38 +606,13 @@
573
606
  <xsl:apply-templates/>
574
607
  </xsl:template>
575
608
 
576
-
577
- <xsl:template match="iho:ul | iho:ol" mode="ul_ol">
578
- <fo:list-block provisional-distance-between-starts="6mm">
579
- <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
580
- </fo:list-block>
581
- <xsl:for-each select="./iho:note">
582
- <xsl:call-template name="note"/>
583
- </xsl:for-each>
584
- </xsl:template>
585
-
609
+ <!-- note in list item -->
586
610
  <xsl:template match="iho:ul//iho:note | iho:ol//iho:note" priority="2">
587
611
  <fo:block id="{@id}">
588
612
  <xsl:apply-templates/>
589
613
  </fo:block>
590
614
  </xsl:template>
591
615
 
592
-
593
- <xsl:template match="iho:li">
594
- <fo:list-item id="{@id}" margin-bottom="12pt">
595
- <fo:list-item-label end-indent="label-end()">
596
- <fo:block line-height="115%">
597
- <xsl:call-template name="getListItemFormat"/>
598
- </fo:block>
599
- </fo:list-item-label>
600
- <fo:list-item-body start-indent="body-start()">
601
- <fo:block>
602
- <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
603
- <xsl:apply-templates select=".//iho:note"/>
604
- </fo:block>
605
- </fo:list-item-body>
606
- </fo:list-item>
607
- </xsl:template>
608
616
 
609
617
  <xsl:template match="iho:li//iho:p//text()">
610
618
  <xsl:choose>
@@ -618,13 +626,6 @@
618
626
  </xsl:template>
619
627
 
620
628
 
621
- <xsl:template match="iho:formula/iho:stem">
622
- <fo:block margin-top="6pt" margin-bottom="12pt" text-align="center">
623
- <xsl:apply-templates/>
624
- </fo:block>
625
- </xsl:template>
626
-
627
-
628
629
 
629
630
  <xsl:template match="iho:example/iho:p" priority="2">
630
631
  <fo:block-container xsl:use-attribute-sets="example-p-style">
@@ -645,23 +646,6 @@
645
646
  <!-- https://github.com/metanorma/mn-native-pdf/issues/214 -->
646
647
  <xsl:template match="iho:index"/>
647
648
 
648
-
649
- <xsl:template match="iho:preferred">
650
- <xsl:variable name="levelTerm">
651
- <xsl:call-template name="getLevelTermName"/>
652
- </xsl:variable>
653
- <fo:block line-height="1.1" role="H{$levelTerm}">
654
- <fo:block font-weight="bold" keep-with-next="always">
655
- <xsl:apply-templates select="ancestor::iho:term[1]/iho:name"/>
656
- </fo:block>
657
- <fo:block font-weight="bold" keep-with-next="always">
658
- <xsl:call-template name="setStyle_preferred"/>
659
- <xsl:apply-templates/>
660
- </fo:block>
661
- </fo:block>
662
- </xsl:template>
663
-
664
-
665
649
 
666
650
 
667
651
  <xsl:template name="insertHeaderFooter">
@@ -709,27 +693,6 @@
709
693
  </xsl:template>
710
694
 
711
695
 
712
- <xsl:template name="getListItemFormat">
713
- <xsl:choose>
714
- <xsl:when test="local-name(..) = 'ul'">
715
- <xsl:call-template name="setULLabel"/>
716
- </xsl:when>
717
- <xsl:otherwise> <!-- for ordered lists -->
718
- <xsl:choose>
719
- <xsl:when test="../@type = 'arabic'">
720
- <xsl:number format="a)" lang="en"/>
721
- </xsl:when>
722
- <xsl:when test="../@type = 'alphabet'">
723
- <xsl:number format="a)" lang="en"/>
724
- </xsl:when>
725
- <xsl:otherwise>
726
- <xsl:number format="1."/>
727
- </xsl:otherwise>
728
- </xsl:choose>
729
- </xsl:otherwise>
730
- </xsl:choose>
731
- </xsl:template>
732
-
733
696
  <xsl:template match="@*|node()" mode="step2">
734
697
  <xsl:copy>
735
698
  <xsl:apply-templates select="@*|node()" mode="step2"/>
@@ -806,11 +769,21 @@
806
769
  <xsl:text>iVBORw0KGgoAAAANSUhEUgAAAN8AAADfCAIAAAD5m5F7AAAAAXNSR0IArs4c6QAAAAlwSFlzAAAh1QAAIdUBBJy0nQAAPjlJREFUeAHtXQdAFEcX5qhH772IgIAgxYLYFRV7773EEjWWaKImplmS2BKT2BVjr9hFxN4bghRBpYn03nvn//aWW5cDkagcd//NxXB7uzNv3rz3zZs37S2noryoqqJQSoojRT5EAiImAdmqiqKyklSCThHTC2GHkoAsTwwwnMR2EkCInASkRY4jwhCRAF8CBJ18SZBv0ZMAQafo6YRwxJcAQSdfEuRb9CRA0Cl6OiEc8SVA0MmXBPkWPQkQdIqeTghHfAkQdPIlQb5FTwIEnaKnE8IRXwIEnXxJkG/RkwBBp+jphHDElwBBJ18S5Fv0JEDQKXo6IRzxJUDQyZcE+RY9CRB0ip5OCEd8CRB08iVBvkVPAgSdoqcTwhFfAgSdfEmQb9GTAEGn6OmEcMSXAEEnXxLkW/QkQNApejohHPElQNDJlwT5Fj0JEHSKnk4IR3wJEHTyJUG+RU8CBJ2ipxPCEV8CBJ18SZBv0ZMAQafo6YRwxJcAQSdfEuRb9CRA0Cl6OiEc8SVA0MmXBPkWPQkQdIqeTghHfAkQdPIlQb5FTwIEnaKnE8IRXwIEnXxJkG/RkwBBp+jphHDElwBBJ18S5Fv0JEDQKXo6IRzxJUDQyZcE+RY9CRB0ip5OCEd8CRB08iVBvkVPAgSdoqcTwhFfAgSdfEmQb9GTAEGn6OmEcMSXAEEnXxLkW/QkQNApejohHPElQNDJlwT5Fj0JEHSKnk4IR3wJEHTyJUG+RU8CBJ2ipxPCEV8CBJ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">
772
+ <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:key name="bibitems" match="*[local-name() = 'bibitem']" use="@id"/><xsl:key name="bibitems_hidden" match="*[local-name() = 'bibitem'][@hidden='true'] | *[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']" use="@id"/><xsl:variable name="lang">
773
+ <xsl:call-template name="getLang"/>
774
+ </xsl:variable><xsl:variable name="pageWidth_">
810
775
  210
811
776
  </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_">
812
777
  297
813
- </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="titles_">
778
+ </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="marginLeftRight1_">
779
+ 25.4
780
+ </xsl:variable><xsl:variable name="marginLeftRight1" select="normalize-space($marginLeftRight1_)"/><xsl:variable name="marginLeftRight2_">
781
+ 25.4
782
+ </xsl:variable><xsl:variable name="marginLeftRight2" select="normalize-space($marginLeftRight2_)"/><xsl:variable name="marginTop_">
783
+ 25.4
784
+ </xsl:variable><xsl:variable name="marginTop" select="normalize-space($marginTop_)"/><xsl:variable name="marginBottom_">
785
+ 25.4
786
+ </xsl:variable><xsl:variable name="marginBottom" select="normalize-space($marginBottom_)"/><xsl:variable name="titles_">
814
787
 
815
788
  <title-edition lang="en">
816
789
 
@@ -822,6 +795,10 @@
822
795
  <xsl:text>Édition </xsl:text>
823
796
  </title-edition>
824
797
 
798
+ <title-edition lang="ru">
799
+ <xsl:text>Издание </xsl:text>
800
+ </title-edition>
801
+
825
802
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
826
803
  <title-toc lang="en">
827
804
 
@@ -838,7 +815,7 @@
838
815
  <xsl:text>Contents</xsl:text>
839
816
 
840
817
  </title-toc>
841
-
818
+
842
819
  <title-descriptors lang="en">Descriptors</title-descriptors>
843
820
 
844
821
  <title-part lang="en">
@@ -850,7 +827,11 @@
850
827
 
851
828
 
852
829
 
853
- </title-part>
830
+ </title-part>
831
+ <title-part lang="ru">
832
+
833
+
834
+ </title-part>
854
835
  <title-part lang="zh">第 # 部分:</title-part>
855
836
 
856
837
  <title-subpart lang="en">Sub-part #</title-subpart>
@@ -866,13 +847,38 @@
866
847
 
867
848
  <title-summary lang="en">Summary</title-summary>
868
849
 
850
+ <title-continued lang="ru">(продолжение)</title-continued>
869
851
  <title-continued lang="en">(continued)</title-continued>
870
852
  <title-continued lang="fr">(continué)</title-continued>
871
853
 
872
- </xsl:variable><xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="bibdata">
854
+ </xsl:variable><xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="title-list-tables">
855
+ <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
856
+ <xsl:value-of select="$toc_table_title"/>
857
+ <xsl:if test="normalize-space($toc_table_title) = ''">
858
+ <xsl:call-template name="getTitle">
859
+ <xsl:with-param name="name" select="'title-list-tables'"/>
860
+ </xsl:call-template>
861
+ </xsl:if>
862
+ </xsl:variable><xsl:variable name="title-list-figures">
863
+ <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
864
+ <xsl:value-of select="$toc_figure_title"/>
865
+ <xsl:if test="normalize-space($toc_figure_title) = ''">
866
+ <xsl:call-template name="getTitle">
867
+ <xsl:with-param name="name" select="'title-list-figures'"/>
868
+ </xsl:call-template>
869
+ </xsl:if>
870
+ </xsl:variable><xsl:variable name="title-list-recommendations">
871
+ <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
872
+ <xsl:value-of select="$toc_requirement_title"/>
873
+ <xsl:if test="normalize-space($toc_requirement_title) = ''">
874
+ <xsl:call-template name="getTitle">
875
+ <xsl:with-param name="name" select="'title-list-recommendations'"/>
876
+ </xsl:call-template>
877
+ </xsl:if>
878
+ </xsl:variable><xsl:variable name="bibdata">
873
879
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
874
880
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
875
- </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
881
+ </xsl:variable><xsl:variable name="linebreak">&#8232;</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:variable name="non_breaking_hyphen">‑</xsl:variable><xsl:variable name="thin_space"> </xsl:variable><xsl:variable name="zero_width_space">​</xsl:variable><xsl:variable name="en_dash">–</xsl:variable><xsl:template name="getTitle">
876
882
  <xsl:param name="name"/>
877
883
  <xsl:param name="lang"/>
878
884
  <xsl:variable name="lang_">
@@ -895,7 +901,7 @@
895
901
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
896
902
  </xsl:otherwise>
897
903
  </xsl:choose>
898
- </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="root-style">
904
+ </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:attribute-set name="root-style">
899
905
 
900
906
 
901
907
 
@@ -1063,12 +1069,13 @@
1063
1069
 
1064
1070
 
1065
1071
  </xsl:attribute-set><xsl:attribute-set name="example-name-style">
1066
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
1067
1072
 
1068
1073
 
1069
1074
 
1070
1075
 
1071
1076
 
1077
+
1078
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1072
1079
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1073
1080
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1074
1081
 
@@ -1442,7 +1449,8 @@
1442
1449
 
1443
1450
 
1444
1451
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1445
- <xsl:attribute name="role">BlockQuote</xsl:attribute>
1452
+ <xsl:attribute name="margin-left">12mm</xsl:attribute>
1453
+ <xsl:attribute name="margin-right">12mm</xsl:attribute>
1446
1454
 
1447
1455
 
1448
1456
 
@@ -1454,10 +1462,8 @@
1454
1462
 
1455
1463
 
1456
1464
  </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
1465
+ <xsl:attribute name="text-align">right</xsl:attribute>
1457
1466
 
1458
-
1459
- <xsl:attribute name="text-align">right</xsl:attribute>
1460
-
1461
1467
 
1462
1468
  </xsl:attribute-set><xsl:attribute-set name="termsource-style">
1463
1469
 
@@ -1484,6 +1490,9 @@
1484
1490
 
1485
1491
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
1486
1492
 
1493
+ </xsl:attribute-set><xsl:attribute-set name="term-name-style">
1494
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1495
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1487
1496
  </xsl:attribute-set><xsl:attribute-set name="figure-style">
1488
1497
 
1489
1498
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
@@ -1515,6 +1524,33 @@
1515
1524
 
1516
1525
 
1517
1526
  </xsl:attribute-set><xsl:attribute-set name="formula-style">
1527
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1528
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1529
+
1530
+
1531
+
1532
+
1533
+
1534
+
1535
+ </xsl:attribute-set><xsl:attribute-set name="formula-stem-block-style">
1536
+ <xsl:attribute name="text-align">center</xsl:attribute>
1537
+
1538
+
1539
+
1540
+
1541
+
1542
+
1543
+
1544
+
1545
+
1546
+
1547
+
1548
+ </xsl:attribute-set><xsl:attribute-set name="formula-stem-number-style">
1549
+ <xsl:attribute name="text-align">right</xsl:attribute>
1550
+
1551
+
1552
+
1553
+
1518
1554
 
1519
1555
  </xsl:attribute-set><xsl:attribute-set name="image-style">
1520
1556
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -1550,6 +1586,20 @@
1550
1586
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1551
1587
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1552
1588
 
1589
+ </xsl:attribute-set><xsl:attribute-set name="preferred-block-style">
1590
+
1591
+
1592
+
1593
+ <xsl:attribute name="line-height">1.1</xsl:attribute>
1594
+
1595
+
1596
+
1597
+
1598
+ </xsl:attribute-set><xsl:attribute-set name="preferred-term-style">
1599
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1600
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1601
+
1602
+
1553
1603
  </xsl:attribute-set><xsl:attribute-set name="domain-style">
1554
1604
 
1555
1605
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
@@ -1568,13 +1618,19 @@
1568
1618
  </xsl:attribute-set><xsl:variable name="color-added-text">
1569
1619
  <xsl:text>rgb(0, 255, 0)</xsl:text>
1570
1620
  </xsl:variable><xsl:attribute-set name="add-style">
1571
- <xsl:attribute name="color">red</xsl:attribute>
1572
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1573
- <!-- <xsl:attribute name="color">black</xsl:attribute>
1574
- <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
1575
- <xsl:attribute name="padding-top">1mm</xsl:attribute>
1576
- <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
1577
- </xsl:attribute-set><xsl:variable name="color-deleted-text">
1621
+
1622
+ <xsl:attribute name="color">red</xsl:attribute>
1623
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1624
+ <!-- <xsl:attribute name="color">black</xsl:attribute>
1625
+ <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
1626
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
1627
+ <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
1628
+
1629
+ </xsl:attribute-set><xsl:variable name="add-style">
1630
+ <add-style xsl:use-attribute-sets="add-style"/>
1631
+ </xsl:variable><xsl:template name="append_add-style">
1632
+ <xsl:copy-of select="xalan:nodeset($add-style)/add-style/@*"/>
1633
+ </xsl:template><xsl:variable name="color-deleted-text">
1578
1634
  <xsl:text>red</xsl:text>
1579
1635
  </xsl:variable><xsl:attribute-set name="del-style">
1580
1636
  <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
@@ -1585,6 +1641,39 @@
1585
1641
 
1586
1642
  </xsl:attribute-set><xsl:attribute-set name="list-style">
1587
1643
 
1644
+
1645
+
1646
+
1647
+
1648
+
1649
+ <xsl:attribute name="provisional-distance-between-starts">6mm</xsl:attribute>
1650
+
1651
+
1652
+
1653
+
1654
+
1655
+
1656
+
1657
+
1658
+
1659
+
1660
+
1661
+
1662
+ </xsl:attribute-set><xsl:attribute-set name="list-item-style">
1663
+
1664
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1665
+
1666
+
1667
+ </xsl:attribute-set><xsl:attribute-set name="list-item-label-style">
1668
+
1669
+ <xsl:attribute name="line-height">115%</xsl:attribute>
1670
+
1671
+
1672
+
1673
+ </xsl:attribute-set><xsl:attribute-set name="list-item-body-style">
1674
+
1675
+
1676
+
1588
1677
  </xsl:attribute-set><xsl:attribute-set name="toc-style">
1589
1678
  <xsl:attribute name="line-height">135%</xsl:attribute>
1590
1679
  </xsl:attribute-set><xsl:attribute-set name="fn-reference-style">
@@ -1869,15 +1958,148 @@
1869
1958
 
1870
1959
 
1871
1960
 
1961
+ </xsl:attribute-set><xsl:attribute-set name="hljs-doctag">
1962
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
1963
+ </xsl:attribute-set><xsl:attribute-set name="hljs-keyword">
1964
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
1965
+ </xsl:attribute-set><xsl:attribute-set name="hljs-meta_hljs-keyword">
1966
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
1967
+ </xsl:attribute-set><xsl:attribute-set name="hljs-template-tag">
1968
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
1969
+ </xsl:attribute-set><xsl:attribute-set name="hljs-template-variable">
1970
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
1971
+ </xsl:attribute-set><xsl:attribute-set name="hljs-type">
1972
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
1973
+ </xsl:attribute-set><xsl:attribute-set name="hljs-variable_and_language_">
1974
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
1975
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title">
1976
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
1977
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_class_">
1978
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
1979
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_class__and_inherited__">
1980
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
1981
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_function_">
1982
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
1983
+ </xsl:attribute-set><xsl:attribute-set name="hljs-attr">
1984
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
1985
+ </xsl:attribute-set><xsl:attribute-set name="hljs-attribute">
1986
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
1987
+ </xsl:attribute-set><xsl:attribute-set name="hljs-literal">
1988
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
1989
+ </xsl:attribute-set><xsl:attribute-set name="hljs-meta">
1990
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
1991
+ </xsl:attribute-set><xsl:attribute-set name="hljs-number">
1992
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
1993
+ </xsl:attribute-set><xsl:attribute-set name="hljs-operator">
1994
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
1995
+ </xsl:attribute-set><xsl:attribute-set name="hljs-variable">
1996
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
1997
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-attr">
1998
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
1999
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-class">
2000
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2001
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-id">
2002
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2003
+ </xsl:attribute-set><xsl:attribute-set name="hljs-regexp">
2004
+ <xsl:attribute name="color">#032f62</xsl:attribute>
2005
+ </xsl:attribute-set><xsl:attribute-set name="hljs-string">
2006
+ <xsl:attribute name="color">#032f62</xsl:attribute>
2007
+ </xsl:attribute-set><xsl:attribute-set name="hljs-meta_hljs-string">
2008
+ <xsl:attribute name="color">#032f62</xsl:attribute>
2009
+ </xsl:attribute-set><xsl:attribute-set name="hljs-built_in">
2010
+ <xsl:attribute name="color">#e36209</xsl:attribute>
2011
+ </xsl:attribute-set><xsl:attribute-set name="hljs-symbol">
2012
+ <xsl:attribute name="color">#e36209</xsl:attribute>
2013
+ </xsl:attribute-set><xsl:attribute-set name="hljs-comment">
2014
+ <xsl:attribute name="color">#6a737d</xsl:attribute>
2015
+ </xsl:attribute-set><xsl:attribute-set name="hljs-code">
2016
+ <xsl:attribute name="color">#6a737d</xsl:attribute>
2017
+ </xsl:attribute-set><xsl:attribute-set name="hljs-formula">
2018
+ <xsl:attribute name="color">#6a737d</xsl:attribute>
2019
+ </xsl:attribute-set><xsl:attribute-set name="hljs-name">
2020
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2021
+ </xsl:attribute-set><xsl:attribute-set name="hljs-quote">
2022
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2023
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-tag">
2024
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2025
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-pseudo">
2026
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2027
+ </xsl:attribute-set><xsl:attribute-set name="hljs-subst">
2028
+ <xsl:attribute name="color">#24292e</xsl:attribute>
2029
+ </xsl:attribute-set><xsl:attribute-set name="hljs-section">
2030
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2031
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2032
+ </xsl:attribute-set><xsl:attribute-set name="hljs-bullet">
2033
+ <xsl:attribute name="color">#735c0f</xsl:attribute>
2034
+ </xsl:attribute-set><xsl:attribute-set name="hljs-emphasis">
2035
+ <xsl:attribute name="color">#24292e</xsl:attribute>
2036
+ <xsl:attribute name="font-style">italic</xsl:attribute>
2037
+ </xsl:attribute-set><xsl:attribute-set name="hljs-strong">
2038
+ <xsl:attribute name="color">#24292e</xsl:attribute>
2039
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2040
+ </xsl:attribute-set><xsl:attribute-set name="hljs-addition">
2041
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2042
+ <xsl:attribute name="background-color">#f0fff4</xsl:attribute>
2043
+ </xsl:attribute-set><xsl:attribute-set name="hljs-deletion">
2044
+ <xsl:attribute name="color">#b31d28</xsl:attribute>
2045
+ <xsl:attribute name="background-color">#ffeef0</xsl:attribute>
2046
+ </xsl:attribute-set><xsl:attribute-set name="hljs-char_and_escape_">
2047
+ </xsl:attribute-set><xsl:attribute-set name="hljs-link">
2048
+ </xsl:attribute-set><xsl:attribute-set name="hljs-params">
2049
+ </xsl:attribute-set><xsl:attribute-set name="hljs-property">
2050
+ </xsl:attribute-set><xsl:attribute-set name="hljs-punctuation">
2051
+ </xsl:attribute-set><xsl:attribute-set name="hljs-tag">
2052
+ </xsl:attribute-set><xsl:attribute-set name="indexsect-title-style">
2053
+ <xsl:attribute name="role">H1</xsl:attribute>
2054
+
2055
+
2056
+
2057
+
2058
+
2059
+ </xsl:attribute-set><xsl:attribute-set name="indexsect-clause-title-style">
2060
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2061
+
2062
+
2063
+
2064
+
2065
+
1872
2066
  </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:variable name="ace_tag">ace-tag_</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
2067
+ <xsl:variable name="nodes_preface_">
2068
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
2069
+ <node id="{@id}"/>
2070
+ </xsl:for-each>
2071
+ </xsl:variable>
2072
+ <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
2073
+
1873
2074
  <xsl:for-each select="/*/*[local-name()='preface']/*">
1874
2075
  <xsl:sort select="@displayorder" data-type="number"/>
2076
+
2077
+ <!-- process Section's title -->
2078
+ <xsl:variable name="preceding-sibling_id" select="$nodes_preface/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
2079
+ <xsl:if test="$preceding-sibling_id != ''">
2080
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="contents_no_displayorder"/>
2081
+ </xsl:if>
2082
+
1875
2083
  <xsl:apply-templates select="." mode="contents"/>
1876
2084
  </xsl:for-each>
1877
2085
  </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1878
2086
 
2087
+ <xsl:variable name="nodes_sections_">
2088
+ <xsl:for-each select="/*/*[local-name()='sections']/*">
2089
+ <node id="{@id}"/>
2090
+ </xsl:for-each>
2091
+ </xsl:variable>
2092
+ <xsl:variable name="nodes_sections" select="xalan:nodeset($nodes_sections_)"/>
2093
+
1879
2094
  <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
1880
2095
  <xsl:sort select="@displayorder" data-type="number"/>
2096
+
2097
+ <!-- process Section's title -->
2098
+ <xsl:variable name="preceding-sibling_id" select="$nodes_sections/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
2099
+ <xsl:if test="$preceding-sibling_id != ''">
2100
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="contents_no_displayorder"/>
2101
+ </xsl:if>
2102
+
1881
2103
  <xsl:apply-templates select="." mode="contents"/>
1882
2104
  </xsl:for-each>
1883
2105
 
@@ -1890,6 +2112,30 @@
1890
2112
  <xsl:sort select="@displayorder" data-type="number"/>
1891
2113
  <xsl:apply-templates select="." mode="contents"/>
1892
2114
  </xsl:for-each>
2115
+ </xsl:template><xsl:template name="processTablesFigures_Contents">
2116
+ <xsl:param name="always"/>
2117
+ <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
2118
+ <xsl:call-template name="processTables_Contents"/>
2119
+ </xsl:if>
2120
+ <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
2121
+ <xsl:call-template name="processFigures_Contents"/>
2122
+ </xsl:if>
2123
+ </xsl:template><xsl:template name="processTables_Contents">
2124
+ <tables>
2125
+ <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
2126
+ <table id="{@id}" alt-text="{*[local-name() = 'name']}">
2127
+ <xsl:copy-of select="*[local-name() = 'name']"/>
2128
+ </table>
2129
+ </xsl:for-each>
2130
+ </tables>
2131
+ </xsl:template><xsl:template name="processFigures_Contents">
2132
+ <figures>
2133
+ <xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name'] and not(@unnumbered = 'true') and normalize-space(@id) != ''] | //*[@id and starts-with(*[local-name() = 'name'], 'Figure ') and normalize-space(@id) != '']">
2134
+ <figure id="{@id}" alt-text="{*[local-name() = 'name']}">
2135
+ <xsl:copy-of select="*[local-name() = 'name']"/>
2136
+ </figure>
2137
+ </xsl:for-each>
2138
+ </figures>
1893
2139
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1894
2140
  <xsl:for-each select="/*/*[local-name()='preface']/*">
1895
2141
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -1955,9 +2201,12 @@
1955
2201
 
1956
2202
 
1957
2203
  </xsl:template><xsl:template match="*[local-name()='legal-statement']//*[local-name()='p']">
2204
+ <xsl:param name="margin"/>
1958
2205
 
1959
2206
  <!-- process in the template 'paragraph' -->
1960
- <xsl:call-template name="paragraph"/>
2207
+ <xsl:call-template name="paragraph">
2208
+ <xsl:with-param name="margin" select="$margin"/>
2209
+ </xsl:call-template>
1961
2210
 
1962
2211
  </xsl:template><xsl:template match="*[local-name()='feedback-statement']">
1963
2212
  <fo:block xsl:use-attribute-sets="feedback-statement-style">
@@ -1969,9 +2218,12 @@
1969
2218
  <xsl:call-template name="title"/>
1970
2219
 
1971
2220
  </xsl:template><xsl:template match="*[local-name()='feedback-statement']//*[local-name()='p']">
2221
+ <xsl:param name="margin"/>
1972
2222
 
1973
2223
  <!-- process in the template 'paragraph' -->
1974
- <xsl:call-template name="paragraph"/>
2224
+ <xsl:call-template name="paragraph">
2225
+ <xsl:with-param name="margin" select="$margin"/>
2226
+ </xsl:call-template>
1975
2227
 
1976
2228
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1977
2229
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
@@ -2010,7 +2262,7 @@
2010
2262
  </xsl:call-template>
2011
2263
  </xsl:if>
2012
2264
  </xsl:variable>
2013
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2265
+ <!-- DEBUG colwidths=<xsl:copy-of select="$colwidths"/> -->
2014
2266
 
2015
2267
 
2016
2268
  <xsl:variable name="margin-side">
@@ -2270,7 +2522,7 @@
2270
2522
  <!-- <xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/> -->
2271
2523
  <!-- 2009 thinspace -->
2272
2524
  <!-- <xsl:with-param name="text" select="translate(normalize-space($td_text),'- —:', ' ')"/> -->
2273
- <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '', ' '))"/>
2525
+ <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
2274
2526
  </xsl:call-template>
2275
2527
  </xsl:variable>
2276
2528
  <xsl:variable name="max_length">
@@ -2311,8 +2563,7 @@
2311
2563
  </xsl:call-template>
2312
2564
  </xsl:if>
2313
2565
  </xsl:template><xsl:template match="text()" mode="td_text">
2314
- <xsl:variable name="zero-space">​</xsl:variable>
2315
- <xsl:value-of select="translate(., $zero-space, ' ')"/><xsl:text> </xsl:text>
2566
+ <xsl:value-of select="translate(., $zero_width_space, ' ')"/><xsl:text> </xsl:text>
2316
2567
  </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
2317
2568
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
2318
2569
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
@@ -2657,37 +2908,7 @@
2657
2908
 
2658
2909
  <!-- list of footnotes to calculate actual footnotes number -->
2659
2910
  <xsl:variable name="p_fn_">
2660
- <xsl:choose>
2661
- <xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
2662
- <fn gen_id="{generate-id(.)}">
2663
- <xsl:copy-of select="@*"/>
2664
- <xsl:copy-of select="node()"/>
2665
- </fn>
2666
- </xsl:when>
2667
- <xsl:otherwise>
2668
- <!-- itetation for:
2669
- footnotes in bibdata/title
2670
- footnotes in bibliography
2671
- footnotes in document's body (except table's head/body/foot and figure text)
2672
- -->
2673
- <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
2674
- <fn gen_id="{generate-id(.)}">
2675
- <xsl:copy-of select="@*"/>
2676
- <xsl:copy-of select="node()"/>
2677
- </fn>
2678
- </xsl:for-each>
2679
- <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
2680
- <xsl:sort select="@displayorder" data-type="number"/>
2681
- <xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
2682
- <!-- copy unique fn -->
2683
- <fn gen_id="{generate-id(.)}">
2684
- <xsl:copy-of select="@*"/>
2685
- <xsl:copy-of select="node()"/>
2686
- </fn>
2687
- </xsl:for-each>
2688
- </xsl:for-each>
2689
- </xsl:otherwise>
2690
- </xsl:choose>
2911
+ <xsl:call-template name="get_fn_list"/>
2691
2912
  </xsl:variable>
2692
2913
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
2693
2914
 
@@ -2748,6 +2969,38 @@
2748
2969
  <xsl:copy-of select="$footnote_inline"/>
2749
2970
  </xsl:otherwise>
2750
2971
  </xsl:choose>
2972
+ </xsl:template><xsl:template name="get_fn_list">
2973
+ <xsl:choose>
2974
+ <xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
2975
+ <fn gen_id="{generate-id(.)}">
2976
+ <xsl:copy-of select="@*"/>
2977
+ <xsl:copy-of select="node()"/>
2978
+ </fn>
2979
+ </xsl:when>
2980
+ <xsl:otherwise>
2981
+ <!-- itetation for:
2982
+ footnotes in bibdata/title
2983
+ footnotes in bibliography
2984
+ footnotes in document's body (except table's head/body/foot and figure text)
2985
+ -->
2986
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
2987
+ <fn gen_id="{generate-id(.)}">
2988
+ <xsl:copy-of select="@*"/>
2989
+ <xsl:copy-of select="node()"/>
2990
+ </fn>
2991
+ </xsl:for-each>
2992
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
2993
+ <xsl:sort select="@displayorder" data-type="number"/>
2994
+ <xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
2995
+ <!-- copy unique fn -->
2996
+ <fn gen_id="{generate-id(.)}">
2997
+ <xsl:copy-of select="@*"/>
2998
+ <xsl:copy-of select="node()"/>
2999
+ </fn>
3000
+ </xsl:for-each>
3001
+ </xsl:for-each>
3002
+ </xsl:otherwise>
3003
+ </xsl:choose>
2751
3004
  </xsl:template><xsl:template name="table_fn_display">
2752
3005
  <xsl:variable name="references">
2753
3006
 
@@ -2919,7 +3172,7 @@
2919
3172
  </fo:inline>
2920
3173
  </xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
2921
3174
  <fo:inline><xsl:value-of select="."/></fo:inline>
2922
- </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
3175
+ </xsl:template><xsl:template match="*[local-name()='fn']//*[local-name()='p']">
2923
3176
  <fo:inline>
2924
3177
  <xsl:apply-templates/>
2925
3178
  </fo:inline>
@@ -3286,20 +3539,44 @@
3286
3539
  <fo:inline text-decoration="underline">
3287
3540
  <xsl:apply-templates/>
3288
3541
  </fo:inline>
3289
- </xsl:template><xsl:template match="*[local-name()='add']">
3542
+ </xsl:template><xsl:template match="*[local-name()='add']" name="tag_add">
3290
3543
  <xsl:param name="skip">true</xsl:param>
3544
+ <xsl:param name="block">false</xsl:param>
3545
+ <xsl:param name="type"/>
3546
+ <xsl:param name="text-align"/>
3291
3547
  <xsl:choose>
3292
3548
  <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
3293
3549
  <xsl:choose>
3294
- <xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][local-name() = 'tab'])) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
3550
+ <xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][local-name() = 'tab']) or local-name(..) = 'formattedref' and not(preceding-sibling::node())) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
3295
3551
  <xsl:otherwise>
3296
- <fo:inline>
3552
+ <xsl:variable name="tag">
3297
3553
  <xsl:call-template name="insertTag">
3298
- <xsl:with-param name="type" select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end -->
3554
+ <xsl:with-param name="type">
3555
+ <xsl:choose>
3556
+ <xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
3557
+ <xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
3558
+ </xsl:choose>
3559
+ </xsl:with-param>
3299
3560
  <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
3300
3561
  <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
3301
3562
  </xsl:call-template>
3302
- </fo:inline>
3563
+ </xsl:variable>
3564
+ <xsl:choose>
3565
+ <xsl:when test="$block = 'false'">
3566
+ <fo:inline>
3567
+ <xsl:copy-of select="$tag"/>
3568
+ </fo:inline>
3569
+ </xsl:when>
3570
+ <xsl:otherwise>
3571
+ <fo:block> <!-- for around figures -->
3572
+ <xsl:if test="$text-align != ''">
3573
+ <xsl:attribute name="text-align"><xsl:value-of select="$text-align"/></xsl:attribute>
3574
+ </xsl:if>
3575
+ <xsl:copy-of select="$tag"/>
3576
+ </fo:block>
3577
+ </xsl:otherwise>
3578
+ </xsl:choose>
3579
+
3303
3580
  </xsl:otherwise>
3304
3581
  </xsl:choose>
3305
3582
  </xsl:when>
@@ -3658,17 +3935,21 @@
3658
3935
  </xsl:apply-templates>
3659
3936
  </xsl:template><xsl:template name="getLang">
3660
3937
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3661
- <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3662
3938
  <xsl:variable name="language">
3663
3939
  <xsl:choose>
3664
3940
  <xsl:when test="$language_current != ''">
3665
3941
  <xsl:value-of select="$language_current"/>
3666
3942
  </xsl:when>
3667
- <xsl:when test="$language_current_2 != ''">
3668
- <xsl:value-of select="$language_current_2"/>
3669
- </xsl:when>
3670
3943
  <xsl:otherwise>
3671
- <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3944
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3945
+ <xsl:choose>
3946
+ <xsl:when test="$language_current_2 != ''">
3947
+ <xsl:value-of select="$language_current_2"/>
3948
+ </xsl:when>
3949
+ <xsl:otherwise>
3950
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3951
+ </xsl:otherwise>
3952
+ </xsl:choose>
3672
3953
  </xsl:otherwise>
3673
3954
  </xsl:choose>
3674
3955
  </xsl:variable>
@@ -3871,6 +4152,9 @@
3871
4152
  </fo:inline>
3872
4153
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
3873
4154
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
4155
+ <xsl:if test="parent::*[local-name() = 'add']">
4156
+ <xsl:call-template name="append_add-style"/>
4157
+ </xsl:if>
3874
4158
  <xsl:apply-templates/>
3875
4159
  </fo:basic-link>
3876
4160
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -3885,8 +4169,8 @@
3885
4169
 
3886
4170
  </xsl:if>
3887
4171
  <fo:block-container margin-left="0mm">
3888
- <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
3889
- <xsl:apply-templates/>
4172
+ <fo:block id="{@id}">
4173
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
3890
4174
  </fo:block>
3891
4175
  </fo:block-container>
3892
4176
  </fo:block-container>
@@ -3898,21 +4182,54 @@
3898
4182
  <fo:inline>
3899
4183
  <xsl:apply-templates/>
3900
4184
  </fo:inline>
3901
- </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="formula_number"> <!-- show by demand -->
4185
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
3902
4186
  <xsl:if test="normalize-space() != ''">
3903
4187
  <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
3904
4188
  </xsl:if>
3905
- </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
3906
-
3907
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
4189
+ </xsl:template><xsl:template match="*[local-name() = 'formula'][*[local-name() = 'name']]/*[local-name() = 'stem']">
4190
+ <fo:block xsl:use-attribute-sets="formula-style">
3908
4191
 
3909
4192
 
4193
+
4194
+ <fo:table table-layout="fixed" width="100%">
4195
+ <fo:table-column column-width="95%"/>
4196
+ <fo:table-column column-width="5%"/>
4197
+ <fo:table-body>
4198
+ <fo:table-row>
4199
+ <fo:table-cell display-align="center">
4200
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style">
4201
+
4202
+
4203
+
4204
+ <xsl:apply-templates/>
4205
+ </fo:block>
4206
+ </fo:table-cell>
4207
+ <fo:table-cell display-align="center">
4208
+ <fo:block xsl:use-attribute-sets="formula-stem-number-style">
4209
+ <xsl:apply-templates select="../*[local-name() = 'name']"/>
4210
+ </fo:block>
4211
+ </fo:table-cell>
4212
+ </fo:table-row>
4213
+ </fo:table-body>
4214
+ </fo:table>
4215
+ </fo:block>
4216
+ </xsl:template><xsl:template match="*[local-name() = 'formula'][not(*[local-name() = 'name'])]/*[local-name() = 'stem']">
4217
+ <fo:block xsl:use-attribute-sets="formula-style">
4218
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style">
4219
+ <xsl:apply-templates/>
4220
+ </fo:block>
4221
+ </fo:block>
4222
+ </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
4223
+
4224
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
4225
+
4226
+
4227
+
4228
+
4229
+
4230
+
3910
4231
 
3911
4232
 
3912
-
3913
-
3914
-
3915
-
3916
4233
 
3917
4234
 
3918
4235
 
@@ -3939,6 +4256,13 @@
3939
4256
 
3940
4257
 
3941
4258
 
4259
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
4260
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
4261
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
4262
+ <xsl:call-template name="append_add-style"/>
4263
+ </xsl:if>
4264
+
4265
+
3942
4266
  <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
3943
4267
  <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
3944
4268
  <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
@@ -3977,6 +4301,12 @@
3977
4301
 
3978
4302
 
3979
4303
 
4304
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
4305
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
4306
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
4307
+ <xsl:call-template name="append_add-style"/>
4308
+ </xsl:if>
4309
+
3980
4310
  <xsl:apply-templates select="*[local-name() = 'name']"/>
3981
4311
 
3982
4312
  </fo:inline>
@@ -4026,6 +4356,7 @@
4026
4356
  </fo:block>
4027
4357
  </xsl:template><xsl:template match="*[local-name() = 'term']">
4028
4358
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
4359
+
4029
4360
 
4030
4361
 
4031
4362
 
@@ -4462,7 +4793,11 @@
4462
4793
  <xsl:value-of select="."/>
4463
4794
  </xsl:template><xsl:template match="node()" mode="contents">
4464
4795
  <xsl:apply-templates mode="contents"/>
4465
- </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" mode="contents">
4796
+ </xsl:template><xsl:template match="*[local-name() = 'preface' or local-name() = 'sections']/*[local-name() = 'p'][@type = 'section-title' and not(@displayorder)]" priority="3" mode="contents"/><xsl:template match="*[local-name() = 'p'][@type = 'section-title' and not(@displayorder)]" mode="contents_no_displayorder">
4797
+ <xsl:call-template name="contents_section-title"/>
4798
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'section-title']" mode="contents_in_clause">
4799
+ <xsl:call-template name="contents_section-title"/>
4800
+ </xsl:template><xsl:template match="*[local-name() = 'clause']/*[local-name() = 'p'][@type = 'section-title' and (@depth != ../*[local-name() = 'title']/@depth or ../*[local-name() = 'title']/@depth = 1)]" priority="3" mode="contents"/><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" name="contents_section-title" mode="contents">
4466
4801
  <xsl:variable name="level">
4467
4802
  <xsl:call-template name="getLevel">
4468
4803
  <xsl:with-param name="depth" select="@depth"/>
@@ -4531,13 +4866,14 @@
4531
4866
  <xsl:apply-templates mode="bookmarks"/>
4532
4867
  </xsl:template><xsl:template name="addBookmarks">
4533
4868
  <xsl:param name="contents"/>
4534
- <xsl:if test="xalan:nodeset($contents)//item">
4869
+ <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
4870
+ <xsl:if test="$contents_nodes//item">
4535
4871
  <fo:bookmark-tree>
4536
4872
  <xsl:choose>
4537
- <xsl:when test="xalan:nodeset($contents)/doc">
4873
+ <xsl:when test="$contents_nodes/doc">
4538
4874
  <xsl:choose>
4539
- <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
4540
- <xsl:for-each select="xalan:nodeset($contents)/doc">
4875
+ <xsl:when test="count($contents_nodes/doc) &gt; 1">
4876
+ <xsl:for-each select="$contents_nodes/doc">
4541
4877
  <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
4542
4878
  <xsl:if test="@bundle = 'true'">
4543
4879
  <xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
@@ -4588,7 +4924,7 @@
4588
4924
  </xsl:for-each>
4589
4925
  </xsl:when>
4590
4926
  <xsl:otherwise>
4591
- <xsl:for-each select="xalan:nodeset($contents)/doc">
4927
+ <xsl:for-each select="$contents_nodes/doc">
4592
4928
 
4593
4929
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4594
4930
 
@@ -4606,25 +4942,36 @@
4606
4942
  </xsl:choose>
4607
4943
  </xsl:when>
4608
4944
  <xsl:otherwise>
4609
- <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
4945
+ <xsl:apply-templates select="$contents_nodes/contents/item" mode="bookmark"/>
4946
+
4947
+ <xsl:call-template name="insertFigureBookmarks">
4948
+ <xsl:with-param name="contents" select="$contents_nodes/contents"/>
4949
+ </xsl:call-template>
4950
+
4951
+ <xsl:call-template name="insertTableBookmarks">
4952
+ <xsl:with-param name="contents" select="$contents_nodes/contents"/>
4953
+ <xsl:with-param name="lang" select="@lang"/>
4954
+ </xsl:call-template>
4955
+
4610
4956
  </xsl:otherwise>
4611
4957
  </xsl:choose>
4612
4958
 
4959
+
4613
4960
 
4614
4961
 
4615
4962
 
4616
4963
 
4617
-
4618
-
4964
+
4619
4965
 
4620
4966
  </fo:bookmark-tree>
4621
4967
  </xsl:if>
4622
4968
  </xsl:template><xsl:template name="insertFigureBookmarks">
4623
4969
  <xsl:param name="contents"/>
4624
- <xsl:if test="xalan:nodeset($contents)/figure">
4625
- <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
4970
+ <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
4971
+ <xsl:if test="$contents_nodes/figure">
4972
+ <fo:bookmark internal-destination="{$contents_nodes/figure[1]/@id}" starting-state="hide">
4626
4973
  <fo:bookmark-title>Figures</fo:bookmark-title>
4627
- <xsl:for-each select="xalan:nodeset($contents)/figure">
4974
+ <xsl:for-each select="$contents_nodes/figure">
4628
4975
  <fo:bookmark internal-destination="{@id}">
4629
4976
  <fo:bookmark-title>
4630
4977
  <xsl:value-of select="normalize-space(title)"/>
@@ -4633,18 +4980,40 @@
4633
4980
  </xsl:for-each>
4634
4981
  </fo:bookmark>
4635
4982
  </xsl:if>
4983
+
4984
+
4985
+ <xsl:if test="$contents_nodes//figures/figure">
4986
+ <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
4987
+
4988
+
4989
+
4990
+ <xsl:variable name="bookmark-title">
4991
+
4992
+ <xsl:value-of select="$title-list-figures"/>
4993
+
4994
+ </xsl:variable>
4995
+ <fo:bookmark-title><xsl:value-of select="normalize-space($bookmark-title)"/></fo:bookmark-title>
4996
+ <xsl:for-each select="$contents_nodes//figures/figure">
4997
+ <fo:bookmark internal-destination="{@id}">
4998
+ <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
4999
+ </fo:bookmark>
5000
+ </xsl:for-each>
5001
+ </fo:bookmark>
5002
+ </xsl:if>
5003
+
4636
5004
  </xsl:template><xsl:template name="insertTableBookmarks">
4637
5005
  <xsl:param name="contents"/>
4638
5006
  <xsl:param name="lang"/>
4639
- <xsl:if test="xalan:nodeset($contents)/table">
4640
- <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
5007
+ <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
5008
+ <xsl:if test="$contents_nodes/table">
5009
+ <fo:bookmark internal-destination="{$contents_nodes/table[1]/@id}" starting-state="hide">
4641
5010
  <fo:bookmark-title>
4642
5011
  <xsl:choose>
4643
5012
  <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
4644
5013
  <xsl:otherwise>Tables</xsl:otherwise>
4645
5014
  </xsl:choose>
4646
5015
  </fo:bookmark-title>
4647
- <xsl:for-each select="xalan:nodeset($contents)/table">
5016
+ <xsl:for-each select="$contents_nodes/table">
4648
5017
  <fo:bookmark internal-destination="{@id}">
4649
5018
  <fo:bookmark-title>
4650
5019
  <xsl:value-of select="normalize-space(title)"/>
@@ -4653,6 +5022,29 @@
4653
5022
  </xsl:for-each>
4654
5023
  </fo:bookmark>
4655
5024
  </xsl:if>
5025
+
5026
+
5027
+ <xsl:if test="$contents_nodes//tables/table">
5028
+ <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
5029
+
5030
+
5031
+
5032
+ <xsl:variable name="bookmark-title">
5033
+
5034
+ <xsl:value-of select="$title-list-tables"/>
5035
+
5036
+ </xsl:variable>
5037
+
5038
+ <fo:bookmark-title><xsl:value-of select="$bookmark-title"/></fo:bookmark-title>
5039
+
5040
+ <xsl:for-each select="$contents_nodes//tables/table">
5041
+ <fo:bookmark internal-destination="{@id}">
5042
+ <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
5043
+ </fo:bookmark>
5044
+ </xsl:for-each>
5045
+ </fo:bookmark>
5046
+ </xsl:if>
5047
+
4656
5048
  </xsl:template><xsl:template name="getLangVersion">
4657
5049
  <xsl:param name="lang"/>
4658
5050
  <xsl:param name="doctype" select="''"/>
@@ -4851,12 +5243,140 @@
4851
5243
  </fo:block-container>
4852
5244
  </fo:block-container>
4853
5245
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
4854
- <xsl:variable name="text">
5246
+ <xsl:choose>
5247
+ <xsl:when test="normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
5248
+ <xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
5249
+ <xsl:choose>
5250
+ <xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
5251
+ <xsl:apply-templates select="xalan:nodeset($syntax)" mode="syntax_highlight"/> <!-- process span tags -->
5252
+ </xsl:when>
5253
+ <xsl:otherwise> <!-- if case of non-succesfull syntax highlight (for instance, unknown lang), process without highlighting -->
5254
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
5255
+ </xsl:otherwise>
5256
+ </xsl:choose>
5257
+ </xsl:when>
5258
+ <xsl:otherwise>
5259
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
5260
+ </xsl:otherwise>
5261
+ </xsl:choose>
5262
+
5263
+ </xsl:template><xsl:template name="add_spaces_to_sourcecode">
5264
+ <xsl:variable name="text_step1">
4855
5265
  <xsl:call-template name="add-zero-spaces-equal"/>
4856
5266
  </xsl:variable>
4857
- <xsl:call-template name="add-zero-spaces-java">
4858
- <xsl:with-param name="text" select="$text"/>
4859
- </xsl:call-template>
5267
+ <xsl:variable name="text_step2">
5268
+ <xsl:call-template name="add-zero-spaces-java">
5269
+ <xsl:with-param name="text" select="$text_step1"/>
5270
+ </xsl:call-template>
5271
+ </xsl:variable>
5272
+ <xsl:value-of select="$text_step2"/>
5273
+ </xsl:template><xsl:template match="*" mode="syntax_highlight">
5274
+ <xsl:apply-templates mode="syntax_highlight"/>
5275
+ </xsl:template><xsl:variable name="syntax_highlight_styles_">
5276
+ <style class="hljs-addition" xsl:use-attribute-sets="hljs-addition"/>
5277
+ <style class="hljs-attr" xsl:use-attribute-sets="hljs-attr"/>
5278
+ <style class="hljs-attribute" xsl:use-attribute-sets="hljs-attribute"/>
5279
+ <style class="hljs-built_in" xsl:use-attribute-sets="hljs-built_in"/>
5280
+ <style class="hljs-bullet" xsl:use-attribute-sets="hljs-bullet"/>
5281
+ <style class="hljs-char_and_escape_" xsl:use-attribute-sets="hljs-char_and_escape_"/>
5282
+ <style class="hljs-code" xsl:use-attribute-sets="hljs-code"/>
5283
+ <style class="hljs-comment" xsl:use-attribute-sets="hljs-comment"/>
5284
+ <style class="hljs-deletion" xsl:use-attribute-sets="hljs-deletion"/>
5285
+ <style class="hljs-doctag" xsl:use-attribute-sets="hljs-doctag"/>
5286
+ <style class="hljs-emphasis" xsl:use-attribute-sets="hljs-emphasis"/>
5287
+ <style class="hljs-formula" xsl:use-attribute-sets="hljs-formula"/>
5288
+ <style class="hljs-keyword" xsl:use-attribute-sets="hljs-keyword"/>
5289
+ <style class="hljs-link" xsl:use-attribute-sets="hljs-link"/>
5290
+ <style class="hljs-literal" xsl:use-attribute-sets="hljs-literal"/>
5291
+ <style class="hljs-meta" xsl:use-attribute-sets="hljs-meta"/>
5292
+ <style class="hljs-meta_hljs-string" xsl:use-attribute-sets="hljs-meta_hljs-string"/>
5293
+ <style class="hljs-meta_hljs-keyword" xsl:use-attribute-sets="hljs-meta_hljs-keyword"/>
5294
+ <style class="hljs-name" xsl:use-attribute-sets="hljs-name"/>
5295
+ <style class="hljs-number" xsl:use-attribute-sets="hljs-number"/>
5296
+ <style class="hljs-operator" xsl:use-attribute-sets="hljs-operator"/>
5297
+ <style class="hljs-params" xsl:use-attribute-sets="hljs-params"/>
5298
+ <style class="hljs-property" xsl:use-attribute-sets="hljs-property"/>
5299
+ <style class="hljs-punctuation" xsl:use-attribute-sets="hljs-punctuation"/>
5300
+ <style class="hljs-quote" xsl:use-attribute-sets="hljs-quote"/>
5301
+ <style class="hljs-regexp" xsl:use-attribute-sets="hljs-regexp"/>
5302
+ <style class="hljs-section" xsl:use-attribute-sets="hljs-section"/>
5303
+ <style class="hljs-selector-attr" xsl:use-attribute-sets="hljs-selector-attr"/>
5304
+ <style class="hljs-selector-class" xsl:use-attribute-sets="hljs-selector-class"/>
5305
+ <style class="hljs-selector-id" xsl:use-attribute-sets="hljs-selector-id"/>
5306
+ <style class="hljs-selector-pseudo" xsl:use-attribute-sets="hljs-selector-pseudo"/>
5307
+ <style class="hljs-selector-tag" xsl:use-attribute-sets="hljs-selector-tag"/>
5308
+ <style class="hljs-string" xsl:use-attribute-sets="hljs-string"/>
5309
+ <style class="hljs-strong" xsl:use-attribute-sets="hljs-strong"/>
5310
+ <style class="hljs-subst" xsl:use-attribute-sets="hljs-subst"/>
5311
+ <style class="hljs-symbol" xsl:use-attribute-sets="hljs-symbol"/>
5312
+ <style class="hljs-tag" xsl:use-attribute-sets="hljs-tag"/>
5313
+ <!-- <style class="hljs-tag_hljs-attr" xsl:use-attribute-sets="hljs-tag_hljs-attr"></style> -->
5314
+ <!-- <style class="hljs-tag_hljs-name" xsl:use-attribute-sets="hljs-tag_hljs-name"></style> -->
5315
+ <style class="hljs-template-tag" xsl:use-attribute-sets="hljs-template-tag"/>
5316
+ <style class="hljs-template-variable" xsl:use-attribute-sets="hljs-template-variable"/>
5317
+ <style class="hljs-title" xsl:use-attribute-sets="hljs-title"/>
5318
+ <style class="hljs-title_and_class_" xsl:use-attribute-sets="hljs-title_and_class_"/>
5319
+ <style class="hljs-title_and_class__and_inherited__" xsl:use-attribute-sets="hljs-title_and_class__and_inherited__"/>
5320
+ <style class="hljs-title_and_function_" xsl:use-attribute-sets="hljs-title_and_function_"/>
5321
+ <style class="hljs-type" xsl:use-attribute-sets="hljs-type"/>
5322
+ <style class="hljs-variable" xsl:use-attribute-sets="hljs-variable"/>
5323
+ <style class="hljs-variable_and_language_" xsl:use-attribute-sets="hljs-variable_and_language_"/>
5324
+ </xsl:variable><xsl:variable name="syntax_highlight_styles" select="xalan:nodeset($syntax_highlight_styles_)"/><xsl:template match="span" mode="syntax_highlight" priority="2">
5325
+ <!-- <fo:inline color="green" font-style="italic"><xsl:apply-templates mode="syntax_highlight"/></fo:inline> -->
5326
+ <fo:inline>
5327
+ <xsl:variable name="classes_">
5328
+ <xsl:call-template name="split">
5329
+ <xsl:with-param name="pText" select="@class"/>
5330
+ <xsl:with-param name="sep" select="' '"/>
5331
+ </xsl:call-template>
5332
+ <!-- a few classes together (_and_ suffix) -->
5333
+ <xsl:if test="contains(@class, 'hljs-char') and contains(@class, 'escape_')">
5334
+ <item>hljs-char_and_escape_</item>
5335
+ </xsl:if>
5336
+ <xsl:if test="contains(@class, 'hljs-title') and contains(@class, 'class_')">
5337
+ <item>hljs-title_and_class_</item>
5338
+ </xsl:if>
5339
+ <xsl:if test="contains(@class, 'hljs-title') and contains(@class, 'class_') and contains(@class, 'inherited__')">
5340
+ <item>hljs-title_and_class__and_inherited__</item>
5341
+ </xsl:if>
5342
+ <xsl:if test="contains(@class, 'hljs-title') and contains(@class, 'function_')">
5343
+ <item>hljs-title_and_function_</item>
5344
+ </xsl:if>
5345
+ <xsl:if test="contains(@class, 'hljs-variable') and contains(@class, 'language_')">
5346
+ <item>hljs-variable_and_language_</item>
5347
+ </xsl:if>
5348
+ <!-- with parent classes (_ suffix) -->
5349
+ <xsl:if test="contains(@class, 'hljs-keyword') and contains(ancestor::*/@class, 'hljs-meta')">
5350
+ <item>hljs-meta_hljs-keyword</item>
5351
+ </xsl:if>
5352
+ <xsl:if test="contains(@class, 'hljs-string') and contains(ancestor::*/@class, 'hljs-meta')">
5353
+ <item>hljs-meta_hljs-string</item>
5354
+ </xsl:if>
5355
+ </xsl:variable>
5356
+ <xsl:variable name="classes" select="xalan:nodeset($classes_)"/>
5357
+
5358
+ <xsl:for-each select="$classes/item">
5359
+ <xsl:variable name="class_name" select="."/>
5360
+ <xsl:for-each select="$syntax_highlight_styles/style[@class = $class_name]/@*[not(local-name() = 'class')]">
5361
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
5362
+ </xsl:for-each>
5363
+ </xsl:for-each>
5364
+
5365
+ <!-- <xsl:variable name="class_name">
5366
+ <xsl:choose>
5367
+ <xsl:when test="@class = 'hljs-attr' and ancestor::*/@class = 'hljs-tag'">hljs-tag_hljs-attr</xsl:when>
5368
+ <xsl:when test="@class = 'hljs-name' and ancestor::*/@class = 'hljs-tag'">hljs-tag_hljs-name</xsl:when>
5369
+ <xsl:when test="@class = 'hljs-string' and ancestor::*/@class = 'hljs-meta'">hljs-meta_hljs-string</xsl:when>
5370
+ <xsl:otherwise><xsl:value-of select="@class"/></xsl:otherwise>
5371
+ </xsl:choose>
5372
+ </xsl:variable>
5373
+ <xsl:for-each select="$syntax_highlight_styles/style[@class = $class_name]/@*[not(local-name() = 'class')]">
5374
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
5375
+ </xsl:for-each> -->
5376
+
5377
+ <xsl:apply-templates mode="syntax_highlight"/></fo:inline>
5378
+ </xsl:template><xsl:template match="text()" mode="syntax_highlight" priority="2">
5379
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
4860
5380
  </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']">
4861
5381
  <xsl:if test="normalize-space() != ''">
4862
5382
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
@@ -5181,6 +5701,8 @@
5181
5701
  </xsl:otherwise>
5182
5702
  </xsl:choose> -->
5183
5703
  </fo:block>
5704
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ')]" priority="2">
5705
+ <xsl:text>[</xsl:text><xsl:value-of select="substring-after(., '[SOURCE: ')"/>
5184
5706
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
5185
5707
  <xsl:if test="normalize-space() != ''">
5186
5708
  <xsl:value-of select="."/>
@@ -5227,11 +5749,14 @@
5227
5749
 
5228
5750
 
5229
5751
  <fo:block-container margin-left="0mm">
5230
-
5231
- <fo:block xsl:use-attribute-sets="quote-style">
5752
+ <fo:block-container xsl:use-attribute-sets="quote-style">
5232
5753
 
5233
- <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5234
- </fo:block>
5754
+ <fo:block-container margin-left="0mm" margin-right="0mm">
5755
+ <fo:block role="BlockQuote">
5756
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5757
+ </fo:block>
5758
+ </fo:block-container>
5759
+ </fo:block-container>
5235
5760
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
5236
5761
  <fo:block xsl:use-attribute-sets="quote-source-style">
5237
5762
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
@@ -5252,26 +5777,11 @@
5252
5777
  </xsl:template><xsl:template match="*[local-name() = 'author']">
5253
5778
  <xsl:text>— </xsl:text>
5254
5779
  <xsl:apply-templates/>
5255
- </xsl:template><xsl:variable name="bibitem_hidden_">
5256
- <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
5257
- <xsl:copy-of select="."/>
5258
- </xsl:for-each>
5259
- <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem']">
5260
- <xsl:copy-of select="."/>
5261
- </xsl:for-each>
5262
- </xsl:variable><xsl:variable name="bibitem_hidden" select="xalan:nodeset($bibitem_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
5263
-
5264
- <xsl:variable name="bibitemid">
5265
- <xsl:choose>
5266
- <!-- <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"></xsl:when>
5267
- <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"></xsl:when> -->
5268
- <xsl:when test="$bibitem_hidden/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
5269
- <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
5270
- </xsl:choose>
5271
- </xsl:variable>
5272
-
5780
+ </xsl:template><xsl:template match="*[local-name() = 'eref']">
5781
+ <xsl:variable name="current_bibitemid" select="@bibitemid"/>
5782
+ <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/>
5273
5783
  <xsl:choose>
5274
- <xsl:when test="normalize-space($bibitemid) != ''"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link -->
5784
+ <xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
5275
5785
  <fo:inline xsl:use-attribute-sets="eref-style">
5276
5786
  <xsl:if test="@type = 'footnote'">
5277
5787
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
@@ -5285,8 +5795,8 @@
5285
5795
  <xsl:variable name="text" select="normalize-space()"/>
5286
5796
 
5287
5797
 
5288
-
5289
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
5798
+
5799
+ <fo:basic-link fox:alt-text="{@citeas}">
5290
5800
  <xsl:if test="normalize-space(@citeas) = ''">
5291
5801
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
5292
5802
  </xsl:if>
@@ -5299,14 +5809,21 @@
5299
5809
 
5300
5810
  </xsl:if>
5301
5811
 
5302
-
5812
+ <xsl:choose>
5813
+ <xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
5814
+ <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
5815
+ </xsl:when>
5816
+ <xsl:otherwise>
5817
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
5818
+ </xsl:otherwise>
5819
+ </xsl:choose>
5303
5820
 
5304
5821
  <xsl:apply-templates/>
5305
5822
  </fo:basic-link>
5306
-
5823
+
5307
5824
  </fo:inline>
5308
5825
  </xsl:when>
5309
- <xsl:otherwise>
5826
+ <xsl:otherwise> <!-- if there is key('bibitems_hidden', $current_bibitemid) -->
5310
5827
  <fo:inline><xsl:apply-templates/></fo:inline>
5311
5828
  </xsl:otherwise>
5312
5829
  </xsl:choose>
@@ -5380,6 +5897,31 @@
5380
5897
  <xsl:with-param name="count" select="$count - 1"/>
5381
5898
  </xsl:call-template>
5382
5899
  </xsl:if>
5900
+ </xsl:template><xsl:template match="*[local-name() = 'preferred']">
5901
+ <xsl:variable name="level">
5902
+ <xsl:call-template name="getLevel"/>
5903
+ </xsl:variable>
5904
+ <xsl:variable name="font-size">
5905
+ inherit
5906
+ </xsl:variable>
5907
+ <xsl:variable name="levelTerm">
5908
+ <xsl:call-template name="getLevelTermName"/>
5909
+ </xsl:variable>
5910
+ <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
5911
+
5912
+
5913
+
5914
+ <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
5915
+ <fo:block xsl:use-attribute-sets="term-name-style">
5916
+ <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
5917
+ </fo:block>
5918
+ </xsl:if>
5919
+
5920
+ <fo:block xsl:use-attribute-sets="preferred-term-style">
5921
+ <xsl:call-template name="setStyle_preferred"/>
5922
+ <xsl:apply-templates/>
5923
+ </fo:block>
5924
+ </fo:block>
5383
5925
  </xsl:template><xsl:template match="*[local-name() = 'domain']">
5384
5926
  <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
5385
5927
  <xsl:text> </xsl:text>
@@ -5463,24 +6005,8 @@
5463
6005
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
5464
6006
  </xsl:template><xsl:variable name="ul_labels_">
5465
6007
 
5466
-
5467
-
5468
-
5469
-
5470
-
5471
- <label>—</label> <!-- em dash -->
5472
-
5473
-
5474
-
5475
-
5476
-
5477
-
5478
-
5479
-
5480
-
5481
-
5482
-
5483
-
6008
+ <label>—</label> <!-- em dash -->
6009
+
5484
6010
  </xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
5485
6011
  <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
5486
6012
  <xsl:variable name="list_level">
@@ -5506,6 +6032,91 @@
5506
6032
  </xsl:template><xsl:template match="label" mode="ul_labels">
5507
6033
  <xsl:copy-of select="@*[not(local-name() = 'level')]"/>
5508
6034
  <xsl:value-of select="."/>
6035
+ </xsl:template><xsl:template name="getListItemFormat">
6036
+ <!-- Example: for BSI <?list-type loweralpha?> -->
6037
+ <xsl:variable name="processing_instruction_type" select="normalize-space(../preceding-sibling::*[1]/processing-instruction('list-type'))"/>
6038
+ <xsl:choose>
6039
+ <xsl:when test="local-name(..) = 'ul'">
6040
+ <xsl:choose>
6041
+ <xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/>
6042
+ <xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
6043
+ </xsl:choose>
6044
+ </xsl:when>
6045
+ <xsl:otherwise> <!-- for ordered lists 'ol' -->
6046
+
6047
+ <!-- Example: for BSI <?list-start 2?> -->
6048
+ <xsl:variable name="processing_instruction_start" select="normalize-space(../preceding-sibling::*[1]/processing-instruction('list-start'))"/>
6049
+
6050
+ <xsl:variable name="start_value">
6051
+ <xsl:choose>
6052
+ <xsl:when test="normalize-space($processing_instruction_start) != ''">
6053
+ <xsl:value-of select="number($processing_instruction_start) - 1"/><!-- if start="3" then start_value=2 + xsl:number(1) = 3 -->
6054
+ </xsl:when>
6055
+ <xsl:when test="normalize-space(../@start) != ''">
6056
+ <xsl:value-of select="number(../@start) - 1"/><!-- if start="3" then start_value=2 + xsl:number(1) = 3 -->
6057
+ </xsl:when>
6058
+ <xsl:otherwise>0</xsl:otherwise>
6059
+ </xsl:choose>
6060
+ </xsl:variable>
6061
+
6062
+ <xsl:variable name="curr_value"><xsl:number/></xsl:variable>
6063
+
6064
+ <xsl:variable name="type">
6065
+ <xsl:choose>
6066
+ <xsl:when test="normalize-space($processing_instruction_type) != ''"><xsl:value-of select="$processing_instruction_type"/></xsl:when>
6067
+ <xsl:when test="normalize-space(../@type) != ''"><xsl:value-of select="../@type"/></xsl:when>
6068
+
6069
+ <xsl:otherwise> <!-- if no @type or @class = 'steps' -->
6070
+
6071
+ <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
6072
+ <xsl:variable name="list_level">
6073
+ <xsl:choose>
6074
+ <xsl:when test="$list_level_ &lt;= 5"><xsl:value-of select="$list_level_"/></xsl:when>
6075
+ <xsl:otherwise><xsl:value-of select="$list_level_ mod 5"/></xsl:otherwise>
6076
+ </xsl:choose>
6077
+ </xsl:variable>
6078
+
6079
+ <xsl:choose>
6080
+ <xsl:when test="$list_level mod 5 = 0">roman_upper</xsl:when> <!-- level 5 -->
6081
+ <xsl:when test="$list_level mod 4 = 0">alphabet_upper</xsl:when> <!-- level 4 -->
6082
+ <xsl:when test="$list_level mod 3 = 0">roman</xsl:when> <!-- level 3 -->
6083
+ <xsl:when test="$list_level mod 2 = 0 and ancestor::*/@class = 'steps'">alphabet</xsl:when> <!-- level 2 and @class = 'steps'-->
6084
+ <xsl:when test="$list_level mod 2 = 0">arabic</xsl:when> <!-- level 2 -->
6085
+ <xsl:otherwise> <!-- level 1 -->
6086
+ <xsl:choose>
6087
+ <xsl:when test="ancestor::*/@class = 'steps'">arabic</xsl:when>
6088
+ <xsl:otherwise>alphabet</xsl:otherwise>
6089
+ </xsl:choose>
6090
+ </xsl:otherwise>
6091
+ </xsl:choose>
6092
+
6093
+ </xsl:otherwise>
6094
+ </xsl:choose>
6095
+ </xsl:variable>
6096
+
6097
+ <xsl:variable name="format">
6098
+ <xsl:choose>
6099
+ <xsl:when test="$type = 'arabic'">
6100
+ 1)
6101
+ </xsl:when>
6102
+ <xsl:when test="$type = 'alphabet'">
6103
+ a)
6104
+ </xsl:when>
6105
+ <xsl:when test="$type = 'alphabet_upper'">
6106
+ A.
6107
+ </xsl:when>
6108
+ <xsl:when test="$type = 'roman'">
6109
+ i)
6110
+ </xsl:when>
6111
+ <xsl:when test="$type = 'roman_upper'">I.</xsl:when>
6112
+ <xsl:otherwise>1.</xsl:otherwise> <!-- for any case, if $type has non-determined value, not using -->
6113
+ </xsl:choose>
6114
+ </xsl:variable>
6115
+
6116
+ <xsl:number value="$start_value + $curr_value" format="{normalize-space($format)}" lang="en"/>
6117
+
6118
+ </xsl:otherwise>
6119
+ </xsl:choose>
5509
6120
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
5510
6121
  <xsl:choose>
5511
6122
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
@@ -5521,18 +6132,71 @@
5521
6132
 
5522
6133
  <fo:block-container margin-left="0mm">
5523
6134
  <fo:block>
5524
- <xsl:apply-templates select="." mode="ul_ol"/>
6135
+ <xsl:apply-templates select="." mode="list"/>
5525
6136
  </fo:block>
5526
6137
  </fo:block-container>
5527
6138
  </fo:block-container>
5528
6139
  </xsl:when>
5529
6140
  <xsl:otherwise>
5530
6141
  <fo:block>
5531
- <xsl:apply-templates select="." mode="ul_ol"/>
6142
+ <xsl:apply-templates select="." mode="list"/>
5532
6143
  </fo:block>
5533
6144
  </xsl:otherwise>
5534
6145
  </xsl:choose>
5535
- </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
6146
+ </xsl:template><xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
6147
+ <fo:list-block xsl:use-attribute-sets="list-style">
6148
+
6149
+
6150
+
6151
+
6152
+
6153
+
6154
+
6155
+
6156
+
6157
+ <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
6158
+ </fo:list-block>
6159
+ <!-- <xsl:for-each select="./iho:note">
6160
+ <xsl:call-template name="note"/>
6161
+ </xsl:for-each> -->
6162
+ <xsl:apply-templates select="./*[local-name() = 'note']"/>
6163
+ </xsl:template><xsl:template match="*[local-name()='li']">
6164
+ <fo:list-item xsl:use-attribute-sets="list-item-style">
6165
+ <xsl:copy-of select="@id"/>
6166
+
6167
+
6168
+
6169
+ <fo:list-item-label end-indent="label-end()">
6170
+ <fo:block xsl:use-attribute-sets="list-item-label-style">
6171
+
6172
+
6173
+
6174
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6175
+ <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
6176
+ <xsl:call-template name="append_add-style"/>
6177
+ </xsl:if>
6178
+
6179
+ <xsl:call-template name="getListItemFormat"/>
6180
+ </fo:block>
6181
+ </fo:list-item-label>
6182
+ <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
6183
+ <fo:block>
6184
+
6185
+
6186
+
6187
+
6188
+
6189
+ <xsl:apply-templates/>
6190
+
6191
+ <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
6192
+
6193
+ <xsl:for-each select="./bsi:note">
6194
+ <xsl:call-template name="note"/>
6195
+ </xsl:for-each> -->
6196
+ </fo:block>
6197
+ </fo:list-item-body>
6198
+ </fo:list-item>
6199
+ </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="bookmark_in_fn">
5536
6200
  <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
5537
6201
  <bookmark><xsl:value-of select="@id"/></bookmark>
5538
6202
  </xsl:for-each>
@@ -5554,7 +6218,7 @@
5554
6218
  <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
5555
6219
  <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
5556
6220
  <xsl:if test="@to">
5557
- <xsl:value-of select="$dash"/>
6221
+ <xsl:value-of select="$en_dash"/>
5558
6222
  <xsl:copy>
5559
6223
  <xsl:copy-of select="@*"/>
5560
6224
  <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
@@ -5579,7 +6243,7 @@
5579
6243
  <xsl:param name="target"/>
5580
6244
  <!-- <node></node> -->
5581
6245
  <xsl:choose>
5582
- <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
6246
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $en_dash) and $remove = 'true'">
5583
6247
  <!-- skip text (i.e. remove it) and process next element -->
5584
6248
  <!-- [removed_<xsl:value-of select="."/>] -->
5585
6249
  <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
@@ -5663,12 +6327,22 @@
5663
6327
  </xsl:variable>
5664
6328
  <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
5665
6329
  <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
6330
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'title']" priority="4">
6331
+ <fo:block xsl:use-attribute-sets="indexsect-title-style">
6332
+ <!-- Index -->
6333
+ <xsl:apply-templates/>
6334
+ </fo:block>
6335
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']/*[local-name() = 'title']" priority="4">
6336
+ <!-- Letter A, B, C, ... -->
6337
+ <fo:block xsl:use-attribute-sets="indexsect-clause-title-style">
6338
+ <xsl:apply-templates/>
6339
+ </fo:block>
5666
6340
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
5667
6341
  <xsl:apply-templates/>
5668
6342
  <fo:block>
5669
- <xsl:if test="following-sibling::*[local-name() = 'clause']">
5670
- <fo:block> </fo:block>
5671
- </xsl:if>
6343
+ <xsl:if test="following-sibling::*[local-name() = 'clause']">
6344
+ <fo:block> </fo:block>
6345
+ </xsl:if>
5672
6346
  </fo:block>
5673
6347
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
5674
6348
  <xsl:apply-templates/>
@@ -5678,6 +6352,9 @@
5678
6352
 
5679
6353
  <xsl:apply-templates/>
5680
6354
  </fo:block>
6355
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/text()">
6356
+ <!-- to split by '_' and other chars -->
6357
+ <xsl:call-template name="add-zero-spaces-java"/>
5681
6358
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
5682
6359
  <fo:inline id="{@id}" font-size="1pt"/>
5683
6360
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
@@ -5939,27 +6616,47 @@
5939
6616
  <xsl:apply-templates/>
5940
6617
  </fo:inline>
5941
6618
  </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
6619
+
6620
+ <!-- list of footnotes to calculate actual footnotes number -->
6621
+ <xsl:variable name="p_fn_">
6622
+ <xsl:call-template name="get_fn_list"/>
6623
+ </xsl:variable>
6624
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
6625
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
6626
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
6627
+ <!-- fn sequence number in document -->
6628
+ <xsl:variable name="current_fn_number">
6629
+ <xsl:choose>
6630
+ <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
6631
+ <xsl:otherwise>
6632
+ <!-- <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1" /> -->
6633
+ <xsl:value-of select="count($p_fn//fn[@gen_id = $gen_id]/preceding-sibling::fn) + 1"/>
6634
+ </xsl:otherwise>
6635
+ </xsl:choose>
6636
+ </xsl:variable>
5942
6637
  <fo:footnote>
5943
6638
  <xsl:variable name="number">
5944
6639
 
5945
- <xsl:number level="any" count="*[local-name() = 'bibitem']/*[local-name() = 'note']"/>
6640
+ <xsl:value-of select="$current_fn_number"/>
5946
6641
 
5947
6642
  </xsl:variable>
5948
- <fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
5949
- <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
5950
- <xsl:value-of select="$number"/>
5951
-
6643
+
6644
+ <xsl:variable name="current_fn_number_text">
6645
+ <xsl:value-of select="$number"/>
6646
+
5952
6647
  <xsl:text>)</xsl:text>
5953
6648
 
6649
+ </xsl:variable>
6650
+
6651
+ <fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
6652
+ <fo:basic-link internal-destination="{$gen_id}" fox:alt-text="footnote {$number}">
6653
+ <xsl:value-of select="$current_fn_number_text"/>
5954
6654
  </fo:basic-link>
5955
6655
  </fo:inline>
5956
6656
  <fo:footnote-body>
5957
6657
  <fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
5958
- <fo:inline id="{generate-id()}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
5959
- <xsl:value-of select="$number"/>
5960
-
5961
- <xsl:text>)</xsl:text>
5962
-
6658
+ <fo:inline id="{$gen_id}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
6659
+ <xsl:value-of select="$current_fn_number_text"/>
5963
6660
  </fo:inline>
5964
6661
  <xsl:apply-templates/>
5965
6662
  </fo:block>
@@ -6085,7 +6782,7 @@
6085
6782
  </fo:table-body>
6086
6783
  </fo:table>
6087
6784
  </fo:block>
6088
- </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
6785
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']" priority="2">
6089
6786
  <fo:table-row min-height="5mm">
6090
6787
  <xsl:apply-templates/>
6091
6788
  </fo:table-row>
@@ -6200,6 +6897,78 @@
6200
6897
  <!-- processing for admonition/p found in the template for 'p' -->
6201
6898
  <xsl:call-template name="paragraph"/>
6202
6899
 
6900
+ </xsl:template><xsl:template match="@*|node()" mode="update_xml_step1">
6901
+ <xsl:copy>
6902
+ <xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
6903
+ </xsl:copy>
6904
+ </xsl:template><xsl:template match="*[local-name() = 'preface']" mode="update_xml_step1">
6905
+ <xsl:copy>
6906
+ <xsl:copy-of select="@*"/>
6907
+
6908
+ <xsl:variable name="nodes_preface_">
6909
+ <xsl:for-each select="*">
6910
+ <node id="{@id}"/>
6911
+ </xsl:for-each>
6912
+ </xsl:variable>
6913
+ <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
6914
+
6915
+ <xsl:for-each select="*">
6916
+ <xsl:sort select="@displayorder" data-type="number"/>
6917
+
6918
+ <!-- process Section's title -->
6919
+ <xsl:variable name="preceding-sibling_id" select="$nodes_preface/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
6920
+ <xsl:if test="$preceding-sibling_id != ''">
6921
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="update_xml_step1"/>
6922
+ </xsl:if>
6923
+
6924
+ <xsl:choose>
6925
+ <xsl:when test="@type = 'section-title' and not(@displayorder)"><!-- skip, don't copy, because copied in above 'apply-templates' --></xsl:when>
6926
+ <xsl:otherwise>
6927
+ <xsl:apply-templates select="." mode="update_xml_step1"/>
6928
+ </xsl:otherwise>
6929
+ </xsl:choose>
6930
+
6931
+ </xsl:for-each>
6932
+ </xsl:copy>
6933
+ </xsl:template><xsl:template match="*[local-name() = 'sections']" mode="update_xml_step1">
6934
+ <xsl:copy>
6935
+ <xsl:copy-of select="@*"/>
6936
+
6937
+ <xsl:variable name="nodes_sections_">
6938
+ <xsl:for-each select="*">
6939
+ <node id="{@id}"/>
6940
+ </xsl:for-each>
6941
+ </xsl:variable>
6942
+ <xsl:variable name="nodes_sections" select="xalan:nodeset($nodes_sections_)"/>
6943
+
6944
+ <!-- move section 'Normative references' inside 'sections' -->
6945
+ <xsl:for-each select="* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
6946
+ <xsl:sort select="@displayorder" data-type="number"/>
6947
+
6948
+ <!-- process Section's title -->
6949
+ <xsl:variable name="preceding-sibling_id" select="$nodes_sections/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
6950
+ <xsl:if test="$preceding-sibling_id != ''">
6951
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="update_xml_step1"/>
6952
+ </xsl:if>
6953
+
6954
+ <xsl:choose>
6955
+ <xsl:when test="@type = 'section-title' and not(@displayorder)"><!-- skip, don't copy, because copied in above 'apply-templates' --></xsl:when>
6956
+ <xsl:otherwise>
6957
+ <xsl:apply-templates select="." mode="update_xml_step1"/>
6958
+ </xsl:otherwise>
6959
+ </xsl:choose>
6960
+
6961
+ </xsl:for-each>
6962
+ </xsl:copy>
6963
+ </xsl:template><xsl:template match="*[local-name() = 'bibliography']" mode="update_xml_step1">
6964
+ <xsl:copy>
6965
+ <xsl:copy-of select="@*"/>
6966
+ <!-- copy all elements from bibliography except 'Normative references' (moved to 'sections') -->
6967
+ <xsl:for-each select="*[not(@normative='true') and not(*[*[@normative='true']])]">
6968
+ <xsl:sort select="@displayorder" data-type="number"/>
6969
+ <xsl:apply-templates select="." mode="update_xml_step1"/>
6970
+ </xsl:for-each>
6971
+ </xsl:copy>
6203
6972
  </xsl:template><xsl:template name="convertDate">
6204
6973
  <xsl:param name="date"/>
6205
6974
  <xsl:param name="format" select="'short'"/>
@@ -6313,9 +7082,6 @@
6313
7082
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
6314
7083
  </xsl:choose>
6315
7084
  </xsl:template><xsl:template name="addPDFUAmeta">
6316
- <xsl:variable name="lang">
6317
- <xsl:call-template name="getLang"/>
6318
- </xsl:variable>
6319
7085
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
6320
7086
  <pdf:dictionary type="normal" key="ViewerPreferences">
6321
7087
  <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
@@ -6543,10 +7309,12 @@
6543
7309
  <xsl:param name="key"/>
6544
7310
  <xsl:param name="formatted">false</xsl:param>
6545
7311
  <xsl:param name="lang"/>
7312
+ <xsl:param name="returnEmptyIfNotFound">false</xsl:param>
6546
7313
 
6547
7314
  <xsl:variable name="curr_lang">
6548
7315
  <xsl:choose>
6549
7316
  <xsl:when test="$lang != ''"><xsl:value-of select="$lang"/></xsl:when>
7317
+ <xsl:when test="$returnEmptyIfNotFound = 'true'"/>
6550
7318
  <xsl:otherwise>
6551
7319
  <xsl:call-template name="getLang"/>
6552
7320
  </xsl:otherwise>
@@ -6581,6 +7349,7 @@
6581
7349
  </xsl:otherwise>
6582
7350
  </xsl:choose>
6583
7351
  </xsl:when>
7352
+ <xsl:when test="$returnEmptyIfNotFound = 'true'"/>
6584
7353
  <xsl:otherwise>
6585
7354
  <xsl:variable name="key_">
6586
7355
  <xsl:call-template name="capitalize">
@@ -6650,53 +7419,153 @@
6650
7419
  <xsl:param name="first"/>
6651
7420
  <xsl:if test="$number != ''">
6652
7421
  <xsl:variable name="words">
6653
- <words>
6654
- <word cardinal="1">One-</word>
6655
- <word ordinal="1">First </word>
6656
- <word cardinal="2">Two-</word>
6657
- <word ordinal="2">Second </word>
6658
- <word cardinal="3">Three-</word>
6659
- <word ordinal="3">Third </word>
6660
- <word cardinal="4">Four-</word>
6661
- <word ordinal="4">Fourth </word>
6662
- <word cardinal="5">Five-</word>
6663
- <word ordinal="5">Fifth </word>
6664
- <word cardinal="6">Six-</word>
6665
- <word ordinal="6">Sixth </word>
6666
- <word cardinal="7">Seven-</word>
6667
- <word ordinal="7">Seventh </word>
6668
- <word cardinal="8">Eight-</word>
6669
- <word ordinal="8">Eighth </word>
6670
- <word cardinal="9">Nine-</word>
6671
- <word ordinal="9">Ninth </word>
6672
- <word ordinal="10">Tenth </word>
6673
- <word ordinal="11">Eleventh </word>
6674
- <word ordinal="12">Twelfth </word>
6675
- <word ordinal="13">Thirteenth </word>
6676
- <word ordinal="14">Fourteenth </word>
6677
- <word ordinal="15">Fifteenth </word>
6678
- <word ordinal="16">Sixteenth </word>
6679
- <word ordinal="17">Seventeenth </word>
6680
- <word ordinal="18">Eighteenth </word>
6681
- <word ordinal="19">Nineteenth </word>
6682
- <word cardinal="20">Twenty-</word>
6683
- <word ordinal="20">Twentieth </word>
6684
- <word cardinal="30">Thirty-</word>
6685
- <word ordinal="30">Thirtieth </word>
6686
- <word cardinal="40">Forty-</word>
6687
- <word ordinal="40">Fortieth </word>
6688
- <word cardinal="50">Fifty-</word>
6689
- <word ordinal="50">Fiftieth </word>
6690
- <word cardinal="60">Sixty-</word>
6691
- <word ordinal="60">Sixtieth </word>
6692
- <word cardinal="70">Seventy-</word>
6693
- <word ordinal="70">Seventieth </word>
6694
- <word cardinal="80">Eighty-</word>
6695
- <word ordinal="80">Eightieth </word>
6696
- <word cardinal="90">Ninety-</word>
6697
- <word ordinal="90">Ninetieth </word>
6698
- <word cardinal="100">Hundred-</word>
6699
- <word ordinal="100">Hundredth </word>
7422
+ <words>
7423
+ <xsl:choose>
7424
+ <xsl:when test="$lang = 'fr'"> <!-- https://en.wiktionary.org/wiki/Appendix:French_numbers -->
7425
+ <word cardinal="1">Une-</word>
7426
+ <word ordinal="1">Première </word>
7427
+ <word cardinal="2">Deux-</word>
7428
+ <word ordinal="2">Seconde </word>
7429
+ <word cardinal="3">Trois-</word>
7430
+ <word ordinal="3">Tierce </word>
7431
+ <word cardinal="4">Quatre-</word>
7432
+ <word ordinal="4">Quatrième </word>
7433
+ <word cardinal="5">Cinq-</word>
7434
+ <word ordinal="5">Cinquième </word>
7435
+ <word cardinal="6">Six-</word>
7436
+ <word ordinal="6">Sixième </word>
7437
+ <word cardinal="7">Sept-</word>
7438
+ <word ordinal="7">Septième </word>
7439
+ <word cardinal="8">Huit-</word>
7440
+ <word ordinal="8">Huitième </word>
7441
+ <word cardinal="9">Neuf-</word>
7442
+ <word ordinal="9">Neuvième </word>
7443
+ <word ordinal="10">Dixième </word>
7444
+ <word ordinal="11">Onzième </word>
7445
+ <word ordinal="12">Douzième </word>
7446
+ <word ordinal="13">Treizième </word>
7447
+ <word ordinal="14">Quatorzième </word>
7448
+ <word ordinal="15">Quinzième </word>
7449
+ <word ordinal="16">Seizième </word>
7450
+ <word ordinal="17">Dix-septième </word>
7451
+ <word ordinal="18">Dix-huitième </word>
7452
+ <word ordinal="19">Dix-neuvième </word>
7453
+ <word cardinal="20">Vingt-</word>
7454
+ <word ordinal="20">Vingtième </word>
7455
+ <word cardinal="30">Trente-</word>
7456
+ <word ordinal="30">Trentième </word>
7457
+ <word cardinal="40">Quarante-</word>
7458
+ <word ordinal="40">Quarantième </word>
7459
+ <word cardinal="50">Cinquante-</word>
7460
+ <word ordinal="50">Cinquantième </word>
7461
+ <word cardinal="60">Soixante-</word>
7462
+ <word ordinal="60">Soixantième </word>
7463
+ <word cardinal="70">Septante-</word>
7464
+ <word ordinal="70">Septantième </word>
7465
+ <word cardinal="80">Huitante-</word>
7466
+ <word ordinal="80">Huitantième </word>
7467
+ <word cardinal="90">Nonante-</word>
7468
+ <word ordinal="90">Nonantième </word>
7469
+ <word cardinal="100">Cent-</word>
7470
+ <word ordinal="100">Centième </word>
7471
+ </xsl:when>
7472
+ <xsl:when test="$lang = 'ru'">
7473
+ <word cardinal="1">Одна-</word>
7474
+ <word ordinal="1">Первое </word>
7475
+ <word cardinal="2">Две-</word>
7476
+ <word ordinal="2">Второе </word>
7477
+ <word cardinal="3">Три-</word>
7478
+ <word ordinal="3">Третье </word>
7479
+ <word cardinal="4">Четыре-</word>
7480
+ <word ordinal="4">Четвертое </word>
7481
+ <word cardinal="5">Пять-</word>
7482
+ <word ordinal="5">Пятое </word>
7483
+ <word cardinal="6">Шесть-</word>
7484
+ <word ordinal="6">Шестое </word>
7485
+ <word cardinal="7">Семь-</word>
7486
+ <word ordinal="7">Седьмое </word>
7487
+ <word cardinal="8">Восемь-</word>
7488
+ <word ordinal="8">Восьмое </word>
7489
+ <word cardinal="9">Девять-</word>
7490
+ <word ordinal="9">Девятое </word>
7491
+ <word ordinal="10">Десятое </word>
7492
+ <word ordinal="11">Одиннадцатое </word>
7493
+ <word ordinal="12">Двенадцатое </word>
7494
+ <word ordinal="13">Тринадцатое </word>
7495
+ <word ordinal="14">Четырнадцатое </word>
7496
+ <word ordinal="15">Пятнадцатое </word>
7497
+ <word ordinal="16">Шестнадцатое </word>
7498
+ <word ordinal="17">Семнадцатое </word>
7499
+ <word ordinal="18">Восемнадцатое </word>
7500
+ <word ordinal="19">Девятнадцатое </word>
7501
+ <word cardinal="20">Двадцать-</word>
7502
+ <word ordinal="20">Двадцатое </word>
7503
+ <word cardinal="30">Тридцать-</word>
7504
+ <word ordinal="30">Тридцатое </word>
7505
+ <word cardinal="40">Сорок-</word>
7506
+ <word ordinal="40">Сороковое </word>
7507
+ <word cardinal="50">Пятьдесят-</word>
7508
+ <word ordinal="50">Пятидесятое </word>
7509
+ <word cardinal="60">Шестьдесят-</word>
7510
+ <word ordinal="60">Шестидесятое </word>
7511
+ <word cardinal="70">Семьдесят-</word>
7512
+ <word ordinal="70">Семидесятое </word>
7513
+ <word cardinal="80">Восемьдесят-</word>
7514
+ <word ordinal="80">Восьмидесятое </word>
7515
+ <word cardinal="90">Девяносто-</word>
7516
+ <word ordinal="90">Девяностое </word>
7517
+ <word cardinal="100">Сто-</word>
7518
+ <word ordinal="100">Сотое </word>
7519
+ </xsl:when>
7520
+ <xsl:otherwise> <!-- default english -->
7521
+ <word cardinal="1">One-</word>
7522
+ <word ordinal="1">First </word>
7523
+ <word cardinal="2">Two-</word>
7524
+ <word ordinal="2">Second </word>
7525
+ <word cardinal="3">Three-</word>
7526
+ <word ordinal="3">Third </word>
7527
+ <word cardinal="4">Four-</word>
7528
+ <word ordinal="4">Fourth </word>
7529
+ <word cardinal="5">Five-</word>
7530
+ <word ordinal="5">Fifth </word>
7531
+ <word cardinal="6">Six-</word>
7532
+ <word ordinal="6">Sixth </word>
7533
+ <word cardinal="7">Seven-</word>
7534
+ <word ordinal="7">Seventh </word>
7535
+ <word cardinal="8">Eight-</word>
7536
+ <word ordinal="8">Eighth </word>
7537
+ <word cardinal="9">Nine-</word>
7538
+ <word ordinal="9">Ninth </word>
7539
+ <word ordinal="10">Tenth </word>
7540
+ <word ordinal="11">Eleventh </word>
7541
+ <word ordinal="12">Twelfth </word>
7542
+ <word ordinal="13">Thirteenth </word>
7543
+ <word ordinal="14">Fourteenth </word>
7544
+ <word ordinal="15">Fifteenth </word>
7545
+ <word ordinal="16">Sixteenth </word>
7546
+ <word ordinal="17">Seventeenth </word>
7547
+ <word ordinal="18">Eighteenth </word>
7548
+ <word ordinal="19">Nineteenth </word>
7549
+ <word cardinal="20">Twenty-</word>
7550
+ <word ordinal="20">Twentieth </word>
7551
+ <word cardinal="30">Thirty-</word>
7552
+ <word ordinal="30">Thirtieth </word>
7553
+ <word cardinal="40">Forty-</word>
7554
+ <word ordinal="40">Fortieth </word>
7555
+ <word cardinal="50">Fifty-</word>
7556
+ <word ordinal="50">Fiftieth </word>
7557
+ <word cardinal="60">Sixty-</word>
7558
+ <word ordinal="60">Sixtieth </word>
7559
+ <word cardinal="70">Seventy-</word>
7560
+ <word ordinal="70">Seventieth </word>
7561
+ <word cardinal="80">Eighty-</word>
7562
+ <word ordinal="80">Eightieth </word>
7563
+ <word cardinal="90">Ninety-</word>
7564
+ <word ordinal="90">Ninetieth </word>
7565
+ <word cardinal="100">Hundred-</word>
7566
+ <word ordinal="100">Hundredth </word>
7567
+ </xsl:otherwise>
7568
+ </xsl:choose>
6700
7569
  </words>
6701
7570
  </xsl:variable>
6702
7571
 
@@ -6770,4 +7639,18 @@
6770
7639
  <xsl:otherwise>_</xsl:otherwise>
6771
7640
  </xsl:choose>
6772
7641
  </xsl:attribute>
7642
+ </xsl:template><xsl:template name="substring-after-last">
7643
+ <xsl:param name="value"/>
7644
+ <xsl:param name="delimiter"/>
7645
+ <xsl:choose>
7646
+ <xsl:when test="contains($value, $delimiter)">
7647
+ <xsl:call-template name="substring-after-last">
7648
+ <xsl:with-param name="value" select="substring-after($value, $delimiter)"/>
7649
+ <xsl:with-param name="delimiter" select="$delimiter"/>
7650
+ </xsl:call-template>
7651
+ </xsl:when>
7652
+ <xsl:otherwise>
7653
+ <xsl:value-of select="$value"/>
7654
+ </xsl:otherwise>
7655
+ </xsl:choose>
6773
7656
  </xsl:template></xsl:stylesheet>