metanorma-ogc 1.3.5 → 1.4.0

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: cf9c0a5cbffaabeba248b57a50309b3abed1c96eb1f222d8dbde3234ef0c2763
4
- data.tar.gz: 31cd6c92355d6077705d51bff35c51fc300345b82a58a50fa9426e15301a9e73
3
+ metadata.gz: 28745dd5a01a192127b2f83263b77bef14f84b34a29250917c52ef19b299abbf
4
+ data.tar.gz: d4b8436c3181ddb7ec37a138ba92de16e8ca52b598aa7bb776fe6a96e857f558
5
5
  SHA512:
6
- metadata.gz: 619abf777ca9e6829561e1d446f58a92448d991506c887a0f0f019950c2b7e897061a625d97259d8c0078f4cd4a336a13d8ba452d271e73a2709a07a9b9bcc01
7
- data.tar.gz: 2ddd0bf8b9b9b5915e194c80f88e22656039dedd9fb97a5d23aae76a39ac469758be9c2fea8553a091fb63056eaffc9c3c5aad1b949038d432cdd155ed1d6189
6
+ metadata.gz: 3eef074b538b1ebd105b1cdf5964738635da7995356276e1eb137199a812d7ca47116d29eca8074fbd5f031b40aa511c8d3e1895b97399f733e9a0e795932815
7
+ data.tar.gz: a7ff610163cc1661bcf9fc85a7e112e01b974d1a324a6f6347c6c53b78a9153b6a6f29e90f8ecebaa3c97de1955f26051e6981882467fd3f9af997979f5ab83a
@@ -16,7 +16,7 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '3.0', '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
22
  steps:
@@ -204,6 +204,18 @@
204
204
  </zeroOrMore>
205
205
  </element>
206
206
  </define>
207
+ <define name="dt">
208
+ <element name="dt">
209
+ <optional>
210
+ <attribute name="id">
211
+ <data type="ID"/>
212
+ </attribute>
213
+ </optional>
214
+ <zeroOrMore>
215
+ <ref name="TextElement"/>
216
+ </zeroOrMore>
217
+ </element>
218
+ </define>
207
219
  <define name="example">
208
220
  <element name="example">
209
221
  <attribute name="id">
@@ -899,7 +911,7 @@
899
911
  </include>
900
912
  <!-- end overrides -->
901
913
  <define name="docsubtype">
902
- <element name="docsubtype">
914
+ <element name="subdoctype">
903
915
  <ref name="DocumentSubtype"/>
904
916
  </element>
905
917
  </define>
@@ -955,7 +967,34 @@
955
967
  <define name="concept">
956
968
  <element name="concept">
957
969
  <optional>
958
- <attribute name="term"/>
970
+ <attribute name="ital">
971
+ <data type="boolean"/>
972
+ </attribute>
973
+ </optional>
974
+ <optional>
975
+ <attribute name="ref">
976
+ <data type="boolean"/>
977
+ </attribute>
978
+ </optional>
979
+ <optional>
980
+ <element name="refterm">
981
+ <zeroOrMore>
982
+ <choice>
983
+ <ref name="PureTextElement"/>
984
+ <ref name="stem"/>
985
+ </choice>
986
+ </zeroOrMore>
987
+ </element>
988
+ </optional>
989
+ <optional>
990
+ <element name="renderterm">
991
+ <zeroOrMore>
992
+ <choice>
993
+ <ref name="PureTextElement"/>
994
+ <ref name="stem"/>
995
+ </choice>
996
+ </zeroOrMore>
997
+ </element>
959
998
  </optional>
960
999
  <choice>
961
1000
  <ref name="eref"/>
@@ -972,8 +1011,14 @@
972
1011
  <ref name="imagemap"/>
973
1012
  <ref name="svgmap"/>
974
1013
  <ref name="inputform"/>
1014
+ <ref name="toc"/>
975
1015
  </choice>
976
1016
  </define>
1017
+ <define name="toc">
1018
+ <element name="toc">
1019
+ <ref name="ul"/>
1020
+ </element>
1021
+ </define>
977
1022
  <define name="inputform">
978
1023
  <element name="form">
979
1024
  <attribute name="id">
@@ -981,6 +1026,9 @@
981
1026
  </attribute>
982
1027
  <attribute name="name"/>
983
1028
  <attribute name="action"/>
1029
+ <optional>
1030
+ <attribute name="class"/>
1031
+ </optional>
984
1032
  <zeroOrMore>
985
1033
  <choice>
986
1034
  <ref name="TextElement"/>
@@ -1212,6 +1260,12 @@
1212
1260
  <optional>
1213
1261
  <attribute name="type"/>
1214
1262
  </optional>
1263
+ <optional>
1264
+ <attribute name="identifier"/>
1265
+ </optional>
1266
+ <optional>
1267
+ <attribute name="prefix"/>
1268
+ </optional>
1215
1269
  <text/>
1216
1270
  </define>
1217
1271
  <define name="ics">
@@ -1473,26 +1527,26 @@
1473
1527
  <optional>
1474
1528
  <ref name="section-title"/>
1475
1529
  </optional>
1476
- <group>
1530
+ <choice>
1477
1531
  <choice>
1478
1532
  <group>
1479
- <zeroOrMore>
1533
+ <oneOrMore>
1480
1534
  <ref name="BasicBlock"/>
1481
- </zeroOrMore>
1535
+ </oneOrMore>
1482
1536
  <zeroOrMore>
1483
1537
  <ref name="note"/>
1484
1538
  </zeroOrMore>
1485
1539
  </group>
1486
1540
  <ref name="amend"/>
1487
1541
  </choice>
1488
- <zeroOrMore>
1542
+ <oneOrMore>
1489
1543
  <choice>
1490
1544
  <ref name="clause-subsection"/>
1491
1545
  <ref name="terms"/>
1492
1546
  <ref name="definitions"/>
1493
1547
  </choice>
1494
- </zeroOrMore>
1495
- </group>
1548
+ </oneOrMore>
1549
+ </choice>
1496
1550
  </define>
1497
1551
  <define name="Annex-Section">
1498
1552
  <optional>
@@ -62,6 +62,19 @@
62
62
  </optional>
63
63
  </element>
64
64
  </define>
65
+ <define name="DocumentSubtype">
66
+ <choice>
67
+ <value>conceptual-model</value>
68
+ <value>conceptual-model-and-encoding</value>
69
+ <value>conceptual-model-and-implementation</value>
70
+ <value>encoding</value>
71
+ <value>extension</value>
72
+ <value>implementation</value>
73
+ <value>profile</value>
74
+ <value>profile-with-extension</value>
75
+ <value>general</value>
76
+ </choice>
77
+ </define>
65
78
  </include>
