metanorma-ogc 1.0.8 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macos.yml +0 -1
  3. data/.github/workflows/ubuntu.yml +10 -7
  4. data/.github/workflows/windows.yml +0 -1
  5. data/Rakefile +2 -0
  6. data/lib/asciidoctor/ogc/biblio.rng +1 -1
  7. data/lib/asciidoctor/ogc/converter.rb +11 -16
  8. data/lib/asciidoctor/ogc/isodoc.rng +427 -0
  9. data/lib/asciidoctor/ogc/reqt.rng +23 -0
  10. data/lib/isodoc/ogc.rb +2 -0
  11. data/lib/isodoc/ogc/base_convert.rb +11 -55
  12. data/lib/isodoc/ogc/html/_coverpage.css +195 -0
  13. data/lib/isodoc/ogc/html/htmlstyle.css +1084 -0
  14. data/lib/isodoc/ogc/html/ogc.css +835 -0
  15. data/lib/isodoc/ogc/html/wordstyle.css +1253 -0
  16. data/lib/isodoc/ogc/html/wordstyle.scss +0 -1
  17. data/lib/isodoc/ogc/html_convert.rb +0 -5
  18. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +874 -310
  19. data/lib/isodoc/ogc/ogc.best-practice.xsl +874 -310
  20. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +874 -310
  21. data/lib/isodoc/ogc/ogc.community-practice.xsl +874 -310
  22. data/lib/isodoc/ogc/ogc.community-standard.xsl +874 -310
  23. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +874 -310
  24. data/lib/isodoc/ogc/ogc.engineering-report.xsl +874 -310
  25. data/lib/isodoc/ogc/ogc.other.xsl +874 -310
  26. data/lib/isodoc/ogc/ogc.policy.xsl +874 -310
  27. data/lib/isodoc/ogc/ogc.reference-model.xsl +874 -310
  28. data/lib/isodoc/ogc/ogc.release-notes.xsl +874 -310
  29. data/lib/isodoc/ogc/ogc.standard.xsl +874 -310
  30. data/lib/isodoc/ogc/ogc.test-suite.xsl +874 -310
  31. data/lib/isodoc/ogc/ogc.user-guide.xsl +874 -310
  32. data/lib/isodoc/ogc/ogc.white-paper.xsl +874 -310
  33. data/lib/isodoc/ogc/pdf_convert.rb +0 -13
  34. data/lib/isodoc/ogc/presentation_xml_convert.rb +10 -0
  35. data/lib/isodoc/ogc/reqt.rb +10 -5
  36. data/lib/isodoc/ogc/sections.rb +9 -8
  37. data/lib/isodoc/ogc/word_convert.rb +4 -9
  38. data/lib/isodoc/ogc/{reqt_xref.rb → xref.rb} +67 -5
  39. data/lib/metanorma/ogc/processor.rb +6 -8
  40. data/lib/metanorma/ogc/version.rb +1 -1
  41. data/metanorma-ogc.gemspec +2 -1
  42. metadata +28 -10
@@ -1153,4 +1153,3 @@ ol
1153
1153
  ul
1154
1154
  {margin-bottom:0cm;
1155
1155
  margin-left:18pt;}
1156
-
@@ -12,7 +12,6 @@ module IsoDoc
12
12
  class HtmlConvert < IsoDoc::HtmlConvert
13
13
  def initialize(options)
14
14
  @libdir = File.dirname(__FILE__)
15
- @reqtlabels = {}
16
15
  super
17
16
  end
18
17
 
@@ -33,10 +32,6 @@ module IsoDoc
33
32
  }
34
33
  end
35
34
 
36
- def metadata_init(lang, script, labels)
37
- @meta = Metadata.new(lang, script, labels)
38
- end
39
-
40
35
  def googlefonts
41
36
  <<~HEAD.freeze
42
37
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet" />
@@ -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:ogc="https://www.metanorma.org/ns/ogc" 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:ogc="https://www.metanorma.org/ns/ogc" 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="no"/>
4
4
 
@@ -18,7 +18,7 @@
18
18
  <xsl:text>© </xsl:text>
19
19
  <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:copyright/ogc:from"/>
20
20
  <xsl:text> </xsl:text>
21
- <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor/ogc:organization/ogc:name"/>
21
+ <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type = 'publisher']/ogc:organization/ogc:name"/>
22
22
  </xsl:variable>
23
23
 
24
24
  <xsl:variable name="doctitle" select="/ogc:ogc-standard/ogc:bibdata/ogc:title[@language = 'en']"/>
@@ -47,6 +47,7 @@
47
47
  </xsl:apply-templates>
48
48
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:foreword" mode="contents">
49
49
  <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ 1"/>
50
+
50
51
  </xsl:apply-templates>
51
52
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:introduction" mode="contents"/>
52
53
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name" mode="contents">
@@ -56,6 +57,12 @@
56
57
  <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ count(/ogc:ogc-standard/ogc:preface/ogc:foreword) + count(/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name) + 1"/>
57
58
  </xsl:apply-templates>
58
59
 
60
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'submitters']" mode="contents">
61
+ <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ count(/ogc:ogc-standard/ogc:preface/ogc:foreword) + count(/ogc:ogc-standard/ogc:preface/ogc:introduction) + count(/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name) + count(/ogc:ogc-standard/ogc:preface/ogc:submitters)"/>
62
+ </xsl:apply-templates>
63
+
64
+
65
+
59
66
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']" mode="contents">
60
67
  <xsl:with-param name="sectionNum" select="'1'"/>
61
68
  </xsl:apply-templates>
@@ -65,22 +72,22 @@
65
72
  </xsl:apply-templates>
66
73
 
67
74
  <!-- Normative references -->
68
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references']" mode="contents">
75
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']" mode="contents">
69
76
  <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + 1"/>
70
77
  </xsl:apply-templates>
71
78
 
72
79
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:terms" mode="contents"> <!-- Terms and definitions -->
73
- <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references']) + 1"/>
80
+ <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']) + 1"/>
74
81
  </xsl:apply-templates>
75
82
 
76
83
 
