metanorma-csa 1.4.12 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,9 +30,22 @@
30
30
  <data type="boolean"/>
31
31
  </attribute>
32
32
  </optional>
33
+ <optional>
34
+ <attribute name="number"/>
35
+ </optional>
33
36
  <optional>
34
37
  <attribute name="subsequence"/>
35
38
  </optional>
39
+ <optional>
40
+ <attribute name="keep-with-next">
41
+ <data type="boolean"/>
42
+ </attribute>
43
+ </optional>
44
+ <optional>
45
+ <attribute name="keep-lines-together">
46
+ <data type="boolean"/>
47
+ </attribute>
48
+ </optional>
36
49
  <attribute name="id">
37
50
  <data type="ID"/>
38
51
  </attribute>
@@ -141,6 +154,16 @@
141
154
  <data type="boolean"/>
142
155
  </attribute>
143
156
  </optional>
157
+ <optional>
158
+ <attribute name="keep-with-next">
159
+ <data type="boolean"/>
160
+ </attribute>
161
+ </optional>
162
+ <optional>
163
+ <attribute name="keep-lines-together">
164
+ <data type="boolean"/>
165
+ </attribute>
166
+ </optional>
144
167
  <oneOrMore>
145
168
  <ref name="BasicBlock"/>
146
169
  </oneOrMore>
@@ -12,7 +12,7 @@ module IsoDoc
12
12
 
13
13
  def annex_name(annex, name, div)
14
14
  div.h1 **{ class: "Annex" } do |t|
15
- t << "#{anchor(annex['id'], :label)} "
15
+ t << "#{@xrefs.anchor(annex['id'], :label)} "
16
16
  t.br
17
17
  t.b do |b|
18
18
  name&.children&.each { |c2| parse(c2, b) }
@@ -23,6 +23,7 @@ module IsoDoc
23
23
  def i18n_init(lang, script)
24
24
  super
25
25
  @annex_lbl = "Appendix"
26
+ @labels["annex"] = "Appendix"
26
27
  end
27
28
 
28
29
  def cleanup(docxml)
@@ -1,4 +1,4 @@
1
- <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:csa="https://www.metanorma.org/ns/csa" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" version="1.0">
1
+ <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:csa="https://www.metanorma.org/ns/csa" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:java="http://xml.apache.org/xalan/java" exclude-result-prefixes="java" version="1.0">
2
2
 
3
3
  <xsl:output version="1.0" method="xml" encoding="UTF-8" indent="yes"/>
4
4
 
@@ -86,44 +86,7 @@
86
86
 
87
87
  </fo:layout-master-set>
88
88
 
89
- <fo:declarations>
90
- <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
91
- <pdf:dictionary type="normal" key="ViewerPreferences">
92
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
93
- </pdf:dictionary>
94
- </pdf:catalog>
95
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
96
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
97
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
98
- <!-- Dublin Core properties go here -->
99
- <dc:title>
100
- <xsl:choose>
101
- <xsl:when test="$doctitle != ''">
102
- <xsl:value-of select="$doctitle"/>
103
- </xsl:when>
104
- <xsl:otherwise>
105
- <xsl:text> </xsl:text>
106
- </xsl:otherwise>
107
- </xsl:choose>
108
- </dc:title>
109
- <dc:creator/>
110
- <dc:description>
111
- <xsl:variable name="abstract">
112
- <xsl:copy-of select="/csa:csa-standard/csa:bibdata/csa:abstract//text()"/>
113
- </xsl:variable>
114
- <xsl:value-of select="normalize-space($abstract)"/>
115
- </dc:description>
116
- <pdf:Keywords>
117
- <xsl:call-template name="insertKeywords"/>
118
- </pdf:Keywords>
119
- </rdf:Description>
120
- <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
121
- <!-- XMP properties go here -->
122
- <xmp:CreatorTool/>
123
- </rdf:Description>
124
- </rdf:RDF>
125
- </x:xmpmeta>
126
- </fo:declarations>
89
+ <xsl:call-template name="addPDFUAmeta"/>
127
90
 
128
91
  <!-- Cover Page -->
129
92
  <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
@@ -198,7 +161,12 @@
198
161
 
199
162
  <fo:block break-after="page"/>
200
163
 
201
- <fo:block font-size="26pt" margin-bottom="18pt">Acknowledgements</fo:block>
164
+ <xsl:variable name="title-acknowledgements">
165
+ <xsl:call-template name="getTitle">
166
+ <xsl:with-param name="name" select="'title-acknowledgements'"/>
167
+ </xsl:call-template>
168
+ </xsl:variable>
169
+ <fo:block font-size="26pt" margin-bottom="18pt"><xsl:value-of select="$title-acknowledgements"/></fo:block>
202
170
 
203
171
  <fo:block font-size="18pt" font-weight="bold" margin-bottom="12pt" color="rgb(3, 115, 200)">Lead Authors:</fo:block>
204
172
  <fo:block>Ronald Tse</fo:block>
@@ -213,7 +181,12 @@
213
181
  <fo:block break-after="page"/>
214
182
 
215
183
  <fo:block-container font-size="12pt" line-height="170%" color="rgb(7, 72, 156)">
216
- <fo:block font-size="26pt" color="black" margin-top="2pt" margin-bottom="30pt">Table of Contents</fo:block>
184
+ <xsl:variable name="title-toc">
185
+ <xsl:call-template name="getTitle">
186
+ <xsl:with-param name="name" select="'title-toc'"/>
187
+ </xsl:call-template>
188
+ </xsl:variable>
189
+ <fo:block font-size="26pt" color="black" margin-top="2pt" margin-bottom="30pt"><xsl:value-of select="$title-toc"/></fo:block>
217
190
 
218
191
  <fo:block margin-left="-3mm">
219
192
  <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true' and @level &lt;= 2]">
@@ -430,8 +403,10 @@
430
403
  </xsl:if>
431
404
  <xsl:choose>
432
405
  <xsl:when test="not(csa:title)">
433
- <xsl:variable name="name" select="local-name()"/>
434
- <xsl:value-of select="translate(substring($name, 1, 1), $lower, $upper)"/><xsl:value-of select="substring($name, 2)"/>
406
+ <xsl:variable name="name" select="local-name()"/>
407
+ <xsl:call-template name="capitalize">
408
+ <xsl:with-param name="str" select="$name"/>
409
+ </xsl:call-template>
435
410
  </xsl:when>
436
411
  <xsl:otherwise>
437
412
  <xsl:value-of select="csa:title"/>
@@ -451,7 +426,12 @@
451
426
  <xsl:number format="i" value="$sectionNum"/>
452
427
  </xsl:variable>
453
428
  <item id="keywords" level="1" section="{$section}" display-section="true" display="true" type="abstract" root="preface">
454
- <xsl:text>Keywords</xsl:text>
429
+ <xsl:variable name="title-keywords">
430
+ <xsl:call-template name="getTitle">
431
+ <xsl:with-param name="name" select="'title-keywords'"/>
432
+ </xsl:call-template>
433
+ </xsl:variable>
434
+ <xsl:value-of select="$title-keywords"/>
455
435
  </item>
456
436
  </xsl:template>
457
437
  <!-- Submitting Organizations -->
@@ -461,7 +441,12 @@
461
441
  <xsl:number format="i" value="$sectionNum"/>
462
442
  </xsl:variable>
463
443
  <item id="submitting_orgs" level="1" section="{$section}" display-section="true" display="true" type="abstract" root="preface">
464
- <xsl:text>Submitting Organizations</xsl:text>
444
+ <xsl:variable name="title-submitting-organizations">
445
+ <xsl:call-template name="getTitle">
446
+ <xsl:with-param name="name" select="'title-submitting-organizations'"/>
447
+ </xsl:call-template>
448
+ </xsl:variable>
449
+ <xsl:value-of select="$title-submitting-organizations"/>
465
450
  </item>
466
451
  </xsl:template>
467
452
 
@@ -469,7 +454,12 @@
469
454
  <xsl:param name="sectionNum"/>
470
455
  <item level="" id="{@id}" type="figure">
471
456
  <xsl:attribute name="section">
472
- <xsl:text>Figure </xsl:text>
457
+ <xsl:variable name="title-figure">
458
+ <xsl:call-template name="getTitle">
459
+ <xsl:with-param name="name" select="'title-figure'"/>
460
+ </xsl:call-template>
461
+ </xsl:variable>
462
+ <xsl:value-of select="$title-figure"/>
473
463
  <xsl:choose>
474
464
  <xsl:when test="ancestor::csa:annex">
475
465
  <xsl:choose>
@@ -504,7 +494,12 @@
504
494
  <xsl:variable name="annex-id" select="ancestor::csa:annex/@id"/>
505
495
  <item level="" id="{@id}" display="false" type="table">
506
496
  <xsl:attribute name="section">
507
- <xsl:text>Table </xsl:text>
497
+ <xsl:variable name="title-table">
498
+ <xsl:call-template name="getTitle">
499
+ <xsl:with-param name="name" select="'title-table'"/>
500
+ </xsl:call-template>
501
+ </xsl:variable>
502
+ <xsl:value-of select="$title-table"/>
508
503
  <xsl:choose>
509
504
  <xsl:when test="ancestor::*[local-name()='executivesummary']">
510
505
  <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered='true')]"/>
@@ -527,7 +522,12 @@
527
522
  <xsl:template match="csa:formula" mode="contents">
528
523
  <item level="" id="{@id}" display="false">
529
524
  <xsl:attribute name="section">
530
- <xsl:text>Formula (</xsl:text><xsl:number format="A.1" level="multiple" count="csa:annex | csa:formula"/><xsl:text>)</xsl:text>
525
+ <xsl:variable name="title-formula">
526
+ <xsl:call-template name="getTitle">
527
+ <xsl:with-param name="name" select="'title-formula'"/>
528
+ </xsl:call-template>
529
+ </xsl:variable>
530
+ <xsl:value-of select="$title-formula"/><xsl:number format="(A.1)" level="multiple" count="csa:annex | csa:formula"/>
531
531
  </xsl:attribute>
532
532
  </item>
533
533
  </xsl:template>
@@ -545,7 +545,12 @@
545
545
 
546
546
  <xsl:template match="/csa:csa-standard/csa:bibdata/csa:edition">
547
547
  <fo:block margin-bottom="12pt">
548
- <xsl:text>Version: </xsl:text>
548
+ <xsl:variable name="title-edition">
549
+ <xsl:call-template name="getTitle">
550
+ <xsl:with-param name="name" select="'title-edition'"/>
551
+ </xsl:call-template>
552
+ </xsl:variable>
553
+ <xsl:value-of select="$title-edition"/><xsl:text>: </xsl:text>
549
554
  <xsl:value-of select="."/><xsl:text> </xsl:text>
550
555
  </fo:block>
551
556
  </xsl:template>
@@ -658,8 +663,10 @@
658
663
  </xsl:variable>
659
664
  <fo:block id="{$id}" font-size="13pt" font-weight="bold" margin-bottom="12pt" color="rgb(14, 26, 133)">
