metanorma-ogc 1.0.9 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) 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/converter.rb +19 -20
  7. data/lib/asciidoctor/ogc/isodoc.rng +12 -6
  8. data/lib/asciidoctor/ogc/validate.rb +13 -25
  9. data/lib/isodoc/ogc.rb +2 -0
  10. data/lib/isodoc/ogc/base_convert.rb +3 -71
  11. data/lib/isodoc/ogc/html/_coverpage.css +195 -0
  12. data/lib/isodoc/ogc/html/htmlstyle.css +1084 -0
  13. data/lib/isodoc/ogc/html/ogc.css +835 -0
  14. data/lib/isodoc/ogc/html/wordstyle.css +1253 -0
  15. data/lib/isodoc/ogc/html/wordstyle.scss +0 -1
  16. data/lib/isodoc/ogc/html_convert.rb +2 -5
  17. data/lib/isodoc/ogc/i18n-en.yaml +1 -0
  18. data/lib/isodoc/ogc/i18n.rb +10 -0
  19. data/lib/isodoc/ogc/init.rb +32 -0
  20. data/lib/isodoc/ogc/metadata.rb +1 -1
  21. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +1862 -1447
  22. data/lib/isodoc/ogc/ogc.best-practice.xsl +1862 -1447
  23. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +1862 -1447
  24. data/lib/isodoc/ogc/ogc.community-practice.xsl +1862 -1447
  25. data/lib/isodoc/ogc/ogc.community-standard.xsl +1862 -1447
  26. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +1862 -1447
  27. data/lib/isodoc/ogc/ogc.engineering-report.xsl +1862 -1447
  28. data/lib/isodoc/ogc/ogc.other.xsl +1862 -1447
  29. data/lib/isodoc/ogc/ogc.policy.xsl +1862 -1447
  30. data/lib/isodoc/ogc/ogc.reference-model.xsl +1862 -1447
  31. data/lib/isodoc/ogc/ogc.release-notes.xsl +1862 -1447
  32. data/lib/isodoc/ogc/ogc.standard.xsl +1862 -1447
  33. data/lib/isodoc/ogc/ogc.test-suite.xsl +1862 -1447
  34. data/lib/isodoc/ogc/ogc.user-guide.xsl +1862 -1447
  35. data/lib/isodoc/ogc/ogc.white-paper.xsl +1966 -1799
  36. data/lib/isodoc/ogc/pdf_convert.rb +0 -13
  37. data/lib/isodoc/ogc/presentation_xml_convert.rb +137 -0
  38. data/lib/isodoc/ogc/reqt.rb +4 -27
  39. data/lib/isodoc/ogc/sections.rb +18 -63
  40. data/lib/isodoc/ogc/word_convert.rb +6 -9
  41. data/lib/isodoc/ogc/{reqt_xref.rb → xref.rb} +65 -5
  42. data/lib/metanorma/ogc/processor.rb +6 -8
  43. data/lib/metanorma/ogc/version.rb +1 -1
  44. data/metanorma-ogc.gemspec +3 -4
  45. metadata +32 -40
@@ -1153,4 +1153,3 @@ ol
1153
1153
  ul
1154
1154
  {margin-bottom:0cm;
1155
1155
  margin-left:18pt;}
1156
-
@@ -1,4 +1,5 @@
1
1
  require_relative "base_convert"
2
+ require_relative "init"
2
3
  require "fileutils"
3
4
  require "isodoc"
4
5
  require_relative "metadata"
@@ -12,7 +13,6 @@ module IsoDoc
12
13
  class HtmlConvert < IsoDoc::HtmlConvert
13
14
  def initialize(options)
14
15
  @libdir = File.dirname(__FILE__)
15
- @reqtlabels = {}
16
16
  super
17
17
  end
18
18
 
@@ -33,10 +33,6 @@ module IsoDoc
33
33
  }
34
34
  end
35
35
 
36
- def metadata_init(lang, script, labels)
37
- @meta = Metadata.new(lang, script, labels)
38
- end
39
-
40
36
  def googlefonts
41
37
  <<~HEAD.freeze
42
38
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet" />
@@ -87,6 +83,7 @@ module IsoDoc
87
83
  end
88
84
 
89
85
  include BaseConvert
86
+ include Init
90
87
  end
91
88
  end
92
89
  end
@@ -1,4 +1,5 @@
1
1
  foreword: Preface
2
+ submitters: Submitters
2
3
  recommendationtest: Recommendation Test
3
4
  requirementtest: Requirement Test
4
5
  permissiontest: Permission Test
@@ -0,0 +1,10 @@
1
+ module IsoDoc
2
+ module Ogc
3
+ class I18n < IsoDoc::I18n
4
+ def load_yaml1(lang, script)
5
+ y = YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
6
+ super.merge(y)
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,32 @@
1
+ require "isodoc"
2
+ require_relative "metadata"
3
+ require_relative "xref"
4
+ require_relative "i18n"
5
+
6
+ module IsoDoc
7
+ module Ogc
8
+ module Init
9
+ def metadata_init(lang, script, labels)
10
+ @meta = Metadata.new(lang, script, labels)
11
+ end
12
+
13
+ def xref_init(lang, script, klass, labels, options)
14
+ html = HtmlConvert.new(language: lang, script: script)
15
+ @xrefs = Xref.new(lang, script, html, labels, options)
16
+ end
17
+
18
+ def i18n_init(lang, script, i18nyaml = nil)
19
+ @i18n = I18n.new(lang, script, i18nyaml || @i18nyaml)
20
+ end
21
+
22
+ def fileloc(loc)
23
+ File.join(File.dirname(__FILE__), loc)
24
+ end
25
+
26
+ def submittingorgs_path
27
+ "//bibdata/contributor[role/@type = 'author']/organization/name"
28
+ end
29
+ end
30
+ end
31
+ end
32
+
@@ -34,7 +34,7 @@ module IsoDoc
34
34
  }
35
35
 
36
36
  class Metadata < IsoDoc::Metadata
37
- def initialize(lang, script, labels)
37
+ def initialize(lang, script, i18n)
38
38
  super
39
39
  end
40
40
 
@@ -1,7 +1,10 @@
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
+
5
+ <xsl:param name="svg_images"/>
6
+ <xsl:variable name="images" select="document($svg_images)"/>
7
+
5
8
  <xsl:variable name="pageWidth" select="'210mm'"/>
6
9
  <xsl:variable name="pageHeight" select="'297mm'"/>
7
10
 
@@ -18,7 +21,7 @@
18
21
  <xsl:text>© </xsl:text>
19
22
  <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:copyright/ogc:from"/>
20
23
  <xsl:text> </xsl:text>
21
- <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor/ogc:organization/ogc:name"/>
24
+ <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type = 'publisher']/ogc:organization/ogc:name"/>
22
25
  </xsl:variable>
23
26
 
24
27
  <xsl:variable name="doctitle" select="/ogc:ogc-standard/ogc:bibdata/ogc:title[@language = 'en']"/>
@@ -35,52 +38,32 @@
35
38
  <xsl:text>:</xsl:text>
36
39
  <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:copyright/ogc:from"/>
37
40
  </xsl:variable>
41
+
42
+ <xsl:variable name="color" select="'rgb(14, 26, 133)'"/>
38
43
 
39
44
  <xsl:variable name="contents">
40
45
  <contents>
41
46
 
42
-
43
47
  <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters -->
44
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:abstract" mode="contents"/>
45
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1]" mode="contents">
46
- <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + 1"/>
47
- </xsl:apply-templates>
48
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:foreword" mode="contents">
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
- </xsl:apply-templates>
51
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:introduction" mode="contents"/>
52
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name" mode="contents">
53
- <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) + 1"/>
54
- </xsl:apply-templates>
55
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:submitters" mode="contents">
56
- <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
- </xsl:apply-templates>
58
-
59
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']" mode="contents">
60
- <xsl:with-param name="sectionNum" select="'1'"/>
61
- </xsl:apply-templates>
62
-
63
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']" mode="contents">
64
- <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + 1"/>
65
- </xsl:apply-templates>
66
48
 