77
84
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/*[local-name() != 'terms' and not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]" mode="contents">
78
- <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references']) + count(/ogc:ogc-standard/ogc:sections/ogc:terms)"/>
85
+ <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']) + count(/ogc:ogc-standard/ogc:sections/ogc:terms)"/>
79
86
  </xsl:apply-templates>
80
87
 
81
88
 
82
89
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:annex" mode="contents"/>
83
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id != '_normative_references' and @id != '_references']" mode="contents"/> <!-- [position() &gt; 1] -->
90
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']" mode="contents"/> <!-- [position() &gt; 1] -->
84
91
 
85
92
 
86
93
  </contents>
@@ -91,7 +98,7 @@
91
98
  </xsl:variable>
92
99
 
93
100
  <xsl:template match="/">
94
- <xsl:message>INFO: Document namespace: '<xsl:value-of select="namespace-uri(/*)"/>'</xsl:message>
101
+ <xsl:call-template name="namespaceCheck"/>
95
102
  <fo:root font-family="Times New Roman, STIX2Math, HanSans" font-size="10.5pt" xml:lang="{$lang}">
96
103
  <fo:layout-master-set>
97
104
  <!-- Cover page -->
@@ -161,44 +168,7 @@
161
168
 
162
169
  </fo:layout-master-set>
163
170
 
164
- <fo:declarations>
165
- <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
166
- <pdf:dictionary type="normal" key="ViewerPreferences">
167
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
168
- </pdf:dictionary>
169
- </pdf:catalog>
170
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
171
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
172
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
173
- <!-- Dublin Core properties go here -->
174
- <dc:title>
175
- <xsl:choose>
176
- <xsl:when test="$doctitle != ''">
177
- <xsl:value-of select="$doctitle"/>
178
- </xsl:when>
179
- <xsl:otherwise>
180
- <xsl:text> </xsl:text>
181
- </xsl:otherwise>
182
- </xsl:choose>
183
- </dc:title>
184
- <dc:creator/>
185
- <dc:description>
186
- <xsl:variable name="abstract">
187
- <xsl:copy-of select="/ogc:ogc-standard/ogc:bibdata/ogc:abstract//text()"/>
188
- </xsl:variable>
189
- <xsl:value-of select="normalize-space($abstract)"/>
190
- </dc:description>
191
- <pdf:Keywords>
192
- <xsl:call-template name="insertKeywords"/>
193
- </pdf:Keywords>
194
- </rdf:Description>
195
- <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
196
- <!-- XMP properties go here -->
197
- <xmp:CreatorTool/>
198
- </rdf:Description>
199
- </rdf:RDF>
200
- </x:xmpmeta>
201
- </fo:declarations>
171
+ <xsl:call-template name="addPDFUAmeta"/>
202
172
 
203
173
  <!-- Cover Page -->
204
174
  <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
@@ -274,7 +244,7 @@
274
244
  </fo:block>
275
245
  </fo:block>
276
246
  <fo:block font-size="24pt" font-weight="bold" text-align="center" margin-top="15pt" line-height="115%">
277
- <xsl:text>OGC </xsl:text><xsl:value-of select="$doctitle"/>
247
+ <xsl:value-of select="$doctitle"/>
278
248
  </fo:block>
279
249
  <fo:block margin-bottom="12pt"> </fo:block>
280
250
  <!-- Copyright notice -->
@@ -287,6 +257,16 @@
287
257
  <fo:table-column column-width="35mm"/>
288
258
  <fo:table-column column-width="70mm"/>
289
259
  <fo:table-body>
260
+ <fo:table-row height="9mm">
261
+ <fo:table-cell>
262
+ <fo:block>Document number: </fo:block>
263
+ </fo:table-cell>
264
+ <fo:table-cell>
265
+ <fo:block>
266
+ <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:docnumber"/>
267
+ </fo:block>
268
+ </fo:table-cell>
269
+ </fo:table-row>
290
270
  <fo:table-row height="9mm">
291
271
  <fo:table-cell>
292
272
  <fo:block>Document type: </fo:block>
@@ -295,6 +275,18 @@
295
275
  <fo:block line-height-shift-adjustment="disregard-shifts">OGC<fo:inline font-size="65%" vertical-align="super">®</fo:inline><xsl:text> </xsl:text><xsl:value-of select="$doctype"/></fo:block>
296
276
  </fo:table-cell>
297
277
  </fo:table-row>
278
+ <fo:table-row height="9mm">
279
+ <fo:table-cell>
280
+ <fo:block>Document subtype: </fo:block>
281
+ </fo:table-cell>
282
+ <fo:table-cell>
283
+ <fo:block>
284
+ <xsl:call-template name="capitalizeWords">
285
+ <xsl:with-param name="str" select="/ogc:ogc-standard/ogc:bibdata/ogc:ext/ogc:docsubtype"/>
286
+ </xsl:call-template>
287
+ </fo:block>
288
+ </fo:table-cell>
289
+ </fo:table-row>
298
290
  <fo:table-row height="9mm">
299
291
  <fo:table-cell>
300
292
  <fo:block>Document stage: </fo:block>
@@ -302,8 +294,9 @@
302
294
  <fo:table-cell>
303
295
  <fo:block>
304
296
  <xsl:variable name="stage" select="/ogc:ogc-standard/ogc:bibdata/ogc:status/ogc:stage"/>
305
- <xsl:value-of select="translate(substring($stage, 1, 1), $lower, $upper)"/>
306
- <xsl:value-of select="substring($stage, 2)"/>
297
+ <xsl:call-template name="capitalize">
298
+ <xsl:with-param name="str" select="$stage"/>
299
+ </xsl:call-template>
307
300
  </fo:block>
308
301
  </fo:table-cell>
309
302
  </fo:table-row>
@@ -312,7 +305,11 @@
312
305
  <fo:block>Document language: </fo:block>
313
306
  </fo:table-cell>
314
307
  <fo:table-cell>
315
- <fo:block><xsl:value-of select="$lang"/></fo:block>
308
+ <fo:block>
309
+ <xsl:call-template name="getLanguage">
310
+ <xsl:with-param name="lang" select="$lang"/>
311
+ </xsl:call-template>
312
+ </fo:block>
316
313
  </fo:table-cell>
317
314
  </fo:table-row>
318
315
  </fo:table-body>
@@ -348,8 +345,13 @@
348
345
  <fo:block> </fo:block>
349
346
  <fo:block break-after="page"/>
350
347
 
351
- <fo:block-container font-weight="bold" line-height="115%">
352
- <fo:block font-size="14pt" margin-top="2pt" margin-bottom="15.5pt">Contents</fo:block>
348
+ <fo:block-container font-weight="bold" line-height="115%" margin-bottom="36pt">
349
+ <xsl:variable name="title-toc">
350
+ <xsl:call-template name="getTitle">
351
+ <xsl:with-param name="name" select="'title-toc'"/>
352
+ </xsl:call-template>
353
+ </xsl:variable>
354
+ <fo:block font-size="14pt" margin-top="2pt" margin-bottom="15.5pt"><xsl:value-of select="$title-toc"/></fo:block>
353
355
 
354
356
  <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true' and @level &lt;= 2]"><!-- skip clause from preface [not(@level = 2 and starts-with(@section, '0'))] -->
355
357
 
@@ -398,7 +400,12 @@
398
400
  <xsl:if test="xalan:nodeset($contents)//item[@type = 'table']">
399
401
  <fo:block font-size="12pt"> </fo:block>
400
402
  <fo:block font-size="12pt"> </fo:block>
401
- <fo:block font-size="14pt" font-weight="bold" space-before="48pt" margin-bottom="15.5pt">List of Tables</fo:block>
403
+ <xsl:variable name="title-list-tables">
404
+ <xsl:call-template name="getTitle">
405
+ <xsl:with-param name="name" select="'title-list-tables'"/>
406
+ </xsl:call-template>
407
+ </xsl:variable>
408
+ <fo:block font-size="14pt" font-weight="bold" space-before="48pt" margin-bottom="15.5pt"><xsl:value-of select="$title-list-tables"/></fo:block>
402
409
  <xsl:for-each select="xalan:nodeset($contents)//item[@type = 'table']">
403
410
  <fo:block text-align-last="justify" margin-top="6pt">
404
411
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{@section}">
@@ -420,7 +427,12 @@
420
427
  <xsl:if test="xalan:nodeset($contents)//item[@type = 'figure']">
421
428
  <fo:block font-size="12pt"> </fo:block>
422
429
  <fo:block font-size="12pt"> </fo:block>
423
- <fo:block font-size="14pt" font-weight="bold" space-before="48pt" margin-bottom="15.5pt">List of Figures</fo:block>
430
+ <xsl:variable name="title-list-figures">
431
+ <xsl:call-template name="getTitle">
432
+ <xsl:with-param name="name" select="'title-list-figures'"/>
433
+ </xsl:call-template>
434
+ </xsl:variable>
435
+ <fo:block font-size="14pt" font-weight="bold" space-before="48pt" margin-bottom="15.5pt"><xsl:value-of select="$title-list-figures"/></fo:block>
424
436
  <xsl:for-each select="xalan:nodeset($contents)//item[@type = 'figure']">
425
437
  <fo:block text-align-last="justify" margin-top="6pt">
426
438
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{@section}">
@@ -458,6 +470,10 @@
458
470
  <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ count(/ogc:ogc-standard/ogc:preface/ogc:foreword) + count(/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name) + 1"/>
459
471
  </xsl:apply-templates>
460
472
 
473
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'submitters']">
474
+ <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ count(/ogc:ogc-standard/ogc:preface/ogc:foreword) + count(/ogc:ogc-standard/ogc:preface/ogc:introduction) + count(/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name) + count(/ogc:ogc-standard/ogc:preface/ogc:submitters)"/>
475
+ </xsl:apply-templates>
476
+
461
477
 
462
478
  </fo:flow>
463
479
  </fo:page-sequence>
@@ -489,22 +505,22 @@
489
505
  </xsl:apply-templates>
490
506
 
491
507
  <!-- Normative references -->
492
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references']">
508
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']">
493
509
  <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + 1"/>
494
510
  </xsl:apply-templates>
495
511
 
496
512
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:terms"> <!-- Terms and definitions -->
497
- <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references']) + 1"/>
513
+ <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']) + 1"/>
498
514
  </xsl:apply-templates>
499
515
 
500
516
 
501
517
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/*[local-name() != 'terms' and not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]">
502
- <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references']) + count(/ogc:ogc-standard/ogc:sections/ogc:terms)"/>
518
+ <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']) + count(/ogc:ogc-standard/ogc:sections/ogc:terms)"/>
503
519
  </xsl:apply-templates>
504
520
 
505
521
 
506
522
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:annex"/>
507
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id != '_normative_references' and @id != '_references']"/> <!-- [position() &gt; 1] -->
523
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']"/> <!-- [position() &gt; 1] -->
508
524
 
509
525
  </fo:block>
510
526
  </fo:flow>
@@ -579,6 +595,25 @@
579
595
  </xsl:apply-templates>
580
596
  </xsl:template>
581
597
 
598
+ <xsl:template match="ogc:ogc-standard/ogc:preface/ogc:clause" mode="contents">
599
+ <xsl:param name="sectionNum"/>
600
+ <xsl:param name="sectionNumSkew" select="0"/>
601
+ <xsl:variable name="sectionNum_">
602
+ <xsl:choose>
603
+ <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
604
+ <xsl:when test="$sectionNumSkew != 0">
605
+ <xsl:variable name="number"><xsl:number count="ogc:clause"/></xsl:variable>
606
+ <xsl:value-of select="$number + $sectionNumSkew"/>
607
+ </xsl:when>
608
+ <xsl:otherwise>
609
+ <xsl:number count="*"/>
610
+ </xsl:otherwise>
611
+ </xsl:choose>
612
+ </xsl:variable>
613
+ <xsl:apply-templates mode="contents">
614
+ <xsl:with-param name="sectionNum" select="$sectionNum_"/>
615
+ </xsl:apply-templates>
616
+ </xsl:template>
582
617
 
583
618
  <!-- Any node with title element - clause, definition, annex,... -->
584
619
  <xsl:template match="ogc:title | ogc:preferred" mode="contents">
@@ -641,7 +676,7 @@
641
676
 
642
677
  </xsl:template>
643
678
 
644
- <xsl:template match="ogc:ogc-standard/ogc:preface/*" mode="contents">
679
+ <xsl:template match="ogc:ogc-standard/ogc:preface/*[not(local-name() = 'clause')]" mode="contents">
645
680
  <xsl:param name="sectionNum" select="'1'"/>
646
681
  <xsl:variable name="section">
647
682
  <xsl:number format="i" value="$sectionNum"/>
@@ -664,7 +699,9 @@
664
699
  <xsl:choose>
665
700
  <xsl:when test="not(ogc:title)">
666
701
  <xsl:variable name="name" select="local-name()"/>
667
- <xsl:value-of select="translate(substring($name, 1, 1), $lower, $upper)"/><xsl:value-of select="substring($name, 2)"/>
702
+ <xsl:call-template name="capitalize">
703
+ <xsl:with-param name="str" select="$name"/>
704
+ </xsl:call-template>
668
705
  </xsl:when>
669
706
  <xsl:otherwise>
670
707
  <xsl:value-of select="ogc:title"/>
@@ -684,7 +721,12 @@
684
721
  <xsl:number format="i" value="$sectionNum"/>
685
722
  </xsl:variable>
686
723
  <item id="keywords" level="1" section="{$section}" display-section="true" display="true" type="abstract" root="preface">
687
- <xsl:text>Keywords</xsl:text>
724
+ <xsl:variable name="title-keywords">
725
+ <xsl:call-template name="getTitle">
726
+ <xsl:with-param name="name" select="'title-keywords'"/>
727
+ </xsl:call-template>
728
+ </xsl:variable>
729
+ <xsl:value-of select="$title-keywords"/>
688
730
  </item>
689
731
  </xsl:template>
690
732
  <!-- Submitting Organizations -->
@@ -694,7 +736,12 @@
694
736
  <xsl:number format="i" value="$sectionNum"/>
695
737
  </xsl:variable>
696
738
  <item id="submitting_orgs" level="1" section="{$section}" display-section="true" display="true" type="abstract" root="preface">
697
- <xsl:text>Submitting Organizations</xsl:text>
739
+ <xsl:variable name="title-submitting-organizations">
740
+ <xsl:call-template name="getTitle">
741
+ <xsl:with-param name="name" select="'title-submitting-organizations'"/>
742
+ </xsl:call-template>
743
+ </xsl:variable>
744
+ <xsl:value-of select="$title-submitting-organizations"/>
698
745
  </item>
699
746
  </xsl:template>
700
747
 
@@ -702,7 +749,12 @@
702
749
  <xsl:param name="sectionNum"/>
703
750
  <item level="" id="{@id}" type="figure">
704
751
  <xsl:attribute name="section">
705
- <xsl:text>Figure </xsl:text>
752
+ <xsl:variable name="title-figure">
753
+ <xsl:call-template name="getTitle">
754
+ <xsl:with-param name="name" select="'title-figure'"/>
755
+ </xsl:call-template>
756
+ </xsl:variable>
757
+ <xsl:value-of select="$title-figure"/>
706
758
  <xsl:choose>
707
759
  <xsl:when test="ancestor::ogc:annex">
708
760
  <xsl:choose>
@@ -731,13 +783,17 @@
731
783
  </xsl:template>
732
784
 
733
785
 
734
-
735
786
  <xsl:template match="ogc:table[not(@unnumbered='true')]" mode="contents">
736
787
  <xsl:param name="sectionNum"/>
737
788
  <xsl:variable name="annex-id" select="ancestor::ogc:annex/@id"/>
738
789
  <item level="" id="{@id}" display="false" type="table">
739
790
  <xsl:attribute name="section">
740
- <xsl:text>Table </xsl:text>
791
+ <xsl:variable name="title-table">
792
+ <xsl:call-template name="getTitle">
793
+ <xsl:with-param name="name" select="'title-table'"/>
794
+ </xsl:call-template>
795
+ </xsl:variable>
796
+ <xsl:value-of select="$title-table"/>
741
797
  <xsl:choose>
742
798
  <xsl:when test="ancestor::*[local-name()='executivesummary']">
743
799
  <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered='true')]"/>
@@ -760,7 +816,12 @@
760
816
  <xsl:template match="ogc:formula" mode="contents">
761
817
  <item level="" id="{@id}" display="false">
762
818
  <xsl:attribute name="section">
763
- <xsl:text>Formula (</xsl:text><xsl:number format="A.1" level="multiple" count="ogc:annex | ogc:formula"/><xsl:text>)</xsl:text>
819
+ <xsl:variable name="title-formula">
820
+ <xsl:call-template name="getTitle">
821
+ <xsl:with-param name="name" select="'title-formula'"/>
822
+ </xsl:call-template>
823
+ </xsl:variable>
824
+ <xsl:value-of select="$title-formula"/><xsl:number format="(A.1)" level="multiple" count="ogc:annex | ogc:formula"/>
764
825
  </xsl:attribute>
765
826
  </item>
766
827
  </xsl:template>
@@ -778,7 +839,12 @@
778
839
 
779
840
  <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:edition">
780
841
  <fo:block margin-bottom="12pt">
781
- <xsl:text>Version: </xsl:text>
842
+ <xsl:variable name="title-edition">
843
+ <xsl:call-template name="getTitle">
844
+ <xsl:with-param name="name" select="'title-edition'"/>
845
+ </xsl:call-template>
846
+ </xsl:variable>
847
+ <xsl:value-of select="$title-edition"/><xsl:text>: </xsl:text>
782
848
  <xsl:value-of select="."/><xsl:text> </xsl:text>
783
849
  </fo:block>
784
850
  </xsl:template>
@@ -817,7 +883,7 @@
817
883
  <xsl:attribute name="text-align">
818
884
  <xsl:choose>
819
885
  <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
820
- <xsl:otherwise>left</xsl:otherwise>
886
+ <xsl:otherwise>center</xsl:otherwise>
821
887
  </xsl:choose>
822
888
  </xsl:attribute>
823
889
  <xsl:apply-templates/>
@@ -892,17 +958,26 @@
892
958
  <fo:block id="{$id}" font-size="13pt" font-weight="bold" margin-bottom="12pt" color="rgb(14, 26, 133)">
893
959
  <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="3mm"> </fo:inline>
894
960
  <xsl:variable name="name" select="local-name()"/>
895
- <xsl:value-of select="translate(substring($name, 1, 1), $lower, $upper)"/><xsl:value-of select="substring($name, 2)"/>
961
+ <xsl:call-template name="capitalize">
962
+ <xsl:with-param name="str" select="$name"/>
963
+ </xsl:call-template>
896
964
  </fo:block>
897
965
  </xsl:if>
898
- <xsl:apply-templates/>
966
+ <xsl:apply-templates>
967
+ <xsl:with-param name="sectionNum" select="$sectionNum"/>
968
+ </xsl:apply-templates>
899
969
  </xsl:template>
900
970
  <!-- Keywords -->
901
971
  <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:keyword">
902
972
  <xsl:param name="sectionNum" select="'1'"/>
903
973
  <fo:block id="keywords" font-size="13pt" font-weight="bold" margin-top="13.5pt" margin-bottom="12pt" color="rgb(14, 26, 133)">
904
974
  <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="2mm"> </fo:inline>
905
- <xsl:text>Keywords</xsl:text>
975
+ <xsl:variable name="title-keywords">
976
+ <xsl:call-template name="getTitle">
977
+ <xsl:with-param name="name" select="'title-keywords'"/>
978
+ </xsl:call-template>
979
+ </xsl:variable>
980
+ <xsl:value-of select="$title-keywords"/>
906
981
  </fo:block>
907
982
  <fo:block margin-bottom="12pt">The following are keywords to be used by search engines and document catalogues.</fo:block>
908
983
  <fo:block margin-bottom="12pt">
@@ -921,7 +996,12 @@
921
996
  <xsl:param name="sectionNum" select="'1'"/>
922
997
  <fo:block id="submitting_orgs" font-size="13pt" font-weight="bold" color="rgb(14, 26, 133)" margin-top="13.5pt" margin-bottom="12pt">
923
998
  <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="3mm"> </fo:inline>
924
- <xsl:text>Submitting Organizations</xsl:text>
999
+ <xsl:variable name="title-submitting-organizations">
1000
+ <xsl:call-template name="getTitle">
1001
+ <xsl:with-param name="name" select="'title-submitting-organizations'"/>
1002
+ </xsl:call-template>
1003
+ </xsl:variable>
1004
+ <xsl:value-of select="$title-submitting-organizations"/>
925
1005
  </fo:block>
926
1006
  <fo:block margin-bottom="12pt">The following organizations submitted this Document to the Open Geospatial Consortium (OGC):</fo:block>
927
1007
  <fo:list-block provisional-distance-between-starts="6.5mm" margin-bottom="12pt" line-height="115%">
@@ -973,6 +1053,25 @@
973
1053
  </fo:block>
974
1054
  </xsl:template>
975
1055
 
1056
+ <xsl:template match="ogc:ogc-standard/ogc:preface/ogc:clause">
1057
+ <xsl:param name="sectionNum"/>
1058
+ <xsl:param name="sectionNumSkew" select="0"/>
1059
+ <xsl:variable name="sectionNum_">
1060
+ <xsl:choose>
1061
+ <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
1062
+ <xsl:when test="$sectionNumSkew != 0">
1063
+ <xsl:variable name="number"><xsl:number count="ogc:clause"/></xsl:variable>
1064
+ <xsl:value-of select="$number + $sectionNumSkew"/>
1065
+ </xsl:when>
1066
+ <xsl:otherwise>
1067
+ <xsl:number count="*"/>
1068
+ </xsl:otherwise>
1069
+ </xsl:choose>
1070
+ </xsl:variable>
1071
+ <xsl:apply-templates>
1072
+ <xsl:with-param name="sectionNum" select="$sectionNum_"/>
1073
+ </xsl:apply-templates>
1074
+ </xsl:template>
976
1075
 
977
1076
 
978
1077
  <xsl:template match="ogc:clause//ogc:clause[not(ogc:title)]">
@@ -1114,10 +1213,13 @@
1114
1213
  </xsl:attribute>
1115
1214
  <xsl:attribute name="space-after">
1116
1215
  <xsl:choose>
1117
- <xsl:when test="ancestor::ogc:li">0pt</xsl:when>
1216
+ <xsl:when test="ancestor::ogc:li">0pt</xsl:when>
1118
1217
  <xsl:otherwise>12pt</xsl:otherwise>
1119
1218
  </xsl:choose>
1120
1219
  </xsl:attribute>
1220
+ <xsl:if test="ancestor::ogc:dd and not(ancestor::ogc:table)">
1221
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1222
+ </xsl:if>
1121
1223
  <xsl:attribute name="line-height">115%</xsl:attribute>
1122
1224
  <xsl:apply-templates/>
1123
1225
  </xsl:element>
@@ -1139,7 +1241,7 @@
1139
1241
  <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
1140
1242
  </fn>
1141
1243
  -->
1142
- <xsl:template match="ogc:title/ogc:fn | ogc:p/ogc:fn[not(ancestor::ogc:table)]" priority="2">
1244
+ <xsl:template match="ogc:title/ogc:fn | ogc:p/ogc:fn[not(ancestor::ogc:table)] | ogc:p/*/ogc:fn[not(ancestor::ogc:table)] | ogc:sourcecode/ogc:fn[not(ancestor::ogc:table)]" priority="2">
1143
1245
  <fo:footnote keep-with-previous.within-line="always">
