metanorma-un 0.6.1 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c90de3003be5bb327042c4c18599a7370ce7a301dfab79344ccdf3a8d9d870c
4
- data.tar.gz: 380402b9b954aeac4986fe2599d44b5334367db790b68e8bc01a524d6fab6833
3
+ metadata.gz: 0a5c20da9a001c0acd4087934cf4f9cbc82a2120c3d2f5b3e7a5d5d044faa5cb
4
+ data.tar.gz: 4d454c978e7dd64bc99b623e7369f85c0217b77cca1e528de503fababdea145b
5
5
  SHA512:
6
- metadata.gz: 0bc101d08b76185ec9a6f9ebd8f5edb9829a60dde96c0bd98f7871734cc09a541cb539b7cc64762d0de2b9ed598ab81aa2e8f3ace9c82c20b79ff2a94d497412
7
- data.tar.gz: 104ccc6eb3d64ba0d96b20ed9b14b682d90e0c3407291a7580779a5da1f276d5c044ddf6c37113b5374c8fd2950001b70d95e2de7bb8864718645cb55e08136a
6
+ metadata.gz: 83bff8b909f59c56c86e1d1a034a0e5d637e7897ebd9578fe7a9d9202a366f7b59607fea61cd297bdd7c8d63697ebbf0db3bd3de888b662a59a15fadf62ad6b9
7
+ data.tar.gz: 8195c49d3f5ab27d550170f76f3047a0a48bc479f5f718a7482ca0a2c95f3e219b08463262be6c09056e0c7c6ba7e0d92975f4eb307797b1094ad8d06c5380fc
@@ -16,19 +16,9 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '2.7', '2.6', '2.5', '2.4' ]
19
+ ruby: [ '3.0', '2.7', '2.6', '2.5' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
- include:
23
- - ruby: '3.0'
24
- os: 'ubuntu-latest'
25
- experimental: true
26
- - ruby: '3.0'
27
- os: 'windows-latest'
28
- experimental: true
29
- - ruby: '3.0'
30
- os: 'macos-latest'
31
- experimental: true
32
22
  steps:
33
23
  - uses: actions/checkout@v2
34
24
  with:
@@ -40,3 +30,14 @@ jobs:
40
30
  bundler-cache: true
41
31
 
42
32
  - run: bundle exec rake
33
+
34
+ tests-passed:
35
+ needs: rake
36
+ runs-on: ubuntu-latest
37
+ steps:
38
+ - uses: peter-evans/repository-dispatch@v1
39
+ with:
40
+ token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
41
+ repository: ${{ github.repository }}
42
+ event-type: tests-passed
43
+ client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
data/.hound.yml CHANGED
@@ -1,3 +1,5 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
1
3
  ruby:
2
- Enabled: true
4
+ enabled: true
3
5
  config_file: .rubocop.yml
data/.rubocop.yml CHANGED
@@ -1,14 +1,10 @@
1
- # This project follows the Ribose OSS style guide.
2
- # https://github.com/riboseinc/oss-guides
3
- # All project-specific additions and overrides should be specified in this file.
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
4
3
  inherit_from:
5
4
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
6
5
 
7
6
  # local repo-specific modifications
7
+ # ...
8
8
 
9
9
  AllCops:
10
- DisplayCopNames: false
11
- StyleGuideCopsOnly: false
12
- TargetRubyVersion: 2.4
13
- Rails:
14
- Enabled: true
10
+ TargetRubyVersion: 2.5
@@ -787,6 +787,7 @@
787
787
  <value>adapted</value>
788
788
  <value>vote-started</value>
789
789
  <value>vote-ended</value>
790
+ <value>announced</value>
790
791
  </choice>
791
792
  </define>
792
793
  <define name="bdate">
@@ -45,6 +45,11 @@
45
45
  <optional>
46
46
  <attribute name="alt"/>
47
47
  </optional>
48
+ <optional>
49
+ <attribute name="updatetype">
50
+ <data type="boolean"/>
51
+ </attribute>
52
+ </optional>
48
53
  <text/>
49
54
  </element>
50
55
  </define>
@@ -543,6 +548,9 @@
543
548
  </define>
544
549
  <define name="BibDataExtensionType">
545
550
  <ref name="doctype"/>
551
+ <optional>
552
+ <ref name="docsubtype"/>
553
+ </optional>
546
554
  <optional>
547
555
  <ref name="editorialgroup"/>
548
556
  </optional>
@@ -876,8 +884,28 @@
876
884
  </zeroOrMore>
877
885
  </element>
878
886
  </define>
887
+ <define name="pagebreak">
888
+ <element name="pagebreak">
889
+ <optional>
890
+ <attribute name="orientation">
891
+ <choice>
892
+ <value>landscape</value>
893
+ <value>portrait</value>
894
+ </choice>
895
+ </attribute>
896
+ </optional>
897
+ </element>
898
+ </define>
879
899
  </include>
880
900
  <!-- end overrides -->
901
+ <define name="docsubtype">
902
+ <element name="docsubtype">
903
+ <ref name="DocumentSubtype"/>
904
+ </element>
905
+ </define>
906
+ <define name="DocumentSubtype">
907
+ <text/>
908
+ </define>
881
909
  <define name="colgroup">
882
910
  <element name="colgroup">
883
911
  <oneOrMore>
@@ -927,7 +955,24 @@
927
955
  <define name="concept">
928
956
  <element name="concept">
929
957
  <optional>
930
- <attribute name="term"/>
958
+ <element name="refterm">
959
+ <zeroOrMore>
960
+ <choice>
961
+ <ref name="PureTextElement"/>
962
+ <ref name="stem"/>
963
+ </choice>
964
+ </zeroOrMore>
965
+ </element>
966
+ </optional>
967
+ <optional>
968
+ <element name="renderterm">
969
+ <zeroOrMore>
970
+ <choice>
971
+ <ref name="PureTextElement"/>
972
+ <ref name="stem"/>
973
+ </choice>
974
+ </zeroOrMore>
975
+ </element>
931
976
  </optional>
932
977
  <choice>
933
978
  <ref name="eref"/>
@@ -943,8 +988,170 @@
943
988
  <ref name="permission"/>
944
989
  <ref name="imagemap"/>
945
990
  <ref name="svgmap"/>
991
+ <ref name="inputform"/>
992
+ </choice>
993
+ </define>
994
+ <define name="inputform">
995
+ <element name="form">
996
+ <attribute name="id">
997
+ <data type="ID"/>
998
+ </attribute>
999
+ <attribute name="name"/>
1000
+ <attribute name="action"/>
1001
+ <zeroOrMore>
1002
+ <choice>
1003
+ <ref name="TextElement"/>
1004
+ <ref name="FormInput"/>
1005
+ </choice>
1006
+ </zeroOrMore>
1007
+ </element>
1008
+ </define>
1009
+ <define name="FormInput">
1010
+ <choice>
1011
+ <ref name="input"/>
1012
+ <ref name="formlabel"/>
1013
+ <ref name="select"/>
1014
+ <ref name="textarea"/>
946
1015
  </choice>
947
1016
  </define>
1017
+ <define name="InputType">
1018
+ <choice>
1019
+ <value>button</value>
1020
+ <value>checkbox</value>
1021
+ <value>date</value>
1022
+ <value>file</value>
1023
+ <value>password</value>
1024
+ <value>radio</value>
1025
+ <value>submit</value>
1026
+ <value>text</value>
1027
+ </choice>
1028
+ </define>
1029
+ <define name="input">
1030
+ <element name="input">
1031
+ <attribute name="type">
1032
+ <ref name="InputType"/>
1033
+ </attribute>
1034
+ <optional>
1035
+ <attribute name="checked">
1036
+ <data type="boolean"/>
1037
+ </attribute>
1038
+ </optional>
1039
+ <optional>
1040
+ <attribute name="disabled">
1041
+ <data type="boolean"/>
1042
+ </attribute>
1043
+ </optional>
1044
+ <optional>
1045
+ <attribute name="readonly">
1046
+ <data type="boolean"/>
1047
+ </attribute>
1048
+ </optional>
1049
+ <optional>
1050
+ <attribute name="maxlength">
1051
+ <data type="int"/>
1052
+ </attribute>
1053
+ </optional>
1054
+ <optional>
1055
+ <attribute name="minlength">
1056
+ <data type="int"/>
1057
+ </attribute>
1058
+ </optional>
1059
+ <optional>
1060
+ <attribute name="name"/>
1061
+ </optional>
1062
+ <optional>
1063
+ <attribute name="value"/>
1064
+ </optional>
1065
+ <optional>
1066
+ <attribute name="id">
1067
+ <data type="ID"/>
1068
+ </attribute>
1069
+ </optional>
1070
+ </element>
1071
+ </define>
1072
+ <define name="formlabel">
1073
+ <element name="label">
1074
+ <attribute name="for">
1075
+ <data type="IDREF"/>
1076
+ </attribute>
1077
+ <zeroOrMore>
1078
+ <ref name="PureTextElement"/>
1079
+ </zeroOrMore>
1080
+ </element>
1081
+ </define>
1082
+ <define name="select">
1083
+ <element name="select">
1084
+ <optional>
1085
+ <attribute name="name"/>
1086
+ </optional>
1087
+ <optional>
1088
+ <attribute name="value"/>
1089
+ </optional>
1090
+ <optional>
1091
+ <attribute name="id">
1092
+ <data type="ID"/>
1093
+ </attribute>
1094
+ </optional>
1095
+ <optional>
1096
+ <attribute name="disabled">
1097
+ <data type="boolean"/>
1098
+ </attribute>
1099
+ </optional>
1100
+ <optional>
1101
+ <attribute name="multiple">
1102
+ <data type="boolean"/>
1103
+ </attribute>
1104
+ </optional>
1105
+ <optional>
1106
+ <attribute name="size">
1107
+ <data type="int"/>
1108
+ </attribute>
1109
+ </optional>
1110
+ <oneOrMore>
1111
+ <ref name="option"/>
1112
+ </oneOrMore>
1113
+ </element>
1114
+ </define>
1115
+ <define name="option">
1116
+ <element name="option">
1117
+ <optional>
1118
+ <attribute name="disabled">
1119
+ <data type="boolean"/>
1120
+ </attribute>
1121
+ </optional>
1122
+ <optional>
1123
+ <attribute name="value"/>
1124
+ </optional>
1125
+ <zeroOrMore>
1126
+ <ref name="PureTextElement"/>
1127
+ </zeroOrMore>
1128
+ </element>
1129
+ </define>
1130
+ <define name="textarea">
1131
+ <element name="textarea">
1132
+ <optional>
1133
+ <attribute name="name"/>
1134
+ </optional>
1135
+ <optional>
1136
+ <attribute name="value"/>
1137
+ </optional>
1138
+ <optional>
1139
+ <attribute name="id">
1140
+ <data type="ID"/>
1141
+ </attribute>
1142
+ </optional>
1143
+ <optional>
1144
+ <attribute name="rows">
1145
+ <data type="int"/>
1146
+ </attribute>
1147
+ </optional>
1148
+ <optional>
1149
+ <attribute name="cols">
1150
+ <data type="int"/>
1151
+ </attribute>
1152
+ </optional>
1153
+ </element>
1154
+ </define>
948
1155
  <define name="bibliography">
949
1156
  <element name="bibliography">
950
1157
  <oneOrMore>
@@ -1017,9 +1224,7 @@
1017
1224
  </define>
1018
1225
  <define name="IsoWorkgroup">
1019
1226
  <optional>
1020
- <attribute name="number">
1021
- <data type="int"/>
1022
- </attribute>
1227
+ <attribute name="number"/>
1023
1228
  </optional>
1024
1229
  <optional>
1025
1230
  <attribute name="type"/>
@@ -104,6 +104,9 @@
104
104
  <optional>
105
105
  <ref name="doctype"/>
106
106
  </optional>
107
+ <optional>
108
+ <ref name="docsubtype"/>
109
+ </optional>
107
110
  <zeroOrMore>
108
111
  <ref name="submissionlanguage"/>
109
112
  </zeroOrMore>
@@ -11,8 +11,12 @@
11
11
 
12
12
 
13
13
 
14
- <xsl:variable name="pageWidth" select="'210mm'"/>
15
- <xsl:variable name="pageHeight" select="'297mm'"/>
14
+ <xsl:variable name="pageWidth" select="210"/>
15
+ <xsl:variable name="pageHeight" select="297"/>
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"/>
16
20
 
17
21
  <xsl:variable name="debug">false</xsl:variable>
18
22
 
@@ -42,7 +46,7 @@
42
46
  <fo:root font-family="Times New Roman, STIX Two Math, Source Han Sans" font-size="10pt" xml:lang="{$lang}">
43
47
  <fo:layout-master-set>
44
48
  <!-- Cover page -->
45
- <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
49
+ <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
46
50
  <fo:region-body margin-top="17.5mm" margin-bottom="10mm" margin-left="20mm" margin-right="20mm"/>
47
51
  <fo:region-before extent="17.5mm"/>
48
52
  <fo:region-after extent="10mm"/>
@@ -51,20 +55,20 @@
51
55
  </fo:simple-page-master>
52
56
 
53
57
  <!-- Document odd pages -->
54
- <fo:simple-page-master master-name="odd" page-width="{$pageWidth}" page-height="{$pageHeight}">
55
- <fo:region-body margin-top="30mm" margin-bottom="40mm" margin-left="40mm" margin-right="40mm"/>
58
+ <fo:simple-page-master master-name="odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
59
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
56
60
  <fo:region-before region-name="header-odd" extent="26mm"/>
57
- <fo:region-after region-name="footer-odd" extent="40mm"/>
58
- <fo:region-start region-name="left-region" extent="40mm"/>
59
- <fo:region-end region-name="right-region" extent="40mm"/>
61
+ <fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
62
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
63
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
60
64
  </fo:simple-page-master>
61
65
  <!-- Document even pages -->
62
- <fo:simple-page-master master-name="even" page-width="{$pageWidth}" page-height="{$pageHeight}">
63
- <fo:region-body margin-top="30mm" margin-bottom="40mm" margin-left="40mm" margin-right="40mm"/>
66
+ <fo:simple-page-master master-name="even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
67
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
64
68
  <fo:region-before region-name="header-even" extent="26mm"/>
65
- <fo:region-after region-name="footer-even" extent="40mm"/>
66
- <fo:region-start region-name="left-region" extent="40mm"/>
67
- <fo:region-end region-name="right-region" extent="40mm"/>
69
+ <fo:region-after region-name="footer-even" extent="{$marginBottom}mm"/>
70
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
71
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
68
72
  </fo:simple-page-master>
69
73
  <fo:page-sequence-master master-name="document">
70
74
  <fo:repeatable-page-master-alternatives>
@@ -1326,6 +1330,9 @@
1326
1330
  <title-continued lang="en">(continued)</title-continued>
1327
1331
  <title-continued lang="fr">(continué)</title-continued>
1328
1332
 
1333
+ </xsl:variable><xsl:variable name="bibdata">
1334
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
1335
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
1329
1336
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1330
1337
  <xsl:param name="name"/>
1331
1338
  <xsl:param name="lang"/>
@@ -1356,6 +1363,8 @@
1356
1363
 
1357
1364
 
1358
1365
 
1366
+
1367
+
1359
1368
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
1360
1369
  <xsl:attribute name="white-space">pre</xsl:attribute>
1361
1370
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -1401,7 +1410,7 @@
1401
1410
 
1402
1411
 
1403
1412
 
1404
-
1413
+
1405
1414
  </xsl:attribute-set><xsl:attribute-set name="example-style">
1406
1415
 
1407
1416
 
@@ -1414,6 +1423,7 @@
1414
1423
 
1415
1424
 
1416
1425
 
1426
+
1417
1427
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1418
1428
 
1419
1429
 
@@ -1430,9 +1440,7 @@
1430
1440
 
1431
1441
 
1432
1442
 
1433
-
1434
-
1435
-
1443
+
1436
1444
 
1437
1445
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1438
1446
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -1467,8 +1475,10 @@
1467
1475
 
1468
1476
 
1469
1477
 
1478
+
1470
1479
  </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1471
1480
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1481
+
1472
1482
 
1473
1483
 
1474
1484
 
@@ -1488,6 +1498,9 @@
1488
1498
 
1489
1499
 
1490
1500
 
1501
+
1502
+ </xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
1503
+
1491
1504
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1492
1505
 
1493
1506
 
@@ -1500,17 +1513,22 @@
1500
1513
 
1501
1514
 
1502
1515
 
1516
+
1517
+
1503
1518
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1504
1519
 
1505
1520
 
1506
1521
 
1507
1522
 
1523
+
1508
1524
  <xsl:attribute name="color">blue</xsl:attribute>
1509
1525
 
1526
+
1510
1527
  </xsl:attribute-set><xsl:attribute-set name="note-style">
1511
1528
 
1512
1529
 
1513
1530
 
1531
+
1514
1532
 
1515
1533
 
1516
1534
 
@@ -1524,6 +1542,7 @@
1524
1542
 
1525
1543
 
1526
1544
 
1545
+
1527
1546
  </xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
1528
1547
 
1529
1548
 
@@ -1536,6 +1555,7 @@
1536
1555
 
1537
1556
 
1538
1557
 
1558
+
1539
1559
  <xsl:attribute name="padding-right">4mm</xsl:attribute>
1540
1560
 
1541
1561
 
@@ -1560,13 +1580,17 @@
1560
1580
 
1561
1581
 
1562
1582
 
1583
+
1563
1584
 
1564
1585
  <xsl:attribute name="margin-top">4pt</xsl:attribute>
1565
1586
 
1566
1587
 
1588
+
1567
1589
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1590
+
1568
1591
 
1569
1592
 
1593
+
1570
1594
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1571
1595
 
1572
1596
 
@@ -1585,14 +1609,18 @@
1585
1609
 
1586
1610
 
1587
1611
 
1612
+
1613
+
1588
1614
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
1589
1615
 
1590
1616
 
1591
1617
 
1618
+
1592
1619
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1593
1620
 
1594
1621
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1595
1622
 
1623
+
1596
1624
 
1597
1625
 
1598
1626
 
@@ -1606,6 +1634,7 @@
1606
1634
 
1607
1635
 
1608
1636
 
1637
+
1609
1638
 
1610
1639
  <xsl:attribute name="text-align">center</xsl:attribute>
1611
1640
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -1621,6 +1650,7 @@
1621
1650
 
1622
1651
 
1623
1652
 
1653
+
1624
1654
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1625
1655
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1626
1656
  <xsl:attribute name="border">2pt solid black</xsl:attribute>
@@ -1632,6 +1662,7 @@
1632
1662
  </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
1633
1663
 
1634
1664
 
1665
+
1635
1666
  <xsl:attribute name="width">100%</xsl:attribute>
1636
1667
  <xsl:attribute name="content-height">100%</xsl:attribute>
1637
1668
  <xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
@@ -1656,11 +1687,14 @@
1656
1687
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1657
1688
 
1658
1689
 
1690
+
1659
1691
  </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1660
1692
 
1693
+
1661
1694
  </xsl:attribute-set><xsl:attribute-set name="definition-style">
1662
1695
 
1663
1696
 
1697
+
1664
1698
  </xsl:attribute-set><xsl:variable name="color-added-text">
1665
1699
  <xsl:text>rgb(0, 255, 0)</xsl:text>
1666
1700
  </xsl:variable><xsl:attribute-set name="add-style">
@@ -1679,6 +1713,8 @@
1679
1713
  <xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
1680
1714
 
1681
1715
 
1716
+ </xsl:attribute-set><xsl:attribute-set name="list-style">
1717
+
1682
1718
  </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:template name="processPrefaceSectionsDefault_Contents">
1683
1719
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1684
1720
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
@@ -1689,14 +1725,15 @@
1689
1725
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1690
1726
 
1691
1727
  <!-- Normative references -->
1692
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
1728
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]" mode="contents"/>
1693
1729
  <!-- Terms and definitions -->
