metanorma-un 0.8.2 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,22 +2,12 @@
2
2
 
3
3
  <xsl:output version="1.0" 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
  <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
11
6
 
12
7
 
13
8
 
14
9
 
15
10
 
16
- <xsl:variable name="marginLeftRight1" select="40"/>
17
- <xsl:variable name="marginLeftRight2" select="40"/>
18
- <xsl:variable name="marginTop" select="30"/>
19
- <xsl:variable name="marginBottom" select="40"/>
20
-
21
11
  <xsl:variable name="debug">false</xsl:variable>
22
12
 
23
13
  <xsl:variable name="contents">
@@ -33,9 +23,6 @@
33
23
  </contents>
34
24
  </xsl:variable>
35
25
 
36
- <xsl:variable name="lang">
37
- <xsl:call-template name="getLang"/>
38
- </xsl:variable>
39
26
 
40
27
  <xsl:variable name="title" select="/un:un-standard/un:bibdata/un:title[@language = 'en' and @type = 'main']"/>
41
28
 
@@ -436,15 +423,6 @@
436
423
  <xsl:otherwise>left</xsl:otherwise>
437
424
  </xsl:choose>
438
425
  </xsl:attribute>
439
- <!-- <xsl:choose>
440
- <xsl:when test="ancestor::un:sections">
441
- <fo:inline padding-right="10mm"><xsl:number format="1. " level="any" count="un:sections//un:clause/un:p"/></fo:inline>
442
- </xsl:when>
443
- <xsl:when test="ancestor::un:annex">
444
- <xsl:variable name="annex_id" select="ancestor::un:annex/@id"/>
445
- <fo:inline padding-right="10mm"><xsl:number format="1. " level="any" count="un:annex[@id = $annex_id]//un:clause/un:p"/></fo:inline>
446
- </xsl:when>
447
- </xsl:choose> -->
448
426
  <xsl:apply-templates/>
449
427
  </fo:block>
450
428
  </xsl:template>
@@ -494,56 +472,19 @@
494
472
  </fo:block>
495
473
  </xsl:template>
496
474
 
497
- <xsl:template match="un:p" name="paragraph"> <!-- priority="3" [not(parent::un:note)]-->
498
-
499
- <fo:block margin-bottom="6pt" line-height="122%">
500
- <xsl:if test="following-sibling::*">
501
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
502
- </xsl:if>
503
- <xsl:attribute name="text-align">
504
- <xsl:choose>
505
- <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
506
- <xsl:otherwise>justify</xsl:otherwise>
507
- </xsl:choose>
508
- </xsl:attribute>
509
- <xsl:apply-templates/>
510
- </fo:block>
511
-
512
- </xsl:template>
513
-
514
- <xsl:template match="un:p2">
515
- <fo:block-container margin-left="1mm">
516
- <fo:block margin-left="-1mm">
517
- <fo:list-block provisional-distance-between-starts="9mm" margin-bottom="6pt" line-height="122%">
518
- <xsl:attribute name="text-align">
519
- <xsl:choose>
520
- <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
521
- <xsl:otherwise>justify</xsl:otherwise>
522
- </xsl:choose>
523
- </xsl:attribute>
524
- <fo:list-item>
525
- <fo:list-item-label end-indent="label-end()">
526
- <fo:block>
527
- <xsl:choose>
528
- <xsl:when test="ancestor::un:sections">
529
- <xsl:number format="1. " level="any" count="un:sections//un:clause/un:p"/>
530
- </xsl:when>
531
- <xsl:when test="ancestor::un:annex">
532
- <xsl:variable name="annex_id" select="ancestor::un:annex/@id"/>
533
- <xsl:number format="1. " level="any" count="un:annex[@id = $annex_id]//un:p"/> <!-- //un:clause -->
534
- </xsl:when>
535
- </xsl:choose>
536
- </fo:block>
537
- </fo:list-item-label>
538
- <fo:list-item-body text-indent="body-start()">
539
- <fo:block>
540
- <xsl:text> </xsl:text><xsl:apply-templates/>
541
- </fo:block>
542
- </fo:list-item-body>
543
- </fo:list-item>
544
- </fo:list-block>
545
- </fo:block>
546
- </fo:block-container>
475
+ <xsl:template match="un:p" name="paragraph">
476
+ <fo:block margin-bottom="6pt" line-height="122%">
477
+ <xsl:if test="following-sibling::*">
478
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
479
+ </xsl:if>
480
+ <xsl:attribute name="text-align">
481
+ <xsl:choose>
482
+ <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
483
+ <xsl:otherwise>justify</xsl:otherwise>
484
+ </xsl:choose>
485
+ </xsl:attribute>
486
+ <xsl:apply-templates/>
487
+ </fo:block>
547
488
  </xsl:template>
548
489
 
549
490
 
@@ -553,65 +494,13 @@
553
494
  </fo:block>
554
495
  </xsl:template>
555
496
 
556
- <xsl:template match="un:ul | un:ol" mode="ul_ol">
497
+ <xsl:template match="un:ul | un:ol" mode="list" priority="2">
557
498
  <fo:block-container margin-left="8mm" text-indent="0mm">
558
- <fo:list-block provisional-distance-between-starts="4mm" margin-left="-8mm">
559
- <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
560
- </fo:list-block>
561
- <xsl:apply-templates select="./un:note"/>
499
+ <xsl:call-template name="list"/>
562
500
  </fo:block-container>
563
501
  </xsl:template>
564
502
 
565
503
 
566
- <xsl:template match="un:li">
567
- <xsl:variable name="level">
568
- <xsl:call-template name="getLevel"/>
569
- </xsl:variable>
570
- <fo:list-item>
571
- <fo:list-item-label end-indent="label-end()">
572
- <fo:block>
573
- <xsl:choose>
574
- <xsl:when test="local-name(..) = 'ul'">
575
- <xsl:call-template name="setULLabel"/>
576
- </xsl:when>
577
- <xsl:otherwise> <!-- for ordered lists -->
578
- <xsl:choose>
579
- <xsl:when test="../@type = 'arabic'">
580
- <xsl:number format="1."/>
581
- </xsl:when>
582
- <xsl:when test="../@type = 'alphabet'">
583
- <xsl:number format="1)"/>
584
- </xsl:when>
585
- <xsl:when test="ancestor::*[un:annex]">
586
- <xsl:choose>
587
- <xsl:when test="$level = 1">
588
- <xsl:number format="a)" lang="en"/>
589
- </xsl:when>
590
- <xsl:when test="$level = 2">
591
- <xsl:number format="i)"/>
592
- </xsl:when>
593
- <xsl:otherwise>
594
- <xsl:number format="1.)"/>
595
- </xsl:otherwise>
596
- </xsl:choose>
597
- </xsl:when>
598
- <xsl:otherwise>
599
- <xsl:number format="1."/>
600
- </xsl:otherwise>
601
- </xsl:choose>
602
- </xsl:otherwise>
603
- </xsl:choose>
604
- </fo:block>
605
- </fo:list-item-label>
606
- <fo:list-item-body start-indent="body-start()">
607
- <fo:block>
608
- <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
609
- <xsl:apply-templates select="./un:note"/>
610
- </fo:block>
611
- </fo:list-item-body>
612
- </fo:list-item>
613
- </xsl:template>
614
-
615
504
  <xsl:template match="un:li//un:p">