66
79
  <define name="TextElement" combine="choice">
67
80
  <ref name="hi"/>
@@ -79,19 +92,6 @@
79
92
  </zeroOrMore>
80
93
  </element>
81
94
  </define>
82
- <define name="DocumentSubtype">
83
- <choice>
84
- <value>conceptual-model</value>
85
- <value>conceptual-model-and-encoding</value>
86
- <value>conceptual-model-and-implementation</value>
87
- <value>encoding</value>
88
- <value>extension</value>
89
- <value>implementation</value>
90
- <value>profile</value>
91
- <value>profile-with-extension</value>
92
- <value>general</value>
93
- </choice>
94
- </define>
95
95
  <define name="submitters">
96
96
  <element name="submitters">
97
97
  <ref name="Basic-Section"/>
@@ -64,9 +64,9 @@
64
64
  <optional>
65
65
  <ref name="label"/>
66
66
  </optional>
67
- <optional>
67
+ <zeroOrMore>
68
68
  <ref name="subject"/>
69
- </optional>
69
+ </zeroOrMore>
70
70
  <zeroOrMore>
71
71
  <ref name="reqinherit"/>
72
72
  </zeroOrMore>
@@ -80,6 +80,7 @@
80
80
  <ref name="verification"/>
81
81
  <ref name="import"/>
82
82
  <ref name="description"/>
83
+ <ref name="component"/>
83
84
  </choice>
84
85
  </zeroOrMore>
85
86
  <optional>
@@ -105,12 +106,16 @@
105
106
  </define>
106
107
  <define name="subject">
107
108
  <element name="subject">
108
- <text/>
109
+ <oneOrMore>
110
+ <ref name="TextElement"/>
111
+ </oneOrMore>
109
112
  </element>
110
113
  </define>
111
114
  <define name="reqinherit">
112
115
  <element name="inherit">
113
- <text/>
116
+ <oneOrMore>
117
+ <ref name="TextElement"/>
118
+ </oneOrMore>
114
119
  </element>
115
120
  </define>
116
121
  <define name="measurementtarget">
@@ -138,6 +143,12 @@
138
143
  <ref name="RequirementSubpart"/>
139
144
  </element>
140
145
  </define>
146
+ <define name="component">
147
+ <element name="component">
148
+ <attribute name="class"/>
149
+ <ref name="RequirementSubpart"/>
150
+ </element>
151
+ </define>
141
152
  <define name="reqt_references">
142
153
  <element name="references">
143
154
  <oneOrMore>
@@ -7,8 +7,12 @@
7
7
  <xsl:variable name="images" select="document($svg_images)"/>
8
8
  <xsl:param name="basepath"/>
9
9
 
10
- <xsl:variable name="pageWidth" select="'215.9mm'"/>
11
- <xsl:variable name="pageHeight" select="'279.4mm'"/>
10
+ <xsl:variable name="pageWidth" select="215.9"/>
11
+ <xsl:variable name="pageHeight" select="279.4"/>
12
+ <xsl:variable name="marginLeftRight1" select="35"/>
13
+ <xsl:variable name="marginLeftRight2" select="17"/>
14
+ <xsl:variable name="marginTop" select="16.5"/>
15
+ <xsl:variable name="marginBottom" select="22.5"/>
12
16
 
13
17
 
14
18
 
@@ -74,7 +78,7 @@
74
78
  <fo:root font-family="Lato, STIX Two Math, Source Han Sans" font-size="11pt" color="{$color_main}" xml:lang="{$lang}">
75
79
  <fo:layout-master-set>
76
80
  <!-- Cover page -->
77
- <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
81
+ <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
78
82
  <fo:region-body margin-top="16.5mm" margin-bottom="10mm" margin-left="16.5mm" margin-right="14mm"/>
79
83
  <fo:region-before region-name="cover-page-header" extent="16.5mm"/>
80
84
  <fo:region-after extent="10mm"/>
@@ -83,7 +87,7 @@
83
87
  </fo:simple-page-master>
84
88
 
85
89
  <!-- Preface pages -->
86
- <fo:simple-page-master master-name="preface" page-width="{$pageWidth}" page-height="{$pageHeight}">
90
+ <fo:simple-page-master master-name="preface" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
87
91
  <fo:region-body margin-top="16.5mm" margin-bottom="22.5mm" margin-left="16.5mm" margin-right="16.5mm"/>
88
92
  <fo:region-before region-name="header" extent="16.5mm"/>
89
93
  <fo:region-after region-name="footer" extent="22.5mm"/>
@@ -93,12 +97,12 @@
93
97
 
94
98
 
95
99
  <!-- Document pages -->
96
- <fo:simple-page-master master-name="document" page-width="{$pageWidth}" page-height="{$pageHeight}">
97
- <fo:region-body margin-top="16.5mm" margin-bottom="22.5mm" margin-left="35mm" margin-right="17mm"/>
98
- <fo:region-before region-name="header" extent="16.5mm"/>
99
- <fo:region-after region-name="footer" extent="22.5mm"/>
100
+ <fo:simple-page-master master-name="document" 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" extent="{$marginTop}mm"/>
103
+ <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
100
104
  <fo:region-start region-name="left-region" extent="16.5mm"/>
101
- <fo:region-end region-name="right-region" extent="17mm"/>
105
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
102
106
  </fo:simple-page-master>
103
107
 
104
108
  </fo:layout-master-set>
@@ -124,16 +128,16 @@
124
128
  <!-- background image -->
125
129
  <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0">
126
130
  <fo:block>
127
- <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Cover-Background))}" width="{$pageWidth}" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
131
+ <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Cover-Background))}" width="{$pageWidth}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
128
132
  </fo:block>
129
133
  </fo:block-container>
130
134
 
131
135
  <!-- background color -->
132
136
  <fo:block-container absolute-position="fixed" left="0" top="0" font-size="0">
133
137
  <fo:block>
134
- <fo:instream-foreign-object content-height="{$pageHeight}" fox:alt-text="Background color">
135
- <svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="215.9mm" height="279.4mm">
136
- <rect width="215.9mm" height="279.4mm" style="fill:rgb(33,55,92);stroke-width:0;fill-opacity:0.85"/>
138
+ <fo:instream-foreign-object content-height="{$pageHeight}mm" fox:alt-text="Background color">
139
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="{$pageWidth}mm" height="{$pageHeight}mm">
140
+ <rect width="{$pageWidth}mm" height="{$pageHeight}mm" style="fill:rgb(33,55,92);stroke-width:0;fill-opacity:0.85"/>
137
141
  </svg>
138
142
  </fo:instream-foreign-object>
