metanorma-cc 1.7.1 → 1.7.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: c42376000b8e82f820c6fdd7f5c3ca85d0d810eb3de71705ac6df2269e50d2db
4
- data.tar.gz: fa9bf780b497c2e67c07d83399b3d4ed9228b1a1731ab31eb4532ab16afd16f9
3
+ metadata.gz: 9800409f83f05968a5bbc1b3fb23acc9b16b0791e97dd43897ec541c9f2309cd
4
+ data.tar.gz: fba0e90b9902ec515e4b61c337c1923bb7dd8377169739dbf8caa40fcf2d0eb0
5
5
  SHA512:
6
- metadata.gz: 78f7007e3975b048c53b85573cb2e6668f9ac5d6eeb80c77becd9d51d7c0cdd2c30c3931c8b0c8aea049d1426b654788a0537631c32609c4b142431840155836
7
- data.tar.gz: 83d8577f2edf35a56eea0e4ad8f467ab7102554f91cfa873e0aa40673c7e78146fced42f8ce8ac45a9e1984e7813d489405984724f7eab5fab780fbfb9eff853
6
+ metadata.gz: 1fca6f832f5332ac625d052864674a9a28d9d7485dab97f58e29a1a12ebffbc3bc83d52bd986dce067e0ea88d633912d52a8b9ae61e31ab819af6e20737d3e4d
7
+ data.tar.gz: 8aa8cd87c0d718a424de2787afdf58f7979d03cebe279df6e7f5f90608910ffdb8fd6b70978a90ff21e43a6756e743eb0f3fbdc835e6ecdae49342c71a39c724
@@ -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">
@@ -73,6 +73,9 @@
73
73
  <optional>
74
74
  <ref name="doctype"/>
75
75
  </optional>
76
+ <optional>
77
+ <ref name="docsubtype"/>
78
+ </optional>
76
79
  <ref name="editorialgroup"/>
77
80
  <zeroOrMore>
78
81
  <ref name="ics"/>
@@ -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"/>
@@ -7,8 +7,13 @@
7
7
  <xsl:variable name="images" select="document($svg_images)"/>
8
8
  <xsl:param name="basepath"/>
9
9
 
10
- <xsl:variable name="pageWidth" select="'210mm'"/>
11
- <xsl:variable name="pageHeight" select="'297mm'"/>
10
+ <xsl:variable name="pageWidth" select="210"/>
11
+ <xsl:variable name="pageHeight" select="297"/>
12
+ <xsl:variable name="marginLeftRight1" select="19"/>
13
+ <xsl:variable name="marginLeftRight2" select="19"/>
14
+ <xsl:variable name="marginTop" select="20.2"/>
15
+ <xsl:variable name="marginBottom" select="20.3"/>
16
+
12
17
 
13
18
 
14
19
 
@@ -42,7 +47,7 @@
42
47
  <fo:root font-family="Source Sans Pro, STIX Two Math, Source Han Sans" font-size="10.5pt" xml:lang="{$lang}">
43
48
  <fo:layout-master-set>
44
49
  <!-- Cover page -->
45
- <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
50
+ <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
46
51
  <fo:region-body margin-top="23.5mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
47
52
  <fo:region-before region-name="cover-page-header" extent="23.5mm"/>
48
53
  <fo:region-after extent="10mm"/>
@@ -53,27 +58,27 @@
53
58
  <!-- Document pages -->
54
59
 
55
60
  <!-- Preface odd pages -->
56
- <fo:simple-page-master master-name="odd-preface" page-width="{$pageWidth}" page-height="{$pageHeight}">
57
- <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
61
+ <fo:simple-page-master master-name="odd-preface" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
62
+ <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
58
63
  <fo:region-before region-name="header-odd" extent="17mm"/>
59
64
  <fo:region-after region-name="footer-odd" extent="10mm"/>
60
- <fo:region-start region-name="left-region" extent="19mm"/>
61
- <fo:region-end region-name="right-region" extent="19mm"/>
65
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
66
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
62
67
  </fo:simple-page-master>
63
68
  <!-- Preface even pages -->
64
- <fo:simple-page-master master-name="even-preface" page-width="{$pageWidth}" page-height="{$pageHeight}">
65
- <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
69
+ <fo:simple-page-master master-name="even-preface" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
70
+ <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
66
71
  <fo:region-before region-name="header-even" extent="17mm"/>
67
72
  <fo:region-after region-name="footer-even" extent="10mm"/>
68
- <fo:region-start region-name="left-region" extent="19mm"/>
69
- <fo:region-end region-name="right-region" extent="19mm"/>
73
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
74
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
70
75
  </fo:simple-page-master>
71
- <fo:simple-page-master master-name="blankpage" page-width="{$pageWidth}" page-height="{$pageHeight}">
72
- <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
76
+ <fo:simple-page-master master-name="blankpage" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
77
+ <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
73
78
  <fo:region-before region-name="header" extent="17mm"/>
74
79
  <fo:region-after region-name="footer" extent="10mm"/>
75
- <fo:region-start region-name="left" extent="19mm"/>
76
- <fo:region-end region-name="right" extent="19mm"/>
80
+ <fo:region-start region-name="left" extent="{$marginLeftRight1}mm"/>
81
+ <fo:region-end region-name="right" extent="{$marginLeftRight2}mm"/>
77
82
  </fo:simple-page-master>
78
83
  <fo:page-sequence-master master-name="preface">
79
84
  <fo:repeatable-page-master-alternatives>
@@ -84,20 +89,20 @@
84
89
  </fo:page-sequence-master>
85
90
 
86
91
  <!-- Document odd pages -->
87
- <fo:simple-page-master master-name="odd" page-width="{$pageWidth}" page-height="{$pageHeight}">
88
- <fo:region-body margin-top="20.2mm" margin-bottom="20.3mm" margin-left="19mm" margin-right="19mm"/>
89
- <fo:region-before region-name="header-odd" extent="20.2mm"/>
90
- <fo:region-after region-name="footer-odd" extent="20.3mm"/>
91
- <fo:region-start region-name="left-region" extent="19mm"/>
92
- <fo:region-end region-name="right-region" extent="19mm"/>
92
+ <fo:simple-page-master master-name="odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
93
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
94
+ <fo:region-before region-name="header-odd" extent="{$marginTop}mm"/>
95
+ <fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
96
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
97
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
93
98
  </fo:simple-page-master>
94
99
  <!-- Preface even pages -->