660
665
  <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="3mm"> </fo:inline>
661
- <xsl:variable name="name" select="local-name()"/>
662
- <xsl:value-of select="translate(substring($name, 1, 1), $lower, $upper)"/><xsl:value-of select="substring($name, 2)"/>
666
+ <xsl:variable name="name" select="local-name()"/>
667
+ <xsl:call-template name="capitalize">
668
+ <xsl:with-param name="str" select="$name"/>
669
+ </xsl:call-template>
663
670
  </fo:block>
664
671
  </xsl:if>
665
672
  <xsl:apply-templates/>
@@ -669,7 +676,12 @@
669
676
  <xsl:param name="sectionNum" select="'1'"/>
670
677
  <fo:block id="keywords" font-size="13pt" font-weight="bold" margin-top="13.5pt" margin-bottom="12pt" color="rgb(14, 26, 133)">
671
678
  <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="2mm"> </fo:inline>
672
- <xsl:text>Keywords</xsl:text>
679
+ <xsl:variable name="title-keywords">
680
+ <xsl:call-template name="getTitle">
681
+ <xsl:with-param name="name" select="'title-keywords'"/>
682
+ </xsl:call-template>
683
+ </xsl:variable>
684
+ <xsl:value-of select="$title-keywords"/>
673
685
  </fo:block>
674
686
  <fo:block margin-bottom="12pt">The following are keywords to be used by search engines and document catalogues.</fo:block>
675
687
  <fo:block margin-bottom="12pt">
@@ -687,8 +699,13 @@
687
699
  <xsl:template match="/csa:csa-standard/csa:bibdata/csa:contributor[csa:role/@type='author']/csa:organization/csa:name">
688
700
  <xsl:param name="sectionNum" select="'1'"/>
689
701
  <fo:block id="submitting_orgs" font-size="13pt" font-weight="bold" color="rgb(14, 26, 133)" margin-top="13.5pt" margin-bottom="12pt">
690
- <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="3mm"> </fo:inline>
691
- <xsl:text>Submitting Organizations</xsl:text>
702
+ <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="3mm"> </fo:inline>
703
+ <xsl:variable name="title-submitting-organizations">
704
+ <xsl:call-template name="getTitle">
705
+ <xsl:with-param name="name" select="'title-submitting-organizations'"/>
706
+ </xsl:call-template>
707
+ </xsl:variable>
708
+ <xsl:value-of select="$title-submitting-organizations"/>
692
709
  </fo:block>
693
710
  <fo:block margin-bottom="12pt">The following organizations submitted this Document to the Open Geospatial Consortium (OGC):</fo:block>
694
711
  <fo:list-block provisional-distance-between-starts="6.5mm" margin-bottom="12pt" line-height="115%">
@@ -841,7 +858,7 @@
841
858
  <xsl:attribute name="line-height">120%</xsl:attribute>
842
859
 
843
860
  <xsl:if test="$level = 2">
844
- <fo:inline padding-right="1mm">
861
+ <fo:inline padding-right="1mm">
845
862
  <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Title-Image))}" width="15mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}" vertical-align="middle"/>
846
863
  </fo:inline>
847
864
  </xsl:if>
@@ -948,11 +965,7 @@
948
965
  </fo:block>
949
966
  </xsl:template>
950
967
 
951
- <xsl:template match="csa:figure">
952
- <xsl:variable name="title">
953
- <xsl:text>Figure </xsl:text>
954
- </xsl:variable>
955
-
968
+ <xsl:template match="csa:figure">
956
969
  <fo:block-container id="{@id}">
957
970
  <fo:block>
958
971
  <xsl:apply-templates/>
@@ -962,7 +975,11 @@
962
975
  <xsl:call-template name="note"/>
963
976
  </xsl:for-each>
964
977
  <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-top="12pt" margin-bottom="6pt" keep-with-previous="always">
965
-
978
+ <xsl:variable name="title-figure">
979
+ <xsl:call-template name="getTitle">
980
+ <xsl:with-param name="name" select="'title-figure'"/>
981
+ </xsl:call-template>
982
+ </xsl:variable>
966
983
  <xsl:choose>
967
984
  <xsl:when test="ancestor::csa:annex">
968
985
  <xsl:choose>
@@ -970,13 +987,13 @@
970
987
  <xsl:number format="a) "/>
971
988
  </xsl:when>
972
989
  <xsl:otherwise>
973
- <xsl:value-of select="$title"/><xsl:number format="A.1-1" level="multiple" count="csa:annex | csa:figure"/>
990
+ <xsl:value-of select="$title-figure"/><xsl:number format="A.1-1" level="multiple" count="csa:annex | csa:figure"/>
974
991
  </xsl:otherwise>
975
992
  </xsl:choose>
976
993
 
977
994
  </xsl:when>
978
995
  <xsl:otherwise>
979
- <xsl:value-of select="$title"/><xsl:number format="1" level="any" count="csa:sourcecode[not(@unnumbered='true') and not(ancestor::csa:example)] | csa:figure"/>
996
+ <xsl:value-of select="$title-figure"/><xsl:number format="1" level="any" count="csa:sourcecode[not(@unnumbered='true') and not(ancestor::csa:example)] | csa:figure"/>
980
997
  </xsl:otherwise>
981
998
  </xsl:choose>
982
999
  <xsl:if test="csa:name">
@@ -1059,13 +1076,13 @@
1059
1076
  </xsl:choose>
1060
1077
  </xsl:variable>
1061
1078
  <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super"> <!-- 60% baseline-shift="35%" -->
1062
- <fo:basic-link internal-destination="footnote_{../@id}" fox:alt-text="footnote {$number}">
1079
+ <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
1063
1080
  <xsl:value-of select="$number"/><!-- <xsl:text>)</xsl:text> -->
1064
1081
  </fo:basic-link>
1065
1082
  </fo:inline>
1066
1083
  <fo:footnote-body>
1067
1084
  <fo:block font-family="AzoSans-Light" font-size="10pt" margin-bottom="12pt" start-indent="0pt" color="rgb(168, 170, 173)">
1068
- <fo:inline id="footnote_{../@id}" keep-with-next.within-line="always" font-size="60%" vertical-align="super"><!-- baseline-shift="30%" padding-right="9mm" alignment-baseline="hanging" -->
1085
+ <fo:inline id="{generate-id()}" keep-with-next.within-line="always" font-size="60%" vertical-align="super"><!-- baseline-shift="30%" padding-right="9mm" alignment-baseline="hanging" -->
1069
1086
  <xsl:value-of select="$number"/><!-- <xsl:text>)</xsl:text> -->
1070
1087
  </fo:inline>
1071
1088
  <xsl:apply-templates/>
@@ -1149,6 +1166,15 @@
1149
1166
  </fo:list-item-body>
1150
1167
  </fo:list-item>
1151
1168
  </xsl:template>
1169
+
1170
+ <xsl:template match="csa:term">
1171
+ <xsl:param name="sectionNum"/>
1172
+ <fo:block id="{@id}">
1173
+ <xsl:apply-templates>
1174
+ <xsl:with-param name="sectionNum" select="$sectionNum"/>
1175
+ </xsl:apply-templates>
1176
+ </fo:block>
1177
+ </xsl:template>
1152
1178
 
1153
1179
  <xsl:template match="csa:preferred">
1154
1180
  <xsl:param name="sectionNum"/>
@@ -1168,7 +1194,7 @@
1168
1194
  </xsl:variable>
1169
1195
  <fo:block font-size="{$font-size}">
1170
1196
  <fo:block font-weight="bold" keep-with-next="always">
1171
- <fo:inline id="{../@id}">
1197
+ <fo:inline>
1172
1198
  <xsl:value-of select="$section"/><xsl:text>.</xsl:text>
1173
1199
  </fo:inline>
1174
1200
  </fo:block>
@@ -1185,7 +1211,12 @@
1185
1211
  </xsl:template>
1186
1212
 
1187
1213
  <xsl:template match="csa:deprecates">
1188
- <fo:block>DEPRECATED: <xsl:apply-templates/></fo:block>
1214
+ <xsl:variable name="title-deprecated">
1215
+ <xsl:call-template name="getTitle">
1216
+ <xsl:with-param name="name" select="'title-deprecated'"/>
1217
+ </xsl:call-template>
1218
+ </xsl:variable>
1219
+ <fo:block><xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/></fo:block>
1189
1220
  </xsl:template>
1190
1221
 
1191
1222
  <xsl:template match="csa:definition[preceding-sibling::csa:domain]">
@@ -1206,7 +1237,14 @@
1206
1237
  <fo:block margin-bottom="12pt" keep-with-previous="always">
1207
1238
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
1208
1239
  <fo:basic-link internal-destination="{csa:origin/@bibitemid}" fox:alt-text="{csa:origin/@citeas}">