139
143
  </fo:block>
@@ -272,10 +276,10 @@
272
276
  </xsl:if>
273
277
 
274
278
  <!-- crossing lines -->
275
- <fo:block-container absolute-position="fixed" width="{$pageWidth}" height="{$pageHeight}" font-size="0">
279
+ <fo:block-container absolute-position="fixed" width="{$pageWidth}mm" height="{$pageHeight}mm" font-size="0">
276
280
  <fo:block>
277
- <fo:instream-foreign-object content-height="{$pageHeight}" content-width="{$pageWidth}" fox:alt-text="Crossing lines">
278
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}" height="{$pageHeight}">
281
+ <fo:instream-foreign-object content-height="{$pageHeight}mm" content-width="{$pageWidth}mm" fox:alt-text="Crossing lines">
282
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}mm" height="{$pageHeight}mm">
279
283
  <line x1="230" y1="0" x2="2159" y2="490" stroke="{$color_lightorange}"/>
280
284
  <line x1="0" y1="395" x2="820" y2="0" stroke="{$color_lightorange}"/>
281
285
  <circle style="fill:{$color_lightorange};" cx="614" cy="100" r="15"/>
@@ -305,10 +309,10 @@
305
309
  <fo:flow flow-name="xsl-region-body">
306
310
 
307
311
  <!-- crossing lines -->
308
- <fo:block-container absolute-position="fixed" width="{$pageWidth}" height="{$pageHeight}" font-size="0">
312
+ <fo:block-container absolute-position="fixed" width="{$pageWidth}mm" height="{$pageHeight}mm" font-size="0">
309
313
  <fo:block>
310
- <fo:instream-foreign-object content-height="{$pageHeight}" content-width="{$pageWidth}" fox:alt-text="Crossing lines">
311
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}" height="{$pageHeight}">
314
+ <fo:instream-foreign-object content-height="{$pageHeight}mm" content-width="{$pageWidth}mm" fox:alt-text="Crossing lines">
315
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}mm" height="{$pageHeight}mm">
312
316
  <line x1="0" y1="545" x2="2084" y2="0" stroke="{$color_lightorange}"/>
313
317
  <line x1="0" y1="1374" x2="355" y2="0" stroke="{$color_lightorange}"/>
314
318
  <circle style="fill:{$color_lightorange};" cx="227" cy="487" r="15"/>
@@ -601,9 +605,9 @@
601
605
  <!-- background color -->
602
606
  <fo:block-container absolute-position="fixed" left="0" top="0" font-size="0">
603
607
  <fo:block>
604
- <fo:instream-foreign-object content-height="{$pageHeight}" fox:alt-text="Background color">
605
- <svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="{$pageWidth}" height="{$pageHeight}">
606
- <rect width="215.9mm" height="279.4mm" style="fill:rgb(33,55,92);stroke-width:0;fill-opacity:1"/>
608
+ <fo:instream-foreign-object content-height="{$pageHeight}mm" fox:alt-text="Background color">
609
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="{$pageWidth}mm" height="{$pageHeight}mm">
610
+ <rect width="{$pageWidth}mm" height="{$pageHeight}mm" style="fill:rgb(33,55,92);stroke-width:0;fill-opacity:1"/>
607
611
  </svg>
608
612
  </fo:instream-foreign-object>
609
613
  </fo:block>
@@ -1355,10 +1359,10 @@
1355
1359
  </xsl:template>
1356
1360
 
1357
1361
  <xsl:template name="insertCrossingLines">
1358
- <fo:block-container absolute-position="fixed" width="{$pageWidth}" height="{$pageHeight}" font-size="0">
1362
+ <fo:block-container absolute-position="fixed" width="{$pageWidth}mm" height="{$pageHeight}mm" font-size="0">
1359
1363
  <fo:block>
1360
- <fo:instream-foreign-object content-height="{$pageHeight}" content-width="{$pageWidth}" fox:alt-text="Crossing lines">
1361
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}" height="{$pageHeight}">
1364
+ <fo:instream-foreign-object content-height="{$pageHeight}mm" content-width="{$pageWidth}mm" fox:alt-text="Crossing lines">
1365
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}mm" height="{$pageHeight}mm">
1362
1366
  <line x1="0" y1="300" x2="2159" y2="675" stroke="{$color_orange}"/>
1363
1367
  <line x1="1215" y1="0" x2="2159" y2="1380" stroke="{$color_orange}"/>
1364
1368
  <line x1="0" y1="1850" x2="2159" y2="2390" stroke="{$color_orange}"/>
@@ -1770,6 +1774,7 @@
1770
1774
 
1771
1775
 
1772
1776
 
1777
+
1773
1778
 
1774
1779
  <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
1775
1780
 
@@ -1786,7 +1791,9 @@
1786
1791
 
1787
1792
 
1788
1793
 
1789
- </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1794
+ </xsl:attribute-set><xsl:variable name="table-border_">
1795
+
1796
+ </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
1790
1797
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1791
1798
 
1792
1799
 
@@ -1840,6 +1847,7 @@
1840
1847
 
1841
1848
 
1842
1849
 
1850
+
1843
1851
  </xsl:attribute-set><xsl:attribute-set name="note-style">
1844
1852
 
1845
1853
 
@@ -2062,14 +2070,15 @@
2062
2070
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
2063
2071
 
2064
2072
  <!-- Normative references -->
2065
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
2073
+ <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"/>
2066
2074
  <!-- Terms and definitions -->
2067
2075
  <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"/>
2068
2076
  <!-- Another main sections -->
2069
2077
  <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"/>
2070
2078
  <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
2071
2079
  <!-- Bibliography -->
2072
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
2080
+ <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"/>
2081
+
2073
2082
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
2074
2083
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
2075
2084
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
@@ -2114,6 +2123,8 @@
2114
2123
  <fo:block>&#xA0;</fo:block>
2115
2124
  </xsl:if> -->
2116
2125
 
2126
+
2127
+ <!-- Display table's name before table as standalone block -->
2117
2128
  <!-- $namespace = 'iso' or -->
2118
2129
 
2119
2130
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -2197,6 +2208,12 @@
2197
2208
 
2198
2209
 
2199
2210
 
2211
+
2212
+
2213
+
2214
+ <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
2215
+
2216
+
2200
2217
  <xsl:variable name="table_width">
2201
2218
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
2202
2219
 
@@ -2221,6 +2238,7 @@
2221
2238
 
2222
2239
 
2223
2240
 
2241
+
2224
2242
  <attribute name="margin-left">0mm</attribute>
2225
2243
  <attribute name="margin-right">0mm</attribute>
2226
2244
 
