metanorma-ogc 1.1.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +2 -0
  3. data/lib/asciidoctor/ogc/boilerplate.xml +3 -3
  4. data/lib/asciidoctor/ogc/converter.rb +12 -8
  5. data/lib/asciidoctor/ogc/front.rb +8 -20
  6. data/lib/asciidoctor/ogc/isodoc.rng +16 -7
  7. data/lib/asciidoctor/ogc/validate.rb +13 -25
  8. data/lib/isodoc/ogc/base_convert.rb +33 -48
  9. data/lib/isodoc/ogc/biblio.rb +33 -4
  10. data/lib/isodoc/ogc/html/_coverpage.css +195 -0
  11. data/lib/isodoc/ogc/html/header_wp.html +210 -0
  12. data/lib/isodoc/ogc/html/htmlstyle.css +1084 -0
  13. data/lib/isodoc/ogc/html/logo.png +0 -0
  14. data/lib/isodoc/ogc/html/ogc.css +838 -0
  15. data/lib/isodoc/ogc/html/ogc.scss +4 -2
  16. data/lib/isodoc/ogc/html/ogc_wp.css +758 -0
  17. data/lib/isodoc/ogc/html/ogc_wp.scss +724 -0
  18. data/lib/isodoc/ogc/html/word_ogc_intro_wp.html +14 -0
  19. data/lib/isodoc/ogc/html/word_ogc_titlepage_wp.html +175 -0
  20. data/lib/isodoc/ogc/html/wordstyle.css +1253 -0
  21. data/lib/isodoc/ogc/html/wordstyle.scss +8 -9
  22. data/lib/isodoc/ogc/html/wordstyle_wp.css +1181 -0
  23. data/lib/isodoc/ogc/html/wordstyle_wp.scss +1093 -0
  24. data/lib/isodoc/ogc/html_convert.rb +3 -0
  25. data/lib/isodoc/ogc/i18n-en.yaml +1 -0
  26. data/lib/isodoc/ogc/i18n.rb +10 -0
  27. data/lib/isodoc/ogc/init.rb +41 -0
  28. data/lib/isodoc/ogc/metadata.rb +31 -28
  29. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +1899 -1618
  30. data/lib/isodoc/ogc/ogc.best-practice.xsl +1899 -1618
  31. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +1899 -1618
  32. data/lib/isodoc/ogc/ogc.community-practice.xsl +1899 -1618
  33. data/lib/isodoc/ogc/ogc.community-standard.xsl +1899 -1618
  34. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +1899 -1618
  35. data/lib/isodoc/ogc/ogc.engineering-report.xsl +1899 -1618
  36. data/lib/isodoc/ogc/ogc.other.xsl +1899 -1618
  37. data/lib/isodoc/ogc/ogc.policy.xsl +1899 -1618
  38. data/lib/isodoc/ogc/ogc.reference-model.xsl +1899 -1618
  39. data/lib/isodoc/ogc/ogc.release-notes.xsl +1899 -1618
  40. data/lib/isodoc/ogc/ogc.standard.xsl +1899 -1618
  41. data/lib/isodoc/ogc/ogc.test-suite.xsl +1899 -1618
  42. data/lib/isodoc/ogc/ogc.user-guide.xsl +1899 -1618
  43. data/lib/isodoc/ogc/ogc.white-paper.xsl +2264 -2218
  44. data/lib/isodoc/ogc/presentation_xml_convert.rb +134 -1
  45. data/lib/isodoc/ogc/reqt.rb +91 -124
  46. data/lib/isodoc/ogc/sections.rb +18 -64
  47. data/lib/isodoc/ogc/word_convert.rb +23 -3
  48. data/lib/isodoc/ogc/xref.rb +28 -23
  49. data/lib/metanorma/ogc/version.rb +1 -1
  50. data/metanorma-ogc.gemspec +3 -4
  51. metadata +34 -34