95
- <fo:simple-page-master master-name="even" page-width="{$pageWidth}" page-height="{$pageHeight}">
96
- <fo:region-body margin-top="20.2mm" margin-bottom="20.3mm" margin-left="19mm" margin-right="19mm"/>
97
- <fo:region-before region-name="header-even" extent="20.2mm"/>
98
- <fo:region-after region-name="footer-even" extent="20.3mm"/>
99
- <fo:region-start region-name="left-region" extent="19mm"/>
100
- <fo:region-end region-name="right-region" extent="19mm"/>
100
+ <fo:simple-page-master master-name="even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
101
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
102
+ <fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
103
+ <fo:region-after region-name="footer-even" extent="{$marginBottom}mm"/>
104
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
105
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
101
106
  </fo:simple-page-master>
102
107
  <fo:page-sequence-master master-name="document">
103
108
  <fo:repeatable-page-master-alternatives>
@@ -932,6 +937,9 @@
932
937
  <title-continued lang="en">(continued)</title-continued>
933
938
  <title-continued lang="fr">(continué)</title-continued>
934
939
 
940
+ </xsl:variable><xsl:variable name="bibdata">
941
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
942
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
935
943
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
936
944
  <xsl:param name="name"/>
937
945
  <xsl:param name="lang"/>
@@ -960,11 +968,13 @@
960
968
 
961
969
  </xsl:attribute-set><xsl:attribute-set name="link-style">
962
970
 
971
+
963
972
  <xsl:attribute name="color">blue</xsl:attribute>
964
973
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
965
974
 
966
975
 
967
976
 
977
+
968
978
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
969
979
  <xsl:attribute name="white-space">pre</xsl:attribute>
970
980
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -1013,7 +1023,7 @@
1013
1023
 
1014
1024
 
1015
1025
 
1016
-
1026
+
1017
1027
  </xsl:attribute-set><xsl:attribute-set name="example-style">
1018
1028
 
1019
1029
 
@@ -1028,6 +1038,7 @@
1028
1038
 
1029
1039
 
1030
1040
 
1041
+
1031
1042
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1032
1043
 
1033
1044
 
@@ -1050,9 +1061,7 @@
1050
1061
 
1051
1062
 
1052
1063
 
1053
-
1054
-
1055
-
1064
+
1056
1065
 
1057
1066
 
1058
1067
 
@@ -1081,8 +1090,10 @@
1081
1090
 
1082
1091
 
1083
1092
 
1093
+
1084
1094
  </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1085
1095
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1096
+
1086
1097
 
1087
1098
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1088
1099
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -1099,6 +1110,9 @@
1099
1110
 
1100
1111
 
1101
1112
 
1113
+
1114
+ </xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
1115
+
1102
1116
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1103
1117
 
1104
1118
  <xsl:attribute name="font-size">12pt</xsl:attribute>
@@ -1120,17 +1134,22 @@
1120
1134
 
1121
1135
 
1122
1136
 
1137
+
1138
+
1123
1139
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1124
1140
 
1125
1141
 
1142
+
1126
1143
  <xsl:attribute name="color">blue</xsl:attribute>
1127
1144
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1128
1145
 
1129
1146
 
1130
1147
 
1148
+
1131
1149
  </xsl:attribute-set><xsl:attribute-set name="note-style">
1132
1150
 
1133
1151
 
1152
+
1134
1153
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1135
1154
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1136
1155
 
@@ -1146,9 +1165,11 @@
1146
1165
 
1147
1166
 
1148
1167
 
1168
+
1149
1169
  </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">
1150
1170
 
1151
1171
 
1172
+
1152
1173
  <xsl:attribute name="padding-right">6mm</xsl:attribute>
1153
1174
 
1154
1175
 
@@ -1179,6 +1200,7 @@
1179
1200
 
1180
1201
  </xsl:attribute-set><xsl:attribute-set name="termnote-style">
1181
1202
 
1203
+
1182
1204
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1183
1205
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1184
1206
 
@@ -1186,9 +1208,12 @@
1186
1208
 
1187
1209
 
1188
1210
 
1211
+
1189
1212
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1213
+
1190
1214
 
1191
1215
 
1216
+
1192
1217
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1193
1218
 
1194
1219
 
@@ -1210,20 +1235,24 @@
1210
1235
  </xsl:attribute-set><xsl:attribute-set name="termsource-style">
1211
1236
 
1212
1237
 
1238
+
1213
1239
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1214
1240
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1215
1241
 
1216
1242
 
1217
1243
 
1218
1244
 
1245
+
1219
1246
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
1220
1247
 
1221
1248
 
1222
1249
 
1250
+
1223
1251
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1224
1252
 
1225
1253
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1226
1254
 
1255
+
1227
1256
 
1228
1257
 
1229
1258
 
@@ -1243,6 +1272,7 @@
1243
1272
 
1244
1273
 
1245
1274
 
1275
+
1246
1276
 
1247
1277
 
1248
1278
 
@@ -1256,10 +1286,12 @@
1256
1286
 
1257
1287
 
1258
1288
 
1289
+
1259
1290
  </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
1260
1291
 
1261
1292
  </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
1262
1293
 
1294
+
1263
1295
  <xsl:attribute name="width">100%</xsl:attribute>
1264
1296
  <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
1265
1297
  <xsl:attribute name="scaling">uniform</xsl:attribute>
@@ -1286,13 +1318,16 @@
1286
1318
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1287
1319
 
1288
1320
 
1321
+
1289
1322
  </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1290
1323
 
1324
+
1291
1325
  </xsl:attribute-set><xsl:attribute-set name="definition-style">
1292
1326
 
1293
1327
 
1294
1328
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1295
1329
 
1330
+
1296
1331
  </xsl:attribute-set><xsl:variable name="color-added-text">
1297
1332
  <xsl:text>rgb(0, 255, 0)</xsl:text>
1298
1333
  </xsl:variable><xsl:attribute-set name="add-style">
@@ -1311,6 +1346,8 @@
1311
1346
  <xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
1312
1347
 
1313
1348
 
1349
+ </xsl:attribute-set><xsl:attribute-set name="list-style">
1350
+
1314
1351
  </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">
1315
1352
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1316
1353
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
@@ -1321,14 +1358,15 @@
1321
1358
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1322
1359
 
1323
1360
  <!-- Normative references -->
1324
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
1361
+ <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"/>
1325
1362
  <!-- Terms and definitions -->
1326
1363
  <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"/>
1327
1364
  <!-- Another main sections -->
1328
1365
  <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"/>
1329
1366
  <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1330
1367
  <!-- Bibliography -->
1331
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
1368
+ <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"/>
1369
+
1332
1370
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1333
1371
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1334
1372
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
@@ -1364,11 +1402,11 @@
1364
1402
  <xsl:variable name="table">
1365
1403
 