1144
1246
  <xsl:variable name="number" select="@reference"/>
1145
1247
 
@@ -1185,10 +1287,6 @@
1185
1287
  </xsl:template>
1186
1288
 
1187
1289
  <xsl:template match="ogc:figure">
1188
- <xsl:variable name="title">
1189
- <xsl:text>Figure </xsl:text>
1190
- </xsl:variable>
1191
-
1192
1290
  <fo:block-container id="{@id}">
1193
1291
  <fo:block>
1194
1292
  <xsl:apply-templates/>
@@ -1198,7 +1296,11 @@
1198
1296
  <xsl:call-template name="note"/>
1199
1297
  </xsl:for-each>
1200
1298
  <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-top="12pt" margin-bottom="6pt" keep-with-previous="always">
1201
-
1299
+ <xsl:variable name="title-figure">
1300
+ <xsl:call-template name="getTitle">
1301
+ <xsl:with-param name="name" select="'title-figure'"/>
1302
+ </xsl:call-template>
1303
+ </xsl:variable>
1202
1304
  <xsl:choose>
1203
1305
  <xsl:when test="ancestor::ogc:annex">
1204
1306
  <xsl:choose>
@@ -1206,13 +1308,13 @@
1206
1308
  <xsl:number format="a) "/>
1207
1309
  </xsl:when>
1208
1310
  <xsl:otherwise>
1209
- <xsl:value-of select="$title"/><xsl:number format="A.1-1" level="multiple" count="ogc:annex | ogc:figure"/>
1311
+ <xsl:value-of select="$title-figure"/><xsl:number format="A.1-1" level="multiple" count="ogc:annex | ogc:figure"/>
1210
1312
  </xsl:otherwise>
1211
1313
  </xsl:choose>
1212
1314
 
1213
1315
  </xsl:when>
1214
1316
  <xsl:otherwise>
1215
- <xsl:value-of select="$title"/><xsl:number format="1" level="any" count="ogc:sourcecode[not(@unnumbered='true') and not(ancestor::ogc:example)] | ogc:figure"/>
1317
+ <xsl:value-of select="$title-figure"/><xsl:number format="1" level="any" count="ogc:sourcecode[not(@unnumbered='true') and not(ancestor::ogc:example)] | ogc:figure"/>
1216
1318
  </xsl:otherwise>
1217
1319
  </xsl:choose>
1218
1320
  <xsl:if test="ogc:name">
@@ -1295,13 +1397,13 @@
1295
1397
  </xsl:choose>
1296
1398
  </xsl:variable>
1297
1399
  <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super"> <!-- 60% baseline-shift="35%" -->
1298
- <fo:basic-link internal-destination="footnote_{../@id}" fox:alt-text="footnote {$number}">
1400
+ <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
1299
1401
  <xsl:value-of select="$number"/><!-- <xsl:text>)</xsl:text> -->
1300
1402
  </fo:basic-link>
1301
1403
  </fo:inline>
1302
1404
  <fo:footnote-body>
1303
1405
  <fo:block font-size="10pt" margin-bottom="12pt" start-indent="0pt">
1304
- <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" -->
1406
+ <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" -->
1305
1407
  <xsl:value-of select="$number"/><!-- <xsl:text>)</xsl:text> -->
1306
1408
  </fo:inline>
1307
1409
  <xsl:apply-templates/>
@@ -1368,6 +1470,14 @@
1368
1470
  </fo:list-item>
1369
1471
  </xsl:template>
1370
1472
 
1473
+ <xsl:template match="ogc:term">
1474
+ <xsl:param name="sectionNum"/>
1475
+ <fo:block id="{@id}">
1476
+ <xsl:apply-templates>
1477
+ <xsl:with-param name="sectionNum" select="$sectionNum"/>
1478
+ </xsl:apply-templates>
1479
+ </fo:block>
1480
+ </xsl:template>
1371
1481
 
1372
1482
  <xsl:template match="ogc:preferred">
1373
1483
  <xsl:param name="sectionNum"/>
@@ -1387,7 +1497,7 @@
1387
1497
  </xsl:variable>
1388
1498
  <fo:block font-size="{$font-size}">
1389
1499
  <fo:block font-weight="bold" keep-with-next="always">
1390
- <fo:inline id="{../@id}">
1500
+ <fo:inline>
1391
1501
  <xsl:value-of select="$section"/><xsl:text>.</xsl:text>
1392
1502
  </fo:inline>
1393
1503
  </fo:block>
@@ -1404,7 +1514,12 @@
1404
1514
  </xsl:template>
1405
1515
 
1406
1516
  <xsl:template match="ogc:deprecates">
1407
- <fo:block>DEPRECATED: <xsl:apply-templates/></fo:block>
1517
+ <xsl:variable name="title-deprecated">
1518
+ <xsl:call-template name="getTitle">
1519
+ <xsl:with-param name="name" select="'title-deprecated'"/>
1520
+ </xsl:call-template>
1521
+ </xsl:variable>
1522
+ <fo:block><xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/></fo:block>
1408
1523
  </xsl:template>
1409
1524
 
1410
1525
  <xsl:template match="ogc:definition[preceding-sibling::ogc:domain]">
@@ -1425,7 +1540,14 @@
1425
1540
  <fo:block margin-bottom="12pt" keep-with-previous="always">
1426
1541
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
1427
1542
  <fo:basic-link internal-destination="{ogc:origin/@bibitemid}" fox:alt-text="{ogc:origin/@citeas}">