1209
- <xsl:text>[SOURCE: </xsl:text>
1240
+ <xsl:text>[</xsl:text>
1241
+ <xsl:variable name="title-source">
1242
+ <xsl:call-template name="getTitle">
1243
+ <xsl:with-param name="name" select="'title-source'"/>
1244
+ </xsl:call-template>
1245
+ </xsl:variable>
1246
+ <xsl:value-of select="$title-source"/>
1247
+ <xsl:text>: </xsl:text>
1210
1248
  <fo:inline text-decoration="underline" color="{$color-link}">
1211
1249
  <xsl:value-of select="csa:origin/@citeas"/>
1212
1250
 
@@ -1219,19 +1257,19 @@
1219
1257
  </fo:block>
1220
1258
  </xsl:template>
1221
1259
 
1222
- <xsl:template match="csa:modification">
1223
- <xsl:text>, modified — </xsl:text>
1224
- <xsl:apply-templates/>
1225
- </xsl:template>
1226
1260
  <xsl:template match="csa:modification/csa:p">
1227
1261
  <fo:inline><xsl:apply-templates/></fo:inline>
1228
1262
  </xsl:template>
1229
1263
 
1230
1264
  <xsl:template match="csa:termnote">
1231
1265
  <fo:block font-size="10pt" margin-bottom="12pt">
1232
- <xsl:text>Note </xsl:text>
1233
- <xsl:number/>
1234
- <xsl:text> to entry: </xsl:text>
1266
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
1267
+ <xsl:variable name="title-note-to-entry">
1268
+ <xsl:call-template name="getTitle">
1269
+ <xsl:with-param name="name" select="'title-note-to-entry'"/>
1270
+ </xsl:call-template>
1271
+ </xsl:variable>
1272
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($title-note-to-entry),'#',$num)"/>
1235
1273
  <xsl:apply-templates/>
1236
1274
  </fo:block>
1237
1275
  </xsl:template>
@@ -1247,7 +1285,12 @@
1247
1285
 
1248
1286
  <xsl:template match="csa:termexample">
1249
1287
  <fo:block font-size="10pt" margin-bottom="12pt">
1250
- <fo:inline padding-right="10mm">EXAMPLE</fo:inline>
1288
+ <xsl:variable name="title-example">
1289
+ <xsl:call-template name="getTitle">
1290
+ <xsl:with-param name="name" select="'title-example'"/>
1291
+ </xsl:call-template>
1292
+ </xsl:variable>
1293
+ <fo:inline padding-right="10mm"><xsl:value-of select="normalize-space($title-example)"/></fo:inline>
1251
1294
  <xsl:apply-templates/>
1252
1295
  </fo:block>
1253
1296
  </xsl:template>
@@ -1366,7 +1409,7 @@
1366
1409
 
1367
1410
  <xsl:template match="csa:source">
1368
1411
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
1369
- <xsl:value-of select="@citeas" disable-output-escaping="yes"/>
1412
+ <xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" -->
1370
1413
  <xsl:apply-templates select="csa:localityStack"/>
1371
1414
  </fo:basic-link>
1372
1415
  </xsl:template>
@@ -1381,6 +1424,17 @@
1381
1424
  <!-- </xsl:if> -->
1382
1425
  <xsl:variable name="type" select="xalan:nodeset($contents)//item[@id = current()/@target]/@type"/>
1383
1426
  <xsl:variable name="root" select="xalan:nodeset($contents)//item[@id = current()/@target]/@root"/>
1427
+
1428
+ <xsl:variable name="title-clause">
1429
+ <xsl:call-template name="getTitle">
1430
+ <xsl:with-param name="name" select="'title-clause'"/>
1431
+ </xsl:call-template>
1432
+ </xsl:variable>
1433
+ <xsl:variable name="title-annex">
1434
+ <xsl:call-template name="getTitle">
1435
+ <xsl:with-param name="name" select="'title-annex'"/>
1436
+ </xsl:call-template>
1437
+ </xsl:variable>
1384
1438
 
1385
1439
  <xsl:choose>
1386
1440
  <xsl:when test="normalize-space(.) != ''">
@@ -1388,9 +1442,9 @@
1388
1442
  </xsl:when>
1389
1443
  <xsl:otherwise>
1390
1444
  <xsl:choose>
1391
- <xsl:when test="$type = 'clause' and $root != 'annex'">Clause </xsl:when><!-- and not (ancestor::annex) -->
1392
- <xsl:when test="$type = 'term' and ($root = 'clause' or $root = 'terms')">Clause </xsl:when>
1393
- <xsl:when test="$type = 'clause' and $root = 'annex'">Annex </xsl:when>
1445
+ <xsl:when test="$type = 'clause' and $root != 'annex'"><xsl:value-of select="$title-clause"/></xsl:when><!-- and not (ancestor::annex) -->
1446
+ <xsl:when test="$type = 'term' and ($root = 'clause' or $root = 'terms')"><xsl:value-of select="$title-clause"/></xsl:when>
1447
+ <xsl:when test="$type = 'clause' and $root = 'annex'"><xsl:value-of select="$title-annex"/></xsl:when>
1394
1448
  <xsl:otherwise/> <!-- <xsl:value-of select="$type"/> -->
1395
1449
  </xsl:choose>
1396
1450
  <xsl:value-of select="$section"/>
@@ -1401,6 +1455,11 @@
1401
1455
 
1402
1456
  <xsl:template match="csa:sourcecode" priority="2">
1403
1457
  <xsl:call-template name="sourcecode"/>
1458
+ <xsl:variable name="title-figure">
1459
+ <xsl:call-template name="getTitle">
1460
+ <xsl:with-param name="name" select="'title-figure'"/>
1461
+ </xsl:call-template>
1462
+ </xsl:variable>
1404
1463
  <xsl:choose>
1405
1464
  <xsl:when test="@unnumbered='true'"/>
1406
1465
  <xsl:when test="ancestor::csa:example"/>
@@ -1412,8 +1471,8 @@
1412
1471
  <xsl:value-of select="/csa:nist-standard/csa:bibdata/csa:ext/csa:structuredidentifier/csa:annexid"/><xsl:number format="-1" level="any" count="csa:annex//csa:sourcecode"/>
1413
1472
  </xsl:when>
1414
1473
  <xsl:otherwise>
1415
- <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="12pt">
1416
- <xsl:text>Figure </xsl:text>
1474
+ <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="12pt">
1475
+ <xsl:value-of select="$title-figure"/>
1417
1476
  <xsl:number format="A." level="multiple" count="csa:annex"/>
1418
1477
  <xsl:number format="1" level="any" count="csa:sourcecode[ancestor::csa:annex/@id = $id_annex and not(@unnumbered='true') and not(ancestor::csa:example)]"/>
1419
1478
  <xsl:if test="csa:name">
@@ -1426,7 +1485,7 @@
1426
1485
  </xsl:when>
1427
1486
  <xsl:otherwise>
1428
1487
  <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="12pt">
1429
- <xsl:text>Figure </xsl:text>
1488
+ <xsl:value-of select="$title-figure"/>
1430
1489
  <xsl:number format="1" level="any" count="csa:sourcecode[not(@unnumbered='true') and not(ancestor::csa:example)] | csa:figure"/>
1431
1490
  <xsl:if test="csa:name">
1432
1491
  <xsl:text> — </xsl:text>
@@ -1455,8 +1514,13 @@
1455
1514
  </xsl:template>
1456
1515
 
1457
1516
  <xsl:template match="csa:example">
1458
- <fo:block font-size="10pt" margin-top="12pt" margin-bottom="12pt" font-weight="bold" keep-with-next="always">
1459
- <xsl:text>EXAMPLE</xsl:text>
1517
+ <fo:block font-size="10pt" margin-top="12pt" margin-bottom="12pt" font-weight="bold" keep-with-next="always">
1518
+ <xsl:variable name="title-example">
1519
+ <xsl:call-template name="getTitle">
1520
+ <xsl:with-param name="name" select="'title-example'"/>
1521
+ </xsl:call-template>
1522
+ </xsl:variable>
1523
+ <xsl:value-of select="$title-example"/>
1460
1524
  <xsl:if test="following-sibling::csa:example or preceding-sibling::csa:example">
1461
1525
  <xsl:number format=" 1"/>
1462
1526
  </xsl:if>
@@ -1486,7 +1550,12 @@
1486
1550
  </xsl:if>
1487
1551
  <xsl:variable name="clauseid" select="ancestor::csa:clause[1]/@id"/>
1488
1552
  <fo:inline padding-right="4mm">
1489
- <xsl:text>NOTE </xsl:text>
1553
+ <xsl:variable name="title-note">
1554
+ <xsl:call-template name="getTitle">
1555
+ <xsl:with-param name="name" select="'title-note'"/>
1556
+ </xsl:call-template>
1557
+ </xsl:variable>
1558
+ <xsl:value-of select="$title-note"/>
1490
1559
  <xsl:if test="count(//csa:note[ancestor::csa:clause[1][@id = $clauseid]]) &gt; 1">
1491
1560
  <xsl:number count="csa:note[ancestor::csa:clause[1][@id = $clauseid]]" level="any"/>
1492
1561
  </xsl:if>
@@ -1506,7 +1575,7 @@
1506
1575
  </xsl:if>
1507
1576
  <xsl:choose>
1508
1577
  <xsl:when test="@citeas and normalize-space(text()) = ''">
1509
- <xsl:value-of select="@citeas" disable-output-escaping="yes"/>
1578
+ <xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" -->
1510
1579
  </xsl:when>
1511
1580
  <xsl:when test="@bibitemid and normalize-space(text()) = ''">
1512
1581
  <xsl:value-of select="//csa:bibitem[@id = current()/@bibitemid]/csa:docidentifier"/>
@@ -1519,9 +1588,19 @@
1519
1588
  </xsl:template>
1520
1589
 
1521
1590
  <xsl:template match="csa:locality">
1591
+ <xsl:variable name="title-clause">
1592
+ <xsl:call-template name="getTitle">
1593
+ <xsl:with-param name="name" select="'title-clause'"/>
1594
+ </xsl:call-template>
1595
+ </xsl:variable>
1596
+ <xsl:variable name="title-annex">
1597
+ <xsl:call-template name="getTitle">
1598
+ <xsl:with-param name="name" select="'title-annex'"/>
1599
+ </xsl:call-template>
1600
+ </xsl:variable>
1522
1601
  <xsl:choose>
1523
- <xsl:when test="@type ='clause'">Clause </xsl:when>
1524
- <xsl:when test="@type ='annex'">Annex </xsl:when>
1602
+ <xsl:when test="@type ='clause'"><xsl:value-of select="$title-clause"/></xsl:when>
1603
+ <xsl:when test="@type ='annex'"><xsl:value-of select="$title-annex"/></xsl:when>
1525
1604
  <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
1526
1605
  </xsl:choose>
1527
1606
  <xsl:text> </xsl:text><xsl:value-of select="csa:referenceFrom"/>
@@ -1530,8 +1609,8 @@
1530
1609
  <xsl:template match="csa:admonition">
1531
1610
  <fo:block-container border="0.5pt solid rgb(79, 129, 189)" color="rgb(79, 129, 189)" margin-left="16mm" margin-right="16mm" margin-bottom="12pt">
1532
1611
  <fo:block-container margin-left="0mm" margin-right="0mm" padding="2mm" padding-top="3mm">
1533
- <fo:block font-size="11pt" margin-bottom="6pt" font-weight="bold" font-style="italic" text-align="center">
1534
- <xsl:value-of select="translate(@type, $lower, $upper)"/>
1612
+ <fo:block font-size="11pt" margin-bottom="6pt" font-weight="bold" font-style="italic" text-align="center">
1613
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@type))"/>
1535
1614
  </fo:block>
1536
1615
  <fo:block font-style="italic">
1537
1616
  <xsl:apply-templates/>
@@ -1542,6 +1621,12 @@
1542
1621
 
1543
1622
  </xsl:template>
1544
1623
 
1624
+ <xsl:template match="csa:formula">
1625
+ <fo:block id="{@id}">
1626
+ <xsl:apply-templates/>
1627
+ </fo:block>
1628
+ </xsl:template>
1629
+
1545
1630
  <xsl:template match="csa:formula/csa:dt/csa:stem">
1546
1631
  <fo:inline>
1547
1632
  <xsl:apply-templates/>
@@ -1549,7 +1634,7 @@
1549
1634
  </xsl:template>
1550
1635
 
1551
1636
  <xsl:template match="csa:formula/csa:stem">
1552
- <fo:block id="{../@id}" margin-top="6pt" margin-bottom="12pt">
1637
+ <fo:block margin-top="6pt" margin-bottom="12pt">
1553
1638
  <fo:table table-layout="fixed" width="100%">
1554
1639
  <fo:table-column column-width="95%"/>
1555
1640
  <fo:table-column column-width="5%"/>
@@ -1564,7 +1649,7 @@
1564
1649
  <fo:block text-align="right">
1565
1650
  <xsl:choose>
1566
1651
  <xsl:when test="ancestor::csa:annex">
1567
- <xsl:text>(</xsl:text><xsl:number format="A.1" level="multiple" count="csa:annex | csa:formula"/><xsl:text>)</xsl:text>
1652
+ <xsl:number format="(A.1)" level="multiple" count="csa:annex | csa:formula"/>
1568
1653
  </xsl:when>