616
505
  <fo:block margin-bottom="6pt" line-height="122%" text-align="justify">
617
506
  <xsl:apply-templates/>
@@ -861,49 +750,6 @@
861
750
  <xsl:template match="un:docidentifier"/>
862
751
 
863
752
 
864
- <xsl:template match="un:formula" name="formula-un" priority="2">
865
- <fo:block-container margin-left="0mm">
866
- <xsl:if test="parent::*[local-name() = 'note']">
867
- <xsl:attribute name="margin-left">
868
- <xsl:choose>
869
- <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
870
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
871
- </xsl:choose>
872
- </xsl:attribute>
873
- </xsl:if>
874
- <fo:block-container margin-left="0mm">
875
-
876
- <fo:block id="{@id}" margin-top="6pt">
877
- <fo:table table-layout="fixed" width="100%">
878
- <fo:table-column column-width="95%"/>
879
- <fo:table-column column-width="5%"/>
880
- <fo:table-body>
881
- <fo:table-row>
882
- <fo:table-cell>
883
- <fo:block text-align="center">
884
- <xsl:if test="ancestor::un:annex">
885
- <xsl:attribute name="text-align">left</xsl:attribute>
886
- <xsl:attribute name="margin-left">7mm</xsl:attribute>
887
- </xsl:if>
888
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
889
- </fo:block>
890
- </fo:table-cell>
891
- <fo:table-cell> <!-- display-align="center" -->
892
- <fo:block text-align="right">
893
- <xsl:apply-templates select="un:name"/>
894
- </fo:block>
895
- </fo:table-cell>
896
- </fo:table-row>
897
- </fo:table-body>
898
- </fo:table>
899
- </fo:block>
900
-
901
- </fo:block-container>
902
- </fo:block-container>
903
- </xsl:template>
904
-
905
-
906
-
907
753
 
908
754
  <xsl:template match="un:dl" priority="2">
909
755
  <fo:block-container margin-left="0mm">
@@ -979,11 +825,21 @@
979
825
  <xsl:text>iVBORw0KGgoAAAANSUhEUgAAAJkAAAAmCAYAAADXwDkaAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA+lpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29s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d1OefiZp2SwkH7fIApxnIhHgN/uwSnK9rHMGlTzW27fbttd6WZ4vyOjg6GU1zf67RY5eXlZTt37mz3PliWCaHL5ubmlm7QhsvK9sMi/W48Holu2rQxfTIvEVlcrPTjqe4EZ7CgwBdra9uSmtcPt6eta6FynHEJKYGv2Jd90s86AQpAwNJsRuT5xUAHrKK4IkCd9g6NQAQPIi8vz4f5o72tANZVgO/GMpe59RvrtQvt7JMQLS0dAyI9sst1m7uTuL28gqwJBqfh8pTaWOTqTIvSblYxVtTe2RnbvHlzg/fsEofcLK4oasda9edCs9An49viDe3tm3sS2YHA/gAL39Le/tU2lGFS0mphWYsBlhI432690j5UQnnB0DjXjuv/Pkr/knwu5fQOx46PR+RzPKz5FG+vOtVFmJn08mQq/ix17K4bM722kS3f8O0J0IOnwddK6jo7zqrx5f7EdckzAOrK/5erFeIorlh4YH/pthHXfac7449A8DVAaRXYTgUQ4wdj/xgw8ytFk7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO8nXeWcqW3QOHeLyryF/Q4L3BoEhzW+fOO0A12vewbTZxj6/yWeCqz4J31WY1ny3/F6UYkeY68LIzhtsxa8myZailU1K6HlxN/x9kjcPp+HcBBgAS2JZd+kqHSQAAAABJRU5ErkJggg==</xsl:text>
980
826
  </xsl:variable>
981
827
 
982
- <xsl:variable name="pageWidth_">
828
+ <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:variable name="lang">
829
+ <xsl:call-template name="getLang"/>
830
+ </xsl:variable><xsl:variable name="pageWidth_">
983
831
  210
984
832
  </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_">
985
833
  297
986
- </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="titles_">
834
+ </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="marginLeftRight1_">
835
+ 40
836
+ </xsl:variable><xsl:variable name="marginLeftRight1" select="normalize-space($marginLeftRight1_)"/><xsl:variable name="marginLeftRight2_">
837
+ 40
838
+ </xsl:variable><xsl:variable name="marginLeftRight2" select="normalize-space($marginLeftRight2_)"/><xsl:variable name="marginTop_">
839
+ 30
840
+ </xsl:variable><xsl:variable name="marginTop" select="normalize-space($marginTop_)"/><xsl:variable name="marginBottom_">
841
+ 40
842
+ </xsl:variable><xsl:variable name="marginBottom" select="normalize-space($marginBottom_)"/><xsl:variable name="titles_">
987
843
 
988
844
  <title-edition lang="en">
989
845
 
@@ -1043,7 +899,7 @@
1043
899
  </xsl:variable><xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="bibdata">
1044
900
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
1045
901
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
1046
- </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
902
+ </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">
1047
903
  <xsl:param name="name"/>
1048
904
  <xsl:param name="lang"/>
1049
905
  <xsl:variable name="lang_">
@@ -1066,7 +922,7 @@
1066
922
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
1067
923
  </xsl:otherwise>
1068
924
  </xsl:choose>
1069
- </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">
925
+ </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">
1070
926
 
1071
927
 
1072
928
 
@@ -1221,7 +1077,7 @@
1221
1077
 
1222
1078
 
1223
1079
  </xsl:attribute-set><xsl:attribute-set name="example-name-style">
1224
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
1080
+
1225
1081
 
1226
1082
 
1227
1083
 
@@ -1235,6 +1091,7 @@
1235
1091
 
1236
1092
 
1237
1093
 
1094
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1238
1095
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1239
1096
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1240
1097
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -1607,7 +1464,8 @@
1607
1464
 
1608
1465
 
1609
1466
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1610
- <xsl:attribute name="role">BlockQuote</xsl:attribute>
1467
+ <xsl:attribute name="margin-left">12mm</xsl:attribute>
1468
+ <xsl:attribute name="margin-right">12mm</xsl:attribute>
1611
1469
 
1612
1470
 
1613
1471
 
@@ -1616,9 +1474,9 @@
1616
1474
 
1617
1475
 
1618
1476
  </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
1477
+ <xsl:attribute name="text-align">right</xsl:attribute>
1619
1478
 
1620
1479
 
1621
-
1622
1480
  </xsl:attribute-set><xsl:attribute-set name="termsource-style">
1623
1481
 
1624
1482
 
@@ -1637,6 +1495,9 @@
1637
1495
 
1638
1496
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1639
1497
 