1366
1404
  <xsl:variable name="simple-table">
1367
- <xsl:call-template name="getSimpleTable"/>
1405
+ <xsl:call-template name="getSimpleTable"/>
1368
1406
  </xsl:variable>
1369
1407
 
1370
1408
  <!-- <xsl:if test="$namespace = 'bipm'">
1371
- <fo:block>&#xA0;</fo:block>
1409
+ <fo:block>&#xA0;</fo:block>
1372
1410
  </xsl:if> -->
1373
1411
 
1374
1412
  <!-- $namespace = 'iso' or -->
@@ -1430,6 +1468,7 @@
1430
1468
 
1431
1469
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1432
1470
 
1471
+
1433
1472
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1434
1473
 
1435
1474
 
@@ -1445,6 +1484,8 @@
1445
1484
 
1446
1485
 
1447
1486
 
1487
+
1488
+
1448
1489
  <xsl:variable name="table_width">
1449
1490
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1450
1491
  100%
@@ -1462,12 +1503,14 @@
1462
1503
 
1463
1504
 
1464
1505
 
1506
+
1465
1507
 
1466
1508
 
1467
1509
 
1468
1510
 
1469
1511
 
1470
1512
 
1513
+
1471
1514
  </xsl:variable>
1472
1515
 
1473
1516
 
@@ -1604,11 +1647,25 @@
1604
1647
  </xsl:choose>
1605
1648
 
1606
1649
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1650
+ <xsl:param name="continued"/>
1607
1651
  <xsl:if test="normalize-space() != ''">
1608
1652
  <fo:block xsl:use-attribute-sets="table-name-style">
1609
1653
 
1610
1654
 
1611
- <xsl:apply-templates/>
1655
+
1656
+
1657
+
1658
+ <xsl:choose>
1659
+ <xsl:when test="$continued = 'true'">
1660
+ <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
1661
+
1662
+ </xsl:when>
1663
+ <xsl:otherwise>
1664
+ <xsl:apply-templates/>
1665
+ </xsl:otherwise>
1666
+ </xsl:choose>
1667
+
1668
+
1612
1669
  </fo:block>
1613
1670
  </xsl:if>
1614
1671
  </xsl:template><xsl:template name="calculate-columns-numbers">
@@ -1745,21 +1802,22 @@
1745
1802
  <!-- font-weight="bold" -->
1746
1803
  <fo:table-header>
1747
1804
 
1805
+
1748
1806
  <xsl:apply-templates/>
1749
1807
  </fo:table-header>
1750
1808
  </xsl:template><xsl:template name="table-header-title">
1751
- <xsl:param name="cols-count"/>
1809
+ <xsl:param name="cols-count"/>
1752
1810
  <!-- row for title -->
1753
1811
  <fo:table-row>
1754
1812
  <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">
1755
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
1813
+
1814
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
1815
+ <xsl:with-param name="continued">true</xsl:with-param>
1816
+ </xsl:apply-templates>
1756
1817
  <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1757
1818
  <xsl:call-template name="fn_name_display"/>
1758
- </xsl:for-each>
1759
- <fo:block text-align="right" font-style="italic">
1760
- <xsl:text> </xsl:text>
1761
- <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
1762
- </fo:block>
1819
+ </xsl:for-each>
1820
+
1763
1821
  </fo:table-cell>
1764
1822
  </fo:table-row>
1765
1823
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
@@ -1980,6 +2038,7 @@
1980
2038
 
1981
2039
 
1982
2040
 
2041
+
1983
2042
  </xsl:if>
1984
2043
  <xsl:if test="$parent-name = 'tfoot'">
1985
2044
 
@@ -1989,6 +2048,10 @@
1989
2048
 
1990
2049
 
1991
2050
 
2051
+
2052
+
2053
+
2054
+
1992
2055
  <!-- <xsl:if test="$namespace = 'bipm'">
1993
2056
  <xsl:attribute name="height">8mm</xsl:attribute>
1994
2057
  </xsl:if> -->
@@ -2017,6 +2080,8 @@
2017
2080
 
2018
2081
 
2019
2082
 
2083
+
2084
+
2020
2085
  <xsl:if test="$lang = 'ar'">
2021
2086
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2022
2087
  </xsl:if>
@@ -2071,6 +2136,11 @@
2071
2136
 
2072
2137
 
2073
2138
 
2139
+
2140
+
2141
+
2142
+
2143
+
2074
2144
  <xsl:if test=".//*[local-name() = 'table']">
2075
2145
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2076
2146
  </xsl:if>
@@ -2100,6 +2170,7 @@
2100
2170
 
2101
2171
 
2102
2172
 
2173
+
2103
2174
  <fo:inline padding-right="2mm">
2104
2175
 
2105
2176
 
@@ -2143,6 +2214,7 @@
2143
2214
 
2144
2215
 
2145
2216
 
2217
+
2146
2218
  <xsl:value-of select="@reference"/>
2147
2219
 
2148
2220
 
@@ -2286,6 +2358,10 @@
2286
2358
 
2287
2359
 
2288
2360
 
2361
+
2362
+
2363
+
2364
+
2289
2365
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2290
2366
 
2291
2367
 
@@ -2377,6 +2453,7 @@
2377
2453
 
2378
2454
 
2379
2455
 
2456
+
2380
2457
  <xsl:variable name="title-key">
2381
2458
 
2382
2459
 
@@ -2587,6 +2664,7 @@
2587
2664
 
2588
2665
  <fo:table-row>
2589
2666
 
2667
+
2590
2668
  <fo:table-cell>
2591
2669
 
2592
2670
  <fo:block margin-top="6pt">
@@ -2604,6 +2682,7 @@
2604
2682
 
2605
2683
 
2606
2684
 
2685
+
2607
2686
  <xsl:apply-templates/>
2608
2687
  <!-- <xsl:if test="$namespace = 'gb'">
2609
2688
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -2660,6 +2739,8 @@
2660
2739
 
2661
2740
  <xsl:apply-templates/>
2662
2741
  </fo:inline>
2742
+ </xsl:template><xsl:template match="*[local-name()='padding']">
2743
+ <fo:inline padding-right="{@value}"> </fo:inline>
2663
2744
  </xsl:template><xsl:template match="*[local-name()='sup']">
2664
2745
  <fo:inline font-size="80%" vertical-align="super">
2665
2746
  <xsl:apply-templates/>
@@ -2685,6 +2766,7 @@
2685
2766
 
2686
2767
 
2687
2768
 
2769
+
2688
2770
 
2689
2771
  </xsl:variable>
2690
2772
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -3066,11 +3148,15 @@
3066
3148
  </xsl:apply-templates>