67
- <!-- Normative references -->
68
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references']" mode="contents">
69
- <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
- </xsl:apply-templates>
49
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/*" mode="contents"/>
71
50
 
72
- <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"/>
74
- </xsl:apply-templates>
51
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']" mode="contents"/>
52
+
53
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']" mode="contents"/>
54
+
55
+ <!-- Normative references -->
56
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']" mode="contents"/>
75
57
 
58
+ <!-- Terms and definitions -->
59
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:terms" mode="contents"/>
76
60
 
77
- <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)"/>
79
- </xsl:apply-templates>
80
-
81
-
61
+ <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"/>
62
+
82
63
  <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] -->
64
+
65
+ <!-- Bibliography -->
66
+ <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
67
 
85
68
 
86
69
  </contents>
@@ -91,7 +74,7 @@
91
74
  </xsl:variable>
92
75
 
93
76
  <xsl:template match="/">
94
- <xsl:message>INFO: Document namespace: '<xsl:value-of select="namespace-uri(/*)"/>'</xsl:message>
77
+ <xsl:call-template name="namespaceCheck"/>
95
78
  <fo:root font-family="Times New Roman, STIX2Math, HanSans" font-size="10.5pt" xml:lang="{$lang}">
96
79
  <fo:layout-master-set>
97
80
  <!-- Cover page -->
@@ -161,44 +144,7 @@
161
144
 
162
145
  </fo:layout-master-set>
163
146
 
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>
147
+ <xsl:call-template name="addPDFUAmeta"/>
202
148
 
203
149
  <!-- Cover Page -->
204
150
  <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
@@ -274,7 +220,7 @@
274
220
  </fo:block>
275
221
  </fo:block>
276
222
  <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"/>
223
+ <xsl:value-of select="$doctitle"/>
278
224
  </fo:block>
279
225
  <fo:block margin-bottom="12pt"> </fo:block>
280
226
  <!-- Copyright notice -->
@@ -287,6 +233,16 @@
287
233
  <fo:table-column column-width="35mm"/>
288
234
  <fo:table-column column-width="70mm"/>
289
235
  <fo:table-body>
236
+ <fo:table-row height="9mm">
237
+ <fo:table-cell>
238
+ <fo:block>Document number: </fo:block>
239
+ </fo:table-cell>
240
+ <fo:table-cell>
241
+ <fo:block>
242
+ <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:docnumber"/>
243
+ </fo:block>
244
+ </fo:table-cell>
245
+ </fo:table-row>
290
246
  <fo:table-row height="9mm">
291
247
  <fo:table-cell>
292
248
  <fo:block>Document type: </fo:block>
@@ -295,6 +251,18 @@
295
251
  <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
252
  </fo:table-cell>
297
253
  </fo:table-row>
254
+ <fo:table-row height="9mm">
255
+ <fo:table-cell>
256
+ <fo:block>Document subtype: </fo:block>
257
+ </fo:table-cell>
258
+ <fo:table-cell>
259
+ <fo:block>
260
+ <xsl:call-template name="capitalizeWords">
261
+ <xsl:with-param name="str" select="/ogc:ogc-standard/ogc:bibdata/ogc:ext/ogc:docsubtype"/>
262
+ </xsl:call-template>
263
+ </fo:block>
264
+ </fo:table-cell>
265
+ </fo:table-row>
298
266
  <fo:table-row height="9mm">
299
267
  <fo:table-cell>
300
268
  <fo:block>Document stage: </fo:block>
@@ -302,8 +270,9 @@
302
270
  <fo:table-cell>
303
271
  <fo:block>
304
272
  <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)"/>
273
+ <xsl:call-template name="capitalize">
274
+ <xsl:with-param name="str" select="$stage"/>
275
+ </xsl:call-template>
307
276
  </fo:block>
308
277
  </fo:table-cell>
309
278
  </fo:table-row>
@@ -312,7 +281,11 @@
312
281
  <fo:block>Document language: </fo:block>
313
282
  </fo:table-cell>
314
283
  <fo:table-cell>
315
- <fo:block><xsl:value-of select="$lang"/></fo:block>
284
+ <fo:block>
285
+ <xsl:call-template name="getLanguage">
286
+ <xsl:with-param name="lang" select="$lang"/>
287
+ </xsl:call-template>
288
+ </fo:block>
316
289
  </fo:table-cell>
317
290
  </fo:table-row>
318
291
  </fo:table-body>
@@ -348,10 +321,15 @@
348
321
  <fo:block> </fo:block>
349
322
  <fo:block break-after="page"/>
350
323
 
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>
324
+ <fo:block-container font-weight="bold" line-height="115%" margin-bottom="36pt">
325
+ <xsl:variable name="title-toc">
326
+ <xsl:call-template name="getTitle">
327
+ <xsl:with-param name="name" select="'title-toc'"/>
328
+ </xsl:call-template>
329
+ </xsl:variable>
330
+ <fo:block font-size="14pt" margin-top="2pt" margin-bottom="15.5pt"><xsl:value-of select="$title-toc"/></fo:block>
353
331
 
354
- <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'))] -->
332
+ <xsl:for-each select="xalan:nodeset($contents)//item">
355
333
 
356
334
  <fo:block>
357
335
  <xsl:if test="@level = 1">
@@ -359,30 +337,23 @@
359
337
  </xsl:if>
360
338
  <fo:list-block>
361
339
  <xsl:attribute name="provisional-distance-between-starts">
362
- <xsl:choose>
363
- <!-- skip 0 section without subsections -->
364
- <xsl:when test="@section != '' and not(@display-section = 'false')">8mm</xsl:when>
340
+ <xsl:choose>
341
+ <xsl:when test="@section != ''">8mm</xsl:when>
365
342
  <xsl:otherwise>0mm</xsl:otherwise>
366
343
  </xsl:choose>
367
344
  </xsl:attribute>
368
345
  <fo:list-item>
369
346
  <fo:list-item-label end-indent="label-end()">
370
347
  <fo:block>
371
- <xsl:if test="@section and not(@display-section = 'false')"> <!-- output below -->
372
- <xsl:value-of select="@section"/><xsl:text>.</xsl:text>
373
- </xsl:if>
348
+ <xsl:value-of select="@section"/>
374
349
  </fo:block>
375
350
  </fo:list-item-label>
376
351
  <fo:list-item-body start-indent="body-start()">
377
352
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
378
353
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
379
- <xsl:if test="@section and @display-section = 'false' and not(@section = '0')">
380
- <xsl:value-of select="@section"/><xsl:text> </xsl:text>
381
- </xsl:if>
382
- <xsl:if test="@addon != ''">
383
- <xsl:text>(</xsl:text><xsl:value-of select="@addon"/><xsl:text>)</xsl:text>
384
- </xsl:if>
385
- <xsl:text> </xsl:text><xsl:value-of select="text()"/>
354
+
355
+ <xsl:apply-templates/>
356
+
386
357
  <fo:inline keep-together.within-line="always">
387
358
  <fo:leader leader-pattern="dots"/>
388
359
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
@@ -395,19 +366,41 @@
395
366
  </fo:block>
396
367
  </xsl:for-each>
397
368
 
398
- <xsl:if test="xalan:nodeset($contents)//item[@type = 'table']">
369
+ <xsl:if test="//ogc:table[@id and ogc:name]">
370
+ <fo:block font-size="12pt"> </fo:block>
371
+ <fo:block font-size="12pt"> </fo:block>
372
+ <xsl:variable name="title-list-tables">
373
+ <xsl:call-template name="getTitle">
374
+ <xsl:with-param name="name" select="'title-list-tables'"/>
375
+ </xsl:call-template>
376
+ </xsl:variable>
377
+ <fo:block font-size="14pt" font-weight="bold" space-before="48pt" margin-bottom="15.5pt"><xsl:value-of select="$title-list-tables"/></fo:block>
378
+ <xsl:for-each select="//ogc:table[@id and ogc:name]">
379
+ <fo:block text-align-last="justify" margin-top="6pt">
380
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}">
381
+ <xsl:apply-templates select="ogc:name" mode="contents"/>
382
+ <fo:inline keep-together.within-line="always">
383
+ <fo:leader leader-pattern="dots"/>
384
+ <fo:page-number-citation ref-id="{@id}"/>
385
+ </fo:inline>
386
+ </fo:basic-link>
387
+ </fo:block>
388
+ </xsl:for-each>
389
+ </xsl:if>
390
+
391
+ <xsl:if test="//ogc:figure[@id and ogc:name]">
399
392
  <fo:block font-size="12pt"> </fo:block>
400
393
  <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>
402
- <xsl:for-each select="xalan:nodeset($contents)//item[@type = 'table']">
394
+ <xsl:variable name="title-list-figures">
395
+ <xsl:call-template name="getTitle">
396
+ <xsl:with-param name="name" select="'title-list-figures'"/>
397
+ </xsl:call-template>
398
+ </xsl:variable>
399
+ <fo:block font-size="14pt" font-weight="bold" space-before="48pt" margin-bottom="15.5pt"><xsl:value-of select="$title-list-figures"/></fo:block>
400
+ <xsl:for-each select="//ogc:figure[@id and ogc:name]">
403
401
  <fo:block text-align-last="justify" margin-top="6pt">
404
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{@section}">
405
- <xsl:value-of select="@section"/>
406
- <xsl:if test="text() != ''">
407
- <xsl:text> — </xsl:text>
408
- <xsl:value-of select="text()"/>
409
- </xsl:if>
410
- <xsl:text> </xsl:text>
402
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}">
403
+ <xsl:apply-templates select="ogc:name" mode="contents"/>
411
404
  <fo:inline keep-together.within-line="always">
412
405
  <fo:leader leader-pattern="dots"/>
413
406
  <fo:page-number-citation ref-id="{@id}"/>
@@ -417,19 +410,19 @@
417
410
  </xsl:for-each>
418
411
  </xsl:if>
419
412
 
420
- <xsl:if test="xalan:nodeset($contents)//item[@type = 'figure']">
413
+ <xsl:if test="//ogc:permission[@id and ogc:name] or //ogc:recommendation[@id and ogc:name] or //ogc:requirement[@id and ogc:name]">
421
414
  <fo:block font-size="12pt"> </fo:block>
422
415
  <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>
424
- <xsl:for-each select="xalan:nodeset($contents)//item[@type = 'figure']">
416
+ <xsl:variable name="title-list-recommendations">
417
+ <xsl:call-template name="getTitle">
418
+ <xsl:with-param name="name" select="'title-list-recommendations'"/>
419
+ </xsl:call-template>
420
+ </xsl:variable>
421
+ <fo:block font-size="14pt" font-weight="bold" space-before="48pt" margin-bottom="15.5pt"><xsl:value-of select="$title-list-recommendations"/></fo:block>
422
+ <xsl:for-each select="//ogc:permission[@id and ogc:name] | //ogc:recommendation[@id and ogc:name] | //ogc:requirement[@id and ogc:name]">
425
423
  <fo:block text-align-last="justify" margin-top="6pt">
426
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{@section}">
427
- <xsl:value-of select="@section"/>
428
- <xsl:if test="text() != ''">
429
- <xsl:text> — </xsl:text>
430
- <xsl:value-of select="text()"/>
431
- </xsl:if>
432
- <xsl:text> </xsl:text>
424
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}">
425
+ <xsl:apply-templates select="ogc:name" mode="contents"/>
433
426
  <fo:inline keep-together.within-line="always">
434
427
  <fo:leader leader-pattern="dots"/>
435
428
  <fo:page-number-citation ref-id="{@id}"/>
@@ -439,26 +432,12 @@
439
432
  </xsl:for-each>
440
433
  </xsl:if>
441
434
 
435
+
442
436
  </fo:block-container>
443
437
 
444
-
445
438
  <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters -->
446
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:abstract" mode="abstract"/>
447
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1]">
448
- <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + 1"/>
449
- </xsl:apply-templates>
450
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:foreword" mode="preface">
451
- <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ 1"/>
452
- </xsl:apply-templates>
453
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:introduction" mode="introduction"/>
454
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name">
455
- <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) + 1"/>
456
- </xsl:apply-templates>
457
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:submitters">
458
- <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
- </xsl:apply-templates>
460
-
461
-
439
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/*" mode="preface"/>
440
+
462
441
  </fo:flow>
463
442
  </fo:page-sequence>
464
443
 
@@ -480,31 +459,22 @@
480
459
 
481
460
  <fo:block line-height="125%">
482
461
 
483
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']">
484
- <xsl:with-param name="sectionNum" select="'1'"/>
485
- </xsl:apply-templates>
462
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']"/>
486
463
 
487
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']">
488
- <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + 1"/>
489
- </xsl:apply-templates>
464
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']"/>
490
465
 
491
466
  <!-- Normative references -->
492
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references']">
493
- <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
- </xsl:apply-templates>
495
-
496
- <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"/>
498
- </xsl:apply-templates>
499
-
500
-
501
- <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)"/>
503
- </xsl:apply-templates>
467
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']"/>
468
+
469
+ <!-- Terms and definitions -->
470
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:terms"/>
504
471
 
472
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/*[local-name() != 'terms' and not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]"/>
505
473
 
506
474
  <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] -->
475
+
476
+ <!-- Bibliography -->
477
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']"/> <!-- [position() &gt; 1] -->
508
478
 
509
479
  </fo:block>
510
480
  </fo:flow>
@@ -515,257 +485,57 @@
515
485
  </fo:root>
516
486
  </xsl:template>
517
487
 
518
- <!-- for pass the paremeter 'sectionNum' over templates, like 'tunnel' parameter in XSLT 2.0 -->
519
- <xsl:template match="node()">
520
- <xsl:param name="sectionNum"/>
521
- <xsl:param name="sectionNumSkew"/>
522
- <xsl:apply-templates>
523
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
524
- <xsl:with-param name="sectionNumSkew" select="$sectionNumSkew"/>
525
- </xsl:apply-templates>
488
+ <xsl:template match="node()">
489
+ <xsl:apply-templates/>
526
490
  </xsl:template>
527
491
 
528
492
  <!-- ============================= -->
529
493
  <!-- CONTENTS -->
530
494
  <!-- ============================= -->
531
- <xsl:template match="node()" mode="contents">
532
- <xsl:param name="sectionNum"/>
533
- <xsl:param name="sectionNumSkew"/>
534
- <xsl:apply-templates mode="contents">
535
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
536
- <xsl:with-param name="sectionNumSkew" select="$sectionNumSkew"/>
537
- </xsl:apply-templates>
495
+ <xsl:template match="node()" mode="contents">
496
+ <xsl:apply-templates mode="contents"/>
538
497
  </xsl:template>
539
498
 
540
-
541
- <!-- calculate main section number (1,2,3) and pass it deep into templates -->
542
- <!-- it's necessary, because there is itu:bibliography/itu:references from other section, but numbering should be sequental -->
543
- <xsl:template match="ogc:ogc-standard/ogc:sections/*" mode="contents">
544
- <xsl:param name="sectionNum"/>
545
- <xsl:param name="sectionNumSkew" select="0"/>
546
- <xsl:variable name="sectionNum_">
547
- <xsl:choose>
548
- <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
549
- <xsl:when test="$sectionNumSkew != 0">
550
- <xsl:variable name="number"><xsl:number count="ogc:sections/ogc:clause[not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]"/></xsl:variable> <!-- * ogc:sections/ogc:clause | ogc:sections/ogc:terms -->
551
- <xsl:value-of select="$number + $sectionNumSkew"/>
552
- </xsl:when>
553
- <xsl:otherwise>
554
- <xsl:number count="*"/>
555
- </xsl:otherwise>
556
- </xsl:choose>
557
- </xsl:variable>
558
- <xsl:apply-templates mode="contents">
559
- <xsl:with-param name="sectionNum" select="$sectionNum_"/>
560
- </xsl:apply-templates>
561
- </xsl:template>
562
- <xsl:template match="ogc:ogc-standard/ogc:sections/ogc:terms" mode="contents">
563
- <xsl:param name="sectionNum"/>
564
- <xsl:param name="sectionNumSkew" select="0"/>
565
- <xsl:variable name="sectionNum_">
566
- <xsl:choose>
567
- <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
568
- <xsl:when test="$sectionNumSkew != 0">
569
- <xsl:variable name="number"><xsl:number count="*"/></xsl:variable> <!-- ogc:sections/ogc:clause | ogc:sections/ogc:terms -->
570
- <xsl:value-of select="$number + $sectionNumSkew"/>
571
- </xsl:when>
572
- <xsl:otherwise>
573
- <xsl:number count="*"/>
574
- </xsl:otherwise>
575
- </xsl:choose>
576
- </xsl:variable>
577
- <xsl:apply-templates mode="contents">
578
- <xsl:with-param name="sectionNum" select="$sectionNum_"/>
579
- </xsl:apply-templates>
580
- </xsl:template>
581
-
582
-
583
- <!-- Any node with title element - clause, definition, annex,... -->
584
- <xsl:template match="ogc:title | ogc:preferred" mode="contents">
585
- <xsl:param name="sectionNum"/>
586
- <xsl:variable name="id">
587
- <xsl:call-template name="getId"/>
588
- </xsl:variable>
589
-
499
+ <!-- element with title -->
500
+ <xsl:template match="*[ogc:title]" mode="contents">
590
501
  <xsl:variable name="level">
591
- <xsl:call-template name="getLevel"/>
592
- </xsl:variable>
593
-
594
- <xsl:variable name="section">
595
- <xsl:call-template name="getSection">
596
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
502
+ <xsl:call-template name="getLevel">
503
+ <xsl:with-param name="depth" select="ogc:title/@depth"/>
597
504
  </xsl:call-template>
598
505
  </xsl:variable>
599
506
 
600
507
  <xsl:variable name="display">
601
508
  <xsl:choose>
602
- <xsl:when test="ancestor::ogc:bibitem">false</xsl:when>
603
- <xsl:when test="ancestor::ogc:term">false</xsl:when>
604
- <xsl:when test="ancestor::ogc:annex and $level &gt;= 3">false</xsl:when>
605
- <xsl:when test="$level &lt;= 3">true</xsl:when>
606
- <xsl:otherwise>false</xsl:otherwise>
607
- </xsl:choose>
608
- </xsl:variable>
609
-
610
- <xsl:variable name="display-section">
611
- <xsl:choose>
612
- <xsl:when test="ancestor::ogc:annex and $level &gt;= 2">true</xsl:when>
613
- <xsl:when test="ancestor::ogc:annex">false</xsl:when>
614
- <xsl:when test="$section = '0'">false</xsl:when>
509
+ <xsl:when test="ancestor-or-self::ogc:bibitem">false</xsl:when>
510
+ <xsl:when test="ancestor-or-self::ogc:term">false</xsl:when>
511
+ <xsl:when test="$level &gt;= 3">false</xsl:when>
615
512
  <xsl:otherwise>true</xsl:otherwise>
616
513
  </xsl:choose>
617
514
  </xsl:variable>
618
515
 
619
- <xsl:variable name="type">
620
- <xsl:value-of select="local-name(..)"/>
621
- </xsl:variable>
622
-
623
- <xsl:variable name="root">
624
- <xsl:choose>
625
- <xsl:when test="ancestor::ogc:annex">annex</xsl:when>
626
- <xsl:when test="ancestor::ogc:clause">clause</xsl:when>
627
- <xsl:when test="ancestor::ogc:terms">terms</xsl:when>
628
- </xsl:choose>
629
- </xsl:variable>
630
-
631
- <item id="{$id}" level="{$level}" section="{$section}" display-section="{$display-section}" display="{$display}" type="{$type}" root="{$root}">
632
- <xsl:attribute name="addon">
633
- <xsl:if test="local-name(..) = 'annex'"><xsl:value-of select="../@obligation"/></xsl:if>
634
- </xsl:attribute>
635
- <xsl:apply-templates/>
636
- </item>
637
516
 
638
- <xsl:apply-templates mode="contents">
639
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
640
- </xsl:apply-templates>
517
+ <xsl:if test="$display = 'true'">
641
518
 
642
- </xsl:template>
643
-
644
- <xsl:template match="ogc:ogc-standard/ogc:preface/*" mode="contents">
645
- <xsl:param name="sectionNum" select="'1'"/>
646
- <xsl:variable name="section">
647
- <xsl:number format="i" value="$sectionNum"/>
648
- </xsl:variable>
649
- <xsl:variable name="id">
650
- <xsl:choose>
651
- <xsl:when test="@id">
652
- <xsl:value-of select="@id"/>
653
- </xsl:when>
654
- <xsl:otherwise>
655
- <xsl:value-of select="local-name()"/>
656
- </xsl:otherwise>
657
- </xsl:choose>
658
- </xsl:variable>
659
- <xsl:if test="not(ogc:title)">
660
- <item id="{$id}" level="1" section="{$section}" display-section="true" display="true" type="abstract" root="preface">
661
- <xsl:if test="local-name() = 'foreword'">
662
- <xsl:attribute name="display">false</xsl:attribute>
663
- </xsl:if>
664
- <xsl:choose>
665
- <xsl:when test="not(ogc:title)">
666
- <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)"/>
668
- </xsl:when>
669
- <xsl:otherwise>
670
- <xsl:value-of select="ogc:title"/>
671
- </xsl:otherwise>
672
- </xsl:choose>
519
+ <xsl:variable name="section">
520
+ <xsl:call-template name="getSection"/>
521
+ </xsl:variable>
522
+
523
+ <xsl:variable name="title">
524
+ <xsl:call-template name="getName"/>
525
+ </xsl:variable>
526
+
527
+ <xsl:variable name="type">
528
+ <xsl:value-of select="local-name()"/>
529
+ </xsl:variable>
530
+
531
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}">
532
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
673
533
  </item>
674
- </xsl:if>
675
- <xsl:apply-templates mode="contents">
676
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
677
- </xsl:apply-templates>
678
- </xsl:template>
679
-
680
- <!-- Keywords -->
681
- <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:keyword" mode="contents">
682
- <xsl:param name="sectionNum" select="'1'"/>
683
- <xsl:variable name="section">
684
- <xsl:number format="i" value="$sectionNum"/>
685
- </xsl:variable>
686
- <item id="keywords" level="1" section="{$section}" display-section="true" display="true" type="abstract" root="preface">
687
- <xsl:text>Keywords</xsl:text>
688
- </item>
689
- </xsl:template>
690
- <!-- Submitting Organizations -->
691
- <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author']/ogc:organization/ogc:name" mode="contents">
692
- <xsl:param name="sectionNum" select="'1'"/>
693
- <xsl:variable name="section">
694
- <xsl:number format="i" value="$sectionNum"/>
695
- </xsl:variable>
696
- <item id="submitting_orgs" level="1" section="{$section}" display-section="true" display="true" type="abstract" root="preface">
697
- <xsl:text>Submitting Organizations</xsl:text>
698
- </item>
699
- </xsl:template>
700
-
701
- <xsl:template match="ogc:figure" mode="contents">
702
- <xsl:param name="sectionNum"/>
703
- <item level="" id="{@id}" type="figure">
704
- <xsl:attribute name="section">
705
- <xsl:text>Figure </xsl:text>
706
- <xsl:choose>
707
- <xsl:when test="ancestor::ogc:annex">
708
- <xsl:choose>
709
- <xsl:when test="count(//ogc:annex) = 1">
710
- <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:figure"/>
711
- </xsl:when>
712
- <xsl:otherwise>
713
- <xsl:number format="A.1-1" level="multiple" count="ogc:annex | ogc:figure"/>
714
- </xsl:otherwise>
715
- </xsl:choose>
716
- </xsl:when>
717
- <xsl:when test="ancestor::ogc:figure">
718
- <xsl:for-each select="parent::*[1]">
719
- <xsl:number format="1" level="any" count="ogc:figure[not(parent::ogc:figure)]"/>
720
- </xsl:for-each>
721
- <xsl:number format="-a" count="ogc:figure"/>
722
- </xsl:when>
723
- <xsl:otherwise>
724
- <xsl:number format="1" level="any" count="ogc:figure[not(parent::ogc:figure)] | ogc:sourcecode[not(@unnumbered = 'true') and not(ancestor::ogc:example)]"/>
725
- <!-- <xsl:number format="1.1-1" level="multiple" count="ogc:annex | ogc:figure"/> -->
726
- </xsl:otherwise>
727
- </xsl:choose>
728
- </xsl:attribute>
729
- <xsl:value-of select="ogc:name"/>
730
- </item>
731
- </xsl:template>
732
-
733
-
734
-
735
- <xsl:template match="ogc:table[not(@unnumbered='true')]" mode="contents">
736
- <xsl:param name="sectionNum"/>
737
- <xsl:variable name="annex-id" select="ancestor::ogc:annex/@id"/>
738
- <item level="" id="{@id}" display="false" type="table">
739
- <xsl:attribute name="section">
740
- <xsl:text>Table </xsl:text>
741
- <xsl:choose>
742
- <xsl:when test="ancestor::*[local-name()='executivesummary']">
743
- <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered='true')]"/>
744
- </xsl:when>
745
- <xsl:when test="ancestor::*[local-name()='annex']">
746
- <xsl:number format="A-" count="ogc:annex"/>
747
- <xsl:number format="1" level="any" count="ogc:table[ancestor::ogc:annex[@id = $annex-id]][not(@unnumbered='true')]"/>
748
- </xsl:when>
749
- <xsl:otherwise>
750
- <xsl:number format="1" level="any" count="*[local-name()='sections']//*[local-name()='table'][not(@unnumbered='true')] | *[local-name()='preface']//*[local-name()='table'][not(@unnumbered='true')]"/>
751
- </xsl:otherwise>
752
- </xsl:choose>
753
- </xsl:attribute>
754
- <xsl:value-of select="ogc:name/text()"/>
755
- </item>
756
- </xsl:template>
757
-
758
-
759
-
760
- <xsl:template match="ogc:formula" mode="contents">
761
- <item level="" id="{@id}" display="false">
762
- <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>
764
- </xsl:attribute>
765
- </item>
534
+ <xsl:apply-templates mode="contents"/>
535
+ </xsl:if>
536
+
766
537
  </xsl:template>
767
538
 
768
- <xsl:template match="ogc:fn" mode="contents"/>
769
539
  <!-- ============================= -->
770
540
  <!-- ============================= -->
771
541
 
@@ -778,7 +548,12 @@
778
548
 
779
549
  <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:edition">
780
550
  <fo:block margin-bottom="12pt">
781
- <xsl:text>Version: </xsl:text>
551
+ <xsl:variable name="title-edition">
552
+ <xsl:call-template name="getTitle">
553
+ <xsl:with-param name="name" select="'title-edition'"/>
554
+ </xsl:call-template>
555
+ </xsl:variable>
556
+ <xsl:value-of select="$title-edition"/><xsl:text>: </xsl:text>
782
557
  <xsl:value-of select="."/><xsl:text> </xsl:text>
783
558
  </fo:block>
784
559
  </xsl:template>
@@ -817,7 +592,7 @@
817
592
  <xsl:attribute name="text-align">
818
593
  <xsl:choose>
819
594
  <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
820
- <xsl:otherwise>left</xsl:otherwise>
595
+ <xsl:otherwise>center</xsl:otherwise>
821
596
  </xsl:choose>
822
597
  </xsl:attribute>
823
598
  <xsl:apply-templates/>
@@ -856,167 +631,40 @@
856
631
  </fo:block>
857
632
  </xsl:template>
858
633
 
859
-
860
- <!-- Introduction -->
861
- <xsl:template match="ogc:ogc-standard/ogc:preface/ogc:introduction" mode="introduction">
862
- <fo:block break-after="page"/>
863
- <xsl:apply-templates select="current()"/>
864
- </xsl:template>
865
- <!-- Abstract -->
866
- <xsl:template match="ogc:ogc-standard/ogc:preface/ogc:abstract" mode="abstract">
867
- <fo:block break-after="page"/>
868
- <xsl:apply-templates select="current()"/>
869
- </xsl:template>
870
- <!-- Preface -->
871
- <xsl:template match="ogc:ogc-standard/ogc:preface/ogc:foreword" mode="preface">
872
- <xsl:param name="sectionNum"/>
873
- <fo:block break-after="page"/>
874
- <xsl:apply-templates select="current()">
875
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
876
- </xsl:apply-templates>
877
- </xsl:template>
878
- <!-- Abstract, Preface -->
879
- <xsl:template match="ogc:ogc-standard/ogc:preface/*">
880
- <xsl:param name="sectionNum" select="'1'"/>
881
- <xsl:if test="not(ogc:title)">
882
- <xsl:variable name="id">
883
- <xsl:choose>
884
- <xsl:when test="@id">
885
- <xsl:value-of select="@id"/>
886
- </xsl:when>
887
- <xsl:otherwise>
888
- <xsl:value-of select="local-name()"/>
889
- </xsl:otherwise>
890
- </xsl:choose>
891
- </xsl:variable>
892
- <fo:block id="{$id}" font-size="13pt" font-weight="bold" margin-bottom="12pt" color="rgb(14, 26, 133)">
893
- <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="3mm"> </fo:inline>
894
- <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)"/>
896
- </fo:block>
897
- </xsl:if>
898
- <xsl:apply-templates/>
899
- </xsl:template>
900
- <!-- Keywords -->
901
- <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:keyword">
902
- <xsl:param name="sectionNum" select="'1'"/>
903
- <fo:block id="keywords" font-size="13pt" font-weight="bold" margin-top="13.5pt" margin-bottom="12pt" color="rgb(14, 26, 133)">
904
- <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="2mm"> </fo:inline>
905
- <xsl:text>Keywords</xsl:text>
906
- </fo:block>
907
- <fo:block margin-bottom="12pt">The following are keywords to be used by search engines and document catalogues.</fo:block>
908
- <fo:block margin-bottom="12pt">
909
- <xsl:call-template name="insertKeywords">
910
- <xsl:with-param name="sorting">no</xsl:with-param>
911
- <xsl:with-param name="charAtEnd"/>
912
- </xsl:call-template>
913
- <!-- <xsl:for-each select="/ogc:ogc-standard/ogc:bibdata/ogc:keyword">
914
- <xsl:value-of select="."/>
915
- <xsl:if test="position() != last()">, </xsl:if>
916
- </xsl:for-each> -->
917
- </fo:block>
918
- </xsl:template>
919
- <!-- Submitting Organizations -->
920
- <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author']/ogc:organization/ogc:name">
921
- <xsl:param name="sectionNum" select="'1'"/>
922
- <fo:block id="submitting_orgs" font-size="13pt" font-weight="bold" color="rgb(14, 26, 133)" margin-top="13.5pt" margin-bottom="12pt">
923
- <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="3mm"> </fo:inline>
924
- <xsl:text>Submitting Organizations</xsl:text>
634
+ <xsl:template match="/*/*[local-name() = 'preface']/*" priority="3">
635
+ <fo:block>
636
+ <xsl:call-template name="setId"/>
637
+ <xsl:apply-templates/>
925
638
  </fo:block>
926
- <fo:block margin-bottom="12pt">The following organizations submitted this Document to the Open Geospatial Consortium (OGC):</fo:block>
927
- <fo:list-block provisional-distance-between-starts="6.5mm" margin-bottom="12pt" line-height="115%">
928
- <xsl:for-each select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author']/ogc:organization/ogc:name">
929
- <fo:list-item>
930
- <fo:list-item-label end-indent="label-end()">
931
- <fo:block>—</fo:block>
932
- </fo:list-item-label>
933
- <fo:list-item-body start-indent="body-start()" line-height-shift-adjustment="disregard-shifts">
934
- <fo:block>
935
- <xsl:apply-templates/>
936
- </fo:block>
937
- </fo:list-item-body>
938
- </fo:list-item>
939
- </xsl:for-each>
940
- </fo:list-block>
941
639
  </xsl:template>
942
-
943
640
 
944
- <!-- clause, terms, clause, ...-->
945
- <xsl:template match="ogc:ogc-standard/ogc:sections/*">
946
- <xsl:param name="sectionNum"/>
947
- <xsl:param name="sectionNumSkew" select="0"/>
948
- <fo:block>
949
- <xsl:variable name="pos"><xsl:number count="ogc:sections/ogc:clause[not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]"/></xsl:variable> <!-- | ogc:sections/ogc:terms -->
950
- <xsl:if test="$pos &gt;= 2">
951
- <xsl:attribute name="space-before">18pt</xsl:attribute>
952
- </xsl:if>
953
- <xsl:variable name="sectionNum_">
954
- <xsl:choose>
955
- <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
956
- <xsl:when test="$sectionNumSkew != 0">
957
- <xsl:variable name="number"><xsl:number count="ogc:sections/ogc:clause[not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]"/></xsl:variable> <!-- | ogc:sections/ogc:terms -->
958
- <xsl:value-of select="$number + $sectionNumSkew"/>
959
- </xsl:when>
960
- <xsl:otherwise>
961
- <xsl:number count="*"/>
962
- </xsl:otherwise>
963
- </xsl:choose>
964
- </xsl:variable>
965
- <xsl:if test="not(ogc:title)">
966
- <fo:block margin-top="3pt" margin-bottom="12pt">
967
- <xsl:value-of select="$sectionNum_"/><xsl:number format=".1 " level="multiple" count="ogc:clause[not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]"/>
968
- </fo:block>
969
- </xsl:if>
970
- <xsl:apply-templates>
971
- <xsl:with-param name="sectionNum" select="$sectionNum_"/>
972
- </xsl:apply-templates>
973
- </fo:block>
641
+ <xsl:template match="ogc:ogc-standard/ogc:preface/*" mode="preface">
642
+ <xsl:if test="local-name() = 'introduction' or local-name() = 'abstract' or local-name() = 'foreword'">
643
+ <fo:block break-after="page"/>
644
+ </xsl:if>
645
+ <xsl:apply-templates select="current()"/>
974
646
  </xsl:template>
975
647
 
976
648
 
977
649
 
978
- <xsl:template match="ogc:clause//ogc:clause[not(ogc:title)]">
979
- <xsl:param name="sectionNum"/>
980
- <xsl:variable name="section">
981
- <xsl:call-template name="getSection">
982
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
983
- </xsl:call-template>
984
- </xsl:variable>
985
-
986
- <fo:block margin-top="3pt">
987
- <fo:inline font-weight="bold" padding-right="3mm">
988
- <xsl:value-of select="$section"/>
989
- </fo:inline>
990
- <xsl:apply-templates>
991
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
992
- <xsl:with-param name="inline" select="'true'"/>
993
- </xsl:apply-templates>
650
+
651
+
652
+ <!-- ====== -->
653
+ <!-- title -->
654
+ <!-- ====== -->
655
+
656
+ <xsl:template match="ogc:annex/ogc:title">
657
+ <fo:block font-size="12pt" text-align="center" margin-bottom="12pt" keep-with-next="always" color="{$color}">
658
+ <xsl:apply-templates/>
994
659
  </fo:block>
995
660
  </xsl:template>
996
661
 
997
-
998
662
  <xsl:template match="ogc:title">
999
- <xsl:param name="sectionNum"/>
1000
-
1001
- <xsl:variable name="parent-name" select="local-name(..)"/>
1002
- <xsl:variable name="references_num_current">
1003
- <xsl:number level="any" count="ogc:references"/>
1004
- </xsl:variable>
1005
-
1006
- <xsl:variable name="id">
1007
- <xsl:call-template name="getId"/>
1008
- </xsl:variable>
1009
663
 
1010
664
  <xsl:variable name="level">
1011
665
  <xsl:call-template name="getLevel"/>
1012
666
  </xsl:variable>
1013
667
 
1014
- <xsl:variable name="section">
1015
- <xsl:call-template name="getSection">
1016
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
1017
- </xsl:call-template>
1018
- </xsl:variable>
1019
-
1020
668
  <xsl:variable name="font-size">
1021
669
  <xsl:choose>
1022
670
  <xsl:when test="ancestor::ogc:preface and $level &gt;= 2">12pt</xsl:when>
@@ -1036,59 +684,19 @@
1036
684
  </xsl:choose>
1037
685
  </xsl:variable>
1038
686
 
1039
- <xsl:variable name="color" select="'rgb(14, 26, 133)'"/>
1040
-
1041
- <xsl:choose>
1042
- <xsl:when test="$parent-name = 'annex'">
1043
- <fo:block id="{$id}" font-size="12pt" font-weight="bold" text-align="center" margin-bottom="12pt" keep-with-next="always" color="{$color}">
1044
- <xsl:value-of select="$section"/>
1045
- <xsl:if test=" ../@obligation">
1046
- <xsl:value-of select="$linebreak"/>
1047
- <fo:inline font-weight="normal">(<xsl:value-of select="../@obligation"/>)</fo:inline>
1048
- </xsl:if>
1049
- <xsl:value-of select="$linebreak"/>
1050
- <xsl:apply-templates/>
1051
- </fo:block>
1052
- </xsl:when>
1053
- <xsl:otherwise>
1054
- <xsl:element name="{$element-name}">
1055
- <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
1056
- <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
1057
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1058
- <xsl:attribute name="space-before">13.5pt</xsl:attribute>
1059
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1060
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
1061
- <xsl:attribute name="color"><xsl:value-of select="$color"/></xsl:attribute>
1062
- <xsl:if test="$section != ''">
1063
- <xsl:if test="$section != '0'">
1064
- <xsl:value-of select="$section"/><xsl:text>.</xsl:text>
1065
- <xsl:choose>
1066
- <xsl:when test="$level &gt;= 5"/>
1067
- <xsl:when test="$level &gt;= 4">
1068
- <fo:inline padding-right="4mm"> </fo:inline>
1069
- </xsl:when>
1070
- <xsl:when test="$level &gt;= 3 and ancestor::ogc:terms">
1071
- <fo:inline padding-right="2mm"> </fo:inline>
1072
- </xsl:when>
1073
- <xsl:when test="$level &gt;= 2">
1074
- <fo:inline padding-right="3mm"> </fo:inline>
1075
- </xsl:when>
1076
- <xsl:when test="$level = 1">
1077
- <fo:inline padding-right="3mm"> </fo:inline>
1078
- </xsl:when>
1079
- <xsl:otherwise>
1080
- <fo:inline padding-right="1mm"> </fo:inline>
1081
- </xsl:otherwise>
1082
- </xsl:choose>
1083
- </xsl:if>
1084
- </xsl:if>
1085
- <xsl:apply-templates/>
1086
- </xsl:element>
1087
- </xsl:otherwise>
1088
- </xsl:choose>
1089
-
687
+ <xsl:element name="{$element-name}">
688
+ <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
689
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
690
+ <xsl:attribute name="space-before">13.5pt</xsl:attribute>
691
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
692
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
693
+ <xsl:attribute name="color"><xsl:value-of select="$color"/></xsl:attribute>
694
+ <xsl:apply-templates/>
695
+ </xsl:element>
696
+
1090
697
  </xsl:template>
1091
-
698
+ <!-- ====== -->
699
+ <!-- ====== -->
1092
700
 
1093
701
  <xsl:template match="ogc:p">
1094
702
  <xsl:param name="inline" select="'false'"/>
@@ -1114,10 +722,13 @@
1114
722
  </xsl:attribute>
1115
723
  <xsl:attribute name="space-after">
1116
724
  <xsl:choose>
1117
- <xsl:when test="ancestor::ogc:li">0pt</xsl:when>
725
+ <xsl:when test="ancestor::ogc:li">0pt</xsl:when>
1118
726
  <xsl:otherwise>12pt</xsl:otherwise>
1119
727
  </xsl:choose>
1120
728
  </xsl:attribute>
729
+ <xsl:if test="ancestor::ogc:dd and not(ancestor::ogc:table)">
730
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
731
+ </xsl:if>
1121
732
  <xsl:attribute name="line-height">115%</xsl:attribute>
1122
733
  <xsl:apply-templates/>
1123
734
  </xsl:element>
@@ -1139,7 +750,7 @@
1139
750
  <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
1140
751
  </fn>
1141
752
  -->
1142
- <xsl:template match="ogc:title/ogc:fn | ogc:p/ogc:fn[not(ancestor::ogc:table)]" priority="2">
753
+ <xsl:template match="ogc:title//ogc:fn | ogc:name//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
754
  <fo:footnote keep-with-previous.within-line="always">
1144
755
  <xsl:variable name="number" select="@reference"/>
1145
756
 
@@ -1167,75 +778,7 @@
1167
778
  </fo:block>
1168
779
  </xsl:template>
1169
780
 
1170
- <xsl:template match="ogc:review">
1171
- <!-- comment 2019-11-29 -->
1172
- <!-- <fo:block font-weight="bold">Review:</fo:block>
1173
- <xsl:apply-templates /> -->
1174
- </xsl:template>
1175
-
1176
- <xsl:template match="text()">
1177
- <xsl:value-of select="."/>
1178
- </xsl:template>
1179
-
1180
781
 
1181
- <xsl:template match="ogc:image"> <!-- only for without outer figure -->
1182
- <fo:block margin-top="12pt" margin-bottom="6pt">
1183
- <fo:external-graphic src="{@src}" width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/> <!-- content-width="75%" -->
1184
- </fo:block>
1185
- </xsl:template>
1186
-
1187
- <xsl:template match="ogc:figure">
1188
- <xsl:variable name="title">
1189
- <xsl:text>Figure </xsl:text>
1190
- </xsl:variable>
1191
-
1192
- <fo:block-container id="{@id}">
1193
- <fo:block>
1194
- <xsl:apply-templates/>
1195
- </fo:block>
1196
- <xsl:call-template name="fn_display_figure"/>
1197
- <xsl:for-each select="ogc:note//ogc:p">
1198
- <xsl:call-template name="note"/>
1199
- </xsl:for-each>
1200
- <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-top="12pt" margin-bottom="6pt" keep-with-previous="always">
1201
-
1202
- <xsl:choose>
1203
- <xsl:when test="ancestor::ogc:annex">
1204
- <xsl:choose>
1205
- <xsl:when test="local-name(..) = 'figure'">
1206
- <xsl:number format="a) "/>
1207
- </xsl:when>
1208
- <xsl:otherwise>
1209
- <xsl:value-of select="$title"/><xsl:number format="A.1-1" level="multiple" count="ogc:annex | ogc:figure"/>
1210
- </xsl:otherwise>
1211
- </xsl:choose>
1212
-
1213
- </xsl:when>
1214
- <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"/>
1216
- </xsl:otherwise>
1217
- </xsl:choose>
1218
- <xsl:if test="ogc:name">
1219
- <xsl:if test="not(local-name(..) = 'figure')">
1220
- <xsl:text> — </xsl:text>
1221
- </xsl:if>
1222
- <xsl:value-of select="ogc:name"/>
1223
- </xsl:if>
1224
- </fo:block>
1225
- </fo:block-container>
1226
- </xsl:template>
1227
-
1228
- <xsl:template match="ogc:figure/ogc:name"/>
1229
- <xsl:template match="ogc:figure/ogc:fn"/>
1230
- <xsl:template match="ogc:figure/ogc:note"/>
1231
-
1232
-
1233
- <xsl:template match="ogc:figure/ogc:image">
1234
- <fo:block text-align="center">
1235
- <fo:external-graphic src="{@src}" width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/> <!-- content-width="75%" -->
1236
- </fo:block>
1237
- </xsl:template>
1238
-
1239
782
 
1240
783
  <xsl:template match="ogc:bibitem">
1241
784
  <fo:block id="{@id}" margin-bottom="12pt" start-indent="12mm" text-indent="-12mm" line-height="115%">
@@ -1282,7 +825,7 @@
1282
825
  </xsl:template>
1283
826
 
1284
827
 
1285
- <xsl:template match="ogc:bibitem/ogc:note">
828
+ <xsl:template match="ogc:bibitem/ogc:note" priority="2">
1286
829
  <fo:footnote>
1287
830
  <xsl:variable name="number">
1288
831
  <xsl:choose>
@@ -1295,13 +838,13 @@
1295
838
  </xsl:choose>
1296
839
  </xsl:variable>
1297
840
  <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}">
841
+ <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
1299
842
  <xsl:value-of select="$number"/><!-- <xsl:text>)</xsl:text> -->
1300
843
  </fo:basic-link>
1301
844
  </fo:inline>
1302
845
  <fo:footnote-body>
1303
846
  <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" -->
847
+ <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
848
  <xsl:value-of select="$number"/><!-- <xsl:text>)</xsl:text> -->
1306
849
  </fo:inline>
1307
850
  <xsl:apply-templates/>
@@ -1325,7 +868,7 @@
1325
868
  </xsl:template>
1326
869
 
1327
870
  <xsl:template match="ogc:li">
1328
- <fo:list-item>
871
+ <fo:list-item id="{@id}">
1329
872
  <fo:list-item-label end-indent="label-end()">
1330
873
  <fo:block>
1331
874
  <xsl:choose>
@@ -1354,28 +897,28 @@
1354
897
  </fo:block>
1355
898
  </fo:list-item-label>
1356
899
  <fo:list-item-body start-indent="body-start()" line-height-shift-adjustment="disregard-shifts">
1357
- <xsl:apply-templates/>
900
+ <fo:block>
901
+ <xsl:apply-templates/>
902
+ </fo:block>
1358
903
  </fo:list-item-body>
1359
904
  </fo:list-item>
1360
905
  </xsl:template>
1361
906
 
1362
- <xsl:template match="ogc:ul/ogc:note | ogc:ol/ogc:note">
907
+ <xsl:template match="ogc:ul/ogc:note | ogc:ol/ogc:note" priority="2">
1363
908
  <fo:list-item font-size="10pt">
1364
909
  <fo:list-item-label><fo:block/></fo:list-item-label>
1365
910
  <fo:list-item-body>
1366
- <xsl:apply-templates/>
911
+ <fo:block>
912
+ <xsl:apply-templates select="ogc:name" mode="presentation"/>
913
+ <xsl:apply-templates/>
914
+ </fo:block>
1367
915
  </fo:list-item-body>
1368
916
  </fo:list-item>
1369
917
  </xsl:template>
1370
918
 
919
+
1371
920
 
1372
- <xsl:template match="ogc:preferred">
1373
- <xsl:param name="sectionNum"/>
1374
- <xsl:variable name="section">
1375
- <xsl:call-template name="getSection">
1376
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
1377
- </xsl:call-template>
1378
- </xsl:variable>
921
+ <xsl:template match="ogc:preferred">
1379
922
  <xsl:variable name="level">
1380
923
  <xsl:call-template name="getLevel"/>
1381
924
  </xsl:variable>
@@ -1387,9 +930,7 @@
1387
930
  </xsl:variable>
1388
931
  <fo:block font-size="{$font-size}">
1389
932
  <fo:block font-weight="bold" keep-with-next="always">
1390
- <fo:inline id="{../@id}">
1391
- <xsl:value-of select="$section"/><xsl:text>.</xsl:text>
1392
- </fo:inline>
933
+ <xsl:apply-templates select="ancestor::ogc:term/ogc:name" mode="presentation"/>
1393
934
  </fo:block>
1394
935
  <fo:block font-weight="bold" keep-with-next="always" line-height="1">
1395
936
  <xsl:apply-templates/>
@@ -1397,108 +938,32 @@
1397
938
  </fo:block>
1398
939
  </xsl:template>
1399
940
 
1400
- <xsl:template match="ogc:admitted">
1401
- <fo:block font-size="11pt">
1402
- <xsl:apply-templates/>
1403
- </fo:block>
1404
- </xsl:template>
1405
-
1406
- <xsl:template match="ogc:deprecates">
1407
- <fo:block>DEPRECATED: <xsl:apply-templates/></fo:block>
1408
- </xsl:template>
1409
-
1410
- <xsl:template match="ogc:definition[preceding-sibling::ogc:domain]">
1411
- <xsl:apply-templates/>
1412
- </xsl:template>
1413
- <xsl:template match="ogc:definition[preceding-sibling::ogc:domain]/ogc:p">
1414
- <fo:inline> <xsl:apply-templates/></fo:inline>
1415
- <fo:block> </fo:block>
1416
- </xsl:template>
1417
-
1418
- <xsl:template match="ogc:definition">
1419
- <fo:block space-after="6pt">
1420
- <xsl:apply-templates/>
1421
- </fo:block>
1422
- </xsl:template>
1423
-
1424
- <xsl:template match="ogc:termsource">
1425
- <fo:block margin-bottom="12pt" keep-with-previous="always">
1426
- <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
1427
- <fo:basic-link internal-destination="{ogc:origin/@bibitemid}" fox:alt-text="{ogc:origin/@citeas}">
1428
- <xsl:text>[SOURCE: </xsl:text>
1429
- <fo:inline color="blue" text-decoration="underline">
1430
- <xsl:value-of select="ogc:origin/@citeas"/>
1431
-
1432
- <xsl:apply-templates select="ogc:origin/ogc:localityStack"/>
1433
-
1434
- </fo:inline>
1435
- </fo:basic-link>
1436
- <xsl:apply-templates select="ogc:modification"/>
1437
- <xsl:text>]</xsl:text>
1438
- </fo:block>
1439
- </xsl:template>
1440
-
1441
- <xsl:template match="ogc:modification">
1442
- <xsl:text>, modified — </xsl:text>
1443
- <xsl:apply-templates/>
1444
- </xsl:template>
1445
- <xsl:template match="ogc:modification/ogc:p">
1446
- <fo:inline><xsl:apply-templates/></fo:inline>
1447
- </xsl:template>
1448
-
1449
- <xsl:template match="ogc:termnote">
1450
- <fo:block font-size="10pt" margin-bottom="12pt">
1451
- <xsl:text>Note </xsl:text>
1452
- <xsl:number/>
1453
- <xsl:text> to entry: </xsl:text>
1454
- <xsl:apply-templates/>
1455
- </fo:block>
1456
- </xsl:template>
1457
-
1458
- <xsl:template match="ogc:termnote/ogc:p">
1459
- <fo:inline><xsl:apply-templates/></fo:inline>
1460
- </xsl:template>
1461
-
1462
- <xsl:template match="ogc:domain">
1463
- <fo:inline>&lt;<xsl:apply-templates/>&gt;</fo:inline>
1464
- </xsl:template>
1465
-
1466
-
1467
- <xsl:template match="ogc:termexample">
1468
- <fo:block font-size="10pt" margin-bottom="12pt">
1469
- <fo:inline padding-right="10mm">EXAMPLE</fo:inline>
1470
- <xsl:apply-templates/>
1471
- </fo:block>
1472
- </xsl:template>
1473
-
1474
- <xsl:template match="ogc:termexample/ogc:p">
1475
- <fo:inline><xsl:apply-templates/></fo:inline>
1476
- </xsl:template>
1477
941
 
1478
942
 
1479
- <xsl:template match="ogc:annex">
1480
- <fo:block break-after="page"/>
1481
- <xsl:apply-templates/>
1482
- </xsl:template>
1483
943
 
1484
944
 
1485
945
  <!-- [position() &gt; 1] -->
1486
- <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references']">
946
+ <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']">
1487
947
  <fo:block break-after="page"/>
1488
- <fo:block line-height="120%">
948
+ <fo:block id="{@id}" line-height="120%">
1489
949
  <xsl:apply-templates/>
1490
950
  </fo:block>
1491
951
  </xsl:template>
1492
952
 
953
+ <xsl:template match="ogc:annex//ogc:references">
954
+ <fo:block id="{@id}">
955
+ <xsl:apply-templates/>
956
+ </fo:block>
957
+ </xsl:template>
1493
958
 
1494
959
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
1495
960
  <!-- <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">
1497
- <fo:list-block margin-bottom="12pt" provisional-distance-between-starts="12mm">
961
+ <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']/ogc:bibitem">
962
+ <fo:list-block id="{@id}" margin-bottom="12pt" provisional-distance-between-starts="12mm">
1498
963
  <fo:list-item>
1499
964
  <fo:list-item-label end-indent="label-end()">
1500
965
  <fo:block>
1501
- <fo:inline id="{@id}">
966
+ <fo:inline>
1502
967
  <xsl:number format="[1]"/>
1503
968
  </fo:inline>
1504
969
  </fo:block>
@@ -1566,204 +1031,24 @@
1566
1031
  </xsl:template>
1567
1032
 
1568
1033
  <!-- <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"/>
1034
+ <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']/ogc:bibitem" mode="contents"/>
1570
1035
 
1571
1036
  <!-- <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">
1037
+ <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']/ogc:bibitem/ogc:title">
1573
1038
  <fo:inline font-style="italic">
1574
1039
  <xsl:apply-templates/>
1575
1040
  </fo:inline>
1576
1041
  </xsl:template>
1577
1042
 
1578
- <xsl:template match="ogc:quote">
1579
- <fo:block margin-top="12pt" margin-left="13mm" margin-right="12mm">
1580
- <xsl:apply-templates select=".//ogc:p"/>
1581
- </fo:block>
1582
- <xsl:if test="ogc:author or ogc:source">
1583
- <fo:block text-align="right" margin-right="25mm">
1584
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
1585
- <xsl:if test="ogc:author">
1586
- <xsl:text>— </xsl:text><xsl:value-of select="ogc:author"/>
1587
- </xsl:if>
1588
- <xsl:if test="ogc:source">
1589
- <xsl:text>, </xsl:text>
1590
- <xsl:apply-templates select="ogc:source"/>
1591
- </xsl:if>
1592
- </fo:block>
1593
- </xsl:if>
1594
- </xsl:template>
1595
-
1596
- <xsl:template match="ogc:source">
1597
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
1598
- <xsl:value-of select="@citeas" disable-output-escaping="yes"/>
1599
- <xsl:apply-templates select="ogc:localityStack"/>
1600
- </fo:basic-link>
1601
- </xsl:template>
1602
-
1603
-
1604
- <xsl:template match="ogc:xref">
1605
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">
1606
- <xsl:variable name="section" select="xalan:nodeset($contents)//item[@id = current()/@target]/@section"/>
1607
- <!-- <xsl:if test="not(starts-with($section, 'Figure') or starts-with($section, 'Table'))"> -->
1608
- <xsl:attribute name="color">blue</xsl:attribute>
1609
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1610
- <!-- </xsl:if> -->
1611
- <xsl:variable name="type" select="xalan:nodeset($contents)//item[@id = current()/@target]/@type"/>
1612
- <xsl:variable name="root" select="xalan:nodeset($contents)//item[@id = current()/@target]/@root"/>
1613
-
1614
- <xsl:choose>
1615
- <xsl:when test="normalize-space(.) != ''">
1616
- <xsl:apply-templates/>
1617
- </xsl:when>
1618
- <xsl:otherwise>
1619
- <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>
1623
- <xsl:otherwise/> <!-- <xsl:value-of select="$type"/> -->
1624
- </xsl:choose>
1625
- <xsl:value-of select="$section"/>
1626
- </xsl:otherwise>
1627
- </xsl:choose>
1628
- </fo:basic-link>
1629
- </xsl:template>
1630
1043
 
1631
- <xsl:template match="ogc:sourcecode" priority="2">
1632
- <xsl:call-template name="sourcecode"/>
1633
- <xsl:choose>
1634
- <xsl:when test="@unnumbered='true'"/>
1635
- <xsl:when test="ancestor::ogc:example"/>
1636
- <xsl:when test="ancestor::ogc:td"/>
1637
- <xsl:when test="ancestor::ogc:annex">
1638
- <xsl:variable name="id_annex" select="ancestor::ogc:annex/@id"/>
1639
- <xsl:choose>
1640
- <xsl:when test="count(//ogc:annex) = 1">
1641
- <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
- </xsl:when>
1643
- <xsl:otherwise>
1644
- <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="12pt">
1645
- <xsl:text>Figure </xsl:text>
1646
- <xsl:number format="A." level="multiple" count="ogc:annex"/>
1647
- <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
- <xsl:if test="ogc:name">
1649
- <xsl:text> — </xsl:text>
1650
- <xsl:apply-templates select="ogc:name/*"/>
1651
- </xsl:if>
1652
- </fo:block>
1653
- </xsl:otherwise>
1654
- </xsl:choose>
1655
- </xsl:when>
1656
- <xsl:otherwise>
1657
- <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="12pt">
1658
- <xsl:text>Figure </xsl:text>
1659
- <xsl:number format="1" level="any" count="ogc:sourcecode[not(@unnumbered='true') and not(ancestor::ogc:example)] | ogc:figure"/>
1660
- <xsl:if test="ogc:name">
1661
- <xsl:text> — </xsl:text>
1662
- <xsl:apply-templates select="ogc:name/*"/>
1663
- </xsl:if>
1664
- </fo:block>
1665
- </xsl:otherwise>
1666
- </xsl:choose>
1667
- </xsl:template>
1668
-
1669
- <xsl:template match="ogc:sourcecode/text()">
1670
- <xsl:variable name="text">
1671
- <xsl:call-template name="add-zero-spaces-equal"/>
1672
- </xsl:variable>
1673
- <xsl:call-template name="add-zero-spaces">
1674
- <xsl:with-param name="text" select="$text"/>
1675
- </xsl:call-template>
1676
- </xsl:template>
1677
-
1678
-
1679
- <xsl:template match="ogc:sourcecode/ogc:name"/>
1680
-
1681
- <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>
1684
- <xsl:if test="following-sibling::ogc:example or preceding-sibling::ogc:example">
1685
- <xsl:number format=" 1"/>
1686
- </xsl:if>
1687
- <xsl:if test="ogc:name">
1688
- <xsl:text> — </xsl:text>
1689
- <xsl:apply-templates select="ogc:name/node()"/>
1690
- </xsl:if>
1691
- </fo:block>
1692
- <fo:block font-size="10pt" margin-left="12.5mm" margin-right="12.5mm">
1693
- <xsl:apply-templates/>
1694
- </fo:block>
1695
- </xsl:template>
1696
-
1697
- <xsl:template match="ogc:example/ogc:name"/>
1698
-
1699
- <xsl:template match="ogc:example/ogc:p">
1700
- <fo:block margin-bottom="14pt">
1701
- <xsl:apply-templates/>
1702
- </fo:block>
1703
- </xsl:template>
1704
-
1705
-
1706
-
1707
- <xsl:template match="ogc:note/ogc:p" name="note">
1708
- <fo:block font-size="10pt" margin-top="12pt" margin-bottom="12pt" line-height="115%">
1709
- <xsl:if test="ancestor::ogc:ul or ancestor::ogc:ol and not(ancestor::ogc:note[1]/following-sibling::*)">
1710
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
1711
- </xsl:if>
1712
- <xsl:variable name="clauseid" select="ancestor::ogc:clause[1]/@id"/>
1713
- <fo:inline padding-right="4mm">
1714
- <xsl:text>NOTE </xsl:text>
1715
- <xsl:if test="count(//ogc:note[ancestor::ogc:clause[1][@id = $clauseid]]) &gt; 1">
1716
- <xsl:number count="ogc:note[ancestor::ogc:clause[1][@id = $clauseid]]" level="any"/>
1717
- </xsl:if>
1718
- </fo:inline>
1719
- <xsl:apply-templates/>
1720
- </fo:block>
1721
- </xsl:template>
1722
1044
 
1723
- <!-- <eref type="inline" bibitemid="ISO20483" citeas="ISO 20483:2013"><locality type="annex"><referenceFrom>C</referenceFrom></locality></eref> -->
1724
- <xsl:template match="ogc:eref">
1725
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}" color="blue" text-decoration="underline"> <!-- font-size="9pt" color="blue" vertical-align="super" -->
1726
- <xsl:if test="@type = 'footnote'">
1727
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
1728
- <xsl:attribute name="font-size">80%</xsl:attribute>
1729
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1730
- <xsl:attribute name="vertical-align">super</xsl:attribute>
1731
- </xsl:if>
1732
- <xsl:if test="@type = 'inline'">
1733
- <xsl:attribute name="color">blue</xsl:attribute>
1734
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1735
- </xsl:if>
1736
- <!-- <xsl:if test="@type = 'inline'">
1737
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1738
- </xsl:if> -->
1739
- <xsl:choose>
1740
- <xsl:when test="@citeas and normalize-space(text()) = ''">
1741
- <xsl:value-of select="@citeas" disable-output-escaping="yes"/>
1742
- </xsl:when>
1743
- <xsl:when test="@bibitemid and normalize-space(text()) = ''">
1744
- <xsl:value-of select="//ogc:bibitem[@id = current()/@bibitemid]/ogc:docidentifier"/>
1745
- </xsl:when>
1746
- <xsl:otherwise/>
1747
- </xsl:choose>
1748
- <xsl:apply-templates select="ogc:localityStack"/>
1749
- <xsl:apply-templates select="text()"/>
1750
- </fo:basic-link>
1751
- </xsl:template>
1752
-
1753
- <xsl:template match="ogc:locality">
1754
- <xsl:choose>
1755
- <xsl:when test="@type ='clause'">Clause </xsl:when>
1756
- <xsl:when test="@type ='annex'">Annex </xsl:when>
1757
- <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
1758
- </xsl:choose>
1759
- <xsl:text> </xsl:text><xsl:value-of select="ogc:referenceFrom"/>
1760
- </xsl:template>
1045
+
1761
1046
 
1762
1047
  <xsl:template match="ogc:admonition">
1763
1048
  <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
1049
  <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)"/>
1050
+ <fo:block font-size="11pt" margin-bottom="6pt" font-weight="bold" font-style="italic" text-align="center">
1051
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@type))"/>
1767
1052
  </fo:block>
1768
1053
  <fo:block font-style="italic">
1769
1054
  <xsl:apply-templates/>
@@ -1773,15 +1058,10 @@
1773
1058
 
1774
1059
 
1775
1060
  </xsl:template>
1776
-
1777
- <xsl:template match="ogc:formula/ogc:dt/ogc:stem">
1778
- <fo:inline>
1779
- <xsl:apply-templates/>
1780
- </fo:inline>
1781
- </xsl:template>
1782
-
1061
+
1062
+
1783
1063
  <xsl:template match="ogc:formula/ogc:stem">
1784
- <fo:block id="{../@id}" margin-top="6pt" margin-bottom="12pt">
1064
+ <fo:block margin-top="6pt" margin-bottom="12pt">
1785
1065
  <fo:table table-layout="fixed" width="100%">
1786
1066
  <fo:table-column column-width="95%"/>
1787
1067
  <fo:table-column column-width="5%"/>
@@ -1794,29 +1074,16 @@
1794
1074
  </fo:table-cell>
1795
1075
  <fo:table-cell display-align="center">
1796
1076
  <fo:block text-align="right">
1797
- <xsl:choose>
1798
- <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>
1800
- </xsl:when>
1801
- <xsl:otherwise> <!-- not(ancestor::ogc:annex) -->
1802
- <!-- <xsl:text>(</xsl:text><xsl:number level="any" count="ogc:formula"/><xsl:text>)</xsl:text> -->
1803
- </xsl:otherwise>
1804
- </xsl:choose>
1077
+ <xsl:apply-templates select="../ogc:name" mode="presentation"/>
1805
1078
  </fo:block>
1806
1079
  </fo:table-cell>
1807
1080
  </fo:table-row>
1808
1081
  </fo:table-body>
1809
- </fo:table>
1810
- <fo:inline keep-together.within-line="always">
1811
- </fo:inline>
1082
+ </fo:table>
1812
1083
  </fo:block>
1813
1084
  </xsl:template>
1814
1085
 
1815
1086
 
1816
- <xsl:template match="ogc:br" priority="2">
1817
- <!-- <fo:block>&#xA0;</fo:block> -->
1818
- <xsl:value-of select="$linebreak"/>
1819
- </xsl:template>
1820
1087
 
1821
1088
  <xsl:template match="ogc:pagebreak">
1822
1089
  <fo:block break-after="page"/>
@@ -1880,169 +1147,131 @@
1880
1147
  </fo:block-container>
1881
1148
  </fo:static-content>
1882
1149
  </xsl:template>
1150
+
1151
+ <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
1152
+
1153
+ <title-annex lang="en">Annex </title-annex>
1154
+ <title-annex lang="fr">Annexe </title-annex>
1155
+
1156
+ <title-annex lang="zh">Annex </title-annex>
1157
+
1158
+
1159
+
1160
+ <title-edition lang="en">
1161
+
1162
+
1163
+ <xsl:text>Version</xsl:text>
1164
+
1165
+ </title-edition>
1166
+
1883
1167
 
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
-
1917
- <xsl:template name="getSection">
1918
- <xsl:param name="sectionNum"/>
1919
- <xsl:variable name="level">
1920
- <xsl:call-template name="getLevel"/>
1921
- </xsl:variable>
1922
- <xsl:variable name="section">
1923
- <xsl:choose>
1924
- <xsl:when test="ancestor::ogc:bibliography">
1925
- <xsl:value-of select="$sectionNum"/>
1926
- </xsl:when>
1927
- <xsl:when test="ancestor::ogc:sections">
1928
- <!-- 1, 2, 3, 4, ... from main section (not annex, bibliography, ...) -->
1929
- <xsl:choose>
1930
- <xsl:when test="$level = 1">
1931
- <xsl:value-of select="$sectionNum"/>
1932
- </xsl:when>
1933
- <xsl:when test="$level &gt;= 2">
1934
- <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"/>
1936
- </xsl:variable>
1937
- <xsl:value-of select="concat($sectionNum, $num)"/>
1938
- </xsl:when>
1939
- <xsl:otherwise>
1940
- <!-- z<xsl:value-of select="$sectionNum"/>z -->
1941
- </xsl:otherwise>
1942
- </xsl:choose>
1943
- <!-- <xsl:text>.</xsl:text> -->
1944
- </xsl:when>
1945
- <!-- <xsl:when test="ancestor::ogc:annex[@obligation = 'informative']">
1946
- <xsl:choose>
1947
- <xsl:when test="$level = 1">
1948
- <xsl:text>Annex </xsl:text>
1949
- <xsl:number format="I" level="any" count="ogc:annex[@obligation = 'informative']"/>
1950
- </xsl:when>
1951
- <xsl:otherwise>
1952
- <xsl:number format="I.1" level="multiple" count="ogc:annex[@obligation = 'informative'] | ogc:clause"/>
1953
- </xsl:otherwise>
1954
- </xsl:choose>
1955
- </xsl:when> -->
1956
- <xsl:when test="ancestor::ogc:annex">
1957
- <xsl:choose>
1958
- <xsl:when test="$level = 1">
1959
- <xsl:text>Annex </xsl:text>
1960
- <xsl:choose>
1961
- <xsl:when test="count(//ogc:annex) = 1">
1962
- <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:ext/ogc:structuredidentifier/ogc:annexid"/>
1963
- </xsl:when>
1964
- <xsl:otherwise>
1965
- <xsl:number format="A" level="any" count="ogc:annex"/>
1966
- </xsl:otherwise>
1967
- </xsl:choose>
1968
- </xsl:when>
1969
- <xsl:otherwise>
1970
- <xsl:choose>
1971
- <xsl:when test="count(//ogc:annex) = 1">
1972
- <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:ext/ogc:structuredidentifier/ogc:annexid"/><xsl:number format=".1" level="multiple" count="ogc:clause"/>
1973
- </xsl:when>
1974
- <xsl:otherwise>
1975
- <xsl:number format="A.1" level="multiple" count="ogc:annex | ogc:clause"/>
1976
- </xsl:otherwise>
1977
- </xsl:choose>
1978
- </xsl:otherwise>
1979
- </xsl:choose>
1980
- </xsl:when>
1981
- <xsl:when test="ancestor::ogc:preface"> <!-- if preface and there is clause(s) -->
1982
- <xsl:choose>
1983
- <xsl:when test="$level = 1 and ..//ogc:clause">0</xsl:when>
1984
- <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)"/>
1989
- </xsl:when>
1990
- <xsl:otherwise>
1991
- <!-- z<xsl:value-of select="$sectionNum"/>z -->
1992
- </xsl:otherwise>
1993
- </xsl:choose>
1994
- </xsl:when>
1995
- <xsl:otherwise>
1996
- </xsl:otherwise>
1997
- </xsl:choose>
1998
- </xsl:variable>
1999
- <xsl:value-of select="$section"/>
2000
- </xsl:template>
2001
-
2002
- <xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-table">
1168
+ <title-toc lang="en">
1169
+
1170
+ <xsl:text>Contents</xsl:text>
1171
+
1172
+
1173
+
1174
+ </title-toc>
1175
+ <title-toc lang="fr">Sommaire</title-toc>
1176
+
1177
+ <title-toc lang="zh">Contents</title-toc>
2003
1178
 
2004
- <xsl:text>Table </xsl:text>
2005
1179
 
2006
1180
 
2007
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-note">
1181
+ <title-page lang="en">Page</title-page>
1182
+ <title-page lang="fr">Page</title-page>
2008
1183
 
2009
- <xsl:text>NOTE </xsl:text>
1184
+ <title-key lang="en">Key</title-key>
1185
+ <title-key lang="fr">Légende</title-key>
1186
+
1187
+ <title-where lang="en">where</title-where>
1188
+ <title-where lang="fr">où</title-where>
1189
+
1190
+ <title-descriptors lang="en">Descriptors</title-descriptors>
1191
+
1192
+ <title-part lang="en">
1193
+
1194
+
1195
+ </title-part>
1196
+ <title-part lang="fr">
1197
+
1198
+
1199
+ </title-part>
1200
+ <title-part lang="zh">第 # 部分:</title-part>
1201
+
1202
+ <title-modified lang="en">modified</title-modified>
1203
+ <title-modified lang="fr">modifiée</title-modified>
2010
1204
 
1205
+ <title-modified lang="zh">modified</title-modified>
2011
1206
 
2012
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-figure">
2013
1207
 
2014
- <xsl:text>Figure </xsl:text>
2015
1208
 
1209
+ <title-source lang="en">SOURCE</title-source>
2016
1210
 
2017
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-example">
1211
+ <title-keywords lang="en">Keywords</title-keywords>
2018
1212
 
2019
- <xsl:text>EXAMPLE </xsl:text>
1213
+ <title-deprecated lang="en">DEPRECATED</title-deprecated>
1214
+ <title-deprecated lang="fr">DEPRECATED</title-deprecated>
1215
+
1216
+ <title-list-tables lang="en">List of Tables</title-list-tables>
1217
+
1218
+ <title-list-figures lang="en">List of Figures</title-list-figures>
2020
1219
 
1220
+ <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
2021
1221
 
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">
1222
+ <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
2023
1223
 
2024
- <xsl:text>Annex </xsl:text>
1224
+ <title-abstract lang="en">Abstract</title-abstract>
2025
1225
 
1226
+ <title-summary lang="en">Summary</title-summary>
2026
1227
 
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">
1228
+ <title-in lang="en">in </title-in>
2030
1229
 
2031
- <xsl:text>Clause </xsl:text>
1230
+ <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
1231
+ <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
2032
1232
 
1233
+ <title-completion-date lang="en">Completion date for this manuscript</title-completion-date>
1234
+ <title-completion-date lang="zh">本稿完成日期</title-completion-date>
2033
1235
 
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">
1236
+ <title-issuance-date lang="en">Issuance Date: #</title-issuance-date>
1237
+ <title-issuance-date lang="zh"># 发布</title-issuance-date>
2037
1238
 
1239
+ <title-implementation-date lang="en">Implementation Date: #</title-implementation-date>
1240
+ <title-implementation-date lang="zh"># 实施</title-implementation-date>
1241
+
1242
+ <title-obligation-normative lang="en">normative</title-obligation-normative>
1243
+ <title-obligation-normative lang="zh">规范性附录</title-obligation-normative>
2038
1244
 
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">
1245
+ <title-caution lang="en">CAUTION</title-caution>
1246
+ <title-caution lang="zh">注意</title-caution>
1247
+
1248
+ <title-warning lang="en">WARNING</title-warning>
1249
+ <title-warning lang="zh">警告</title-warning>
1250
+
1251
+ <title-amendment lang="en">AMENDMENT</title-amendment>
1252
+ </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1253
+ <xsl:param name="name"/>
1254
+ <xsl:variable name="lang">
1255
+ <xsl:call-template name="getLang"/>
1256
+ </xsl:variable>
1257
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
1258
+ <xsl:choose>
1259
+ <xsl:when test="normalize-space($title_) != ''">
1260
+ <xsl:value-of select="$title_"/>
1261
+ </xsl:when>
1262
+ <xsl:otherwise>
1263
+ <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
1264
+ </xsl:otherwise>
1265
+ </xsl:choose>
1266
+ </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
1267
 
2041
1268
  <xsl:attribute name="color">blue</xsl:attribute>
2042
1269
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
2043
1270
 
2044
1271
 
2045
- </xsl:attribute-set><xsl:attribute-set xmlns:java="http://xml.apache.org/xalan/java" name="sourcecode-style">
1272
+ </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
1273
+ <xsl:attribute name="white-space">pre</xsl:attribute>
1274
+ <xsl:attribute name="wrap-option">wrap</xsl:attribute>
2046
1275
 
2047
1276
 
2048
1277
 
@@ -2057,7 +1286,158 @@
2057
1286
  <xsl:attribute name="line-height">113%</xsl:attribute>
2058
1287
 
2059
1288
 
2060
- </xsl:attribute-set><xsl:attribute-set xmlns:java="http://xml.apache.org/xalan/java" name="appendix-style">
1289
+ </xsl:attribute-set><xsl:attribute-set name="permission-style">
1290
+
1291
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1292
+
1293
+ </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
1294
+
1295
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1296
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1297
+ <xsl:attribute name="text-align">center</xsl:attribute>
1298
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
1299
+ <xsl:attribute name="padding-bottom">1mm</xsl:attribute>
1300
+ <xsl:attribute name="margin-bottom">1mm</xsl:attribute>
1301
+ <xsl:attribute name="background-color">rgb(165,165,165)</xsl:attribute>
1302
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1303
+
1304
+ </xsl:attribute-set><xsl:attribute-set name="permission-label-style">
1305
+
1306
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1307
+
1308
+ </xsl:attribute-set><xsl:attribute-set name="requirement-style">
1309
+
1310
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1311
+
1312
+ </xsl:attribute-set><xsl:attribute-set name="requirement-name-style">
1313
+
1314
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1315
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1316
+ <xsl:attribute name="text-align">center</xsl:attribute>
1317
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
1318
+ <xsl:attribute name="padding-bottom">1mm</xsl:attribute>
1319
+ <xsl:attribute name="margin-bottom">1mm</xsl:attribute>
1320
+ <xsl:attribute name="background-color">rgb(165,165,165)</xsl:attribute>
1321
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1322
+
1323
+ </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
1324
+
1325
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1326
+
1327
+ </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
1328
+ </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
1329
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
1330
+
1331
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1332
+
1333
+
1334
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-name-style">
1335
+
1336
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1337
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1338
+ <xsl:attribute name="text-align">center</xsl:attribute>
1339
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
1340
+ <xsl:attribute name="padding-bottom">1mm</xsl:attribute>
1341
+ <xsl:attribute name="margin-bottom">1mm</xsl:attribute>
1342
+ <xsl:attribute name="background-color">rgb(165,165,165)</xsl:attribute>
1343
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1344
+
1345
+
1346
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-label-style">
1347
+
1348
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1349
+
1350
+ </xsl:attribute-set><xsl:attribute-set name="termexample-style">
1351
+
1352
+
1353
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1354
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1355
+
1356
+
1357
+
1358
+
1359
+
1360
+
1361
+ </xsl:attribute-set><xsl:attribute-set name="example-style">
1362
+
1363
+
1364
+
1365
+
1366
+
1367
+
1368
+
1369
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1370
+ <xsl:attribute name="margin-left">12.5mm</xsl:attribute>
1371
+ <xsl:attribute name="margin-right">12.5mm</xsl:attribute>
1372
+
1373
+
1374
+
1375
+
1376
+ </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1377
+
1378
+
1379
+ </xsl:attribute-set><xsl:attribute-set name="example-name-style">
1380
+
1381
+
1382
+
1383
+
1384
+
1385
+
1386
+
1387
+
1388
+
1389
+
1390
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1391
+ <xsl:attribute name="text-align">center</xsl:attribute>
1392
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1393
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1394
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1395
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1396
+
1397
+
1398
+
1399
+
1400
+
1401
+
1402
+ </xsl:attribute-set><xsl:attribute-set name="example-p-style">
1403
+
1404
+
1405
+
1406
+
1407
+
1408
+
1409
+
1410
+
1411
+ <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
1412
+
1413
+
1414
+
1415
+
1416
+ </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
1417
+
1418
+ <xsl:attribute name="padding-right">10mm</xsl:attribute>
1419
+
1420
+
1421
+
1422
+
1423
+ </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1424
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1425
+
1426
+
1427
+
1428
+
1429
+
1430
+
1431
+
1432
+ <xsl:attribute name="text-align">center</xsl:attribute>
1433
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1434
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1435
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1436
+
1437
+
1438
+
1439
+
1440
+ </xsl:attribute-set><xsl:attribute-set name="appendix-style">
2061
1441
 
2062
1442
  <xsl:attribute name="font-size">12pt</xsl:attribute>
2063
1443
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -2066,7 +1446,7 @@
2066
1446
 
2067
1447
 
2068
1448
 
2069
- </xsl:attribute-set><xsl:attribute-set xmlns:java="http://xml.apache.org/xalan/java" name="appendix-example-style">
1449
+ </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
2070
1450
 
2071
1451
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2072
1452
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
@@ -2074,118 +1454,259 @@
2074
1454
 
2075
1455
 
2076
1456
 
2077
- </xsl:attribute-set><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="text()">
2078
- <xsl:value-of select="."/>
2079
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='br']">
2080
- <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">
2082
- <!-- <xsl:call-template name="add-zero-spaces"/> -->
2083
- <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']">
2085
-
2086
- <xsl:variable name="simple-table">
2087
- <!-- <xsl:copy> -->
2088
- <xsl:call-template name="getSimpleTable"/>
2089
- <!-- </xsl:copy> -->
2090
- </xsl:variable>
2091
-
2092
- <!-- DEBUG -->
2093
- <!-- SourceTable=<xsl:copy-of select="current()"/>EndSourceTable -->
2094
- <!-- Simpletable=<xsl:copy-of select="$simple-table"/>EndSimpltable -->
2095
-
2096
- <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
1457
+ </xsl:attribute-set><xsl:attribute-set name="xref-style">
2097
1458
 
2098
- <!-- <xsl:if test="$namespace = 'iso'">
2099
- <fo:block space-before="6pt">&#xA0;</fo:block>
2100
- </xsl:if> -->
2101
1459
 
2102
- <xsl:choose>
2103
- <xsl:when test="@unnumbered = 'true'"/>
2104
- <xsl:otherwise>
2105
-
2106
-
2107
-
2108
- <fo:block font-weight="bold" text-align="center" margin-bottom="6pt" keep-with-next="always">
2109
-
2110
-
2111
-
2112
-
2113
-
2114
-
2115
- <xsl:attribute name="font-weight">normal</xsl:attribute>
2116
- <xsl:attribute name="font-size">11pt</xsl:attribute>
2117
-
2118
-
2119
-
2120
-
2121
- <xsl:value-of select="$title-table"/>
2122
-
2123
- <xsl:call-template name="getTableNumber"/>
2124
-
2125
-
2126
- <xsl:if test="*[local-name()='name']">
2127
-
2128
-
2129
-
2130
- <xsl:text> — </xsl:text>
2131
-
2132
- <xsl:apply-templates select="*[local-name()='name']" mode="process"/>
2133
- </xsl:if>
2134
- </fo:block>
2135
-
1460
+ <xsl:attribute name="color">blue</xsl:attribute>
1461
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
2136
1462
 
2137
- <xsl:call-template name="fn_name_display"/>
1463
+ </xsl:attribute-set><xsl:attribute-set name="eref-style">
1464
+
1465
+
1466
+ <xsl:attribute name="color">blue</xsl:attribute>
1467
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1468
+
1469
+
1470
+ </xsl:attribute-set><xsl:attribute-set name="note-style">
1471
+
1472
+
1473
+
2138
1474
 
2139
- </xsl:otherwise>
2140
- </xsl:choose>
2141
1475
 
2142
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
2143
1476
 
2144
- <!-- <xsl:variable name="cols-count">
2145
- <xsl:choose>
2146
- <xsl:when test="*[local-name()='thead']">
2147
- <xsl:call-template name="calculate-columns-numbers">
2148
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
2149
- </xsl:call-template>
2150
- </xsl:when>
2151
- <xsl:otherwise>
2152
- <xsl:call-template name="calculate-columns-numbers">
2153
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
2154
- </xsl:call-template>
2155
- </xsl:otherwise>
2156
- </xsl:choose>
2157
- </xsl:variable> -->
2158
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
2159
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
2160
1477
 
2161
1478
 
2162
1479
 
2163
- <xsl:variable name="colwidths">
2164
- <xsl:call-template name="calculate-column-widths">
2165
- <xsl:with-param name="cols-count" select="$cols-count"/>
2166
- <xsl:with-param name="table" select="$simple-table"/>
2167
- </xsl:call-template>
2168
- </xsl:variable>
2169
1480
 
2170
- <!-- <xsl:variable name="colwidths2">
2171
- <xsl:call-template name="calculate-column-widths">
2172
- <xsl:with-param name="cols-count" select="$cols-count"/>
2173
- </xsl:call-template>
2174
- </xsl:variable> -->
1481
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1482
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1483
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1484
+ <xsl:attribute name="line-height">115%</xsl:attribute>
2175
1485
 
2176
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
2177
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
2178
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
2179
1486
 
2180
- <xsl:variable name="margin-left">
2181
- <xsl:choose>
2182
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
2183
- <xsl:otherwise>0</xsl:otherwise>
2184
- </xsl:choose>
2185
- </xsl:variable>
2186
1487
 
2187
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2188
-
1488
+
1489
+
1490
+
1491
+ </xsl:attribute-set><xsl:attribute-set name="note-name-style">
1492
+
1493
+
1494
+
1495
+
1496
+
1497
+
1498
+
1499
+
1500
+
1501
+ <xsl:attribute name="padding-right">4mm</xsl:attribute>
1502
+
1503
+
1504
+ </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1505
+
1506
+
1507
+
1508
+
1509
+
1510
+
1511
+
1512
+
1513
+
1514
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1515
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1516
+
1517
+
1518
+
1519
+
1520
+
1521
+ </xsl:attribute-set><xsl:attribute-set name="termnote-style">
1522
+
1523
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1524
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1525
+
1526
+
1527
+
1528
+
1529
+
1530
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
1531
+
1532
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1533
+ <xsl:attribute name="margin-left">13mm</xsl:attribute>
1534
+ <xsl:attribute name="margin-right">12mm</xsl:attribute>
1535
+
1536
+
1537
+
1538
+
1539
+
1540
+
1541
+ </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
1542
+
1543
+ <xsl:attribute name="text-align">right</xsl:attribute>
1544
+ <xsl:attribute name="margin-right">25mm</xsl:attribute>
1545
+
1546
+
1547
+
1548
+ </xsl:attribute-set><xsl:attribute-set name="termsource-style">
1549
+
1550
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1551
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1552
+
1553
+
1554
+
1555
+
1556
+
1557
+ </xsl:attribute-set><xsl:attribute-set name="origin-style">
1558
+
1559
+
1560
+ <xsl:attribute name="color">blue</xsl:attribute>
1561
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1562
+
1563
+ </xsl:attribute-set><xsl:attribute-set name="term-style">
1564
+
1565
+ </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1566
+
1567
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1568
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1569
+ <xsl:attribute name="text-align">center</xsl:attribute>
1570
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1571
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1572
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1573
+
1574
+
1575
+
1576
+
1577
+
1578
+
1579
+
1580
+
1581
+
1582
+
1583
+
1584
+
1585
+
1586
+
1587
+
1588
+
1589
+ </xsl:attribute-set><xsl:attribute-set name="formula-style">
1590
+
1591
+ </xsl:attribute-set><xsl:attribute-set name="image-style">
1592
+ <xsl:attribute name="text-align">center</xsl:attribute>
1593
+
1594
+ <xsl:attribute name="space-before">12pt</xsl:attribute>
1595
+ <xsl:attribute name="space-after">6pt</xsl:attribute>
1596
+
1597
+
1598
+
1599
+
1600
+
1601
+ </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
1602
+
1603
+ </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
1604
+
1605
+ <xsl:attribute name="width">100%</xsl:attribute>
1606
+ <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
1607
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
1608
+
1609
+
1610
+
1611
+
1612
+
1613
+ </xsl:attribute-set><xsl:attribute-set name="tt-style">
1614
+
1615
+
1616
+ <xsl:attribute name="font-family">Courier</xsl:attribute>
1617
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1618
+
1619
+ </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
1620
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1621
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1622
+ <xsl:attribute name="text-align">center</xsl:attribute>
1623
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1624
+ </xsl:attribute-set><xsl:attribute-set name="domain-style">
1625
+
1626
+ </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1627
+
1628
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1629
+
1630
+
1631
+ </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1632
+
1633
+ </xsl:attribute-set><xsl:attribute-set name="definition-style">
1634
+
1635
+ <xsl:attribute name="space-after">6pt</xsl:attribute>
1636
+
1637
+
1638
+ </xsl:attribute-set><xsl:template match="text()">
1639
+ <xsl:value-of select="."/>
1640
+ </xsl:template><xsl:template match="*[local-name()='br']">
1641
+ <xsl:value-of select="$linebreak"/>
1642
+ </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1643
+ <!-- <xsl:call-template name="add-zero-spaces"/> -->
1644
+ <xsl:call-template name="add-zero-spaces-java"/>
1645
+ </xsl:template><xsl:template match="*[local-name()='table']">
1646
+
1647
+ <xsl:variable name="simple-table">
1648
+ <xsl:call-template name="getSimpleTable"/>
1649
+ </xsl:variable>
1650
+
1651
+
1652
+
1653
+
1654
+
1655
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1656
+
1657
+
1658
+
1659
+ <xsl:call-template name="fn_name_display"/>
1660
+
1661
+
1662
+
1663
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1664
+
1665
+ <!-- <xsl:variable name="cols-count">
1666
+ <xsl:choose>
1667
+ <xsl:when test="*[local-name()='thead']">
1668
+ <xsl:call-template name="calculate-columns-numbers">
1669
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1670
+ </xsl:call-template>
1671
+ </xsl:when>
1672
+ <xsl:otherwise>
1673
+ <xsl:call-template name="calculate-columns-numbers">
1674
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1675
+ </xsl:call-template>
1676
+ </xsl:otherwise>
1677
+ </xsl:choose>
1678
+ </xsl:variable> -->
1679
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1680
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1681
+
1682
+
1683
+
1684
+ <xsl:variable name="colwidths">
1685
+ <xsl:call-template name="calculate-column-widths">
1686
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1687
+ <xsl:with-param name="table" select="$simple-table"/>
1688
+ </xsl:call-template>
1689
+ </xsl:variable>
1690
+
1691
+ <!-- <xsl:variable name="colwidths2">
1692
+ <xsl:call-template name="calculate-column-widths">
1693
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1694
+ </xsl:call-template>
1695
+ </xsl:variable> -->
1696
+
1697
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1698
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
1699
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1700
+
1701
+ <xsl:variable name="margin-left">
1702
+ <xsl:choose>
1703
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1704
+ <xsl:otherwise>0</xsl:otherwise>
1705
+ </xsl:choose>
1706
+ </xsl:variable>
1707
+
1708
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1709
+
2189
1710
 
2190
1711
 
2191
1712
 
@@ -2224,46 +1745,36 @@
2224
1745
  </xsl:otherwise>
2225
1746
  </xsl:choose>
2226
1747
  </xsl:for-each>
2227
- <xsl:apply-templates/>
1748
+
1749
+ <xsl:choose>
1750
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1751
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1752
+ </xsl:when>
1753
+ <xsl:otherwise>
1754
+ <xsl:apply-templates/>
1755
+ </xsl:otherwise>
1756
+ </xsl:choose>
1757
+
2228
1758
  </fo:table>
2229
1759
 
2230
1760
 
2231
1761
 
1762
+
1763
+
2232
1764
  </fo:block-container>
2233
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="getTableNumber">
2234
- <xsl:choose>
2235
- <xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
2236
- <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true']"/>
2237
- </xsl:when>
2238
- <xsl:when test="ancestor::*[local-name()='annex']">
2239
-
2240
-
2241
-
2242
- <xsl:number format="A." count="*[local-name()='annex']"/><xsl:number format="1"/>
2243
-
2244
-
2245
-
2246
-
2247
-
2248
-
2249
- </xsl:when>
2250
- <xsl:otherwise>
2251
-
2252
-
2253
- <xsl:number format="A." count="*[local-name()='annex']"/>
2254
- <xsl:number format="1" level="any" count="//*[local-name()='table'] [not(ancestor::*[local-name()='annex']) and not(ancestor::*[local-name()='executivesummary']) and not(ancestor::*[local-name()='bibdata'])] [not(@unnumbered) or @unnumbered != 'true']"/>
2255
-
2256
- </xsl:otherwise>
2257
- </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">
2259
- <xsl:apply-templates/>
2260
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="calculate-columns-numbers">
1765
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1766
+ <xsl:if test="normalize-space() != ''">
1767
+ <fo:block xsl:use-attribute-sets="table-name-style">
1768
+ <xsl:apply-templates/>
1769
+ </fo:block>
1770
+ </xsl:if>
1771
+ </xsl:template><xsl:template name="calculate-columns-numbers">
2261
1772
  <xsl:param name="table-row"/>
2262
1773
  <xsl:variable name="columns-count" select="count($table-row/*)"/>
2263
1774
  <xsl:variable name="sum-colspans" select="sum($table-row/*/@colspan)"/>