1569
1654
  <xsl:otherwise> <!-- not(ancestor::csa:annex) -->
1570
1655
  <!-- <xsl:text>(</xsl:text><xsl:number level="any" count="csa:formula"/><xsl:text>)</xsl:text> -->
@@ -1608,38 +1693,6 @@
1608
1693
  </fo:static-content>
1609
1694
  </xsl:template>
1610
1695
 
1611
- <xsl:template name="getId">
1612
- <xsl:choose>
1613
- <xsl:when test="../@id">
1614
- <xsl:value-of select="../@id"/>
1615
- </xsl:when>
1616
- <xsl:otherwise>
1617
- <xsl:value-of select="text()"/>
1618
- </xsl:otherwise>
1619
- </xsl:choose>
1620
- </xsl:template>
1621
-
1622
- <xsl:template name="getLevel">
1623
- <xsl:variable name="level_total" select="count(ancestor::*)"/>
1624
- <xsl:variable name="level">
1625
- <xsl:choose>
1626
- <xsl:when test="ancestor::csa:preface">
1627
- <xsl:value-of select="$level_total - 2"/>
1628
- </xsl:when>
1629
- <xsl:when test="ancestor::csa:sections">
1630
- <xsl:value-of select="$level_total - 2"/>
1631
- </xsl:when>
1632
- <xsl:when test="ancestor::csa:bibliography">
1633
- <xsl:value-of select="$level_total - 2"/>
1634
- </xsl:when>
1635
- <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
1636
- <xsl:otherwise>
1637
- <xsl:value-of select="$level_total - 1"/>
1638
- </xsl:otherwise>
1639
- </xsl:choose>
1640
- </xsl:variable>
1641
- <xsl:value-of select="$level"/>
1642
- </xsl:template>
1643
1696
 
1644
1697
  <xsl:template name="getSection">
1645
1698
  <xsl:param name="sectionNum"/>
@@ -1659,7 +1712,7 @@
1659
1712
  </xsl:when>
1660
1713
  <xsl:when test="$level &gt;= 2">
1661
1714
  <xsl:variable name="num">
1662
- <xsl:number format=".1" level="multiple" count="csa:clause/csa:clause | csa:clause/csa:terms | csa:terms/csa:term | csa:clause/csa:term | csa:clause/csa:definitions | csa:definitions/csa:definitions | csa:terms/csa:definitions"/>
1715
+ <xsl:call-template name="getSubSection"/>
1663
1716
  </xsl:variable>
1664
1717
  <xsl:value-of select="concat($sectionNum, $num)"/>
1665
1718
  </xsl:when>
@@ -1683,7 +1736,12 @@
1683
1736
  <xsl:when test="ancestor::csa:annex">
1684
1737
  <xsl:choose>
1685
1738
  <xsl:when test="$level = 1">
1686
- <xsl:text>Annex </xsl:text>
1739
+ <xsl:variable name="title-annex">
1740
+ <xsl:call-template name="getTitle">
1741
+ <xsl:with-param name="name" select="'title-annex'"/>
1742
+ </xsl:call-template>
1743
+ </xsl:variable>
1744
+ <xsl:value-of select="$title-annex"/>
1687
1745
  <xsl:choose>
1688
1746
  <xsl:when test="count(//csa:annex) = 1">
1689
1747
  <xsl:value-of select="/csa:csa-standard/csa:bibdata/csa:ext/csa:structuredidentifier/csa:annexid"/>
@@ -2959,50 +3017,191 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
2959
3017
  </xsl:text>
2960
3018
  </xsl:variable>
2961
3019
 
2962
- <xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-table">
3020
+ <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
3021
+
3022
+ <title-table lang="en">Table </title-table>
3023
+ <title-table lang="fr">Tableau </title-table>
3024
+
3025
+ <title-table lang="zh">Table </title-table>
3026
+
3027
+
3028
+
3029
+ <title-note lang="en">NOTE </title-note>
3030
+ <title-note lang="fr">NOTE </title-note>
3031
+
3032
+ <title-note lang="zh">NOTE </title-note>
3033
+
3034
+
3035
+
3036
+ <title-figure lang="en">Figure </title-figure>
3037
+ <title-figure lang="fr">Figure </title-figure>
3038
+
3039
+ <title-figure lang="zh">Figure </title-figure>
3040
+
3041
+
3042
+
3043
+ <title-example lang="en">EXAMPLE </title-example>
3044
+ <title-example lang="fr">EXEMPLE </title-example>
3045
+
3046
+ <title-example lang="zh">EXAMPLE </title-example>
3047
+
3048
+
3049
+
3050
+ <title-example-xref lang="en">Example </title-example-xref>
3051
+ <title-example-xref lang="fr">Exemple </title-example-xref>
3052
+
3053
+ <title-section lang="en">Section </title-section>
3054
+ <title-section lang="fr">Section </title-section>
3055
+
3056
+ <title-inequality lang="en">Inequality </title-inequality>
3057
+ <title-inequality lang="fr">Inequality </title-inequality>
3058
+
3059
+ <title-equation lang="en">Equation </title-equation>
3060
+ <title-equation lang="fr">Equation </title-equation>
3061
+
3062
+ <title-annex lang="en">Annex </title-annex>
3063
+ <title-annex lang="fr">Annexe </title-annex>
3064
+
3065
+ <title-annex lang="zh">Annex </title-annex>
3066
+
3067
+
3068
+
3069
+ <title-appendix lang="en">Appendix </title-appendix>
3070
+ <title-appendix lang="fr">Appendix </title-appendix>
3071
+
3072
+ <title-clause lang="en">Clause </title-clause>
3073
+ <title-clause lang="fr">Article </title-clause>
3074
+
3075
+ <title-clause lang="zh">Clause </title-clause>
3076
+
3077
+
3078
+
3079
+ <title-edition lang="en">
3080
+
3081
+
3082
+ <xsl:text>Version</xsl:text>
3083
+
3084
+ </title-edition>
3085
+
3086
+ <title-formula lang="en">Formula </title-formula>
3087
+ <title-formula lang="fr">Formula </title-formula>
3088
+
3089
+ <title-toc lang="en">
3090
+
3091
+
3092
+ <xsl:text>Table of Contents</xsl:text>
3093
+
3094
+
3095
+ </title-toc>
3096
+ <title-toc lang="fr">Sommaire</title-toc>
3097
+
3098
+ <title-toc lang="zh">Contents</title-toc>
3099
+
3100
+
3101
+
3102
+ <title-page lang="en">Page</title-page>
3103
+ <title-page lang="fr">Page</title-page>
3104
+
3105
+ <title-key lang="en">Key</title-key>
3106
+ <title-key lang="fr">Légende</title-key>
3107
+
3108
+ <title-where lang="en">where</title-where>
3109
+ <title-where lang="fr">où</title-where>
3110
+
3111
+ <title-descriptors lang="en">Descriptors</title-descriptors>
3112
+
3113
+ <title-part lang="en">
3114
+
3115
+
3116
+ </title-part>
3117
+ <title-part lang="fr">
3118
+
3119
+
3120
+ </title-part>
3121
+ <title-part lang="zh">第 # 部分:</title-part>
3122
+
3123
+ <title-note-to-entry lang="en">Note # to entry: </title-note-to-entry>
3124
+ <title-note-to-entry lang="fr">Note # à l'article: </title-note-to-entry>
3125
+
3126
+ <title-note-to-entry lang="zh">Note # to entry: </title-note-to-entry>
2963
3127
 
2964
- <xsl:text>Table </xsl:text>
2965
3128
 
2966
3129
 
2967
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-note">
3130
+ <title-modified lang="en">modified</title-modified>
3131
+ <title-modified lang="fr">modifiée</title-modified>
2968
3132
 
2969
- <xsl:text>NOTE </xsl:text>
3133
+ <title-modified lang="zh">modified</title-modified>
2970
3134
 
2971
3135
 
2972
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-figure">
2973
3136
 
2974
- <xsl:text>Figure </xsl:text>
3137
+ <title-source lang="en">SOURCE</title-source>
2975
3138
 
3139
+ <title-keywords lang="en">Keywords</title-keywords>
2976
3140
 
2977
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-example">
3141
+ <title-deprecated lang="en">DEPRECATED</title-deprecated>
3142
+ <title-deprecated lang="fr">DEPRECATED</title-deprecated>
2978
3143
 
2979
- <xsl:text>EXAMPLE </xsl:text>
3144
+ <title-submitting-organizations lang="en">Submitting Organizations</title-submitting-organizations>
2980
3145
 
3146
+ <title-list-tables lang="en">List of Tables</title-list-tables>
2981
3147
 
2982
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-inequality">Inequality </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-equation">Equation </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-annex">
3148
+ <title-list-figures lang="en">List of Figures</title-list-figures>
2983
3149
 
2984
- <xsl:text>Annex </xsl:text>
3150
+ <title-recommendation lang="en">Recommendation </title-recommendation>
2985
3151
 
3152
+ <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
2986
3153
 
2987
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-appendix">
2988
- <xsl:text>Appendix </xsl:text>
2989
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-clause">
3154
+ <title-abstract lang="en">Abstract</title-abstract>
2990
3155
 
2991
- <xsl:text>Clause </xsl:text>
3156
+ <title-summary lang="en">Summary</title-summary>
2992
3157
 
3158
+ <title-in lang="en">in </title-in>
2993
3159
 
2994
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-edition">
2995
- <xsl:text>Edition </xsl:text>
2996
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-toc">
3160
+ <title-box lang="en">Box </title-box>
2997
3161
 
3162
+ <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
3163
+ <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
2998
3164
 
2999
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-page">Page</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-key">Key</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-where">where</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-descriptors">Descriptors</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-part-en">Part </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-part-fr">Partie </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-note-to-entry">Note # to entry: </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-modified">modified</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-source">SOURCE</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-keywords">Keywords</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="linebreak" select="'&#8232;'"/><xsl:attribute-set xmlns:java="http://xml.apache.org/xalan/java" name="link-style">
3165
+ <title-completion-date lang="en">Completion date for this manuscript</title-completion-date>
3166
+ <title-completion-date lang="zh">本稿完成日期</title-completion-date>
3167
+
3168
+ <title-issuance-date lang="en">Issuance Date: #</title-issuance-date>
3169
+ <title-issuance-date lang="zh"># 发布</title-issuance-date>
3170
+
3171
+ <title-implementation-date lang="en">Implementation Date: #</title-implementation-date>
3172
+ <title-implementation-date lang="zh"># 实施</title-implementation-date>
3173
+
3174
+ <title-obligation-normative lang="en">normative</title-obligation-normative>
3175
+ <title-obligation-normative lang="zh">规范性附录</title-obligation-normative>
3176
+
3177
+ <title-caution lang="en">CAUTION</title-caution>
3178
+ <title-caution lang="zh">注意</title-caution>
3179
+
3180
+ <title-warning lang="en">WARNING</title-warning>
3181
+ <title-warning lang="zh">警告</title-warning>
3182
+
3183
+ <title-amendment lang="en">AMENDMENT</title-amendment>
3184
+ </xsl:variable><xsl:template name="getTitle">
3185
+ <xsl:param name="name"/>
3186
+ <xsl:variable name="lang">
3187
+ <xsl:call-template name="getLang"/>
3188
+ </xsl:variable>
3189
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
3190
+ <xsl:choose>
3191
+ <xsl:when test="normalize-space($title_) != ''">
3192
+ <xsl:value-of select="$title_"/>
3193
+ </xsl:when>
3194
+ <xsl:otherwise>
3195
+ <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
3196
+ </xsl:otherwise>
3197
+ </xsl:choose>
3198
+ </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="link-style">
3000
3199
 