1694
1730
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
1695
1731
  <!-- Another main sections -->
1696
1732
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
1697
1733
  <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1698
1734
  <!-- Bibliography -->
1699
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
1735
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
1736
+
1700
1737
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1701
1738
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1702
1739
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
@@ -1732,11 +1769,11 @@
1732
1769
  <xsl:variable name="table">
1733
1770
 
1734
1771
  <xsl:variable name="simple-table">
1735
- <xsl:call-template name="getSimpleTable"/>
1772
+ <xsl:call-template name="getSimpleTable"/>
1736
1773
  </xsl:variable>
1737
1774
 
1738
1775
  <!-- <xsl:if test="$namespace = 'bipm'">
1739
- <fo:block>&#xA0;</fo:block>
1776
+ <fo:block>&#xA0;</fo:block>
1740
1777
  </xsl:if> -->
1741
1778
 
1742
1779
  <!-- $namespace = 'iso' or -->
@@ -1799,6 +1836,7 @@
1799
1836
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1800
1837
 
1801
1838
 
1839
+
1802
1840
 
1803
1841
 
1804
1842
 
@@ -1814,6 +1852,8 @@
1814
1852
 
1815
1853
 
1816
1854
 
1855
+
1856
+
1817
1857
  <xsl:variable name="table_width">