1498
+ </xsl:attribute-set><xsl:attribute-set name="term-name-style">
1499
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1500
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1640
1501
  </xsl:attribute-set><xsl:attribute-set name="figure-style">
1641
1502
 
1642
1503
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
@@ -1665,6 +1526,33 @@
1665
1526
 
1666
1527
 
1667
1528
  </xsl:attribute-set><xsl:attribute-set name="formula-style">
1529
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1530
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1531
+
1532
+
1533
+
1534
+
1535
+
1536
+
1537
+ </xsl:attribute-set><xsl:attribute-set name="formula-stem-block-style">
1538
+ <xsl:attribute name="text-align">center</xsl:attribute>
1539
+
1540
+
1541
+
1542
+
1543
+
1544
+
1545
+
1546
+
1547
+
1548
+
1549
+
1550
+ </xsl:attribute-set><xsl:attribute-set name="formula-stem-number-style">
1551
+ <xsl:attribute name="text-align">right</xsl:attribute>
1552
+
1553
+
1554
+
1555
+
1668
1556
 
1669
1557
  </xsl:attribute-set><xsl:attribute-set name="image-style">
1670
1558
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -1703,6 +1591,18 @@
1703
1591
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1704
1592
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1705
1593
 
1594
+ </xsl:attribute-set><xsl:attribute-set name="preferred-block-style">
1595
+
1596
+
1597
+
1598
+
1599
+
1600
+
1601
+ </xsl:attribute-set><xsl:attribute-set name="preferred-term-style">
1602
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1603
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1604
+
1605
+
1706
1606
  </xsl:attribute-set><xsl:attribute-set name="domain-style">
1707
1607
 
1708
1608
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
@@ -1736,6 +1636,36 @@
1736
1636
 
1737
1637
  </xsl:attribute-set><xsl:attribute-set name="list-style">
1738
1638
 
1639
+
1640
+
1641
+
1642
+
1643
+
1644
+
1645
+
1646
+
1647
+
1648
+
1649
+
1650
+
1651
+
1652
+
1653
+
1654
+ <xsl:attribute name="provisional-distance-between-starts">4mm</xsl:attribute>
1655
+ <xsl:attribute name="margin-left">-8mm</xsl:attribute>
1656
+
1657
+
1658
+ </xsl:attribute-set><xsl:attribute-set name="list-item-style">
1659
+
1660
+
1661
+ </xsl:attribute-set><xsl:attribute-set name="list-item-label-style">
1662
+
1663
+
1664
+
1665
+ </xsl:attribute-set><xsl:attribute-set name="list-item-body-style">
1666
+
1667
+
1668
+
1739
1669
  </xsl:attribute-set><xsl:attribute-set name="toc-style">
1740
1670
  <xsl:attribute name="line-height">135%</xsl:attribute>
1741
1671
  </xsl:attribute-set><xsl:attribute-set name="fn-reference-style">
@@ -2018,6 +1948,111 @@
2018
1948
 
2019
1949
 
2020
1950
 
1951
+ </xsl:attribute-set><xsl:attribute-set name="hljs-doctag">
1952
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
1953
+ </xsl:attribute-set><xsl:attribute-set name="hljs-keyword">
1954
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
1955
+ </xsl:attribute-set><xsl:attribute-set name="hljs-meta_hljs-keyword">
1956
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
1957
+ </xsl:attribute-set><xsl:attribute-set name="hljs-template-tag">
1958
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
1959
+ </xsl:attribute-set><xsl:attribute-set name="hljs-template-variable">
1960
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
1961
+ </xsl:attribute-set><xsl:attribute-set name="hljs-type">
1962
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
1963
+ </xsl:attribute-set><xsl:attribute-set name="hljs-variable_and_language_">
1964
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
1965
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title">
1966
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
1967
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_class_">
1968
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
1969
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_class__and_inherited__">
1970
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
1971
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_function_">
1972
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
1973
+ </xsl:attribute-set><xsl:attribute-set name="hljs-attr">
1974
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
1975
+ </xsl:attribute-set><xsl:attribute-set name="hljs-attribute">
1976
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
1977
+ </xsl:attribute-set><xsl:attribute-set name="hljs-literal">
1978
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
1979
+ </xsl:attribute-set><xsl:attribute-set name="hljs-meta">
1980
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
1981
+ </xsl:attribute-set><xsl:attribute-set name="hljs-number">
1982
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
1983
+ </xsl:attribute-set><xsl:attribute-set name="hljs-operator">
1984
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
1985
+ </xsl:attribute-set><xsl:attribute-set name="hljs-variable">
1986
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
1987
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-attr">
1988
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
1989
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-class">
1990
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
1991
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-id">
1992
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
1993
+ </xsl:attribute-set><xsl:attribute-set name="hljs-regexp">
1994
+ <xsl:attribute name="color">#032f62</xsl:attribute>
1995
+ </xsl:attribute-set><xsl:attribute-set name="hljs-string">
1996
+ <xsl:attribute name="color">#032f62</xsl:attribute>
1997
+ </xsl:attribute-set><xsl:attribute-set name="hljs-meta_hljs-string">
1998
+ <xsl:attribute name="color">#032f62</xsl:attribute>
1999
+ </xsl:attribute-set><xsl:attribute-set name="hljs-built_in">
2000
+ <xsl:attribute name="color">#e36209</xsl:attribute>
2001
+ </xsl:attribute-set><xsl:attribute-set name="hljs-symbol">
2002
+ <xsl:attribute name="color">#e36209</xsl:attribute>
2003
+ </xsl:attribute-set><xsl:attribute-set name="hljs-comment">
2004
+ <xsl:attribute name="color">#6a737d</xsl:attribute>
2005
+ </xsl:attribute-set><xsl:attribute-set name="hljs-code">
2006
+ <xsl:attribute name="color">#6a737d</xsl:attribute>
2007
+ </xsl:attribute-set><xsl:attribute-set name="hljs-formula">
2008
+ <xsl:attribute name="color">#6a737d</xsl:attribute>
2009
+ </xsl:attribute-set><xsl:attribute-set name="hljs-name">
2010
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2011
+ </xsl:attribute-set><xsl:attribute-set name="hljs-quote">
2012
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2013
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-tag">
2014
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2015
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-pseudo">
2016
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2017
+ </xsl:attribute-set><xsl:attribute-set name="hljs-subst">
2018
+ <xsl:attribute name="color">#24292e</xsl:attribute>
2019
+ </xsl:attribute-set><xsl:attribute-set name="hljs-section">
2020
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2021
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2022
+ </xsl:attribute-set><xsl:attribute-set name="hljs-bullet">
2023
+ <xsl:attribute name="color">#735c0f</xsl:attribute>
2024
+ </xsl:attribute-set><xsl:attribute-set name="hljs-emphasis">
2025
+ <xsl:attribute name="color">#24292e</xsl:attribute>
2026
+ <xsl:attribute name="font-style">italic</xsl:attribute>
2027
+ </xsl:attribute-set><xsl:attribute-set name="hljs-strong">
2028
+ <xsl:attribute name="color">#24292e</xsl:attribute>
2029
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2030
+ </xsl:attribute-set><xsl:attribute-set name="hljs-addition">
2031
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2032
+ <xsl:attribute name="background-color">#f0fff4</xsl:attribute>
2033
+ </xsl:attribute-set><xsl:attribute-set name="hljs-deletion">
2034
+ <xsl:attribute name="color">#b31d28</xsl:attribute>
2035
+ <xsl:attribute name="background-color">#ffeef0</xsl:attribute>
2036
+ </xsl:attribute-set><xsl:attribute-set name="hljs-char_and_escape_">
2037
+ </xsl:attribute-set><xsl:attribute-set name="hljs-link">
2038
+ </xsl:attribute-set><xsl:attribute-set name="hljs-params">
2039
+ </xsl:attribute-set><xsl:attribute-set name="hljs-property">
2040
+ </xsl:attribute-set><xsl:attribute-set name="hljs-punctuation">
2041
+ </xsl:attribute-set><xsl:attribute-set name="hljs-tag">
2042
+ </xsl:attribute-set><xsl:attribute-set name="indexsect-title-style">
2043
+ <xsl:attribute name="role">H1</xsl:attribute>
2044
+
2045
+
2046
+
2047
+
2048
+
2049
+ </xsl:attribute-set><xsl:attribute-set name="indexsect-clause-title-style">
2050
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2051
+
2052
+
2053
+
2054
+
2055
+
2021
2056
  </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">