@@ -2246,6 +2264,8 @@
2246
2264
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2247
2265
  </xsl:if>
2248
2266
 
2267
+
2268
+
2249
2269
  <xsl:choose>
2250
2270
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2251
2271
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -2530,9 +2550,9 @@
2530
2550
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
2531
2551
  <xsl:with-param name="continued">true</xsl:with-param>
2532
2552
  </xsl:apply-templates>
2533
- <xsl:for-each select="ancestor::*[local-name()='table'][1]">
2534
- <xsl:call-template name="fn_name_display"/>
2535
- </xsl:for-each>
2553
+
2554
+
2555
+
2536
2556
 
2537
2557
  </fo:table-cell>
2538
2558
  </fo:table-row>
@@ -2616,7 +2636,11 @@
2616
2636
 
2617
2637
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2618
2638
 
2619
- <xsl:if test="$isNoteOrFnExist = 'true'">
2639
+ <xsl:variable name="isNoteOrFnExistShowAfterTable">
2640
+
2641
+ </xsl:variable>
2642
+
2643
+ <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
2620
2644
 
2621
2645
  <xsl:variable name="cols-count">
2622
2646
  <xsl:choose>
@@ -2645,6 +2669,8 @@
2645
2669
  </xsl:choose>
2646
2670
  </xsl:for-each>
2647
2671
 
2672
+
2673
+
2648
2674
  <xsl:choose>
2649
2675
  <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
2650
2676
  <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
@@ -2671,6 +2697,7 @@
2671
2697
 
2672
2698
 
2673
2699
 
2700
+
2674
2701
  <!-- fn will be processed inside 'note' processing -->
2675
2702
 
2676
2703
 
@@ -2681,6 +2708,11 @@
2681
2708
 
2682
2709
 
2683
2710
 
2711
+
2712
+
2713
+ <!-- for BSI (not PAS) display Notes before footnotes -->
2714
+
2715
+
2684
2716
  <!-- except gb -->
2685
2717
 
2686
2718
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
@@ -2706,6 +2738,10 @@
2706
2738
  <!-- fn processing -->
2707
2739
  <xsl:call-template name="fn_display"/>
2708
2740
 
2741
+
2742
+ <!-- for PAS display Notes after footnotes -->
2743
+
2744
+
2709
2745
  </fo:table-cell>
2710
2746
  </fo:table-row>
2711
2747
  </fo:table-body>
@@ -2747,6 +2783,19 @@
2747
2783
 
2748
2784
  </fo:table-body>
2749
2785
 
2786
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
2787
+ <xsl:choose>
2788
+ <xsl:when test="substring-after(., '—') != ''">
2789
+ <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
2790
+ </xsl:when>
2791
+ <xsl:otherwise>
2792
+ <xsl:value-of select="."/>
2793
+ </xsl:otherwise>
2794
+ </xsl:choose>
2795
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
2796
+ <xsl:apply-templates mode="presentation_name"/>
2797
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
2798
+ <xsl:apply-templates select="."/>
2750
2799
  </xsl:template><xsl:template match="*[local-name()='tr']">
2751
2800
  <xsl:variable name="parent-name" select="local-name(..)"/>
2752
2801
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -2759,10 +2808,13 @@
2759
2808
 
2760
2809
 
2761
2810
 
2811
+
2812
+
2762
2813
  </xsl:if>
2763
2814
  <xsl:if test="$parent-name = 'tfoot'">
2764
2815
 
2765
2816
 
2817
+
2766
2818
  </xsl:if>
2767
2819
 
2768
2820
 
@@ -2784,6 +2836,8 @@
2784
2836
 
2785
2837
 
2786
2838
 
2839
+
2840
+
2787
2841
  <!-- <xsl:if test="$namespace = 'bipm'">
2788
2842
  <xsl:attribute name="height">8mm</xsl:attribute>
2789
2843
  </xsl:if> -->
@@ -2866,6 +2920,7 @@
2866
2920
 
2867
2921
 
2868
2922
 
2923
+
2869
2924
  <xsl:attribute name="border">solid 0pt white</xsl:attribute>
2870
2925
 
2871
2926
 
@@ -2905,8 +2960,14 @@
2905
2960
 
2906
2961
 
2907
2962
 
2963
+
2964
+
2965
+ <!-- Table's note name (NOTE, for example) -->
2966
+
2908
2967
  <fo:inline padding-right="2mm">
2909
2968
 
2969
+
2970
+
2910
2971
 
2911
2972
 
2912
2973
 
@@ -2914,6 +2975,8 @@
2914
2975
 
2915
2976
  </fo:inline>
2916
2977
 
2978
+
2979
+
2917
2980
  <xsl:apply-templates mode="process"/>
2918
2981
  </fo:block>
2919
2982
 
@@ -2921,24 +2984,18 @@
2921
2984
  <xsl:apply-templates/>
2922
2985
  </xsl:template><xsl:template name="fn_display">
2923
2986
  <xsl:variable name="references">
2987
+
2924
2988
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
2925
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2926
-
2927
-
2928
- <xsl:attribute name="id">
2929
- <xsl:value-of select="@reference"/>
2930
- <xsl:text>_</xsl:text>
2931
- <xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
2932
- </xsl:attribute>
2933
-
2934
- <xsl:apply-templates/>
2935
- </fn>
2989
+ <xsl:call-template name="create_fn"/>
2936
2990
  </xsl:for-each>
2937
2991
  </xsl:variable>
2992
+
2938
2993
  <xsl:for-each select="xalan:nodeset($references)//fn">
2939
2994
  <xsl:variable name="reference" select="@reference"/>
2940
2995
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
2941
2996
  <fo:block margin-bottom="12pt">
2997
+
2998
+
2942
2999
 
2943
3000
 
2944
3001
 
@@ -2954,9 +3011,11 @@
2954
3011
 
2955
3012
 
2956
3013
 
3014
+
2957
3015
  <xsl:value-of select="@reference"/>
2958
3016
 
2959
3017
 
3018
+
2960
3019
  </fo:inline>
2961
3020
  <fo:inline>
2962
3021
 
@@ -2966,6 +3025,18 @@
2966
3025
  </fo:block>
2967
3026
  </xsl:if>
2968
3027
  </xsl:for-each>
3028
+ </xsl:template><xsl:template name="create_fn">
3029
+ <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
3030
+
3031
+
3032
+ <xsl:attribute name="id">
3033
+ <xsl:value-of select="@reference"/>
3034
+ <xsl:text>_</xsl:text>
3035
+ <xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
3036
+ </xsl:attribute>
3037
+
3038
+ <xsl:apply-templates/>
3039
+ </fn>
2969
3040
  </xsl:template><xsl:template name="fn_name_display">