@@ -1,7 +1,10 @@
1
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,38 @@
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
- <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters -->
47
+ <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters -->
48
+ <!-- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/*" mode="contents"/> -->
44
49
  <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>
50
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'keyword']" mode="contents"/>
51
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:foreword" mode="contents"/>
51
52
  <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>
53
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'submitting_orgs']" mode="contents"/>
54
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:submitters" mode="contents"/>
55
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[not(@type = 'submitting_orgs') and not(@type = 'keyword')]" mode="contents"/>
56
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:acknowledgements" mode="contents"/>
62
57
 
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
58
 
59
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@type='scope']" mode="contents"/>
60
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@type='conformance']" mode="contents"/>
67
61
  <!-- 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>
71
-
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>
75
-
62
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@normative='true']" mode="contents"/>
63
+ <!-- Terms and definitions -->
64
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:terms" mode="contents"/>
65
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:definitions" mode="contents"/>
76
66
 
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
-
67
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[not(@type='scope') and not(@type='conformance')]" mode="contents"/>
68
+
82
69
  <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] -->
70
+
71
+ <!-- Bibliography -->
72
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[not(@normative='true')]" mode="contents"/>
84
73
 
85
74
 
86
75
  </contents>
@@ -91,7 +80,7 @@
91
80
  </xsl:variable>
92
81
 
93
82
  <xsl:template match="/">
94
- <xsl:message>INFO: Document namespace: '<xsl:value-of select="namespace-uri(/*)"/>'</xsl:message>
83
+ <xsl:call-template name="namespaceCheck"/>
95
84
  <fo:root font-family="Times New Roman, STIX2Math, HanSans" font-size="10.5pt" xml:lang="{$lang}">
96
85
  <fo:layout-master-set>
97
86
  <!-- Cover page -->
@@ -237,7 +226,7 @@
237
226
  </fo:block>
238
227
  </fo:block>
239
228
  <fo:block font-size="24pt" font-weight="bold" text-align="center" margin-top="15pt" line-height="115%">
240
- <xsl:text>OGC </xsl:text><xsl:value-of select="$doctitle"/>
229
+ <xsl:value-of select="$doctitle"/>
241
230
  </fo:block>
242
231
  <fo:block margin-bottom="12pt"> </fo:block>
243
232
  <!-- Copyright notice -->
@@ -250,6 +239,16 @@
250
239
  <fo:table-column column-width="35mm"/>
251
240
  <fo:table-column column-width="70mm"/>
252
241
  <fo:table-body>
242
+ <fo:table-row height="9mm">
243
+ <fo:table-cell>
244
+ <fo:block>Document number: </fo:block>
245
+ </fo:table-cell>
246
+ <fo:table-cell>
247
+ <fo:block>
248
+ <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:docnumber"/>
249
+ </fo:block>
250
+ </fo:table-cell>
251
+ </fo:table-row>
253
252
  <fo:table-row height="9mm">
254
253
  <fo:table-cell>
255
254
  <fo:block>Document type: </fo:block>
@@ -258,6 +257,18 @@
258
257
  <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>
259
258
  </fo:table-cell>
260
259
  </fo:table-row>
260
+ <fo:table-row height="9mm">
261
+ <fo:table-cell>
262
+ <fo:block>Document subtype: </fo:block>
263
+ </fo:table-cell>
264
+ <fo:table-cell>
265
+ <fo:block>
266
+ <xsl:call-template name="capitalizeWords">
267
+ <xsl:with-param name="str" select="/ogc:ogc-standard/ogc:bibdata/ogc:ext/ogc:docsubtype"/>
268
+ </xsl:call-template>
269
+ </fo:block>
270
+ </fo:table-cell>
271
+ </fo:table-row>
261
272
  <fo:table-row height="9mm">
262
273
  <fo:table-cell>
263
274
  <fo:block>Document stage: </fo:block>
@@ -276,7 +287,11 @@
276
287
  <fo:block>Document language: </fo:block>
277
288
  </fo:table-cell>
278
289
  <fo:table-cell>
279
- <fo:block><xsl:value-of select="$lang"/></fo:block>
290
+ <fo:block>
291
+ <xsl:call-template name="getLanguage">
292
+ <xsl:with-param name="lang" select="$lang"/>
293
+ </xsl:call-template>
294
+ </fo:block>
280
295
  </fo:table-cell>
281
296
  </fo:table-row>
282
297
  </fo:table-body>
@@ -312,7 +327,7 @@
312
327
  <fo:block> </fo:block>
313
328
  <fo:block break-after="page"/>
314
329
 
315
- <fo:block-container font-weight="bold" line-height="115%">
330
+ <fo:block-container font-weight="bold" line-height="115%" margin-bottom="36pt">
316
331
  <xsl:variable name="title-toc">
317
332
  <xsl:call-template name="getTitle">
318
333
  <xsl:with-param name="name" select="'title-toc'"/>
@@ -320,7 +335,7 @@
320
335
  </xsl:variable>
321
336
  <fo:block font-size="14pt" margin-top="2pt" margin-bottom="15.5pt"><xsl:value-of select="$title-toc"/></fo:block>
322
337
 
323
- <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'))] -->
338
+ <xsl:for-each select="xalan:nodeset($contents)//item">
324
339
 
325
340
  <fo:block>
326
341
  <xsl:if test="@level = 1">
@@ -328,30 +343,23 @@
328
343
  </xsl:if>
329
344
  <fo:list-block>
330
345
  <xsl:attribute name="provisional-distance-between-starts">
331
- <xsl:choose>
332
- <!-- skip 0 section without subsections -->
333
- <xsl:when test="@section != '' and not(@display-section = 'false')">8mm</xsl:when>
346
+ <xsl:choose>
347
+ <xsl:when test="@section != ''">8mm</xsl:when>
334
348
  <xsl:otherwise>0mm</xsl:otherwise>
335
349
  </xsl:choose>
336
350
  </xsl:attribute>
337
351
  <fo:list-item>
338
352
  <fo:list-item-label end-indent="label-end()">
339
353
  <fo:block>
340
- <xsl:if test="@section and not(@display-section = 'false')"> <!-- output below -->
341
- <xsl:value-of select="@section"/><xsl:text>.</xsl:text>
342
- </xsl:if>
354
+ <xsl:value-of select="@section"/>
343
355
  </fo:block>
344
356
  </fo:list-item-label>
345
357
  <fo:list-item-body start-indent="body-start()">
346
358
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
347
359
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
348
- <xsl:if test="@section and @display-section = 'false' and not(@section = '0')">
349
- <xsl:value-of select="@section"/><xsl:text> </xsl:text>
350
- </xsl:if>
351
- <xsl:if test="@addon != ''">
352
- <xsl:text>(</xsl:text><xsl:value-of select="@addon"/><xsl:text>)</xsl:text>
353
- </xsl:if>
354
- <xsl:text> </xsl:text><xsl:value-of select="text()"/>
360
+
361
+ <xsl:apply-templates/>
362
+
355
363
  <fo:inline keep-together.within-line="always">
356
364
  <fo:leader leader-pattern="dots"/>
357
365
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
@@ -364,7 +372,7 @@
364
372
  </fo:block>
365
373
  </xsl:for-each>
366
374
 
367
- <xsl:if test="xalan:nodeset($contents)//item[@type = 'table']">
375
+ <xsl:if test="//ogc:table[@id and ogc:name]">
368
376
  <fo:block font-size="12pt"> </fo:block>
369
377
  <fo:block font-size="12pt"> </fo:block>
370
378
  <xsl:variable name="title-list-tables">
@@ -373,15 +381,10 @@
373
381
  </xsl:call-template>
374
382
  </xsl:variable>
375
383
  <fo:block font-size="14pt" font-weight="bold" space-before="48pt" margin-bottom="15.5pt"><xsl:value-of select="$title-list-tables"/></fo:block>
376
- <xsl:for-each select="xalan:nodeset($contents)//item[@type = 'table']">
384
+ <xsl:for-each select="//ogc:table[@id and ogc:name]">
377
385
  <fo:block text-align-last="justify" margin-top="6pt">
378
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{@section}">
379
- <xsl:value-of select="@section"/>
380
- <xsl:if test="text() != ''">
381
- <xsl:text> — </xsl:text>
382
- <xsl:value-of select="text()"/>
383
- </xsl:if>
384
- <xsl:text> </xsl:text>
386
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}">
387
+ <xsl:apply-templates select="ogc:name" mode="contents"/>
385
388
  <fo:inline keep-together.within-line="always">
386
389
  <fo:leader leader-pattern="dots"/>
387
390
  <fo:page-number-citation ref-id="{@id}"/>
@@ -391,7 +394,7 @@
391
394
  </xsl:for-each>
392
395
  </xsl:if>
393
396
 
394
- <xsl:if test="xalan:nodeset($contents)//item[@type = 'figure']">
397
+ <xsl:if test="//ogc:figure[@id and ogc:name]">
395
398
  <fo:block font-size="12pt"> </fo:block>
396
399
  <fo:block font-size="12pt"> </fo:block>
397
400
  <xsl:variable name="title-list-figures">
@@ -400,15 +403,10 @@
400
403
  </xsl:call-template>
401
404
  </xsl:variable>
402
405
  <fo:block font-size="14pt" font-weight="bold" space-before="48pt" margin-bottom="15.5pt"><xsl:value-of select="$title-list-figures"/></fo:block>
403
- <xsl:for-each select="xalan:nodeset($contents)//item[@type = 'figure']">
406
+ <xsl:for-each select="//ogc:figure[@id and ogc:name]">
404
407
  <fo:block text-align-last="justify" margin-top="6pt">
405
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{@section}">
406
- <xsl:value-of select="@section"/>
407
- <xsl:if test="text() != ''">
408
- <xsl:text> — </xsl:text>
409
- <xsl:value-of select="text()"/>
410
- </xsl:if>
411
- <xsl:text> </xsl:text>
408
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}">
409
+ <xsl:apply-templates select="ogc:name" mode="contents"/>
412
410
  <fo:inline keep-together.within-line="always">
413
411
  <fo:leader leader-pattern="dots"/>
414
412
  <fo:page-number-citation ref-id="{@id}"/>
@@ -418,25 +416,54 @@
418
416
  </xsl:for-each>
419
417
  </xsl:if>
420
418
 
419
+ <!-- <xsl:if test="//ogc:permission[@id and ogc:name] or //ogc:recommendation[@id and ogc:name] or //ogc:requirement[@id and ogc:name]"> -->
420
+ <xsl:if test="//ogc:table[.//ogc:p[@class = 'RecommendationTitle']]">
421
+ <fo:block font-size="12pt"> </fo:block>
422
+ <fo:block font-size="12pt"> </fo:block>
423
+ <xsl:variable name="title-list-recommendations">
424
+ <xsl:call-template name="getTitle">
425
+ <xsl:with-param name="name" select="'title-list-recommendations'"/>
426
+ </xsl:call-template>
427
+ </xsl:variable>
428
+ <fo:block font-size="14pt" font-weight="bold" space-before="48pt" margin-bottom="15.5pt"><xsl:value-of select="$title-list-recommendations"/></fo:block>
429
+ <!-- <xsl:for-each select="//ogc:permission[@id and ogc:name] | //ogc:recommendation[@id and ogc:name] | //ogc:requirement[@id and ogc:name]"> -->
430
+ <xsl:for-each select="//ogc:table[.//ogc:p[@class = 'RecommendationTitle']]">
431
+ <xsl:variable name="table_id" select="@id"/>
432
+ <fo:block text-align-last="justify" margin-top="6pt">
433
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{.//ogc:p[@class = 'RecommendationTitle'][1]/text()}">
434
+ <xsl:apply-templates select=".//ogc:p[@class = 'RecommendationTitle'][ancestor::ogc:table[1][@id= $table_id]]/node()"/>
435
+ <fo:inline keep-together.within-line="always">
436
+ <fo:leader leader-pattern="dots"/>
437
+ <fo:page-number-citation ref-id="{@id}"/>
438
+ </fo:inline>
439
+ </fo:basic-link>
440
+ </fo:block>
441
+ </xsl:for-each>
442
+ </xsl:if>
443
+
444
+
421
445
  </fo:block-container>
422
446
 
423
-
424
447
  <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters -->
425
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:abstract" mode="abstract"/>
426
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1]">
427
- <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + 1"/>
428
- </xsl:apply-templates>
429
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:foreword" mode="preface">
430
- <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ 1"/>
431
- </xsl:apply-templates>
432
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:introduction" mode="introduction"/>
433
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name">
434
- <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"/>
435
- </xsl:apply-templates>
436
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:submitters">
437
- <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"/>
438
- </xsl:apply-templates>
448
+ <!-- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/*" mode="preface"/> -->
449
+ <xsl:if test="/ogc:ogc-standard/ogc:preface/ogc:abstract">
450
+ <fo:block break-after="page"/>
451
+ </xsl:if>
452
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:abstract"/>
453
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'keyword']"/>
454
+ <xsl:if test="/ogc:ogc-standard/ogc:preface/ogc:foreword">
455
+ <fo:block break-after="page"/>
456
+ </xsl:if>
457
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:foreword"/>
458
+ <xsl:if test="/ogc:ogc-standard/ogc:preface/ogc:introduction">
459
+ <fo:block break-after="page"/>
460
+ </xsl:if>
461
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:introduction"/>
439
462
 
463
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'submitting_orgs']"/>
464
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:submitters"/>
465
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[not(@type = 'submitting_orgs') and not(@type = 'keyword')]"/>
466
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:acknowledgements"/>
440
467
 
441
468
  </fo:flow>
442
469
  </fo:page-sequence>
@@ -459,31 +486,23 @@
459
486
 
460
487
  <fo:block line-height="125%">
461
488
 
462
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']">
463
- <xsl:with-param name="sectionNum" select="'1'"/>
464
- </xsl:apply-templates>
489
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@type='scope']"/>
465
490
 
466
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']">
467
- <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + 1"/>
468
- </xsl:apply-templates>
491
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@type='conformance']"/>
469
492
 
470
493
  <!-- Normative references -->
471
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references']">
472
- <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"/>
473
- </xsl:apply-templates>
474
-
475
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:terms"> <!-- Terms and definitions -->
476
- <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"/>
477
- </xsl:apply-templates>
478
-
479
-
480
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/*[local-name() != 'terms' and not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]">
481
- <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)"/>
482
- </xsl:apply-templates>
494
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@normative='true']"/>
495
+
496
+ <!-- Terms and definitions -->
497
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:terms"/>
498
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:definitions"/>
483
499
 
500
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[not(@type='scope') and not(@type='conformance')]"/>
484
501
 
485
502
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:annex"/>
486
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id != '_normative_references' and @id != '_references']"/> <!-- [position() &gt; 1] -->
503
+
504
+ <!-- Bibliography -->
505
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[not(@normative='true')]"/>
487
506
 
488
507
  </fo:block>
489
508
  </fo:flow>
@@ -494,284 +513,57 @@
494
513
  </fo:root>
495
514
  </xsl:template>
496
515
 
497
- <!-- for pass the paremeter 'sectionNum' over templates, like 'tunnel' parameter in XSLT 2.0 -->
498
- <xsl:template match="node()">
499
- <xsl:param name="sectionNum"/>
500
- <xsl:param name="sectionNumSkew"/>
501
- <xsl:apply-templates>
502
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
503
- <xsl:with-param name="sectionNumSkew" select="$sectionNumSkew"/>
504
- </xsl:apply-templates>
516
+ <xsl:template match="node()">
517
+ <xsl:apply-templates/>
505
518
  </xsl:template>
506
519
 
507
520
  <!-- ============================= -->
508
521
  <!-- CONTENTS -->
509
522
  <!-- ============================= -->
510
- <xsl:template match="node()" mode="contents">
511
- <xsl:param name="sectionNum"/>
512
- <xsl:param name="sectionNumSkew"/>
513
- <xsl:apply-templates mode="contents">
514
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
515
- <xsl:with-param name="sectionNumSkew" select="$sectionNumSkew"/>
516
- </xsl:apply-templates>
523
+ <xsl:template match="node()" mode="contents">
524
+ <xsl:apply-templates mode="contents"/>
517
525
  </xsl:template>
518
526
 
519
-
520
- <!-- calculate main section number (1,2,3) and pass it deep into templates -->
521
- <!-- it's necessary, because there is itu:bibliography/itu:references from other section, but numbering should be sequental -->
522
- <xsl:template match="ogc:ogc-standard/ogc:sections/*" mode="contents">
523
- <xsl:param name="sectionNum"/>
524
- <xsl:param name="sectionNumSkew" select="0"/>
525
- <xsl:variable name="sectionNum_">
526
- <xsl:choose>
527
- <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
528
- <xsl:when test="$sectionNumSkew != 0">
529
- <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 -->
530
- <xsl:value-of select="$number + $sectionNumSkew"/>
531
- </xsl:when>
532
- <xsl:otherwise>
533
- <xsl:number count="*"/>
534
- </xsl:otherwise>
535
- </xsl:choose>
536
- </xsl:variable>
537
- <xsl:apply-templates mode="contents">
538
- <xsl:with-param name="sectionNum" select="$sectionNum_"/>
539
- </xsl:apply-templates>
540
- </xsl:template>
541
- <xsl:template match="ogc:ogc-standard/ogc:sections/ogc:terms" mode="contents">
542
- <xsl:param name="sectionNum"/>
543
- <xsl:param name="sectionNumSkew" select="0"/>
544
- <xsl:variable name="sectionNum_">
545
- <xsl:choose>
546
- <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
547
- <xsl:when test="$sectionNumSkew != 0">
548
- <xsl:variable name="number"><xsl:number count="*"/></xsl:variable> <!-- ogc:sections/ogc:clause | ogc:sections/ogc:terms -->
549
- <xsl:value-of select="$number + $sectionNumSkew"/>
550
- </xsl:when>
551
- <xsl:otherwise>
552
- <xsl:number count="*"/>
553
- </xsl:otherwise>
554
- </xsl:choose>
555
- </xsl:variable>
556
- <xsl:apply-templates mode="contents">
557
- <xsl:with-param name="sectionNum" select="$sectionNum_"/>
558
- </xsl:apply-templates>
559
- </xsl:template>
560
-
561
-
562
- <!-- Any node with title element - clause, definition, annex,... -->
563
- <xsl:template match="ogc:title | ogc:preferred" mode="contents">
564
- <xsl:param name="sectionNum"/>
565
- <xsl:variable name="id">
566
- <xsl:call-template name="getId"/>
567
- </xsl:variable>
568
-
527
+ <!-- element with title -->
528
+ <xsl:template match="*[ogc:title]" mode="contents">
569
529
  <xsl:variable name="level">
570
- <xsl:call-template name="getLevel"/>
571
- </xsl:variable>
572
-
573
- <xsl:variable name="section">
574
- <xsl:call-template name="getSection">
575
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
530
+ <xsl:call-template name="getLevel">
531
+ <xsl:with-param name="depth" select="ogc:title/@depth"/>
576
532
  </xsl:call-template>
577
533
  </xsl:variable>
578
534
 
579
535
  <xsl:variable name="display">
580
536
  <xsl:choose>
581
- <xsl:when test="ancestor::ogc:bibitem">false</xsl:when>
582
- <xsl:when test="ancestor::ogc:term">false</xsl:when>
583
- <xsl:when test="ancestor::ogc:annex and $level &gt;= 3">false</xsl:when>
584
- <xsl:when test="$level &lt;= 3">true</xsl:when>
585
- <xsl:otherwise>false</xsl:otherwise>
586
- </xsl:choose>
587
- </xsl:variable>
588
-
589
- <xsl:variable name="display-section">
590
- <xsl:choose>
591
- <xsl:when test="ancestor::ogc:annex and $level &gt;= 2">true</xsl:when>
592
- <xsl:when test="ancestor::ogc:annex">false</xsl:when>
593
- <xsl:when test="$section = '0'">false</xsl:when>
537
+ <xsl:when test="ancestor-or-self::ogc:bibitem">false</xsl:when>
538
+ <xsl:when test="ancestor-or-self::ogc:term">false</xsl:when>
539
+ <xsl:when test="$level &gt;= 3">false</xsl:when>
594
540
  <xsl:otherwise>true</xsl:otherwise>
595
541
  </xsl:choose>
596
542
  </xsl:variable>
597
543
 
598
- <xsl:variable name="type">
599
- <xsl:value-of select="local-name(..)"/>
600
- </xsl:variable>
601
-
602
- <xsl:variable name="root">
603
- <xsl:choose>
604
- <xsl:when test="ancestor::ogc:annex">annex</xsl:when>
605
- <xsl:when test="ancestor::ogc:clause">clause</xsl:when>
606
- <xsl:when test="ancestor::ogc:terms">terms</xsl:when>
607
- </xsl:choose>
608
- </xsl:variable>
609
-
610
- <item id="{$id}" level="{$level}" section="{$section}" display-section="{$display-section}" display="{$display}" type="{$type}" root="{$root}">
611
- <xsl:attribute name="addon">
612
- <xsl:if test="local-name(..) = 'annex'"><xsl:value-of select="../@obligation"/></xsl:if>
613
- </xsl:attribute>
614
- <xsl:apply-templates/>
615
- </item>
616
544
 
617
- <xsl:apply-templates mode="contents">
618
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
619
- </xsl:apply-templates>
545
+ <xsl:if test="$display = 'true'">
620
546
 
621
- </xsl:template>
622
-
623
- <xsl:template match="ogc:ogc-standard/ogc:preface/*" mode="contents">
624
- <xsl:param name="sectionNum" select="'1'"/>
625
- <xsl:variable name="section">
626
- <xsl:number format="i" value="$sectionNum"/>
627
- </xsl:variable>
628
- <xsl:variable name="id">
629
- <xsl:choose>
630
- <xsl:when test="@id">
631
- <xsl:value-of select="@id"/>
632
- </xsl:when>
633
- <xsl:otherwise>
634
- <xsl:value-of select="local-name()"/>
635
- </xsl:otherwise>
636
- </xsl:choose>
637
- </xsl:variable>
638
- <xsl:if test="not(ogc:title)">
639
- <item id="{$id}" level="1" section="{$section}" display-section="true" display="true" type="abstract" root="preface">
640
- <xsl:if test="local-name() = 'foreword'">
641
- <xsl:attribute name="display">false</xsl:attribute>
642
- </xsl:if>
643
- <xsl:choose>
644
- <xsl:when test="not(ogc:title)">
645
- <xsl:variable name="name" select="local-name()"/>
646
- <xsl:call-template name="capitalize">
647
- <xsl:with-param name="str" select="$name"/>
648
- </xsl:call-template>
649
- </xsl:when>
650
- <xsl:otherwise>
651
- <xsl:value-of select="ogc:title"/>
652
- </xsl:otherwise>
653
- </xsl:choose>
654
- </item>
655
- </xsl:if>
656
- <xsl:apply-templates mode="contents">
657
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
658
- </xsl:apply-templates>
659
- </xsl:template>
660
-
661
- <!-- Keywords -->
662
- <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:keyword" mode="contents">
663
- <xsl:param name="sectionNum" select="'1'"/>
664
- <xsl:variable name="section">
665
- <xsl:number format="i" value="$sectionNum"/>
666
- </xsl:variable>
667
- <item id="keywords" level="1" section="{$section}" display-section="true" display="true" type="abstract" root="preface">
668
- <xsl:variable name="title-keywords">
669
- <xsl:call-template name="getTitle">
670
- <xsl:with-param name="name" select="'title-keywords'"/>
671
- </xsl:call-template>
547
+ <xsl:variable name="section">
548
+ <xsl:call-template name="getSection"/>
672
549
  </xsl:variable>
673
- <xsl:value-of select="$title-keywords"/>
674
- </item>
675
- </xsl:template>
676
- <!-- Submitting Organizations -->
677
- <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author']/ogc:organization/ogc:name" mode="contents">
678
- <xsl:param name="sectionNum" select="'1'"/>
679
- <xsl:variable name="section">
680
- <xsl:number format="i" value="$sectionNum"/>
681
- </xsl:variable>
682
- <item id="submitting_orgs" level="1" section="{$section}" display-section="true" display="true" type="abstract" root="preface">
683
- <xsl:variable name="title-submitting-organizations">
684
- <xsl:call-template name="getTitle">
685
- <xsl:with-param name="name" select="'title-submitting-organizations'"/>
686
- </xsl:call-template>
550
+
551
+ <xsl:variable name="title">
552
+ <xsl:call-template name="getName"/>
687
553
  </xsl:variable>
688
- <xsl:value-of select="$title-submitting-organizations"/>
689
- </item>
690
- </xsl:template>
691
-
692
- <xsl:template match="ogc:figure" mode="contents">
693
- <xsl:param name="sectionNum"/>
694
- <item level="" id="{@id}" type="figure">
695
- <xsl:attribute name="section">
696
- <xsl:variable name="title-figure">
697
- <xsl:call-template name="getTitle">
698
- <xsl:with-param name="name" select="'title-figure'"/>
699
- </xsl:call-template>
700
- </xsl:variable>
701
- <xsl:value-of select="$title-figure"/>
702
- <xsl:choose>
703
- <xsl:when test="ancestor::ogc:annex">
704
- <xsl:choose>
705
- <xsl:when test="count(//ogc:annex) = 1">
706
- <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"/>
707
- </xsl:when>
708
- <xsl:otherwise>
709
- <xsl:number format="A.1-1" level="multiple" count="ogc:annex | ogc:figure"/>
710
- </xsl:otherwise>
711
- </xsl:choose>
712
- </xsl:when>
713
- <xsl:when test="ancestor::ogc:figure">
714
- <xsl:for-each select="parent::*[1]">
715
- <xsl:number format="1" level="any" count="ogc:figure[not(parent::ogc:figure)]"/>
716
- </xsl:for-each>
717
- <xsl:number format="-a" count="ogc:figure"/>
718
- </xsl:when>
719
- <xsl:otherwise>
720
- <xsl:number format="1" level="any" count="ogc:figure[not(parent::ogc:figure)] | ogc:sourcecode[not(@unnumbered = 'true') and not(ancestor::ogc:example)]"/>
721
- <!-- <xsl:number format="1.1-1" level="multiple" count="ogc:annex | ogc:figure"/> -->
722
- </xsl:otherwise>
723
- </xsl:choose>
724
- </xsl:attribute>
725
- <xsl:value-of select="ogc:name"/>
726
- </item>
727
- </xsl:template>
728
-
729
-
730
-
731
- <xsl:template match="ogc:table[not(@unnumbered='true')]" mode="contents">
732
- <xsl:param name="sectionNum"/>
733
- <xsl:variable name="annex-id" select="ancestor::ogc:annex/@id"/>
734
- <item level="" id="{@id}" display="false" type="table">
735
- <xsl:attribute name="section">
736
- <xsl:variable name="title-table">
737
- <xsl:call-template name="getTitle">
738
- <xsl:with-param name="name" select="'title-table'"/>
739
- </xsl:call-template>
740
- </xsl:variable>
741
- <xsl:value-of select="$title-table"/>
742
- <xsl:choose>
743
- <xsl:when test="ancestor::*[local-name()='executivesummary']">
744
- <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered='true')]"/>
745
- </xsl:when>
746
- <xsl:when test="ancestor::*[local-name()='annex']">
747
- <xsl:number format="A-" count="ogc:annex"/>
748
- <xsl:number format="1" level="any" count="ogc:table[ancestor::ogc:annex[@id = $annex-id]][not(@unnumbered='true')]"/>
749
- </xsl:when>
750
- <xsl:otherwise>
751
- <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')]"/>
752
- </xsl:otherwise>
753
- </xsl:choose>
754
- </xsl:attribute>
755
- <xsl:value-of select="ogc:name/text()"/>
756
- </item>
757
- </xsl:template>
758
-
759
-
760
-
761
- <xsl:template match="ogc:formula" mode="contents">
762
- <item level="" id="{@id}" display="false">
763
- <xsl:attribute name="section">
764
- <xsl:variable name="title-formula">
765
- <xsl:call-template name="getTitle">
766
- <xsl:with-param name="name" select="'title-formula'"/>
767
- </xsl:call-template>
768
- </xsl:variable>
769
- <xsl:value-of select="$title-formula"/><xsl:number format="(A.1)" level="multiple" count="ogc:annex | ogc:formula"/>
770
- </xsl:attribute>
771
- </item>
554
+
555
+ <xsl:variable name="type">
556
+ <xsl:value-of select="local-name()"/>
557
+ </xsl:variable>
558
+
559
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}">
560
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
561
+ </item>
562
+ <xsl:apply-templates mode="contents"/>
563
+ </xsl:if>
564
+
772
565
  </xsl:template>
773
566
 
774
- <xsl:template match="ogc:fn" mode="contents"/>
775
567
  <!-- ============================= -->
776
568
  <!-- ============================= -->
777
569
 
@@ -828,7 +620,7 @@
828
620
  <xsl:attribute name="text-align">
829
621
  <xsl:choose>
830
622
  <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
831
- <xsl:otherwise>left</xsl:otherwise>
623
+ <xsl:otherwise>center</xsl:otherwise>
832
624
  </xsl:choose>
833
625
  </xsl:attribute>
834
626
  <xsl:apply-templates/>
@@ -867,179 +659,30 @@
867
659
  </fo:block>
868
660
  </xsl:template>
869
661
 
870
-
871
- <!-- Introduction -->
872
- <xsl:template match="ogc:ogc-standard/ogc:preface/ogc:introduction" mode="introduction">
873
- <fo:block break-after="page"/>
874
- <xsl:apply-templates select="current()"/>
875
- </xsl:template>
876
- <!-- Abstract -->
877
- <xsl:template match="ogc:ogc-standard/ogc:preface/ogc:abstract" mode="abstract">
878
- <fo:block break-after="page"/>
879
- <xsl:apply-templates select="current()"/>
880
- </xsl:template>
881
- <!-- Preface -->
882
- <xsl:template match="ogc:ogc-standard/ogc:preface/ogc:foreword" mode="preface">
883
- <xsl:param name="sectionNum"/>
884
- <fo:block break-after="page"/>
885
- <xsl:apply-templates select="current()">
886
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
887
- </xsl:apply-templates>
888
- </xsl:template>
889
- <!-- Abstract, Preface -->
890
- <xsl:template match="ogc:ogc-standard/ogc:preface/*">
891
- <xsl:param name="sectionNum" select="'1'"/>
892
- <xsl:if test="not(ogc:title)">
893
- <xsl:variable name="id">
894
- <xsl:choose>
895
- <xsl:when test="@id">
896
- <xsl:value-of select="@id"/>
897
- </xsl:when>
898
- <xsl:otherwise>
899
- <xsl:value-of select="local-name()"/>
900
- </xsl:otherwise>
901
- </xsl:choose>
902
- </xsl:variable>
903
- <fo:block id="{$id}" font-size="13pt" font-weight="bold" margin-bottom="12pt" color="rgb(14, 26, 133)">
904
- <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="3mm"> </fo:inline>
905
- <xsl:variable name="name" select="local-name()"/>
906
- <xsl:call-template name="capitalize">
907
- <xsl:with-param name="str" select="$name"/>
908
- </xsl:call-template>
909
- </fo:block>
910
- </xsl:if>
911
- <xsl:apply-templates/>
912
- </xsl:template>
913
- <!-- Keywords -->
914
- <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:keyword">
915
- <xsl:param name="sectionNum" select="'1'"/>
916
- <fo:block id="keywords" font-size="13pt" font-weight="bold" margin-top="13.5pt" margin-bottom="12pt" color="rgb(14, 26, 133)">
917
- <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="2mm"> </fo:inline>
918
- <xsl:variable name="title-keywords">
919
- <xsl:call-template name="getTitle">
920
- <xsl:with-param name="name" select="'title-keywords'"/>
921
- </xsl:call-template>
922
- </xsl:variable>
923
- <xsl:value-of select="$title-keywords"/>
924
- </fo:block>
925
- <fo:block margin-bottom="12pt">The following are keywords to be used by search engines and document catalogues.</fo:block>
926
- <fo:block margin-bottom="12pt">
927
- <xsl:call-template name="insertKeywords">
928
- <xsl:with-param name="sorting">no</xsl:with-param>
929
- <xsl:with-param name="charAtEnd"/>
930
- </xsl:call-template>
931
- <!-- <xsl:for-each select="/ogc:ogc-standard/ogc:bibdata/ogc:keyword">
932
- <xsl:value-of select="."/>
933
- <xsl:if test="position() != last()">, </xsl:if>
934
- </xsl:for-each> -->
935
- </fo:block>
936
- </xsl:template>
937
- <!-- Submitting Organizations -->
938
- <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author']/ogc:organization/ogc:name">
939
- <xsl:param name="sectionNum" select="'1'"/>
940
- <fo:block id="submitting_orgs" font-size="13pt" font-weight="bold" color="rgb(14, 26, 133)" margin-top="13.5pt" margin-bottom="12pt">
941
- <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="3mm"> </fo:inline>
942
- <xsl:variable name="title-submitting-organizations">
943
- <xsl:call-template name="getTitle">
944
- <xsl:with-param name="name" select="'title-submitting-organizations'"/>
945
- </xsl:call-template>
946
- </xsl:variable>
947
- <xsl:value-of select="$title-submitting-organizations"/>
948
- </fo:block>
949
- <fo:block margin-bottom="12pt">The following organizations submitted this Document to the Open Geospatial Consortium (OGC):</fo:block>
950
- <fo:list-block provisional-distance-between-starts="6.5mm" margin-bottom="12pt" line-height="115%">
951
- <xsl:for-each select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author']/ogc:organization/ogc:name">
952
- <fo:list-item>
953
- <fo:list-item-label end-indent="label-end()">
954
- <fo:block>—</fo:block>
955
- </fo:list-item-label>
956
- <fo:list-item-body start-indent="body-start()" line-height-shift-adjustment="disregard-shifts">
957
- <fo:block>
958
- <xsl:apply-templates/>
959
- </fo:block>
960
- </fo:list-item-body>
961
- </fo:list-item>
962
- </xsl:for-each>
963
- </fo:list-block>
964
- </xsl:template>
965
-
966
-
967
- <!-- clause, terms, clause, ...-->
968
- <xsl:template match="ogc:ogc-standard/ogc:sections/*">
969
- <xsl:param name="sectionNum"/>
970
- <xsl:param name="sectionNumSkew" select="0"/>
662
+ <xsl:template match="/*/*[local-name() = 'preface']/*" priority="3">
971
663
  <fo:block>
972
- <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 -->
973
- <xsl:if test="$pos &gt;= 2">
974
- <xsl:attribute name="space-before">18pt</xsl:attribute>
975
- </xsl:if>
976
- <xsl:variable name="sectionNum_">
977
- <xsl:choose>
978
- <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
979
- <xsl:when test="$sectionNumSkew != 0">
980
- <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 -->
981
- <xsl:value-of select="$number + $sectionNumSkew"/>
982
- </xsl:when>
983
- <xsl:otherwise>
984
- <xsl:number count="*"/>
985
- </xsl:otherwise>
986
- </xsl:choose>
987
- </xsl:variable>
988
- <xsl:if test="not(ogc:title)">
989
- <fo:block margin-top="3pt" margin-bottom="12pt">
990
- <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')]"/>
991
- </fo:block>
992
- </xsl:if>
993
- <xsl:apply-templates>
994
- <xsl:with-param name="sectionNum" select="$sectionNum_"/>
995
- </xsl:apply-templates>
664
+ <xsl:call-template name="setId"/>
665
+ <xsl:apply-templates/>
996
666
  </fo:block>
997
667
  </xsl:template>
998
668
 
999
-
1000
669
 
1001
- <xsl:template match="ogc:clause//ogc:clause[not(ogc:title)]">
1002
- <xsl:param name="sectionNum"/>
1003
- <xsl:variable name="section">
1004
- <xsl:call-template name="getSection">
1005
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
1006
- </xsl:call-template>
1007
- </xsl:variable>
1008
-
1009
- <fo:block margin-top="3pt">
1010
- <fo:inline font-weight="bold" padding-right="3mm">
1011
- <xsl:value-of select="$section"/>
1012
- </fo:inline>
1013
- <xsl:apply-templates>
1014
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
1015
- <xsl:with-param name="inline" select="'true'"/>
1016
- </xsl:apply-templates>
670
+ <!-- ====== -->
671
+ <!-- title -->
672
+ <!-- ====== -->
673
+
674
+ <xsl:template match="ogc:annex/ogc:title">
675
+ <fo:block font-size="12pt" text-align="center" margin-bottom="12pt" keep-with-next="always" color="{$color}">
676
+ <xsl:apply-templates/>
1017
677
  </fo:block>
1018
678
  </xsl:template>
1019
679
 
1020
-
1021
680
  <xsl:template match="ogc:title">
1022
- <xsl:param name="sectionNum"/>
1023
-
1024
- <xsl:variable name="parent-name" select="local-name(..)"/>
1025
- <xsl:variable name="references_num_current">
1026
- <xsl:number level="any" count="ogc:references"/>
1027
- </xsl:variable>
1028
-
1029
- <xsl:variable name="id">
1030
- <xsl:call-template name="getId"/>
1031
- </xsl:variable>
1032
681
 
1033
682
  <xsl:variable name="level">
1034
683
  <xsl:call-template name="getLevel"/>
1035
684
  </xsl:variable>
1036
685
 
1037
- <xsl:variable name="section">
1038
- <xsl:call-template name="getSection">
1039
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
1040
- </xsl:call-template>
1041
- </xsl:variable>
1042
-
1043
686
  <xsl:variable name="font-size">
1044
687
  <xsl:choose>
1045
688
  <xsl:when test="ancestor::ogc:preface and $level &gt;= 2">12pt</xsl:when>
@@ -1059,59 +702,19 @@
1059
702
  </xsl:choose>
1060
703
  </xsl:variable>
1061
704
 
1062
- <xsl:variable name="color" select="'rgb(14, 26, 133)'"/>
1063
-
1064
- <xsl:choose>
1065
- <xsl:when test="$parent-name = 'annex'">
1066
- <fo:block id="{$id}" font-size="12pt" font-weight="bold" text-align="center" margin-bottom="12pt" keep-with-next="always" color="{$color}">
1067
- <xsl:value-of select="$section"/>
1068
- <xsl:if test=" ../@obligation">
1069
- <xsl:value-of select="$linebreak"/>
1070
- <fo:inline font-weight="normal">(<xsl:value-of select="../@obligation"/>)</fo:inline>
1071
- </xsl:if>
1072
- <xsl:value-of select="$linebreak"/>
1073
- <xsl:apply-templates/>
1074
- </fo:block>
1075
- </xsl:when>
1076
- <xsl:otherwise>
1077
- <xsl:element name="{$element-name}">
1078
- <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
1079
- <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
1080
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1081
- <xsl:attribute name="space-before">13.5pt</xsl:attribute>
1082
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1083
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
1084
- <xsl:attribute name="color"><xsl:value-of select="$color"/></xsl:attribute>
1085
- <xsl:if test="$section != ''">
1086
- <xsl:if test="$section != '0'">
1087
- <xsl:value-of select="$section"/><xsl:text>.</xsl:text>
1088
- <xsl:choose>
1089
- <xsl:when test="$level &gt;= 5"/>
1090
- <xsl:when test="$level &gt;= 4">
1091
- <fo:inline padding-right="4mm"> </fo:inline>
1092
- </xsl:when>
1093
- <xsl:when test="$level &gt;= 3 and ancestor::ogc:terms">
1094
- <fo:inline padding-right="2mm"> </fo:inline>
1095
- </xsl:when>
1096
- <xsl:when test="$level &gt;= 2">
1097
- <fo:inline padding-right="3mm"> </fo:inline>
1098
- </xsl:when>
1099
- <xsl:when test="$level = 1">
1100
- <fo:inline padding-right="3mm"> </fo:inline>
1101
- </xsl:when>
1102
- <xsl:otherwise>
1103
- <fo:inline padding-right="1mm"> </fo:inline>
1104
- </xsl:otherwise>
1105
- </xsl:choose>
1106
- </xsl:if>
1107
- </xsl:if>
1108
- <xsl:apply-templates/>
1109
- </xsl:element>
1110
- </xsl:otherwise>
1111
- </xsl:choose>
1112
-
705
+ <xsl:element name="{$element-name}">
706
+ <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
707
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
708
+ <xsl:attribute name="space-before">13.5pt</xsl:attribute>
709
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
710
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
711
+ <xsl:attribute name="color"><xsl:value-of select="$color"/></xsl:attribute>
712
+ <xsl:apply-templates/>
713
+ </xsl:element>
714
+
1113
715
  </xsl:template>
1114
-
716
+ <!-- ====== -->
717
+ <!-- ====== -->
1115
718
 
1116
719
  <xsl:template match="ogc:p">
1117
720
  <xsl:param name="inline" select="'false'"/>
@@ -1165,7 +768,7 @@
1165
768
  <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
1166
769
  </fn>
1167
770
  -->
1168
- <xsl:template match="ogc:title/ogc:fn | ogc:p/ogc:fn[not(ancestor::ogc:table)] | ogc:p/*/ogc:fn[not(ancestor::ogc:table)] | ogc:sourcecode/ogc:fn[not(ancestor::ogc:table)]" priority="2">
771
+ <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">
1169
772
  <fo:footnote keep-with-previous.within-line="always">