3067
3149
  </xsl:template><xsl:template name="getLang">
3068
3150
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3151
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3069
3152
  <xsl:variable name="language">
3070
3153
  <xsl:choose>
3071
3154
  <xsl:when test="$language_current != ''">
3072
3155
  <xsl:value-of select="$language_current"/>
3073
3156
  </xsl:when>
3157
+ <xsl:when test="$language_current_2 != ''">
3158
+ <xsl:value-of select="$language_current_2"/>
3159
+ </xsl:when>
3074
3160
  <xsl:otherwise>
3075
3161
  <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3076
3162
  </xsl:otherwise>
@@ -3144,9 +3230,27 @@
3144
3230
  <xsl:copy>
3145
3231
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
3146
3232
  </xsl:copy>
3147
- <mathml:mspace width="0.5ex"/>
3233
+ <xsl:choose>
3234
+ <!-- if in msub, then don't add space -->
3235
+ <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
3236
+ <!-- if next char in digit, don't add space -->
3237
+ <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
3238
+ <xsl:otherwise>
3239
+ <mathml:mspace width="0.5ex"/>
3240
+ </xsl:otherwise>
3241
+ </xsl:choose>
3148
3242
  </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">
3149
3243
  <xsl:variable name="target">
3244
+ <xsl:choose>
3245
+ <xsl:when test="@updatetype = 'true'">
3246
+ <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
3247
+ </xsl:when>
3248
+ <xsl:otherwise>
3249
+ <xsl:value-of select="normalize-space(@target)"/>
3250
+ </xsl:otherwise>
3251
+ </xsl:choose>
3252
+ </xsl:variable>
3253
+ <xsl:variable name="target_text">
3150
3254
  <xsl:choose>
3151
3255
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
3152
3256
  <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
@@ -3158,20 +3262,22 @@
3158
3262
  </xsl:variable>
3159
3263
  <fo:inline xsl:use-attribute-sets="link-style">
3160
3264
 
3265
+
3266
+
3161
3267
  <xsl:choose>
3162
- <xsl:when test="$target = ''">
3268
+ <xsl:when test="$target_text = ''">
3163
3269
  <xsl:apply-templates/>
3164
3270
  </xsl:when>
3165
3271
  <xsl:otherwise>
3166
- <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
3272
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
3167
3273
  <xsl:choose>
3168
3274
  <xsl:when test="normalize-space(.) = ''">
3169
- <!-- <xsl:value-of select="$target"/> -->
3170
3275
  <xsl:call-template name="add-zero-spaces-link-java">
3171
- <xsl:with-param name="text" select="$target"/>
3276
+ <xsl:with-param name="text" select="$target_text"/>
3172
3277
  </xsl:call-template>
3173
3278
  </xsl:when>
3174
3279
  <xsl:otherwise>
3280
+ <!-- output text from <link>text</link> -->
3175
3281
  <xsl:apply-templates/>
3176
3282
  </xsl:otherwise>
3177
3283
  </xsl:choose>
@@ -3283,6 +3389,7 @@
3283
3389
 
3284
3390
 
3285
3391
  <fo:inline xsl:use-attribute-sets="note-name-style">
3392
+
3286
3393
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3287
3394
  </fo:inline>
3288
3395
  <xsl:apply-templates/>
@@ -3308,7 +3415,9 @@
3308
3415
  </xsl:choose>
3309
3416
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
3310
3417
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
3418
+
3311
3419
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
3420
+
3312
3421
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3313
3422
  </fo:inline>
3314
3423
  <xsl:apply-templates/>
@@ -3380,13 +3489,17 @@
3380
3489
  </xsl:call-template>
3381
3490
 
3382
3491
  <fo:block>
3492
+
3383
3493
  <xsl:apply-templates/>
3384
3494
  </fo:block>
3385
3495
  <xsl:call-template name="fn_display_figure"/>
3386
3496
  <xsl:for-each select="*[local-name() = 'note']">
3387
3497
  <xsl:call-template name="note"/>
3388
3498
  </xsl:for-each>
3389
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3499
+
3500
+
3501
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3502
+
3390
3503
  </fo:block-container>
3391
3504
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
3392
3505
  <fo:block id="{@id}">
@@ -3499,21 +3612,249 @@
3499
3612
  <xsl:param name="height"/>
3500
3613
  <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; "/>
3501
3614
  <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; "/>