1428
- <xsl:text>[SOURCE: </xsl:text>
1543
+ <xsl:text>[</xsl:text>
1544
+ <xsl:variable name="title-source">
1545
+ <xsl:call-template name="getTitle">
1546
+ <xsl:with-param name="name" select="'title-source'"/>
1547
+ </xsl:call-template>
1548
+ </xsl:variable>
1549
+ <xsl:value-of select="$title-source"/>
1550
+ <xsl:text>: </xsl:text>
1429
1551
  <fo:inline color="blue" text-decoration="underline">
1430
1552
  <xsl:value-of select="ogc:origin/@citeas"/>
1431
1553
 
@@ -1438,19 +1560,20 @@
1438
1560
  </fo:block>
1439
1561
  </xsl:template>
1440
1562
 
1441
- <xsl:template match="ogc:modification">
1442
- <xsl:text>, modified — </xsl:text>
1443
- <xsl:apply-templates/>
1444
- </xsl:template>
1563
+
1445
1564
  <xsl:template match="ogc:modification/ogc:p">
1446
1565
  <fo:inline><xsl:apply-templates/></fo:inline>
1447
1566
  </xsl:template>
1448
1567
 
1449
1568
  <xsl:template match="ogc:termnote">
1450
1569
  <fo:block font-size="10pt" margin-bottom="12pt">
1451
- <xsl:text>Note </xsl:text>
1452
- <xsl:number/>
1453
- <xsl:text> to entry: </xsl:text>
1570
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
1571
+ <xsl:variable name="title-note-to-entry">
1572
+ <xsl:call-template name="getTitle">
1573
+ <xsl:with-param name="name" select="'title-note-to-entry'"/>
1574
+ </xsl:call-template>
1575
+ </xsl:variable>
1576
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($title-note-to-entry),'#',$num)"/>
1454
1577
  <xsl:apply-templates/>
1455
1578
  </fo:block>
1456
1579
  </xsl:template>
@@ -1466,7 +1589,12 @@
1466
1589
 
1467
1590
  <xsl:template match="ogc:termexample">
1468
1591
  <fo:block font-size="10pt" margin-bottom="12pt">
1469
- <fo:inline padding-right="10mm">EXAMPLE</fo:inline>
1592
+ <xsl:variable name="title-example">
1593
+ <xsl:call-template name="getTitle">
1594
+ <xsl:with-param name="name" select="'title-example'"/>
1595
+ </xsl:call-template>
1596
+ </xsl:variable>
1597
+ <fo:inline padding-right="10mm"><xsl:value-of select="normalize-space($title-example)"/></fo:inline>
1470
1598
  <xsl:apply-templates/>
1471
1599
  </fo:block>
1472
1600
  </xsl:template>
@@ -1483,7 +1611,7 @@
1483
1611
 
1484
1612
 
1485
1613
  <!-- [position() &gt; 1] -->
1486
- <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references']">
1614
+ <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']">
1487
1615
  <fo:block break-after="page"/>
1488
1616
  <fo:block line-height="120%">
1489
1617
  <xsl:apply-templates/>
@@ -1493,7 +1621,7 @@
1493
1621
 
1494
1622
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
1495
1623
  <!-- <xsl:template match="ogc:references[@id = '_bibliography']/ogc:bibitem"> [position() &gt; 1] -->
1496
- <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references']/ogc:bibitem">
1624
+ <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']/ogc:bibitem">
1497
1625
  <fo:list-block margin-bottom="12pt" provisional-distance-between-starts="12mm">
1498
1626
  <fo:list-item>
1499
1627
  <fo:list-item-label end-indent="label-end()">
@@ -1566,10 +1694,10 @@
1566
1694
  </xsl:template>
1567
1695
 
1568
1696
  <!-- <xsl:template match="ogc:references[@id = '_bibliography']/ogc:bibitem" mode="contents"/> [position() &gt; 1] -->
1569
- <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references']/ogc:bibitem" mode="contents"/>
1697
+ <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']/ogc:bibitem" mode="contents"/>
1570
1698
 
1571
1699
  <!-- <xsl:template match="ogc:references[@id = '_bibliography']/ogc:bibitem/ogc:title"> [position() &gt; 1]-->
1572
- <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references']/ogc:bibitem/ogc:title">
1700
+ <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']/ogc:bibitem/ogc:title">
1573
1701
  <fo:inline font-style="italic">
1574
1702
  <xsl:apply-templates/>
1575
1703
  </fo:inline>
@@ -1595,7 +1723,7 @@
1595
1723
 
1596
1724
  <xsl:template match="ogc:source">
1597
1725
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
1598
- <xsl:value-of select="@citeas" disable-output-escaping="yes"/>
1726
+ <xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" -->
1599
1727
  <xsl:apply-templates select="ogc:localityStack"/>
1600
1728
  </fo:basic-link>
1601
1729
  </xsl:template>
@@ -1610,6 +1738,17 @@
1610
1738
  <!-- </xsl:if> -->
1611
1739
  <xsl:variable name="type" select="xalan:nodeset($contents)//item[@id = current()/@target]/@type"/>
1612
1740
  <xsl:variable name="root" select="xalan:nodeset($contents)//item[@id = current()/@target]/@root"/>
1741
+
1742
+ <xsl:variable name="title-clause">
1743
+ <xsl:call-template name="getTitle">
1744
+ <xsl:with-param name="name" select="'title-clause'"/>
1745
+ </xsl:call-template>
1746
+ </xsl:variable>
1747
+ <xsl:variable name="title-annex">
1748
+ <xsl:call-template name="getTitle">
1749
+ <xsl:with-param name="name" select="'title-annex'"/>
1750
+ </xsl:call-template>
1751
+ </xsl:variable>
1613
1752
 
1614
1753
  <xsl:choose>
1615
1754
  <xsl:when test="normalize-space(.) != ''">
@@ -1617,9 +1756,9 @@
1617
1756
  </xsl:when>
1618
1757
  <xsl:otherwise>
1619
1758
  <xsl:choose>
1620
- <xsl:when test="$type = 'clause' and $root != 'annex'">Clause </xsl:when><!-- and not (ancestor::annex) -->
1621
- <xsl:when test="$type = 'term' and ($root = 'clause' or $root = 'terms')">Clause </xsl:when>
1622
- <xsl:when test="$type = 'clause' and $root = 'annex'">Annex </xsl:when>
1759
+ <xsl:when test="$type = 'clause' and $root != 'annex'"><xsl:value-of select="$title-clause"/></xsl:when><!-- and not (ancestor::annex) -->
1760
+ <xsl:when test="$type = 'term' and ($root = 'clause' or $root = 'terms')"><xsl:value-of select="$title-clause"/></xsl:when>
1761
+ <xsl:when test="$type = 'clause' and $root = 'annex'"><xsl:value-of select="$title-annex"/></xsl:when>
1623
1762
  <xsl:otherwise/> <!-- <xsl:value-of select="$type"/> -->
1624
1763
  </xsl:choose>
1625
1764
  <xsl:value-of select="$section"/>
@@ -1630,19 +1769,24 @@
1630
1769
 
1631
1770
  <xsl:template match="ogc:sourcecode" priority="2">
1632
1771
  <xsl:call-template name="sourcecode"/>
1772
+ <xsl:variable name="title-figure">
1773
+ <xsl:call-template name="getTitle">
1774
+ <xsl:with-param name="name" select="'title-figure'"/>
1775
+ </xsl:call-template>
1776
+ </xsl:variable>
1633
1777
  <xsl:choose>
1634
1778
  <xsl:when test="@unnumbered='true'"/>
1635
1779
  <xsl:when test="ancestor::ogc:example"/>
1636
1780
  <xsl:when test="ancestor::ogc:td"/>
1637
1781
  <xsl:when test="ancestor::ogc:annex">
1638
- <xsl:variable name="id_annex" select="ancestor::ogc:annex/@id"/>
1782
+ <xsl:variable name="id_annex" select="ancestor::ogc:annex/@id"/>
1639
1783
  <xsl:choose>
1640
1784
  <xsl:when test="count(//ogc:annex) = 1">
1641
1785
  <xsl:value-of select="/ogc:nist-standard/ogc:bibdata/ogc:ext/ogc:structuredidentifier/ogc:annexid"/><xsl:number format="-1" level="any" count="ogc:annex//ogc:sourcecode"/>
1642
1786
  </xsl:when>
1643
1787
  <xsl:otherwise>
1644
1788
  <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="12pt">
1645
- <xsl:text>Figure </xsl:text>
1789
+ <xsl:value-of select="$title-figure"/>
1646
1790
  <xsl:number format="A." level="multiple" count="ogc:annex"/>
1647
1791
  <xsl:number format="1" level="any" count="ogc:sourcecode[ancestor::ogc:annex/@id = $id_annex and not(@unnumbered='true') and not(ancestor::ogc:example)]"/>
1648
1792
  <xsl:if test="ogc:name">
@@ -1655,7 +1799,7 @@
1655
1799
  </xsl:when>
1656
1800
  <xsl:otherwise>
1657
1801
  <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="12pt">
1658
- <xsl:text>Figure </xsl:text>
1802
+ <xsl:value-of select="$title-figure"/>
1659
1803
  <xsl:number format="1" level="any" count="ogc:sourcecode[not(@unnumbered='true') and not(ancestor::ogc:example)] | ogc:figure"/>
1660
1804
  <xsl:if test="ogc:name">
1661
1805
  <xsl:text> — </xsl:text>
@@ -1679,8 +1823,13 @@
1679
1823
  <xsl:template match="ogc:sourcecode/ogc:name"/>
1680
1824
 
1681
1825
  <xsl:template match="ogc:example">
1682
- <fo:block font-size="10pt" margin-top="12pt" margin-bottom="12pt" font-weight="bold" keep-with-next="always">
1683
- <xsl:text>EXAMPLE</xsl:text>
1826
+ <fo:block font-size="10pt" text-align="center" margin-top="12pt" margin-bottom="12pt" font-weight="bold" keep-with-next="always">
1827
+ <xsl:variable name="title-example">
1828
+ <xsl:call-template name="getTitle">
1829
+ <xsl:with-param name="name" select="'title-example'"/>
1830
+ </xsl:call-template>
1831
+ </xsl:variable>
1832
+ <xsl:value-of select="normalize-space($title-example)"/>
1684
1833
  <xsl:if test="following-sibling::ogc:example or preceding-sibling::ogc:example">
1685
1834
  <xsl:number format=" 1"/>
1686
1835
  </xsl:if>
@@ -1711,7 +1860,12 @@
1711
1860
  </xsl:if>
1712
1861
  <xsl:variable name="clauseid" select="ancestor::ogc:clause[1]/@id"/>
1713
1862
  <fo:inline padding-right="4mm">
1714
- <xsl:text>NOTE </xsl:text>
1863
+ <xsl:variable name="title-note">
1864
+ <xsl:call-template name="getTitle">
1865
+ <xsl:with-param name="name" select="'title-note'"/>
1866
+ </xsl:call-template>
1867
+ </xsl:variable>
1868
+ <xsl:value-of select="$title-note"/>
1715
1869
  <xsl:if test="count(//ogc:note[ancestor::ogc:clause[1][@id = $clauseid]]) &gt; 1">
1716
1870
  <xsl:number count="ogc:note[ancestor::ogc:clause[1][@id = $clauseid]]" level="any"/>
1717
1871
  </xsl:if>
@@ -1738,7 +1892,7 @@
1738
1892
  </xsl:if> -->
1739
1893
  <xsl:choose>
1740
1894
  <xsl:when test="@citeas and normalize-space(text()) = ''">
1741
- <xsl:value-of select="@citeas" disable-output-escaping="yes"/>
1895
+ <xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" -->
1742
1896
  </xsl:when>
1743
1897
  <xsl:when test="@bibitemid and normalize-space(text()) = ''">
1744
1898
  <xsl:value-of select="//ogc:bibitem[@id = current()/@bibitemid]/ogc:docidentifier"/>
@@ -1751,9 +1905,19 @@
1751
1905
  </xsl:template>
1752
1906
 
1753
1907
  <xsl:template match="ogc:locality">
1908
+ <xsl:variable name="title-clause">
1909
+ <xsl:call-template name="getTitle">
1910
+ <xsl:with-param name="name" select="'title-clause'"/>
1911
+ </xsl:call-template>
1912
+ </xsl:variable>
1913
+ <xsl:variable name="title-annex">
1914
+ <xsl:call-template name="getTitle">
1915
+ <xsl:with-param name="name" select="'title-annex'"/>
1916
+ </xsl:call-template>
1917
+ </xsl:variable>
1754
1918
  <xsl:choose>
1755
- <xsl:when test="@type ='clause'">Clause </xsl:when>
1756
- <xsl:when test="@type ='annex'">Annex </xsl:when>
1919
+ <xsl:when test="@type ='clause'"><xsl:value-of select="$title-clause"/></xsl:when>
1920
+ <xsl:when test="@type ='annex'"><xsl:value-of select="$title-annex"/></xsl:when>
1757
1921
  <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
1758
1922
  </xsl:choose>
1759
1923
  <xsl:text> </xsl:text><xsl:value-of select="ogc:referenceFrom"/>
@@ -1762,8 +1926,8 @@
1762
1926
  <xsl:template match="ogc:admonition">
1763
1927
  <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">
1764
1928
  <fo:block-container margin-left="0mm" margin-right="0mm" padding="2mm" padding-top="3mm">
1765
- <fo:block font-size="11pt" margin-bottom="6pt" font-weight="bold" font-style="italic" text-align="center">
1766
- <xsl:value-of select="translate(@type, $lower, $upper)"/>
1929
+ <fo:block font-size="11pt" margin-bottom="6pt" font-weight="bold" font-style="italic" text-align="center">
1930
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@type))"/>
1767
1931
  </fo:block>
1768
1932
  <fo:block font-style="italic">
1769
1933
  <xsl:apply-templates/>
@@ -1774,6 +1938,12 @@
1774
1938
 
1775
1939
  </xsl:template>
1776
1940
 
1941
+ <xsl:template match="ogc:formula">
1942
+ <fo:block id="{@id}">
1943
+ <xsl:apply-templates/>
1944
+ </fo:block>
1945
+ </xsl:template>
1946
+
1777
1947
  <xsl:template match="ogc:formula/ogc:dt/ogc:stem">
1778
1948
  <fo:inline>
1779
1949
  <xsl:apply-templates/>
@@ -1781,7 +1951,7 @@
1781
1951
  </xsl:template>
1782
1952
 
1783
1953
  <xsl:template match="ogc:formula/ogc:stem">
1784
- <fo:block id="{../@id}" margin-top="6pt" margin-bottom="12pt">
1954
+ <fo:block margin-top="6pt" margin-bottom="12pt">
1785
1955
  <fo:table table-layout="fixed" width="100%">
1786
1956
  <fo:table-column column-width="95%"/>
1787
1957
  <fo:table-column column-width="5%"/>
@@ -1796,7 +1966,7 @@
1796
1966
  <fo:block text-align="right">
1797
1967
  <xsl:choose>
1798
1968
  <xsl:when test="ancestor::ogc:annex">
1799
- <xsl:text>(</xsl:text><xsl:number format="A.1" level="multiple" count="ogc:annex | ogc:formula"/><xsl:text>)</xsl:text>
1969
+ <xsl:number format="(A.1)" level="multiple" count="ogc:annex | ogc:formula"/>
1800
1970
  </xsl:when>
1801
1971
  <xsl:otherwise> <!-- not(ancestor::ogc:annex) -->
1802
1972
  <!-- <xsl:text>(</xsl:text><xsl:number level="any" count="ogc:formula"/><xsl:text>)</xsl:text> -->
@@ -1812,7 +1982,6 @@
1812
1982
  </fo:block>
1813
1983
  </xsl:template>
1814
1984
 
1815
-
1816
1985
  <xsl:template match="ogc:br" priority="2">
1817
1986
  <!-- <fo:block>&#xA0;</fo:block> -->
1818
1987
  <xsl:value-of select="$linebreak"/>
@@ -1881,38 +2050,6 @@
1881
2050
  </fo:static-content>
1882
2051
  </xsl:template>
1883
2052
 
1884
- <xsl:template name="getId">
1885
- <xsl:choose>
1886
- <xsl:when test="../@id">
1887
- <xsl:value-of select="../@id"/>
1888
- </xsl:when>
1889
- <xsl:otherwise>
1890
- <xsl:value-of select="text()"/>
1891
- </xsl:otherwise>
1892
- </xsl:choose>
1893
- </xsl:template>
1894
-
1895
- <xsl:template name="getLevel">
1896
- <xsl:variable name="level_total" select="count(ancestor::*)"/>
1897
- <xsl:variable name="level">
1898
- <xsl:choose>
1899
- <xsl:when test="ancestor::ogc:preface">
1900
- <xsl:value-of select="$level_total - 2"/>
1901
- </xsl:when>
1902
- <xsl:when test="ancestor::ogc:sections">
1903
- <xsl:value-of select="$level_total - 2"/>
1904
- </xsl:when>
1905
- <xsl:when test="ancestor::ogc:bibliography">
1906
- <xsl:value-of select="$level_total - 2"/>
1907
- </xsl:when>
1908
- <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
1909
- <xsl:otherwise>
1910
- <xsl:value-of select="$level_total - 1"/>
1911
- </xsl:otherwise>
1912
- </xsl:choose>
1913
- </xsl:variable>
1914
- <xsl:value-of select="$level"/>
1915
- </xsl:template>
1916
2053
 
1917
2054
  <xsl:template name="getSection">
1918
2055
  <xsl:param name="sectionNum"/>
@@ -1932,7 +2069,7 @@
1932
2069
  </xsl:when>
1933
2070
  <xsl:when test="$level &gt;= 2">
1934
2071
  <xsl:variable name="num">
1935
- <xsl:number format=".1" level="multiple" count="ogc:clause/ogc:clause | ogc:clause/ogc:terms | ogc:terms/ogc:term | ogc:clause/ogc:term | ogc:clause/ogc:definitions | ogc:definitions/ogc:definitions | ogc:terms/ogc:definitions"/>
2072
+ <xsl:call-template name="getSubSection"/>
1936
2073
  </xsl:variable>
1937
2074
  <xsl:value-of select="concat($sectionNum, $num)"/>
1938
2075
  </xsl:when>
@@ -1956,7 +2093,12 @@
1956
2093
  <xsl:when test="ancestor::ogc:annex">
1957
2094
  <xsl:choose>
1958
2095
  <xsl:when test="$level = 1">