1170
773
  <xsl:variable name="number" select="@reference"/>
1171
774
 
@@ -1193,122 +796,19 @@
1193
796
  </fo:block>
1194
797
  </xsl:template>
1195
798
 
1196
- <xsl:template match="ogc:review">
1197
- <!-- comment 2019-11-29 -->
1198
- <!-- <fo:block font-weight="bold">Review:</fo:block>
1199
- <xsl:apply-templates /> -->
1200
- </xsl:template>
1201
-
1202
- <xsl:template match="text()">
1203
- <xsl:value-of select="."/>
1204
- </xsl:template>
1205
-
1206
-
1207
- <xsl:template match="ogc:image"> <!-- only for without outer figure -->
1208
- <fo:block margin-top="12pt" margin-bottom="6pt">
1209
- <fo:external-graphic src="{@src}" width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/> <!-- content-width="75%" -->
1210
- </fo:block>
1211
- </xsl:template>
1212
799
 
1213
- <xsl:template match="ogc:figure">
1214
- <fo:block-container id="{@id}">
1215
- <fo:block>
1216
- <xsl:apply-templates/>
1217
- </fo:block>
1218
- <xsl:call-template name="fn_display_figure"/>
1219
- <xsl:for-each select="ogc:note//ogc:p">
1220
- <xsl:call-template name="note"/>
1221
- </xsl:for-each>
1222
- <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-top="12pt" margin-bottom="6pt" keep-with-previous="always">
1223
- <xsl:variable name="title-figure">
1224
- <xsl:call-template name="getTitle">
1225
- <xsl:with-param name="name" select="'title-figure'"/>
1226
- </xsl:call-template>
1227
- </xsl:variable>
1228
- <xsl:choose>
1229
- <xsl:when test="ancestor::ogc:annex">
1230
- <xsl:choose>
1231
- <xsl:when test="local-name(..) = 'figure'">
1232
- <xsl:number format="a) "/>
1233
- </xsl:when>
1234
- <xsl:otherwise>
1235
- <xsl:value-of select="$title-figure"/><xsl:number format="A.1-1" level="multiple" count="ogc:annex | ogc:figure"/>
1236
- </xsl:otherwise>
1237
- </xsl:choose>
1238
-
1239
- </xsl:when>
1240
- <xsl:otherwise>
1241
- <xsl:value-of select="$title-figure"/><xsl:number format="1" level="any" count="ogc:sourcecode[not(@unnumbered='true') and not(ancestor::ogc:example)] | ogc:figure"/>
1242
- </xsl:otherwise>
1243
- </xsl:choose>
1244
- <xsl:if test="ogc:name">
1245
- <xsl:if test="not(local-name(..) = 'figure')">
1246
- <xsl:text> — </xsl:text>
1247
- </xsl:if>
1248
- <xsl:value-of select="ogc:name"/>
1249
- </xsl:if>
1250
- </fo:block>
1251
- </fo:block-container>
1252
- </xsl:template>
1253
-
1254
- <xsl:template match="ogc:figure/ogc:name"/>
1255
- <xsl:template match="ogc:figure/ogc:fn"/>
1256
- <xsl:template match="ogc:figure/ogc:note"/>
1257
-
1258
-
1259
- <xsl:template match="ogc:figure/ogc:image">
1260
- <fo:block text-align="center">
1261
- <fo:external-graphic src="{@src}" width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/> <!-- content-width="75%" -->
1262
- </fo:block>
1263
- </xsl:template>
1264
-
1265
800
 
1266
801
  <xsl:template match="ogc:bibitem">
1267
802
  <fo:block id="{@id}" margin-bottom="12pt" start-indent="12mm" text-indent="-12mm" line-height="115%">
1268
803
  <xsl:if test=".//ogc:fn">
1269
804
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
1270
- </xsl:if>
1271
- <xsl:choose>
1272
- <xsl:when test="ogc:formattedref">
1273
- <xsl:apply-templates select="ogc:formattedref"/>
1274
- </xsl:when>
1275
- <xsl:otherwise>
1276
- <xsl:for-each select="ogc:contributor[ogc:role/@type='publisher']/ogc:organization/ogc:name">
1277
- <xsl:apply-templates/>
1278
- <xsl:if test="position() != last()">, </xsl:if>
1279
- <xsl:if test="position() = last()">: </xsl:if>
1280
- </xsl:for-each>
1281
- <!-- ogc:docidentifier -->
1282
- <xsl:if test="ogc:docidentifier">
1283
- <xsl:value-of select="ogc:docidentifier/@type"/><xsl:text> </xsl:text>
1284
- <xsl:value-of select="ogc:docidentifier"/>
1285
- </xsl:if>
1286
- <xsl:apply-templates select="ogc:note"/>
1287
- <xsl:if test="ogc:docidentifier">, </xsl:if>
1288
- <fo:inline font-style="italic">
1289
- <xsl:choose>
1290
- <xsl:when test="ogc:title[@type = 'main' and @language = 'en']">
1291
- <xsl:value-of select="ogc:title[@type = 'main' and @language = 'en']"/><xsl:text>. </xsl:text>
1292
- </xsl:when>
1293
- <xsl:otherwise>
1294
- <xsl:value-of select="ogc:title"/><xsl:text>. </xsl:text>
1295
- </xsl:otherwise>
1296
- </xsl:choose>
1297
- </fo:inline>
1298
- <xsl:for-each select="ogc:contributor[ogc:role/@type='publisher']/ogc:organization/ogc:name">
1299
- <xsl:apply-templates/>
1300
- <xsl:if test="position() != last()">, </xsl:if>
1301
- </xsl:for-each>
1302
- <xsl:if test="ogc:date[@type='published']/ogc:on">
1303
- <xsl:text>(</xsl:text><xsl:value-of select="ogc:date[@type='published']/ogc:on"/><xsl:text>)</xsl:text>
1304
- </xsl:if>
1305
- </xsl:otherwise>
1306
- </xsl:choose>
805
+ </xsl:if>
806
+ <xsl:call-template name="processBibitem"/>
1307
807
  </fo:block>
1308
808
  </xsl:template>
1309
809
 
1310
810
 
1311
- <xsl:template match="ogc:bibitem/ogc:note">
811
+ <xsl:template match="ogc:bibitem/ogc:note" priority="2">
1312
812
  <fo:footnote>
1313
813
  <xsl:variable name="number">
1314
814
  <xsl:choose>
@@ -1339,7 +839,7 @@
1339
839
 
1340
840
 
1341
841
  <xsl:template match="ogc:ul | ogc:ol">
1342
- <fo:list-block provisional-distance-between-starts="6.5mm" margin-bottom="12pt" line-height="115%">
842
+ <fo:list-block provisional-distance-between-starts="6.5mm" space-after="12pt" line-height="115%">
1343
843
  <xsl:if test="ancestor::ogc:ul | ancestor::ogc:ol">
1344
844
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
1345
845
  </xsl:if>
@@ -1351,7 +851,7 @@
1351
851
  </xsl:template>
1352
852
 
1353
853
  <xsl:template match="ogc:li">
1354
- <fo:list-item>
854
+ <fo:list-item id="{@id}">
1355
855
  <fo:list-item-label end-indent="label-end()">
1356
856
  <fo:block>
1357
857
  <xsl:choose>
@@ -1380,36 +880,28 @@
1380
880
  </fo:block>
1381
881
  </fo:list-item-label>
1382
882
  <fo:list-item-body start-indent="body-start()" line-height-shift-adjustment="disregard-shifts">
1383
- <xsl:apply-templates/>
883
+ <fo:block>
884
+ <xsl:apply-templates/>
885
+ </fo:block>
1384
886
  </fo:list-item-body>
1385
887
  </fo:list-item>
1386
888
  </xsl:template>
1387
889
 
1388
- <xsl:template match="ogc:ul/ogc:note | ogc:ol/ogc:note">
890
+ <xsl:template match="ogc:ul/ogc:note | ogc:ol/ogc:note" priority="2">
1389
891
  <fo:list-item font-size="10pt">
1390
892
  <fo:list-item-label><fo:block/></fo:list-item-label>
1391
893
  <fo:list-item-body>
1392
- <xsl:apply-templates/>
894
+ <fo:block>
895
+ <xsl:apply-templates select="ogc:name" mode="presentation"/>
896
+ <xsl:apply-templates/>
897
+ </fo:block>
1393
898
  </fo:list-item-body>
1394
899
  </fo:list-item>
1395
900
  </xsl:template>
1396
901
 
1397
- <xsl:template match="ogc:term">
1398
- <xsl:param name="sectionNum"/>
1399
- <fo:block id="{@id}">
1400
- <xsl:apply-templates>
1401
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
1402
- </xsl:apply-templates>
1403
- </fo:block>
1404
- </xsl:template>
902
+
1405
903
 
1406
- <xsl:template match="ogc:preferred">
1407
- <xsl:param name="sectionNum"/>
1408
- <xsl:variable name="section">
1409
- <xsl:call-template name="getSection">
1410
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
1411
- </xsl:call-template>
1412
- </xsl:variable>
904
+ <xsl:template match="ogc:preferred">
1413
905
  <xsl:variable name="level">
1414
906
  <xsl:call-template name="getLevel"/>
1415
907
  </xsl:variable>
@@ -1421,9 +913,7 @@
1421
913
  </xsl:variable>
1422
914
  <fo:block font-size="{$font-size}">
1423
915
  <fo:block font-weight="bold" keep-with-next="always">
1424
- <fo:inline>
1425
- <xsl:value-of select="$section"/><xsl:text>.</xsl:text>
1426
- </fo:inline>
916
+ <xsl:apply-templates select="ancestor::ogc:term/ogc:name" mode="presentation"/>
1427
917
  </fo:block>
1428
918
  <fo:block font-weight="bold" keep-with-next="always" line-height="1">
1429
919
  <xsl:apply-templates/>
@@ -1431,491 +921,96 @@
1431
921
  </fo:block>
1432
922
  </xsl:template>
1433
923
 
1434
- <xsl:template match="ogc:admitted">
1435
- <fo:block font-size="11pt">
1436
- <xsl:apply-templates/>
1437
- </fo:block>
1438
- </xsl:template>
1439
-
1440
- <xsl:template match="ogc:deprecates">
1441
- <xsl:variable name="title-deprecated">
1442
- <xsl:call-template name="getTitle">
1443
- <xsl:with-param name="name" select="'title-deprecated'"/>
1444
- </xsl:call-template>
1445
- </xsl:variable>
1446
- <fo:block><xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/></fo:block>
1447
- </xsl:template>
1448
-
1449
- <xsl:template match="ogc:definition[preceding-sibling::ogc:domain]">
1450
- <xsl:apply-templates/>
1451
- </xsl:template>
1452
- <xsl:template match="ogc:definition[preceding-sibling::ogc:domain]/ogc:p">
1453
- <fo:inline> <xsl:apply-templates/></fo:inline>
1454
- <fo:block> </fo:block>
1455
- </xsl:template>
1456
-
1457
- <xsl:template match="ogc:definition">
1458
- <fo:block space-after="6pt">
1459
- <xsl:apply-templates/>
1460
- </fo:block>
1461
- </xsl:template>
1462
-
1463
- <xsl:template match="ogc:termsource">
1464
- <fo:block margin-bottom="12pt" keep-with-previous="always">
1465
- <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
1466
- <fo:basic-link internal-destination="{ogc:origin/@bibitemid}" fox:alt-text="{ogc:origin/@citeas}">
1467
- <xsl:text>[</xsl:text>
1468
- <xsl:variable name="title-source">
1469
- <xsl:call-template name="getTitle">
1470
- <xsl:with-param name="name" select="'title-source'"/>
1471
- </xsl:call-template>
1472
- </xsl:variable>
1473
- <xsl:value-of select="$title-source"/>
1474
- <xsl:text>: </xsl:text>
1475
- <fo:inline color="blue" text-decoration="underline">
1476
- <xsl:value-of select="ogc:origin/@citeas"/>
1477
-
1478
- <xsl:apply-templates select="ogc:origin/ogc:localityStack"/>
1479
-
1480
- </fo:inline>
1481
- </fo:basic-link>
1482
- <xsl:apply-templates select="ogc:modification"/>
1483
- <xsl:text>]</xsl:text>
1484
- </fo:block>
1485
- </xsl:template>
1486
-
1487
-
1488
- <xsl:template match="ogc:modification/ogc:p">
1489
- <fo:inline><xsl:apply-templates/></fo:inline>
1490
- </xsl:template>
1491
-
1492
- <xsl:template match="ogc:termnote">
1493
- <fo:block font-size="10pt" margin-bottom="12pt">
1494
- <xsl:variable name="num"><xsl:number/></xsl:variable>
1495
- <xsl:variable name="title-note-to-entry">
1496
- <xsl:call-template name="getTitle">
1497
- <xsl:with-param name="name" select="'title-note-to-entry'"/>
1498
- </xsl:call-template>
1499
- </xsl:variable>
1500
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($title-note-to-entry),'#',$num)"/>
1501
- <xsl:apply-templates/>
1502
- </fo:block>
1503
- </xsl:template>
1504
-
1505
- <xsl:template match="ogc:termnote/ogc:p">
1506
- <fo:inline><xsl:apply-templates/></fo:inline>
1507
- </xsl:template>
1508
-
1509
- <xsl:template match="ogc:domain">
1510
- <fo:inline>&lt;<xsl:apply-templates/>&gt;</fo:inline>
1511
- </xsl:template>
1512
-
1513
924
 
1514
- <xsl:template match="ogc:termexample">
1515
- <fo:block font-size="10pt" margin-bottom="12pt">
1516
- <xsl:variable name="title-example">
1517
- <xsl:call-template name="getTitle">
1518
- <xsl:with-param name="name" select="'title-example'"/>
1519
- </xsl:call-template>
1520
- </xsl:variable>
1521
- <fo:inline padding-right="10mm"><xsl:value-of select="normalize-space($title-example)"/></fo:inline>
925
+ <!-- [position() &gt; 1] -->
926
+ <xsl:template match="ogc:references[not(@normative='true')]">
927
+ <fo:block break-after="page"/>
928
+ <fo:block id="{@id}" line-height="120%">
1522
929
  <xsl:apply-templates/>
1523
930
  </fo:block>
1524
931
  </xsl:template>
1525
-
1526
- <xsl:template match="ogc:termexample/ogc:p">
1527
- <fo:inline><xsl:apply-templates/></fo:inline>
1528
- </xsl:template>
1529
932
 
1530
-
1531
- <xsl:template match="ogc:annex">
1532
- <fo:block break-after="page"/>
1533
- <xsl:apply-templates/>
1534
- </xsl:template>
1535
-
1536
-
1537
- <!-- [position() &gt; 1] -->
1538
- <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references']">
1539
- <fo:block break-after="page"/>
1540
- <fo:block line-height="120%">
933
+ <xsl:template match="ogc:annex//ogc:references">
934
+ <fo:block id="{@id}">
1541
935
  <xsl:apply-templates/>
1542
936
  </fo:block>
1543
937
  </xsl:template>
1544
938
 
1545
-
1546
- <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
1547
- <!-- <xsl:template match="ogc:references[@id = '_bibliography']/ogc:bibitem"> [position() &gt; 1] -->
1548
- <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references']/ogc:bibitem">
1549
- <fo:list-block margin-bottom="12pt" provisional-distance-between-starts="12mm">
939
+ <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
940
+ <xsl:template match="ogc:references[not(@normative='true')]/ogc:bibitem">
941
+ <fo:list-block id="{@id}" margin-bottom="12pt" provisional-distance-between-starts="12mm">
1550
942
  <fo:list-item>
1551
943
  <fo:list-item-label end-indent="label-end()">
1552
944
  <fo:block>
1553
- <fo:inline id="{@id}">
945
+ <fo:inline>
1554
946
  <xsl:number format="[1]"/>
1555
947
  </fo:inline>
1556
948
  </fo:block>
1557
949
  </fo:list-item-label>
1558
950
  <fo:list-item-body start-indent="body-start()">
1559
951
  <fo:block>
1560
-
1561
- <xsl:if test="not(ogc:formattedref)">
1562
- <xsl:choose>
1563
- <xsl:when test="ogc:contributor[ogc:role/@type='publisher']/ogc:organization/ogc:abbreviation">
1564
- <xsl:for-each select="ogc:contributor[ogc:role/@type='publisher']/ogc:organization/ogc:abbreviation">
1565
- <xsl:value-of select="."/>
1566
- <xsl:if test="position() != last()">/</xsl:if>
1567
- </xsl:for-each>
1568
- <xsl:text>: </xsl:text>
1569
- </xsl:when>
1570
- <xsl:when test="ogc:contributor[ogc:role/@type='publisher']/ogc:organization/ogc:name">
1571
- <xsl:value-of select="ogc:contributor[ogc:role/@type='publisher']/ogc:organization/ogc:name"/>
1572
- <xsl:text>: </xsl:text>
1573
- </xsl:when>
1574
- </xsl:choose>
1575
-
1576
- </xsl:if>
1577
-
1578
- <xsl:if test="ogc:docidentifier">
1579
- <xsl:choose>
1580
- <xsl:when test="ogc:docidentifier/@type = 'ISO' and ogc:formattedref"/>
1581
- <xsl:when test="ogc:docidentifier/@type = 'OGC' and ogc:formattedref"/>
1582
- <xsl:otherwise><fo:inline>
1583
- <xsl:if test="ogc:docidentifier/@type = 'OGC'">OGC </xsl:if>
1584
- <xsl:value-of select="ogc:docidentifier"/><xsl:apply-templates select="ogc:note"/>, </fo:inline></xsl:otherwise>
1585
- </xsl:choose>
1586
- </xsl:if>
1587
-
1588
-
1589
-
1590
- <xsl:choose>
1591
- <xsl:when test="ogc:title[@type = 'main' and @language = 'en']">
1592
- <xsl:apply-templates select="ogc:title[@type = 'main' and @language = 'en']"/>
1593
- </xsl:when>
1594
- <xsl:otherwise>
1595
- <xsl:apply-templates select="ogc:title"/>
1596
- </xsl:otherwise>
1597
- </xsl:choose>
1598
- <xsl:if test="ogc:contributor[ogc:role/@type='publisher']/ogc:organization/ogc:name">
1599
- <xsl:text>, </xsl:text>
1600
- <xsl:for-each select="ogc:contributor[ogc:role/@type='publisher']/ogc:organization/ogc:name">
1601
- <xsl:if test="position() != last()">and </xsl:if>
1602
- <xsl:value-of select="."/>
1603
- </xsl:for-each>
1604
-
1605
- </xsl:if>
1606
- <xsl:if test="ogc:place">
1607
- <xsl:text>, </xsl:text>
1608
- <xsl:value-of select="ogc:place"/>
1609
- </xsl:if>
1610
- <xsl:if test="ogc:date[@type='published']/ogc:on">
1611
- <xsl:text> (</xsl:text><xsl:value-of select="ogc:date[@type='published']/ogc:on"/><xsl:text>).</xsl:text>
1612
- </xsl:if>
1613
- <xsl:apply-templates select="ogc:formattedref"/>
952
+ <xsl:call-template name="processBibitem"/>
1614
953
  </fo:block>