3615
+ </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">
3616
+ <xsl:param name="name"/>
3617
+
3618
+ <xsl:variable name="svg_content">
3619
+ <xsl:apply-templates select="." mode="svg_update"/>
3620
+ </xsl:variable>
3621
+
3622
+ <xsl:variable name="alt-text">
3623
+ <xsl:choose>
3624
+ <xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
3625
+ <xsl:value-of select="../*[local-name() = 'name']"/>
3626
+ </xsl:when>
3627
+ <xsl:when test="normalize-space($name) != ''">
3628
+ <xsl:value-of select="$name"/>
3629
+ </xsl:when>
3630
+ <xsl:otherwise>Figure</xsl:otherwise>
3631
+ </xsl:choose>
3632
+ </xsl:variable>
3633
+
3634
+ <xsl:choose>
3635
+ <xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
3636
+ <fo:block>
3637
+ <xsl:variable name="width" select="@width"/>
3638
+ <xsl:variable name="height" select="@height"/>
3639
+
3640
+ <xsl:variable name="scale_x">
3641
+ <xsl:choose>
3642
+ <xsl:when test="$width &gt; $width_effective_px">
3643
+ <xsl:value-of select="$width_effective_px div $width"/>
3644
+ </xsl:when>
3645
+ <xsl:otherwise>1</xsl:otherwise>
3646
+ </xsl:choose>
3647
+ </xsl:variable>
3648
+
3649
+ <xsl:variable name="scale_y">
3650
+ <xsl:choose>
3651
+ <xsl:when test="$height * $scale_x &gt; $height_effective_px">
3652
+ <xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
3653
+ </xsl:when>
3654
+ <xsl:otherwise>1</xsl:otherwise>
3655
+ </xsl:choose>
3656
+ </xsl:variable>
3657
+
3658
+ <xsl:variable name="scale">
3659
+ <xsl:choose>
3660
+ <xsl:when test="$scale_y != 1">
3661
+ <xsl:value-of select="$scale_x * $scale_y"/>
3662
+ </xsl:when>
3663
+ <xsl:otherwise>
3664
+ <xsl:value-of select="$scale_x"/>
3665
+ </xsl:otherwise>
3666
+ </xsl:choose>
3667
+ </xsl:variable>
3668
+
3669
+ <xsl:variable name="width_scale" select="round($width * $scale)"/>
3670
+ <xsl:variable name="height_scale" select="round($height * $scale)"/>
3671
+
3672
+ <fo:table table-layout="fixed" width="100%">
3673
+ <fo:table-column column-width="proportional-column-width(1)"/>
3674
+ <fo:table-column column-width="{$width_scale}px"/>
3675
+ <fo:table-column column-width="proportional-column-width(1)"/>
3676
+ <fo:table-body>
3677
+ <fo:table-row>
3678
+ <fo:table-cell column-number="2">
3679
+ <fo:block>
3680
+ <fo:block-container width="{$width_scale}px" height="{$height_scale}px">
3681
+ <xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
3682
+ <fo:block line-height="0" font-size="0">
3683
+ <xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
3684
+ <xsl:call-template name="bookmark"/>
3685
+ </xsl:for-each>
3686
+ </fo:block>
3687
+ </xsl:if>
3688
+ <fo:block text-depth="0" line-height="0" font-size="0">
3689
+
3690
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
3691
+ <xsl:attribute name="width">100%</xsl:attribute>
3692
+ <xsl:attribute name="content-height">100%</xsl:attribute>
3693
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
3694
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
3695
+
3696
+ <xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
3697
+ </fo:instream-foreign-object>
3698
+ </fo:block>
3699
+
3700
+ <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">
3701
+ <xsl:with-param name="scale" select="$scale"/>
3702
+ </xsl:apply-templates>
3703
+ </fo:block-container>
3704
+ </fo:block>
3705
+ </fo:table-cell>
3706
+ </fo:table-row>
3707
+ </fo:table-body>
3708
+ </fo:table>
3709
+ </fo:block>
3710
+
3711
+ </xsl:when>
3712
+ <xsl:otherwise>
3713
+ <fo:block xsl:use-attribute-sets="image-style">
3714
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
3715
+ <xsl:attribute name="width">100%</xsl:attribute>
3716
+ <xsl:attribute name="content-height">100%</xsl:attribute>
3717
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
3718
+ <!-- effective height 297 - 27.4 - 13 = 256.6 -->
3719
+ <!-- effective width 210 - 12.5 - 25 = 172.5 -->
3720
+ <!-- effective height / width = 1.48, 1.4 - with title -->
3721
+ <xsl:if test="@height &gt; (@width * 1.4)"> <!-- for images with big height -->
3722
+ <xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
3723
+ <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
3724
+ </xsl:if>
3725
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
3726
+ <xsl:copy-of select="$svg_content"/>
3727
+ </fo:instream-foreign-object>
3728
+ </fo:block>
3729
+ </xsl:otherwise>
3730
+ </xsl:choose>
3731
+ </xsl:template><xsl:template match="@*|node()" mode="svg_update">
3732
+ <xsl:copy>
3733
+ <xsl:apply-templates select="@*|node()" mode="svg_update"/>
3734
+ </xsl:copy>
3735
+ </xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
3736
+ <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
3737
+ <xsl:value-of select="."/>
3738
+ </xsl:attribute>
3739
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
3740
+ <xsl:variable name="svg_content" select="document(@src)"/>
3741
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
3742
+ <xsl:for-each select="xalan:nodeset($svg_content)/node()">
3743
+ <xsl:call-template name="image_svg">
3744
+ <xsl:with-param name="name" select="$name"/>
3745
+ </xsl:call-template>
3746
+ </xsl:for-each>
3747
+ </xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
3748
+ <xsl:copy>
3749
+ <xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
3750
+ </xsl:copy>
3751
+ </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
3752
+ <xsl:apply-templates mode="svg_remove_a"/>
3753
+ </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
3754
+ <xsl:param name="scale"/>
3755
+ <xsl:variable name="dest">
3756
+ <xsl:choose>
3757
+ <xsl:when test="starts-with(@href, '#')">
3758
+ <xsl:value-of select="substring-after(@href, '#')"/>
3759
+ </xsl:when>
3760
+ <xsl:otherwise>
3761
+ <xsl:value-of select="@href"/>
3762
+ </xsl:otherwise>
3763
+ </xsl:choose>
3764
+ </xsl:variable>
3765
+ <xsl:for-each select="./*[local-name() = 'rect']">
3766
+ <xsl:call-template name="insertSVGMapLink">
3767
+ <xsl:with-param name="left" select="floor(@x * $scale)"/>
3768
+ <xsl:with-param name="top" select="floor(@y * $scale)"/>
3769
+ <xsl:with-param name="width" select="floor(@width * $scale)"/>
3770
+ <xsl:with-param name="height" select="floor(@height * $scale)"/>
3771
+ <xsl:with-param name="dest" select="$dest"/>
3772
+ </xsl:call-template>
3773
+ </xsl:for-each>
3774
+
3775
+ <xsl:for-each select="./*[local-name() = 'polygon']">
3776
+ <xsl:variable name="points">
3777
+ <xsl:call-template name="split">
3778
+ <xsl:with-param name="pText" select="@points"/>
3779
+ </xsl:call-template>
3780
+ </xsl:variable>
3781
+ <xsl:variable name="x_coords">
3782
+ <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
3783
+ <xsl:sort select="." data-type="number"/>
3784
+ <x><xsl:value-of select="."/></x>
3785
+ </xsl:for-each>
3786
+ </xsl:variable>
3787
+ <xsl:variable name="y_coords">
3788
+ <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
3789
+ <xsl:sort select="." data-type="number"/>
3790
+ <y><xsl:value-of select="."/></y>
3791
+ </xsl:for-each>
3792
+ </xsl:variable>
3793
+ <xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
3794
+ <xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
3795
+ <xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
3796
+ <xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
3797
+ <xsl:call-template name="insertSVGMapLink">
3798
+ <xsl:with-param name="left" select="floor($x * $scale)"/>
3799
+ <xsl:with-param name="top" select="floor($y * $scale)"/>
3800
+ <xsl:with-param name="width" select="floor($width * $scale)"/>
3801
+ <xsl:with-param name="height" select="floor($height * $scale)"/>
3802
+ <xsl:with-param name="dest" select="$dest"/>
3803
+ </xsl:call-template>
3804
+ </xsl:for-each>
3805
+
3806
+ <xsl:for-each select="./*[local-name() = 'circle']">
3807
+ <xsl:call-template name="insertSVGMapLink">
3808
+ <xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
3809
+ <xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
3810
+ <xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
3811
+ <xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
3812
+ <xsl:with-param name="dest" select="$dest"/>
3813
+ </xsl:call-template>
3814
+ </xsl:for-each>
3815
+ <xsl:for-each select="./*[local-name() = 'ellipse']">
3816
+ <xsl:call-template name="insertSVGMapLink">
3817
+ <xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
3818
+ <xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
3819
+ <xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
3820
+ <xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
3821
+ <xsl:with-param name="dest" select="$dest"/>
3822
+ </xsl:call-template>
3823
+ </xsl:for-each>
3824
+ </xsl:template><xsl:template name="insertSVGMapLink">
3825
+ <xsl:param name="left"/>
3826
+ <xsl:param name="top"/>
3827
+ <xsl:param name="width"/>
3828
+ <xsl:param name="height"/>
3829
+ <xsl:param name="dest"/>
3830
+ <fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
3831
+ <fo:block font-size="1pt">
3832
+ <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
3833
+ <fo:inline-container inline-progression-dimension="100%">
3834
+ <fo:block-container height="{$height - 1}px" width="100%">
3835
+ <!-- DEBUG <xsl:if test="local-name()='polygon'">
3836
+ <xsl:attribute name="background-color">magenta</xsl:attribute>
3837
+ </xsl:if> -->
3838
+ <fo:block> </fo:block></fo:block-container>
3839
+ </fo:inline-container>
3840
+ </fo:basic-link>
3841
+ </fo:block>
3842
+ </fo:block-container>
3502
3843
  </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">