2264
1775
  <xsl:variable name="columns-with-colspan" select="count($table-row/*[@colspan])"/>
2265
1776
  <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">
1777
+ </xsl:template><xsl:template name="calculate-column-widths">
2267
1778
  <xsl:param name="table"/>
2268
1779
  <xsl:param name="cols-count"/>
2269
1780
  <xsl:param name="curr-col" select="1"/>
@@ -2361,23 +1872,27 @@
2361
1872
  <xsl:with-param name="table" select="$table"/>
2362
1873
  </xsl:call-template>
2363
1874
  </xsl:if>
2364
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="text()" mode="td_text">
1875
+ </xsl:template><xsl:template match="text()" mode="td_text">
2365
1876
  <xsl:variable name="zero-space">​</xsl:variable>
2366
1877
  <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">
1878
+ </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
2368
1879
  <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">
1880
+ </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
2370
1881
  <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">
1882
+ </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
2372
1883
  <xsl:param name="cols-count"/>
2373
1884
  <!-- font-weight="bold" -->
2374
1885
  <fo:table-header>
2375
1886
 
2376
1887
  <xsl:apply-templates/>
2377
1888
  </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">
1889
+ </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
1890
+ <fo:table-body>
1891
+ <xsl:apply-templates/>
1892
+ </fo:table-body>
1893
+ </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
2379
1894
  <xsl:apply-templates/>