1615
954
  </fo:list-item-body>
1616
955
  </fo:list-item>
1617
956
  </fo:list-block>
1618
957
  </xsl:template>
1619
958
 
1620
- <!-- <xsl:template match="ogc:references[@id = '_bibliography']/ogc:bibitem" mode="contents"/> [position() &gt; 1] -->
1621
- <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references']/ogc:bibitem" mode="contents"/>
959
+
960
+ <xsl:template match="ogc:references[not(@normative='true')]/ogc:bibitem" mode="contents"/>
1622
961
 
1623
- <!-- <xsl:template match="ogc:references[@id = '_bibliography']/ogc:bibitem/ogc:title"> [position() &gt; 1]-->
1624
- <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references']/ogc:bibitem/ogc:title">
962
+ <xsl:template match="ogc:bibitem/ogc:title">
1625
963
  <fo:inline font-style="italic">
1626
964
  <xsl:apply-templates/>
1627
965
  </fo:inline>
1628
966
  </xsl:template>
1629
967
 
1630
- <xsl:template match="ogc:quote">
1631
- <fo:block margin-top="12pt" margin-left="13mm" margin-right="12mm">
1632
- <xsl:apply-templates select=".//ogc:p"/>
968
+
969
+ <xsl:template match="ogc:admonition">
970
+ <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">
971
+ <fo:block-container margin-left="0mm" margin-right="0mm" padding="2mm" padding-top="3mm">
972
+ <fo:block font-size="11pt" margin-bottom="6pt" font-weight="bold" font-style="italic" text-align="center">
973
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@type))"/>
974
+ </fo:block>
975
+ <fo:block font-style="italic">
976
+ <xsl:apply-templates/>
977
+ </fo:block>
978
+ </fo:block-container>
979
+ </fo:block-container>
980
+
981
+
982
+ </xsl:template>
983
+
984
+
985
+ <xsl:template match="ogc:formula/ogc:stem">
986
+ <fo:block margin-top="6pt" margin-bottom="12pt">
987
+ <fo:table table-layout="fixed" width="100%">
988
+ <fo:table-column column-width="95%"/>
989
+ <fo:table-column column-width="5%"/>
990
+ <fo:table-body>
991
+ <fo:table-row>
992
+ <fo:table-cell display-align="center">
993
+ <fo:block text-align="left" margin-left="5mm">
994
+ <xsl:apply-templates/>
995
+ </fo:block>
996
+ </fo:table-cell>
997
+ <fo:table-cell display-align="center">
998
+ <fo:block text-align="right">
999
+ <xsl:apply-templates select="../ogc:name" mode="presentation"/>
1000
+ </fo:block>
1001
+ </fo:table-cell>
1002
+ </fo:table-row>
1003
+ </fo:table-body>
1004
+ </fo:table>
1633
1005
  </fo:block>
1634
- <xsl:if test="ogc:author or ogc:source">
1635
- <fo:block text-align="right" margin-right="25mm">
1636
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
1637
- <xsl:if test="ogc:author">
1638
- <xsl:text>— </xsl:text><xsl:value-of select="ogc:author"/>
1639
- </xsl:if>
1640
- <xsl:if test="ogc:source">
1641
- <xsl:text>, </xsl:text>
1642
- <xsl:apply-templates select="ogc:source"/>
1643
- </xsl:if>
1644
- </fo:block>
1645
- </xsl:if>
1646
1006
  </xsl:template>
1647
1007
 
1648
- <xsl:template match="ogc:source">
1649
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
1650
- <xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" -->
1651
- <xsl:apply-templates select="ogc:localityStack"/>
1652
- </fo:basic-link>
1653
- </xsl:template>
1654
-
1655
1008
 
1656
- <xsl:template match="ogc:xref">
1657
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">
1658
- <xsl:variable name="section" select="xalan:nodeset($contents)//item[@id = current()/@target]/@section"/>
1659
- <!-- <xsl:if test="not(starts-with($section, 'Figure') or starts-with($section, 'Table'))"> -->
1660
- <xsl:attribute name="color">blue</xsl:attribute>
1661
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1662
- <!-- </xsl:if> -->
1663
- <xsl:variable name="type" select="xalan:nodeset($contents)//item[@id = current()/@target]/@type"/>
1664
- <xsl:variable name="root" select="xalan:nodeset($contents)//item[@id = current()/@target]/@root"/>
1665
-
1666
- <xsl:variable name="title-clause">
1667
- <xsl:call-template name="getTitle">
1668
- <xsl:with-param name="name" select="'title-clause'"/>
1669
- </xsl:call-template>
1670
- </xsl:variable>
1671
- <xsl:variable name="title-annex">
1672
- <xsl:call-template name="getTitle">
1673
- <xsl:with-param name="name" select="'title-annex'"/>
1674
- </xsl:call-template>
1675
- </xsl:variable>
1676
-
1677
- <xsl:choose>
1678
- <xsl:when test="normalize-space(.) != ''">
1679
- <xsl:apply-templates/>
1680
- </xsl:when>
1681
- <xsl:otherwise>
1682
- <xsl:choose>
1683
- <xsl:when test="$type = 'clause' and $root != 'annex'"><xsl:value-of select="$title-clause"/></xsl:when><!-- and not (ancestor::annex) -->
1684
- <xsl:when test="$type = 'term' and ($root = 'clause' or $root = 'terms')"><xsl:value-of select="$title-clause"/></xsl:when>
1685
- <xsl:when test="$type = 'clause' and $root = 'annex'"><xsl:value-of select="$title-annex"/></xsl:when>
1686
- <xsl:otherwise/> <!-- <xsl:value-of select="$type"/> -->
1687
- </xsl:choose>
1688
- <xsl:value-of select="$section"/>
1689
- </xsl:otherwise>
1690
- </xsl:choose>
1691
- </fo:basic-link>
1692
- </xsl:template>
1693
-
1694
- <xsl:template match="ogc:sourcecode" priority="2">
1695
- <xsl:call-template name="sourcecode"/>
1696
- <xsl:variable name="title-figure">
1697
- <xsl:call-template name="getTitle">
1698
- <xsl:with-param name="name" select="'title-figure'"/>
1699
- </xsl:call-template>
1700
- </xsl:variable>
1701
- <xsl:choose>
1702
- <xsl:when test="@unnumbered='true'"/>
1703
- <xsl:when test="ancestor::ogc:example"/>
1704
- <xsl:when test="ancestor::ogc:td"/>
1705
- <xsl:when test="ancestor::ogc:annex">
1706
- <xsl:variable name="id_annex" select="ancestor::ogc:annex/@id"/>
1707
- <xsl:choose>
1708
- <xsl:when test="count(//ogc:annex) = 1">
1709
- <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"/>
1710
- </xsl:when>
1711
- <xsl:otherwise>
1712
- <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="12pt">
1713
- <xsl:value-of select="$title-figure"/>
1714
- <xsl:number format="A." level="multiple" count="ogc:annex"/>
1715
- <xsl:number format="1" level="any" count="ogc:sourcecode[ancestor::ogc:annex/@id = $id_annex and not(@unnumbered='true') and not(ancestor::ogc:example)]"/>
1716
- <xsl:if test="ogc:name">
1717
- <xsl:text> — </xsl:text>
1718
- <xsl:apply-templates select="ogc:name/*"/>
1719
- </xsl:if>
1720
- </fo:block>
1721
- </xsl:otherwise>
1722
- </xsl:choose>
1723
- </xsl:when>
1724
- <xsl:otherwise>
1725
- <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="12pt">
1726
- <xsl:value-of select="$title-figure"/>
1727
- <xsl:number format="1" level="any" count="ogc:sourcecode[not(@unnumbered='true') and not(ancestor::ogc:example)] | ogc:figure"/>
1728
- <xsl:if test="ogc:name">
1729
- <xsl:text> — </xsl:text>
1730
- <xsl:apply-templates select="ogc:name/*"/>
1731
- </xsl:if>
1732
- </fo:block>
1733
- </xsl:otherwise>
1734
- </xsl:choose>
1735
- </xsl:template>
1736
-
1737
- <xsl:template match="ogc:sourcecode/text()">
1738
- <xsl:variable name="text">
1739
- <xsl:call-template name="add-zero-spaces-equal"/>
1740
- </xsl:variable>
1741
- <xsl:call-template name="add-zero-spaces">
1742
- <xsl:with-param name="text" select="$text"/>
1743
- </xsl:call-template>
1744
- </xsl:template>
1745
-
1746
-
1747
- <xsl:template match="ogc:sourcecode/ogc:name"/>
1748
-
1749
- <xsl:template match="ogc:example">
1750
- <fo:block font-size="10pt" margin-top="12pt" margin-bottom="12pt" font-weight="bold" keep-with-next="always">
1751
- <xsl:variable name="title-example">
1752
- <xsl:call-template name="getTitle">
1753
- <xsl:with-param name="name" select="'title-example'"/>
1754
- </xsl:call-template>
1755
- </xsl:variable>
1756
- <xsl:value-of select="normalize-space($title-example)"/>
1757
- <xsl:if test="following-sibling::ogc:example or preceding-sibling::ogc:example">
1758
- <xsl:number format=" 1"/>
1759
- </xsl:if>
1760
- <xsl:if test="ogc:name">
1761
- <xsl:text> — </xsl:text>
1762
- <xsl:apply-templates select="ogc:name/node()"/>
1763
- </xsl:if>
1764
- </fo:block>
1765
- <fo:block font-size="10pt" margin-left="12.5mm" margin-right="12.5mm">
1766
- <xsl:apply-templates/>
1767
- </fo:block>
1768
- </xsl:template>
1769
-
1770
- <xsl:template match="ogc:example/ogc:name"/>
1771
-
1772
- <xsl:template match="ogc:example/ogc:p">
1773
- <fo:block margin-bottom="14pt">
1774
- <xsl:apply-templates/>
1775
- </fo:block>
1776
- </xsl:template>
1777
-
1778
-
1779
-
1780
- <xsl:template match="ogc:note/ogc:p" name="note">
1781
- <fo:block font-size="10pt" margin-top="12pt" margin-bottom="12pt" line-height="115%">
1782
- <xsl:if test="ancestor::ogc:ul or ancestor::ogc:ol and not(ancestor::ogc:note[1]/following-sibling::*)">
1783
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
1784
- </xsl:if>
1785
- <xsl:variable name="clauseid" select="ancestor::ogc:clause[1]/@id"/>
1786
- <fo:inline padding-right="4mm">
1787
- <xsl:variable name="title-note">
1788
- <xsl:call-template name="getTitle">
1789
- <xsl:with-param name="name" select="'title-note'"/>
1790
- </xsl:call-template>
1791
- </xsl:variable>
1792
- <xsl:value-of select="$title-note"/>
1793
- <xsl:if test="count(//ogc:note[ancestor::ogc:clause[1][@id = $clauseid]]) &gt; 1">
1794
- <xsl:number count="ogc:note[ancestor::ogc:clause[1][@id = $clauseid]]" level="any"/>
1795
- </xsl:if>
1796
- </fo:inline>
1797
- <xsl:apply-templates/>
1798
- </fo:block>
1799
- </xsl:template>
1800
-
1801
- <!-- <eref type="inline" bibitemid="ISO20483" citeas="ISO 20483:2013"><locality type="annex"><referenceFrom>C</referenceFrom></locality></eref> -->
1802
- <xsl:template match="ogc:eref">
1803
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}" color="blue" text-decoration="underline"> <!-- font-size="9pt" color="blue" vertical-align="super" -->
1804
- <xsl:if test="@type = 'footnote'">
1805
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
1806
- <xsl:attribute name="font-size">80%</xsl:attribute>
1807
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1808
- <xsl:attribute name="vertical-align">super</xsl:attribute>
1809
- </xsl:if>
1810
- <xsl:if test="@type = 'inline'">
1811
- <xsl:attribute name="color">blue</xsl:attribute>
1812
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1813
- </xsl:if>
1814
- <!-- <xsl:if test="@type = 'inline'">
1815
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1816
- </xsl:if> -->
1817
- <xsl:choose>
1818
- <xsl:when test="@citeas and normalize-space(text()) = ''">
1819
- <xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" -->
1820
- </xsl:when>
1821
- <xsl:when test="@bibitemid and normalize-space(text()) = ''">
1822
- <xsl:value-of select="//ogc:bibitem[@id = current()/@bibitemid]/ogc:docidentifier"/>
1823
- </xsl:when>
1824
- <xsl:otherwise/>
1825
- </xsl:choose>
1826
- <xsl:apply-templates select="ogc:localityStack"/>
1827
- <xsl:apply-templates select="text()"/>
1828
- </fo:basic-link>
1829
- </xsl:template>
1830
-
1831
- <xsl:template match="ogc:locality">
1832
- <xsl:variable name="title-clause">
1833
- <xsl:call-template name="getTitle">
1834
- <xsl:with-param name="name" select="'title-clause'"/>
1835
- </xsl:call-template>
1836
- </xsl:variable>
1837
- <xsl:variable name="title-annex">
1838
- <xsl:call-template name="getTitle">
1839
- <xsl:with-param name="name" select="'title-annex'"/>
1840
- </xsl:call-template>
1841
- </xsl:variable>
1842
- <xsl:choose>
1843
- <xsl:when test="@type ='clause'"><xsl:value-of select="$title-clause"/></xsl:when>
1844
- <xsl:when test="@type ='annex'"><xsl:value-of select="$title-annex"/></xsl:when>
1845
- <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
1846
- </xsl:choose>
1847
- <xsl:text> </xsl:text><xsl:value-of select="ogc:referenceFrom"/>
1848
- </xsl:template>
1849
-
1850
- <xsl:template match="ogc:admonition">
1851
- <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">
1852
- <fo:block-container margin-left="0mm" margin-right="0mm" padding="2mm" padding-top="3mm">
1853
- <fo:block font-size="11pt" margin-bottom="6pt" font-weight="bold" font-style="italic" text-align="center">
1854
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@type))"/>
1855
- </fo:block>
1856
- <fo:block font-style="italic">
1857
- <xsl:apply-templates/>
1858
- </fo:block>
1859
- </fo:block-container>
1860
- </fo:block-container>
1861
-
1862
-
1863
- </xsl:template>
1864
-
1865
- <xsl:template match="ogc:formula">
1866
- <fo:block id="{@id}">
1867
- <xsl:apply-templates/>
1868
- </fo:block>
1869
- </xsl:template>
1870
-
1871
- <xsl:template match="ogc:formula/ogc:dt/ogc:stem">
1872
- <fo:inline>
1873
- <xsl:apply-templates/>
1874
- </fo:inline>
1875
- </xsl:template>
1876
-
1877
- <xsl:template match="ogc:formula/ogc:stem">
1878
- <fo:block margin-top="6pt" margin-bottom="12pt">
1879
- <fo:table table-layout="fixed" width="100%">
1880
- <fo:table-column column-width="95%"/>
1881
- <fo:table-column column-width="5%"/>
1882
- <fo:table-body>
1883
- <fo:table-row>
1884
- <fo:table-cell display-align="center">
1885
- <fo:block text-align="left" margin-left="5mm">
1886
- <xsl:apply-templates/>
1887
- </fo:block>
1888
- </fo:table-cell>
1889
- <fo:table-cell display-align="center">
1890
- <fo:block text-align="right">
1891
- <xsl:choose>
1892
- <xsl:when test="ancestor::ogc:annex">
1893
- <xsl:number format="(A.1)" level="multiple" count="ogc:annex | ogc:formula"/>
1894
- </xsl:when>
1895
- <xsl:otherwise> <!-- not(ancestor::ogc:annex) -->
1896
- <!-- <xsl:text>(</xsl:text><xsl:number level="any" count="ogc:formula"/><xsl:text>)</xsl:text> -->
1897
- </xsl:otherwise>
1898
- </xsl:choose>
1899
- </fo:block>
1900
- </fo:table-cell>
1901
- </fo:table-row>
1902
- </fo:table-body>
1903
- </fo:table>
1904
- <fo:inline keep-together.within-line="always">
1905
- </fo:inline>
1906
- </fo:block>
1907
- </xsl:template>
1908
-
1909
-
1910
- <xsl:template match="ogc:br" priority="2">
1911
- <!-- <fo:block>&#xA0;</fo:block> -->
1912
- <xsl:value-of select="$linebreak"/>
1913
- </xsl:template>
1914
-
1915
- <xsl:template match="ogc:pagebreak">
1916
- <fo:block break-after="page"/>
1917
- <fo:block> </fo:block>
1918
- <fo:block break-after="page"/>
1009
+
1010
+ <xsl:template match="ogc:pagebreak">
1011
+ <fo:block break-after="page"/>
1012
+ <fo:block> </fo:block>
1013
+ <fo:block break-after="page"/>
1919
1014
  </xsl:template>
1920
1015
 
1921
1016
  <xsl:template name="insertHeaderFooter">
@@ -1974,139 +1069,8 @@
1974
1069
  </fo:block-container>
1975
1070
  </fo:static-content>
1976
1071
  </xsl:template>
1977
-
1978
-
1979
- <xsl:template name="getSection">
1980
- <xsl:param name="sectionNum"/>
1981
- <xsl:variable name="level">
1982
- <xsl:call-template name="getLevel"/>
1983
- </xsl:variable>
1984
- <xsl:variable name="section">
1985
- <xsl:choose>
1986
- <xsl:when test="ancestor::ogc:bibliography">
1987
- <xsl:value-of select="$sectionNum"/>
1988
- </xsl:when>
1989
- <xsl:when test="ancestor::ogc:sections">
1990
- <!-- 1, 2, 3, 4, ... from main section (not annex, bibliography, ...) -->
1991
- <xsl:choose>
1992
- <xsl:when test="$level = 1">
1993
- <xsl:value-of select="$sectionNum"/>
1994
- </xsl:when>
1995
- <xsl:when test="$level &gt;= 2">
1996
- <xsl:variable name="num">
1997
- <xsl:call-template name="getSubSection"/>
1998
- </xsl:variable>
1999
- <xsl:value-of select="concat($sectionNum, $num)"/>
2000
- </xsl:when>
2001
- <xsl:otherwise>
2002
- <!-- z<xsl:value-of select="$sectionNum"/>z -->
2003
- </xsl:otherwise>
2004
- </xsl:choose>
2005
- <!-- <xsl:text>.</xsl:text> -->
2006
- </xsl:when>
2007
- <!-- <xsl:when test="ancestor::ogc:annex[@obligation = 'informative']">
2008
- <xsl:choose>
2009
- <xsl:when test="$level = 1">
2010
- <xsl:text>Annex </xsl:text>
2011
- <xsl:number format="I" level="any" count="ogc:annex[@obligation = 'informative']"/>
2012
- </xsl:when>
2013
- <xsl:otherwise>
2014
- <xsl:number format="I.1" level="multiple" count="ogc:annex[@obligation = 'informative'] | ogc:clause"/>
2015
- </xsl:otherwise>
2016
- </xsl:choose>
2017
- </xsl:when> -->
2018
- <xsl:when test="ancestor::ogc:annex">
2019
- <xsl:choose>
2020
- <xsl:when test="$level = 1">
2021
- <xsl:variable name="title-annex">
2022
- <xsl:call-template name="getTitle">
2023
- <xsl:with-param name="name" select="'title-annex'"/>
2024
- </xsl:call-template>
2025
- </xsl:variable>
2026
- <xsl:value-of select="$title-annex"/>
2027
- <xsl:choose>
2028
- <xsl:when test="count(//ogc:annex) = 1">
2029
- <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:ext/ogc:structuredidentifier/ogc:annexid"/>
2030
- </xsl:when>
2031
- <xsl:otherwise>
2032
- <xsl:number format="A" level="any" count="ogc:annex"/>
2033
- </xsl:otherwise>
2034
- </xsl:choose>
2035
- </xsl:when>
2036
- <xsl:otherwise>
2037
- <xsl:choose>
2038
- <xsl:when test="count(//ogc:annex) = 1">
2039
- <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:ext/ogc:structuredidentifier/ogc:annexid"/><xsl:number format=".1" level="multiple" count="ogc:clause"/>
2040
- </xsl:when>
2041
- <xsl:otherwise>
2042
- <xsl:number format="A.1" level="multiple" count="ogc:annex | ogc:clause"/>
2043
- </xsl:otherwise>
2044
- </xsl:choose>
2045
- </xsl:otherwise>
2046
- </xsl:choose>
2047
- </xsl:when>
2048
- <xsl:when test="ancestor::ogc:preface"> <!-- if preface and there is clause(s) -->
2049
- <xsl:choose>
2050
- <xsl:when test="$level = 1 and ..//ogc:clause">0</xsl:when>
2051
- <xsl:when test="$level &gt;= 2">
2052
- <xsl:variable name="num">
2053
- <xsl:number format=".1" level="multiple" count="ogc:clause"/>
2054
- </xsl:variable>
2055
- <xsl:value-of select="concat('0', $num)"/>
2056
- </xsl:when>
2057
- <xsl:otherwise>
2058
- <!-- z<xsl:value-of select="$sectionNum"/>z -->
2059
- </xsl:otherwise>
2060
- </xsl:choose>
2061
- </xsl:when>
2062
- <xsl:otherwise>
2063
- </xsl:otherwise>
2064
- </xsl:choose>
2065
- </xsl:variable>
2066
- <xsl:value-of select="$section"/>
2067
- </xsl:template>
2068
1072
 