3503
3844
  <xsl:apply-templates mode="contents"/>
3504
3845
  <xsl:text> </xsl:text>
3505
3846
  </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">
3506
3847
  <xsl:apply-templates mode="bookmarks"/>
3507
3848
  <xsl:text> </xsl:text>
3508
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
3849
+ </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">
3509
3850
  <xsl:value-of select="."/>
3510
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
3851
+ </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">
3511
3852
  <xsl:value-of select="."/>
3512
3853
  </xsl:template><xsl:template match="node()" mode="contents">
3513
3854
  <xsl:apply-templates mode="contents"/>
3514
3855
  </xsl:template><xsl:template match="node()" mode="bookmarks">
3515
3856
  <xsl:apply-templates mode="bookmarks"/>
3516
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3857
+ </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
3517
3858
  <xsl:apply-templates select="."/>
3518
3859
  </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3519
3860
  <xsl:apply-templates mode="bookmarks"/>
@@ -3527,28 +3868,39 @@
3527
3868
  <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3528
3869
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3529
3870
  <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3871
+ <xsl:if test="@bundle = 'true'">
3872
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
3873
+ </xsl:if>
3530
3874
  <fo:bookmark-title>
3531
- <xsl:variable name="bookmark-title_">
3532
- <xsl:call-template name="getLangVersion">
3533
- <xsl:with-param name="lang" select="@lang"/>
3534
- <xsl:with-param name="doctype" select="@doctype"/>
3535
- <xsl:with-param name="title" select="@title-part"/>
3536
- </xsl:call-template>
3537
- </xsl:variable>
3538
3875
  <xsl:choose>
3539
- <xsl:when test="normalize-space($bookmark-title_) != ''">
3540
- <xsl:value-of select="normalize-space($bookmark-title_)"/>
3541
- </xsl:when>
3542
- <xsl:otherwise>
3876
+ <xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
3877
+ <xsl:variable name="bookmark-title_">
3878
+ <xsl:call-template name="getLangVersion">
3879
+ <xsl:with-param name="lang" select="@lang"/>
3880
+ <xsl:with-param name="doctype" select="@doctype"/>
3881
+ <xsl:with-param name="title" select="@title-part"/>
3882
+ </xsl:call-template>
3883
+ </xsl:variable>
3543
3884
  <xsl:choose>
3544
- <xsl:when test="@lang = 'en'">English</xsl:when>
3545
- <xsl:when test="@lang = 'fr'">Français</xsl:when>
3546
- <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3547
- <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3885
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
3886
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
3887
+ </xsl:when>
3888
+ <xsl:otherwise>
3889
+ <xsl:choose>
3890
+ <xsl:when test="@lang = 'en'">English</xsl:when>
3891
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
3892
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3893
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3894
+ </xsl:choose>
3895
+ </xsl:otherwise>
3548
3896
  </xsl:choose>
3897
+ </xsl:when>
3898
+ <xsl:otherwise>
3899
+ <xsl:value-of select="@title-part"/>
3549
3900
  </xsl:otherwise>
3550
3901
  </xsl:choose>
3551
3902
  </fo:bookmark-title>
3903
+
3552
3904
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3553
3905
 
3554
3906
  <xsl:call-template name="insertFigureBookmarks">
@@ -3647,20 +3999,28 @@
3647
3999
  <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3648
4000
  </xsl:choose>
3649
4001
  </xsl:template><xsl:template match="item" mode="bookmark">
3650
- <fo:bookmark internal-destination="{@id}" starting-state="hide">
3651
- <fo:bookmark-title>
3652
- <xsl:if test="@section != ''">
3653
- <xsl:value-of select="@section"/>
3654
- <xsl:text> </xsl:text>
3655
- </xsl:if>
3656
- <xsl:value-of select="normalize-space(title)"/>
3657
- </fo:bookmark-title>
3658
- <xsl:apply-templates mode="bookmark"/>
3659
- </fo:bookmark>
4002
+ <xsl:choose>
4003
+ <xsl:when test="@id != ''">
4004
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
4005
+ <fo:bookmark-title>
4006
+ <xsl:if test="@section != ''">
4007
+ <xsl:value-of select="@section"/>
4008
+ <xsl:text> </xsl:text>
4009
+ </xsl:if>
4010
+ <xsl:value-of select="normalize-space(title)"/>
4011
+ </fo:bookmark-title>
4012
+ <xsl:apply-templates mode="bookmark"/>
4013
+ </fo:bookmark>
4014
+ </xsl:when>
4015
+ <xsl:otherwise>
4016
+ <xsl:apply-templates mode="bookmark"/>
4017
+ </xsl:otherwise>
4018
+ </xsl:choose>
3660
4019
  </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">
3661
4020
  <xsl:if test="normalize-space() != ''">
3662
4021
  <fo:block xsl:use-attribute-sets="figure-name-style">
3663
4022
 
4023
+
3664
4024
  <xsl:apply-templates/>
3665
4025
  </fo:block>
3666
4026
  </xsl:if>
@@ -3712,6 +4072,8 @@
3712
4072
  </fo:list-item-body>
3713
4073
  </fo:list-item>
3714
4074
  </fo:list-block>
4075
+ </xsl:template><xsl:template name="extractSection">
4076
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
3715
4077
  </xsl:template><xsl:template name="extractTitle">
3716
4078
  <xsl:choose>
3717
4079
  <xsl:when test="*[local-name() = 'tab']">