2970
3041
  <!-- <xsl:variable name="references">
2971
3042
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
@@ -3094,6 +3165,9 @@
3094
3165
 
3095
3166
 
3096
3167
 
3168
+
3169
+
3170
+
3097
3171
  <xsl:attribute name="vertical-align">super</xsl:attribute>
3098
3172
 
3099
3173
 
@@ -3110,6 +3184,7 @@
3110
3184
 
3111
3185
  <xsl:value-of select="@reference"/>
3112
3186
 
3187
+
3113
3188
  </fo:basic-link>
3114
3189
  </fo:inline>
3115
3190
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -3972,19 +4047,6 @@
3972
4047
  <!-- replace start and end spaces to non-break space -->
3973
4048
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3974
4049
  </xsl:copy>
3975
- </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
3976
- <xsl:copy>
3977
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
3978
- </xsl:copy>
3979
- <xsl:choose>
3980
- <!-- if in msub, then don't add space -->
3981
- <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
3982
- <!-- if next char in digit, don't add space -->
3983
- <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
3984
- <xsl:otherwise>
3985
- <mathml:mspace width="0.5ex"/>
3986
- </xsl:otherwise>
3987
- </xsl:choose>
3988
4050
  </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">
3989
4051
  <xsl:variable name="target">
3990
4052
  <xsl:choose>
@@ -4009,6 +4071,7 @@
4009
4071
  <fo:inline xsl:use-attribute-sets="link-style">
4010
4072
 
4011
4073
 
4074
+
4012
4075
  <xsl:choose>
4013
4076
  <xsl:when test="$target_text = ''">
4014
4077
  <xsl:apply-templates/>
@@ -4121,6 +4184,7 @@
4121
4184
 
4122
4185
 
4123
4186
 
4187
+
4124
4188
  <fo:block-container margin-left="0mm">
4125
4189
 
4126
4190
 
@@ -4297,7 +4361,24 @@
4297
4361
  </fo:instream-foreign-object>
4298
4362
  </xsl:when>
4299
4363
  <xsl:otherwise>
4300
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
4364
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
4365
+ <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
4366
+
4367
+ <xsl:variable name="img_src">
4368
+ <xsl:choose>
4369
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
4370
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
4371
+ </xsl:choose>
4372
+ </xsl:variable>
4373
+
4374
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
4375
+ <xsl:if test="number($scale) &lt; 100">
4376
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
4377
+ </xsl:if>
4378
+
4379
+ </xsl:if>
4380
+
4381
+ </fo:external-graphic>
4301
4382
  </xsl:otherwise>
4302
4383
  </xsl:choose>
4303
4384
 
@@ -4365,6 +4446,253 @@
4365
4446
  <xsl:param name="height"/>
4366
4447
  <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; "/>
4367
4448
  <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; "/>