2380
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="insertTableFooter">
1895
+ </xsl:template><xsl:template name="insertTableFooter">
2381
1896
  <xsl:param name="cols-count"/>
2382
1897
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2383
1898
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -2417,7 +1932,7 @@
2417
1932
  </fo:table-footer>
2418
1933
 
2419
1934
  </xsl:if>
2420
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tbody']">
1935
+ </xsl:template><xsl:template match="*[local-name()='tbody']">
2421
1936
 
2422
1937
  <xsl:variable name="cols-count">
2423
1938
  <xsl:choose>
@@ -2448,7 +1963,7 @@
2448
1963
 
2449
1964
  </fo:table-body>
2450
1965
 
2451
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tr']">
1966
+ </xsl:template><xsl:template match="*[local-name()='tr']">
2452
1967
  <xsl:variable name="parent-name" select="local-name(..)"/>
2453
1968
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
2454
1969
  <fo:table-row min-height="4mm">
@@ -2468,7 +1983,7 @@
2468
1983
 
2469
1984
  <xsl:apply-templates/>
2470
1985
  </fo:table-row>
2471
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='th']">
1986
+ </xsl:template><xsl:template match="*[local-name()='th']">
2472
1987
  <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
2473
1988
 
2474
1989
 
@@ -2477,6 +1992,7 @@
2477
1992
 