2069
1073
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
2070
-
2071
- <title-table lang="en">Table </title-table>
2072
- <title-table lang="fr">Tableau </title-table>
2073
-
2074
- <title-table lang="zh">Table </title-table>
2075
-
2076
-
2077
-
2078
- <title-note lang="en">NOTE </title-note>
2079
- <title-note lang="fr">NOTE </title-note>
2080
-
2081
- <title-note lang="zh">NOTE </title-note>
2082
-
2083
-
2084
-
2085
- <title-figure lang="en">Figure </title-figure>
2086
- <title-figure lang="fr">Figure </title-figure>
2087
-
2088
- <title-figure lang="zh">Figure </title-figure>
2089
-
2090
-
2091
-
2092
- <title-example lang="en">EXAMPLE </title-example>
2093
- <title-example lang="fr">EXEMPLE </title-example>
2094
-
2095
- <title-example lang="zh">EXAMPLE </title-example>
2096
-
2097
-
2098
-
2099
- <title-example-xref lang="en">Example </title-example-xref>
2100
- <title-example-xref lang="fr">Exemple </title-example-xref>
2101
-
2102
- <title-section lang="en">Section </title-section>
2103
- <title-section lang="fr">Section </title-section>
2104
-
2105
- <title-inequality lang="en">Inequality </title-inequality>
2106
- <title-inequality lang="fr">Inequality </title-inequality>
2107
-
2108
- <title-equation lang="en">Equation </title-equation>
2109
- <title-equation lang="fr">Equation </title-equation>
2110
1074
 
2111
1075
  <title-annex lang="en">Annex </title-annex>
2112
1076
  <title-annex lang="fr">Annexe </title-annex>
@@ -2114,17 +1078,7 @@
2114
1078
  <title-annex lang="zh">Annex </title-annex>
2115
1079
 
2116
1080
 
2117
-
2118
- <title-appendix lang="en">Appendix </title-appendix>
2119
- <title-appendix lang="fr">Appendix </title-appendix>
2120
-
2121
- <title-clause lang="en">Clause </title-clause>
2122
- <title-clause lang="fr">Article </title-clause>
2123
-
2124
- <title-clause lang="zh">Clause </title-clause>
2125
-
2126
-
2127
-
1081
+
2128
1082
  <title-edition lang="en">
2129
1083
 
2130
1084
 
@@ -2132,9 +1086,7 @@
2132
1086
 
2133
1087
  </title-edition>
2134
1088
 
2135
- <title-formula lang="en">Formula </title-formula>
2136
- <title-formula lang="fr">Formula </title-formula>
2137
-
1089
+
2138
1090
  <title-toc lang="en">
2139
1091
 
2140
1092
  <xsl:text>Contents</xsl:text>
@@ -2169,13 +1121,6 @@
2169
1121
  </title-part>
2170
1122
  <title-part lang="zh">第 # 部分:</title-part>
2171
1123
 
2172
- <title-note-to-entry lang="en">Note # to entry: </title-note-to-entry>
2173
- <title-note-to-entry lang="fr">Note # à l'article: </title-note-to-entry>
2174
-
2175
- <title-note-to-entry lang="zh">Note # to entry: </title-note-to-entry>
2176
-
2177
-
2178
-
2179
1124
  <title-modified lang="en">modified</title-modified>
2180
1125
  <title-modified lang="fr">modifiée</title-modified>
2181
1126
 
@@ -2189,14 +1134,12 @@
2189
1134
 
2190
1135
  <title-deprecated lang="en">DEPRECATED</title-deprecated>
2191
1136
  <title-deprecated lang="fr">DEPRECATED</title-deprecated>
2192
-
2193
- <title-submitting-organizations lang="en">Submitting Organizations</title-submitting-organizations>
2194
-
1137
+
2195
1138
  <title-list-tables lang="en">List of Tables</title-list-tables>
2196
1139
 
2197
1140
  <title-list-figures lang="en">List of Figures</title-list-figures>
2198
1141
 
2199
- <title-recommendation lang="en">Recommendation </title-recommendation>
1142
+ <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
2200
1143
 
2201
1144
  <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
2202
1145
 
@@ -2206,8 +1149,6 @@
2206
1149
 
2207
1150
  <title-in lang="en">in </title-in>
2208
1151
 
2209
- <title-box lang="en">Box </title-box>
2210
-
2211
1152
  <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
2212
1153
  <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
2213
1154
 
@@ -2230,7 +1171,7 @@
2230
1171
  <title-warning lang="zh">警告</title-warning>
2231
1172
 
2232
1173
  <title-amendment lang="en">AMENDMENT</title-amendment>
2233
- </xsl:variable><xsl:template name="getTitle">
1174
+ </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
2234
1175
  <xsl:param name="name"/>
2235
1176
  <xsl:variable name="lang">
2236
1177
  <xsl:call-template name="getLang"/>
@@ -2251,6 +1192,8 @@
2251
1192
 
2252
1193
 
2253
1194
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
1195
+ <xsl:attribute name="white-space">pre</xsl:attribute>
1196
+ <xsl:attribute name="wrap-option">wrap</xsl:attribute>
2254
1197
 
2255
1198
 
2256
1199
 
@@ -2265,164 +1208,496 @@
2265
1208
  <xsl:attribute name="line-height">113%</xsl:attribute>
2266
1209
 
2267
1210
 
2268
- </xsl:attribute-set><xsl:attribute-set name="appendix-style">
2269
-
2270
- <xsl:attribute name="font-size">12pt</xsl:attribute>
1211
+ </xsl:attribute-set><xsl:attribute-set name="permission-style">
1212
+
1213
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1214
+
1215
+ </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
1216
+
1217
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
2271
1218
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2272
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
1219
+ <xsl:attribute name="text-align">center</xsl:attribute>
1220
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
1221
+ <xsl:attribute name="padding-bottom">1mm</xsl:attribute>
1222
+ <xsl:attribute name="margin-bottom">1mm</xsl:attribute>
1223
+ <xsl:attribute name="background-color">rgb(165,165,165)</xsl:attribute>
1224
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1225
+
1226
+ </xsl:attribute-set><xsl:attribute-set name="permission-label-style">
1227
+
2273
1228
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2274
1229
 
1230
+ </xsl:attribute-set><xsl:attribute-set name="requirement-style">
2275
1231
 
1232
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
2276
1233
 
2277
- </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
1234
+ </xsl:attribute-set><xsl:attribute-set name="requirement-name-style">
2278
1235
 
2279
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2280
- <xsl:attribute name="margin-top">8pt</xsl:attribute>
2281
- <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1236
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1237
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1238
+ <xsl:attribute name="text-align">center</xsl:attribute>
1239
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
1240
+ <xsl:attribute name="padding-bottom">1mm</xsl:attribute>
1241
+ <xsl:attribute name="margin-bottom">1mm</xsl:attribute>
1242
+ <xsl:attribute name="background-color">rgb(165,165,165)</xsl:attribute>
1243
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2282
1244
 
1245
+ </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
1246
+
1247
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1248
+
1249
+ </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
1250
+ </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
1251
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
1252
+
1253
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1254
+
1255
+
1256
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-name-style">
1257
+
1258
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1259
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1260
+ <xsl:attribute name="text-align">center</xsl:attribute>
1261
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
1262
+ <xsl:attribute name="padding-bottom">1mm</xsl:attribute>
1263
+ <xsl:attribute name="margin-bottom">1mm</xsl:attribute>
1264
+ <xsl:attribute name="background-color">rgb(165,165,165)</xsl:attribute>
1265
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1266
+
1267
+
1268
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-label-style">
1269
+
1270
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1271
+
1272
+ </xsl:attribute-set><xsl:attribute-set name="termexample-style">
1273
+
1274
+
1275
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1276
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1277
+
1278
+
1279
+
1280
+
1281
+
1282
+
1283
+ </xsl:attribute-set><xsl:attribute-set name="example-style">
1284
+
1285
+
1286
+
1287
+
1288
+
1289
+
1290
+
1291
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1292
+ <xsl:attribute name="margin-left">12.5mm</xsl:attribute>
1293
+ <xsl:attribute name="margin-right">12.5mm</xsl:attribute>
1294
+
1295
+
1296
+
1297
+
1298
+ </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1299
+
1300
+
1301
+
1302
+ </xsl:attribute-set><xsl:attribute-set name="example-name-style">
1303
+
1304
+
1305
+
1306
+
1307
+
1308
+
1309
+
1310
+
1311
+
1312
+
1313
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1314
+ <xsl:attribute name="text-align">center</xsl:attribute>
1315
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1316
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1317
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1318
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2283
1319
 
2284
1320
 
2285
- </xsl:attribute-set><xsl:template match="text()">
2286
- <xsl:value-of select="."/>
2287
- </xsl:template><xsl:template match="*[local-name()='br']">
2288
- <xsl:value-of select="$linebreak"/>
2289
- </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
2290
- <!-- <xsl:call-template name="add-zero-spaces"/> -->
2291
- <xsl:call-template name="add-zero-spaces-java"/>
2292
- </xsl:template><xsl:template match="*[local-name()='table']">
2293
-
2294
- <xsl:variable name="simple-table">
2295
- <!-- <xsl:copy> -->
2296
- <xsl:call-template name="getSimpleTable"/>
2297
- <!-- </xsl:copy> -->
2298
- </xsl:variable>
2299
-
2300
- <!-- DEBUG -->
2301
- <!-- SourceTable=<xsl:copy-of select="current()"/>EndSourceTable -->
2302
- <!-- Simpletable=<xsl:copy-of select="$simple-table"/>EndSimpltable -->
2303
-
2304
- <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
2305
1321
 
2306
- <!-- <xsl:if test="$namespace = 'iso'">
2307
- <fo:block space-before="6pt">&#xA0;</fo:block>
2308
- </xsl:if> -->
2309
1322
 
2310
- <xsl:choose>
2311
- <xsl:when test="@unnumbered = 'true'"/>
2312
- <xsl:otherwise>
2313
-
2314
1323
 
1324
+
1325
+
1326
+
1327
+ </xsl:attribute-set><xsl:attribute-set name="example-p-style">
1328
+
1329
+
1330
+
1331
+
1332
+
1333
+
1334
+
1335
+
1336
+ <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
1337
+
1338
+
1339
+
1340
+
1341
+
1342
+
1343
+ </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
1344
+
1345
+ <xsl:attribute name="padding-right">10mm</xsl:attribute>
1346
+
1347
+
1348
+
2315
1349
 
2316
- <fo:block font-weight="bold" text-align="center" margin-bottom="6pt" keep-with-next="always">
2317
-
2318
-
2319
-
2320
-
2321
-
2322
-
2323
- <xsl:attribute name="font-weight">normal</xsl:attribute>
2324
- <xsl:attribute name="font-size">11pt</xsl:attribute>
2325
-
2326
-
2327
-
2328
- <xsl:variable name="title-table">
2329
- <xsl:call-template name="getTitle">
2330
- <xsl:with-param name="name" select="'title-table'"/>
2331
- </xsl:call-template>
2332
- </xsl:variable>
2333
- <xsl:value-of select="$title-table"/>
2334
-
2335
- <xsl:call-template name="getTableNumber"/>
2336
-
2337
-
2338
- <xsl:if test="*[local-name()='name']">
2339
-
2340
-
2341
-
2342
- <xsl:text> — </xsl:text>
2343
-
2344
- <xsl:apply-templates select="*[local-name()='name']" mode="process"/>
2345
- </xsl:if>
2346
- </fo:block>
1350
+ </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1351
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1352
+
1353
+
1354
+
1355
+
2347
1356
 
1357
+
1358
+
1359
+ <xsl:attribute name="text-align">center</xsl:attribute>
1360
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1361
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1362
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1363
+
1364
+
2348
1365
 
2349
- <xsl:call-template name="fn_name_display"/>
1366
+
1367
+
1368
+ </xsl:attribute-set><xsl:attribute-set name="appendix-style">
2350
1369
 
2351
- </xsl:otherwise>
2352
- </xsl:choose>
1370
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
1371
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1372
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1373
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2353
1374
 
2354
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
2355
1375
 
2356
- <!-- <xsl:variable name="cols-count">
2357
- <xsl:choose>
2358
- <xsl:when test="*[local-name()='thead']">
2359
- <xsl:call-template name="calculate-columns-numbers">
2360
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
2361
- </xsl:call-template>
2362
- </xsl:when>
2363
- <xsl:otherwise>
2364
- <xsl:call-template name="calculate-columns-numbers">
2365
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
2366
- </xsl:call-template>
2367
- </xsl:otherwise>
2368
- </xsl:choose>
2369
- </xsl:variable> -->
2370
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
2371
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
2372
1376
 
1377
+ </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
2373
1378
 
1379
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1380
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
1381
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
2374
1382
 
2375
- <xsl:variable name="colwidths">
2376
- <xsl:call-template name="calculate-column-widths">
2377
- <xsl:with-param name="cols-count" select="$cols-count"/>
2378
- <xsl:with-param name="table" select="$simple-table"/>
2379
- </xsl:call-template>
2380
- </xsl:variable>
2381
1383
 
2382
- <!-- <xsl:variable name="colwidths2">
2383
- <xsl:call-template name="calculate-column-widths">
2384
- <xsl:with-param name="cols-count" select="$cols-count"/>
2385
- </xsl:call-template>
2386
- </xsl:variable> -->
2387
1384
 
2388
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
2389
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
2390
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1385
+ </xsl:attribute-set><xsl:attribute-set name="xref-style">
2391
1386
 
2392
- <xsl:variable name="margin-left">
2393
- <xsl:choose>
2394
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
2395
- <xsl:otherwise>0</xsl:otherwise>
2396
- </xsl:choose>
2397
- </xsl:variable>
2398
1387
 
2399
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2400
-
2401
-
2402
-
2403
-
2404
-
2405
-
2406
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2407
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
2408
- <xsl:attribute name="space-after">12pt</xsl:attribute>
2409
-
2410
-
2411
-
2412
- <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
2413
-
2414
-
2415
-
1388
+ <xsl:attribute name="color">blue</xsl:attribute>
1389
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
2416
1390
 
1391
+ </xsl:attribute-set><xsl:attribute-set name="eref-style">
1392
+
1393
+
1394
+ <xsl:attribute name="color">blue</xsl:attribute>
1395
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1396
+
1397
+
1398
+ </xsl:attribute-set><xsl:attribute-set name="note-style">
1399
+
1400
+
1401
+
2417
1402
 
2418
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2419
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
1403
+
1404
+
1405
+
1406
+
1407
+
1408
+
1409
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1410
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1411
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1412
+ <xsl:attribute name="line-height">115%</xsl:attribute>
1413
+
1414
+
1415
+
1416
+
1417
+
1418
+
1419
+ </xsl:attribute-set><xsl:attribute-set name="note-name-style">
1420
+
1421
+
1422
+
1423
+
1424
+
1425
+
1426
+
1427
+
1428
+
1429
+ <xsl:attribute name="padding-right">4mm</xsl:attribute>
2420
1430
 
1431
+
1432
+ </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1433
+
1434
+
1435
+
2421
1436
 
1437
+
1438
+
1439
+
1440
+
1441
+
1442
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1443
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1444
+
1445
+
1446
+
1447
+
1448
+
1449
+ </xsl:attribute-set><xsl:attribute-set name="termnote-style">
1450
+
1451
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1452
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1453
+
1454
+
1455
+
1456
+
1457
+
1458
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
1459
+
1460
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1461
+ <xsl:attribute name="margin-left">13mm</xsl:attribute>
1462
+ <xsl:attribute name="margin-right">12mm</xsl:attribute>
1463
+
1464
+
1465
+
1466
+
1467
+
1468
+
1469
+ </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
1470
+
1471
+ <xsl:attribute name="text-align">right</xsl:attribute>
1472
+ <xsl:attribute name="margin-right">25mm</xsl:attribute>
1473
+
1474
+
1475
+
1476
+ </xsl:attribute-set><xsl:attribute-set name="termsource-style">
1477
+
1478
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1479
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1480
+
1481
+
1482
+
1483
+
1484
+
1485
+ </xsl:attribute-set><xsl:attribute-set name="origin-style">
1486
+
1487
+
1488
+ <xsl:attribute name="color">blue</xsl:attribute>
1489
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1490
+
1491
+ </xsl:attribute-set><xsl:attribute-set name="term-style">
1492
+
1493
+ </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1494
+
1495
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1496
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1497
+ <xsl:attribute name="text-align">center</xsl:attribute>
1498
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1499
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1500
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1501
+
1502
+
1503
+
1504
+
1505
+
1506
+
1507
+
1508
+
1509
+
1510
+
1511
+
1512
+
1513
+
1514
+
1515
+
1516
+
1517
+ </xsl:attribute-set><xsl:attribute-set name="formula-style">
1518
+
1519
+ </xsl:attribute-set><xsl:attribute-set name="image-style">
1520
+ <xsl:attribute name="text-align">center</xsl:attribute>
1521
+
1522
+ <xsl:attribute name="space-before">12pt</xsl:attribute>
1523
+ <xsl:attribute name="space-after">6pt</xsl:attribute>
1524
+
1525
+
1526
+
1527
+
1528
+
1529
+ </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
1530
+
1531
+ </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
1532
+
1533
+ <xsl:attribute name="width">100%</xsl:attribute>
1534
+ <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
1535
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
1536
+
1537
+
1538
+
1539
+
1540
+
1541
+ </xsl:attribute-set><xsl:attribute-set name="tt-style">
1542
+
1543
+
1544
+ <xsl:attribute name="font-family">Courier</xsl:attribute>
1545
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1546
+
1547
+ </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
1548
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1549
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1550
+ <xsl:attribute name="text-align">center</xsl:attribute>
1551
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1552
+ </xsl:attribute-set><xsl:attribute-set name="domain-style">
1553
+
1554
+ </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1555
+
1556
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1557
+
1558
+
1559
+ </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1560
+
1561
+ </xsl:attribute-set><xsl:attribute-set name="definition-style">
1562
+
1563
+ <xsl:attribute name="space-after">6pt</xsl:attribute>
1564
+
1565
+
1566
+ </xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
1567
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1568
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1569
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
1570
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
1571
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
1572
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1573
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1574
+
1575
+ <!-- Normative references -->
1576
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
1577
+ <!-- Terms and definitions -->
1578
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
1579
+ <!-- Another main sections -->
1580
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
1581
+ <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1582
+ <!-- Bibliography -->
1583
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
1584
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1585
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1586
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
1587
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
1588
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
1589
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
1590
+ </xsl:template><xsl:template name="processMainSectionsDefault">
1591
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
1592
+
1593
+ <!-- Normative references -->
1594
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/>
1595
+ <!-- Terms and definitions -->
1596
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]"/>
1597
+ <!-- Another main sections -->
1598
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]"/>
1599
+ <xsl:apply-templates select="/*/*[local-name()='annex']"/>
1600
+ <!-- Bibliography -->
1601
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
1602
+ </xsl:template><xsl:template match="text()">
1603
+ <xsl:value-of select="."/>
1604
+ </xsl:template><xsl:template match="*[local-name()='br']">
1605
+ <xsl:value-of select="$linebreak"/>
1606
+ </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1607
+ <!-- <xsl:call-template name="add-zero-spaces"/> -->
1608
+ <xsl:call-template name="add-zero-spaces-java"/>
1609
+ </xsl:template><xsl:template match="*[local-name()='table']">
1610
+
1611
+ <xsl:variable name="simple-table">
1612
+ <xsl:call-template name="getSimpleTable"/>
1613
+ </xsl:variable>
1614
+
1615
+
1616
+
1617
+
1618
+
1619
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1620
+
1621
+
1622
+
1623
+ <xsl:call-template name="fn_name_display"/>
1624
+
1625
+
1626
+
1627
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1628
+
1629
+ <!-- <xsl:variable name="cols-count">
1630
+ <xsl:choose>
1631
+ <xsl:when test="*[local-name()='thead']">
1632
+ <xsl:call-template name="calculate-columns-numbers">
1633
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1634
+ </xsl:call-template>
1635
+ </xsl:when>
1636
+ <xsl:otherwise>
1637
+ <xsl:call-template name="calculate-columns-numbers">
1638
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1639
+ </xsl:call-template>
1640
+ </xsl:otherwise>
1641
+ </xsl:choose>
1642
+ </xsl:variable> -->
1643
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1644
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1645
+
1646
+
1647
+
1648
+ <xsl:variable name="colwidths">
1649
+ <xsl:call-template name="calculate-column-widths">
1650
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1651
+ <xsl:with-param name="table" select="$simple-table"/>
1652
+ </xsl:call-template>
1653
+ </xsl:variable>
1654
+
1655
+ <!-- <xsl:variable name="colwidths2">
1656
+ <xsl:call-template name="calculate-column-widths">
1657
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1658
+ </xsl:call-template>
1659
+ </xsl:variable> -->
1660
+
1661
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1662
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
1663
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1664
+
1665
+ <xsl:variable name="margin-left">
1666
+ <xsl:choose>
1667
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1668
+ <xsl:otherwise>0</xsl:otherwise>
1669
+ </xsl:choose>
1670
+ </xsl:variable>
1671
+
1672
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1673
+
1674
+
1675
+
1676
+
1677
+
1678
+
1679
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
1680
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
1681
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
1682
+
1683
+
1684
+
1685
+
1686
+ <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
1687
+
1688
+
1689
+
1690
+
1691
+
1692
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
1693
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2422
1694
 