1959
- <xsl:text>Annex </xsl:text>
2096
+ <xsl:variable name="title-annex">
2097
+ <xsl:call-template name="getTitle">
2098
+ <xsl:with-param name="name" select="'title-annex'"/>
2099
+ </xsl:call-template>
2100
+ </xsl:variable>
2101
+ <xsl:value-of select="$title-annex"/>
1960
2102
  <xsl:choose>
1961
2103
  <xsl:when test="count(//ogc:annex) = 1">
1962
2104
  <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:ext/ogc:structuredidentifier/ogc:annexid"/>
@@ -1980,12 +2122,13 @@
1980
2122
  </xsl:when>
1981
2123
  <xsl:when test="ancestor::ogc:preface"> <!-- if preface and there is clause(s) -->
1982
2124
  <xsl:choose>
1983
- <xsl:when test="$level = 1 and ..//ogc:clause">0</xsl:when>
2125
+ <xsl:when test="$level = 1"> <!-- and ancestor::ogc:foreword -->
2126
+ <xsl:number format="i" value="$sectionNum"/>
2127
+ </xsl:when>
2128
+ <!-- <xsl:when test="$level = 1 and ..//ogc:clause">0</xsl:when> -->
1984
2129
  <xsl:when test="$level &gt;= 2">
1985
- <xsl:variable name="num">
1986
- <xsl:number format=".1" level="multiple" count="ogc:clause"/>
1987
- </xsl:variable>
1988
- <xsl:value-of select="concat('0', $num)"/>
2130
+ <xsl:number format="i.1" level="multiple" count="ogc:clause"/>
2131
+ <!-- <xsl:value-of select="concat('0', $num)"/> -->
1989
2132
  </xsl:when>
1990
2133
  <xsl:otherwise>
1991
2134
  <!-- z<xsl:value-of select="$sectionNum"/>z -->
@@ -1999,50 +2142,191 @@
1999
2142
  <xsl:value-of select="$section"/>
2000
2143
  </xsl:template>
2001
2144
 
2002
- <xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-table">
2145
+ <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
2146
+
2147
+ <title-table lang="en">Table </title-table>
2148
+ <title-table lang="fr">Tableau </title-table>
2149
+
2150
+ <title-table lang="zh">Table </title-table>
2151
+
2152
+
2153
+
2154
+ <title-note lang="en">NOTE </title-note>
2155
+ <title-note lang="fr">NOTE </title-note>
2156
+
2157
+ <title-note lang="zh">NOTE </title-note>
2158
+
2159
+
2160
+
2161
+ <title-figure lang="en">Figure </title-figure>
2162
+ <title-figure lang="fr">Figure </title-figure>
2163
+
2164
+ <title-figure lang="zh">Figure </title-figure>
2165
+
2166
+
2167
+
2168
+ <title-example lang="en">EXAMPLE </title-example>
2169
+ <title-example lang="fr">EXEMPLE </title-example>
2170
+
2171
+ <title-example lang="zh">EXAMPLE </title-example>
2172
+
2173
+
2174
+
2175
+ <title-example-xref lang="en">Example </title-example-xref>
2176
+ <title-example-xref lang="fr">Exemple </title-example-xref>
2177
+
2178
+ <title-section lang="en">Section </title-section>
2179
+ <title-section lang="fr">Section </title-section>
2180
+
2181
+ <title-inequality lang="en">Inequality </title-inequality>
2182
+ <title-inequality lang="fr">Inequality </title-inequality>
2183
+
2184
+ <title-equation lang="en">Equation </title-equation>
2185
+ <title-equation lang="fr">Equation </title-equation>
2186
+
2187
+ <title-annex lang="en">Annex </title-annex>
2188
+ <title-annex lang="fr">Annexe </title-annex>
2189
+
2190
+ <title-annex lang="zh">Annex </title-annex>
2191
+
2192
+
2193
+
2194
+ <title-appendix lang="en">Appendix </title-appendix>
2195
+ <title-appendix lang="fr">Appendix </title-appendix>
2196
+
2197
+ <title-clause lang="en">Clause </title-clause>
2198
+ <title-clause lang="fr">Article </title-clause>
2199
+
2200
+ <title-clause lang="zh">Clause </title-clause>
2201
+
2202
+
2203
+
2204
+ <title-edition lang="en">
2205
+
2206
+
2207
+ <xsl:text>Version</xsl:text>
2208
+
2209
+ </title-edition>
2210
+
2211
+ <title-formula lang="en">Formula </title-formula>
2212
+ <title-formula lang="fr">Formula </title-formula>
2213
+
2214
+ <title-toc lang="en">
2215
+
2216
+ <xsl:text>Contents</xsl:text>
2217
+
2218
+
2219
+
2220
+ </title-toc>
2221
+ <title-toc lang="fr">Sommaire</title-toc>
2222
+
2223
+ <title-toc lang="zh">Contents</title-toc>
2224
+
2225
+
2226
+
2227
+ <title-page lang="en">Page</title-page>
2228
+ <title-page lang="fr">Page</title-page>
2229
+
2230
+ <title-key lang="en">Key</title-key>
2231
+ <title-key lang="fr">Légende</title-key>
2232
+
2233
+ <title-where lang="en">where</title-where>
2234
+ <title-where lang="fr">où</title-where>
2235
+
2236
+ <title-descriptors lang="en">Descriptors</title-descriptors>
2237
+
2238
+ <title-part lang="en">
2239
+
2240
+
2241
+ </title-part>
2242
+ <title-part lang="fr">
2243
+
2244
+
2245
+ </title-part>
2246
+ <title-part lang="zh">第 # 部分:</title-part>
2247
+
2248
+ <title-note-to-entry lang="en">Note # to entry: </title-note-to-entry>
2249
+ <title-note-to-entry lang="fr">Note # à l'article: </title-note-to-entry>
2250
+
2251
+ <title-note-to-entry lang="zh">Note # to entry: </title-note-to-entry>
2003
2252
 
2004
- <xsl:text>Table </xsl:text>
2005
2253
 
2006
2254
 
2007
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-note">
2255
+ <title-modified lang="en">modified</title-modified>
2256
+ <title-modified lang="fr">modifiée</title-modified>
2008
2257
 
2009
- <xsl:text>NOTE </xsl:text>
2258
+ <title-modified lang="zh">modified</title-modified>
2010
2259
 
2011
2260
 
2012
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-figure">
2013
2261
 
2014
- <xsl:text>Figure </xsl:text>
2262
+ <title-source lang="en">SOURCE</title-source>
2015
2263
 
2264
+ <title-keywords lang="en">Keywords</title-keywords>
2016
2265
 
2017
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-example">
2266
+ <title-deprecated lang="en">DEPRECATED</title-deprecated>
2267
+ <title-deprecated lang="fr">DEPRECATED</title-deprecated>
2018
2268
 
2019
- <xsl:text>EXAMPLE </xsl:text>
2269
+ <title-submitting-organizations lang="en">Submitting Organizations</title-submitting-organizations>
2020
2270
 
2271
+ <title-list-tables lang="en">List of Tables</title-list-tables>
2021
2272
 
2022
- </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">
2273
+ <title-list-figures lang="en">List of Figures</title-list-figures>
2023
2274
 
2024
- <xsl:text>Annex </xsl:text>
2275
+ <title-recommendation lang="en">Recommendation </title-recommendation>
2025
2276
 
2277
+ <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
2026
2278
 
2027
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-appendix">
2028
- <xsl:text>Appendix </xsl:text>
2029
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-clause">
2279
+ <title-abstract lang="en">Abstract</title-abstract>
2030
2280
 
2031
- <xsl:text>Clause </xsl:text>
2281
+ <title-summary lang="en">Summary</title-summary>
2032
2282
 
2283
+ <title-in lang="en">in </title-in>
2033
2284
 
2034
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-edition">
2035
- <xsl:text>Edition </xsl:text>
2036
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-toc">
2285
+ <title-box lang="en">Box </title-box>
2037
2286
 
2287
+ <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
2288
+ <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
2038
2289
 
2039
- </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">
2290
+ <title-completion-date lang="en">Completion date for this manuscript</title-completion-date>
2291
+ <title-completion-date lang="zh">本稿完成日期</title-completion-date>
2292
+
2293
+ <title-issuance-date lang="en">Issuance Date: #</title-issuance-date>
2294
+ <title-issuance-date lang="zh"># 发布</title-issuance-date>
2295
+
2296
+ <title-implementation-date lang="en">Implementation Date: #</title-implementation-date>
2297
+ <title-implementation-date lang="zh"># 实施</title-implementation-date>
2298
+
2299
+ <title-obligation-normative lang="en">normative</title-obligation-normative>
2300
+ <title-obligation-normative lang="zh">规范性附录</title-obligation-normative>
2301
+
2302
+ <title-caution lang="en">CAUTION</title-caution>
2303
+ <title-caution lang="zh">注意</title-caution>
2304
+
2305
+ <title-warning lang="en">WARNING</title-warning>
2306
+ <title-warning lang="zh">警告</title-warning>
2307
+
2308
+ <title-amendment lang="en">AMENDMENT</title-amendment>
2309
+ </xsl:variable><xsl:template name="getTitle">
2310
+ <xsl:param name="name"/>
2311
+ <xsl:variable name="lang">
2312
+ <xsl:call-template name="getLang"/>
2313
+ </xsl:variable>
2314
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
2315
+ <xsl:choose>
2316
+ <xsl:when test="normalize-space($title_) != ''">
2317
+ <xsl:value-of select="$title_"/>
2318
+ </xsl:when>
2319
+ <xsl:otherwise>
2320
+ <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
2321
+ </xsl:otherwise>
2322
+ </xsl:choose>
2323
+ </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">
2040
2324
 
2041
2325
  <xsl:attribute name="color">blue</xsl:attribute>
2042
2326
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
2043
2327
 
2044
2328
 
2045
- </xsl:attribute-set><xsl:attribute-set xmlns:java="http://xml.apache.org/xalan/java" name="sourcecode-style">
2329
+ </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
2046
2330
 
2047
2331
 
2048
2332
 
@@ -2057,7 +2341,7 @@
2057
2341
  <xsl:attribute name="line-height">113%</xsl:attribute>
2058
2342
 
2059
2343
 
2060
- </xsl:attribute-set><xsl:attribute-set xmlns:java="http://xml.apache.org/xalan/java" name="appendix-style">
2344
+ </xsl:attribute-set><xsl:attribute-set name="appendix-style">
2061
2345
 
2062
2346
  <xsl:attribute name="font-size">12pt</xsl:attribute>
2063
2347
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -2066,7 +2350,7 @@
2066
2350
 
2067
2351
 
2068
2352
 
2069
- </xsl:attribute-set><xsl:attribute-set xmlns:java="http://xml.apache.org/xalan/java" name="appendix-example-style">
2353
+ </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
2070
2354
 
2071
2355
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2072
2356
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
@@ -2074,14 +2358,14 @@
2074
2358
 
2075
2359
 
2076
2360
 
2077
- </xsl:attribute-set><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="text()">
2361
+ </xsl:attribute-set><xsl:template match="text()">
2078
2362
  <xsl:value-of select="."/>
2079
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='br']">
2363
+ </xsl:template><xsl:template match="*[local-name()='br']">
2080
2364
  <xsl:value-of select="$linebreak"/>
2081
- </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">
2365
+ </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
2082
2366
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
2083
2367
  <xsl:call-template name="add-zero-spaces-java"/>
2084
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']">
2368
+ </xsl:template><xsl:template match="*[local-name()='table']">
2085
2369
 
2086
2370
  <xsl:variable name="simple-table">
2087
2371
  <!-- <xsl:copy> -->
@@ -2117,7 +2401,11 @@
2117
2401
 
2118
2402
 
2119
2403
 
2120
-
2404
+ <xsl:variable name="title-table">
2405
+ <xsl:call-template name="getTitle">
2406
+ <xsl:with-param name="name" select="'title-table'"/>
2407
+ </xsl:call-template>
2408
+ </xsl:variable>
2121
2409
  <xsl:value-of select="$title-table"/>
2122
2410
 
2123
2411
  <xsl:call-template name="getTableNumber"/>
@@ -2224,13 +2512,22 @@
2224
2512
  </xsl:otherwise>
2225
2513
  </xsl:choose>
2226
2514
  </xsl:for-each>
2227
- <xsl:apply-templates/>
2515
+
2516
+ <xsl:choose>
2517
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2518
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2519
+ </xsl:when>
2520
+ <xsl:otherwise>
2521
+ <xsl:apply-templates/>
2522
+ </xsl:otherwise>
2523
+ </xsl:choose>
2524
+
2228
2525
  </fo:table>
2229
2526
 
2230
2527
 
2231
2528
 
2232
2529
  </fo:block-container>
2233
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="getTableNumber">
2530
+ </xsl:template><xsl:template name="getTableNumber">
2234
2531
  <xsl:choose>
2235
2532
  <xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
2236
2533
  <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true']"/>
@@ -2255,15 +2552,15 @@
2255
2552
 
2256
2553
  </xsl:otherwise>
2257
2554
  </xsl:choose>
2258
- </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">
2555
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']"/><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="process">
2259
2556
  <xsl:apply-templates/>
2260
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="calculate-columns-numbers">
2557
+ </xsl:template><xsl:template name="calculate-columns-numbers">
2261
2558
  <xsl:param name="table-row"/>
2262
2559
  <xsl:variable name="columns-count" select="count($table-row/*)"/>
2263
2560
  <xsl:variable name="sum-colspans" select="sum($table-row/*/@colspan)"/>