@@ -3738,6 +4100,8 @@
3738
4100
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
3739
4101
 
3740
4102
  <fo:block-container margin-left="0mm">
4103
+ <xsl:copy-of select="@id"/>
4104
+
3741
4105
  <xsl:if test="parent::*[local-name() = 'note']">
3742
4106
  <xsl:attribute name="margin-left">
3743
4107
  <xsl:choose>
@@ -3748,7 +4112,9 @@
3748
4112
 
3749
4113
  </xsl:if>
3750
4114
  <fo:block-container margin-left="0mm">
3751
-
4115
+
4116
+
4117
+
3752
4118
  <fo:block xsl:use-attribute-sets="sourcecode-style">
3753
4119
  <xsl:variable name="_font-size">
3754
4120
 
@@ -3759,6 +4125,7 @@
3759
4125
 
3760
4126
 
3761
4127
 
4128
+
3762
4129
 
3763
4130
 
3764
4131
 
@@ -3776,10 +4143,14 @@
3776
4143
  </xsl:choose>
3777
4144
  </xsl:attribute>
3778
4145
  </xsl:if>
3779
- <xsl:apply-templates/>
3780
- </fo:block>
4146
+
4147
+ <xsl:apply-templates/>
4148
+ </fo:block>
4149
+
4150
+
3781
4151
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3782
4152
 
4153
+
3783
4154
  </fo:block-container>
3784
4155
  </fo:block-container>
3785
4156
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
@@ -4014,6 +4385,7 @@
4014
4385
  </xsl:template><xsl:template match="*[local-name() = 'example']">
4015
4386
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4016
4387
 
4388
+
4017
4389
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4018
4390
 
4019
4391
  <xsl:variable name="element">
@@ -4081,7 +4453,7 @@
4081
4453
  </fo:inline>
4082
4454
  </xsl:otherwise>
4083
4455
  </xsl:choose>
4084
- </xsl:template><xsl:template match="*[local-name() = 'termsource']">
4456
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
4085
4457
  <fo:block xsl:use-attribute-sets="termsource-style">
4086
4458
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
4087
4459
  <xsl:variable name="termsource_text">
@@ -4090,13 +4462,15 @@
4090
4462
 
4091
4463
  <xsl:choose>
4092
4464
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
4093
- <xsl:apply-templates/>
4465
+ <!-- <xsl:apply-templates /> -->
4466
+ <xsl:copy-of select="$termsource_text"/>
4094
4467
  </xsl:when>
4095
4468
  <xsl:otherwise>
4096
4469
 
4097
4470
  <xsl:text>[</xsl:text>
4098
4471
 
4099
- <xsl:apply-templates/>
4472
+ <!-- <xsl:apply-templates /> -->
4473
+ <xsl:copy-of select="$termsource_text"/>
4100
4474
 
4101
4475
  <xsl:text>]</xsl:text>
4102
4476
 
@@ -4107,20 +4481,29 @@
4107
4481
  <xsl:if test="normalize-space() != ''">
4108
4482
  <xsl:value-of select="."/>
4109
4483
  </xsl:if>
4110
- </xsl:template><xsl:template match="*[local-name() = 'origin']">
4484
+ </xsl:template><xsl:variable name="localized.source">
4485
+ <xsl:call-template name="getLocalizedString">
4486
+ <xsl:with-param name="key">source</xsl:with-param>
4487
+ </xsl:call-template>
4488
+ </xsl:variable><xsl:template match="*[local-name() = 'origin']">
4111
4489
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4490
+ <xsl:if test="normalize-space(@citeas) = ''">
4491
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
4492
+ </xsl:if>
4112
4493
 
4113
4494
  <fo:inline>
4114
4495
 
4115
4496
 
4116
4497
 
4117
4498
 
4499
+
4500
+
4118
4501
  <xsl:call-template name="getTitle">
4119
4502
  <xsl:with-param name="name" select="'title-source'"/>
4120
4503
  </xsl:call-template>
4504
+ <xsl:text>: </xsl:text>
4121
4505
 
4122
4506
 
4123
- <xsl:text>: </xsl:text>
4124
4507
  </fo:inline>
4125
4508
 
4126
4509
  <fo:inline xsl:use-attribute-sets="origin-style">
@@ -4193,6 +4576,7 @@
4193
4576
  </xsl:if>
4194
4577
 
4195
4578
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4579
+
4196
4580
  <xsl:if test="normalize-space(@citeas) = ''">
4197
4581
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
4198
4582
  </xsl:if>
@@ -4247,6 +4631,7 @@
4247
4631
 
4248
4632
 
4249
4633
 
4634
+
4250
4635
  </xsl:variable>
4251
4636
 
4252
4637
  <xsl:variable name="padding-right">
@@ -4332,7 +4717,6 @@
4332
4717
 
4333
4718
 
4334
4719
 
4335
-
4336
4720
  <xsl:apply-templates/>
4337
4721
  </fo:block>
4338
4722
 
@@ -4349,6 +4733,7 @@
4349
4733
  <xsl:call-template name="setId"/>
4350
4734
 
4351
4735
 
4736
+
4352
4737
  <xsl:apply-templates/>
4353
4738
  </fo:block>
4354
4739
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
@@ -4375,7 +4760,7 @@
4375
4760
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
4376
4761
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
4377
4762
  <xsl:choose>
4378
- <xsl:when test="parent::*[local-name() = 'note']">
4763
+ <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
4379
4764
  <fo:block-container>
4380
4765
  <xsl:attribute name="margin-left">
4381
4766
  <xsl:choose>
@@ -4385,6 +4770,7 @@
4385
4770
  </xsl:attribute>
4386
4771
 
4387
4772
 
4773
+
4388
4774
  <fo:block-container margin-left="0mm">
4389
4775
  <fo:block>
4390
4776
  <xsl:apply-templates select="." mode="ul_ol"/>
@@ -4586,21 +4972,25 @@
4586
4972
 
4587
4973
 
4588
4974
 
4975
+
4976
+
4977
+
4978
+
4589
4979
  </xsl:template><xsl:template name="processBibitemDocId">
4590
4980
  <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')]"/>
4591
4981
  <xsl:choose>
4592
4982
  <xsl:when test="normalize-space($_doc_ident) != ''">
4593
- <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"/>
4983
+ <!-- <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"/>
4594
4984
  <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
4595
4985
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4596
- </xsl:if>
4986
+ </xsl:if> -->
4597
4987
  <xsl:value-of select="$_doc_ident"/>
4598
4988
  </xsl:when>
4599
4989
  <xsl:otherwise>
4600
- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
4990
+ <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
4601
4991
  <xsl:if test="$type != ''">