1818
1858
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1819
1859
 
@@ -1836,6 +1876,7 @@
1836
1876
 
1837
1877
 
1838
1878
 
1879
+
1839
1880
 
1840
1881
 
1841
1882
 
@@ -1844,6 +1885,7 @@
1844
1885
 
1845
1886
 
1846
1887
 
1888
+
1847
1889
  </xsl:variable>
1848
1890
 
1849
1891
 
@@ -1977,11 +2019,25 @@
1977
2019
  </xsl:choose>
1978
2020
 
1979
2021
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
2022
+ <xsl:param name="continued"/>
1980
2023
  <xsl:if test="normalize-space() != ''">
1981
2024
  <fo:block xsl:use-attribute-sets="table-name-style">
1982
2025
 
1983
2026
 
1984
- <xsl:apply-templates/>
2027
+
2028
+
2029
+
2030
+ <xsl:choose>
2031
+ <xsl:when test="$continued = 'true'">
2032
+ <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
2033
+
2034
+ </xsl:when>
2035
+ <xsl:otherwise>
2036
+ <xsl:apply-templates/>
2037
+ </xsl:otherwise>
2038
+ </xsl:choose>
2039
+
2040
+
1985
2041
  </fo:block>
1986
2042
  </xsl:if>
1987
2043
  </xsl:template><xsl:template name="calculate-columns-numbers">
@@ -2118,21 +2174,22 @@
2118
2174
  <!-- font-weight="bold" -->
2119
2175
  <fo:table-header>
2120
2176
 
2177
+
2121
2178
  <xsl:apply-templates/>
2122
2179
  </fo:table-header>