2022
2057
  <xsl:for-each select="/*/*[local-name()='preface']/*">
2023
2058
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -2104,9 +2139,12 @@
2104
2139
 
2105
2140
 
2106
2141
  </xsl:template><xsl:template match="*[local-name()='legal-statement']//*[local-name()='p']">
2142
+ <xsl:param name="margin"/>
2107
2143
 
2108
2144
  <!-- process in the template 'paragraph' -->
2109
- <xsl:call-template name="paragraph"/>
2145
+ <xsl:call-template name="paragraph">
2146
+ <xsl:with-param name="margin" select="$margin"/>
2147
+ </xsl:call-template>
2110
2148
 
2111
2149
  </xsl:template><xsl:template match="*[local-name()='feedback-statement']">
2112
2150
  <fo:block xsl:use-attribute-sets="feedback-statement-style">
@@ -2118,9 +2156,12 @@
2118
2156
  <xsl:call-template name="title"/>
2119
2157
 
2120
2158
  </xsl:template><xsl:template match="*[local-name()='feedback-statement']//*[local-name()='p']">
2159
+ <xsl:param name="margin"/>
2121
2160
 
2122
2161
  <!-- process in the template 'paragraph' -->
2123
- <xsl:call-template name="paragraph"/>
2162
+ <xsl:call-template name="paragraph">
2163
+ <xsl:with-param name="margin" select="$margin"/>
2164
+ </xsl:call-template>
2124
2165
 
2125
2166
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
2126
2167
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
@@ -2468,8 +2509,7 @@
2468
2509
  </xsl:call-template>
2469
2510
  </xsl:if>
2470
2511
  </xsl:template><xsl:template match="text()" mode="td_text">
2471
- <xsl:variable name="zero-space">​</xsl:variable>
2472
- <xsl:value-of select="translate(., $zero-space, ' ')"/><xsl:text> </xsl:text>
2512
+ <xsl:value-of select="translate(., $zero_width_space, ' ')"/><xsl:text> </xsl:text>
2473
2513
  </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
2474
2514
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
2475
2515
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
@@ -3447,20 +3487,44 @@
3447
3487
  <fo:inline text-decoration="underline">
3448
3488
  <xsl:apply-templates/>
3449
3489
  </fo:inline>
3450
- </xsl:template><xsl:template match="*[local-name()='add']">
3490
+ </xsl:template><xsl:template match="*[local-name()='add']" name="tag_add">
3451
3491
  <xsl:param name="skip">true</xsl:param>
3492
+ <xsl:param name="block">false</xsl:param>
3493
+ <xsl:param name="type"/>
3494
+ <xsl:param name="text-align"/>
3452
3495
  <xsl:choose>
3453
3496
  <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
3454
3497
  <xsl:choose>
3455
- <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>
3498
+ <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>
3456
3499
  <xsl:otherwise>
3457
- <fo:inline>
3500
+ <xsl:variable name="tag">
3458
3501
  <xsl:call-template name="insertTag">
3459
- <xsl:with-param name="type" select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end -->
3502
+ <xsl:with-param name="type">
3503
+ <xsl:choose>
3504
+ <xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
3505
+ <xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
3506
+ </xsl:choose>
3507
+ </xsl:with-param>
3460
3508
  <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
3461
3509
  <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
3462
3510
  </xsl:call-template>
3463
- </fo:inline>
3511
+ </xsl:variable>
3512
+ <xsl:choose>
3513
+ <xsl:when test="$block = 'false'">
3514
+ <fo:inline>
3515
+ <xsl:copy-of select="$tag"/>
3516
+ </fo:inline>
3517
+ </xsl:when>
3518
+ <xsl:otherwise>
3519
+ <fo:block> <!-- for around figures -->
3520
+ <xsl:if test="$text-align != ''">
3521
+ <xsl:attribute name="text-align"><xsl:value-of select="$text-align"/></xsl:attribute>
3522
+ </xsl:if>
3523
+ <xsl:copy-of select="$tag"/>
3524
+ </fo:block>
3525
+ </xsl:otherwise>
3526
+ </xsl:choose>
3527
+
3464
3528
  </xsl:otherwise>
3465
3529
  </xsl:choose>
3466
3530
  </xsl:when>
@@ -3819,17 +3883,21 @@
3819
3883
  </xsl:apply-templates>
3820
3884
  </xsl:template><xsl:template name="getLang">
3821
3885
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3822
- <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3823
3886
  <xsl:variable name="language">
3824
3887
  <xsl:choose>
3825
3888
  <xsl:when test="$language_current != ''">
3826
3889
  <xsl:value-of select="$language_current"/>
3827
3890
  </xsl:when>
3828
- <xsl:when test="$language_current_2 != ''">
3829
- <xsl:value-of select="$language_current_2"/>
3830
- </xsl:when>
3831
3891
  <xsl:otherwise>
3832
- <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3892
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3893
+ <xsl:choose>
3894
+ <xsl:when test="$language_current_2 != ''">
3895
+ <xsl:value-of select="$language_current_2"/>
3896
+ </xsl:when>
3897
+ <xsl:otherwise>
3898
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3899
+ </xsl:otherwise>
3900
+ </xsl:choose>
3833
3901
  </xsl:otherwise>
3834
3902
  </xsl:choose>
3835
3903
  </xsl:variable>
@@ -4046,8 +4114,8 @@
4046
4114
 
4047
4115
  </xsl:if>
4048
4116
  <fo:block-container margin-left="0mm">