2478
1993
 
2479
1994
 
1995
+
2480
1996
  <xsl:if test="@colspan">
2481
1997
  <xsl:attribute name="number-columns-spanned">
2482
1998
  <xsl:value-of select="@colspan"/>
@@ -2491,12 +2007,12 @@
2491
2007
  <xsl:apply-templates/>
2492
2008
  </fo:block>
2493
2009
  </fo:table-cell>
2494
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='td']">
2010
+ </xsl:template><xsl:template match="*[local-name()='td']">
2495
2011
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
2496
2012
 
2497
2013
 
2498
2014
 
2499
-
2015
+
2500
2016
 
2501
2017
 
2502
2018
 
@@ -2515,21 +2031,9 @@
2515
2031
  <fo:block>
2516
2032
 
2517
2033
  <xsl:apply-templates/>
2518
- </fo:block>
2519
- <!-- <xsl:choose>
2520
- <xsl:when test="count(*) = 1 and *[local-name() = 'p']">
2521
- <xsl:apply-templates />
2522
- </xsl:when>
2523
- <xsl:otherwise>
2524
- <fo:block>
2525
- <xsl:apply-templates />
2526
- </fo:block>
2527
- </xsl:otherwise>
2528
- </xsl:choose> -->
2529
-
2530
-
2034
+ </fo:block>
2531
2035
  </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">
2036
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
2533
2037
 
2534
2038
 
2535
2039
  <fo:block font-size="10pt" margin-bottom="12pt">
@@ -2540,23 +2044,17 @@
2540
2044
  <fo:inline padding-right="2mm">
2541
2045
 
2542
2046
 
2543
- <xsl:value-of select="$title-note"/>
2544
2047
 
2545
- <xsl:variable name="id" select="ancestor::*[local-name() = 'table'][1]/@id"/>
2546
- <xsl:if test="count(//*[local-name()='note'][ancestor::*[@id = $id]]) &gt; 1">
2547
- <xsl:number count="*[local-name()='note'][ancestor::*[@id = $id]]" level="any"/>
2548
- </xsl:if>
2048
+
2049
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2549
2050
 
2550
-
2551
-
2552
-
2553
2051
  </fo:inline>
2554
2052
  <xsl:apply-templates mode="process"/>
2555
2053
  </fo:block>
2556
2054
 
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">
2055
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
2558
2056
  <xsl:apply-templates/>
2559
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="fn_display">
2057
+ </xsl:template><xsl:template name="fn_display">
2560
2058
  <xsl:variable name="references">