2123
2180
  </xsl:template><xsl:template name="table-header-title">
2124
- <xsl:param name="cols-count"/>
2181
+ <xsl:param name="cols-count"/>
2125
2182
  <!-- row for title -->
2126
2183
  <fo:table-row>
2127
2184
  <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
2128
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
2185
+
2186
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
2187
+ <xsl:with-param name="continued">true</xsl:with-param>
2188
+ </xsl:apply-templates>
2129
2189
  <xsl:for-each select="ancestor::*[local-name()='table'][1]">
2130
2190
  <xsl:call-template name="fn_name_display"/>
2131
- </xsl:for-each>
2132
- <fo:block text-align="right" font-style="italic">
2133
- <xsl:text> </xsl:text>
2134
- <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
2135
- </fo:block>
2191
+ </xsl:for-each>
2192
+
2136
2193
  </fo:table-cell>
2137
2194
  </fo:table-row>
2138
2195
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
@@ -2353,6 +2410,7 @@
2353
2410
 
2354
2411
 
2355
2412
 
2413
+
2356
2414
  </xsl:if>
2357
2415
  <xsl:if test="$parent-name = 'tfoot'">
2358
2416
 
@@ -2366,6 +2424,10 @@
2366
2424
 
2367
2425
 
2368
2426
 
2427
+
2428
+
2429
+
2430
+
2369
2431
  <!-- <xsl:if test="$namespace = 'bipm'">
2370
2432
  <xsl:attribute name="height">8mm</xsl:attribute>
2371
2433
  </xsl:if> -->
@@ -2392,6 +2454,7 @@
2392
2454
 
2393
2455
 
2394
2456
 
2457
+
2395
2458
  <xsl:attribute name="display-align">center</xsl:attribute>
2396
2459
  <xsl:attribute name="font-style">italic</xsl:attribute>
2397
2460
  <xsl:attribute name="font-weight">normal</xsl:attribute>
@@ -2404,6 +2467,7 @@
2404
2467
 
2405
2468
 
2406
2469
 
2470
+
2407
2471
  <xsl:if test="$lang = 'ar'">
2408
2472
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2409
2473
  </xsl:if>
@@ -2456,6 +2520,8 @@
2456
2520
 
2457
2521
 
2458
2522
 
2523
+
2524
+
2459
2525
  <xsl:attribute name="display-align">before</xsl:attribute>
2460
2526
  <xsl:attribute name="padding-left">0mm</xsl:attribute>
2461
2527
  <xsl:attribute name="padding-top">2mm</xsl:attribute>
@@ -2466,6 +2532,9 @@
2466
2532
 
2467
2533
 
2468
2534
 
2535
+
2536
+
2537
+
2469
2538
  <xsl:if test=".//*[local-name() = 'table']">
2470
2539
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2471
2540
  </xsl:if>
@@ -2495,6 +2564,7 @@
2495
2564
 
2496
2565
 
2497
2566
 
2567
+
2498
2568
  <fo:inline padding-right="2mm">
2499
2569
 
2500
2570
 
@@ -2548,6 +2618,7 @@
2548
2618
 
2549
2619
 
2550
2620
 
2621
+
2551
2622
  <xsl:value-of select="@reference"/>
2552
2623
 
2553
2624
 
@@ -2691,6 +2762,10 @@
2691
2762
 
2692
2763
 
2693
2764
 
2765
+
2766
+
2767
+
2768
+
2694
2769
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2695
2770
 
2696
2771
 
@@ -2782,6 +2857,7 @@
2782
2857
 
2783
2858
 
2784
2859
 
2860
+
2785
2861
  <xsl:variable name="title-key">
2786
2862
 
2787
2863
 
@@ -2992,6 +3068,7 @@
2992
3068
 
2993
3069
  <fo:table-row>
2994
3070
 
3071
+
2995
3072
  <fo:table-cell>
2996
3073
 
2997
3074
  <fo:block margin-top="6pt">
@@ -3007,6 +3084,7 @@
3007
3084
 
3008
3085
 
3009
3086
 
3087
+
3010
3088
  <xsl:apply-templates/>
3011
3089
  <!-- <xsl:if test="$namespace = 'gb'">
3012
3090
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -3063,6 +3141,8 @@
3063
3141
 
3064
3142
  <xsl:apply-templates/>
3065
3143
  </fo:inline>
3144
+ </xsl:template><xsl:template match="*[local-name()='padding']">
3145
+ <fo:inline padding-right="{@value}"> </fo:inline>
3066
3146
  </xsl:template><xsl:template match="*[local-name()='sup']">
3067
3147
  <fo:inline font-size="80%" vertical-align="super">
3068
3148
  <xsl:apply-templates/>
@@ -3088,6 +3168,7 @@
3088
3168
 
3089
3169
 
3090
3170
 
3171
+
3091
3172
 
3092
3173
  </xsl:variable>
3093
3174
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -3469,11 +3550,15 @@
3469
3550
  </xsl:apply-templates>
3470
3551
  </xsl:template><xsl:template name="getLang">
3471
3552
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3553
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3472
3554
  <xsl:variable name="language">
3473
3555
  <xsl:choose>
3474
3556
  <xsl:when test="$language_current != ''">
3475
3557
  <xsl:value-of select="$language_current"/>
3476
3558
  </xsl:when>
3559
+ <xsl:when test="$language_current_2 != ''">
3560
+ <xsl:value-of select="$language_current_2"/>
3561
+ </xsl:when>
3477
3562
  <xsl:otherwise>
3478
3563
  <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3479
3564
  </xsl:otherwise>
@@ -3547,9 +3632,27 @@
3547
3632
  <xsl:copy>
3548
3633
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
3549
3634
  </xsl:copy>
3550
- <mathml:mspace width="0.5ex"/>
3635
+ <xsl:choose>
3636
+ <!-- if in msub, then don't add space -->
3637
+ <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
3638
+ <!-- if next char in digit, don't add space -->
3639
+ <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
3640
+ <xsl:otherwise>
3641
+ <mathml:mspace width="0.5ex"/>
3642
+ </xsl:otherwise>
3643
+ </xsl:choose>
3551
3644
  </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3552
3645
  <xsl:variable name="target">
3646
+ <xsl:choose>
3647
+ <xsl:when test="@updatetype = 'true'">
3648
+ <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
3649
+ </xsl:when>
3650
+ <xsl:otherwise>
3651
+ <xsl:value-of select="normalize-space(@target)"/>
3652
+ </xsl:otherwise>
3653
+ </xsl:choose>
3654
+ </xsl:variable>
3655
+ <xsl:variable name="target_text">
3553
3656
  <xsl:choose>
3554
3657
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
3555
3658
  <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
@@ -3561,20 +3664,22 @@
3561
3664
  </xsl:variable>
3562
3665
  <fo:inline xsl:use-attribute-sets="link-style">
3563
3666
 
3667
+
3668
+
3564
3669
  <xsl:choose>
3565
- <xsl:when test="$target = ''">
3670
+ <xsl:when test="$target_text = ''">
3566
3671
  <xsl:apply-templates/>
3567
3672
  </xsl:when>
3568
3673
  <xsl:otherwise>
3569
- <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
3674
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
3570
3675
  <xsl:choose>
3571
3676
  <xsl:when test="normalize-space(.) = ''">
3572
- <!-- <xsl:value-of select="$target"/> -->
3573
3677
  <xsl:call-template name="add-zero-spaces-link-java">
3574
- <xsl:with-param name="text" select="$target"/>
3678
+ <xsl:with-param name="text" select="$target_text"/>
3575
3679
  </xsl:call-template>
3576
3680
  </xsl:when>
3577
3681
  <xsl:otherwise>