4049
- <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
4050
- <xsl:apply-templates/>
4117
+ <fo:block id="{@id}">
4118
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
4051
4119
  </fo:block>
4052
4120
  </fo:block-container>
4053
4121
  </fo:block-container>
@@ -4059,10 +4127,48 @@
4059
4127
  <fo:inline>
4060
4128
  <xsl:apply-templates/>
4061
4129
  </fo:inline>
4062
- </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 -->
4130
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
4063
4131
  <xsl:if test="normalize-space() != ''">
4064
4132
  <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
4065
4133
  </xsl:if>
4134
+ </xsl:template><xsl:template match="*[local-name() = 'formula'][*[local-name() = 'name']]/*[local-name() = 'stem']">
4135
+ <fo:block xsl:use-attribute-sets="formula-style">
4136
+
4137
+
4138
+
4139
+ <fo:table table-layout="fixed" width="100%">
4140
+ <fo:table-column column-width="95%"/>
4141
+ <fo:table-column column-width="5%"/>
4142
+ <fo:table-body>
4143
+ <fo:table-row>
4144
+ <fo:table-cell display-align="center">
4145
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style">
4146
+
4147
+
4148
+ <xsl:if test="ancestor::*[local-name() ='annex']">
4149
+ <xsl:attribute name="text-align">left</xsl:attribute>
4150
+ <xsl:attribute name="margin-left">7mm</xsl:attribute>
4151
+ </xsl:if>
4152
+
4153
+
4154
+ <xsl:apply-templates/>
4155
+ </fo:block>
4156
+ </fo:table-cell>
4157
+ <fo:table-cell display-align="center">
4158
+ <fo:block xsl:use-attribute-sets="formula-stem-number-style">
4159
+ <xsl:apply-templates select="../*[local-name() = 'name']"/>
4160
+ </fo:block>
4161
+ </fo:table-cell>
4162
+ </fo:table-row>
4163
+ </fo:table-body>
4164
+ </fo:table>
4165
+ </fo:block>
4166
+ </xsl:template><xsl:template match="*[local-name() = 'formula'][not(*[local-name() = 'name'])]/*[local-name() = 'stem']">
4167
+ <fo:block xsl:use-attribute-sets="formula-style">
4168
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style">
4169
+ <xsl:apply-templates/>
4170
+ </fo:block>
4171
+ </fo:block>
4066
4172
  </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
4067
4173
 
4068
4174
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
@@ -5021,12 +5127,140 @@
5021
5127
  </fo:block-container>
5022
5128
  </fo:block-container>
5023
5129
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
5024
- <xsl:variable name="text">
5130
+ <xsl:choose>
5131
+ <xsl:when test="normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
5132
+ <xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
5133
+ <xsl:choose>
5134
+ <xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
5135
+ <xsl:apply-templates select="xalan:nodeset($syntax)" mode="syntax_highlight"/> <!-- process span tags -->
5136
+ </xsl:when>
5137
+ <xsl:otherwise> <!-- if case of non-succesfull syntax highlight (for instance, unknown lang), process without highlighting -->
5138
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
5139
+ </xsl:otherwise>
5140
+ </xsl:choose>
5141
+ </xsl:when>
5142
+ <xsl:otherwise>
5143
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
5144
+ </xsl:otherwise>
5145
+ </xsl:choose>
5146
+
5147
+ </xsl:template><xsl:template name="add_spaces_to_sourcecode">
5148
+ <xsl:variable name="text_step1">
5025
5149
  <xsl:call-template name="add-zero-spaces-equal"/>
5026
5150
  </xsl:variable>