4449
+ </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">
4450
+ <xsl:param name="name"/>
4451
+
4452
+ <xsl:variable name="svg_content">
4453
+ <xsl:apply-templates select="." mode="svg_update"/>
4454
+ </xsl:variable>
4455
+
4456
+ <xsl:variable name="alt-text">
4457
+ <xsl:choose>
4458
+ <xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
4459
+ <xsl:value-of select="../*[local-name() = 'name']"/>
4460
+ </xsl:when>
4461
+ <xsl:when test="normalize-space($name) != ''">
4462
+ <xsl:value-of select="$name"/>
4463
+ </xsl:when>
4464
+ <xsl:otherwise>Figure</xsl:otherwise>
4465
+ </xsl:choose>
4466
+ </xsl:variable>
4467
+
4468
+ <xsl:choose>
4469
+ <xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
4470
+ <fo:block>
4471
+ <xsl:variable name="width" select="@width"/>
4472
+ <xsl:variable name="height" select="@height"/>
4473
+
4474
+ <xsl:variable name="scale_x">
4475
+ <xsl:choose>
4476
+ <xsl:when test="$width &gt; $width_effective_px">
4477
+ <xsl:value-of select="$width_effective_px div $width"/>
4478
+ </xsl:when>
4479
+ <xsl:otherwise>1</xsl:otherwise>
4480
+ </xsl:choose>
4481
+ </xsl:variable>
4482
+
4483
+ <xsl:variable name="scale_y">
4484
+ <xsl:choose>
4485
+ <xsl:when test="$height * $scale_x &gt; $height_effective_px">
4486
+ <xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
4487
+ </xsl:when>
4488
+ <xsl:otherwise>1</xsl:otherwise>
4489
+ </xsl:choose>
4490
+ </xsl:variable>
4491
+
4492
+ <xsl:variable name="scale">
4493
+ <xsl:choose>
4494
+ <xsl:when test="$scale_y != 1">
4495
+ <xsl:value-of select="$scale_x * $scale_y"/>
4496
+ </xsl:when>
4497
+ <xsl:otherwise>
4498
+ <xsl:value-of select="$scale_x"/>
4499
+ </xsl:otherwise>
4500
+ </xsl:choose>
4501
+ </xsl:variable>
4502
+
4503
+ <xsl:variable name="width_scale" select="round($width * $scale)"/>
4504
+ <xsl:variable name="height_scale" select="round($height * $scale)"/>
4505
+
4506
+ <fo:table table-layout="fixed" width="100%">
4507
+ <fo:table-column column-width="proportional-column-width(1)"/>
4508
+ <fo:table-column column-width="{$width_scale}px"/>
4509
+ <fo:table-column column-width="proportional-column-width(1)"/>
4510
+ <fo:table-body>
4511
+ <fo:table-row>
4512
+ <fo:table-cell column-number="2">
4513
+ <fo:block>
4514
+ <fo:block-container width="{$width_scale}px" height="{$height_scale}px">
4515
+ <xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
4516
+ <fo:block line-height="0" font-size="0">
4517
+ <xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
4518
+ <xsl:call-template name="bookmark"/>
4519
+ </xsl:for-each>
4520
+ </fo:block>
4521
+ </xsl:if>
4522
+ <fo:block text-depth="0" line-height="0" font-size="0">
4523
+
4524
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
4525
+ <xsl:attribute name="width">100%</xsl:attribute>
4526
+ <xsl:attribute name="content-height">100%</xsl:attribute>
4527
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4528
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
4529
+
4530
+ <xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
4531
+ </fo:instream-foreign-object>
4532
+ </fo:block>
4533
+
4534
+ <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">
4535
+ <xsl:with-param name="scale" select="$scale"/>
4536
+ </xsl:apply-templates>
4537
+ </fo:block-container>
4538
+ </fo:block>
4539
+ </fo:table-cell>
4540
+ </fo:table-row>
4541
+ </fo:table-body>
4542
+ </fo:table>
4543
+ </fo:block>
4544
+
4545
+ </xsl:when>
4546
+ <xsl:otherwise>
4547
+ <fo:block xsl:use-attribute-sets="image-style">
4548
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
4549
+ <xsl:attribute name="width">100%</xsl:attribute>
4550
+ <xsl:attribute name="content-height">100%</xsl:attribute>
4551
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4552
+ <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
4553
+ <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
4554
+ <!-- effective height 297 - 27.4 - 13 = 256.6 -->
4555
+ <!-- effective width 210 - 12.5 - 25 = 172.5 -->
4556
+ <!-- effective height / width = 1.48, 1.4 - with title -->
4557
+ <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
4558
+ <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
4559
+ <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
4560
+ </xsl:if>
4561
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
4562
+ <xsl:copy-of select="$svg_content"/>
4563
+ </fo:instream-foreign-object>
4564
+ </fo:block>
4565
+ </xsl:otherwise>
4566
+ </xsl:choose>
4567
+ </xsl:template><xsl:template match="@*|node()" mode="svg_update">
4568
+ <xsl:copy>
4569
+ <xsl:apply-templates select="@*|node()" mode="svg_update"/>
4570
+ </xsl:copy>
4571
+ </xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
4572
+ <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
4573
+ <xsl:value-of select="."/>
4574
+ </xsl:attribute>
4575
+ </xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
4576
+ <xsl:copy>
4577
+ <xsl:apply-templates select="@*" mode="svg_update"/>
4578
+ <xsl:variable name="viewbox">
4579
+ <xsl:call-template name="split">
4580
+ <xsl:with-param name="pText" select="@viewBox"/>
4581
+ <xsl:with-param name="sep" select="' '"/>
4582
+ </xsl:call-template>
4583
+ </xsl:variable>
4584
+ <xsl:attribute name="width">
4585
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
4586
+ </xsl:attribute>
4587
+ <xsl:attribute name="height">
4588
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
4589
+ </xsl:attribute>
4590
+ <xsl:apply-templates mode="svg_update"/>
4591
+ </xsl:copy>
4592
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
4593
+ <xsl:variable name="svg_content" select="document(@src)"/>
4594
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
4595
+ <xsl:for-each select="xalan:nodeset($svg_content)/node()">
4596
+ <xsl:call-template name="image_svg">
4597
+ <xsl:with-param name="name" select="$name"/>
4598
+ </xsl:call-template>
4599
+ </xsl:for-each>
4600
+ </xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
4601
+ <xsl:copy>
4602
+ <xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
4603
+ </xsl:copy>
4604
+ </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
4605
+ <xsl:apply-templates mode="svg_remove_a"/>
4606
+ </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
4607
+ <xsl:param name="scale"/>
4608
+ <xsl:variable name="dest">
4609
+ <xsl:choose>
4610
+ <xsl:when test="starts-with(@href, '#')">
4611
+ <xsl:value-of select="substring-after(@href, '#')"/>
4612
+ </xsl:when>
4613
+ <xsl:otherwise>
4614
+ <xsl:value-of select="@href"/>
4615
+ </xsl:otherwise>
4616
+ </xsl:choose>
4617
+ </xsl:variable>
4618
+ <xsl:for-each select="./*[local-name() = 'rect']">
4619
+ <xsl:call-template name="insertSVGMapLink">
4620
+ <xsl:with-param name="left" select="floor(@x * $scale)"/>
4621
+ <xsl:with-param name="top" select="floor(@y * $scale)"/>
4622
+ <xsl:with-param name="width" select="floor(@width * $scale)"/>
4623
+ <xsl:with-param name="height" select="floor(@height * $scale)"/>
4624
+ <xsl:with-param name="dest" select="$dest"/>
4625
+ </xsl:call-template>
4626
+ </xsl:for-each>
4627
+
4628
+ <xsl:for-each select="./*[local-name() = 'polygon']">
4629
+ <xsl:variable name="points">
4630
+ <xsl:call-template name="split">
4631
+ <xsl:with-param name="pText" select="@points"/>
4632
+ </xsl:call-template>
4633
+ </xsl:variable>
4634
+ <xsl:variable name="x_coords">
4635
+ <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
4636
+ <xsl:sort select="." data-type="number"/>
4637
+ <x><xsl:value-of select="."/></x>
4638
+ </xsl:for-each>
4639
+ </xsl:variable>
4640
+ <xsl:variable name="y_coords">
4641
+ <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
4642
+ <xsl:sort select="." data-type="number"/>
4643
+ <y><xsl:value-of select="."/></y>
4644
+ </xsl:for-each>
4645
+ </xsl:variable>
4646
+ <xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
4647
+ <xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
4648
+ <xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
4649
+ <xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
4650
+ <xsl:call-template name="insertSVGMapLink">
4651
+ <xsl:with-param name="left" select="floor($x * $scale)"/>
4652
+ <xsl:with-param name="top" select="floor($y * $scale)"/>
4653
+ <xsl:with-param name="width" select="floor($width * $scale)"/>
4654
+ <xsl:with-param name="height" select="floor($height * $scale)"/>
4655
+ <xsl:with-param name="dest" select="$dest"/>
4656
+ </xsl:call-template>
4657
+ </xsl:for-each>
4658
+
4659
+ <xsl:for-each select="./*[local-name() = 'circle']">
4660
+ <xsl:call-template name="insertSVGMapLink">
4661
+ <xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
4662
+ <xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
4663
+ <xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
4664
+ <xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
4665
+ <xsl:with-param name="dest" select="$dest"/>
4666
+ </xsl:call-template>
4667
+ </xsl:for-each>
4668
+ <xsl:for-each select="./*[local-name() = 'ellipse']">
4669
+ <xsl:call-template name="insertSVGMapLink">
4670
+ <xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
4671
+ <xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
4672
+ <xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
4673
+ <xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
4674
+ <xsl:with-param name="dest" select="$dest"/>
4675
+ </xsl:call-template>
4676
+ </xsl:for-each>
4677
+ </xsl:template><xsl:template name="insertSVGMapLink">
4678
+ <xsl:param name="left"/>
4679
+ <xsl:param name="top"/>
4680
+ <xsl:param name="width"/>
4681
+ <xsl:param name="height"/>
4682
+ <xsl:param name="dest"/>
4683
+ <fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
4684
+ <fo:block font-size="1pt">
4685
+ <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
4686
+ <fo:inline-container inline-progression-dimension="100%">
4687
+ <fo:block-container height="{$height - 1}px" width="100%">
4688
+ <!-- DEBUG <xsl:if test="local-name()='polygon'">
4689
+ <xsl:attribute name="background-color">magenta</xsl:attribute>
4690
+ </xsl:if> -->
4691
+ <fo:block> </fo:block></fo:block-container>
4692
+ </fo:inline-container>
4693
+ </fo:basic-link>
4694
+ </fo:block>
4695
+ </fo:block-container>
4368
4696
  </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">