3682
+ <!-- output text from <link>text</link> -->
3578
3683
  <xsl:apply-templates/>
3579
3684
  </xsl:otherwise>
3580
3685
  </xsl:choose>
@@ -3695,6 +3800,7 @@
3695
3800
 
3696
3801
 
3697
3802
  <fo:inline xsl:use-attribute-sets="note-name-style">
3803
+
3698
3804
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3699
3805
  </fo:inline>
3700
3806
  <xsl:apply-templates/>
@@ -3720,7 +3826,9 @@
3720
3826
  </xsl:choose>
3721
3827
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
3722
3828
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
3829
+
3723
3830
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
3831
+
3724
3832
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3725
3833
  </fo:inline>
3726
3834
  <xsl:apply-templates/>
@@ -3796,13 +3904,17 @@
3796
3904
  </xsl:call-template>
3797
3905
 
3798
3906
  <fo:block>
3907
+
3799
3908
  <xsl:apply-templates/>
3800
3909
  </fo:block>
3801
3910
  <xsl:call-template name="fn_display_figure"/>
3802
3911
  <xsl:for-each select="*[local-name() = 'note']">
3803
3912
  <xsl:call-template name="note"/>
3804
3913
  </xsl:for-each>
3805
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3914
+
3915
+
3916
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3917
+
3806
3918
  </fo:block-container>
3807
3919
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
3808
3920
  <fo:block id="{@id}">
@@ -3915,21 +4027,249 @@
3915
4027
  <xsl:param name="height"/>
3916
4028
  <line xmlns="http://www.w3.org/2000/svg" x1="0" y1="0" x2="{$width}" y2="{$height}" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
3917
4029
  <line xmlns="http://www.w3.org/2000/svg" x1="0" y1="{$height}" x2="{$width}" y2="0" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