5027
- <xsl:call-template name="add-zero-spaces-java">
5028
- <xsl:with-param name="text" select="$text"/>
5029
- </xsl:call-template>
5151
+ <xsl:variable name="text_step2">
5152
+ <xsl:call-template name="add-zero-spaces-java">
5153
+ <xsl:with-param name="text" select="$text_step1"/>
5154
+ </xsl:call-template>
5155
+ </xsl:variable>
5156
+ <xsl:value-of select="$text_step2"/>
5157
+ </xsl:template><xsl:template match="*" mode="syntax_highlight">
5158
+ <xsl:apply-templates mode="syntax_highlight"/>
5159
+ </xsl:template><xsl:variable name="syntax_highlight_styles_">
5160
+ <style class="hljs-addition" xsl:use-attribute-sets="hljs-addition"/>
5161
+ <style class="hljs-attr" xsl:use-attribute-sets="hljs-attr"/>
5162
+ <style class="hljs-attribute" xsl:use-attribute-sets="hljs-attribute"/>
5163
+ <style class="hljs-built_in" xsl:use-attribute-sets="hljs-built_in"/>
5164
+ <style class="hljs-bullet" xsl:use-attribute-sets="hljs-bullet"/>
5165
+ <style class="hljs-char_and_escape_" xsl:use-attribute-sets="hljs-char_and_escape_"/>
5166
+ <style class="hljs-code" xsl:use-attribute-sets="hljs-code"/>
5167
+ <style class="hljs-comment" xsl:use-attribute-sets="hljs-comment"/>
5168
+ <style class="hljs-deletion" xsl:use-attribute-sets="hljs-deletion"/>
5169
+ <style class="hljs-doctag" xsl:use-attribute-sets="hljs-doctag"/>
5170
+ <style class="hljs-emphasis" xsl:use-attribute-sets="hljs-emphasis"/>
5171
+ <style class="hljs-formula" xsl:use-attribute-sets="hljs-formula"/>
5172
+ <style class="hljs-keyword" xsl:use-attribute-sets="hljs-keyword"/>
5173
+ <style class="hljs-link" xsl:use-attribute-sets="hljs-link"/>
5174
+ <style class="hljs-literal" xsl:use-attribute-sets="hljs-literal"/>
5175
+ <style class="hljs-meta" xsl:use-attribute-sets="hljs-meta"/>
5176
+ <style class="hljs-meta_hljs-string" xsl:use-attribute-sets="hljs-meta_hljs-string"/>
5177
+ <style class="hljs-meta_hljs-keyword" xsl:use-attribute-sets="hljs-meta_hljs-keyword"/>
5178
+ <style class="hljs-name" xsl:use-attribute-sets="hljs-name"/>
5179
+ <style class="hljs-number" xsl:use-attribute-sets="hljs-number"/>
5180
+ <style class="hljs-operator" xsl:use-attribute-sets="hljs-operator"/>
5181
+ <style class="hljs-params" xsl:use-attribute-sets="hljs-params"/>
5182
+ <style class="hljs-property" xsl:use-attribute-sets="hljs-property"/>
5183
+ <style class="hljs-punctuation" xsl:use-attribute-sets="hljs-punctuation"/>
5184
+ <style class="hljs-quote" xsl:use-attribute-sets="hljs-quote"/>
5185
+ <style class="hljs-regexp" xsl:use-attribute-sets="hljs-regexp"/>
5186
+ <style class="hljs-section" xsl:use-attribute-sets="hljs-section"/>
5187
+ <style class="hljs-selector-attr" xsl:use-attribute-sets="hljs-selector-attr"/>
5188
+ <style class="hljs-selector-class" xsl:use-attribute-sets="hljs-selector-class"/>
5189
+ <style class="hljs-selector-id" xsl:use-attribute-sets="hljs-selector-id"/>
5190
+ <style class="hljs-selector-pseudo" xsl:use-attribute-sets="hljs-selector-pseudo"/>
5191
+ <style class="hljs-selector-tag" xsl:use-attribute-sets="hljs-selector-tag"/>
5192
+ <style class="hljs-string" xsl:use-attribute-sets="hljs-string"/>
5193
+ <style class="hljs-strong" xsl:use-attribute-sets="hljs-strong"/>
5194
+ <style class="hljs-subst" xsl:use-attribute-sets="hljs-subst"/>
5195
+ <style class="hljs-symbol" xsl:use-attribute-sets="hljs-symbol"/>
5196
+ <style class="hljs-tag" xsl:use-attribute-sets="hljs-tag"/>
5197
+ <!-- <style class="hljs-tag_hljs-attr" xsl:use-attribute-sets="hljs-tag_hljs-attr"></style> -->
5198
+ <!-- <style class="hljs-tag_hljs-name" xsl:use-attribute-sets="hljs-tag_hljs-name"></style> -->
5199
+ <style class="hljs-template-tag" xsl:use-attribute-sets="hljs-template-tag"/>
5200
+ <style class="hljs-template-variable" xsl:use-attribute-sets="hljs-template-variable"/>
5201
+ <style class="hljs-title" xsl:use-attribute-sets="hljs-title"/>
5202
+ <style class="hljs-title_and_class_" xsl:use-attribute-sets="hljs-title_and_class_"/>
5203
+ <style class="hljs-title_and_class__and_inherited__" xsl:use-attribute-sets="hljs-title_and_class__and_inherited__"/>
5204
+ <style class="hljs-title_and_function_" xsl:use-attribute-sets="hljs-title_and_function_"/>
5205
+ <style class="hljs-type" xsl:use-attribute-sets="hljs-type"/>
5206
+ <style class="hljs-variable" xsl:use-attribute-sets="hljs-variable"/>
5207
+ <style class="hljs-variable_and_language_" xsl:use-attribute-sets="hljs-variable_and_language_"/>
5208
+ </xsl:variable><xsl:variable name="syntax_highlight_styles" select="xalan:nodeset($syntax_highlight_styles_)"/><xsl:template match="span" mode="syntax_highlight" priority="2">
5209
+ <!-- <fo:inline color="green" font-style="italic"><xsl:apply-templates mode="syntax_highlight"/></fo:inline> -->
5210
+ <fo:inline>
5211
+ <xsl:variable name="classes_">
5212
+ <xsl:call-template name="split">
5213
+ <xsl:with-param name="pText" select="@class"/>
5214
+ <xsl:with-param name="sep" select="' '"/>
5215
+ </xsl:call-template>
5216
+ <!-- a few classes together (_and_ suffix) -->
5217
+ <xsl:if test="contains(@class, 'hljs-char') and contains(@class, 'escape_')">
5218
+ <item>hljs-char_and_escape_</item>
5219
+ </xsl:if>
5220
+ <xsl:if test="contains(@class, 'hljs-title') and contains(@class, 'class_')">
5221
+ <item>hljs-title_and_class_</item>
5222
+ </xsl:if>
5223
+ <xsl:if test="contains(@class, 'hljs-title') and contains(@class, 'class_') and contains(@class, 'inherited__')">
5224
+ <item>hljs-title_and_class__and_inherited__</item>
5225
+ </xsl:if>
5226
+ <xsl:if test="contains(@class, 'hljs-title') and contains(@class, 'function_')">
5227
+ <item>hljs-title_and_function_</item>
5228
+ </xsl:if>
5229
+ <xsl:if test="contains(@class, 'hljs-variable') and contains(@class, 'language_')">
5230
+ <item>hljs-variable_and_language_</item>
5231
+ </xsl:if>
5232
+ <!-- with parent classes (_ suffix) -->
5233
+ <xsl:if test="contains(@class, 'hljs-keyword') and contains(ancestor::*/@class, 'hljs-meta')">
5234
+ <item>hljs-meta_hljs-keyword</item>
5235
+ </xsl:if>
5236
+ <xsl:if test="contains(@class, 'hljs-string') and contains(ancestor::*/@class, 'hljs-meta')">
5237
+ <item>hljs-meta_hljs-string</item>
5238
+ </xsl:if>
5239
+ </xsl:variable>
5240
+ <xsl:variable name="classes" select="xalan:nodeset($classes_)"/>
5241
+
5242
+ <xsl:for-each select="$classes/item">
5243
+ <xsl:variable name="class_name" select="."/>
5244
+ <xsl:for-each select="$syntax_highlight_styles/style[@class = $class_name]/@*[not(local-name() = 'class')]">
5245
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
5246
+ </xsl:for-each>
5247
+ </xsl:for-each>
5248
+
5249
+ <!-- <xsl:variable name="class_name">
5250
+ <xsl:choose>
5251
+ <xsl:when test="@class = 'hljs-attr' and ancestor::*/@class = 'hljs-tag'">hljs-tag_hljs-attr</xsl:when>
5252
+ <xsl:when test="@class = 'hljs-name' and ancestor::*/@class = 'hljs-tag'">hljs-tag_hljs-name</xsl:when>
5253
+ <xsl:when test="@class = 'hljs-string' and ancestor::*/@class = 'hljs-meta'">hljs-meta_hljs-string</xsl:when>
5254
+ <xsl:otherwise><xsl:value-of select="@class"/></xsl:otherwise>
5255
+ </xsl:choose>
5256
+ </xsl:variable>
5257
+ <xsl:for-each select="$syntax_highlight_styles/style[@class = $class_name]/@*[not(local-name() = 'class')]">
5258
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
5259
+ </xsl:for-each> -->
5260
+
5261
+ <xsl:apply-templates mode="syntax_highlight"/></fo:inline>
5262
+ </xsl:template><xsl:template match="text()" mode="syntax_highlight" priority="2">
5263
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
5030
5264
  </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']">
5031
5265
  <xsl:if test="normalize-space() != ''">
5032
5266
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
@@ -5401,11 +5635,14 @@
5401
5635
 
5402
5636
 
5403
5637
  <fo:block-container margin-left="0mm">
5404
-
5405
- <fo:block xsl:use-attribute-sets="quote-style">
5638
+ <fo:block-container xsl:use-attribute-sets="quote-style">
5406
5639
 
5407
- <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5408
- </fo:block>
5640
+ <fo:block-container margin-left="0mm" margin-right="0mm">
5641
+ <fo:block role="BlockQuote">
5642
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5643
+ </fo:block>
5644
+ </fo:block-container>
5645
+ </fo:block-container>
5409
5646
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
5410
5647
  <fo:block xsl:use-attribute-sets="quote-source-style">