2423
1695
 
2424
1696
 
2425
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1697
+
1698
+
1699
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1700
+
2426
1701
 
2427
1702
 
2428
1703
 
@@ -2450,34 +1725,15 @@
2450
1725
 
2451
1726
 
2452
1727
 
1728
+
1729
+
2453
1730
  </fo:block-container>
2454
- </xsl:template><xsl:template name="getTableNumber">
2455
- <xsl:choose>
2456
- <xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
2457
- <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true']"/>
2458
- </xsl:when>
2459
- <xsl:when test="ancestor::*[local-name()='annex']">
2460
-
2461
-
2462
-
2463
- <xsl:number format="A." count="*[local-name()='annex']"/><xsl:number format="1"/>
2464
-
2465
-
2466
-
2467
-
2468
-
2469
-
2470
- </xsl:when>
2471
- <xsl:otherwise>
2472
-
2473
-
2474
- <xsl:number format="A." count="*[local-name()='annex']"/>
2475
- <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']"/>
2476
-
2477
- </xsl:otherwise>
2478
- </xsl:choose>
2479
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']"/><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="process">
2480
- <xsl:apply-templates/>
1731
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1732
+ <xsl:if test="normalize-space() != ''">
1733
+ <fo:block xsl:use-attribute-sets="table-name-style">
1734
+ <xsl:apply-templates/>
1735
+ </fo:block>
1736
+ </xsl:if>
2481
1737
  </xsl:template><xsl:template name="calculate-columns-numbers">
2482
1738
  <xsl:param name="table-row"/>
2483
1739
  <xsl:variable name="columns-count" select="count($table-row/*)"/>
@@ -2695,6 +1951,16 @@
2695
1951
  </fo:table-row>
2696
1952
  </xsl:template><xsl:template match="*[local-name()='th']">
2697
1953
  <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
1954
+ <xsl:attribute name="text-align">
1955
+ <xsl:choose>
1956
+ <xsl:when test="@align">
1957
+ <xsl:value-of select="@align"/>
1958
+ </xsl:when>
1959
+ <xsl:otherwise>center</xsl:otherwise>
1960
+ </xsl:choose>
1961
+ </xsl:attribute>
1962
+
1963
+
2698
1964
 
2699
1965
 
2700
1966
 
@@ -2718,10 +1984,18 @@
2718
1984
  </fo:table-cell>
2719
1985
  </xsl:template><xsl:template match="*[local-name()='td']">
2720
1986
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
1987
+ <xsl:attribute name="text-align">
1988
+ <xsl:choose>
1989
+ <xsl:when test="@align">
1990
+ <xsl:value-of select="@align"/>
1991
+ </xsl:when>
1992
+ <xsl:otherwise>left</xsl:otherwise>
1993
+ </xsl:choose>
1994
+ </xsl:attribute>
2721
1995
 
2722
1996
 
2723
1997
 
2724
-
1998
+
2725
1999
 
2726
2000
 
2727
2001
 
@@ -2740,21 +2014,9 @@
2740
2014
  <fo:block>
2741
2015
 
2742
2016
  <xsl:apply-templates/>
2743
- </fo:block>
2744
- <!-- <xsl:choose>
2745
- <xsl:when test="count(*) = 1 and *[local-name() = 'p']">
2746
- <xsl:apply-templates />
2747
- </xsl:when>
2748
- <xsl:otherwise>
2749
- <fo:block>
2750
- <xsl:apply-templates />
2751
- </fo:block>
2752
- </xsl:otherwise>
2753
- </xsl:choose> -->
2754
-
2755
-
2017
+ </fo:block>
2756
2018
  </fo:table-cell>
2757
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
2019
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
2758
2020
 
2759
2021
 
2760
2022
  <fo:block font-size="10pt" margin-bottom="12pt">
@@ -2765,26 +2027,15 @@
2765
2027
  <fo:inline padding-right="2mm">
2766
2028
 
2767
2029
 
2768
- <xsl:variable name="title-note">
2769
- <xsl:call-template name="getTitle">
2770
- <xsl:with-param name="name" select="'title-note'"/>
2771
- </xsl:call-template>
2772
- </xsl:variable>
2773
- <xsl:value-of select="$title-note"/>
2774
2030
 
2775
- <xsl:variable name="id" select="ancestor::*[local-name() = 'table'][1]/@id"/>
2776
- <xsl:if test="count(//*[local-name()='note'][ancestor::*[@id = $id]]) &gt; 1">
2777
- <xsl:number count="*[local-name()='note'][ancestor::*[@id = $id]]" level="any"/>
2778
- </xsl:if>
2031
+
2032
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2779
2033
 
2780
-
2781
-
2782
-
2783
2034
  </fo:inline>
2784
2035
  <xsl:apply-templates mode="process"/>
2785
2036
  </fo:block>
2786
2037
 
2787
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
2038
+ </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">
2788
2039
  <xsl:apply-templates/>
2789
2040
  </xsl:template><xsl:template name="fn_display">
2790
2041
  <xsl:variable name="references">
@@ -2850,7 +2101,7 @@
2850
2101
  <!-- and (not(@class) or @class !='pseudocode') -->
2851
2102
  </xsl:variable>
2852
2103
  <xsl:variable name="references">
2853
- <xsl:for-each select=".//*[local-name()='fn']">
2104
+ <xsl:for-each select=".//*[local-name()='fn'][not(parent::*[local-name()='name'])]">
2854
2105
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2855
2106
  <xsl:apply-templates/>
2856
2107
  </fn>
@@ -3127,7 +2378,7 @@
3127
2378
  <xsl:value-of select="string-length(normalize-space(.))"/>
3128
2379
  </xsl:if>
3129
2380
  </xsl:for-each>
3130
- </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']">
2381
+ </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
3131
2382
  <xsl:param name="key_iso"/>
3132
2383
 
3133
2384
  <!-- <tr>
@@ -3143,12 +2394,7 @@
3143
2394
  <xsl:if test="normalize-space($key_iso) = 'true'">
3144
2395
  <xsl:attribute name="margin-top">0</xsl:attribute>
3145
2396
  </xsl:if>
3146
- <xsl:variable name="title-note">
3147
- <xsl:call-template name="getTitle">
3148
- <xsl:with-param name="name" select="'title-note'"/>
3149
- </xsl:call-template>
3150
- </xsl:variable>
3151
- <xsl:value-of select="$title-note"/>
2397
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3152
2398
  </fo:block>
3153
2399
  </fo:table-cell>
3154
2400
  <fo:table-cell>
@@ -3202,14 +2448,36 @@
3202
2448
  <fo:table-cell>
3203
2449
  <fo:block>
3204
2450
 
3205
-
2451
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2452
+ <xsl:if test="local-name(*[1]) != 'stem'">
2453
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2454
+ </xsl:if>
2455
+ </xsl:if> -->
3206
2456
 
3207
2457
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
3208
2458
 
3209
2459
  </fo:block>
3210
2460
  </fo:table-cell>
3211
2461
  </fo:table-row>
3212
-
2462
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2463
+ <xsl:if test="local-name(*[1]) = 'stem'">
2464
+ <fo:table-row>
2465
+ <fo:table-cell>
2466
+ <fo:block margin-top="6pt">
2467
+ <xsl:if test="normalize-space($key_iso) = 'true'">
2468
+ <xsl:attribute name="margin-top">0</xsl:attribute>
2469
+ </xsl:if>
2470
+ <xsl:text>&#xA0;</xsl:text>
2471
+ </fo:block>
2472
+ </fo:table-cell>
2473
+ <fo:table-cell>
2474
+ <fo:block>
2475
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2476
+ </fo:block>
2477
+ </fo:table-cell>
2478
+ </fo:table-row>
2479
+ </xsl:if>
2480
+ </xsl:if> -->
3213
2481
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
3214
2482
  <xsl:apply-templates/>
3215
2483
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
@@ -3220,7 +2488,7 @@
3220
2488
  <fo:inline font-style="italic">
3221
2489
  <xsl:apply-templates/>
3222
2490
  </fo:inline>
3223
- </xsl:template><xsl:template match="*[local-name()='strong']">
2491
+ </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
3224
2492
  <fo:inline font-weight="bold">
3225
2493
  <xsl:apply-templates/>
3226
2494
  </fo:inline>
@@ -3233,7 +2501,7 @@
3233
2501
  <xsl:apply-templates/>
3234
2502
  </fo:inline>
3235
2503
  </xsl:template><xsl:template match="*[local-name()='tt']">
3236
- <fo:inline font-family="Courier" font-size="10pt">
2504
+ <fo:inline xsl:use-attribute-sets="tt-style">
3237
2505
  <xsl:apply-templates/>
3238
2506
  </fo:inline>
3239
2507
  </xsl:template><xsl:template match="*[local-name()='del']">
@@ -3564,13 +2832,7 @@
3564
2832
  <xsl:copy-of select="."/>
3565
2833
  </fo:instream-foreign-object>
3566
2834
  </fo:inline>
3567
- </xsl:template><xsl:template match="*[local-name()='localityStack']">
3568
- <xsl:for-each select="*[local-name()='locality']">
3569
- <xsl:if test="position() =1"><xsl:text>, </xsl:text></xsl:if>
3570
- <xsl:apply-templates select="."/>
3571
- <xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if>
3572
- </xsl:for-each>
3573
- </xsl:template><xsl:template match="*[local-name()='link']" name="link">
2835
+ </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3574
2836
  <xsl:variable name="target">
3575
2837
  <xsl:choose>
3576
2838
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
@@ -3581,100 +2843,1054 @@
3581
2843
  </xsl:otherwise>
3582
2844
  </xsl:choose>
3583
2845
  </xsl:variable>