2561
2059
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
2562
2060
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -2599,7 +2097,7 @@
2599
2097
  </fo:block>
2600
2098
  </xsl:if>
2601
2099
  </xsl:for-each>
2602
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="fn_name_display">
2100
+ </xsl:template><xsl:template name="fn_name_display">
2603
2101
  <!-- <xsl:variable name="references">
2604
2102
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
2605
2103
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -2615,17 +2113,47 @@
2615
2113
  <xsl:apply-templates/>
2616
2114
  </fo:block>
2617
2115
  </xsl:for-each>
2618
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="fn_display_figure">
2116
+ </xsl:template><xsl:template name="fn_display_figure">
2619
2117
  <xsl:variable name="key_iso">
2620
2118
  <!-- and (not(@class) or @class !='pseudocode') -->
2621
2119
  </xsl:variable>
2622
2120
  <xsl:variable name="references">
2623
- <xsl:for-each select=".//*[local-name()='fn']">
2121
+ <xsl:for-each select=".//*[local-name()='fn'][not(parent::*[local-name()='name'])]">
2624
2122
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2625
2123
  <xsl:apply-templates/>
2626
2124
  </fn>
2627
2125
  </xsl:for-each>
2628
2126
  </xsl:variable>
2127
+
2128
+ <!-- current hierarchy is 'figure' element -->
2129
+ <xsl:variable name="following_dl_colwidths">
2130
+ <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
2131
+ <xsl:variable name="html-table">
2132
+ <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2133
+ <xsl:element name="{$ns}:table">
2134
+ <xsl:for-each select="*[local-name() = 'dl'][1]">
2135
+ <tbody>
2136
+ <xsl:apply-templates mode="dl"/>
2137
+ </tbody>
2138
+ </xsl:for-each>
2139
+ </xsl:element>
2140
+ </xsl:variable>
2141
+
2142
+ <xsl:call-template name="calculate-column-widths">
2143
+ <xsl:with-param name="cols-count" select="2"/>
2144
+ <xsl:with-param name="table" select="$html-table"/>
2145
+ </xsl:call-template>
2146
+
2147
+ </xsl:if>
2148
+ </xsl:variable>
2149
+
2150
+
2151
+ <xsl:variable name="maxlength_dt">
2152
+ <xsl:for-each select="*[local-name() = 'dl'][1]">
2153
+ <xsl:call-template name="getMaxLength_dt"/>
2154
+ </xsl:for-each>
2155
+ </xsl:variable>
2156
+
2629
2157
  <xsl:if test="xalan:nodeset($references)//fn">
2630
2158
  <fo:block>
2631
2159
  <fo:table width="95%" table-layout="fixed">
@@ -2633,8 +2161,19 @@
2633
2161
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2634
2162
 
2635
2163
  </xsl:if>
2636
- <fo:table-column column-width="15%"/>
2637
- <fo:table-column column-width="85%"/>
2164
+ <xsl:choose>
2165
+ <!-- if there 'dl', then set same columns width -->
2166
+ <xsl:when test="xalan:nodeset($following_dl_colwidths)//column">
2167
+ <xsl:call-template name="setColumnWidth_dl">
2168
+ <xsl:with-param name="colwidths" select="$following_dl_colwidths"/>
2169
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2170
+ </xsl:call-template>
2171
+ </xsl:when>
2172
+ <xsl:otherwise>
2173
+ <fo:table-column column-width="15%"/>
2174
+ <fo:table-column column-width="85%"/>
2175
+ </xsl:otherwise>
2176
+ </xsl:choose>
2638
2177
  <fo:table-body>
2639
2178
  <xsl:for-each select="xalan:nodeset($references)//fn">
2640
2179
  <xsl:variable name="reference" select="@reference"/>
@@ -2666,7 +2205,7 @@
2666
2205
  </fo:block>
2667
2206
  </xsl:if>
2668
2207
 
2669
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='fn']">
2208
+ </xsl:template><xsl:template match="*[local-name()='fn']">
2670
2209
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
2671
2210
  <fo:inline font-size="80%" keep-with-previous.within-line="always">
2672
2211
 
@@ -2688,11 +2227,11 @@
2688
2227
  <xsl:value-of select="@reference"/>
2689
2228
  </fo:basic-link>
2690
2229
  </fo:inline>