2264
2561
  <xsl:variable name="columns-with-colspan" select="count($table-row/*[@colspan])"/>
2265
2562
  <xsl:value-of select="$columns-count + $sum-colspans - $columns-with-colspan"/>
2266
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="calculate-column-widths">
2563
+ </xsl:template><xsl:template name="calculate-column-widths">
2267
2564
  <xsl:param name="table"/>
2268
2565
  <xsl:param name="cols-count"/>
2269
2566
  <xsl:param name="curr-col" select="1"/>
@@ -2361,23 +2658,27 @@
2361
2658
  <xsl:with-param name="table" select="$table"/>
2362
2659
  </xsl:call-template>
2363
2660
  </xsl:if>
2364
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="text()" mode="td_text">
2661
+ </xsl:template><xsl:template match="text()" mode="td_text">
2365
2662
  <xsl:variable name="zero-space">​</xsl:variable>
2366
2663
  <xsl:value-of select="translate(., $zero-space, ' ')"/><xsl:text> </xsl:text>
2367
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='termsource']" mode="td_text">
2664
+ </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
2368
2665
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
2369
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='link']" mode="td_text">
2666
+ </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
2370
2667
  <xsl:value-of select="@target"/>
2371
- </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">
2668
+ </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
2372
2669
  <xsl:param name="cols-count"/>
2373
2670
  <!-- font-weight="bold" -->
2374
2671
  <fo:table-header>
2375
2672
 
2376
2673
  <xsl:apply-templates/>
2377
2674
  </fo:table-header>
2378
- </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">
2675
+ </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
2676
+ <fo:table-body>
2677
+ <xsl:apply-templates/>
2678
+ </fo:table-body>
2679
+ </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
2379
2680
  <xsl:apply-templates/>
2380
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="insertTableFooter">
2681
+ </xsl:template><xsl:template name="insertTableFooter">
2381
2682
  <xsl:param name="cols-count"/>
2382
2683
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2383
2684
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -2417,7 +2718,7 @@
2417
2718
  </fo:table-footer>
2418
2719
 
2419
2720
  </xsl:if>
2420
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tbody']">
2721
+ </xsl:template><xsl:template match="*[local-name()='tbody']">
2421
2722
 
2422
2723
  <xsl:variable name="cols-count">
2423
2724
  <xsl:choose>
@@ -2448,7 +2749,7 @@
2448
2749
 
2449
2750
  </fo:table-body>
2450
2751
 
2451
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tr']">
2752
+ </xsl:template><xsl:template match="*[local-name()='tr']">
2452
2753
  <xsl:variable name="parent-name" select="local-name(..)"/>
2453
2754
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
2454
2755
  <fo:table-row min-height="4mm">
@@ -2468,7 +2769,7 @@
2468
2769
 
2469
2770
  <xsl:apply-templates/>
2470
2771
  </fo:table-row>
2471
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='th']">
2772
+ </xsl:template><xsl:template match="*[local-name()='th']">
2472
2773
  <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
2473
2774
 
2474
2775
 
@@ -2491,7 +2792,7 @@
2491
2792
  <xsl:apply-templates/>
2492
2793
  </fo:block>
2493
2794
  </fo:table-cell>
2494
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='td']">
2795
+ </xsl:template><xsl:template match="*[local-name()='td']">
2495
2796
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
2496
2797
 
2497
2798
 
@@ -2529,7 +2830,7 @@
2529
2830
 
2530
2831
 
2531
2832
  </fo:table-cell>
2532
- </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">
2833
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
2533
2834
 
2534
2835
 
2535
2836
  <fo:block font-size="10pt" margin-bottom="12pt">
@@ -2540,6 +2841,12 @@
2540
2841
  <fo:inline padding-right="2mm">
2541
2842
 
2542
2843
 
2844
+
2845
+ <xsl:variable name="title-note">
2846
+ <xsl:call-template name="getTitle">
2847
+ <xsl:with-param name="name" select="'title-note'"/>
2848
+ </xsl:call-template>
2849
+ </xsl:variable>
2543
2850
  <xsl:value-of select="$title-note"/>
2544
2851
 
2545
2852
  <xsl:variable name="id" select="ancestor::*[local-name() = 'table'][1]/@id"/>
@@ -2554,9 +2861,9 @@
2554
2861
  <xsl:apply-templates mode="process"/>
2555
2862
  </fo:block>
2556
2863
 
2557
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
2864
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
2558
2865
  <xsl:apply-templates/>
2559
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="fn_display">
2866
+ </xsl:template><xsl:template name="fn_display">
2560
2867
  <xsl:variable name="references">
2561
2868
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
2562
2869
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -2599,7 +2906,7 @@
2599
2906
  </fo:block>
2600
2907
  </xsl:if>
2601
2908
  </xsl:for-each>
2602
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="fn_name_display">
2909
+ </xsl:template><xsl:template name="fn_name_display">
2603
2910
  <!-- <xsl:variable name="references">
2604
2911
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
2605
2912
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -2615,7 +2922,7 @@
2615
2922
  <xsl:apply-templates/>
2616
2923
  </fo:block>
2617
2924
  </xsl:for-each>
2618
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="fn_display_figure">
2925
+ </xsl:template><xsl:template name="fn_display_figure">
2619
2926
  <xsl:variable name="key_iso">
2620
2927
  <!-- and (not(@class) or @class !='pseudocode') -->
2621
2928
  </xsl:variable>
@@ -2626,6 +2933,36 @@
2626
2933
  </fn>
2627
2934
  </xsl:for-each>
2628
2935
  </xsl:variable>
2936
+
2937
+ <!-- current hierarchy is 'figure' element -->
2938
+ <xsl:variable name="following_dl_colwidths">
2939
+ <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
2940
+ <xsl:variable name="html-table">
2941
+ <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2942
+ <xsl:element name="{$ns}:table">
2943
+ <xsl:for-each select="*[local-name() = 'dl'][1]">
2944
+ <tbody>
2945
+ <xsl:apply-templates mode="dl"/>
2946
+ </tbody>
2947
+ </xsl:for-each>
2948
+ </xsl:element>
2949
+ </xsl:variable>
2950
+
2951
+ <xsl:call-template name="calculate-column-widths">
2952
+ <xsl:with-param name="cols-count" select="2"/>
2953
+ <xsl:with-param name="table" select="$html-table"/>
2954
+ </xsl:call-template>
2955
+
2956
+ </xsl:if>
2957
+ </xsl:variable>
2958
+
2959
+
2960
+ <xsl:variable name="maxlength_dt">
2961
+ <xsl:for-each select="*[local-name() = 'dl'][1]">
2962
+ <xsl:call-template name="getMaxLength_dt"/>
2963
+ </xsl:for-each>
2964
+ </xsl:variable>
2965
+
2629
2966
  <xsl:if test="xalan:nodeset($references)//fn">
2630
2967
  <fo:block>
2631
2968
  <fo:table width="95%" table-layout="fixed">
@@ -2633,8 +2970,19 @@
2633
2970
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2634
2971
 
2635
2972
  </xsl:if>
2636
- <fo:table-column column-width="15%"/>
2637
- <fo:table-column column-width="85%"/>
2973
+ <xsl:choose>
2974
+ <!-- if there 'dl', then set same columns width -->
2975
+ <xsl:when test="xalan:nodeset($following_dl_colwidths)//column">
2976
+ <xsl:call-template name="setColumnWidth_dl">
2977
+ <xsl:with-param name="colwidths" select="$following_dl_colwidths"/>
2978
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2979
+ </xsl:call-template>
2980
+ </xsl:when>
2981
+ <xsl:otherwise>
2982
+ <fo:table-column column-width="15%"/>
2983
+ <fo:table-column column-width="85%"/>
2984
+ </xsl:otherwise>
2985
+ </xsl:choose>
2638
2986
  <fo:table-body>
2639
2987
  <xsl:for-each select="xalan:nodeset($references)//fn">
2640
2988
  <xsl:variable name="reference" select="@reference"/>
@@ -2666,7 +3014,7 @@
2666
3014
  </fo:block>
2667
3015
  </xsl:if>
2668
3016
 
2669
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='fn']">
3017
+ </xsl:template><xsl:template match="*[local-name()='fn']">
2670
3018
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
2671
3019
  <fo:inline font-size="80%" keep-with-previous.within-line="always">
2672
3020
 
@@ -2688,11 +3036,11 @@
2688
3036
  <xsl:value-of select="@reference"/>
2689
3037
  </fo:basic-link>
2690
3038
  </fo:inline>