3584
- <fo:inline xsl:use-attribute-sets="link-style">
2846
+ <fo:inline xsl:use-attribute-sets="link-style">
2847
+ <xsl:choose>
2848
+ <xsl:when test="$target = ''">
2849
+ <xsl:apply-templates/>
2850
+ </xsl:when>
2851
+ <xsl:otherwise>
2852
+ <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
2853
+ <xsl:choose>
2854
+ <xsl:when test="normalize-space(.) = ''">
2855
+ <xsl:value-of select="$target"/>
2856
+ </xsl:when>
2857
+ <xsl:otherwise>
2858
+ <xsl:apply-templates/>
2859
+ </xsl:otherwise>
2860
+ </xsl:choose>
2861
+ </fo:basic-link>
2862
+ </xsl:otherwise>
2863
+ </xsl:choose>
2864
+ </fo:inline>
2865
+ </xsl:template><xsl:template match="*[local-name()='bookmark']">
2866
+ <fo:inline id="{@id}"/>
2867
+ </xsl:template><xsl:template match="*[local-name()='appendix']">
2868
+ <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
2869
+ <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
2870
+ </fo:block>
2871
+ <xsl:apply-templates/>
2872
+ </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
2873
+ <fo:inline><xsl:apply-templates/></fo:inline>
2874
+ </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
2875
+ <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
2876
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2877
+ </fo:block>
2878
+ <xsl:apply-templates/>
2879
+ </xsl:template><xsl:template match="*[local-name() = 'callout']">
2880
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
2881
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']">
2882
+ <xsl:variable name="annotation-id" select="@id"/>
2883
+ <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
2884
+ <fo:block id="{$annotation-id}" white-space="nowrap">
2885
+ <fo:inline>
2886
+ <xsl:apply-templates>
2887
+ <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
2888
+ </xsl:apply-templates>
2889
+ </fo:inline>
2890
+ </fo:block>
2891
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
2892
+ <xsl:param name="callout"/>
2893
+ <fo:inline id="{@id}">
2894
+ <!-- for first p in annotation, put <x> -->
2895
+ <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
2896
+ <xsl:apply-templates/>
2897
+ </fo:inline>
2898
+ </xsl:template><xsl:template match="*[local-name() = 'modification']">
2899
+ <xsl:variable name="title-modified">
2900
+ <xsl:call-template name="getTitle">
2901
+ <xsl:with-param name="name" select="'title-modified'"/>
2902
+ </xsl:call-template>
2903
+ </xsl:variable>
2904
+ <xsl:choose>
2905
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
2906
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
2907
+ </xsl:choose>
2908
+ <xsl:apply-templates/>
2909
+ </xsl:template><xsl:template match="*[local-name() = 'xref']">
2910
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2911
+
2912
+ <xsl:apply-templates/>
2913
+ </fo:basic-link>
2914
+ </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
2915
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2916
+ <xsl:apply-templates/>
2917
+ </fo:block>
2918
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
2919
+ <fo:inline>
2920
+ <xsl:apply-templates/>
2921
+ </fo:inline>
2922
+ </xsl:template><xsl:template match="*[local-name() = 'admitted']/*[local-name() = 'stem']">
2923
+ <fo:inline>
2924
+ <xsl:apply-templates/>
2925
+ </fo:inline>
2926
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="presentation">
2927
+ <xsl:if test="normalize-space() != ''">
2928
+ <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
2929
+ </xsl:if>
2930
+ </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
2931
+
2932
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
2933
+
2934
+
2935
+ <xsl:if test="ancestor::ogc:ul or ancestor::ogc:ol and not(ancestor::ogc:note[1]/following-sibling::*)">
2936
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2937
+ </xsl:if>
2938
+
2939
+
2940
+
2941
+ <fo:block-container margin-left="0mm">
2942
+
2943
+
2944
+
2945
+
2946
+
2947
+
2948
+
2949
+
2950
+ <fo:block>
2951
+
2952
+
2953
+
2954
+
2955
+ <fo:inline xsl:use-attribute-sets="note-name-style">
2956
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2957
+ </fo:inline>
2958
+ <xsl:apply-templates/>
2959
+ </fo:block>
2960
+
2961
+
2962
+ </fo:block-container>
2963
+ </fo:block-container>
2964
+
2965
+ </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
2966
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
2967
+ <xsl:choose>
2968
+ <xsl:when test="$num = 1">
2969
+ <fo:inline xsl:use-attribute-sets="note-p-style">
2970
+ <xsl:apply-templates/>
2971
+ </fo:inline>
2972
+ </xsl:when>
2973
+ <xsl:otherwise>
2974
+ <fo:block xsl:use-attribute-sets="note-p-style">
2975
+ <xsl:apply-templates/>
2976
+ </fo:block>
2977
+ </xsl:otherwise>
2978
+ </xsl:choose>
2979
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']">
2980
+ <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
2981
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2982
+ <xsl:apply-templates/>
2983
+ </fo:block>
2984
+ </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">
2985
+ <xsl:param name="sfx"/>
2986
+ <xsl:variable name="suffix">
2987
+ <xsl:choose>
2988
+ <xsl:when test="$sfx != ''">
2989
+ <xsl:value-of select="$sfx"/>
2990
+ </xsl:when>
2991
+ <xsl:otherwise>
2992
+
2993
+
2994
+ </xsl:otherwise>
2995
+ </xsl:choose>
2996
+ </xsl:variable>
2997
+ <xsl:if test="normalize-space() != ''">
2998
+ <xsl:apply-templates/>
2999
+ <xsl:value-of select="$suffix"/>
3000
+ </xsl:if>
3001
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']" mode="presentation">
3002
+ <xsl:param name="sfx"/>
3003
+ <xsl:variable name="suffix">
3004
+ <xsl:choose>
3005
+ <xsl:when test="$sfx != ''">
3006
+ <xsl:value-of select="$sfx"/>
3007
+ </xsl:when>
3008
+ <xsl:otherwise>
3009
+
3010
+ <xsl:text>:</xsl:text>
3011
+
3012
+
3013
+ </xsl:otherwise>
3014
+ </xsl:choose>
3015
+ </xsl:variable>
3016
+ <xsl:if test="normalize-space() != ''">
3017
+ <xsl:apply-templates/>
3018
+ <xsl:value-of select="$suffix"/>
3019
+ </xsl:if>
3020
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
3021
+ <fo:inline><xsl:apply-templates/></fo:inline>
3022
+ </xsl:template><xsl:template match="*[local-name() = 'terms']">
3023
+ <fo:block id="{@id}">
3024
+ <xsl:apply-templates/>
3025
+ </fo:block>
3026
+ </xsl:template><xsl:template match="*[local-name() = 'term']">
3027
+ <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
3028
+
3029
+
3030
+
3031
+ <xsl:apply-templates/>
3032
+ </fo:block>
3033
+ </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
3034
+ <xsl:if test="normalize-space() != ''">
3035
+ <fo:inline>
3036
+ <xsl:apply-templates/>
3037
+ <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
3038
+ <xsl:text>.</xsl:text>
3039
+ </xsl:if> -->
3040
+ </fo:inline>
3041
+ </xsl:if>
3042
+ </xsl:template><xsl:template match="*[local-name() = 'figure']">
3043
+ <fo:block-container id="{@id}">
3044
+ <fo:block>
3045
+ <xsl:apply-templates/>
3046
+ </fo:block>
3047
+ <xsl:call-template name="fn_display_figure"/>
3048
+ <xsl:for-each select="*[local-name() = 'note']">
3049
+ <xsl:call-template name="note"/>
3050
+ </xsl:for-each>
3051
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3052
+ </fo:block-container>
3053
+ </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
3054
+ <fo:block id="{@id}">
3055
+ <xsl:apply-templates/>
3056
+ </fo:block>
3057
+ </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
3058
+ <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
3059
+ <xsl:apply-templates/>
3060
+ </fo:block>
3061
+ </xsl:template><xsl:template match="*[local-name() = 'image']">
3062
+ <fo:block xsl:use-attribute-sets="image-style">
3063
+
3064
+
3065
+ <xsl:variable name="src">
3066
+ <xsl:choose>
3067
+ <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
3068
+ <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
3069
+ </xsl:when>
3070
+ <xsl:otherwise>
3071
+ <xsl:value-of select="@src"/>
3072
+ </xsl:otherwise>
3073
+ </xsl:choose>
3074
+ </xsl:variable>
3075
+
3076
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3077
+ </fo:block>
3078
+ </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">
3079
+ <xsl:apply-templates mode="contents"/>
3080
+ <xsl:text> </xsl:text>
3081
+ </xsl:template><xsl:template match="text()" mode="contents">
3082
+ <xsl:value-of select="."/>
3083
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3084
+ <xsl:if test="normalize-space() != ''">
3085
+ <fo:block xsl:use-attribute-sets="figure-name-style">
3086
+
3087
+ <xsl:apply-templates/>
3088
+ </fo:block>
3089
+ </xsl:if>
3090
+ </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">
3091
+ <xsl:apply-templates mode="contents_item"/>
3092
+ <!-- <xsl:text> </xsl:text> -->
3093
+ </xsl:template><xsl:template name="getSection">
3094
+ <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
3095
+ </xsl:template><xsl:template name="getName">
3096
+ <xsl:choose>
3097
+ <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
3098
+ <xsl:copy-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/following-sibling::node()"/>
3099
+ </xsl:when>
3100
+ <xsl:otherwise>
3101
+ <xsl:copy-of select="*[local-name() = 'title']/node()"/>
3102
+ </xsl:otherwise>
3103
+ </xsl:choose>
3104
+ </xsl:template><xsl:template name="insertTitleAsListItem">
3105
+ <xsl:param name="provisional-distance-between-starts" select="'9.5mm'"/>
3106
+ <xsl:variable name="section">
3107
+ <xsl:for-each select="..">
3108
+ <xsl:call-template name="getSection"/>
3109
+ </xsl:for-each>
3110
+ </xsl:variable>
3111
+ <fo:list-block provisional-distance-between-starts="{$provisional-distance-between-starts}">
3112
+ <fo:list-item>
3113
+ <fo:list-item-label end-indent="label-end()">
3114
+ <fo:block>
3115
+ <xsl:value-of select="$section"/>
3116
+ </fo:block>
3117
+ </fo:list-item-label>
3118
+ <fo:list-item-body start-indent="body-start()">
3119
+ <fo:block>
3120
+ <xsl:choose>
3121
+ <xsl:when test="*[local-name() = 'tab']">
3122
+ <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
3123
+ </xsl:when>
3124
+ <xsl:otherwise>
3125
+ <xsl:apply-templates/>
3126
+ </xsl:otherwise>
3127
+ </xsl:choose>
3128
+ </fo:block>
3129
+ </fo:list-item-body>
3130
+ </fo:list-item>
3131
+ </fo:list-block>
3132
+ </xsl:template><xsl:template name="extractTitle">
3133
+ <xsl:choose>
3134
+ <xsl:when test="*[local-name() = 'tab']">
3135
+ <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
3136
+ </xsl:when>
3137
+ <xsl:otherwise>
3138
+ <xsl:apply-templates/>
3139
+ </xsl:otherwise>
3140
+ </xsl:choose>
3141
+ </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">
3142
+ <xsl:text> </xsl:text>
3143
+ </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
3144
+ <xsl:copy>
3145
+ <xsl:apply-templates mode="contents_item"/>
3146
+ </xsl:copy>
3147
+ </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
3148
+ <xsl:text> </xsl:text>
3149
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
3150
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
3151
+ <xsl:apply-templates/>
3152
+ </fo:block>
3153
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3154
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()">
3155
+ <xsl:variable name="text">
3156
+ <xsl:call-template name="add-zero-spaces-equal"/>
3157
+ </xsl:variable>
3158
+ <xsl:call-template name="add-zero-spaces">
3159
+ <xsl:with-param name="text" select="$text"/>
3160
+ </xsl:call-template>
3161
+ </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
3162
+ <xsl:if test="normalize-space() != ''">
3163
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
3164
+
3165
+ <xsl:apply-templates/>
3166
+ </fo:block>
3167
+ </xsl:if>
3168
+ </xsl:template><xsl:template match="*[local-name() = 'permission']">
3169
+ <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
3170
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3171
+ <xsl:apply-templates/>
3172
+ </fo:block>
3173
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']" mode="presentation">
3174
+ <xsl:if test="normalize-space() != ''">
3175
+ <fo:block xsl:use-attribute-sets="permission-name-style">
3176
+ <xsl:apply-templates/>
3177
+
3178
+ <xsl:text>:</xsl:text>
3179
+
3180
+ </fo:block>
3181
+ </xsl:if>
3182
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'label']">
3183
+ <fo:block xsl:use-attribute-sets="permission-label-style">
3184
+ <xsl:apply-templates/>
3185
+ </fo:block>
3186
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']">
3187
+ <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
3188
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3189
+ <xsl:apply-templates select="*[local-name()='label']" mode="presentation"/>
3190
+ <xsl:apply-templates select="@obligation" mode="presentation"/>
3191
+ <xsl:apply-templates select="*[local-name()='subject']" mode="presentation"/>
3192
+ <xsl:apply-templates/>
3193
+ </fo:block>
3194
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']" mode="presentation">
3195
+ <xsl:if test="normalize-space() != ''">
3196
+ <fo:block xsl:use-attribute-sets="requirement-name-style">
3197
+
3198
+ <xsl:if test="../@type = 'class'">
3199
+ <xsl:attribute name="background-color">white</xsl:attribute>
3200
+ </xsl:if>
3201
+
3202
+ <xsl:apply-templates/>
3203
+
3204
+ <xsl:text>:</xsl:text>
3205
+
3206
+ </fo:block>
3207
+ </xsl:if>
3208
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']" mode="presentation">
3209
+ <fo:block xsl:use-attribute-sets="requirement-label-style">
3210
+ <xsl:apply-templates/>
3211
+ </fo:block>
3212
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation" mode="presentation">
3213
+ <fo:block>
3214
+ <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
3215
+ </fo:block>
3216
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
3217
+ <fo:block xsl:use-attribute-sets="requirement-subject-style">
3218
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
3219
+ </fo:block>
3220
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
3221
+ <fo:block xsl:use-attribute-sets="requirement-inherit-style">
3222
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
3223
+ </fo:block>
3224
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
3225
+ <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
3226
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3227
+ <xsl:apply-templates/>
3228
+ </fo:block>
3229
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']" mode="presentation">
3230
+ <xsl:if test="normalize-space() != ''">
3231
+ <fo:block xsl:use-attribute-sets="recommendation-name-style">
3232
+ <xsl:apply-templates/>
3233
+
3234
+ </fo:block>
3235
+ </xsl:if>
3236
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'label']">
3237
+ <fo:block xsl:use-attribute-sets="recommendation-label-style">
3238
+ <xsl:apply-templates/>
3239
+ </fo:block>
3240
+ </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3241
+ <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
3242
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3243
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
3244
+ </xsl:if>
3245
+ <fo:block-container margin-left="0mm" margin-right="0mm">
3246
+ <fo:table id="{@id}" table-layout="fixed" width="100%" border="1pt solid black">
3247
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3248
+ <xsl:attribute name="border">0.5pt solid black</xsl:attribute>
3249
+ </xsl:if>
3250
+ <xsl:variable name="simple-table">
3251
+ <xsl:call-template name="getSimpleTable"/>
3252
+ </xsl:variable>
3253
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
3254
+ <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
3255
+ <!-- <fo:table-column column-width="35mm"/>
3256
+ <fo:table-column column-width="115mm"/> -->
3257
+ <fo:table-column column-width="25%"/>
3258
+ <fo:table-column column-width="75%"/>
3259
+ </xsl:if>
3260
+ <xsl:apply-templates mode="requirement"/>
3261
+ </fo:table>
3262
+ <!-- fn processing -->
3263
+ <xsl:if test=".//*[local-name() = 'fn']">
3264
+ <xsl:for-each select="*[local-name() = 'tbody']">
3265
+ <fo:block font-size="90%" border-bottom="1pt solid black">
3266
+ <xsl:call-template name="fn_display"/>
3267
+ </fo:block>
3268
+ </xsl:for-each>
3269
+ </xsl:if>
3270
+ </fo:block-container>
3271
+ </fo:block-container>
3272
+ </xsl:template><xsl:template match="*[local-name()='thead']" mode="requirement">
3273
+ <fo:table-header>
3274
+ <xsl:apply-templates mode="requirement"/>
3275
+ </fo:table-header>
3276
+ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="requirement">
3277
+ <fo:table-body>
3278
+ <xsl:apply-templates mode="requirement"/>
3279
+ </fo:table-body>
3280
+ </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
3281
+ <fo:table-row height="7mm">
3282
+ <xsl:if test="parent::*[local-name()='thead'] and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission'])">
3283
+ <xsl:attribute name="border">1pt solid black</xsl:attribute>
3284
+ </xsl:if>
3285
+ <xsl:apply-templates mode="requirement"/>
3286
+ </fo:table-row>
3287
+ </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
3288
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black">
3289
+ <xsl:attribute name="text-align">
3290
+ <xsl:choose>
3291
+ <xsl:when test="@align">
3292
+ <xsl:value-of select="@align"/>
3293
+ </xsl:when>
3294
+ <xsl:otherwise>left</xsl:otherwise>
3295
+ </xsl:choose>
3296
+ </xsl:attribute>
3297
+ <xsl:if test="@colspan">
3298
+ <xsl:attribute name="number-columns-spanned">
3299
+ <xsl:value-of select="@colspan"/>
3300
+ </xsl:attribute>
3301
+ </xsl:if>
3302
+ <xsl:if test="@rowspan">
3303
+ <xsl:attribute name="number-rows-spanned">
3304
+ <xsl:value-of select="@rowspan"/>
3305
+ </xsl:attribute>
3306
+ </xsl:if>
3307
+
3308
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3309
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3310
+ <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
3311
+ </xsl:if>
3312
+ <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
3313
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3314
+ <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3315
+ </xsl:if> -->
3316
+
3317
+ <fo:block>
3318
+ <xsl:apply-templates/>
3319
+ </fo:block>
3320
+ </fo:table-cell>
3321
+ </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
3322
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black">
3323
+ <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3324
+ <xsl:attribute name="padding">0mm</xsl:attribute>
3325
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
3326
+ </xsl:if>
3327
+ <xsl:attribute name="text-align">
3328
+ <xsl:choose>
3329
+ <xsl:when test="@align">
3330
+ <xsl:value-of select="@align"/>
3331
+ </xsl:when>
3332
+ <xsl:otherwise>left</xsl:otherwise>
3333
+ </xsl:choose>
3334
+ </xsl:attribute>
3335
+ <xsl:if test="@colspan">
3336
+ <xsl:attribute name="number-columns-spanned">
3337
+ <xsl:value-of select="@colspan"/>
3338
+ </xsl:attribute>
3339
+ </xsl:if>
3340
+ <xsl:if test="@rowspan">
3341
+ <xsl:attribute name="number-rows-spanned">
3342
+ <xsl:value-of select="@rowspan"/>
3343
+ </xsl:attribute>
3344
+ </xsl:if>
3345
+
3346
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3347
+ <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
3348
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3349
+ <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
3350
+ <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3351
+ </xsl:if>
3352
+ </xsl:if> -->
3353
+ <!-- 2nd line and below -->
3354
+
3355
+ <fo:block>
3356
+ <xsl:apply-templates/>
3357
+ </fo:block>
3358
+ </fo:table-cell>
3359
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
3360
+ <fo:block font-size="11pt" font-weight="bold"> <!-- margin-bottom="4pt" text-align="center" -->
3361
+ <xsl:apply-templates/>
3362
+ </fo:block>
3363
+ </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
3364
+ <fo:block> <!-- margin-bottom="10pt" -->
3365
+ <xsl:apply-templates/>
3366
+ </fo:block>
3367
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']">
3368
+ <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
3369
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3370
+ <xsl:apply-templates/>
3371
+ </fo:block>
3372
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']" mode="presentation">
3373
+ <xsl:if test="normalize-space() != ''">
3374
+ <fo:inline xsl:use-attribute-sets="termexample-name-style">
3375
+ <xsl:apply-templates/>
3376
+ </fo:inline>
3377
+ </xsl:if>
3378
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
3379
+ <fo:inline><xsl:apply-templates/></fo:inline>
3380
+ </xsl:template><xsl:template match="*[local-name() = 'example']">
3381
+ <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
3382
+
3383
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3384
+
3385
+ <xsl:variable name="element">
3386
+ block
3387
+
3388
+ </xsl:variable>
3389
+
3390
+ <xsl:choose>
3391
+ <xsl:when test="normalize-space($element) = 'block'">
3392
+ <fo:block xsl:use-attribute-sets="example-body-style">
3393
+ <xsl:apply-templates/>
3394
+ </fo:block>
3395
+ </xsl:when>
3396
+ <xsl:otherwise>
3397
+ <fo:inline>
3398
+ <xsl:apply-templates/>
3399
+ </fo:inline>
3400
+ </xsl:otherwise>
3401
+ </xsl:choose>
3402
+
3403
+ </fo:block>
3404
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']" mode="presentation">
3405
+
3406
+ <xsl:variable name="element">
3407
+ block
3408
+
3409
+ </xsl:variable>
3410
+ <xsl:choose>
3411
+ <xsl:when test="ancestor::*[local-name() = 'appendix']">
3412
+ <fo:inline>
3413
+ <xsl:apply-templates/>
3414
+ </fo:inline>
3415
+ </xsl:when>
3416
+ <xsl:when test="normalize-space($element) = 'block'">
3417
+ <fo:block xsl:use-attribute-sets="example-name-style">
3418
+ <xsl:apply-templates/>
3419
+ </fo:block>
3420
+ </xsl:when>
3421
+ <xsl:otherwise>
3422
+ <fo:inline xsl:use-attribute-sets="example-name-style">
3423
+ <xsl:apply-templates/>
3424
+ </fo:inline>
3425
+ </xsl:otherwise>
3426
+ </xsl:choose>
3427
+
3428
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3429
+ <fo:block xsl:use-attribute-sets="example-p-style">
3430
+
3431
+ <xsl:apply-templates/>
3432
+ </fo:block>
3433
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']">
3434
+ <fo:block xsl:use-attribute-sets="termsource-style">
3435
+ <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
3436
+ <xsl:variable name="termsource_text">
3437
+ <xsl:apply-templates/>
3438
+ </xsl:variable>
3439
+ <xsl:choose>
3440
+ <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
3441
+ <xsl:apply-templates/>
3442
+ </xsl:when>
3443
+ <xsl:otherwise>
3444
+ <xsl:text>[</xsl:text>
3445
+ <xsl:apply-templates/>
3446
+ <xsl:text>]</xsl:text>
3447
+ </xsl:otherwise>
3448
+ </xsl:choose>
3449
+ </fo:block>
3450
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
3451
+ <xsl:if test="normalize-space() != ''">
3452
+ <xsl:value-of select="."/>
3453
+ </xsl:if>
3454
+ </xsl:template><xsl:template match="*[local-name() = 'origin']">
3455
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3456
+
3457
+ <xsl:call-template name="getTitle">
3458
+ <xsl:with-param name="name" select="'title-source'"/>
3459
+ </xsl:call-template>
3460
+ <xsl:text>: </xsl:text>
3461
+
3462
+ <fo:inline xsl:use-attribute-sets="origin-style">
3463
+ <xsl:apply-templates/>
3464
+ </fo:inline>
3465
+ </fo:basic-link>
3466
+ </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
3467
+ <fo:inline><xsl:apply-templates/></fo:inline>
3468
+ </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
3469
+ <xsl:if test="normalize-space() != ''">
3470
+ <xsl:value-of select="."/>
3471
+ </xsl:if>
3472
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
3473
+
3474
+ <fo:block xsl:use-attribute-sets="quote-style">
3475
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3476
+ </fo:block>
3477
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3478
+ <fo:block xsl:use-attribute-sets="quote-source-style">
3479
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
3480
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
3481
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
3482
+ </fo:block>
3483
+ </xsl:if>
3484
+ </xsl:template><xsl:template match="*[local-name() = 'source']">
3485
+ <xsl:if test="../*[local-name() = 'author']">
3486
+ <xsl:text>, </xsl:text>
3487
+ </xsl:if>
3488
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3489
+ <xsl:apply-templates/>
3490
+ </fo:basic-link>
3491
+ </xsl:template><xsl:template match="*[local-name() = 'author']">
3492
+ <xsl:text>— </xsl:text>
3493
+ <xsl:apply-templates/>
3494
+ </xsl:template><xsl:template match="*[local-name() = 'eref']">
3495
+ <fo:inline xsl:use-attribute-sets="eref-style">
3496
+ <xsl:if test="@type = 'footnote'">
3497
+
3498
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
3499
+ <xsl:attribute name="font-size">80%</xsl:attribute>
3500
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3501
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
3502
+
3503
+
3504
+ </xsl:if>
3505
+
3506
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3507
+
3508
+ <xsl:if test="@type = 'inline'">
3509
+
3510
+ <xsl:attribute name="color">blue</xsl:attribute>
3511
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
3512
+
3513
+
3514
+ </xsl:if>
3515
+
3516
+
3517
+ <xsl:apply-templates/>
3518
+ </fo:basic-link>
3519
+ </fo:inline>
3520
+ </xsl:template><xsl:template match="*[local-name() = 'tab']">
3521
+ <!-- zero-space char -->
3522
+ <xsl:variable name="depth">
3523
+ <xsl:call-template name="getLevel">
3524
+ <xsl:with-param name="depth" select="../@depth"/>
3525
+ </xsl:call-template>
3526
+ </xsl:variable>
3527
+
3528
+ <xsl:variable name="padding">
3529
+
3530
+
3531
+
3532
+
3533
+
3534
+
3535
+
3536
+
3537
+
3538
+
3539
+
3540
+
3541
+ <xsl:choose>
3542
+ <xsl:when test="$depth &gt;= 5"/>
3543
+ <xsl:when test="$depth &gt;= 4">5</xsl:when>
3544
+ <xsl:when test="$depth &gt;= 3 and ancestor::ogc:terms">3</xsl:when>
3545
+ <xsl:when test="$depth &gt;= 2">4</xsl:when>
3546
+ <xsl:when test="$depth = 1">4</xsl:when>
3547
+ <xsl:otherwise>2</xsl:otherwise>
3548
+ </xsl:choose>
3549
+
3550
+
3551
+
3552
+
3553
+
3554
+
3555
+ </xsl:variable>
3556
+
3557
+ <xsl:variable name="padding-right">
3558
+ <xsl:choose>
3559
+ <xsl:when test="normalize-space($padding) = ''">0</xsl:when>
3560
+ <xsl:otherwise>
3561
+ <xsl:value-of select="normalize-space($padding)"/>
3562
+ </xsl:otherwise>
3563
+ </xsl:choose>
3564
+ </xsl:variable>
3565
+
3566
+ <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3567
+
3568
+ <xsl:choose>
3569
+ <xsl:when test="$language = 'zh'">
3570
+ <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
3571
+ </xsl:when>
3572
+ <xsl:when test="../../@inline-header = 'true'">
3573
+ <fo:inline font-size="90%">
3574
+ <xsl:call-template name="insertNonBreakSpaces">
3575
+ <xsl:with-param name="count" select="$padding-right"/>
3576
+ </xsl:call-template>
3577
+ </fo:inline>
3578
+ </xsl:when>
3579
+ <xsl:otherwise>
3580
+ <fo:inline padding-right="{$padding-right}mm">​</fo:inline>
3581
+ </xsl:otherwise>
3582
+ </xsl:choose>
3583
+
3584
+ </xsl:template><xsl:template name="insertNonBreakSpaces">
3585
+ <xsl:param name="count"/>
3586
+ <xsl:if test="$count &gt; 0">
3587
+ <xsl:text> </xsl:text>
3588
+ <xsl:call-template name="insertNonBreakSpaces">
3589
+ <xsl:with-param name="count" select="$count - 1"/>
3590
+ </xsl:call-template>
3591
+ </xsl:if>
3592
+ </xsl:template><xsl:template match="*[local-name() = 'domain']">
3593
+ <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
3594
+ <xsl:text> </xsl:text>
3595
+ </xsl:template><xsl:template match="*[local-name() = 'admitted']">
3596
+ <fo:block xsl:use-attribute-sets="admitted-style">
3597
+ <xsl:apply-templates/>
3598
+ </fo:block>
3599
+ </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3600
+ <xsl:variable name="title-deprecated">
3601
+ <xsl:call-template name="getTitle">
3602
+ <xsl:with-param name="name" select="'title-deprecated'"/>
3603
+ </xsl:call-template>
3604
+ </xsl:variable>
3605
+ <fo:block xsl:use-attribute-sets="deprecates-style">
3606
+ <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
3607
+ </fo:block>
3608
+ </xsl:template><xsl:template match="*[local-name() = 'definition']">
3609
+ <fo:block xsl:use-attribute-sets="definition-style">
3610
+ <xsl:apply-templates/>
3611
+ </fo:block>
3612
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
3613
+ <xsl:apply-templates/>
3614
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
3615
+ <fo:inline> <xsl:apply-templates/></fo:inline>
3616
+ <fo:block> </fo:block>
3617
+ </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
3618
+
3619
+ <fo:block>
3620
+ <xsl:call-template name="setId"/>
3621
+
3622
+
3623
+
3624
+
3625
+
3626
+
3627
+
3628
+ <xsl:variable name="pos"><xsl:number count="ogc:sections/ogc:clause[not(@type='scope') and not(@type='conformance')]"/></xsl:variable> <!-- | ogc:sections/ogc:terms -->
3629
+ <xsl:if test="$pos &gt;= 2">
3630
+ <xsl:attribute name="space-before">18pt</xsl:attribute>
3631
+ </xsl:if>
3632
+
3633
+
3634
+
3635
+
3636
+ <xsl:apply-templates/>
3637
+ </fo:block>
3638
+
3639
+
3640
+
3641
+ </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
3642
+ <fo:block break-after="page"/>
3643
+ <fo:block>
3644
+ <xsl:call-template name="setId"/>
3645
+ <xsl:apply-templates/>
3646
+ </fo:block>
3647
+ </xsl:template><xsl:template match="*[local-name() = 'clause']">
3648
+ <fo:block>
3649
+ <xsl:call-template name="setId"/>
3650
+ <xsl:apply-templates/>
3651
+ </fo:block>
3652
+ </xsl:template><xsl:template match="*[local-name() = 'definitions']">
3653
+ <fo:block id="{@id}">
3654
+ <xsl:apply-templates/>
3655
+ </fo:block>
3656
+ </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
3657
+
3658
+ <fo:block id="{@id}">
3659
+ <xsl:apply-templates/>
3660
+ </fo:block>
3661
+ </xsl:template><xsl:template match="*[local-name() = 'annex']">
3662
+ <fo:block break-after="page"/>
3663
+ <fo:block id="{@id}">
3664
+
3665
+ </fo:block>
3666
+ <xsl:apply-templates/>
3667
+ </xsl:template><xsl:template match="*[local-name() = 'review']">
3668
+ <!-- comment 2019-11-29 -->
3669
+ <!-- <fo:block font-weight="bold">Review:</fo:block>
3670
+ <xsl:apply-templates /> -->
3671
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
3672
+ <!-- 0xA0 to space replacement -->
3673
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3674
+ </xsl:template><xsl:template match="*[local-name() = 'errata']">
3675
+ <!-- <row>
3676
+ <date>05-07-2013</date>
3677
+ <type>Editorial</type>
3678
+ <change>Changed CA-9 Priority Code from P1 to P2 in <xref target="tabled2"/>.</change>
3679
+ <pages>D-3</pages>
3680
+ </row>
3681
+ -->
3682
+ <fo:table table-layout="fixed" width="100%" font-size="10pt" border="1pt solid black">
3683
+ <fo:table-column column-width="20mm"/>
3684
+ <fo:table-column column-width="23mm"/>
3685
+ <fo:table-column column-width="107mm"/>
3686
+ <fo:table-column column-width="15mm"/>
3687
+ <fo:table-body>
3688
+ <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
3689
+ <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
3690
+ <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
3691
+ <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
3692
+ <fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell>
3693
+ </fo:table-row>
3694
+ <xsl:apply-templates/>
3695
+ </fo:table-body>
3696
+ </fo:table>
3697
+ </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']">
3698
+ <fo:table-row>
3699
+ <xsl:apply-templates/>
3700
+ </fo:table-row>
3701
+ </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*">
3702
+ <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
3703
+ <fo:block><xsl:apply-templates/></fo:block>
3704
+ </fo:table-cell>
3705
+ </xsl:template><xsl:template name="processBibitem">
3706
+
3585
3707
  <xsl:choose>