4030
+ </xsl:template><xsl:variable name="figure_name_height">14</xsl:variable><xsl:variable name="width_effective" select="$pageWidth - $marginLeftRight1 - $marginLeftRight2"/><xsl:variable name="height_effective" select="$pageHeight - $marginTop - $marginBottom - $figure_name_height"/><xsl:variable name="image_dpi" select="96"/><xsl:variable name="width_effective_px" select="$width_effective div 25.4 * $image_dpi"/><xsl:variable name="height_effective_px" select="$height_effective div 25.4 * $image_dpi"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image']) and *[local-name() = 'svg']]/*[local-name() = 'name']/*[local-name() = 'bookmark']" priority="2"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image'])]/*[local-name() = 'svg']" priority="2" name="image_svg">
4031
+ <xsl:param name="name"/>
4032
+
4033
+ <xsl:variable name="svg_content">
4034
+ <xsl:apply-templates select="." mode="svg_update"/>
4035
+ </xsl:variable>
4036
+
4037
+ <xsl:variable name="alt-text">
4038
+ <xsl:choose>
4039
+ <xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
4040
+ <xsl:value-of select="../*[local-name() = 'name']"/>
4041
+ </xsl:when>
4042
+ <xsl:when test="normalize-space($name) != ''">
4043
+ <xsl:value-of select="$name"/>
4044
+ </xsl:when>
4045
+ <xsl:otherwise>Figure</xsl:otherwise>
4046
+ </xsl:choose>
4047
+ </xsl:variable>
4048
+
4049
+ <xsl:choose>
4050
+ <xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
4051
+ <fo:block>
4052
+ <xsl:variable name="width" select="@width"/>
4053
+ <xsl:variable name="height" select="@height"/>
4054
+
4055
+ <xsl:variable name="scale_x">
4056
+ <xsl:choose>
4057
+ <xsl:when test="$width &gt; $width_effective_px">
4058
+ <xsl:value-of select="$width_effective_px div $width"/>
4059
+ </xsl:when>
4060
+ <xsl:otherwise>1</xsl:otherwise>
4061
+ </xsl:choose>
4062
+ </xsl:variable>
4063
+
4064
+ <xsl:variable name="scale_y">
4065
+ <xsl:choose>
4066
+ <xsl:when test="$height * $scale_x &gt; $height_effective_px">
4067
+ <xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
4068
+ </xsl:when>
4069
+ <xsl:otherwise>1</xsl:otherwise>
4070
+ </xsl:choose>
4071
+ </xsl:variable>
4072
+
4073
+ <xsl:variable name="scale">
4074
+ <xsl:choose>
4075
+ <xsl:when test="$scale_y != 1">
4076
+ <xsl:value-of select="$scale_x * $scale_y"/>
4077
+ </xsl:when>
4078
+ <xsl:otherwise>
4079
+ <xsl:value-of select="$scale_x"/>
4080
+ </xsl:otherwise>
4081
+ </xsl:choose>
4082
+ </xsl:variable>
4083
+
4084
+ <xsl:variable name="width_scale" select="round($width * $scale)"/>
4085
+ <xsl:variable name="height_scale" select="round($height * $scale)"/>
4086
+
4087
+ <fo:table table-layout="fixed" width="100%">
4088
+ <fo:table-column column-width="proportional-column-width(1)"/>
4089
+ <fo:table-column column-width="{$width_scale}px"/>
4090
+ <fo:table-column column-width="proportional-column-width(1)"/>
4091
+ <fo:table-body>
4092
+ <fo:table-row>
4093
+ <fo:table-cell column-number="2">
4094
+ <fo:block>
4095
+ <fo:block-container width="{$width_scale}px" height="{$height_scale}px">
4096
+ <xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
4097
+ <fo:block line-height="0" font-size="0">
4098
+ <xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
4099
+ <xsl:call-template name="bookmark"/>
4100
+ </xsl:for-each>
4101
+ </fo:block>
4102
+ </xsl:if>
4103
+ <fo:block text-depth="0" line-height="0" font-size="0">
4104
+
4105
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
4106
+ <xsl:attribute name="width">100%</xsl:attribute>
4107
+ <xsl:attribute name="content-height">100%</xsl:attribute>
4108
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4109
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
4110
+
4111
+ <xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
4112
+ </fo:instream-foreign-object>
4113
+ </fo:block>
4114
+
4115
+ <xsl:apply-templates select=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]" mode="svg_imagemap_links">
4116
+ <xsl:with-param name="scale" select="$scale"/>
4117
+ </xsl:apply-templates>
4118
+ </fo:block-container>
4119
+ </fo:block>
4120
+ </fo:table-cell>
4121
+ </fo:table-row>
4122
+ </fo:table-body>
4123
+ </fo:table>
4124
+ </fo:block>
4125
+
4126
+ </xsl:when>
4127
+ <xsl:otherwise>
4128
+ <fo:block xsl:use-attribute-sets="image-style">
4129
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
4130
+ <xsl:attribute name="width">100%</xsl:attribute>
4131
+ <xsl:attribute name="content-height">100%</xsl:attribute>
4132
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4133
+ <!-- effective height 297 - 27.4 - 13 = 256.6 -->
4134
+ <!-- effective width 210 - 12.5 - 25 = 172.5 -->
4135
+ <!-- effective height / width = 1.48, 1.4 - with title -->
4136
+ <xsl:if test="@height &gt; (@width * 1.4)"> <!-- for images with big height -->
4137
+ <xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
4138
+ <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
4139
+ </xsl:if>
4140
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
4141
+ <xsl:copy-of select="$svg_content"/>
4142
+ </fo:instream-foreign-object>
4143
+ </fo:block>
4144
+ </xsl:otherwise>
4145
+ </xsl:choose>
4146
+ </xsl:template><xsl:template match="@*|node()" mode="svg_update">
4147
+ <xsl:copy>
4148
+ <xsl:apply-templates select="@*|node()" mode="svg_update"/>
4149
+ </xsl:copy>
4150
+ </xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
4151
+ <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
4152
+ <xsl:value-of select="."/>
4153
+ </xsl:attribute>
4154
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
4155
+ <xsl:variable name="svg_content" select="document(@src)"/>
4156
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
4157
+ <xsl:for-each select="xalan:nodeset($svg_content)/node()">
4158
+ <xsl:call-template name="image_svg">
4159
+ <xsl:with-param name="name" select="$name"/>
4160
+ </xsl:call-template>
4161
+ </xsl:for-each>
4162
+ </xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
4163
+ <xsl:copy>
4164
+ <xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
4165
+ </xsl:copy>
4166
+ </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
4167
+ <xsl:apply-templates mode="svg_remove_a"/>
4168
+ </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
4169
+ <xsl:param name="scale"/>
4170
+ <xsl:variable name="dest">
4171
+ <xsl:choose>
4172
+ <xsl:when test="starts-with(@href, '#')">
4173
+ <xsl:value-of select="substring-after(@href, '#')"/>
4174
+ </xsl:when>
4175
+ <xsl:otherwise>
4176
+ <xsl:value-of select="@href"/>
4177
+ </xsl:otherwise>
4178
+ </xsl:choose>
4179
+ </xsl:variable>
4180
+ <xsl:for-each select="./*[local-name() = 'rect']">
4181
+ <xsl:call-template name="insertSVGMapLink">
4182
+ <xsl:with-param name="left" select="floor(@x * $scale)"/>
4183
+ <xsl:with-param name="top" select="floor(@y * $scale)"/>
4184
+ <xsl:with-param name="width" select="floor(@width * $scale)"/>
4185
+ <xsl:with-param name="height" select="floor(@height * $scale)"/>
4186
+ <xsl:with-param name="dest" select="$dest"/>
4187
+ </xsl:call-template>
4188
+ </xsl:for-each>
4189
+
4190
+ <xsl:for-each select="./*[local-name() = 'polygon']">
4191
+ <xsl:variable name="points">
4192
+ <xsl:call-template name="split">
4193
+ <xsl:with-param name="pText" select="@points"/>
4194
+ </xsl:call-template>
4195
+ </xsl:variable>
4196
+ <xsl:variable name="x_coords">
4197
+ <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
4198
+ <xsl:sort select="." data-type="number"/>
4199
+ <x><xsl:value-of select="."/></x>
4200
+ </xsl:for-each>
4201
+ </xsl:variable>
4202
+ <xsl:variable name="y_coords">
4203
+ <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
4204
+ <xsl:sort select="." data-type="number"/>
4205
+ <y><xsl:value-of select="."/></y>
4206
+ </xsl:for-each>
4207
+ </xsl:variable>
4208
+ <xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
4209
+ <xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
4210
+ <xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
4211
+ <xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
4212
+ <xsl:call-template name="insertSVGMapLink">
4213
+ <xsl:with-param name="left" select="floor($x * $scale)"/>
4214
+ <xsl:with-param name="top" select="floor($y * $scale)"/>
4215
+ <xsl:with-param name="width" select="floor($width * $scale)"/>
4216
+ <xsl:with-param name="height" select="floor($height * $scale)"/>
4217
+ <xsl:with-param name="dest" select="$dest"/>
4218
+ </xsl:call-template>
4219
+ </xsl:for-each>
4220
+
4221
+ <xsl:for-each select="./*[local-name() = 'circle']">
4222
+ <xsl:call-template name="insertSVGMapLink">
4223
+ <xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
4224
+ <xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
4225
+ <xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
4226
+ <xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
4227
+ <xsl:with-param name="dest" select="$dest"/>
4228
+ </xsl:call-template>
4229
+ </xsl:for-each>
4230
+ <xsl:for-each select="./*[local-name() = 'ellipse']">
4231
+ <xsl:call-template name="insertSVGMapLink">
4232
+ <xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
4233
+ <xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
4234
+ <xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
4235
+ <xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
4236
+ <xsl:with-param name="dest" select="$dest"/>
4237
+ </xsl:call-template>
4238
+ </xsl:for-each>
4239
+ </xsl:template><xsl:template name="insertSVGMapLink">
4240
+ <xsl:param name="left"/>
4241
+ <xsl:param name="top"/>
4242
+ <xsl:param name="width"/>
4243
+ <xsl:param name="height"/>
4244
+ <xsl:param name="dest"/>
4245
+ <fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
4246
+ <fo:block font-size="1pt">
4247
+ <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
4248
+ <fo:inline-container inline-progression-dimension="100%">
4249
+ <fo:block-container height="{$height - 1}px" width="100%">
4250
+ <!-- DEBUG <xsl:if test="local-name()='polygon'">
4251
+ <xsl:attribute name="background-color">magenta</xsl:attribute>
4252
+ </xsl:if> -->
4253
+ <fo:block> </fo:block></fo:block-container>
4254
+ </fo:inline-container>
4255
+ </fo:basic-link>
4256
+ </fo:block>
4257
+ </fo:block-container>
3918
4258
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
3919
4259
  <xsl:apply-templates mode="contents"/>
3920
4260
  <xsl:text> </xsl:text>
3921
4261
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
3922
4262
  <xsl:apply-templates mode="bookmarks"/>
3923
4263
  <xsl:text> </xsl:text>
3924
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
4264
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
3925
4265
  <xsl:value-of select="."/>
3926
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
4266
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
3927
4267
  <xsl:value-of select="."/>
3928
4268
  </xsl:template><xsl:template match="node()" mode="contents">
3929
4269
  <xsl:apply-templates mode="contents"/>
3930
4270
  </xsl:template><xsl:template match="node()" mode="bookmarks">
3931
4271
  <xsl:apply-templates mode="bookmarks"/>
3932
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
4272
+ </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
3933
4273
  <xsl:apply-templates select="."/>
3934
4274
  </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3935
4275
  <xsl:apply-templates mode="bookmarks"/>
@@ -3943,28 +4283,39 @@
3943
4283
  <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3944
4284
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3945
4285
  <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
4286
+ <xsl:if test="@bundle = 'true'">
4287
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
4288
+ </xsl:if>
3946
4289
  <fo:bookmark-title>
3947
- <xsl:variable name="bookmark-title_">
3948
- <xsl:call-template name="getLangVersion">
3949
- <xsl:with-param name="lang" select="@lang"/>
3950
- <xsl:with-param name="doctype" select="@doctype"/>
3951
- <xsl:with-param name="title" select="@title-part"/>
3952
- </xsl:call-template>
3953
- </xsl:variable>
3954
4290
  <xsl:choose>
3955
- <xsl:when test="normalize-space($bookmark-title_) != ''">
3956
- <xsl:value-of select="normalize-space($bookmark-title_)"/>
3957
- </xsl:when>
3958
- <xsl:otherwise>
4291
+ <xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
4292
+ <xsl:variable name="bookmark-title_">
4293
+ <xsl:call-template name="getLangVersion">
4294
+ <xsl:with-param name="lang" select="@lang"/>
4295
+ <xsl:with-param name="doctype" select="@doctype"/>
4296
+ <xsl:with-param name="title" select="@title-part"/>
4297
+ </xsl:call-template>
4298
+ </xsl:variable>
3959
4299
  <xsl:choose>
3960
- <xsl:when test="@lang = 'en'">English</xsl:when>
3961
- <xsl:when test="@lang = 'fr'">Français</xsl:when>
3962
- <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3963
- <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
4300
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
4301
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
4302
+ </xsl:when>
4303
+ <xsl:otherwise>
4304
+ <xsl:choose>
4305
+ <xsl:when test="@lang = 'en'">English</xsl:when>
4306
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
4307
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
4308
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
4309
+ </xsl:choose>
4310
+ </xsl:otherwise>
3964
4311
  </xsl:choose>
4312
+ </xsl:when>
4313
+ <xsl:otherwise>
4314
+ <xsl:value-of select="@title-part"/>
3965
4315
  </xsl:otherwise>
3966
4316
  </xsl:choose>
3967
4317
  </fo:bookmark-title>
4318
+
3968
4319
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3969
4320
 
3970
4321
  <xsl:call-template name="insertFigureBookmarks">
@@ -4063,20 +4414,28 @@
4063
4414
  <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
4064
4415
  </xsl:choose>
4065
4416
  </xsl:template><xsl:template match="item" mode="bookmark">
4066
- <fo:bookmark internal-destination="{@id}" starting-state="hide">
4067
- <fo:bookmark-title>
4068
- <xsl:if test="@section != ''">
4069
- <xsl:value-of select="@section"/>
4070
- <xsl:text> </xsl:text>
4071
- </xsl:if>
4072
- <xsl:value-of select="normalize-space(title)"/>
4073
- </fo:bookmark-title>
4074
- <xsl:apply-templates mode="bookmark"/>
4075
- </fo:bookmark>
4417
+ <xsl:choose>
4418
+ <xsl:when test="@id != ''">
4419
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
4420
+ <fo:bookmark-title>
4421
+ <xsl:if test="@section != ''">
4422
+ <xsl:value-of select="@section"/>
4423
+ <xsl:text> </xsl:text>
4424
+ </xsl:if>
4425
+ <xsl:value-of select="normalize-space(title)"/>
4426
+ </fo:bookmark-title>
4427
+ <xsl:apply-templates mode="bookmark"/>
4428
+ </fo:bookmark>
4429
+ </xsl:when>
4430
+ <xsl:otherwise>
4431
+ <xsl:apply-templates mode="bookmark"/>
4432
+ </xsl:otherwise>
4433
+ </xsl:choose>
4076
4434
  </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
4077
4435
  <xsl:if test="normalize-space() != ''">
4078
4436
  <fo:block xsl:use-attribute-sets="figure-name-style">
4079
4437
 
4438
+
4080
4439
  <xsl:apply-templates/>
4081
4440
  </fo:block>
4082
4441
  </xsl:if>
@@ -4128,6 +4487,8 @@
4128
4487
  </fo:list-item-body>
4129
4488
  </fo:list-item>
4130
4489
  </fo:list-block>
4490
+ </xsl:template><xsl:template name="extractSection">
4491
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
4131
4492
  </xsl:template><xsl:template name="extractTitle">
4132
4493
  <xsl:choose>
4133
4494
  <xsl:when test="*[local-name() = 'tab']">
@@ -4154,6 +4515,8 @@
4154
4515
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
4155
4516
 
4156
4517
  <fo:block-container margin-left="0mm">
4518
+ <xsl:copy-of select="@id"/>
4519
+
4157
4520
  <xsl:if test="parent::*[local-name() = 'note']">
4158
4521
  <xsl:attribute name="margin-left">
4159
4522
  <xsl:choose>
@@ -4164,7 +4527,9 @@
4164
4527
 
4165
4528
  </xsl:if>
4166
4529
  <fo:block-container margin-left="0mm">
4167
-
4530
+
4531
+
4532
+
4168
4533
  <fo:block xsl:use-attribute-sets="sourcecode-style">
4169
4534
  <xsl:variable name="_font-size">
4170
4535
 
@@ -4175,6 +4540,7 @@
4175
4540
 
4176
4541
 
4177
4542
 
4543
+
4178
4544
 
4179
4545
 
4180
4546
 
@@ -4192,10 +4558,14 @@
4192
4558
  </xsl:choose>
4193
4559
  </xsl:attribute>
4194
4560
  </xsl:if>
4195
- <xsl:apply-templates/>
4196
- </fo:block>
4561
+
4562
+ <xsl:apply-templates/>
4563
+ </fo:block>
4564
+
4565
+
4197
4566
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4198
4567
 
4568
+
4199
4569
  </fo:block-container>
4200
4570
  </fo:block-container>
4201
4571
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
@@ -4430,6 +4800,7 @@
4430
4800
  </xsl:template><xsl:template match="*[local-name() = 'example']">
4431
4801
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4432
4802
 
4803
+
4433
4804
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4434
4805
 
4435
4806
  <xsl:variable name="element">
@@ -4502,7 +4873,7 @@
4502
4873
  </fo:inline>
4503
4874
  </xsl:otherwise>
4504
4875
  </xsl:choose>
4505
- </xsl:template><xsl:template match="*[local-name() = 'termsource']">
4876
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
4506
4877
  <fo:block xsl:use-attribute-sets="termsource-style">
4507
4878
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
4508
4879
  <xsl:variable name="termsource_text">
@@ -4511,13 +4882,15 @@
4511
4882
 
4512
4883
  <xsl:choose>
4513
4884
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
4514
- <xsl:apply-templates/>
4885
+ <!-- <xsl:apply-templates /> -->
4886
+ <xsl:copy-of select="$termsource_text"/>
4515
4887
  </xsl:when>
4516
4888
  <xsl:otherwise>
4517
4889
 
4518
4890
  <xsl:text>[</xsl:text>
4519
4891
 
4520
- <xsl:apply-templates/>
4892
+ <!-- <xsl:apply-templates /> -->
4893
+ <xsl:copy-of select="$termsource_text"/>
4521
4894
 
4522
4895
  <xsl:text>]</xsl:text>
4523
4896
 
@@ -4528,8 +4901,15 @@
4528
4901
  <xsl:if test="normalize-space() != ''">
4529
4902
  <xsl:value-of select="."/>
4530
4903
  </xsl:if>
4531
- </xsl:template><xsl:template match="*[local-name() = 'origin']">
4904
+ </xsl:template><xsl:variable name="localized.source">
4905
+ <xsl:call-template name="getLocalizedString">
4906
+ <xsl:with-param name="key">source</xsl:with-param>
4907
+ </xsl:call-template>
4908
+ </xsl:variable><xsl:template match="*[local-name() = 'origin']">
4532
4909
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4910
+ <xsl:if test="normalize-space(@citeas) = ''">
4911
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
4912
+ </xsl:if>
4533
4913
 
4534
4914
  <fo:inline xsl:use-attribute-sets="origin-style">
4535
4915
  <xsl:apply-templates/>
@@ -4601,6 +4981,7 @@
4601
4981
  </xsl:if>
4602
4982
 
4603
4983
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4984
+
4604
4985
  <xsl:if test="normalize-space(@citeas) = ''">
4605
4986
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
4606
4987
  </xsl:if>
@@ -4645,6 +5026,7 @@
4645
5026
 
4646
5027
 
4647
5028
 
5029
+
4648
5030
  <xsl:choose>
4649
5031
  <xsl:when test="ancestor::un:sections and $depth = 1">12</xsl:when>
4650
5032
  <xsl:when test="ancestor::un:sections">8</xsl:when>
@@ -4738,7 +5120,6 @@
4738
5120
  </xsl:if>
4739
5121
 
4740
5122
 
4741
-
4742
5123
  <xsl:apply-templates/>
4743
5124
  </fo:block>
4744
5125
 
@@ -4755,6 +5136,7 @@
4755
5136
  <xsl:call-template name="setId"/>
4756
5137
 
4757
5138
 
5139
+
4758
5140
  <xsl:apply-templates/>
4759
5141
  </fo:block>
4760
5142
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
@@ -4786,7 +5168,7 @@
4786
5168
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
4787
5169
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
4788
5170
  <xsl:choose>
4789
- <xsl:when test="parent::*[local-name() = 'note']">
5171
+ <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
4790
5172
  <fo:block-container>
4791
5173
  <xsl:attribute name="margin-left">
4792
5174
  <xsl:choose>
@@ -4796,6 +5178,7 @@
4796
5178
  </xsl:attribute>
4797
5179
 
4798
5180
 
5181
+
4799
5182
  <fo:block-container margin-left="0mm">
4800
5183
  <fo:block>
4801
5184
  <xsl:apply-templates select="." mode="ul_ol"/>
@@ -4997,21 +5380,25 @@
4997
5380
 
4998
5381
 
4999
5382
 
5383
+
5384
+
5385
+
5386
+
5000
5387
  </xsl:template><xsl:template name="processBibitemDocId">
5001
5388
  <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
5002
5389
  <xsl:choose>
5003
5390
  <xsl:when test="normalize-space($_doc_ident) != ''">
5004
- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
5391
+ <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
5005
5392
  <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
5006
5393
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
5007
- </xsl:if>
5394
+ </xsl:if> -->
5008
5395
  <xsl:value-of select="$_doc_ident"/>
5009
5396
  </xsl:when>
5010
5397
  <xsl:otherwise>
5011
- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
5398
+ <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
5012
5399
  <xsl:if test="$type != ''">
5013
5400
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
5014
- </xsl:if>
5401
+ </xsl:if> -->
5015
5402
  <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
5016
5403
  </xsl:otherwise>
5017
5404
  </xsl:choose>
@@ -5053,6 +5440,70 @@
5053
5440
  <xsl:value-of select="substring(.,1,1)"/>
5054
5441
  </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
5055
5442
  <fo:inline><xsl:apply-templates/></fo:inline>
5443
+ </xsl:template><xsl:template match="*[local-name() = 'form']">
5444
+ <fo:block>
5445
+ <xsl:apply-templates/>
5446
+ </fo:block>
5447
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'label']">
5448
+ <fo:inline><xsl:apply-templates/></fo:inline>
5449
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'text' or @type = 'date' or @type = 'file' or @type = 'password']">
5450
+ <fo:inline>
5451
+ <xsl:call-template name="text_input"/>
5452
+ </fo:inline>
5453
+ </xsl:template><xsl:template name="text_input">
5454
+ <xsl:variable name="count">
5455
+ <xsl:choose>
5456
+ <xsl:when test="normalize-space(@maxlength) != ''"><xsl:value-of select="@maxlength"/></xsl:when>
5457
+ <xsl:when test="normalize-space(@size) != ''"><xsl:value-of select="@size"/></xsl:when>
5458
+ <xsl:otherwise>10</xsl:otherwise>
5459
+ </xsl:choose>
5460
+ </xsl:variable>
5461
+ <xsl:call-template name="repeat">
5462
+ <xsl:with-param name="char" select="'_'"/>
5463
+ <xsl:with-param name="count" select="$count"/>
5464
+ </xsl:call-template>
5465
+ <xsl:text> </xsl:text>
5466
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'button']">
5467
+ <xsl:variable name="caption">
5468
+ <xsl:choose>
5469
+ <xsl:when test="normalize-space(@value) != ''"><xsl:value-of select="@value"/></xsl:when>
5470
+ <xsl:otherwise>BUTTON</xsl:otherwise>
5471
+ </xsl:choose>
5472
+ </xsl:variable>
5473
+ <fo:inline>[<xsl:value-of select="$caption"/>]</fo:inline>
5474
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'checkbox']">
5475
+ <fo:inline padding-right="1mm">
5476
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
5477
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
5478
+ <xsl:attribute name="content-width">100%</xsl:attribute>
5479
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
5480
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
5481
+ <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
5482
+ <polyline points="0,0 80,0 80,80 0,80 0,0" stroke="black" stroke-width="5" fill="white"/>
5483
+ </svg>
5484
+ </fo:instream-foreign-object>
5485
+ </fo:inline>
5486
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'radio']">
5487
+ <fo:inline padding-right="1mm">
5488
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
5489
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
5490
+ <xsl:attribute name="content-width">100%</xsl:attribute>
5491
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
5492
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
5493
+ <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
5494
+ <circle cx="40" cy="40" r="30" stroke="black" stroke-width="5" fill="white"/>
5495
+ <circle cx="40" cy="40" r="15" stroke="black" stroke-width="5" fill="white"/>
5496
+ </svg>
5497
+ </fo:instream-foreign-object>
5498
+ </fo:inline>
5499
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'select']">
5500
+ <fo:inline>
5501
+ <xsl:call-template name="text_input"/>
5502
+ </fo:inline>
5503
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'textarea']">
5504
+ <fo:block-container border="1pt solid black" width="50%">
5505
+ <fo:block> </fo:block>
5506
+ </fo:block-container>
5056
5507
  </xsl:template><xsl:template name="convertDate">
5057
5508
  <xsl:param name="date"/>
5058
5509
  <xsl:param name="format" select="'short'"/>
@@ -5260,6 +5711,9 @@
5260
5711
  <xsl:when test="parent::*[local-name() = 'preface']">
5261
5712
  <xsl:value-of select="$level_total - 1"/>
5262
5713
  </xsl:when>
5714
+ <xsl:when test="ancestor::*[local-name() = 'preface'] and not(ancestor::*[local-name() = 'foreword']) and not(ancestor::*[local-name() = 'introduction'])"> <!-- for preface/clause -->
5715
+ <xsl:value-of select="$level_total - 1"/>
5716
+ </xsl:when>
5263
5717
  <xsl:when test="ancestor::*[local-name() = 'preface']">
5264
5718
  <xsl:value-of select="$level_total - 2"/>
5265
5719
  </xsl:when>
@@ -5318,6 +5772,7 @@
5318
5772
 
5319
5773
 
5320
5774
 
5775
+
5321
5776
  <xsl:value-of select="document('')//*/namespace::un"/>