2691
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='fn']/*[local-name()='p']">
3039
+ </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
2692
3040
  <fo:inline>
2693
3041
  <xsl:apply-templates/>
2694
3042
  </fo:inline>
2695
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dl']">
3043
+ </xsl:template><xsl:template match="*[local-name()='dl']">
2696
3044
  <xsl:variable name="parent" select="local-name(..)"/>
2697
3045
 
2698
3046
  <xsl:variable name="key_iso">
@@ -2705,6 +3053,11 @@
2705
3053
 
2706
3054
  <fo:block margin-bottom="12pt" text-align="left">
2707
3055
 
3056
+ <xsl:variable name="title-where">
3057
+ <xsl:call-template name="getTitle">
3058
+ <xsl:with-param name="name" select="'title-where'"/>
3059
+ </xsl:call-template>
3060
+ </xsl:variable>
2708
3061
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2709
3062
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
2710
3063
  <xsl:text/>
@@ -2718,14 +3071,24 @@
2718
3071
 
2719
3072
 
2720
3073
 
3074
+ <xsl:variable name="title-where">
3075
+ <xsl:call-template name="getTitle">
3076
+ <xsl:with-param name="name" select="'title-where'"/>
3077
+ </xsl:call-template>
3078
+ </xsl:variable>
2721
3079
  <xsl:value-of select="$title-where"/>
2722
3080
  </fo:block>
2723
3081
  </xsl:when>
2724
3082
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2725
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt">
3083
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2726
3084
 
2727
3085
 
2728
3086
 
3087
+ <xsl:variable name="title-key">
3088
+ <xsl:call-template name="getTitle">
3089
+ <xsl:with-param name="name" select="'title-key'"/>
3090
+ </xsl:call-template>
3091
+ </xsl:variable>
2729
3092
  <xsl:value-of select="$title-key"/>
2730
3093
  </fo:block>
2731
3094
  </xsl:when>
@@ -2742,23 +3105,6 @@
2742
3105
 
2743
3106
 
2744
3107
 
2745
- <!-- create virtual html table for dl/[dt and dd] -->
2746
- <xsl:variable name="html-table">
2747
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2748
- <xsl:element name="{$ns}:table">
2749
- <tbody>
2750
- <xsl:apply-templates mode="dl"/>
2751
- </tbody>
2752
- </xsl:element>
2753
- </xsl:variable>
2754
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
2755
- <xsl:variable name="colwidths">
2756
- <xsl:call-template name="calculate-column-widths">
2757
- <xsl:with-param name="cols-count" select="2"/>
2758
- <xsl:with-param name="table" select="$html-table"/>
2759
- </xsl:call-template>
2760
- </xsl:variable>
2761
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2762
3108
 
2763
3109
  <fo:table width="95%" table-layout="fixed">
2764
3110
 
@@ -2771,42 +3117,30 @@
2771
3117
 
2772
3118
  </xsl:when>
2773
3119
  </xsl:choose>
2774
- <xsl:choose>
2775
- <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
2776
- <fo:table-column column-width="50%"/>
2777
- <fo:table-column column-width="50%"/>
2778
- </xsl:when>
2779
- <xsl:otherwise>
2780
- <xsl:choose>
2781
- <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
2782
- <fo:table-column column-width="60%"/>
2783
- <fo:table-column column-width="40%"/>
2784
- </xsl:when> -->
2785
- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.3">
2786
- <fo:table-column column-width="50%"/>
2787
- <fo:table-column column-width="50%"/>
2788
- </xsl:when>
2789
- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 0.5">
2790
- <fo:table-column column-width="40%"/>
2791
- <fo:table-column column-width="60%"/>
2792
- </xsl:when>
2793
- <xsl:otherwise>
2794
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2795
- <xsl:choose>
2796
- <xsl:when test=". = 1 or . = 0">
2797
- <fo:table-column column-width="proportional-column-width(2)"/>
2798
- </xsl:when>
2799
- <xsl:otherwise>
2800
- <fo:table-column column-width="proportional-column-width({.})"/>
2801
- </xsl:otherwise>
2802
- </xsl:choose>
2803
- </xsl:for-each>
2804
- </xsl:otherwise>
2805
- </xsl:choose>
2806
- <!-- <fo:table-column column-width="15%"/>
2807
- <fo:table-column column-width="85%"/> -->
2808
- </xsl:otherwise>
2809
- </xsl:choose>
3120
+ <!-- create virtual html table for dl/[dt and dd] -->
3121
+ <xsl:variable name="html-table">
3122
+ <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
3123
+ <xsl:element name="{$ns}:table">
3124
+ <tbody>
3125
+ <xsl:apply-templates mode="dl"/>
3126
+ </tbody>
3127
+ </xsl:element>
3128
+ </xsl:variable>
3129
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
3130
+ <xsl:variable name="colwidths">
3131
+ <xsl:call-template name="calculate-column-widths">
3132
+ <xsl:with-param name="cols-count" select="2"/>
3133
+ <xsl:with-param name="table" select="$html-table"/>
3134
+ </xsl:call-template>
3135
+ </xsl:variable>
3136
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
3137
+ <xsl:variable name="maxlength_dt">
3138
+ <xsl:call-template name="getMaxLength_dt"/>
3139
+ </xsl:variable>
3140
+ <xsl:call-template name="setColumnWidth_dl">
3141
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3142
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
3143
+ </xsl:call-template>
2810
3144
  <fo:table-body>
2811
3145
  <xsl:apply-templates>
2812
3146
  <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
@@ -2816,7 +3150,61 @@
2816
3150
  </fo:block>
2817
3151
  </fo:block>
2818
3152
  </xsl:if>
2819
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dl']/*[local-name()='note']">
3153
+ </xsl:template><xsl:template name="setColumnWidth_dl">
3154
+ <xsl:param name="colwidths"/>
3155
+ <xsl:param name="maxlength_dt"/>
3156
+ <xsl:choose>
3157
+ <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
3158
+ <fo:table-column column-width="50%"/>
3159
+ <fo:table-column column-width="50%"/>
3160
+ </xsl:when>
3161
+ <xsl:otherwise>
3162
+ <xsl:choose>
3163
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
3164
+ <fo:table-column column-width="5%"/>
3165
+ <fo:table-column column-width="95%"/>
3166
+ </xsl:when>
3167
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
3168
+ <fo:table-column column-width="10%"/>
3169
+ <fo:table-column column-width="90%"/>
3170
+ </xsl:when>
3171
+ <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
3172
+ <fo:table-column column-width="60%"/>
3173
+ <fo:table-column column-width="40%"/>
3174
+ </xsl:when> -->
3175
+ <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.3">
3176
+ <fo:table-column column-width="50%"/>
3177
+ <fo:table-column column-width="50%"/>
3178
+ </xsl:when>
3179
+ <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 0.5">
3180
+ <fo:table-column column-width="40%"/>
3181
+ <fo:table-column column-width="60%"/>
3182
+ </xsl:when>
3183
+ <xsl:otherwise>
3184
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3185
+ <xsl:choose>
3186
+ <xsl:when test=". = 1 or . = 0">
3187
+ <fo:table-column column-width="proportional-column-width(2)"/>
3188
+ </xsl:when>
3189
+ <xsl:otherwise>
3190
+ <fo:table-column column-width="proportional-column-width({.})"/>
3191
+ </xsl:otherwise>
3192
+ </xsl:choose>
3193
+ </xsl:for-each>
3194
+ </xsl:otherwise>
3195
+ </xsl:choose>
3196
+ <!-- <fo:table-column column-width="15%"/>
3197
+ <fo:table-column column-width="85%"/> -->
3198
+ </xsl:otherwise>
3199
+ </xsl:choose>
3200
+ </xsl:template><xsl:template name="getMaxLength_dt">
3201
+ <xsl:for-each select="*[local-name()='dt']">
3202
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
3203
+ <xsl:if test="position() = 1">
3204
+ <xsl:value-of select="string-length(normalize-space(.))"/>
3205
+ </xsl:if>
3206
+ </xsl:for-each>
3207
+ </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']">
2820
3208
  <xsl:param name="key_iso"/>
2821
3209
 
2822
3210
  <!-- <tr>
@@ -2832,6 +3220,11 @@
2832
3220
  <xsl:if test="normalize-space($key_iso) = 'true'">
2833
3221
  <xsl:attribute name="margin-top">0</xsl:attribute>
2834
3222
  </xsl:if>
3223
+ <xsl:variable name="title-note">
3224
+ <xsl:call-template name="getTitle">
3225
+ <xsl:with-param name="name" select="'title-note'"/>
3226
+ </xsl:call-template>
3227
+ </xsl:variable>
2835
3228
  <xsl:value-of select="$title-note"/>
2836
3229
  </fo:block>
2837
3230
  </fo:table-cell>
@@ -2841,7 +3234,7 @@
2841
3234
  </fo:block>
2842
3235
  </fo:table-cell>
2843
3236
  </fo:table-row>
2844
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dt']" mode="dl">
3237
+ </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl">
2845
3238
  <tr>
2846
3239
  <td>
2847
3240
  <xsl:apply-templates/>
@@ -2854,7 +3247,7 @@
2854
3247
  </td>
2855
3248
  </tr>
2856
3249
 
2857
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dt']">
3250
+ </xsl:template><xsl:template match="*[local-name()='dt']">
2858
3251
  <xsl:param name="key_iso"/>
2859
3252
 
2860
3253
  <fo:table-row>
@@ -2872,8 +3265,15 @@
2872
3265
 
2873
3266
 
2874
3267
 
2875
- <xsl:apply-templates/>
3268
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
3269
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2876
3270
 
3271
+ <xsl:apply-templates/>
3272
+ <!-- <xsl:if test="$namespace = 'gb'">
3273
+ <xsl:if test="ancestor::*[local-name()='formula']">
3274
+ <xsl:text>—</xsl:text>
3275
+ </xsl:if>
3276
+ </xsl:if> -->
2877
3277
  </fo:block>
2878
3278
  </fo:table-cell>
2879
3279
  <fo:table-cell>
@@ -2887,37 +3287,37 @@
2887
3287
  </fo:table-cell>
2888
3288
  </fo:table-row>
2889
3289
 
2890
- </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">
3290
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
2891
3291
  <xsl:apply-templates/>
2892
- </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">
3292
+ </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
2893
3293
  <xsl:apply-templates/>
2894
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
3294
+ </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
2895
3295
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
2896
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='em']">
3296
+ </xsl:template><xsl:template match="*[local-name()='em']">
2897
3297
  <fo:inline font-style="italic">
2898
3298
  <xsl:apply-templates/>
2899
3299
  </fo:inline>
2900
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='strong']">
3300
+ </xsl:template><xsl:template match="*[local-name()='strong']">
2901
3301
  <fo:inline font-weight="bold">
2902
3302
  <xsl:apply-templates/>
2903
3303
  </fo:inline>
2904
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='sup']">
3304
+ </xsl:template><xsl:template match="*[local-name()='sup']">
2905
3305
  <fo:inline font-size="80%" vertical-align="super">
2906
3306
  <xsl:apply-templates/>
2907
3307
  </fo:inline>
2908
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='sub']">
3308
+ </xsl:template><xsl:template match="*[local-name()='sub']">
2909
3309
  <fo:inline font-size="80%" vertical-align="sub">
2910
3310
  <xsl:apply-templates/>
2911
3311
  </fo:inline>
2912
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tt']">
3312
+ </xsl:template><xsl:template match="*[local-name()='tt']">
2913
3313
  <fo:inline font-family="Courier" font-size="10pt">
2914
3314
  <xsl:apply-templates/>
2915
3315
  </fo:inline>
2916
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='del']">
3316
+ </xsl:template><xsl:template match="*[local-name()='del']">
2917
3317
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2918
3318
  <xsl:apply-templates/>
2919
3319
  </fo:inline>
2920
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="text()[ancestor::*[local-name()='smallcap']]">
3320
+ </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
2921
3321
  <xsl:variable name="text" select="normalize-space(.)"/>
2922
3322
  <fo:inline font-size="75%">
2923
3323
  <xsl:if test="string-length($text) &gt; 0">
@@ -2926,10 +3326,11 @@
2926
3326
  </xsl:call-template>
2927
3327
  </xsl:if>
2928
3328
  </fo:inline>
2929
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="recursiveSmallCaps">
3329
+ </xsl:template><xsl:template name="recursiveSmallCaps">
2930
3330
  <xsl:param name="text"/>
2931
3331
  <xsl:variable name="char" select="substring($text,1,1)"/>
2932
- <xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/>
3332
+ <!-- <xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/> -->
3333
+ <xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
2933
3334
  <xsl:choose>
2934
3335
  <xsl:when test="$char=$upperCase">
2935
3336
  <fo:inline font-size="{100 div 0.75}%">
@@ -2945,7 +3346,7 @@
2945
3346
  <xsl:with-param name="text" select="substring($text,2)"/>
2946
3347
  </xsl:call-template>
2947
3348
  </xsl:if>
2948
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="tokenize">
3349
+ </xsl:template><xsl:template name="tokenize">
2949
3350
  <xsl:param name="text"/>
2950
3351
  <xsl:param name="separator" select="' '"/>
2951
3352
  <xsl:choose>
@@ -2993,7 +3394,7 @@
2993
3394
  </xsl:call-template>
2994
3395
  </xsl:otherwise>
2995
3396
  </xsl:choose>
2996
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="max_length">
3397
+ </xsl:template><xsl:template name="max_length">
2997
3398
  <xsl:param name="words"/>
2998
3399
  <xsl:for-each select="$words//word">
2999
3400
  <xsl:sort select="." data-type="number" order="descending"/>
@@ -3001,11 +3402,11 @@
3001
3402
  <xsl:value-of select="."/>
3002
3403
  </xsl:if>
3003
3404
  </xsl:for-each>
3004
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="add-zero-spaces-java">
3405
+ </xsl:template><xsl:template name="add-zero-spaces-java">
3005
3406
  <xsl:param name="text" select="."/>
3006
3407
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
3007
3408
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
3008
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="add-zero-spaces">
3409
+ </xsl:template><xsl:template name="add-zero-spaces">
3009
3410
  <xsl:param name="text" select="."/>
3010
3411
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
3011
3412
  <xsl:variable name="zero-space-after-dot">.</xsl:variable>
@@ -3058,7 +3459,7 @@
3058
3459
  <xsl:value-of select="$text"/>
3059
3460
  </xsl:otherwise>
3060
3461
  </xsl:choose>
3061
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="add-zero-spaces-equal">
3462
+ </xsl:template><xsl:template name="add-zero-spaces-equal">
3062
3463
  <xsl:param name="text" select="."/>
3063
3464
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
3064
3465
  <xsl:variable name="zero-space-after-equal">=</xsl:variable>
@@ -3084,7 +3485,7 @@
3084
3485
  <xsl:value-of select="$text"/>
3085
3486
  </xsl:otherwise>
3086
3487
  </xsl:choose>
3087
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="getSimpleTable">
3488
+ </xsl:template><xsl:template name="getSimpleTable">
3088
3489
  <xsl:variable name="simple-table">
3089
3490
 
3090
3491
  <!-- Step 1. colspan processing -->
@@ -3111,9 +3512,9 @@
3111
3512
  </xsl:choose> -->
3112
3513
  </xsl:variable>
3113
3514
  <xsl:copy-of select="$simple-table"/>
3114
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
3515
+ </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
3115
3516
  <xsl:apply-templates mode="simple-table-colspan"/>
3116
- </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">
3517
+ </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">
3117
3518
  <xsl:choose>
3118
3519
  <xsl:when test="@colspan">
3119
3520
  <xsl:variable name="td">
@@ -3135,16 +3536,16 @@
3135
3536
  </xsl:element>
3136
3537
  </xsl:otherwise>
3137
3538
  </xsl:choose>
3138
- </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">
3539
+ </xsl:template><xsl:template match="@colspan" mode="simple-table-colspan"/><xsl:template match="*[local-name()='tr']" mode="simple-table-colspan">
3139
3540
  <xsl:element name="tr">
3140
3541
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
3141
3542
  <xsl:apply-templates mode="simple-table-colspan"/>
3142
3543
  </xsl:element>
3143
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="@*|node()" mode="simple-table-colspan">
3544
+ </xsl:template><xsl:template match="@*|node()" mode="simple-table-colspan">
3144
3545
  <xsl:copy>
3145
3546
  <xsl:apply-templates select="@*|node()" mode="simple-table-colspan"/>
3146
3547
  </xsl:copy>
3147
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="repeatNode">
3548
+ </xsl:template><xsl:template name="repeatNode">
3148
3549
  <xsl:param name="count"/>
3149
3550
  <xsl:param name="node"/>
3150
3551
 
@@ -3155,18 +3556,18 @@
3155
3556
  </xsl:call-template>
3156
3557
  <xsl:copy-of select="$node"/>
3157
3558
  </xsl:if>
3158
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="@*|node()" mode="simple-table-rowspan">
3559
+ </xsl:template><xsl:template match="@*|node()" mode="simple-table-rowspan">
3159
3560
  <xsl:copy>
3160
3561
  <xsl:apply-templates select="@*|node()" mode="simple-table-rowspan"/>
3161
3562
  </xsl:copy>
3162
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="tbody" mode="simple-table-rowspan">
3563
+ </xsl:template><xsl:template match="tbody" mode="simple-table-rowspan">
3163
3564
  <xsl:copy>
3164
3565
  <xsl:copy-of select="tr[1]"/>
3165
3566
  <xsl:apply-templates select="tr[2]" mode="simple-table-rowspan">
3166
3567
  <xsl:with-param name="previousRow" select="tr[1]"/>
3167
3568
  </xsl:apply-templates>
3168
3569
  </xsl:copy>
3169
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="tr" mode="simple-table-rowspan">
3570
+ </xsl:template><xsl:template match="tr" mode="simple-table-rowspan">
3170
3571
  <xsl:param name="previousRow"/>
3171
3572
  <xsl:variable name="currentRow" select="."/>
3172
3573
 
@@ -3200,43 +3601,53 @@
3200
3601
  <xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan">
3201
3602
  <xsl:with-param name="previousRow" select="$newRow"/>
3202
3603
  </xsl:apply-templates>
3203
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="getLang">
3604
+ </xsl:template><xsl:template name="getLang">
3204
3605
  <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3205
3606
  <xsl:choose>
3206
3607
  <xsl:when test="$language = 'English'">en</xsl:when>
3207
3608
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
3208
3609
  </xsl:choose>
3209
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="capitalizeWords">
3610
+ </xsl:template><xsl:template name="capitalizeWords">
3210
3611
  <xsl:param name="str"/>
3211
3612
  <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
3212
3613
  <xsl:choose>
3213
3614
  <xsl:when test="contains($str2, ' ')">
3214
3615
  <xsl:variable name="substr" select="substring-before($str2, ' ')"/>
3215
- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
3216
- <xsl:value-of select="substring($substr, 2)"/>
3616
+ <!-- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
3617
+ <xsl:value-of select="substring($substr, 2)"/> -->
3618
+ <xsl:call-template name="capitalize">
3619
+ <xsl:with-param name="str" select="$substr"/>
3620
+ </xsl:call-template>
3217
3621
  <xsl:text> </xsl:text>
3218
3622
  <xsl:call-template name="capitalizeWords">
3219
3623
  <xsl:with-param name="str" select="substring-after($str2, ' ')"/>
3220
3624
  </xsl:call-template>
3221
3625
  </xsl:when>
3222
3626
  <xsl:otherwise>
3223
- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
3224
- <xsl:value-of select="substring($str2, 2)"/>
3627
+ <!-- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
3628
+ <xsl:value-of select="substring($str2, 2)"/> -->
3629
+ <xsl:call-template name="capitalize">
3630
+ <xsl:with-param name="str" select="$str2"/>
3631
+ </xsl:call-template>
3225
3632
  </xsl:otherwise>
3226
3633
  </xsl:choose>
3227
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="mathml:math">
3634
+ </xsl:template><xsl:template name="capitalize">
3635
+ <xsl:param name="str"/>
3636
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
3637
+ <xsl:value-of select="substring($str, 2)"/>
3638
+ </xsl:template><xsl:template match="mathml:math">
3228
3639
  <fo:inline font-family="STIX2Math">
3229
3640
  <fo:instream-foreign-object fox:alt-text="Math">
3230
3641
  <xsl:copy-of select="."/>
3231
3642
  </fo:instream-foreign-object>
3232
3643
  </fo:inline>
3233
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='localityStack']">
3644
+ </xsl:template><xsl:template match="*[local-name()='localityStack']">
3234
3645
  <xsl:for-each select="*[local-name()='locality']">
3235
3646
  <xsl:if test="position() =1"><xsl:text>, </xsl:text></xsl:if>
3236
3647
  <xsl:apply-templates select="."/>
3237
3648
  <xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if>
3238
3649
  </xsl:for-each>
3239
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='link']" name="link">
3650
+ </xsl:template><xsl:template match="*[local-name()='link']" name="link">
3240
3651
  <xsl:variable name="target">
3241
3652
  <xsl:choose>
3242
3653
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
@@ -3266,7 +3677,7 @@
3266
3677
  </xsl:otherwise>
3267
3678
  </xsl:choose>
3268
3679
  </fo:inline>
3269
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='sourcecode']" name="sourcecode">
3680
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
3270
3681
  <fo:block xsl:use-attribute-sets="sourcecode-style">
3271
3682
  <!-- <xsl:choose>
3272
3683
  <xsl:when test="@lang = 'en'"></xsl:when>
@@ -3277,19 +3688,29 @@
3277
3688
  </xsl:choose> -->
3278
3689
  <xsl:apply-templates/>
3279
3690
  </fo:block>
3280
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='bookmark']">
3691
+ </xsl:template><xsl:template match="*[local-name()='bookmark']">
3281
3692
  <fo:inline id="{@id}"/>
3282
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']">
3693
+ </xsl:template><xsl:template match="*[local-name()='appendix']">
3283
3694
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
3695
+ <xsl:variable name="title-appendix">
3696
+ <xsl:call-template name="getTitle">
3697
+ <xsl:with-param name="name" select="'title-appendix'"/>
3698
+ </xsl:call-template>
3699
+ </xsl:variable>
3284
3700
  <fo:inline padding-right="5mm"><xsl:value-of select="$title-appendix"/> <xsl:number/></fo:inline>
3285
3701
  <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
3286
3702
  </fo:block>
3287
3703
  <xsl:apply-templates/>
3288
- </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">
3704
+ </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3289
3705
  <fo:inline><xsl:apply-templates/></fo:inline>
3290
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']//*[local-name()='example']">
3706
+ </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']">
3291
3707
  <fo:block xsl:use-attribute-sets="appendix-example-style">
3292
3708
  <xsl:variable name="claims_id" select="ancestor::*[local-name()='clause'][1]/@id"/>
3709
+ <xsl:variable name="title-example">
3710
+ <xsl:call-template name="getTitle">
3711
+ <xsl:with-param name="name" select="'title-example'"/>
3712
+ </xsl:call-template>
3713
+ </xsl:variable>
3293
3714
  <xsl:value-of select="$title-example"/>
3294
3715
  <xsl:if test="count(ancestor::*[local-name()='clause'][1]//*[local-name()='example']) &gt; 1">
3295
3716
  <xsl:number count="*[local-name()='example'][ancestor::*[local-name()='clause'][@id = $claims_id]]" level="any"/><xsl:text> </xsl:text>
@@ -3299,11 +3720,11 @@
3299
3720
  </xsl:if>
3300
3721
  </fo:block>
3301
3722
  <xsl:apply-templates/>
3302
- </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">
3723
+ </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">
3303
3724
  <fo:inline><xsl:apply-templates/></fo:inline>
3304
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name() = 'callout']">
3725
+ </xsl:template><xsl:template match="*[local-name() = 'callout']">
3305
3726
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
3306
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name() = 'annotation']">
3727
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']">
3307
3728
  <xsl:variable name="annotation-id" select="@id"/>
3308
3729
  <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
3309
3730
  <fo:block id="{$annotation-id}" white-space="nowrap">
@@ -3313,14 +3734,25 @@
3313
3734
  </xsl:apply-templates>
3314
3735
  </fo:inline>
3315
3736
  </fo:block>
3316
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name() = 'annotation']/*[local-name() = 'p']">
3737
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
3317
3738
  <xsl:param name="callout"/>
3318
3739
  <fo:inline id="{@id}">
3319
3740
  <!-- for first p in annotation, put <x> -->
3320
3741
  <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
3321
3742
  <xsl:apply-templates/>
3322
3743
  </fo:inline>
3323
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="convertDate">
3744
+ </xsl:template><xsl:template match="*[local-name() = 'modification']">
3745
+ <xsl:variable name="title-modified">
3746
+ <xsl:call-template name="getTitle">
3747
+ <xsl:with-param name="name" select="'title-modified'"/>
3748
+ </xsl:call-template>
3749
+ </xsl:variable>
3750
+ <xsl:choose>
3751
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3752
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
3753
+ </xsl:choose>
3754
+ <xsl:apply-templates/>
3755
+ </xsl:template><xsl:template name="convertDate">
3324
3756
  <xsl:param name="date"/>
3325
3757
  <xsl:param name="format" select="'short'"/>
3326
3758
  <xsl:variable name="year" select="substring($date, 1, 4)"/>
@@ -3353,7 +3785,7 @@
3353
3785
  </xsl:choose>
3354
3786
  </xsl:variable>
3355
3787
  <xsl:value-of select="$result"/>
3356
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="insertKeywords">
3788
+ </xsl:template><xsl:template name="insertKeywords">
3357
3789
  <xsl:param name="sorting" select="'true'"/>
3358
3790
  <xsl:param name="charAtEnd" select="'.'"/>
3359
3791
  <xsl:param name="charDelim" select="', '"/>
@@ -3376,7 +3808,7 @@
3376
3808
  </xsl:for-each>
3377
3809
  </xsl:otherwise>
3378
3810
  </xsl:choose>
3379
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="insertKeyword">
3811
+ </xsl:template><xsl:template name="insertKeyword">
3380
3812
  <xsl:param name="charAtEnd"/>
3381
3813
  <xsl:param name="charDelim"/>
3382
3814
  <xsl:apply-templates/>
@@ -3384,4 +3816,136 @@
3384
3816
  <xsl:when test="position() != last()"><xsl:value-of select="$charDelim"/></xsl:when>
3385
3817
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
3386
3818
  </xsl:choose>
3819
+ </xsl:template><xsl:template name="addPDFUAmeta">
3820
+ <fo:declarations>
3821
+ <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
3822
+ <pdf:dictionary type="normal" key="ViewerPreferences">
3823
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
3824
+ </pdf:dictionary>
3825
+ </pdf:catalog>
3826
+ <x:xmpmeta xmlns:x="adobe:ns:meta/">
3827
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
3828
+ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
3829
+ <!-- Dublin Core properties go here -->
3830
+ <dc:title>
3831
+ <xsl:variable name="title">
3832
+
3833
+
3834
+ <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en']"/>
3835
+
3836
+
3837
+
3838
+ </xsl:variable>
3839
+ <xsl:choose>
3840
+ <xsl:when test="normalize-space($title) != ''">
3841
+ <xsl:value-of select="$title"/>
3842
+ </xsl:when>
3843
+ <xsl:otherwise>
3844
+ <xsl:text> </xsl:text>
3845
+ </xsl:otherwise>
3846
+ </xsl:choose>
3847
+ </dc:title>
3848
+ <dc:creator>
3849
+
3850
+
3851
+ </dc:creator>
3852
+ <dc:description>
3853
+ <xsl:variable name="abstract">
3854
+
3855
+
3856
+
3857
+
3858
+ <xsl:copy-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'abstract']//text()"/>
3859
+
3860
+ </xsl:variable>
3861
+ <xsl:value-of select="normalize-space($abstract)"/>
3862
+ </dc:description>
3863
+ <pdf:Keywords>
3864
+ <xsl:call-template name="insertKeywords"/>
3865
+ </pdf:Keywords>
3866
+ </rdf:Description>
3867
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
3868
+ <!-- XMP properties go here -->
3869
+ <xmp:CreatorTool/>
3870
+ </rdf:Description>
3871
+ </rdf:RDF>
3872
+ </x:xmpmeta>
3873
+ </fo:declarations>
3874
+ </xsl:template><xsl:template name="getId">
3875
+ <xsl:choose>
3876
+ <xsl:when test="../@id">
3877
+ <xsl:value-of select="../@id"/>
3878
+ </xsl:when>
3879
+ <xsl:otherwise>
3880
+ <!-- <xsl:value-of select="concat(local-name(..), '_', text())"/> -->
3881
+ <xsl:value-of select="concat(generate-id(..), '_', text())"/>
3882
+ </xsl:otherwise>
3883
+ </xsl:choose>
3884
+ </xsl:template><xsl:template name="getLevel">
3885
+ <xsl:variable name="level_total" select="count(ancestor::*)"/>
3886
+ <xsl:variable name="level">
3887
+ <xsl:choose>
3888
+ <xsl:when test="ancestor::*[local-name() = 'preface']">
3889
+ <xsl:value-of select="$level_total - 2"/>
3890
+ </xsl:when>
3891
+ <xsl:when test="ancestor::*[local-name() = 'sections']">
3892
+ <xsl:value-of select="$level_total - 2"/>
3893
+ </xsl:when>
3894
+ <xsl:when test="ancestor::*[local-name() = 'bibliography']">
3895
+ <xsl:value-of select="$level_total - 2"/>
3896
+ </xsl:when>
3897
+ <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
3898
+ <xsl:otherwise>
3899
+ <xsl:value-of select="$level_total - 1"/>
3900
+ </xsl:otherwise>
3901
+ </xsl:choose>
3902
+ </xsl:variable>
3903
+ <xsl:value-of select="$level"/>
3904
+ </xsl:template><xsl:template name="getSubSection">
3905
+ <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']"/>
3906
+ </xsl:template><xsl:template name="split">
3907
+ <xsl:param name="pText" select="."/>
3908
+ <xsl:param name="sep" select="','"/>
3909
+ <xsl:if test="string-length($pText) &gt;0">
3910
+ <item>
3911
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
3912
+ </item>
3913
+ <xsl:call-template name="split">
3914
+ <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
3915
+ <xsl:with-param name="sep" select="$sep"/>
3916
+ </xsl:call-template>
3917
+ </xsl:if>
3918
+ </xsl:template><xsl:template name="getDocumentId">
3919
+ <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
3920
+ </xsl:template><xsl:template name="namespaceCheck">
3921
+ <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
3922
+ <xsl:variable name="XSLNS">
3923
+
3924
+
3925
+
3926
+
3927
+
3928
+
3929
+ <xsl:value-of select="document('')//*/namespace::ogc"/>
3930
+
3931
+
3932
+
3933
+
3934
+
3935
+
3936
+
3937
+ </xsl:variable>
3938
+ <xsl:if test="$documentNS != $XSLNS">
3939
+ <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
3940
+ </xsl:if>
3941
+ </xsl:template><xsl:template name="getLanguage">
3942
+ <xsl:param name="lang"/>
3943
+ <xsl:variable name="language" select="java:toLowerCase(java:java.lang.String.new($lang))"/>
3944
+ <xsl:choose>
3945
+ <xsl:when test="$language = 'en'">English</xsl:when>
3946
+ <xsl:when test="$language = 'fr'">French</xsl:when>
3947
+ <xsl:when test="$language = 'de'">Deutsch</xsl:when>
3948
+ <xsl:when test="$language = 'cn'">Chinese</xsl:when>
3949
+ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
3950
+ </xsl:choose>
3387
3951
  </xsl:template></xsl:stylesheet>