3001
3200
 
3002
3201
  <xsl:attribute name="color">rgb(33, 94, 159)</xsl:attribute>
3003
3202
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
3004
3203
 
3005
- </xsl:attribute-set><xsl:attribute-set xmlns:java="http://xml.apache.org/xalan/java" name="sourcecode-style">
3204
+ </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
3006
3205
 
3007
3206
 
3008
3207
  <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
@@ -3017,22 +3216,22 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3017
3216
 
3018
3217
 
3019
3218
 
3020
- </xsl:attribute-set><xsl:attribute-set xmlns:java="http://xml.apache.org/xalan/java" name="appendix-style">
3219
+ </xsl:attribute-set><xsl:attribute-set name="appendix-style">
3021
3220
 
3022
3221
 
3023
3222
 
3024
- </xsl:attribute-set><xsl:attribute-set xmlns:java="http://xml.apache.org/xalan/java" name="appendix-example-style">
3223
+ </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
3025
3224
 
3026
3225
 
3027
3226
 
3028
- </xsl:attribute-set><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="text()">
3227
+ </xsl:attribute-set><xsl:template match="text()">
3029
3228
  <xsl:value-of select="."/>
3030
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='br']">
3229
+ </xsl:template><xsl:template match="*[local-name()='br']">
3031
3230
  <xsl:value-of select="$linebreak"/>
3032
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
3231
+ </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
3033
3232
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
3034
3233
  <xsl:call-template name="add-zero-spaces-java"/>
3035
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']">
3234
+ </xsl:template><xsl:template match="*[local-name()='table']">
3036
3235
 
3037
3236
  <xsl:variable name="simple-table">
3038
3237
  <!-- <xsl:copy> -->
@@ -3136,13 +3335,22 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3136
3335
  </xsl:otherwise>
3137
3336
  </xsl:choose>
3138
3337
  </xsl:for-each>
3139
- <xsl:apply-templates/>
3338
+
3339
+ <xsl:choose>
3340
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
3341
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3342
+ </xsl:when>
3343
+ <xsl:otherwise>
3344
+ <xsl:apply-templates/>
3345
+ </xsl:otherwise>
3346
+ </xsl:choose>
3347
+
3140
3348
  </fo:table>
3141
3349
 
3142
3350
 
3143
3351
 
3144
3352
  </fo:block-container>
3145
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="getTableNumber">
3353
+ </xsl:template><xsl:template name="getTableNumber">
3146
3354
  <xsl:choose>
3147
3355
  <xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
3148
3356
  <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true']"/>
@@ -3162,15 +3370,15 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3162
3370
 
3163
3371
  </xsl:otherwise>
3164
3372
  </xsl:choose>
3165
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']/*[local-name()='name']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']/*[local-name()='name']" mode="process">
3373
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']"/><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="process">
3166
3374
  <xsl:apply-templates/>
3167
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="calculate-columns-numbers">
3375
+ </xsl:template><xsl:template name="calculate-columns-numbers">
3168
3376
  <xsl:param name="table-row"/>
3169
3377
  <xsl:variable name="columns-count" select="count($table-row/*)"/>
3170
3378
  <xsl:variable name="sum-colspans" select="sum($table-row/*/@colspan)"/>
3171
3379
  <xsl:variable name="columns-with-colspan" select="count($table-row/*[@colspan])"/>
3172
3380
  <xsl:value-of select="$columns-count + $sum-colspans - $columns-with-colspan"/>
3173
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="calculate-column-widths">
3381
+ </xsl:template><xsl:template name="calculate-column-widths">
3174
3382
  <xsl:param name="table"/>
3175
3383
  <xsl:param name="cols-count"/>
3176
3384
  <xsl:param name="curr-col" select="1"/>
@@ -3268,23 +3476,27 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3268
3476
  <xsl:with-param name="table" select="$table"/>
3269
3477
  </xsl:call-template>
3270
3478
  </xsl:if>
3271
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="text()" mode="td_text">
3479
+ </xsl:template><xsl:template match="text()" mode="td_text">
3272
3480
  <xsl:variable name="zero-space">​</xsl:variable>
3273
3481
  <xsl:value-of select="translate(., $zero-space, ' ')"/><xsl:text> </xsl:text>
3274
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='termsource']" mode="td_text">
3482
+ </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
3275
3483
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
3276
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='link']" mode="td_text">
3484
+ </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
3277
3485
  <xsl:value-of select="@target"/>
3278
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table2']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='thead']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='thead']" mode="process">
3486
+ </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
3279
3487
  <xsl:param name="cols-count"/>
3280
3488
  <!-- font-weight="bold" -->
3281
3489
  <fo:table-header>
3282
3490
 
3283
3491
  <xsl:apply-templates/>
3284
3492
  </fo:table-header>
3285
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tfoot']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tfoot']" mode="process">
3493
+ </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
3494
+ <fo:table-body>
3495
+ <xsl:apply-templates/>
3496
+ </fo:table-body>
3497
+ </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
3286
3498
  <xsl:apply-templates/>
3287
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="insertTableFooter">
3499
+ </xsl:template><xsl:template name="insertTableFooter">
3288
3500
  <xsl:param name="cols-count"/>
3289
3501
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3290
3502
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -3324,7 +3536,7 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3324
3536
  </fo:table-footer>
3325
3537
 
3326
3538
  </xsl:if>
3327
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tbody']">
3539
+ </xsl:template><xsl:template match="*[local-name()='tbody']">
3328
3540
 
3329
3541
  <xsl:variable name="cols-count">
3330
3542
  <xsl:choose>
@@ -3355,7 +3567,7 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3355
3567
 
3356
3568
  </fo:table-body>
3357
3569
 
3358
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tr']">
3570
+ </xsl:template><xsl:template match="*[local-name()='tr']">
3359
3571
  <xsl:variable name="parent-name" select="local-name(..)"/>
3360
3572
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
3361
3573
  <fo:table-row min-height="4mm">
@@ -3375,7 +3587,7 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3375
3587
 
3376
3588
  <xsl:apply-templates/>
3377
3589
  </fo:table-row>
3378
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='th']">
3590
+ </xsl:template><xsl:template match="*[local-name()='th']">
3379
3591
  <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
3380
3592
 
3381
3593
 
@@ -3398,7 +3610,7 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3398
3610
  <xsl:apply-templates/>
3399
3611
  </fo:block>
3400
3612
  </fo:table-cell>
3401
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='td']">
3613
+ </xsl:template><xsl:template match="*[local-name()='td']">
3402
3614
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
3403
3615
 
3404
3616
 
@@ -3436,7 +3648,7 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3436
3648
 
3437
3649
 
3438
3650
  </fo:table-cell>