4369
4697
  <xsl:apply-templates mode="contents"/>
4370
4698
  <xsl:text> </xsl:text>
@@ -4393,28 +4721,39 @@
4393
4721
  <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
4394
4722
  <xsl:for-each select="xalan:nodeset($contents)/doc">
4395
4723
  <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
4724
+ <xsl:if test="@bundle = 'true'">
4725
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
4726
+ </xsl:if>
4396
4727
  <fo:bookmark-title>
4397
- <xsl:variable name="bookmark-title_">
4398
- <xsl:call-template name="getLangVersion">
4399
- <xsl:with-param name="lang" select="@lang"/>
4400
- <xsl:with-param name="doctype" select="@doctype"/>
4401
- <xsl:with-param name="title" select="@title-part"/>
4402
- </xsl:call-template>
4403
- </xsl:variable>
4404
4728
  <xsl:choose>
4405
- <xsl:when test="normalize-space($bookmark-title_) != ''">
4406
- <xsl:value-of select="normalize-space($bookmark-title_)"/>
4407
- </xsl:when>
4408
- <xsl:otherwise>
4729
+ <xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
4730
+ <xsl:variable name="bookmark-title_">
4731
+ <xsl:call-template name="getLangVersion">
4732
+ <xsl:with-param name="lang" select="@lang"/>
4733
+ <xsl:with-param name="doctype" select="@doctype"/>
4734
+ <xsl:with-param name="title" select="@title-part"/>
4735
+ </xsl:call-template>
4736
+ </xsl:variable>
4409
4737
  <xsl:choose>
4410
- <xsl:when test="@lang = 'en'">English</xsl:when>
4411
- <xsl:when test="@lang = 'fr'">Français</xsl:when>
4412
- <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
4413
- <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
4738
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
4739
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
4740
+ </xsl:when>
4741
+ <xsl:otherwise>
4742
+ <xsl:choose>
4743
+ <xsl:when test="@lang = 'en'">English</xsl:when>
4744
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
4745
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
4746
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
4747
+ </xsl:choose>
4748
+ </xsl:otherwise>
4414
4749
  </xsl:choose>
4750
+ </xsl:when>
4751
+ <xsl:otherwise>
4752
+ <xsl:value-of select="@title-part"/>
4415
4753
  </xsl:otherwise>
4416
4754
  </xsl:choose>
4417
4755
  </fo:bookmark-title>
4756
+
4418
4757
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4419
4758
 
4420
4759
  <xsl:call-template name="insertFigureBookmarks">
@@ -4556,16 +4895,23 @@
4556
4895
  <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
4557
4896
  </xsl:choose>
4558
4897
  </xsl:template><xsl:template match="item" mode="bookmark">
4559
- <fo:bookmark internal-destination="{@id}" starting-state="hide">
4560
- <fo:bookmark-title>
4561
- <xsl:if test="@section != ''">
4562
- <xsl:value-of select="@section"/>
4563
- <xsl:text> </xsl:text>
4564
- </xsl:if>
4565
- <xsl:value-of select="normalize-space(title)"/>
4566
- </fo:bookmark-title>
4567
- <xsl:apply-templates mode="bookmark"/>
4568
- </fo:bookmark>
4898
+ <xsl:choose>
4899
+ <xsl:when test="@id != ''">
4900
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
4901
+ <fo:bookmark-title>
4902
+ <xsl:if test="@section != ''">
4903
+ <xsl:value-of select="@section"/>
4904
+ <xsl:text> </xsl:text>
4905
+ </xsl:if>
4906
+ <xsl:value-of select="normalize-space(title)"/>
4907
+ </fo:bookmark-title>
4908
+ <xsl:apply-templates mode="bookmark"/>
4909
+ </fo:bookmark>
4910
+ </xsl:when>
4911
+ <xsl:otherwise>
4912
+ <xsl:apply-templates mode="bookmark"/>
4913
+ </xsl:otherwise>
4914
+ </xsl:choose>
4569
4915
  </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">
4570
4916
  <xsl:if test="normalize-space() != ''">
4571
4917
  <fo:block xsl:use-attribute-sets="figure-name-style">
@@ -4939,7 +5285,19 @@
4939
5285
  </fo:inline>
4940
5286
  </xsl:if>
4941
5287
  </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
4942
- <fo:inline><xsl:apply-templates/></fo:inline>
5288
+ <xsl:variable name="element">inline
5289
+
5290
+ </xsl:variable>
5291
+ <xsl:choose>
5292
+ <xsl:when test="contains($element, 'block')">
5293
+ <fo:block xsl:use-attribute-sets="example-p-style">
5294
+ <xsl:apply-templates/>
5295
+ </fo:block>
5296
+ </xsl:when>
5297
+ <xsl:otherwise>
5298
+ <fo:inline><xsl:apply-templates/></fo:inline>
5299
+ </xsl:otherwise>
5300
+ </xsl:choose>
4943
5301
  </xsl:template><xsl:template match="*[local-name() = 'example']">
4944
5302
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4945
5303
 
@@ -5131,7 +5489,9 @@
5131
5489
 
5132
5490
 
5133
5491
  </xsl:if>
5134
-
5492
+
5493
+
5494
+
5135
5495
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
5136
5496
  <xsl:if test="normalize-space(@citeas) = ''">
5137
5497
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
@@ -5141,6 +5501,7 @@
5141
5501
 
5142
5502
 
5143
5503
 
5504
+
5144
5505
  </xsl:if>
5145
5506
 
5146
5507
  <xsl:apply-templates/>
@@ -5519,7 +5880,6 @@
5519
5880
  </xsl:template><xsl:template name="processBibitem">
5520
5881
 
5521
5882
 
5522
- <!-- end BIPM bibitem processing-->
5523
5883
 
5524
5884
 
5525
5885
  <!-- start OGC bibtem processing -->
@@ -6126,20 +6486,40 @@
6126
6486
  </xsl:call-template>
6127
6487
  </xsl:if>
6128
6488
  </xsl:template><xsl:template name="getLocalizedString">
6129
- <xsl:param name="key"/>
6489
+ <xsl:param name="key"/>
6490
+ <xsl:param name="formatted">false</xsl:param>
6130
6491
 
6131
6492
  <xsl:variable name="curr_lang">
6132
6493
  <xsl:call-template name="getLang"/>