5411
5648
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
@@ -5552,6 +5789,31 @@
5552
5789
  <xsl:with-param name="count" select="$count - 1"/>
5553
5790
  </xsl:call-template>
5554
5791
  </xsl:if>
5792
+ </xsl:template><xsl:template match="*[local-name() = 'preferred']">
5793
+ <xsl:variable name="level">
5794
+ <xsl:call-template name="getLevel"/>
5795
+ </xsl:variable>
5796
+ <xsl:variable name="font-size">
5797
+ inherit
5798
+ </xsl:variable>
5799
+ <xsl:variable name="levelTerm">
5800
+ <xsl:call-template name="getLevelTermName"/>
5801
+ </xsl:variable>
5802
+ <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
5803
+
5804
+
5805
+
5806
+ <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
5807
+ <fo:block xsl:use-attribute-sets="term-name-style">
5808
+ <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
5809
+ </fo:block>
5810
+ </xsl:if>
5811
+
5812
+ <fo:block xsl:use-attribute-sets="preferred-term-style">
5813
+ <xsl:call-template name="setStyle_preferred"/>
5814
+ <xsl:apply-templates/>
5815
+ </fo:block>
5816
+ </fo:block>
5555
5817
  </xsl:template><xsl:template match="*[local-name() = 'domain']">
5556
5818
  <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
5557
5819
  <xsl:text> </xsl:text>
@@ -5645,24 +5907,8 @@
5645
5907
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
5646
5908
  </xsl:template><xsl:variable name="ul_labels_">
5647
5909
 
5648
-
5649
-
5650
-
5651
-
5652
-
5653
-
5654
-
5655
-
5656
-
5657
-
5658
-
5659
-
5660
-
5661
-
5662
-
5663
- <label>•</label>
5664
-
5665
-
5910
+ <label>•</label>
5911
+
5666
5912
  </xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
5667
5913
  <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
5668
5914
  <xsl:variable name="list_level">
@@ -5688,6 +5934,91 @@
5688
5934
  </xsl:template><xsl:template match="label" mode="ul_labels">
5689
5935
  <xsl:copy-of select="@*[not(local-name() = 'level')]"/>
5690
5936
  <xsl:value-of select="."/>
5937
+ </xsl:template><xsl:template name="getListItemFormat">
5938
+ <!-- Example: for BSI <?list-type loweralpha?> -->
5939
+ <xsl:variable name="processing_instruction_type" select="normalize-space(../preceding-sibling::*[1]/processing-instruction('list-type'))"/>
5940
+ <xsl:choose>
5941
+ <xsl:when test="local-name(..) = 'ul'">
5942
+ <xsl:choose>
5943
+ <xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/>
5944
+ <xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
5945
+ </xsl:choose>
5946
+ </xsl:when>
5947
+ <xsl:otherwise> <!-- for ordered lists 'ol' -->
5948
+
5949
+ <!-- Example: for BSI <?list-start 2?> -->
5950
+ <xsl:variable name="processing_instruction_start" select="normalize-space(../preceding-sibling::*[1]/processing-instruction('list-start'))"/>
5951
+
5952
+ <xsl:variable name="start_value">
5953
+ <xsl:choose>
5954
+ <xsl:when test="normalize-space($processing_instruction_start) != ''">
5955
+ <xsl:value-of select="number($processing_instruction_start) - 1"/><!-- if start="3" then start_value=2 + xsl:number(1) = 3 -->
5956
+ </xsl:when>
5957
+ <xsl:when test="normalize-space(../@start) != ''">
5958
+ <xsl:value-of select="number(../@start) - 1"/><!-- if start="3" then start_value=2 + xsl:number(1) = 3 -->
5959
+ </xsl:when>
5960
+ <xsl:otherwise>0</xsl:otherwise>
5961
+ </xsl:choose>
5962
+ </xsl:variable>
5963
+
5964
+ <xsl:variable name="curr_value"><xsl:number/></xsl:variable>
5965
+
5966
+ <xsl:variable name="type">
5967
+ <xsl:choose>
5968
+ <xsl:when test="normalize-space($processing_instruction_type) != ''"><xsl:value-of select="$processing_instruction_type"/></xsl:when>
5969
+ <xsl:when test="normalize-space(../@type) != ''"><xsl:value-of select="../@type"/></xsl:when>
5970
+
5971
+ <xsl:otherwise> <!-- if no @type or @class = 'steps' -->
5972
+
5973
+ <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
5974
+ <xsl:variable name="list_level">
5975
+ <xsl:choose>
5976
+ <xsl:when test="$list_level_ &lt;= 5"><xsl:value-of select="$list_level_"/></xsl:when>
5977
+ <xsl:otherwise><xsl:value-of select="$list_level_ mod 5"/></xsl:otherwise>
5978
+ </xsl:choose>
5979
+ </xsl:variable>
5980
+
5981
+ <xsl:choose>
5982
+ <xsl:when test="$list_level mod 5 = 0">roman_upper</xsl:when> <!-- level 5 -->
5983
+ <xsl:when test="$list_level mod 4 = 0">alphabet_upper</xsl:when> <!-- level 4 -->
5984
+ <xsl:when test="$list_level mod 3 = 0">roman</xsl:when> <!-- level 3 -->
5985
+ <xsl:when test="$list_level mod 2 = 0 and ancestor::*/@class = 'steps'">alphabet</xsl:when> <!-- level 2 and @class = 'steps'-->
5986
+ <xsl:when test="$list_level mod 2 = 0">arabic</xsl:when> <!-- level 2 -->
5987
+ <xsl:otherwise> <!-- level 1 -->
5988
+ <xsl:choose>
5989
+ <xsl:when test="ancestor::*/@class = 'steps'">arabic</xsl:when>
5990
+ <xsl:otherwise>alphabet</xsl:otherwise>
5991
+ </xsl:choose>
5992
+ </xsl:otherwise>
5993
+ </xsl:choose>
5994
+
5995
+ </xsl:otherwise>
5996
+ </xsl:choose>
5997
+ </xsl:variable>
5998
+
5999
+ <xsl:variable name="format">
6000
+ <xsl:choose>
6001
+ <xsl:when test="$type = 'arabic'">
6002
+ 1.
6003
+ </xsl:when>
6004
+ <xsl:when test="$type = 'alphabet'">
6005
+ a)
6006
+ </xsl:when>
6007
+ <xsl:when test="$type = 'alphabet_upper'">
6008
+ A.
6009
+ </xsl:when>
6010
+ <xsl:when test="$type = 'roman'">
6011
+ i)
6012
+ </xsl:when>
6013
+ <xsl:when test="$type = 'roman_upper'">I.</xsl:when>
6014
+ <xsl:otherwise>1.</xsl:otherwise> <!-- for any case, if $type has non-determined value, not using -->
6015
+ </xsl:choose>
6016
+ </xsl:variable>
6017
+
6018
+ <xsl:number value="$start_value + $curr_value" format="{normalize-space($format)}" lang="en"/>
6019
+
6020
+ </xsl:otherwise>
6021
+ </xsl:choose>
5691
6022
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
5692
6023
  <xsl:choose>