4602
4992
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4603
- </xsl:if>
4993
+ </xsl:if> -->
4604
4994
  <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
4605
4995
  </xsl:otherwise>
4606
4996
  </xsl:choose>
@@ -4642,6 +5032,70 @@
4642
5032
  <xsl:value-of select="substring(.,1,1)"/>
4643
5033
  </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
4644
5034
  <fo:inline><xsl:apply-templates/></fo:inline>
5035
+ </xsl:template><xsl:template match="*[local-name() = 'form']">
5036
+ <fo:block>
5037
+ <xsl:apply-templates/>
5038
+ </fo:block>
5039
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'label']">
5040
+ <fo:inline><xsl:apply-templates/></fo:inline>
5041
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'text' or @type = 'date' or @type = 'file' or @type = 'password']">
5042
+ <fo:inline>
5043
+ <xsl:call-template name="text_input"/>
5044
+ </fo:inline>
5045
+ </xsl:template><xsl:template name="text_input">
5046
+ <xsl:variable name="count">
5047
+ <xsl:choose>
5048
+ <xsl:when test="normalize-space(@maxlength) != ''"><xsl:value-of select="@maxlength"/></xsl:when>
5049
+ <xsl:when test="normalize-space(@size) != ''"><xsl:value-of select="@size"/></xsl:when>
5050
+ <xsl:otherwise>10</xsl:otherwise>
5051
+ </xsl:choose>
5052
+ </xsl:variable>
5053
+ <xsl:call-template name="repeat">
5054
+ <xsl:with-param name="char" select="'_'"/>
5055
+ <xsl:with-param name="count" select="$count"/>
5056
+ </xsl:call-template>
5057
+ <xsl:text> </xsl:text>
5058
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'button']">
5059
+ <xsl:variable name="caption">
5060
+ <xsl:choose>
5061
+ <xsl:when test="normalize-space(@value) != ''"><xsl:value-of select="@value"/></xsl:when>
5062
+ <xsl:otherwise>BUTTON</xsl:otherwise>
5063
+ </xsl:choose>
5064
+ </xsl:variable>
5065
+ <fo:inline>[<xsl:value-of select="$caption"/>]</fo:inline>
5066
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'checkbox']">
5067
+ <fo:inline padding-right="1mm">
5068
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
5069
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
5070
+ <xsl:attribute name="content-width">100%</xsl:attribute>
5071
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
5072
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
5073
+ <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
5074
+ <polyline points="0,0 80,0 80,80 0,80 0,0" stroke="black" stroke-width="5" fill="white"/>
5075
+ </svg>
5076
+ </fo:instream-foreign-object>
5077
+ </fo:inline>
5078
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'radio']">
5079
+ <fo:inline padding-right="1mm">
5080
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
5081
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
5082
+ <xsl:attribute name="content-width">100%</xsl:attribute>
5083
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
5084
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
5085
+ <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
5086
+ <circle cx="40" cy="40" r="30" stroke="black" stroke-width="5" fill="white"/>
5087
+ <circle cx="40" cy="40" r="15" stroke="black" stroke-width="5" fill="white"/>
5088
+ </svg>
5089
+ </fo:instream-foreign-object>
5090
+ </fo:inline>
5091
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'select']">
5092
+ <fo:inline>
5093
+ <xsl:call-template name="text_input"/>
5094
+ </fo:inline>
5095
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'textarea']">
5096
+ <fo:block-container border="1pt solid black" width="50%">
5097
+ <fo:block> </fo:block>
5098
+ </fo:block-container>
4645
5099
  </xsl:template><xsl:template name="convertDate">
4646
5100
  <xsl:param name="date"/>
4647
5101
  <xsl:param name="format" select="'short'"/>
@@ -4849,6 +5303,9 @@
4849
5303
  <xsl:when test="parent::*[local-name() = 'preface']">
4850
5304
  <xsl:value-of select="$level_total - 1"/>
4851
5305
  </xsl:when>
5306
+ <xsl:when test="ancestor::*[local-name() = 'preface'] and not(ancestor::*[local-name() = 'foreword']) and not(ancestor::*[local-name() = 'introduction'])"> <!-- for preface/clause -->
5307
+ <xsl:value-of select="$level_total - 1"/>
5308
+ </xsl:when>
4852
5309
  <xsl:when test="ancestor::*[local-name() = 'preface']">
4853
5310
  <xsl:value-of select="$level_total - 2"/>
4854
5311
  </xsl:when>
@@ -4912,6 +5369,7 @@
4912
5369
 
4913
5370
 
4914
5371
 
5372
+
4915
5373
  <xsl:value-of select="document('')//*/namespace::csd"/>
4916
5374
 
4917
5375
 
@@ -4973,17 +5431,29 @@
4973
5431
  </xsl:call-template>
4974
5432
  </xsl:if>
4975
5433
  </xsl:template><xsl:template name="getLocalizedString">
4976
- <xsl:param name="key"/>
5434
+ <xsl:param name="key"/>
4977
5435
 
4978
5436
  <xsl:variable name="curr_lang">
4979
5437
  <xsl:call-template name="getLang"/>
4980
5438
  </xsl:variable>
4981
5439
 
5440
+ <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
5441
+
4982
5442
  <xsl:choose>
5443
+ <xsl:when test="$data_value != ''">
5444
+ <xsl:value-of select="$data_value"/>
5445
+ </xsl:when>
4983
5446
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
4984
5447
  <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4985
5448
  </xsl:when>
4986
- <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
5449
+ <xsl:otherwise>
5450
+ <xsl:variable name="key_">
5451
+ <xsl:call-template name="capitalize">
5452
+ <xsl:with-param name="str" select="translate($key, '_', ' ')"/>
5453
+ </xsl:call-template>
5454
+ </xsl:variable>
5455
+ <xsl:value-of select="$key_"/>
5456
+ </xsl:otherwise>
4987
5457
  </xsl:choose>
4988
5458
 
4989
5459
  </xsl:template><xsl:template name="setTrackChangesStyles">
@@ -5026,4 +5496,14 @@
5026
5496
  <xsl:value-of select="$align"/>
5027
5497
  </xsl:when>
5028
5498
  </xsl:choose>
5499
+ </xsl:template><xsl:template name="setTextAlignment">
5500
+ <xsl:param name="default">left</xsl:param>
5501
+ <xsl:attribute name="text-align">
5502
+ <xsl:choose>
5503
+ <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
5504
+ <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
5505
+ <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
5506
+ <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
5507
+ </xsl:choose>
5508
+ </xsl:attribute>
5029
5509
  </xsl:template></xsl:stylesheet>