6133
6494
  </xsl:variable>
6134
6495
 
6135
- <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
6496
+ <xsl:variable name="data_value">
6497
+ <xsl:choose>
6498
+ <xsl:when test="$formatted = 'true'">
6499
+ <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6500
+ </xsl:when>
6501
+ <xsl:otherwise>
6502
+ <xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
6503
+ </xsl:otherwise>
6504
+ </xsl:choose>
6505
+ </xsl:variable>
6136
6506
 
6137
6507
  <xsl:choose>
6138
- <xsl:when test="$data_value != ''">
6139
- <xsl:value-of select="$data_value"/>
6508
+ <xsl:when test="normalize-space($data_value) != ''">
6509
+ <xsl:choose>
6510
+ <xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when>
6511
+ <xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise>
6512
+ </xsl:choose>
6140
6513
  </xsl:when>
6141
6514
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
6142
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6515
+ <xsl:choose>
6516
+ <xsl:when test="$formatted = 'true'">
6517
+ <xsl:apply-templates select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6518
+ </xsl:when>
6519
+ <xsl:otherwise>
6520
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6521
+ </xsl:otherwise>
6522
+ </xsl:choose>
6143
6523
  </xsl:when>
6144
6524
  <xsl:otherwise>
6145
6525
  <xsl:variable name="key_">
@@ -6150,7 +6530,7 @@
6150
6530
  <xsl:value-of select="$key_"/>
6151
6531
  </xsl:otherwise>
6152
6532
  </xsl:choose>
6153
-
6533
+
6154
6534
  </xsl:template><xsl:template name="setTrackChangesStyles">
6155
6535
  <xsl:param name="isAdded"/>
6156
6536
  <xsl:param name="isDeleted"/>
@@ -6201,4 +6581,100 @@
6201
6581
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
6202
6582
  </xsl:choose>
6203
6583
  </xsl:attribute>
6584
+ </xsl:template><xsl:template name="number-to-words">
6585
+ <xsl:param name="number"/>
6586
+ <xsl:param name="first"/>
6587
+ <xsl:if test="$number != ''">
6588
+ <xsl:variable name="words">
6589
+ <words>
6590
+ <word cardinal="1">One-</word>
6591
+ <word ordinal="1">First </word>
6592
+ <word cardinal="2">Two-</word>
6593
+ <word ordinal="2">Second </word>
6594
+ <word cardinal="3">Three-</word>
6595
+ <word ordinal="3">Third </word>
6596
+ <word cardinal="4">Four-</word>
6597
+ <word ordinal="4">Fourth </word>
6598
+ <word cardinal="5">Five-</word>
6599
+ <word ordinal="5">Fifth </word>
6600
+ <word cardinal="6">Six-</word>
6601
+ <word ordinal="6">Sixth </word>
6602
+ <word cardinal="7">Seven-</word>
6603
+ <word ordinal="7">Seventh </word>
6604
+ <word cardinal="8">Eight-</word>
6605
+ <word ordinal="8">Eighth </word>
6606
+ <word cardinal="9">Nine-</word>
6607
+ <word ordinal="9">Ninth </word>
6608
+ <word ordinal="10">Tenth </word>
6609
+ <word ordinal="11">Eleventh </word>
6610
+ <word ordinal="12">Twelfth </word>
6611
+ <word ordinal="13">Thirteenth </word>
6612
+ <word ordinal="14">Fourteenth </word>
6613
+ <word ordinal="15">Fifteenth </word>
6614
+ <word ordinal="16">Sixteenth </word>
6615
+ <word ordinal="17">Seventeenth </word>
6616
+ <word ordinal="18">Eighteenth </word>
6617
+ <word ordinal="19">Nineteenth </word>
6618
+ <word cardinal="20">Twenty-</word>
6619
+ <word ordinal="20">Twentieth </word>
6620
+ <word cardinal="30">Thirty-</word>
6621
+ <word ordinal="30">Thirtieth </word>
6622
+ <word cardinal="40">Forty-</word>
6623
+ <word ordinal="40">Fortieth </word>
6624
+ <word cardinal="50">Fifty-</word>
6625
+ <word ordinal="50">Fiftieth </word>
6626
+ <word cardinal="60">Sixty-</word>
6627
+ <word ordinal="60">Sixtieth </word>
6628
+ <word cardinal="70">Seventy-</word>
6629
+ <word ordinal="70">Seventieth </word>
6630
+ <word cardinal="80">Eighty-</word>
6631
+ <word ordinal="80">Eightieth </word>
6632
+ <word cardinal="90">Ninety-</word>
6633
+ <word ordinal="90">Ninetieth </word>
6634
+ <word cardinal="100">Hundred-</word>
6635
+ <word ordinal="100">Hundredth </word>
6636
+ </words>
6637
+ </xsl:variable>
6638
+
6639
+ <xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
6640
+
6641
+ <xsl:variable name="value">
6642
+ <xsl:choose>
6643
+ <xsl:when test="$ordinal != ''">
6644
+ <xsl:value-of select="$ordinal"/>
6645
+ </xsl:when>
6646
+ <xsl:otherwise>
6647
+ <xsl:choose>
6648
+ <xsl:when test="$number &lt; 100">
6649
+ <xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
6650
+ <xsl:variable name="digit" select="substring($number,2)"/>
6651
+ <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
6652
+ <xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
6653
+ </xsl:when>
6654
+ <xsl:otherwise>
6655
+ <!-- more 100 -->
6656
+ <xsl:variable name="hundred" select="substring($number,1,1)"/>
6657
+ <xsl:variable name="digits" select="number(substring($number,2))"/>
6658
+ <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
6659
+ <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
6660
+ <xsl:call-template name="number-to-words">
6661
+ <xsl:with-param name="number" select="$digits"/>
6662
+ </xsl:call-template>
6663
+ </xsl:otherwise>
6664
+ </xsl:choose>
6665
+ </xsl:otherwise>
6666
+ </xsl:choose>
6667
+ </xsl:variable>
6668
+ <xsl:choose>
6669
+ <xsl:when test="$first = 'true'">
6670
+ <xsl:variable name="value_lc" select="java:toLowerCase(java:java.lang.String.new($value))"/>
6671
+ <xsl:call-template name="capitalize">
6672
+ <xsl:with-param name="str" select="$value_lc"/>
6673
+ </xsl:call-template>
6674
+ </xsl:when>
6675
+ <xsl:otherwise>
6676
+ <xsl:value-of select="$value"/>
6677
+ </xsl:otherwise>
6678
+ </xsl:choose>
6679
+ </xsl:if>
6204
6680
  </xsl:template></xsl:stylesheet>