5322
5777
 
5323
5778
 
@@ -5384,17 +5839,29 @@
5384
5839
  </xsl:call-template>
5385
5840
  </xsl:if>
5386
5841
  </xsl:template><xsl:template name="getLocalizedString">
5387
- <xsl:param name="key"/>
5842
+ <xsl:param name="key"/>
5388
5843
 
5389
5844
  <xsl:variable name="curr_lang">
5390
5845
  <xsl:call-template name="getLang"/>
5391
5846
  </xsl:variable>
5392
5847
 
5848
+ <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
5849
+
5393
5850
  <xsl:choose>
5851
+ <xsl:when test="$data_value != ''">
5852
+ <xsl:value-of select="$data_value"/>
5853
+ </xsl:when>
5394
5854
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
5395
5855
  <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5396
5856
  </xsl:when>
5397
- <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
5857
+ <xsl:otherwise>
5858
+ <xsl:variable name="key_">
5859
+ <xsl:call-template name="capitalize">
5860
+ <xsl:with-param name="str" select="translate($key, '_', ' ')"/>
5861
+ </xsl:call-template>
5862
+ </xsl:variable>
5863
+ <xsl:value-of select="$key_"/>
5864
+ </xsl:otherwise>
5398
5865
  </xsl:choose>
5399
5866
 
5400
5867
  </xsl:template><xsl:template name="setTrackChangesStyles">
@@ -5437,4 +5904,14 @@
5437
5904
  <xsl:value-of select="$align"/>
5438
5905
  </xsl:when>
5439
5906
  </xsl:choose>
5907
+ </xsl:template><xsl:template name="setTextAlignment">
5908
+ <xsl:param name="default">left</xsl:param>
5909
+ <xsl:attribute name="text-align">
5910
+ <xsl:choose>
5911
+ <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
5912
+ <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
5913
+ <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
5914
+ <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
5915
+ </xsl:choose>
5916
+ </xsl:attribute>
5440
5917
  </xsl:template></xsl:stylesheet>