2691
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='fn']/*[local-name()='p']">
2230
+ </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
2692
2231
  <fo:inline>
2693
2232
  <xsl:apply-templates/>
2694
2233
  </fo:inline>
2695
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dl']">
2234
+ </xsl:template><xsl:template match="*[local-name()='dl']">
2696
2235
  <xsl:variable name="parent" select="local-name(..)"/>
2697
2236
 
2698
2237
  <xsl:variable name="key_iso">
@@ -2705,6 +2244,11 @@
2705
2244
 
2706
2245
  <fo:block margin-bottom="12pt" text-align="left">
2707
2246
 
2247
+ <xsl:variable name="title-where">
2248
+ <xsl:call-template name="getTitle">
2249
+ <xsl:with-param name="name" select="'title-where'"/>
2250
+ </xsl:call-template>
2251
+ </xsl:variable>
2708
2252
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2709
2253
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
2710
2254
  <xsl:text/>
@@ -2718,14 +2262,24 @@
2718
2262
 
2719
2263
 
2720
2264
 
2265
+ <xsl:variable name="title-where">
2266
+ <xsl:call-template name="getTitle">
2267
+ <xsl:with-param name="name" select="'title-where'"/>
2268
+ </xsl:call-template>
2269
+ </xsl:variable>
2721
2270
  <xsl:value-of select="$title-where"/>
2722
2271
  </fo:block>
2723
2272
  </xsl:when>
2724
2273
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2725
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt">
2274
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2726
2275
 
2727
2276
 
2728
2277
 
2278
+ <xsl:variable name="title-key">
2279
+ <xsl:call-template name="getTitle">
2280
+ <xsl:with-param name="name" select="'title-key'"/>
2281
+ </xsl:call-template>
2282
+ </xsl:variable>
2729
2283
  <xsl:value-of select="$title-key"/>
2730
2284
  </fo:block>
2731
2285
  </xsl:when>
@@ -2742,23 +2296,6 @@
2742
2296
 
2743
2297
 
2744
2298
 
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
2299
 
2763
2300
  <fo:table width="95%" table-layout="fixed">
2764
2301
 
@@ -2771,42 +2308,30 @@
2771
2308
 
2772
2309
  </xsl:when>
2773
2310
  </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>
2311
+ <!-- create virtual html table for dl/[dt and dd] -->
2312
+ <xsl:variable name="html-table">
2313
+ <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2314
+ <xsl:element name="{$ns}:table">
2315
+ <tbody>
2316
+ <xsl:apply-templates mode="dl"/>
2317
+ </tbody>
2318
+ </xsl:element>
2319
+ </xsl:variable>
2320
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
2321
+ <xsl:variable name="colwidths">
2322
+ <xsl:call-template name="calculate-column-widths">
2323
+ <xsl:with-param name="cols-count" select="2"/>
2324
+ <xsl:with-param name="table" select="$html-table"/>
2325
+ </xsl:call-template>
2326
+ </xsl:variable>
2327
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2328
+ <xsl:variable name="maxlength_dt">
2329
+ <xsl:call-template name="getMaxLength_dt"/>
2330
+ </xsl:variable>
2331
+ <xsl:call-template name="setColumnWidth_dl">
2332
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2333
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2334
+ </xsl:call-template>
2810
2335
  <fo:table-body>
2811
2336
  <xsl:apply-templates>
2812
2337
  <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
@@ -2816,7 +2341,61 @@
2816
2341
  </fo:block>
2817
2342
  </fo:block>
2818
2343
  </xsl:if>
2819
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dl']/*[local-name()='note']">
2344
+ </xsl:template><xsl:template name="setColumnWidth_dl">
2345
+ <xsl:param name="colwidths"/>
2346
+ <xsl:param name="maxlength_dt"/>
2347
+ <xsl:choose>
2348
+ <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
2349
+ <fo:table-column column-width="50%"/>
2350
+ <fo:table-column column-width="50%"/>
2351
+ </xsl:when>
2352
+ <xsl:otherwise>
2353
+ <xsl:choose>
2354
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
2355
+ <fo:table-column column-width="5%"/>
2356
+ <fo:table-column column-width="95%"/>
2357
+ </xsl:when>
2358
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
2359
+ <fo:table-column column-width="10%"/>
2360
+ <fo:table-column column-width="90%"/>
2361
+ </xsl:when>
2362
+ <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
2363
+ <fo:table-column column-width="60%"/>
2364
+ <fo:table-column column-width="40%"/>
2365
+ </xsl:when> -->
2366
+ <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.3">
2367
+ <fo:table-column column-width="50%"/>
2368
+ <fo:table-column column-width="50%"/>
2369
+ </xsl:when>
2370
+ <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 0.5">
2371
+ <fo:table-column column-width="40%"/>
2372
+ <fo:table-column column-width="60%"/>
2373
+ </xsl:when>
2374
+ <xsl:otherwise>
2375
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2376
+ <xsl:choose>
2377
+ <xsl:when test=". = 1 or . = 0">
2378
+ <fo:table-column column-width="proportional-column-width(2)"/>
2379
+ </xsl:when>
2380
+ <xsl:otherwise>
2381
+ <fo:table-column column-width="proportional-column-width({.})"/>
2382
+ </xsl:otherwise>
2383
+ </xsl:choose>
2384
+ </xsl:for-each>
2385
+ </xsl:otherwise>
2386
+ </xsl:choose>
2387
+ <!-- <fo:table-column column-width="15%"/>
2388
+ <fo:table-column column-width="85%"/> -->
2389
+ </xsl:otherwise>
2390
+ </xsl:choose>
2391
+ </xsl:template><xsl:template name="getMaxLength_dt">
2392
+ <xsl:for-each select="*[local-name()='dt']">
2393
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2394
+ <xsl:if test="position() = 1">
2395
+ <xsl:value-of select="string-length(normalize-space(.))"/>
2396
+ </xsl:if>
2397
+ </xsl:for-each>
2398
+ </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2820
2399
  <xsl:param name="key_iso"/>
2821
2400
 
2822
2401
  <!-- <tr>
@@ -2832,7 +2411,7 @@
2832
2411
  <xsl:if test="normalize-space($key_iso) = 'true'">
2833
2412
  <xsl:attribute name="margin-top">0</xsl:attribute>
2834
2413
  </xsl:if>
2835
- <xsl:value-of select="$title-note"/>
2414
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2836
2415
  </fo:block>
2837
2416
  </fo:table-cell>
2838
2417
  <fo:table-cell>
@@ -2841,7 +2420,7 @@
2841
2420
  </fo:block>
2842
2421
  </fo:table-cell>
2843
2422
  </fo:table-row>
2844
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dt']" mode="dl">
2423
+ </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl">
2845
2424
  <tr>
2846
2425
  <td>
2847
2426
  <xsl:apply-templates/>
@@ -2854,7 +2433,7 @@
2854
2433
  </td>
2855
2434
  </tr>
2856
2435
 
2857
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dt']">
2436
+ </xsl:template><xsl:template match="*[local-name()='dt']">
2858
2437
  <xsl:param name="key_iso"/>
2859
2438
 
2860
2439
  <fo:table-row>
@@ -2872,8 +2451,15 @@
2872
2451
 
2873
2452
 
2874
2453
 
2875
- <xsl:apply-templates/>
2454
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
2455
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2876
2456
 
2457
+ <xsl:apply-templates/>
2458
+ <!-- <xsl:if test="$namespace = 'gb'">
2459
+ <xsl:if test="ancestor::*[local-name()='formula']">
2460
+ <xsl:text>—</xsl:text>
2461
+ </xsl:if>
2462
+ </xsl:if> -->
2877
2463
  </fo:block>
2878
2464
  </fo:table-cell>
2879
2465
  <fo:table-cell>
@@ -2887,37 +2473,37 @@
2887
2473
  </fo:table-cell>
2888
2474
  </fo:table-row>
2889
2475
 
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">
2476
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
2891
2477
  <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">
2478
+ </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
2893
2479
  <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">
2480
+ </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
2895
2481
  <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']">
2482
+ </xsl:template><xsl:template match="*[local-name()='em']">
2897
2483
  <fo:inline font-style="italic">
2898
2484
  <xsl:apply-templates/>
2899
2485
  </fo:inline>
2900
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='strong']">
2486
+ </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2901
2487
  <fo:inline font-weight="bold">
2902
2488
  <xsl:apply-templates/>
2903
2489
  </fo:inline>
2904
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='sup']">
2490
+ </xsl:template><xsl:template match="*[local-name()='sup']">
2905
2491
  <fo:inline font-size="80%" vertical-align="super">
2906
2492
  <xsl:apply-templates/>
2907
2493
  </fo:inline>
2908
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='sub']">
2494
+ </xsl:template><xsl:template match="*[local-name()='sub']">
2909
2495
  <fo:inline font-size="80%" vertical-align="sub">
2910
2496
  <xsl:apply-templates/>
2911
2497
  </fo:inline>
2912
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tt']">
2913
- <fo:inline font-family="Courier" font-size="10pt">
2498
+ </xsl:template><xsl:template match="*[local-name()='tt']">
2499
+ <fo:inline xsl:use-attribute-sets="tt-style">
2914
2500
  <xsl:apply-templates/>
2915
2501
  </fo:inline>
2916
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='del']">
2502
+ </xsl:template><xsl:template match="*[local-name()='del']">
2917
2503
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2918
2504
  <xsl:apply-templates/>
2919
2505
  </fo:inline>
2920
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="text()[ancestor::*[local-name()='smallcap']]">
2506
+ </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
2921
2507
  <xsl:variable name="text" select="normalize-space(.)"/>
2922
2508
  <fo:inline font-size="75%">
2923
2509
  <xsl:if test="string-length($text) &gt; 0">
@@ -2926,10 +2512,11 @@
2926
2512
  </xsl:call-template>
2927
2513
  </xsl:if>
2928
2514
  </fo:inline>
2929
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="recursiveSmallCaps">
2515
+ </xsl:template><xsl:template name="recursiveSmallCaps">
2930
2516
  <xsl:param name="text"/>
2931
2517
  <xsl:variable name="char" select="substring($text,1,1)"/>
2932
- <xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/>
2518
+ <!-- <xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/> -->
2519
+ <xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
2933
2520
  <xsl:choose>
2934
2521
  <xsl:when test="$char=$upperCase">
2935
2522
  <fo:inline font-size="{100 div 0.75}%">
@@ -2945,7 +2532,7 @@
2945
2532
  <xsl:with-param name="text" select="substring($text,2)"/>
2946
2533
  </xsl:call-template>
2947
2534
  </xsl:if>
2948
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="tokenize">
2535
+ </xsl:template><xsl:template name="tokenize">
2949
2536
  <xsl:param name="text"/>
2950
2537
  <xsl:param name="separator" select="' '"/>
2951
2538
  <xsl:choose>
@@ -2993,7 +2580,7 @@
2993
2580
  </xsl:call-template>
2994
2581
  </xsl:otherwise>
2995
2582
  </xsl:choose>
2996
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="max_length">
2583
+ </xsl:template><xsl:template name="max_length">
2997
2584
  <xsl:param name="words"/>
2998
2585
  <xsl:for-each select="$words//word">
2999
2586
  <xsl:sort select="." data-type="number" order="descending"/>
@@ -3001,11 +2588,11 @@
3001
2588
  <xsl:value-of select="."/>
3002
2589
  </xsl:if>
3003
2590
  </xsl:for-each>
3004
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="add-zero-spaces-java">
2591
+ </xsl:template><xsl:template name="add-zero-spaces-java">
3005
2592
  <xsl:param name="text" select="."/>
3006
2593
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
3007
2594
  <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">
2595
+ </xsl:template><xsl:template name="add-zero-spaces">
3009
2596
  <xsl:param name="text" select="."/>
3010
2597
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
3011
2598
  <xsl:variable name="zero-space-after-dot">.</xsl:variable>
@@ -3058,7 +2645,7 @@
3058
2645
  <xsl:value-of select="$text"/>
3059
2646
  </xsl:otherwise>
3060
2647
  </xsl:choose>
3061
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="add-zero-spaces-equal">
2648
+ </xsl:template><xsl:template name="add-zero-spaces-equal">
3062
2649
  <xsl:param name="text" select="."/>
3063
2650
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
3064
2651
  <xsl:variable name="zero-space-after-equal">=</xsl:variable>
@@ -3084,7 +2671,7 @@
3084
2671
  <xsl:value-of select="$text"/>
3085
2672
  </xsl:otherwise>
3086
2673
  </xsl:choose>
3087
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="getSimpleTable">
2674
+ </xsl:template><xsl:template name="getSimpleTable">
3088
2675
  <xsl:variable name="simple-table">
3089
2676
 
3090
2677
  <!-- Step 1. colspan processing -->
@@ -3111,9 +2698,9 @@
3111
2698
  </xsl:choose> -->
3112
2699
  </xsl:variable>
3113
2700
  <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">
2701
+ </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
3115
2702
  <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">
2703
+ </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
2704
  <xsl:choose>
3118
2705
  <xsl:when test="@colspan">
3119
2706
  <xsl:variable name="td">
@@ -3135,16 +2722,16 @@
3135
2722
  </xsl:element>
3136
2723
  </xsl:otherwise>
3137
2724
  </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">
2725
+ </xsl:template><xsl:template match="@colspan" mode="simple-table-colspan"/><xsl:template match="*[local-name()='tr']" mode="simple-table-colspan">
3139
2726
  <xsl:element name="tr">
3140
2727
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
3141
2728
  <xsl:apply-templates mode="simple-table-colspan"/>
3142
2729
  </xsl:element>
3143
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="@*|node()" mode="simple-table-colspan">
2730
+ </xsl:template><xsl:template match="@*|node()" mode="simple-table-colspan">
3144
2731
  <xsl:copy>
3145
2732
  <xsl:apply-templates select="@*|node()" mode="simple-table-colspan"/>
3146
2733
  </xsl:copy>
3147
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="repeatNode">
2734
+ </xsl:template><xsl:template name="repeatNode">
3148
2735
  <xsl:param name="count"/>
3149
2736
  <xsl:param name="node"/>
3150
2737
 
@@ -3155,18 +2742,18 @@
3155
2742
  </xsl:call-template>
3156
2743
  <xsl:copy-of select="$node"/>
3157
2744
  </xsl:if>
3158
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="@*|node()" mode="simple-table-rowspan">
2745
+ </xsl:template><xsl:template match="@*|node()" mode="simple-table-rowspan">
3159
2746
  <xsl:copy>
3160
2747
  <xsl:apply-templates select="@*|node()" mode="simple-table-rowspan"/>
3161
2748
  </xsl:copy>
3162
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="tbody" mode="simple-table-rowspan">
2749
+ </xsl:template><xsl:template match="tbody" mode="simple-table-rowspan">
3163
2750
  <xsl:copy>
3164
2751
  <xsl:copy-of select="tr[1]"/>
3165
2752
  <xsl:apply-templates select="tr[2]" mode="simple-table-rowspan">
3166
2753
  <xsl:with-param name="previousRow" select="tr[1]"/>
3167
2754
  </xsl:apply-templates>
3168
2755
  </xsl:copy>
3169
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="tr" mode="simple-table-rowspan">
2756
+ </xsl:template><xsl:template match="tr" mode="simple-table-rowspan">
3170
2757
  <xsl:param name="previousRow"/>
3171
2758
  <xsl:variable name="currentRow" select="."/>
3172
2759
 
@@ -3200,127 +2787,790 @@
3200
2787
  <xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan">
3201
2788
  <xsl:with-param name="previousRow" select="$newRow"/>
3202
2789
  </xsl:apply-templates>
3203
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="getLang">
2790
+ </xsl:template><xsl:template name="getLang">
3204
2791
  <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3205
2792
  <xsl:choose>
3206
2793
  <xsl:when test="$language = 'English'">en</xsl:when>
3207
2794
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
3208
2795
  </xsl:choose>
3209
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="capitalizeWords">
2796
+ </xsl:template><xsl:template name="capitalizeWords">
3210
2797
  <xsl:param name="str"/>
3211
2798
  <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
3212
2799
  <xsl:choose>
3213
2800
  <xsl:when test="contains($str2, ' ')">
3214
2801
  <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)"/>
2802
+ <!-- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
2803
+ <xsl:value-of select="substring($substr, 2)"/> -->
2804
+ <xsl:call-template name="capitalize">
2805
+ <xsl:with-param name="str" select="$substr"/>
2806
+ </xsl:call-template>
3217
2807
  <xsl:text> </xsl:text>
3218
2808
  <xsl:call-template name="capitalizeWords">
3219
2809
  <xsl:with-param name="str" select="substring-after($str2, ' ')"/>
3220
2810
  </xsl:call-template>
3221
2811
  </xsl:when>
3222
2812
  <xsl:otherwise>
3223
- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
3224
- <xsl:value-of select="substring($str2, 2)"/>
2813
+ <!-- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
2814
+ <xsl:value-of select="substring($str2, 2)"/> -->
2815
+ <xsl:call-template name="capitalize">
2816
+ <xsl:with-param name="str" select="$str2"/>
2817
+ </xsl:call-template>
2818
+ </xsl:otherwise>
2819
+ </xsl:choose>
2820
+ </xsl:template><xsl:template name="capitalize">
2821
+ <xsl:param name="str"/>
2822
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2823
+ <xsl:value-of select="substring($str, 2)"/>
2824
+ </xsl:template><xsl:template match="mathml:math">
2825
+ <fo:inline font-family="STIX2Math">
2826
+ <fo:instream-foreign-object fox:alt-text="Math">
2827
+ <xsl:copy-of select="."/>
2828
+ </fo:instream-foreign-object>
2829
+ </fo:inline>
2830
+ </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
2831
+ <xsl:variable name="target">
2832
+ <xsl:choose>
2833
+ <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
2834
+ <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
2835
+ </xsl:when>
2836
+ <xsl:otherwise>
2837
+ <xsl:value-of select="normalize-space(@target)"/>
2838
+ </xsl:otherwise>
2839
+ </xsl:choose>
2840
+ </xsl:variable>
2841
+ <fo:inline xsl:use-attribute-sets="link-style">
2842
+ <xsl:choose>
2843
+ <xsl:when test="$target = ''">
2844
+ <xsl:apply-templates/>
2845
+ </xsl:when>
2846
+ <xsl:otherwise>
2847
+ <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
2848
+ <xsl:choose>
2849
+ <xsl:when test="normalize-space(.) = ''">
2850
+ <xsl:value-of select="$target"/>
2851
+ </xsl:when>
2852
+ <xsl:otherwise>
2853
+ <xsl:apply-templates/>
2854
+ </xsl:otherwise>
2855
+ </xsl:choose>
2856
+ </fo:basic-link>
2857
+ </xsl:otherwise>
2858
+ </xsl:choose>
2859
+ </fo:inline>
2860
+ </xsl:template><xsl:template match="*[local-name()='bookmark']">
2861
+ <fo:inline id="{@id}"/>
2862
+ </xsl:template><xsl:template match="*[local-name()='appendix']">
2863
+ <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
2864
+ <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
2865
+ </fo:block>
2866
+ <xsl:apply-templates/>
2867
+ </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
2868
+ <fo:inline><xsl:apply-templates/></fo:inline>
2869
+ </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
2870
+ <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
2871
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2872
+ </fo:block>
2873
+ <xsl:apply-templates/>
2874
+ </xsl:template><xsl:template match="*[local-name() = 'callout']">
2875
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
2876
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']">
2877
+ <xsl:variable name="annotation-id" select="@id"/>
2878
+ <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
2879
+ <fo:block id="{$annotation-id}" white-space="nowrap">
2880
+ <fo:inline>
2881
+ <xsl:apply-templates>
2882
+ <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
2883
+ </xsl:apply-templates>
2884
+ </fo:inline>
2885
+ </fo:block>
2886
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
2887
+ <xsl:param name="callout"/>
2888
+ <fo:inline id="{@id}">
2889
+ <!-- for first p in annotation, put <x> -->
2890
+ <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
2891
+ <xsl:apply-templates/>
2892
+ </fo:inline>
2893
+ </xsl:template><xsl:template match="*[local-name() = 'modification']">
2894
+ <xsl:variable name="title-modified">
2895
+ <xsl:call-template name="getTitle">
2896
+ <xsl:with-param name="name" select="'title-modified'"/>
2897
+ </xsl:call-template>
2898
+ </xsl:variable>
2899
+ <xsl:choose>
2900
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
2901
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
2902
+ </xsl:choose>
2903
+ <xsl:apply-templates/>
2904
+ </xsl:template><xsl:template match="*[local-name() = 'xref']">
2905
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2906
+
2907
+ <xsl:apply-templates/>
2908
+ </fo:basic-link>
2909
+ </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
2910
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2911
+ <xsl:apply-templates/>
2912
+ </fo:block>
2913
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
2914
+ <fo:inline>
2915
+ <xsl:apply-templates/>
2916
+ </fo:inline>
2917
+ </xsl:template><xsl:template match="*[local-name() = 'admitted']/*[local-name() = 'stem']">
2918
+ <fo:inline>
2919
+ <xsl:apply-templates/>
2920
+ </fo:inline>
2921
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="presentation">
2922
+ <xsl:if test="normalize-space() != ''">
2923
+ <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
2924
+ </xsl:if>
2925
+ </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
2926
+
2927
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
2928
+
2929
+
2930
+ <xsl:if test="ancestor::ogc:ul or ancestor::ogc:ol and not(ancestor::ogc:note[1]/following-sibling::*)">
2931
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2932
+ </xsl:if>
2933
+
2934
+
2935
+
2936
+ <fo:block-container margin-left="0mm">
2937
+
2938
+
2939
+
2940
+
2941
+
2942
+
2943
+
2944
+
2945
+ <fo:block>
2946
+
2947
+
2948
+
2949
+
2950
+ <fo:inline xsl:use-attribute-sets="note-name-style">
2951
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2952
+ </fo:inline>
2953
+ <xsl:apply-templates/>
2954
+ </fo:block>
2955
+
2956
+
2957
+ </fo:block-container>
2958
+ </fo:block-container>
2959
+
2960
+ </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
2961
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
2962
+ <xsl:choose>
2963
+ <xsl:when test="$num = 1">
2964
+ <fo:inline xsl:use-attribute-sets="note-p-style">
2965
+ <xsl:apply-templates/>
2966
+ </fo:inline>
2967
+ </xsl:when>
2968
+ <xsl:otherwise>
2969
+ <fo:block xsl:use-attribute-sets="note-p-style">
2970
+ <xsl:apply-templates/>
2971
+ </fo:block>
2972
+ </xsl:otherwise>
2973
+ </xsl:choose>
2974
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']">
2975
+ <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
2976
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2977
+ <xsl:apply-templates/>
2978
+ </fo:block>
2979
+ </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name'] | *[local-name() = 'termnote']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']" mode="presentation">
2980
+ <xsl:param name="sfx"/>
2981
+ <xsl:variable name="suffix">
2982
+ <xsl:choose>
2983
+ <xsl:when test="$sfx != ''">
2984
+ <xsl:value-of select="$sfx"/>
2985
+ </xsl:when>
2986
+ <xsl:otherwise>
2987
+
2988
+
2989
+ </xsl:otherwise>
2990
+ </xsl:choose>
2991
+ </xsl:variable>
2992
+ <xsl:if test="normalize-space() != ''">
2993
+ <xsl:apply-templates/>
2994
+ <xsl:value-of select="$suffix"/>
2995
+ </xsl:if>
2996
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']" mode="presentation">
2997
+ <xsl:param name="sfx"/>
2998
+ <xsl:variable name="suffix">
2999
+ <xsl:choose>
3000
+ <xsl:when test="$sfx != ''">
3001
+ <xsl:value-of select="$sfx"/>
3002
+ </xsl:when>
3003
+ <xsl:otherwise>
3004
+
3005
+ <xsl:text>:</xsl:text>
3006
+
3007
+
3008
+ </xsl:otherwise>
3009
+ </xsl:choose>
3010
+ </xsl:variable>
3011
+ <xsl:if test="normalize-space() != ''">
3012
+ <xsl:apply-templates/>
3013
+ <xsl:value-of select="$suffix"/>
3014
+ </xsl:if>
3015
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
3016
+ <fo:inline><xsl:apply-templates/></fo:inline>
3017
+ </xsl:template><xsl:template match="*[local-name() = 'terms']">
3018
+ <fo:block id="{@id}">
3019
+ <xsl:apply-templates/>
3020
+ </fo:block>
3021
+ </xsl:template><xsl:template match="*[local-name() = 'term']">
3022
+ <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
3023
+
3024
+
3025
+
3026
+ <xsl:apply-templates/>
3027
+ </fo:block>
3028
+ </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
3029
+ <xsl:if test="normalize-space() != ''">
3030
+ <fo:inline>
3031
+ <xsl:apply-templates/>
3032
+ <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
3033
+ <xsl:text>.</xsl:text>
3034
+ </xsl:if> -->
3035
+ </fo:inline>
3036
+ </xsl:if>
3037
+ </xsl:template><xsl:template match="*[local-name() = 'figure']">
3038
+ <fo:block-container id="{@id}">
3039
+ <fo:block>
3040
+ <xsl:apply-templates/>
3041
+ </fo:block>
3042
+ <xsl:call-template name="fn_display_figure"/>
3043
+ <xsl:for-each select="*[local-name() = 'note']">
3044
+ <xsl:call-template name="note"/>
3045
+ </xsl:for-each>
3046
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3047
+ </fo:block-container>
3048
+ </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
3049
+ <fo:block id="{@id}">
3050
+ <xsl:apply-templates/>
3051
+ </fo:block>
3052
+ </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
3053
+ <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
3054
+ <xsl:apply-templates/>
3055
+ </fo:block>
3056
+ </xsl:template><xsl:template match="*[local-name() = 'image']">
3057
+ <fo:block xsl:use-attribute-sets="image-style">
3058
+
3059
+
3060
+ <xsl:variable name="src">
3061
+ <xsl:choose>
3062
+ <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
3063
+ <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
3064
+ </xsl:when>
3065
+ <xsl:otherwise>
3066
+ <xsl:value-of select="@src"/>
3067
+ </xsl:otherwise>
3068
+ </xsl:choose>
3069
+ </xsl:variable>
3070
+
3071
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3072
+ </fo:block>
3073
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
3074
+ <xsl:apply-templates mode="contents"/>
3075
+ <xsl:text> </xsl:text>
3076
+ </xsl:template><xsl:template match="text()" mode="contents">
3077
+ <xsl:value-of select="."/>
3078
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3079
+ <xsl:if test="normalize-space() != ''">
3080
+ <fo:block xsl:use-attribute-sets="figure-name-style">
3081
+
3082
+ <xsl:apply-templates/>
3083
+ </fo:block>
3084
+ </xsl:if>
3085
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/><xsl:template match="*[local-name() = 'title']" mode="contents_item">
3086
+ <xsl:apply-templates mode="contents_item"/>
3087
+ <!-- <xsl:text> </xsl:text> -->
3088
+ </xsl:template><xsl:template name="getSection">
3089
+ <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
3090
+ </xsl:template><xsl:template name="getName">
3091
+ <xsl:choose>
3092
+ <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
3093
+ <xsl:copy-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/following-sibling::node()"/>
3094
+ </xsl:when>
3095
+ <xsl:otherwise>
3096
+ <xsl:copy-of select="*[local-name() = 'title']/node()"/>
3097
+ </xsl:otherwise>
3098
+ </xsl:choose>
3099
+ </xsl:template><xsl:template name="insertTitleAsListItem">
3100
+ <xsl:param name="provisional-distance-between-starts" select="'9.5mm'"/>
3101
+ <xsl:variable name="section">
3102
+ <xsl:for-each select="..">
3103
+ <xsl:call-template name="getSection"/>
3104
+ </xsl:for-each>
3105
+ </xsl:variable>
3106
+ <fo:list-block provisional-distance-between-starts="{$provisional-distance-between-starts}">
3107
+ <fo:list-item>
3108
+ <fo:list-item-label end-indent="label-end()">
3109
+ <fo:block>
3110
+ <xsl:value-of select="$section"/>
3111
+ </fo:block>
3112
+ </fo:list-item-label>
3113
+ <fo:list-item-body start-indent="body-start()">
3114
+ <fo:block>
3115
+ <xsl:choose>
3116
+ <xsl:when test="*[local-name() = 'tab']">
3117
+ <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
3118
+ </xsl:when>
3119
+ <xsl:otherwise>
3120
+ <xsl:apply-templates/>
3121
+ </xsl:otherwise>
3122
+ </xsl:choose>
3123
+ </fo:block>
3124
+ </fo:list-item-body>
3125
+ </fo:list-item>
3126
+ </fo:list-block>
3127
+ </xsl:template><xsl:template name="extractTitle">
3128
+ <xsl:choose>
3129
+ <xsl:when test="*[local-name() = 'tab']">
3130
+ <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
3131
+ </xsl:when>
3132
+ <xsl:otherwise>
3133
+ <xsl:apply-templates/>
3134
+ </xsl:otherwise>
3135
+ </xsl:choose>
3136
+ </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
3137
+ <xsl:text> </xsl:text>
3138
+ </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
3139
+ <xsl:copy>
3140
+ <xsl:apply-templates mode="contents_item"/>
3141
+ </xsl:copy>
3142
+ </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
3143
+ <xsl:text> </xsl:text>
3144
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
3145
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
3146
+ <xsl:apply-templates/>
3147
+ </fo:block>
3148
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3149
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()">
3150
+ <xsl:variable name="text">
3151
+ <xsl:call-template name="add-zero-spaces-equal"/>
3152
+ </xsl:variable>
3153
+ <xsl:call-template name="add-zero-spaces">
3154
+ <xsl:with-param name="text" select="$text"/>
3155
+ </xsl:call-template>
3156
+ </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
3157
+ <xsl:if test="normalize-space() != ''">
3158
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
3159
+
3160
+ <xsl:apply-templates/>
3161
+ </fo:block>
3162
+ </xsl:if>
3163
+ </xsl:template><xsl:template match="*[local-name() = 'permission']">
3164
+ <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
3165
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3166
+ <xsl:apply-templates/>
3167
+ </fo:block>
3168
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']" mode="presentation">
3169
+ <xsl:if test="normalize-space() != ''">
3170
+ <fo:block xsl:use-attribute-sets="permission-name-style">
3171
+ <xsl:apply-templates/>
3172
+
3173
+ <xsl:text>:</xsl:text>
3174
+
3175
+ </fo:block>
3176
+ </xsl:if>
3177
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'label']">
3178
+ <fo:block xsl:use-attribute-sets="permission-label-style">
3179
+ <xsl:apply-templates/>
3180
+ </fo:block>
3181
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']">
3182
+ <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
3183
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3184
+ <xsl:apply-templates select="*[local-name()='label']" mode="presentation"/>
3185
+ <xsl:apply-templates select="@obligation" mode="presentation"/>
3186
+ <xsl:apply-templates select="*[local-name()='subject']" mode="presentation"/>
3187
+ <xsl:apply-templates/>
3188
+ </fo:block>
3189
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']" mode="presentation">
3190
+ <xsl:if test="normalize-space() != ''">
3191
+ <fo:block xsl:use-attribute-sets="requirement-name-style">
3192
+
3193
+ <xsl:if test="../@type = 'class'">
3194
+ <xsl:attribute name="background-color">white</xsl:attribute>
3195
+ </xsl:if>
3196
+
3197
+ <xsl:apply-templates/>
3198
+
3199
+ <xsl:text>:</xsl:text>
3200
+
3201
+ </fo:block>
3202
+ </xsl:if>
3203
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']" mode="presentation">
3204
+ <fo:block xsl:use-attribute-sets="requirement-label-style">
3205
+ <xsl:apply-templates/>
3206
+ </fo:block>
3207
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation" mode="presentation">
3208
+ <fo:block>
3209
+ <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
3210
+ </fo:block>
3211
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
3212
+ <fo:block xsl:use-attribute-sets="requirement-subject-style">
3213
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
3214
+ </fo:block>
3215
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
3216
+ <fo:block xsl:use-attribute-sets="requirement-inherit-style">
3217
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
3218
+ </fo:block>
3219
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
3220
+ <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
3221
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3222
+ <xsl:apply-templates/>
3223
+ </fo:block>
3224
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']" mode="presentation">
3225
+ <xsl:if test="normalize-space() != ''">
3226
+ <fo:block xsl:use-attribute-sets="recommendation-name-style">
3227
+ <xsl:apply-templates/>
3228
+
3229
+ </fo:block>
3230
+ </xsl:if>
3231
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'label']">
3232
+ <fo:block xsl:use-attribute-sets="recommendation-label-style">
3233
+ <xsl:apply-templates/>
3234
+ </fo:block>
3235
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']">
3236
+ <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
3237
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3238
+ <xsl:apply-templates/>
3239
+ </fo:block>
3240
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']" mode="presentation">
3241
+ <xsl:if test="normalize-space() != ''">
3242
+ <fo:inline xsl:use-attribute-sets="termexample-name-style">
3243
+ <xsl:apply-templates/>
3244
+ </fo:inline>
3245
+ </xsl:if>
3246
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
3247
+ <fo:inline><xsl:apply-templates/></fo:inline>
3248
+ </xsl:template><xsl:template match="*[local-name() = 'example']">
3249
+ <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
3250
+
3251
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3252
+
3253
+ <xsl:variable name="element">
3254
+ block
3255
+
3256
+ </xsl:variable>
3257
+
3258
+ <xsl:choose>
3259
+ <xsl:when test="normalize-space($element) = 'block'">
3260
+ <fo:block xsl:use-attribute-sets="example-body-style">
3261
+ <xsl:apply-templates/>
3262
+ </fo:block>
3263
+ </xsl:when>
3264
+ <xsl:otherwise>
3265
+ <fo:inline>
3266
+ <xsl:apply-templates/>
3267
+ </fo:inline>
3268
+ </xsl:otherwise>
3269
+ </xsl:choose>
3270
+
3271
+ </fo:block>
3272
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']" mode="presentation">
3273
+
3274
+ <xsl:variable name="element">
3275
+ block
3276
+
3277
+ </xsl:variable>
3278
+ <xsl:choose>
3279
+ <xsl:when test="ancestor::*[local-name() = 'appendix']">
3280
+ <fo:inline>
3281
+ <xsl:apply-templates/>
3282
+ </fo:inline>
3283
+ </xsl:when>
3284
+ <xsl:when test="normalize-space($element) = 'block'">
3285
+ <fo:block xsl:use-attribute-sets="example-name-style">
3286
+ <xsl:apply-templates/>
3287
+ </fo:block>
3288
+ </xsl:when>
3289
+ <xsl:otherwise>
3290
+ <fo:inline xsl:use-attribute-sets="example-name-style">
3291
+ <xsl:apply-templates/>
3292
+ </fo:inline>
3225
3293
  </xsl:otherwise>
3226
3294
  </xsl:choose>
3227
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="mathml:math">
3228
- <fo:inline font-family="STIX2Math">
3229
- <fo:instream-foreign-object fox:alt-text="Math">
3230
- <xsl:copy-of select="."/>
3231
- </fo:instream-foreign-object>
3232
- </fo:inline>
3233
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='localityStack']">
3234
- <xsl:for-each select="*[local-name()='locality']">
3235
- <xsl:if test="position() =1"><xsl:text>, </xsl:text></xsl:if>
3236
- <xsl:apply-templates select="."/>
3237
- <xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if>
3238
- </xsl:for-each>
3239
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='link']" name="link">
3240
- <xsl:variable name="target">
3295
+
3296
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3297
+ <fo:block xsl:use-attribute-sets="example-p-style">
3298
+
3299
+ <xsl:apply-templates/>
3300
+ </fo:block>
3301
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']">
3302
+ <fo:block xsl:use-attribute-sets="termsource-style">
3303
+ <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
3304
+ <xsl:variable name="termsource_text">
3305
+ <xsl:apply-templates/>
3306
+ </xsl:variable>
3241
3307
  <xsl:choose>
3242
- <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
3243
- <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
3308
+ <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
3309
+ <xsl:apply-templates/>
3244
3310
  </xsl:when>
3245
3311
  <xsl:otherwise>
3246
- <xsl:value-of select="normalize-space(@target)"/>
3312
+ <xsl:text>[</xsl:text>
3313
+ <xsl:apply-templates/>
3314
+ <xsl:text>]</xsl:text>
3247
3315
  </xsl:otherwise>
3248
3316
  </xsl:choose>
3317
+ </fo:block>
3318
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
3319
+ <xsl:if test="normalize-space() != ''">
3320
+ <xsl:value-of select="."/>
3321
+ </xsl:if>
3322
+ </xsl:template><xsl:template match="*[local-name() = 'origin']">
3323
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3324
+
3325
+ <xsl:call-template name="getTitle">
3326
+ <xsl:with-param name="name" select="'title-source'"/>
3327
+ </xsl:call-template>
3328
+ <xsl:text>: </xsl:text>
3329
+
3330
+ <fo:inline xsl:use-attribute-sets="origin-style">
3331
+ <xsl:apply-templates/>
3332
+ </fo:inline>
3333
+ </fo:basic-link>
3334
+ </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
3335
+ <fo:inline><xsl:apply-templates/></fo:inline>
3336
+ </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
3337
+ <xsl:if test="normalize-space() != ''">
3338
+ <xsl:value-of select="."/>
3339
+ </xsl:if>
3340
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
3341
+
3342
+ <fo:block xsl:use-attribute-sets="quote-style">
3343
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3344
+ </fo:block>
3345
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3346
+ <fo:block xsl:use-attribute-sets="quote-source-style">
3347
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
3348
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
3349
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
3350
+ </fo:block>
3351
+ </xsl:if>
3352
+ </xsl:template><xsl:template match="*[local-name() = 'source']">
3353
+ <xsl:if test="../*[local-name() = 'author']">
3354
+ <xsl:text>, </xsl:text>
3355
+ </xsl:if>
3356
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3357
+ <xsl:apply-templates/>
3358
+ </fo:basic-link>
3359
+ </xsl:template><xsl:template match="*[local-name() = 'author']">
3360
+ <xsl:text>— </xsl:text>
3361
+ <xsl:apply-templates/>
3362
+ </xsl:template><xsl:template match="*[local-name() = 'eref']">
3363
+ <fo:inline xsl:use-attribute-sets="eref-style">
3364
+ <xsl:if test="@type = 'footnote'">
3365
+
3366
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
3367
+ <xsl:attribute name="font-size">80%</xsl:attribute>
3368
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3369
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
3370
+
3371
+
3372
+ </xsl:if>
3373
+
3374
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3375
+
3376
+ <xsl:if test="@type = 'inline'">
3377
+
3378
+ <xsl:attribute name="color">blue</xsl:attribute>
3379
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
3380
+
3381
+
3382
+ </xsl:if>
3383
+
3384
+
3385
+ <xsl:apply-templates/>
3386
+ </fo:basic-link>
3387
+ </fo:inline>
3388
+ </xsl:template><xsl:template match="*[local-name() = 'tab']">
3389
+ <!-- zero-space char -->
3390
+ <xsl:variable name="depth">
3391
+ <xsl:call-template name="getLevel">
3392
+ <xsl:with-param name="depth" select="../@depth"/>
3393
+ </xsl:call-template>
3249
3394
  </xsl:variable>
3250
- <fo:inline xsl:use-attribute-sets="link-style">
3395
+
3396
+ <xsl:variable name="padding">
3397
+
3398
+
3399
+
3400
+
3401
+
3402
+
3403
+
3404
+
3405
+
3406
+
3407
+
3408
+
3409
+ <xsl:choose>
3410
+ <xsl:when test="$depth &gt;= 5"/>
3411
+ <xsl:when test="$depth &gt;= 4">5</xsl:when>
3412
+ <xsl:when test="$depth &gt;= 3 and ancestor::ogc:terms">3</xsl:when>
3413
+ <xsl:when test="$depth &gt;= 2">4</xsl:when>
3414
+ <xsl:when test="$depth = 1">4</xsl:when>
3415
+ <xsl:otherwise>2</xsl:otherwise>
3416
+ </xsl:choose>
3417
+
3418
+
3419
+
3420
+
3421
+
3422
+
3423
+ </xsl:variable>
3424
+
3425
+ <xsl:variable name="padding-right">
3251
3426
  <xsl:choose>
3252
- <xsl:when test="$target = ''">
3253
- <xsl:apply-templates/>
3254
- </xsl:when>
3427
+ <xsl:when test="normalize-space($padding) = ''">0</xsl:when>
3255
3428
  <xsl:otherwise>
3256
- <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
3257
- <xsl:choose>
3258
- <xsl:when test="normalize-space(.) = ''">
3259
- <xsl:value-of select="$target"/>
3260
- </xsl:when>
3261
- <xsl:otherwise>
3262
- <xsl:apply-templates/>
3263
- </xsl:otherwise>
3264
- </xsl:choose>
3265
- </fo:basic-link>
3429
+ <xsl:value-of select="normalize-space($padding)"/>
3266
3430
  </xsl:otherwise>
3267
3431
  </xsl:choose>
3268
- </fo:inline>
3269
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='sourcecode']" name="sourcecode">
3270
- <fo:block xsl:use-attribute-sets="sourcecode-style">
3271
- <!-- <xsl:choose>
3272
- <xsl:when test="@lang = 'en'"></xsl:when>
3273
- <xsl:otherwise> -->
3274
- <xsl:attribute name="white-space">pre</xsl:attribute>
3275
- <xsl:attribute name="wrap-option">wrap</xsl:attribute>
3276
- <!-- </xsl:otherwise>
3277
- </xsl:choose> -->
3432
+ </xsl:variable>
3433
+
3434
+ <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3435
+
3436
+ <xsl:choose>
3437
+ <xsl:when test="$language = 'zh'">
3438
+ <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
3439
+ </xsl:when>
3440
+ <xsl:when test="../../@inline-header = 'true'">
3441
+ <fo:inline font-size="90%">
3442
+ <xsl:call-template name="insertNonBreakSpaces">
3443
+ <xsl:with-param name="count" select="$padding-right"/>
3444
+ </xsl:call-template>
3445
+ </fo:inline>
3446
+ </xsl:when>
3447
+ <xsl:otherwise>
3448
+ <fo:inline padding-right="{$padding-right}mm">​</fo:inline>
3449
+ </xsl:otherwise>
3450
+ </xsl:choose>
3451
+
3452
+ </xsl:template><xsl:template name="insertNonBreakSpaces">
3453
+ <xsl:param name="count"/>
3454
+ <xsl:if test="$count &gt; 0">
3455
+ <xsl:text> </xsl:text>
3456
+ <xsl:call-template name="insertNonBreakSpaces">
3457
+ <xsl:with-param name="count" select="$count - 1"/>
3458
+ </xsl:call-template>
3459
+ </xsl:if>
3460
+ </xsl:template><xsl:template match="*[local-name() = 'domain']">
3461
+ <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
3462
+ <xsl:text> </xsl:text>
3463
+ </xsl:template><xsl:template match="*[local-name() = 'admitted']">
3464
+ <fo:block xsl:use-attribute-sets="admitted-style">
3278
3465
  <xsl:apply-templates/>
3279
3466
  </fo:block>
3280
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='bookmark']">
3281
- <fo:inline id="{@id}"/>
3282
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']">
3283
- <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
3284
- <fo:inline padding-right="5mm"><xsl:value-of select="$title-appendix"/> <xsl:number/></fo:inline>
3285
- <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
3467
+ </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3468
+ <xsl:variable name="title-deprecated">
3469
+ <xsl:call-template name="getTitle">
3470
+ <xsl:with-param name="name" select="'title-deprecated'"/>
3471
+ </xsl:call-template>
3472
+ </xsl:variable>
3473
+ <fo:block xsl:use-attribute-sets="deprecates-style">
3474
+ <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
3286
3475
  </fo:block>
3476
+ </xsl:template><xsl:template match="*[local-name() = 'definition']">
3477
+ <fo:block xsl:use-attribute-sets="definition-style">
3478
+ <xsl:apply-templates/>
3479
+ </fo:block>
3480
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
3287
3481
  <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">
3289
- <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']">
3291
- <fo:block xsl:use-attribute-sets="appendix-example-style">
3292
- <xsl:variable name="claims_id" select="ancestor::*[local-name()='clause'][1]/@id"/>
3293
- <xsl:value-of select="$title-example"/>
3294
- <xsl:if test="count(ancestor::*[local-name()='clause'][1]//*[local-name()='example']) &gt; 1">
3295
- <xsl:number count="*[local-name()='example'][ancestor::*[local-name()='clause'][@id = $claims_id]]" level="any"/><xsl:text> </xsl:text>
3482
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
3483
+ <fo:inline> <xsl:apply-templates/></fo:inline>
3484
+ <fo:block> </fo:block>
3485
+ </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
3486
+
3487
+ <fo:block>
3488
+ <xsl:call-template name="setId"/>
3489
+
3490
+
3491
+
3492
+
3493
+
3494
+
3495
+
3496
+ <xsl:variable name="pos"><xsl:number count="ogc:sections/ogc:clause[not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]"/></xsl:variable> <!-- | ogc:sections/ogc:terms -->
3497
+ <xsl:if test="$pos &gt;= 2">
3498
+ <xsl:attribute name="space-before">18pt</xsl:attribute>
3296
3499
  </xsl:if>
3297
- <xsl:if test="*[local-name()='name']">
3298
- <xsl:text>— </xsl:text><xsl:apply-templates select="*[local-name()='name']" mode="process"/>
3299
- </xsl:if>
3500
+
3501
+
3502
+
3503
+
3504
+ <xsl:apply-templates/>
3505
+ </fo:block>
3506
+
3507
+
3508
+
3509
+ </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
3510
+ <fo:block break-after="page"/>
3511
+ <fo:block>
3512
+ <xsl:call-template name="setId"/>
3513
+ <xsl:apply-templates/>
3514
+ </fo:block>
3515
+ </xsl:template><xsl:template match="*[local-name() = 'clause']">
3516
+ <fo:block>
3517
+ <xsl:call-template name="setId"/>
3518
+ <xsl:apply-templates/>
3519
+ </fo:block>
3520
+ </xsl:template><xsl:template match="*[local-name() = 'definitions']">
3521
+ <fo:block id="{@id}">
3522
+ <xsl:apply-templates/>
3523
+ </fo:block>
3524
+ </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@id = '_normative_references' or @id = '_references']">
3525
+
3526
+ <fo:block id="{@id}">
3527
+ <xsl:apply-templates/>
3528
+ </fo:block>
3529
+ </xsl:template><xsl:template match="*[local-name() = 'annex']">
3530
+ <fo:block break-after="page"/>
3531
+ <fo:block id="{@id}">
3532
+
3300
3533
  </fo:block>
3301
3534
  <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">
3303
- <fo:inline><xsl:apply-templates/></fo:inline>
3304
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name() = 'callout']">
3305
- <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']">
3307
- <xsl:variable name="annotation-id" select="@id"/>
3308
- <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
3309
- <fo:block id="{$annotation-id}" white-space="nowrap">
3310
- <fo:inline>
3311
- <xsl:apply-templates>
3312
- <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
3313
- </xsl:apply-templates>
3314
- </fo:inline>
3315
- </fo:block>
3316
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name() = 'annotation']/*[local-name() = 'p']">
3317
- <xsl:param name="callout"/>
3318
- <fo:inline id="{@id}">
3319
- <!-- for first p in annotation, put <x> -->
3320
- <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
3535
+ </xsl:template><xsl:template match="*[local-name() = 'review']">
3536
+ <!-- comment 2019-11-29 -->
3537
+ <!-- <fo:block font-weight="bold">Review:</fo:block>
3538
+ <xsl:apply-templates /> -->
3539
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
3540
+ <!-- 0xA0 to space replacement -->
3541
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3542
+ </xsl:template><xsl:template match="*[local-name() = 'errata']">
3543
+ <!-- <row>
3544
+ <date>05-07-2013</date>
3545
+ <type>Editorial</type>
3546
+ <change>Changed CA-9 Priority Code from P1 to P2 in <xref target="tabled2"/>.</change>
3547
+ <pages>D-3</pages>
3548
+ </row>
3549
+ -->
3550
+ <fo:table table-layout="fixed" width="100%" font-size="10pt" border="1pt solid black">
3551
+ <fo:table-column column-width="20mm"/>
3552
+ <fo:table-column column-width="23mm"/>
3553
+ <fo:table-column column-width="107mm"/>
3554
+ <fo:table-column column-width="15mm"/>
3555
+ <fo:table-body>
3556
+ <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
3557
+ <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
3558
+ <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
3559
+ <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
3560
+ <fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell>
3561
+ </fo:table-row>
3562
+ <xsl:apply-templates/>
3563
+ </fo:table-body>
3564
+ </fo:table>
3565
+ </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']">
3566
+ <fo:table-row>
3321
3567
  <xsl:apply-templates/>
3322
- </fo:inline>
3323
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="convertDate">
3568
+ </fo:table-row>
3569
+ </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*">
3570
+ <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
3571
+ <fo:block><xsl:apply-templates/></fo:block>
3572
+ </fo:table-cell>
3573
+ </xsl:template><xsl:template name="convertDate">
3324
3574
  <xsl:param name="date"/>
3325
3575
  <xsl:param name="format" select="'short'"/>
3326
3576
  <xsl:variable name="year" select="substring($date, 1, 4)"/>
@@ -3353,7 +3603,7 @@
3353
3603
  </xsl:choose>
3354
3604
  </xsl:variable>
3355
3605
  <xsl:value-of select="$result"/>
3356
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="insertKeywords">
3606
+ </xsl:template><xsl:template name="insertKeywords">
3357
3607
  <xsl:param name="sorting" select="'true'"/>
3358
3608
  <xsl:param name="charAtEnd" select="'.'"/>
3359
3609
  <xsl:param name="charDelim" select="', '"/>
@@ -3376,7 +3626,7 @@
3376
3626
  </xsl:for-each>
3377
3627
  </xsl:otherwise>
3378
3628
  </xsl:choose>
3379
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="insertKeyword">
3629
+ </xsl:template><xsl:template name="insertKeyword">
3380
3630
  <xsl:param name="charAtEnd"/>
3381
3631
  <xsl:param name="charDelim"/>
3382
3632
  <xsl:apply-templates/>
@@ -3384,4 +3634,169 @@
3384
3634
  <xsl:when test="position() != last()"><xsl:value-of select="$charDelim"/></xsl:when>
3385
3635
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
3386
3636
  </xsl:choose>
3637
+ </xsl:template><xsl:template name="addPDFUAmeta">
3638
+ <fo:declarations>
3639
+ <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
3640
+ <pdf:dictionary type="normal" key="ViewerPreferences">
3641
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
3642
+ </pdf:dictionary>
3643
+ </pdf:catalog>
3644
+ <x:xmpmeta xmlns:x="adobe:ns:meta/">
3645
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
3646
+ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
3647
+ <!-- Dublin Core properties go here -->
3648
+ <dc:title>
3649
+ <xsl:variable name="title">
3650
+
3651
+
3652
+ <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en']"/>
3653
+
3654
+
3655
+
3656
+ </xsl:variable>
3657
+ <xsl:choose>
3658
+ <xsl:when test="normalize-space($title) != ''">
3659
+ <xsl:value-of select="$title"/>
3660
+ </xsl:when>
3661
+ <xsl:otherwise>
3662
+ <xsl:text> </xsl:text>
3663
+ </xsl:otherwise>
3664
+ </xsl:choose>
3665
+ </dc:title>
3666
+ <dc:creator>
3667
+
3668
+
3669
+ </dc:creator>
3670
+ <dc:description>
3671
+ <xsl:variable name="abstract">
3672
+
3673
+
3674
+
3675
+
3676
+ <xsl:copy-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'abstract']//text()"/>
3677
+
3678
+ </xsl:variable>
3679
+ <xsl:value-of select="normalize-space($abstract)"/>
3680
+ </dc:description>
3681
+ <pdf:Keywords>
3682
+ <xsl:call-template name="insertKeywords"/>
3683
+ </pdf:Keywords>
3684
+ </rdf:Description>
3685
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
3686
+ <!-- XMP properties go here -->
3687
+ <xmp:CreatorTool/>
3688
+ </rdf:Description>
3689
+ </rdf:RDF>
3690
+ </x:xmpmeta>
3691
+ </fo:declarations>
3692
+ </xsl:template><xsl:template name="getId">
3693
+ <xsl:choose>
3694
+ <xsl:when test="../@id">
3695
+ <xsl:value-of select="../@id"/>
3696
+ </xsl:when>
3697
+ <xsl:otherwise>
3698
+ <!-- <xsl:value-of select="concat(local-name(..), '_', text())"/> -->
3699
+ <xsl:value-of select="concat(generate-id(..), '_', text())"/>
3700
+ </xsl:otherwise>
3701
+ </xsl:choose>
3702
+ </xsl:template><xsl:template name="getLevel">
3703
+ <xsl:param name="depth"/>
3704
+ <xsl:choose>
3705
+ <xsl:when test="normalize-space(@depth) != ''">
3706
+ <xsl:value-of select="@depth"/>
3707
+ </xsl:when>
3708
+ <xsl:when test="normalize-space($depth) != ''">
3709
+ <xsl:value-of select="$depth"/>
3710
+ </xsl:when>
3711
+ <xsl:otherwise>
3712
+ <xsl:variable name="level_total" select="count(ancestor::*)"/>
3713
+ <xsl:variable name="level">
3714
+ <xsl:choose>
3715
+ <xsl:when test="parent::*[local-name() = 'preface']">
3716
+ <xsl:value-of select="$level_total - 1"/>
3717
+ </xsl:when>
3718
+ <xsl:when test="ancestor::*[local-name() = 'preface']">
3719
+ <xsl:value-of select="$level_total - 2"/>
3720
+ </xsl:when>
3721
+ <!-- <xsl:when test="parent::*[local-name() = 'sections']">
3722
+ <xsl:value-of select="$level_total - 1"/>
3723
+ </xsl:when> -->
3724
+ <xsl:when test="ancestor::*[local-name() = 'sections']">
3725
+ <xsl:value-of select="$level_total - 1"/>
3726
+ </xsl:when>
3727
+ <xsl:when test="ancestor::*[local-name() = 'bibliography']">
3728
+ <xsl:value-of select="$level_total - 1"/>
3729
+ </xsl:when>
3730
+ <xsl:when test="parent::*[local-name() = 'annex']">
3731
+ <xsl:value-of select="$level_total - 1"/>
3732
+ </xsl:when>
3733
+ <xsl:when test="ancestor::*[local-name() = 'annex']">
3734
+ <xsl:value-of select="$level_total"/>
3735
+ </xsl:when>
3736
+ <xsl:when test="local-name() = 'annex'">1</xsl:when>
3737
+ <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
3738
+ <xsl:otherwise>
3739
+ <xsl:value-of select="$level_total - 1"/>
3740
+ </xsl:otherwise>
3741
+ </xsl:choose>
3742
+ </xsl:variable>
3743
+ <xsl:value-of select="$level"/>
3744
+ </xsl:otherwise>
3745
+ </xsl:choose>
3746
+ </xsl:template><xsl:template name="split">
3747
+ <xsl:param name="pText" select="."/>
3748
+ <xsl:param name="sep" select="','"/>
3749
+ <xsl:if test="string-length($pText) &gt;0">
3750
+ <item>
3751
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
3752
+ </item>
3753
+ <xsl:call-template name="split">
3754
+ <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
3755
+ <xsl:with-param name="sep" select="$sep"/>
3756
+ </xsl:call-template>
3757
+ </xsl:if>
3758
+ </xsl:template><xsl:template name="getDocumentId">
3759
+ <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
3760
+ </xsl:template><xsl:template name="namespaceCheck">
3761
+ <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
3762
+ <xsl:variable name="XSLNS">
3763
+
3764
+
3765
+
3766
+
3767
+
3768
+
3769
+ <xsl:value-of select="document('')//*/namespace::ogc"/>
3770
+
3771
+
3772
+
3773
+
3774
+
3775
+
3776
+
3777
+ </xsl:variable>
3778
+ <xsl:if test="$documentNS != $XSLNS">
3779
+ <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
3780
+ </xsl:if>
3781
+ </xsl:template><xsl:template name="getLanguage">
3782
+ <xsl:param name="lang"/>
3783
+ <xsl:variable name="language" select="java:toLowerCase(java:java.lang.String.new($lang))"/>
3784
+ <xsl:choose>
3785
+ <xsl:when test="$language = 'en'">English</xsl:when>
3786
+ <xsl:when test="$language = 'fr'">French</xsl:when>
3787
+ <xsl:when test="$language = 'de'">Deutsch</xsl:when>
3788
+ <xsl:when test="$language = 'cn'">Chinese</xsl:when>
3789
+ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
3790
+ </xsl:choose>
3791
+ </xsl:template><xsl:template name="setId">
3792
+ <xsl:attribute name="id">
3793
+ <xsl:choose>
3794
+ <xsl:when test="@id">
3795
+ <xsl:value-of select="@id"/>
3796
+ </xsl:when>
3797
+ <xsl:otherwise>
3798
+ <xsl:value-of select="generate-id()"/>
3799
+ </xsl:otherwise>
3800
+ </xsl:choose>
3801
+ </xsl:attribute>
3387
3802
  </xsl:template></xsl:stylesheet>