3439
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']/*[local-name()='note']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']/*[local-name()='note']" mode="process">
3651
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
3440
3652
 
3441
3653
 
3442
3654
  <fo:block font-size="10pt" margin-bottom="12pt">
@@ -3447,6 +3659,11 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3447
3659
  <fo:inline padding-right="2mm">
3448
3660
 
3449
3661
 
3662
+ <xsl:variable name="title-note">
3663
+ <xsl:call-template name="getTitle">
3664
+ <xsl:with-param name="name" select="'title-note'"/>
3665
+ </xsl:call-template>
3666
+ </xsl:variable>
3450
3667
  <xsl:value-of select="$title-note"/>
3451
3668
 
3452
3669
 
@@ -3455,9 +3672,9 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3455
3672
  <xsl:apply-templates mode="process"/>
3456
3673
  </fo:block>
3457
3674
 
3458
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
3675
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
3459
3676
  <xsl:apply-templates/>
3460
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="fn_display">
3677
+ </xsl:template><xsl:template name="fn_display">
3461
3678
  <xsl:variable name="references">
3462
3679
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
3463
3680
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -3492,7 +3709,7 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3492
3709
  </fo:block>
3493
3710
  </xsl:if>
3494
3711
  </xsl:for-each>
3495
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="fn_name_display">
3712
+ </xsl:template><xsl:template name="fn_name_display">
3496
3713
  <!-- <xsl:variable name="references">
3497
3714
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
3498
3715
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -3508,7 +3725,7 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3508
3725
  <xsl:apply-templates/>
3509
3726
  </fo:block>
3510
3727
  </xsl:for-each>
3511
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="fn_display_figure">
3728
+ </xsl:template><xsl:template name="fn_display_figure">
3512
3729
  <xsl:variable name="key_iso">
3513
3730
  <!-- and (not(@class) or @class !='pseudocode') -->
3514
3731
  </xsl:variable>
@@ -3519,6 +3736,36 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3519
3736
  </fn>
3520
3737
  </xsl:for-each>
3521
3738
  </xsl:variable>
3739
+
3740
+ <!-- current hierarchy is 'figure' element -->
3741
+ <xsl:variable name="following_dl_colwidths">
3742
+ <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
3743
+ <xsl:variable name="html-table">
3744
+ <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
3745
+ <xsl:element name="{$ns}:table">
3746
+ <xsl:for-each select="*[local-name() = 'dl'][1]">
3747
+ <tbody>
3748
+ <xsl:apply-templates mode="dl"/>
3749
+ </tbody>
3750
+ </xsl:for-each>
3751
+ </xsl:element>
3752
+ </xsl:variable>
3753
+
3754
+ <xsl:call-template name="calculate-column-widths">
3755
+ <xsl:with-param name="cols-count" select="2"/>
3756
+ <xsl:with-param name="table" select="$html-table"/>
3757
+ </xsl:call-template>
3758
+
3759
+ </xsl:if>
3760
+ </xsl:variable>
3761
+
3762
+
3763
+ <xsl:variable name="maxlength_dt">
3764
+ <xsl:for-each select="*[local-name() = 'dl'][1]">
3765
+ <xsl:call-template name="getMaxLength_dt"/>
3766
+ </xsl:for-each>
3767
+ </xsl:variable>
3768
+
3522
3769
  <xsl:if test="xalan:nodeset($references)//fn">
3523
3770
  <fo:block>
3524
3771
  <fo:table width="95%" table-layout="fixed">
@@ -3526,8 +3773,19 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3526
3773
  <xsl:attribute name="font-size">10pt</xsl:attribute>
3527
3774
 
3528
3775
  </xsl:if>
3529
- <fo:table-column column-width="15%"/>
3530
- <fo:table-column column-width="85%"/>
3776
+ <xsl:choose>
3777
+ <!-- if there 'dl', then set same columns width -->
3778
+ <xsl:when test="xalan:nodeset($following_dl_colwidths)//column">
3779
+ <xsl:call-template name="setColumnWidth_dl">
3780
+ <xsl:with-param name="colwidths" select="$following_dl_colwidths"/>
3781
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
3782
+ </xsl:call-template>
3783
+ </xsl:when>
3784
+ <xsl:otherwise>
3785
+ <fo:table-column column-width="15%"/>
3786
+ <fo:table-column column-width="85%"/>
3787
+ </xsl:otherwise>
3788
+ </xsl:choose>
3531
3789
  <fo:table-body>
3532
3790
  <xsl:for-each select="xalan:nodeset($references)//fn">
3533
3791
  <xsl:variable name="reference" select="@reference"/>
@@ -3559,7 +3817,7 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3559
3817
  </fo:block>
3560
3818
  </xsl:if>
3561
3819
 
3562
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='fn']">
3820
+ </xsl:template><xsl:template match="*[local-name()='fn']">
3563
3821
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
3564
3822
  <fo:inline font-size="80%" keep-with-previous.within-line="always">
3565
3823
 
@@ -3571,11 +3829,11 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3571
3829
  <xsl:value-of select="@reference"/>
3572
3830
  </fo:basic-link>
3573
3831
  </fo:inline>
3574
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='fn']/*[local-name()='p']">
3832
+ </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
3575
3833
  <fo:inline>
3576
3834
  <xsl:apply-templates/>
3577
3835
  </fo:inline>
3578
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dl']">
3836
+ </xsl:template><xsl:template match="*[local-name()='dl']">
3579
3837
  <xsl:variable name="parent" select="local-name(..)"/>
3580
3838
 
3581
3839
  <xsl:variable name="key_iso">
@@ -3593,14 +3851,24 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3593
3851
 
3594
3852
 
3595
3853
 
3854
+ <xsl:variable name="title-where">
3855
+ <xsl:call-template name="getTitle">
3856
+ <xsl:with-param name="name" select="'title-where'"/>
3857
+ </xsl:call-template>
3858
+ </xsl:variable>
3596
3859
  <xsl:value-of select="$title-where"/>
3597
3860
  </fo:block>
3598
3861
  </xsl:when>
3599
3862
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
3600
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt">
3863
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
3601
3864
 
3602
3865
 
3603
3866
 
3867
+ <xsl:variable name="title-key">
3868
+ <xsl:call-template name="getTitle">
3869
+ <xsl:with-param name="name" select="'title-key'"/>
3870
+ </xsl:call-template>
3871
+ </xsl:variable>
3604
3872
  <xsl:value-of select="$title-key"/>
3605
3873
  </fo:block>
3606
3874
  </xsl:when>
@@ -3617,23 +3885,6 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3617
3885
 
3618
3886
 
3619
3887
 
3620
- <!-- create virtual html table for dl/[dt and dd] -->
3621
- <xsl:variable name="html-table">
3622
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
3623
- <xsl:element name="{$ns}:table">
3624
- <tbody>
3625
- <xsl:apply-templates mode="dl"/>
3626
- </tbody>
3627
- </xsl:element>
3628
- </xsl:variable>
3629
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
3630
- <xsl:variable name="colwidths">
3631
- <xsl:call-template name="calculate-column-widths">
3632
- <xsl:with-param name="cols-count" select="2"/>
3633
- <xsl:with-param name="table" select="$html-table"/>
3634
- </xsl:call-template>
3635
- </xsl:variable>
3636
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
3637
3888
 
3638
3889
  <fo:table width="95%" table-layout="fixed">
3639
3890
 
@@ -3646,42 +3897,30 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3646
3897
 
3647
3898
  </xsl:when>
3648
3899
  </xsl:choose>
3649
- <xsl:choose>
3650
- <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
3651
- <fo:table-column column-width="50%"/>
3652
- <fo:table-column column-width="50%"/>
3653
- </xsl:when>
3654
- <xsl:otherwise>
3655
- <xsl:choose>
3656
- <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
3657
- <fo:table-column column-width="60%"/>
3658
- <fo:table-column column-width="40%"/>
3659
- </xsl:when> -->
3660
- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.3">
3661
- <fo:table-column column-width="50%"/>
3662
- <fo:table-column column-width="50%"/>
3663
- </xsl:when>
3664
- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 0.5">
3665
- <fo:table-column column-width="40%"/>
3666
- <fo:table-column column-width="60%"/>
3667
- </xsl:when>
3668
- <xsl:otherwise>
3669
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
3670
- <xsl:choose>
3671
- <xsl:when test=". = 1 or . = 0">
3672
- <fo:table-column column-width="proportional-column-width(2)"/>
3673
- </xsl:when>
3674
- <xsl:otherwise>
3675
- <fo:table-column column-width="proportional-column-width({.})"/>
3676
- </xsl:otherwise>
3677
- </xsl:choose>
3678
- </xsl:for-each>
3679
- </xsl:otherwise>
3680
- </xsl:choose>
3681
- <!-- <fo:table-column column-width="15%"/>
3682
- <fo:table-column column-width="85%"/> -->
3683
- </xsl:otherwise>
3684
- </xsl:choose>
3900
+ <!-- create virtual html table for dl/[dt and dd] -->
3901
+ <xsl:variable name="html-table">
3902
+ <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
3903
+ <xsl:element name="{$ns}:table">
3904
+ <tbody>
3905
+ <xsl:apply-templates mode="dl"/>
3906
+ </tbody>
3907
+ </xsl:element>
3908
+ </xsl:variable>
3909
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
3910
+ <xsl:variable name="colwidths">
3911
+ <xsl:call-template name="calculate-column-widths">
3912
+ <xsl:with-param name="cols-count" select="2"/>
3913
+ <xsl:with-param name="table" select="$html-table"/>
3914
+ </xsl:call-template>
3915
+ </xsl:variable>
3916
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
3917
+ <xsl:variable name="maxlength_dt">
3918
+ <xsl:call-template name="getMaxLength_dt"/>
3919
+ </xsl:variable>
3920
+ <xsl:call-template name="setColumnWidth_dl">
3921
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3922
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
3923
+ </xsl:call-template>
3685
3924
  <fo:table-body>
3686
3925
  <xsl:apply-templates>
3687
3926
  <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
@@ -3691,7 +3930,61 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3691
3930
  </fo:block>
3692
3931
  </fo:block>
3693
3932
  </xsl:if>
3694
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dl']/*[local-name()='note']">
3933
+ </xsl:template><xsl:template name="setColumnWidth_dl">
3934
+ <xsl:param name="colwidths"/>
3935
+ <xsl:param name="maxlength_dt"/>
3936
+ <xsl:choose>
3937
+ <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
3938
+ <fo:table-column column-width="50%"/>
3939
+ <fo:table-column column-width="50%"/>
3940
+ </xsl:when>
3941
+ <xsl:otherwise>
3942
+ <xsl:choose>
3943
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
3944
+ <fo:table-column column-width="5%"/>
3945
+ <fo:table-column column-width="95%"/>
3946
+ </xsl:when>
3947
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
3948
+ <fo:table-column column-width="10%"/>
3949
+ <fo:table-column column-width="90%"/>
3950
+ </xsl:when>
3951
+ <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
3952
+ <fo:table-column column-width="60%"/>
3953
+ <fo:table-column column-width="40%"/>
3954
+ </xsl:when> -->
3955
+ <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.3">
3956
+ <fo:table-column column-width="50%"/>
3957
+ <fo:table-column column-width="50%"/>
3958
+ </xsl:when>
3959
+ <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 0.5">
3960
+ <fo:table-column column-width="40%"/>
3961
+ <fo:table-column column-width="60%"/>
3962
+ </xsl:when>
3963
+ <xsl:otherwise>
3964
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3965
+ <xsl:choose>
3966
+ <xsl:when test=". = 1 or . = 0">
3967
+ <fo:table-column column-width="proportional-column-width(2)"/>
3968
+ </xsl:when>
3969
+ <xsl:otherwise>
3970
+ <fo:table-column column-width="proportional-column-width({.})"/>
3971
+ </xsl:otherwise>
3972
+ </xsl:choose>
3973
+ </xsl:for-each>
3974
+ </xsl:otherwise>
3975
+ </xsl:choose>
3976
+ <!-- <fo:table-column column-width="15%"/>
3977
+ <fo:table-column column-width="85%"/> -->
3978
+ </xsl:otherwise>
3979
+ </xsl:choose>
3980
+ </xsl:template><xsl:template name="getMaxLength_dt">
3981
+ <xsl:for-each select="*[local-name()='dt']">
3982
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
3983
+ <xsl:if test="position() = 1">
3984
+ <xsl:value-of select="string-length(normalize-space(.))"/>
3985
+ </xsl:if>
3986
+ </xsl:for-each>
3987
+ </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']">
3695
3988
  <xsl:param name="key_iso"/>
3696
3989
 
3697
3990
  <!-- <tr>
@@ -3707,6 +4000,11 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3707
4000
  <xsl:if test="normalize-space($key_iso) = 'true'">
3708
4001
  <xsl:attribute name="margin-top">0</xsl:attribute>
3709
4002
  </xsl:if>
4003
+ <xsl:variable name="title-note">
4004
+ <xsl:call-template name="getTitle">
4005
+ <xsl:with-param name="name" select="'title-note'"/>
4006
+ </xsl:call-template>
4007
+ </xsl:variable>
3710
4008
  <xsl:value-of select="$title-note"/>
3711
4009
  </fo:block>
3712
4010
  </fo:table-cell>
@@ -3716,7 +4014,7 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3716
4014
  </fo:block>
3717
4015
  </fo:table-cell>
3718
4016
  </fo:table-row>
3719
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dt']" mode="dl">
4017
+ </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl">
3720
4018
  <tr>
3721
4019
  <td>
3722
4020
  <xsl:apply-templates/>
@@ -3727,7 +4025,7 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3727
4025
  </td>
3728
4026
  </tr>
3729
4027
 
3730
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dt']">
4028
+ </xsl:template><xsl:template match="*[local-name()='dt']">
3731
4029
  <xsl:param name="key_iso"/>
3732
4030
 
3733
4031
  <fo:table-row>
@@ -3746,7 +4044,11 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3746
4044
 
3747
4045
 
3748
4046
  <xsl:apply-templates/>
3749
-
4047
+ <!-- <xsl:if test="$namespace = 'gb'">
4048
+ <xsl:if test="ancestor::*[local-name()='formula']">
4049
+ <xsl:text>—</xsl:text>
4050
+ </xsl:if>
4051
+ </xsl:if> -->
3750
4052
  </fo:block>
3751
4053
  </fo:table-cell>
3752
4054
  <fo:table-cell>
@@ -3758,37 +4060,37 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3758
4060
  </fo:table-cell>
3759
4061
  </fo:table-row>
3760
4062
 
3761
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dd']" mode="dl"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dd']" mode="dl_process">
4063
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
3762
4064
  <xsl:apply-templates/>
3763
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dd']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dd']" mode="process">
4065
+ </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
3764
4066
  <xsl:apply-templates/>
3765
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
4067
+ </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
3766
4068
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
3767
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='em']">
4069
+ </xsl:template><xsl:template match="*[local-name()='em']">
3768
4070
  <fo:inline font-style="italic">
3769
4071
  <xsl:apply-templates/>
3770
4072
  </fo:inline>
3771
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='strong']">
4073
+ </xsl:template><xsl:template match="*[local-name()='strong']">
3772
4074
  <fo:inline font-weight="bold">
3773
4075
  <xsl:apply-templates/>
3774
4076
  </fo:inline>
3775
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='sup']">
4077
+ </xsl:template><xsl:template match="*[local-name()='sup']">
3776
4078
  <fo:inline font-size="80%" vertical-align="super">
3777
4079
  <xsl:apply-templates/>
3778
4080
  </fo:inline>
3779
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='sub']">
4081
+ </xsl:template><xsl:template match="*[local-name()='sub']">
3780
4082
  <fo:inline font-size="80%" vertical-align="sub">
3781
4083
  <xsl:apply-templates/>
3782
4084
  </fo:inline>
3783
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tt']">
4085
+ </xsl:template><xsl:template match="*[local-name()='tt']">
3784
4086
  <fo:inline font-family="Courier" font-size="10pt">
3785
4087
  <xsl:apply-templates/>
3786
4088
  </fo:inline>
3787
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='del']">
4089
+ </xsl:template><xsl:template match="*[local-name()='del']">
3788
4090
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
3789
4091
  <xsl:apply-templates/>
3790
4092
  </fo:inline>
3791
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="text()[ancestor::*[local-name()='smallcap']]">
4093
+ </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
3792
4094
  <xsl:variable name="text" select="normalize-space(.)"/>
3793
4095
  <fo:inline font-size="75%">
3794
4096
  <xsl:if test="string-length($text) &gt; 0">
@@ -3797,10 +4099,11 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3797
4099
  </xsl:call-template>
3798
4100
  </xsl:if>
3799
4101
  </fo:inline>
3800
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="recursiveSmallCaps">
4102
+ </xsl:template><xsl:template name="recursiveSmallCaps">
3801
4103
  <xsl:param name="text"/>
3802
4104
  <xsl:variable name="char" select="substring($text,1,1)"/>
3803
- <xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/>
4105
+ <!-- <xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/> -->
4106
+ <xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
3804
4107
  <xsl:choose>
3805
4108
  <xsl:when test="$char=$upperCase">
3806
4109
  <fo:inline font-size="{100 div 0.75}%">
@@ -3816,7 +4119,7 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3816
4119
  <xsl:with-param name="text" select="substring($text,2)"/>
3817
4120
  </xsl:call-template>
3818
4121
  </xsl:if>
3819
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="tokenize">
4122
+ </xsl:template><xsl:template name="tokenize">
3820
4123
  <xsl:param name="text"/>
3821
4124
  <xsl:param name="separator" select="' '"/>
3822
4125
  <xsl:choose>
@@ -3864,7 +4167,7 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3864
4167
  </xsl:call-template>
3865
4168
  </xsl:otherwise>
3866
4169
  </xsl:choose>
3867
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="max_length">
4170
+ </xsl:template><xsl:template name="max_length">
3868
4171
  <xsl:param name="words"/>
3869
4172
  <xsl:for-each select="$words//word">
3870
4173
  <xsl:sort select="." data-type="number" order="descending"/>
@@ -3872,11 +4175,11 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3872
4175
  <xsl:value-of select="."/>
3873
4176
  </xsl:if>
3874
4177
  </xsl:for-each>
3875
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="add-zero-spaces-java">
4178
+ </xsl:template><xsl:template name="add-zero-spaces-java">
3876
4179
  <xsl:param name="text" select="."/>
3877
4180
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
3878
4181
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
3879
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="add-zero-spaces">
4182
+ </xsl:template><xsl:template name="add-zero-spaces">
3880
4183
  <xsl:param name="text" select="."/>
3881
4184
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
3882
4185
  <xsl:variable name="zero-space-after-dot">.</xsl:variable>
@@ -3929,7 +4232,7 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3929
4232
  <xsl:value-of select="$text"/>
3930
4233
  </xsl:otherwise>
3931
4234
  </xsl:choose>
3932
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="add-zero-spaces-equal">
4235
+ </xsl:template><xsl:template name="add-zero-spaces-equal">
3933
4236
  <xsl:param name="text" select="."/>
3934
4237
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
3935
4238
  <xsl:variable name="zero-space-after-equal">=</xsl:variable>
@@ -3955,7 +4258,7 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3955
4258
  <xsl:value-of select="$text"/>
3956
4259
  </xsl:otherwise>
3957
4260
  </xsl:choose>
3958
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="getSimpleTable">
4261
+ </xsl:template><xsl:template name="getSimpleTable">
3959
4262
  <xsl:variable name="simple-table">
3960
4263
 
3961
4264
  <!-- Step 1. colspan processing -->
@@ -3982,9 +4285,9 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
3982
4285
  </xsl:choose> -->
3983
4286
  </xsl:variable>
3984
4287
  <xsl:copy-of select="$simple-table"/>
3985
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
4288
+ </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
3986
4289
  <xsl:apply-templates mode="simple-table-colspan"/>
3987
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='fn']" mode="simple-table-colspan"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='th'] | *[local-name()='td']" mode="simple-table-colspan">
4290
+ </xsl:template><xsl:template match="*[local-name()='fn']" mode="simple-table-colspan"/><xsl:template match="*[local-name()='th'] | *[local-name()='td']" mode="simple-table-colspan">
3988
4291
  <xsl:choose>
3989
4292
  <xsl:when test="@colspan">
3990
4293
  <xsl:variable name="td">
@@ -4006,16 +4309,16 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
4006
4309
  </xsl:element>
4007
4310
  </xsl:otherwise>
4008
4311
  </xsl:choose>
4009
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="@colspan" mode="simple-table-colspan"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tr']" mode="simple-table-colspan">
4312
+ </xsl:template><xsl:template match="@colspan" mode="simple-table-colspan"/><xsl:template match="*[local-name()='tr']" mode="simple-table-colspan">
4010
4313
  <xsl:element name="tr">
4011
4314
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
4012
4315
  <xsl:apply-templates mode="simple-table-colspan"/>
4013
4316
  </xsl:element>
4014
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="@*|node()" mode="simple-table-colspan">
4317
+ </xsl:template><xsl:template match="@*|node()" mode="simple-table-colspan">
4015
4318
  <xsl:copy>
4016
4319
  <xsl:apply-templates select="@*|node()" mode="simple-table-colspan"/>
4017
4320
  </xsl:copy>
4018
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="repeatNode">
4321
+ </xsl:template><xsl:template name="repeatNode">
4019
4322
  <xsl:param name="count"/>
4020
4323
  <xsl:param name="node"/>
4021
4324
 
@@ -4026,18 +4329,18 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
4026
4329
  </xsl:call-template>
4027
4330
  <xsl:copy-of select="$node"/>
4028
4331
  </xsl:if>
4029
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="@*|node()" mode="simple-table-rowspan">
4332
+ </xsl:template><xsl:template match="@*|node()" mode="simple-table-rowspan">
4030
4333
  <xsl:copy>
4031
4334
  <xsl:apply-templates select="@*|node()" mode="simple-table-rowspan"/>
4032
4335
  </xsl:copy>
4033
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="tbody" mode="simple-table-rowspan">
4336
+ </xsl:template><xsl:template match="tbody" mode="simple-table-rowspan">
4034
4337
  <xsl:copy>
4035
4338
  <xsl:copy-of select="tr[1]"/>
4036
4339
  <xsl:apply-templates select="tr[2]" mode="simple-table-rowspan">
4037
4340
  <xsl:with-param name="previousRow" select="tr[1]"/>
4038
4341
  </xsl:apply-templates>
4039
4342
  </xsl:copy>
4040
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="tr" mode="simple-table-rowspan">
4343
+ </xsl:template><xsl:template match="tr" mode="simple-table-rowspan">
4041
4344
  <xsl:param name="previousRow"/>
4042
4345
  <xsl:variable name="currentRow" select="."/>
4043
4346
 
@@ -4071,43 +4374,53 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
4071
4374
  <xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan">
4072
4375
  <xsl:with-param name="previousRow" select="$newRow"/>
4073
4376
  </xsl:apply-templates>
4074
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="getLang">
4377
+ </xsl:template><xsl:template name="getLang">
4075
4378
  <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4076
4379
  <xsl:choose>
4077
4380
  <xsl:when test="$language = 'English'">en</xsl:when>
4078
4381
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
4079
4382
  </xsl:choose>
4080
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="capitalizeWords">
4383
+ </xsl:template><xsl:template name="capitalizeWords">
4081
4384
  <xsl:param name="str"/>
4082
4385
  <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
4083
4386
  <xsl:choose>
4084
4387
  <xsl:when test="contains($str2, ' ')">
4085
4388
  <xsl:variable name="substr" select="substring-before($str2, ' ')"/>
4086
- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
4087
- <xsl:value-of select="substring($substr, 2)"/>
4389
+ <!-- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
4390
+ <xsl:value-of select="substring($substr, 2)"/> -->
4391
+ <xsl:call-template name="capitalize">
4392
+ <xsl:with-param name="str" select="$substr"/>
4393
+ </xsl:call-template>
4088
4394
  <xsl:text> </xsl:text>
4089
4395
  <xsl:call-template name="capitalizeWords">
4090
4396
  <xsl:with-param name="str" select="substring-after($str2, ' ')"/>
4091
4397
  </xsl:call-template>
4092
4398
  </xsl:when>
4093
4399
  <xsl:otherwise>
4094
- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
4095
- <xsl:value-of select="substring($str2, 2)"/>
4400
+ <!-- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
4401
+ <xsl:value-of select="substring($str2, 2)"/> -->
4402
+ <xsl:call-template name="capitalize">
4403
+ <xsl:with-param name="str" select="$str2"/>
4404
+ </xsl:call-template>
4096
4405
  </xsl:otherwise>
4097
4406
  </xsl:choose>
4098
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="mathml:math">
4407
+ </xsl:template><xsl:template name="capitalize">
4408
+ <xsl:param name="str"/>
4409
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
4410
+ <xsl:value-of select="substring($str, 2)"/>
4411
+ </xsl:template><xsl:template match="mathml:math">
4099
4412
  <fo:inline font-family="STIX2Math">
4100
4413
  <fo:instream-foreign-object fox:alt-text="Math">
4101
4414
  <xsl:copy-of select="."/>
4102
4415
  </fo:instream-foreign-object>
4103
4416
  </fo:inline>
4104
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='localityStack']">
4417
+ </xsl:template><xsl:template match="*[local-name()='localityStack']">
4105
4418
  <xsl:for-each select="*[local-name()='locality']">
4106
4419
  <xsl:if test="position() =1"><xsl:text>, </xsl:text></xsl:if>
4107
4420
  <xsl:apply-templates select="."/>
4108
4421
  <xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if>
4109
4422
  </xsl:for-each>
4110
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='link']" name="link">
4423
+ </xsl:template><xsl:template match="*[local-name()='link']" name="link">
4111
4424
  <xsl:variable name="target">
4112
4425
  <xsl:choose>
4113
4426
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
@@ -4137,7 +4450,7 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
4137
4450
  </xsl:otherwise>
4138
4451
  </xsl:choose>
4139
4452
  </fo:inline>
4140
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='sourcecode']" name="sourcecode">
4453
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
4141
4454
  <fo:block xsl:use-attribute-sets="sourcecode-style">
4142
4455
  <!-- <xsl:choose>
4143
4456
  <xsl:when test="@lang = 'en'"></xsl:when>
@@ -4148,19 +4461,29 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
4148
4461
  </xsl:choose> -->
4149
4462
  <xsl:apply-templates/>
4150
4463
  </fo:block>
4151
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='bookmark']">
4464
+ </xsl:template><xsl:template match="*[local-name()='bookmark']">
4152
4465
  <fo:inline id="{@id}"/>
4153
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']">
4466
+ </xsl:template><xsl:template match="*[local-name()='appendix']">
4154
4467
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
4468
+ <xsl:variable name="title-appendix">
4469
+ <xsl:call-template name="getTitle">
4470
+ <xsl:with-param name="name" select="'title-appendix'"/>
4471
+ </xsl:call-template>
4472
+ </xsl:variable>
4155
4473
  <fo:inline padding-right="5mm"><xsl:value-of select="$title-appendix"/> <xsl:number/></fo:inline>
4156
4474
  <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
4157
4475
  </fo:block>
4158
4476
  <xsl:apply-templates/>
4159
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
4477
+ </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
4160
4478
  <fo:inline><xsl:apply-templates/></fo:inline>
4161
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']//*[local-name()='example']">
4479
+ </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']">
4162
4480
  <fo:block xsl:use-attribute-sets="appendix-example-style">
4163
4481
  <xsl:variable name="claims_id" select="ancestor::*[local-name()='clause'][1]/@id"/>
4482
+ <xsl:variable name="title-example">
4483
+ <xsl:call-template name="getTitle">
4484
+ <xsl:with-param name="name" select="'title-example'"/>
4485
+ </xsl:call-template>
4486
+ </xsl:variable>
4164
4487
  <xsl:value-of select="$title-example"/>
4165
4488
  <xsl:if test="count(ancestor::*[local-name()='clause'][1]//*[local-name()='example']) &gt; 1">
4166
4489
  <xsl:number count="*[local-name()='example'][ancestor::*[local-name()='clause'][@id = $claims_id]]" level="any"/><xsl:text> </xsl:text>
@@ -4170,11 +4493,11 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
4170
4493
  </xsl:if>
4171
4494
  </fo:block>
4172
4495
  <xsl:apply-templates/>
4173
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']//*[local-name()='example']/*[local-name()='name']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']//*[local-name()='example']/*[local-name()='name']" mode="process">
4496
+ </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']/*[local-name()='name']"/><xsl:template match="*[local-name()='appendix']//*[local-name()='example']/*[local-name()='name']" mode="process">
4174
4497
  <fo:inline><xsl:apply-templates/></fo:inline>
4175
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name() = 'callout']">
4498
+ </xsl:template><xsl:template match="*[local-name() = 'callout']">
4176
4499
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
4177
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name() = 'annotation']">
4500
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']">
4178
4501
  <xsl:variable name="annotation-id" select="@id"/>
4179
4502
  <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
4180
4503
  <fo:block id="{$annotation-id}" white-space="nowrap">
@@ -4184,14 +4507,25 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
4184
4507
  </xsl:apply-templates>
4185
4508
  </fo:inline>
4186
4509
  </fo:block>
4187
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name() = 'annotation']/*[local-name() = 'p']">
4510
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
4188
4511
  <xsl:param name="callout"/>
4189
4512
  <fo:inline id="{@id}">
4190
4513
  <!-- for first p in annotation, put <x> -->
4191
4514
  <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
4192
4515
  <xsl:apply-templates/>
4193
4516
  </fo:inline>
4194
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="convertDate">
4517
+ </xsl:template><xsl:template match="*[local-name() = 'modification']">
4518
+ <xsl:variable name="title-modified">
4519
+ <xsl:call-template name="getTitle">
4520
+ <xsl:with-param name="name" select="'title-modified'"/>
4521
+ </xsl:call-template>
4522
+ </xsl:variable>
4523
+ <xsl:choose>
4524
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
4525
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
4526
+ </xsl:choose>
4527
+ <xsl:apply-templates/>
4528
+ </xsl:template><xsl:template name="convertDate">
4195
4529
  <xsl:param name="date"/>
4196
4530
  <xsl:param name="format" select="'short'"/>
4197
4531
  <xsl:variable name="year" select="substring($date, 1, 4)"/>
@@ -4224,7 +4558,7 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
4224
4558
  </xsl:choose>
4225
4559
  </xsl:variable>
4226
4560
  <xsl:value-of select="$result"/>
4227
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="insertKeywords">
4561
+ </xsl:template><xsl:template name="insertKeywords">
4228
4562
  <xsl:param name="sorting" select="'true'"/>
4229
4563
  <xsl:param name="charAtEnd" select="'.'"/>
4230
4564
  <xsl:param name="charDelim" select="', '"/>
@@ -4247,7 +4581,7 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
4247
4581
  </xsl:for-each>
4248
4582
  </xsl:otherwise>
4249
4583
  </xsl:choose>
4250
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="insertKeyword">
4584
+ </xsl:template><xsl:template name="insertKeyword">
4251
4585
  <xsl:param name="charAtEnd"/>
4252
4586
  <xsl:param name="charDelim"/>
4253
4587
  <xsl:apply-templates/>
@@ -4255,4 +4589,105 @@ JP5/AQYA3Lt5kGz07MoAAAAASUVORK5CYII=
4255
4589
  <xsl:when test="position() != last()"><xsl:value-of select="$charDelim"/></xsl:when>
4256
4590
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
4257
4591
  </xsl:choose>
4592
+ </xsl:template><xsl:template name="addPDFUAmeta">
4593
+ <fo:declarations>
4594
+ <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4595
+ <pdf:dictionary type="normal" key="ViewerPreferences">
4596
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
4597
+ </pdf:dictionary>
4598
+ </pdf:catalog>
4599
+ <x:xmpmeta xmlns:x="adobe:ns:meta/">
4600
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
4601
+ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
4602
+ <!-- Dublin Core properties go here -->
4603
+ <dc:title>
4604
+ <xsl:variable name="title">
4605
+
4606
+
4607
+ <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en']"/>
4608
+
4609
+
4610
+
4611
+ </xsl:variable>
4612
+ <xsl:choose>
4613
+ <xsl:when test="normalize-space($title) != ''">
4614
+ <xsl:value-of select="$title"/>
4615
+ </xsl:when>
4616
+ <xsl:otherwise>
4617
+ <xsl:text> </xsl:text>
4618
+ </xsl:otherwise>
4619
+ </xsl:choose>
4620
+ </dc:title>
4621
+ <dc:creator>
4622
+
4623
+
4624
+ </dc:creator>
4625
+ <dc:description>
4626
+ <xsl:variable name="abstract">
4627
+
4628
+
4629
+
4630
+
4631
+ <xsl:copy-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'abstract']//text()"/>
4632
+
4633
+ </xsl:variable>
4634
+ <xsl:value-of select="normalize-space($abstract)"/>
4635
+ </dc:description>
4636
+ <pdf:Keywords>
4637
+ <xsl:call-template name="insertKeywords"/>
4638
+ </pdf:Keywords>
4639
+ </rdf:Description>
4640
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
4641
+ <!-- XMP properties go here -->
4642
+ <xmp:CreatorTool/>
4643
+ </rdf:Description>
4644
+ </rdf:RDF>
4645
+ </x:xmpmeta>
4646
+ </fo:declarations>
4647
+ </xsl:template><xsl:template name="getId">
4648
+ <xsl:choose>
4649
+ <xsl:when test="../@id">
4650
+ <xsl:value-of select="../@id"/>
4651
+ </xsl:when>
4652
+ <xsl:otherwise>
4653
+ <!-- <xsl:value-of select="concat(local-name(..), '_', text())"/> -->
4654
+ <xsl:value-of select="concat(generate-id(..), '_', text())"/>
4655
+ </xsl:otherwise>
4656
+ </xsl:choose>
4657
+ </xsl:template><xsl:template name="getLevel">
4658
+ <xsl:variable name="level_total" select="count(ancestor::*)"/>
4659
+ <xsl:variable name="level">
4660
+ <xsl:choose>
4661
+ <xsl:when test="ancestor::*[local-name() = 'preface']">
4662
+ <xsl:value-of select="$level_total - 2"/>
4663
+ </xsl:when>
4664
+ <xsl:when test="ancestor::*[local-name() = 'sections']">
4665
+ <xsl:value-of select="$level_total - 2"/>
4666
+ </xsl:when>
4667
+ <xsl:when test="ancestor::*[local-name() = 'bibliography']">
4668
+ <xsl:value-of select="$level_total - 2"/>
4669
+ </xsl:when>
4670
+ <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
4671
+ <xsl:otherwise>
4672
+ <xsl:value-of select="$level_total - 1"/>
4673
+ </xsl:otherwise>
4674
+ </xsl:choose>
4675
+ </xsl:variable>
4676
+ <xsl:value-of select="$level"/>
4677
+ </xsl:template><xsl:template name="getSubSection">
4678
+ <xsl:number format=".1" level="multiple" count="*[local-name() = 'clause']/*[local-name() = 'clause'] | *[local-name() = 'clause']/*[local-name() = 'terms'] | *[local-name() = 'terms']/*[local-name() = 'term'] | *[local-name() = 'clause']/*[local-name() = 'term'] | *[local-name() = 'terms']/*[local-name() = 'clause'] | *[local-name() = 'terms']/*[local-name() = 'definitions'] | *[local-name() = 'definitions']/*[local-name() = 'clause'] | *[local-name() = 'clause']/*[local-name() = 'definitions'] | *[local-name() = 'definitions']/*[local-name() = 'definitions'] | *[local-name() = 'clause']/*[local-name() = 'references']"/>
4679
+ </xsl:template><xsl:template name="split">
4680
+ <xsl:param name="pText" select="."/>
4681
+ <xsl:param name="sep" select="','"/>
4682
+ <xsl:if test="string-length($pText) &gt;0">
4683
+ <item>
4684
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4685
+ </item>
4686
+ <xsl:call-template name="split">
4687
+ <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
4688
+ <xsl:with-param name="sep" select="$sep"/>
4689
+ </xsl:call-template>
4690
+ </xsl:if>
4691
+ </xsl:template><xsl:template name="getDocumentId">
4692
+ <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
4258
4693
  </xsl:template></xsl:stylesheet>