3586
- <xsl:when test="$target = ''">
3587
- <xsl:apply-templates/>
3708
+ <xsl:when test="*[local-name() = 'formattedref']">
3709
+ <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
3588
3710
  </xsl:when>
3589
3711
  <xsl:otherwise>
3590
- <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
3712
+ <xsl:variable name="personalAuthors">
3713
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'person']">
3714
+ <xsl:call-template name="processPersonalAuthor"/>
3715
+ </xsl:for-each>
3716
+ <xsl:if test="not(*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'person'])">
3717
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='editor']/*[local-name() = 'person']">
3718
+ <xsl:call-template name="processPersonalAuthor"/>
3719
+ </xsl:for-each>
3720
+ </xsl:if>
3721
+ </xsl:variable>
3722
+
3723
+ <xsl:variable name="city" select="*[local-name() = 'place']"/>
3724
+ <xsl:variable name="year">
3591
3725
  <xsl:choose>
3592
- <xsl:when test="normalize-space(.) = ''">
3593
- <xsl:value-of select="$target"/>
3726
+ <xsl:when test="*[local-name() = 'date'][@type = 'published']">
3727
+ <xsl:for-each select="*[local-name() = 'date'][@type = 'published']">
3728
+ <xsl:call-template name="renderDate"/>
3729
+ </xsl:for-each>
3730
+ </xsl:when>
3731
+ <xsl:when test="*[local-name() = 'date'][@type = 'issued']">
3732
+ <xsl:for-each select="*[local-name() = 'date'][@type = 'issued']">
3733
+ <xsl:call-template name="renderDate"/>
3734
+ </xsl:for-each>
3735
+ </xsl:when>
3736
+ <xsl:when test="*[local-name() = 'date'][@type = 'circulated']">
3737
+ <xsl:for-each select="*[local-name() = 'date'][@type = 'circulated']">
3738
+ <xsl:call-template name="renderDate"/>
3739
+ </xsl:for-each>
3594
3740
  </xsl:when>
3595
3741
  <xsl:otherwise>
3596
- <xsl:apply-templates/>
3742
+ <xsl:for-each select="*[local-name() = 'date']">
3743
+ <xsl:call-template name="renderDate"/>
3744
+ </xsl:for-each>
3597
3745
  </xsl:otherwise>
3598
3746
  </xsl:choose>
3599
- </fo:basic-link>
3747
+ </xsl:variable>
3748
+
3749
+ <xsl:variable name="uri" select="*[local-name() = 'uri']"/>
3750
+
3751
+
3752
+ <!-- citation structure:
3753
+ {personal names | organisation}: {document identifier}, {title}. {publisher}, {city} ({year})
3754
+ -->
3755
+
3756
+ <!-- Author(s) -->
3757
+ <xsl:choose>
3758
+ <xsl:when test="xalan:nodeset($personalAuthors)//author">
3759
+ <xsl:for-each select="xalan:nodeset($personalAuthors)//author">
3760
+ <xsl:apply-templates/>
3761
+ <xsl:if test="position() != last()">, </xsl:if>
3762
+ </xsl:for-each>
3763
+ <xsl:text>: </xsl:text>
3764
+ </xsl:when>
3765
+ <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'abbreviation']">
3766
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'abbreviation']">
3767
+ <xsl:value-of select="."/>
3768
+ <xsl:if test="position() != last()">/</xsl:if>
3769
+ </xsl:for-each>
3770
+ <xsl:text>: </xsl:text>
3771
+ </xsl:when>
3772
+ <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
3773
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
3774
+ <xsl:value-of select="."/>
3775
+ <xsl:if test="position() != last()">, </xsl:if>
3776
+ </xsl:for-each>
3777
+ <xsl:text>: </xsl:text>
3778
+ </xsl:when>
3779
+ </xsl:choose>
3780
+
3781
+
3782
+ <xsl:variable name="document_identifier">
3783
+ <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
3784
+ <xsl:choose>
3785
+ <xsl:when test="normalize-space($_doc_ident) != ''">
3786
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
3787
+ <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
3788
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
3789
+ </xsl:if>
3790
+ <xsl:value-of select="$_doc_ident"/>
3791
+ </xsl:when>
3792
+ <xsl:otherwise>
3793
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
3794
+ <xsl:if test="$type != ''">
3795
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
3796
+ </xsl:if>
3797
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
3798
+ </xsl:otherwise>
3799
+ </xsl:choose>
3800
+ </xsl:variable>
3801
+
3802
+ <xsl:value-of select="$document_identifier"/>
3803
+
3804
+ <xsl:apply-templates select="*[local-name() = 'note']"/>
3805
+
3806
+ <xsl:variable name="isDraft">
3807
+ <xsl:variable name="stage" select="normalize-space(*[local-name() = 'status']/*[local-name() = 'stage'])"/>
3808
+ <xsl:if test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization'][*[local-name() = 'name']/text() = 'Open Geospatial Consortium'] and $stage != '' and $stage != 'published' and $stage != 'deprecated' and $stage != 'retired'">true</xsl:if>
3809
+ </xsl:variable>
3810
+
3811
+ <xsl:if test="$isDraft = 'true'">
3812
+ <xsl:text> (Draft)</xsl:text>
3813
+ </xsl:if>
3814
+
3815
+ <xsl:text>, </xsl:text>
3816
+
3817
+ <xsl:choose>
3818
+ <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = 'en']">
3819
+ <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = 'en']"/>
3820
+ </xsl:when>
3821
+ <xsl:otherwise>
3822
+ <xsl:apply-templates select="*[local-name() = 'title']"/>
3823
+ </xsl:otherwise>
3824
+ </xsl:choose>
3825
+
3826
+ <xsl:text>. </xsl:text>
3827
+
3828
+ <xsl:if test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
3829
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
3830
+ <xsl:value-of select="."/>
3831
+ <xsl:if test="position() != last()">, </xsl:if>
3832
+ </xsl:for-each>
3833
+ <xsl:if test="normalize-space($city) != ''">, </xsl:if>
3834
+ </xsl:if>
3835
+
3836
+ <xsl:value-of select="$city"/>
3837
+
3838
+ <xsl:if test="(*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name'] or normalize-space($city) != '') and normalize-space($year) != ''">
3839
+ <xsl:text> </xsl:text>
3840
+ </xsl:if>
3841
+
3842
+ <xsl:if test="normalize-space($year) != ''">
3843
+ <xsl:text>(</xsl:text>
3844
+ <xsl:value-of select="$year"/>
3845
+ <xsl:text>). </xsl:text>
3846
+ </xsl:if>
3847
+
3848
+ <xsl:if test="normalize-space($uri) != ''">
3849
+ <xsl:text> </xsl:text>
3850
+ <fo:basic-link external-destination="{$uri}" fox:alt-text="{$uri}">
3851
+ <xsl:value-of select="$uri"/>
3852
+ </fo:basic-link>
3853
+ </xsl:if>
3854
+
3600
3855
  </xsl:otherwise>
3601
3856
  </xsl:choose>
3602
- </fo:inline>
3603
- </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
3604
- <fo:block xsl:use-attribute-sets="sourcecode-style">
3605
- <!-- <xsl:choose>
3606
- <xsl:when test="@lang = 'en'"></xsl:when>
3607
- <xsl:otherwise> -->
3608
- <xsl:attribute name="white-space">pre</xsl:attribute>
3609
- <xsl:attribute name="wrap-option">wrap</xsl:attribute>
3610
- <!-- </xsl:otherwise>
3611
- </xsl:choose> -->
3612
- <xsl:apply-templates/>
3613
- </fo:block>
3614
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
3615
- <fo:inline id="{@id}"/>
3616
- </xsl:template><xsl:template match="*[local-name()='appendix']">
3617
- <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
3618
- <xsl:variable name="title-appendix">
3619
- <xsl:call-template name="getTitle">
3620
- <xsl:with-param name="name" select="'title-appendix'"/>
3621
- </xsl:call-template>
3622
- </xsl:variable>
3623
- <fo:inline padding-right="5mm"><xsl:value-of select="$title-appendix"/> <xsl:number/></fo:inline>
3624
- <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
3625
- </fo:block>
3626
- <xsl:apply-templates/>
3627
- </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3628
- <fo:inline><xsl:apply-templates/></fo:inline>
3629
- </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']">
3630
- <fo:block xsl:use-attribute-sets="appendix-example-style">
3631
- <xsl:variable name="claims_id" select="ancestor::*[local-name()='clause'][1]/@id"/>
3632
- <xsl:variable name="title-example">
3633
- <xsl:call-template name="getTitle">
3634
- <xsl:with-param name="name" select="'title-example'"/>
3635
- </xsl:call-template>
3636
- </xsl:variable>
3637
- <xsl:value-of select="$title-example"/>
3638
- <xsl:if test="count(ancestor::*[local-name()='clause'][1]//*[local-name()='example']) &gt; 1">
3639
- <xsl:number count="*[local-name()='example'][ancestor::*[local-name()='clause'][@id = $claims_id]]" level="any"/><xsl:text> </xsl:text>
3640
- </xsl:if>
3641
- <xsl:if test="*[local-name()='name']">
3642
- <xsl:text>— </xsl:text><xsl:apply-templates select="*[local-name()='name']" mode="process"/>
3643
- </xsl:if>
3644
- </fo:block>
3645
- <xsl:apply-templates/>
3646
- </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']/*[local-name()='name']"/><xsl:template match="*[local-name()='appendix']//*[local-name()='example']/*[local-name()='name']" mode="process">
3647
- <fo:inline><xsl:apply-templates/></fo:inline>
3648
- </xsl:template><xsl:template match="*[local-name() = 'callout']">
3649
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
3650
- </xsl:template><xsl:template match="*[local-name() = 'annotation']">
3651
- <xsl:variable name="annotation-id" select="@id"/>
3652
- <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
3653
- <fo:block id="{$annotation-id}" white-space="nowrap">
3654
- <fo:inline>
3655
- <xsl:apply-templates>
3656
- <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
3657
- </xsl:apply-templates>
3658
- </fo:inline>
3659
- </fo:block>
3660
- </xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
3661
- <xsl:param name="callout"/>
3662
- <fo:inline id="{@id}">
3663
- <!-- for first p in annotation, put <x> -->
3664
- <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
3665
- <xsl:apply-templates/>
3666
- </fo:inline>
3667
- </xsl:template><xsl:template match="*[local-name() = 'modification']">
3668
- <xsl:variable name="title-modified">
3669
- <xsl:call-template name="getTitle">
3670
- <xsl:with-param name="name" select="'title-modified'"/>
3671
- </xsl:call-template>
3672
- </xsl:variable>
3857
+
3858
+ </xsl:template><xsl:template name="processPersonalAuthor">
3673
3859
  <xsl:choose>
3674
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3675
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
3860
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
3861
+ <author>
3862
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
3863
+ </author>
3864
+ </xsl:when>
3865
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
3866
+ <author>
3867
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3868
+ <xsl:text> </xsl:text>
3869
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
3870
+ </author>
3871
+ </xsl:when>
3872
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
3873
+ <author>
3874
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3875
+ <xsl:text> </xsl:text>
3876
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
3877
+ </author>
3878
+ </xsl:when>
3879
+ <xsl:otherwise>
3880
+ <xsl:apply-templates/>
3881
+ </xsl:otherwise>
3676
3882
  </xsl:choose>
3677
- <xsl:apply-templates/>
3883
+ </xsl:template><xsl:template name="renderDate">
3884
+ <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
3885
+ <xsl:value-of select="*[local-name() = 'on']"/>
3886
+ </xsl:if>
3887
+ <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
3888
+ <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
3889
+ </xsl:if>
3890
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
3891
+ <xsl:value-of select="translate(.,'. ','')"/>
3892
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
3893
+ <xsl:value-of select="substring(.,1,1)"/>
3678
3894
  </xsl:template><xsl:template name="convertDate">
3679
3895
  <xsl:param name="date"/>
3680
3896
  <xsl:param name="format" select="'short'"/>
@@ -3805,27 +4021,49 @@
3805
4021
  </xsl:otherwise>
3806
4022
  </xsl:choose>
3807
4023
  </xsl:template><xsl:template name="getLevel">
3808
- <xsl:variable name="level_total" select="count(ancestor::*)"/>
3809
- <xsl:variable name="level">
3810
- <xsl:choose>
3811
- <xsl:when test="ancestor::*[local-name() = 'preface']">
3812
- <xsl:value-of select="$level_total - 2"/>
3813
- </xsl:when>
3814
- <xsl:when test="ancestor::*[local-name() = 'sections']">
3815
- <xsl:value-of select="$level_total - 2"/>
3816
- </xsl:when>
3817
- <xsl:when test="ancestor::*[local-name() = 'bibliography']">
3818
- <xsl:value-of select="$level_total - 2"/>
3819
- </xsl:when>
3820
- <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
3821
- <xsl:otherwise>
3822
- <xsl:value-of select="$level_total - 1"/>
3823
- </xsl:otherwise>
3824
- </xsl:choose>
3825
- </xsl:variable>
3826
- <xsl:value-of select="$level"/>
3827
- </xsl:template><xsl:template name="getSubSection">
3828
- <xsl:number format=".1" level="multiple" count="*[local-name() = 'clause']/*[local-name() = 'clause'] | *[local-name() = 'clause']/*[local-name() = 'terms'] | *[local-name() = 'terms']/*[local-name() = 'term'] | *[local-name() = 'clause']/*[local-name() = 'term'] | *[local-name() = 'terms']/*[local-name() = 'clause'] | *[local-name() = 'terms']/*[local-name() = 'definitions'] | *[local-name() = 'definitions']/*[local-name() = 'clause'] | *[local-name() = 'clause']/*[local-name() = 'definitions'] | *[local-name() = 'definitions']/*[local-name() = 'definitions'] | *[local-name() = 'clause']/*[local-name() = 'references']"/>
4024
+ <xsl:param name="depth"/>
4025
+ <xsl:choose>
4026
+ <xsl:when test="normalize-space(@depth) != ''">
4027
+ <xsl:value-of select="@depth"/>
4028
+ </xsl:when>
4029
+ <xsl:when test="normalize-space($depth) != ''">
4030
+ <xsl:value-of select="$depth"/>
4031
+ </xsl:when>
4032
+ <xsl:otherwise>
4033
+ <xsl:variable name="level_total" select="count(ancestor::*)"/>
4034
+ <xsl:variable name="level">
4035
+ <xsl:choose>
4036
+ <xsl:when test="parent::*[local-name() = 'preface']">
4037
+ <xsl:value-of select="$level_total - 1"/>
4038
+ </xsl:when>
4039
+ <xsl:when test="ancestor::*[local-name() = 'preface']">
4040
+ <xsl:value-of select="$level_total - 2"/>
4041
+ </xsl:when>
4042
+ <!-- <xsl:when test="parent::*[local-name() = 'sections']">
4043
+ <xsl:value-of select="$level_total - 1"/>
4044
+ </xsl:when> -->
4045
+ <xsl:when test="ancestor::*[local-name() = 'sections']">
4046
+ <xsl:value-of select="$level_total - 1"/>
4047
+ </xsl:when>
4048
+ <xsl:when test="ancestor::*[local-name() = 'bibliography']">
4049
+ <xsl:value-of select="$level_total - 1"/>
4050
+ </xsl:when>
4051
+ <xsl:when test="parent::*[local-name() = 'annex']">
4052
+ <xsl:value-of select="$level_total - 1"/>
4053
+ </xsl:when>
4054
+ <xsl:when test="ancestor::*[local-name() = 'annex']">
4055
+ <xsl:value-of select="$level_total"/>
4056
+ </xsl:when>
4057
+ <xsl:when test="local-name() = 'annex'">1</xsl:when>
4058
+ <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
4059
+ <xsl:otherwise>
4060
+ <xsl:value-of select="$level_total - 1"/>
4061
+ </xsl:otherwise>
4062
+ </xsl:choose>
4063
+ </xsl:variable>
4064
+ <xsl:value-of select="$level"/>
4065
+ </xsl:otherwise>
4066
+ </xsl:choose>
3829
4067
  </xsl:template><xsl:template name="split">
3830
4068
  <xsl:param name="pText" select="."/>
3831
4069
  <xsl:param name="sep" select="','"/>
@@ -3840,4 +4078,47 @@
3840
4078
  </xsl:if>
3841
4079
  </xsl:template><xsl:template name="getDocumentId">
3842
4080
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
4081
+ </xsl:template><xsl:template name="namespaceCheck">
4082
+ <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
4083
+ <xsl:variable name="XSLNS">
4084
+
4085
+
4086
+
4087
+
4088
+
4089
+
4090
+ <xsl:value-of select="document('')//*/namespace::ogc"/>
4091
+
4092
+
4093
+
4094
+
4095
+
4096
+
4097
+
4098
+
4099
+ </xsl:variable>
4100
+ <xsl:if test="$documentNS != $XSLNS">
4101
+ <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
4102
+ </xsl:if>
4103
+ </xsl:template><xsl:template name="getLanguage">
4104
+ <xsl:param name="lang"/>
4105
+ <xsl:variable name="language" select="java:toLowerCase(java:java.lang.String.new($lang))"/>
4106
+ <xsl:choose>
4107
+ <xsl:when test="$language = 'en'">English</xsl:when>
4108
+ <xsl:when test="$language = 'fr'">French</xsl:when>
4109
+ <xsl:when test="$language = 'de'">Deutsch</xsl:when>
4110
+ <xsl:when test="$language = 'cn'">Chinese</xsl:when>
4111
+ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
4112
+ </xsl:choose>
4113
+ </xsl:template><xsl:template name="setId">
4114
+ <xsl:attribute name="id">
4115
+ <xsl:choose>
4116
+ <xsl:when test="@id">
4117
+ <xsl:value-of select="@id"/>
4118
+ </xsl:when>
4119
+ <xsl:otherwise>
4120
+ <xsl:value-of select="generate-id()"/>
4121
+ </xsl:otherwise>
4122
+ </xsl:choose>
4123
+ </xsl:attribute>
3843
4124
  </xsl:template></xsl:stylesheet>