5693
6024
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
@@ -5703,18 +6034,66 @@
5703
6034
 
5704
6035
  <fo:block-container margin-left="0mm">
5705
6036
  <fo:block>
5706
- <xsl:apply-templates select="." mode="ul_ol"/>
6037
+ <xsl:apply-templates select="." mode="list"/>
5707
6038
  </fo:block>
5708
6039
  </fo:block-container>
5709
6040
  </fo:block-container>
5710
6041
  </xsl:when>
5711
6042
  <xsl:otherwise>
5712
6043
  <fo:block>
5713
- <xsl:apply-templates select="." mode="ul_ol"/>
6044
+ <xsl:apply-templates select="." mode="list"/>
5714
6045
  </fo:block>
5715
6046
  </xsl:otherwise>
5716
6047
  </xsl:choose>
5717
- </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
6048
+ </xsl:template><xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
6049
+ <fo:list-block xsl:use-attribute-sets="list-style">
6050
+
6051
+
6052
+
6053
+
6054
+
6055
+
6056
+
6057
+
6058
+
6059
+ <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
6060
+ </fo:list-block>
6061
+ <!-- <xsl:for-each select="./iho:note">
6062
+ <xsl:call-template name="note"/>
6063
+ </xsl:for-each> -->
6064
+ <xsl:apply-templates select="./*[local-name() = 'note']"/>
6065
+ </xsl:template><xsl:template match="*[local-name()='li']">
6066
+ <fo:list-item xsl:use-attribute-sets="list-item-style">
6067
+ <xsl:copy-of select="@id"/>
6068
+
6069
+
6070
+
6071
+ <fo:list-item-label end-indent="label-end()">
6072
+ <fo:block xsl:use-attribute-sets="list-item-label-style">
6073
+
6074
+
6075
+
6076
+ <xsl:call-template name="getListItemFormat"/>
6077
+ </fo:block>
6078
+ </fo:list-item-label>
6079
+ <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
6080
+ <fo:block>
6081
+
6082
+
6083
+
6084
+
6085
+
6086
+ <xsl:apply-templates/>
6087
+
6088
+ <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
6089
+
6090
+ <xsl:for-each select="./bsi:note">
6091
+ <xsl:call-template name="note"/>
6092
+ </xsl:for-each> -->
6093
+ </fo:block>
6094
+ </fo:list-item-body>
6095
+ </fo:list-item>
6096
+ </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="bookmark_in_fn">
5718
6097
  <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
5719
6098
  <bookmark><xsl:value-of select="@id"/></bookmark>
5720
6099
  </xsl:for-each>
@@ -5736,7 +6115,7 @@
5736
6115
  <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
5737
6116
  <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
5738
6117
  <xsl:if test="@to">
5739
- <xsl:value-of select="$dash"/>
6118
+ <xsl:value-of select="$en_dash"/>
5740
6119
  <xsl:copy>
5741
6120
  <xsl:copy-of select="@*"/>
5742
6121
  <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
@@ -5761,7 +6140,7 @@
5761
6140
  <xsl:param name="target"/>
5762
6141
  <!-- <node></node> -->
5763
6142
  <xsl:choose>
5764
- <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
6143
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $en_dash) and $remove = 'true'">
5765
6144
  <!-- skip text (i.e. remove it) and process next element -->
5766
6145
  <!-- [removed_<xsl:value-of select="."/>] -->
5767
6146
  <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
@@ -5845,12 +6224,22 @@
5845
6224
  </xsl:variable>
5846
6225
  <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
5847
6226
  <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
6227
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'title']" priority="4">
6228
+ <fo:block xsl:use-attribute-sets="indexsect-title-style">
6229
+ <!-- Index -->
6230
+ <xsl:apply-templates/>
6231
+ </fo:block>
6232
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']/*[local-name() = 'title']" priority="4">
6233
+ <!-- Letter A, B, C, ... -->
6234
+ <fo:block xsl:use-attribute-sets="indexsect-clause-title-style">
6235
+ <xsl:apply-templates/>
6236
+ </fo:block>
5848
6237
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
5849
6238
  <xsl:apply-templates/>
5850
6239
  <fo:block>
5851
- <xsl:if test="following-sibling::*[local-name() = 'clause']">
5852
- <fo:block> </fo:block>
5853
- </xsl:if>
6240
+ <xsl:if test="following-sibling::*[local-name() = 'clause']">
6241
+ <fo:block> </fo:block>
6242
+ </xsl:if>
5854
6243
  </fo:block>
5855
6244
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
5856
6245
  <xsl:apply-templates/>
@@ -5860,6 +6249,9 @@
5860
6249
 
5861
6250
  <xsl:apply-templates/>
5862
6251
  </fo:block>
6252
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/text()">
6253
+ <!-- to split by '_' and other chars -->
6254
+ <xsl:call-template name="add-zero-spaces-java"/>
5863
6255
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
5864
6256
  <fo:inline id="{@id}" font-size="1pt"/>
5865
6257
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
@@ -6162,7 +6554,7 @@
6162
6554
  </fo:table-body>
6163
6555
  </fo:table>
6164
6556
  </fo:block>
6165
- </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
6557
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']" priority="2">
6166
6558
  <fo:table-row min-height="5mm">
6167
6559
  <xsl:apply-templates/>
6168
6560
  </fo:table-row>
@@ -6398,9 +6790,6 @@
6398
6790
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
6399
6791
  </xsl:choose>
6400
6792
  </xsl:template><xsl:template name="addPDFUAmeta">
6401
- <xsl:variable name="lang">
6402
- <xsl:call-template name="getLang"/>
6403
- </xsl:variable>
6404
6793
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
6405
6794
  <pdf:dictionary type="normal" key="ViewerPreferences">
6406
6795
  <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
@@ -6628,10 +7017,12 @@
6628
7017
  <xsl:param name="key"/>
6629
7018
  <xsl:param name="formatted">false</xsl:param>
6630
7019
  <xsl:param name="lang"/>
7020
+ <xsl:param name="returnEmptyIfNotFound">false</xsl:param>
6631
7021
 
6632
7022
  <xsl:variable name="curr_lang">
6633
7023
  <xsl:choose>
6634
7024
  <xsl:when test="$lang != ''"><xsl:value-of select="$lang"/></xsl:when>
7025
+ <xsl:when test="$returnEmptyIfNotFound = 'true'"/>
6635
7026
  <xsl:otherwise>
6636
7027
  <xsl:call-template name="getLang"/>
6637
7028
  </xsl:otherwise>
@@ -6666,6 +7057,7 @@
6666
7057
  </xsl:otherwise>
6667
7058
  </xsl:choose>
6668
7059
  </xsl:when>
7060
+ <xsl:when test="$returnEmptyIfNotFound = 'true'"/>
6669
7061
  <xsl:otherwise>
6670
7062
  <xsl:variable name="key_">
6671
7063
  <xsl:call-template name="capitalize">