metanorma-ogc 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2421990413977914ea161a6565552ab89b79410f8565c55c2e075a47d67c23e
4
- data.tar.gz: 84d00c4e381efc9fe62e9b1d9d66950f63133b92e559d7297282afdd4af20ab3
3
+ metadata.gz: 43f8c82b7c051c4ce9974cc59fd04888e7db9e8b770de76b4e9e9515e8560039
4
+ data.tar.gz: 1f2eb9c0ac27f25ba414ba90c5fa68ef9c633e1222db6ffc040c2b8b6d29cd26
5
5
  SHA512:
6
- metadata.gz: cf9c21efa5e92165362d868acb0dd12db79c99ec47251e49807234641ff06d71161525d06620a9c941471a9fad6ec8ff1133e629de6a88c2382bc8def66235c1
7
- data.tar.gz: a25fe7ef0b9a0db87259fd02683499906a8736e8b97f87973a6173ec25ab201cfb20e44099964a22c1e09d5797f8260b5d2d1e3f8bf7d5e90f253048cccc22a9
6
+ metadata.gz: 0f28e6bce33b702a3dfac144e92e712e92a10e13e37ad906f51a21bd238340502055fb23e8922c9314b3ff7aba4a78825effeaa4a0b7072e013bee82d35b237e
7
+ data.tar.gz: e1faf7484dcdbfaeb41fd394f3cbae90009d5cffe7dd72e54c271fa36e2d6d5586ec280bdf35f4b6bb028409ce55e72f30cfb87268ea36378d528488df67c735
data/Rakefile CHANGED
@@ -1,6 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
+ require 'isodoc/gem_tasks'
3
4
 
5
+ IsoDoc::GemTasks.install
4
6
  RSpec::Core::RakeTask.new(:spec)
5
7
 
6
8
  task :default => :spec
@@ -1153,4 +1153,3 @@ ol
1153
1153
  ul
1154
1154
  {margin-bottom:0cm;
1155
1155
  margin-left:18pt;}
1156
-
@@ -18,7 +18,7 @@
18
18
  <xsl:text>© </xsl:text>
19
19
  <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:copyright/ogc:from"/>
20
20
  <xsl:text> </xsl:text>
21
- <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor/ogc:organization/ogc:name"/>
21
+ <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type = 'publisher']/ogc:organization/ogc:name"/>
22
22
  </xsl:variable>
23
23
 
24
24
  <xsl:variable name="doctitle" select="/ogc:ogc-standard/ogc:bibdata/ogc:title[@language = 'en']"/>
@@ -47,6 +47,7 @@
47
47
  </xsl:apply-templates>
48
48
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:foreword" mode="contents">
49
49
  <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ 1"/>
50
+
50
51
  </xsl:apply-templates>
51
52
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:introduction" mode="contents"/>
52
53
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name" mode="contents">
@@ -56,6 +57,12 @@
56
57
  <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ count(/ogc:ogc-standard/ogc:preface/ogc:foreword) + count(/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name) + 1"/>
57
58
  </xsl:apply-templates>
58
59
 
60
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'submitters']" mode="contents">
61
+ <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ count(/ogc:ogc-standard/ogc:preface/ogc:foreword) + count(/ogc:ogc-standard/ogc:preface/ogc:introduction) + count(/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name) + count(/ogc:ogc-standard/ogc:preface/ogc:submitters)"/>
62
+ </xsl:apply-templates>
63
+
64
+
65
+
59
66
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']" mode="contents">
60
67
  <xsl:with-param name="sectionNum" select="'1'"/>
61
68
  </xsl:apply-templates>
@@ -65,22 +72,22 @@
65
72
  </xsl:apply-templates>
66
73
 
67
74
  <!-- Normative references -->
68
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references']" mode="contents">
75
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']" mode="contents">
69
76
  <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + 1"/>
70
77
  </xsl:apply-templates>
71
78
 
72
79
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:terms" mode="contents"> <!-- Terms and definitions -->
73
- <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references']) + 1"/>
80
+ <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']) + 1"/>
74
81
  </xsl:apply-templates>
75
82
 
76
83
 
77
84
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/*[local-name() != 'terms' and not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]" mode="contents">
78
- <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references']) + count(/ogc:ogc-standard/ogc:sections/ogc:terms)"/>
85
+ <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']) + count(/ogc:ogc-standard/ogc:sections/ogc:terms)"/>
79
86
  </xsl:apply-templates>
80
87
 
81
88
 
82
89
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:annex" mode="contents"/>
83
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id != '_normative_references' and @id != '_references']" mode="contents"/> <!-- [position() &gt; 1] -->
90
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']" mode="contents"/> <!-- [position() &gt; 1] -->
84
91
 
85
92
 
86
93
  </contents>
@@ -91,7 +98,7 @@
91
98
  </xsl:variable>
92
99
 
93
100
  <xsl:template match="/">
94
- <xsl:message>INFO: Document namespace: '<xsl:value-of select="namespace-uri(/*)"/>'</xsl:message>
101
+ <xsl:call-template name="namespaceCheck"/>
95
102
  <fo:root font-family="Times New Roman, STIX2Math, HanSans" font-size="10.5pt" xml:lang="{$lang}">
96
103
  <fo:layout-master-set>
97
104
  <!-- Cover page -->
@@ -237,7 +244,7 @@
237
244
  </fo:block>
238
245
  </fo:block>
239
246
  <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"/>
247
+ <xsl:value-of select="$doctitle"/>
241
248
  </fo:block>
242
249
  <fo:block margin-bottom="12pt"> </fo:block>
243
250
  <!-- Copyright notice -->
@@ -250,6 +257,16 @@
250
257
  <fo:table-column column-width="35mm"/>
251
258
  <fo:table-column column-width="70mm"/>
252
259
  <fo:table-body>
260
+ <fo:table-row height="9mm">
261
+ <fo:table-cell>
262
+ <fo:block>Document number: </fo:block>
263
+ </fo:table-cell>
264
+ <fo:table-cell>
265
+ <fo:block>
266
+ <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:docnumber"/>
267
+ </fo:block>
268
+ </fo:table-cell>
269
+ </fo:table-row>
253
270
  <fo:table-row height="9mm">
254
271
  <fo:table-cell>
255
272
  <fo:block>Document type: </fo:block>
@@ -258,6 +275,18 @@
258
275
  <fo:block line-height-shift-adjustment="disregard-shifts">OGC<fo:inline font-size="65%" vertical-align="super">®</fo:inline><xsl:text> </xsl:text><xsl:value-of select="$doctype"/></fo:block>
259
276
  </fo:table-cell>
260
277
  </fo:table-row>
278
+ <fo:table-row height="9mm">
279
+ <fo:table-cell>
280
+ <fo:block>Document subtype: </fo:block>
281
+ </fo:table-cell>
282
+ <fo:table-cell>
283
+ <fo:block>
284
+ <xsl:call-template name="capitalizeWords">
285
+ <xsl:with-param name="str" select="/ogc:ogc-standard/ogc:bibdata/ogc:ext/ogc:docsubtype"/>
286
+ </xsl:call-template>
287
+ </fo:block>
288
+ </fo:table-cell>
289
+ </fo:table-row>
261
290
  <fo:table-row height="9mm">
262
291
  <fo:table-cell>
263
292
  <fo:block>Document stage: </fo:block>
@@ -276,7 +305,11 @@
276
305
  <fo:block>Document language: </fo:block>
277
306
  </fo:table-cell>
278
307
  <fo:table-cell>
279
- <fo:block><xsl:value-of select="$lang"/></fo:block>
308
+ <fo:block>
309
+ <xsl:call-template name="getLanguage">
310
+ <xsl:with-param name="lang" select="$lang"/>
311
+ </xsl:call-template>
312
+ </fo:block>
280
313
  </fo:table-cell>
281
314
  </fo:table-row>
282
315
  </fo:table-body>
@@ -312,7 +345,7 @@
312
345
  <fo:block> </fo:block>
313
346
  <fo:block break-after="page"/>
314
347
 
315
- <fo:block-container font-weight="bold" line-height="115%">
348
+ <fo:block-container font-weight="bold" line-height="115%" margin-bottom="36pt">
316
349
  <xsl:variable name="title-toc">
317
350
  <xsl:call-template name="getTitle">
318
351
  <xsl:with-param name="name" select="'title-toc'"/>
@@ -437,6 +470,10 @@
437
470
  <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ count(/ogc:ogc-standard/ogc:preface/ogc:foreword) + count(/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name) + 1"/>
438
471
  </xsl:apply-templates>
439
472
 
473
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'submitters']">
474
+ <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ count(/ogc:ogc-standard/ogc:preface/ogc:foreword) + count(/ogc:ogc-standard/ogc:preface/ogc:introduction) + count(/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name) + count(/ogc:ogc-standard/ogc:preface/ogc:submitters)"/>
475
+ </xsl:apply-templates>
476
+
440
477
 
441
478
  </fo:flow>
442
479
  </fo:page-sequence>
@@ -468,22 +505,22 @@
468
505
  </xsl:apply-templates>
469
506
 
470
507
  <!-- Normative references -->
471
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references']">
508
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']">
472
509
  <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + 1"/>
473
510
  </xsl:apply-templates>
474
511
 
475
512
  <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"/>
513
+ <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']) + 1"/>
477
514
  </xsl:apply-templates>
478
515
 
479
516
 
480
517
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/*[local-name() != 'terms' and not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]">
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)"/>
518
+ <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']) + count(/ogc:ogc-standard/ogc:sections/ogc:terms)"/>
482
519
  </xsl:apply-templates>
483
520
 
484
521
 
485
522
  <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] -->
523
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']"/> <!-- [position() &gt; 1] -->
487
524
 
488
525
  </fo:block>
489
526
  </fo:flow>
@@ -558,6 +595,25 @@
558
595
  </xsl:apply-templates>
559
596
  </xsl:template>
560
597
 
598
+ <xsl:template match="ogc:ogc-standard/ogc:preface/ogc:clause" mode="contents">
599
+ <xsl:param name="sectionNum"/>
600
+ <xsl:param name="sectionNumSkew" select="0"/>
601
+ <xsl:variable name="sectionNum_">
602
+ <xsl:choose>
603
+ <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
604
+ <xsl:when test="$sectionNumSkew != 0">
605
+ <xsl:variable name="number"><xsl:number count="ogc:clause"/></xsl:variable>
606
+ <xsl:value-of select="$number + $sectionNumSkew"/>
607
+ </xsl:when>
608
+ <xsl:otherwise>
609
+ <xsl:number count="*"/>
610
+ </xsl:otherwise>
611
+ </xsl:choose>
612
+ </xsl:variable>
613
+ <xsl:apply-templates mode="contents">
614
+ <xsl:with-param name="sectionNum" select="$sectionNum_"/>
615
+ </xsl:apply-templates>
616
+ </xsl:template>
561
617
 
562
618
  <!-- Any node with title element - clause, definition, annex,... -->
563
619
  <xsl:template match="ogc:title | ogc:preferred" mode="contents">
@@ -620,7 +676,7 @@
620
676
 
621
677
  </xsl:template>
622
678
 
623
- <xsl:template match="ogc:ogc-standard/ogc:preface/*" mode="contents">
679
+ <xsl:template match="ogc:ogc-standard/ogc:preface/*[not(local-name() = 'clause')]" mode="contents">
624
680
  <xsl:param name="sectionNum" select="'1'"/>
625
681
  <xsl:variable name="section">
626
682
  <xsl:number format="i" value="$sectionNum"/>
@@ -727,7 +783,6 @@
727
783
  </xsl:template>
728
784
 
729
785
 
730
-
731
786
  <xsl:template match="ogc:table[not(@unnumbered='true')]" mode="contents">
732
787
  <xsl:param name="sectionNum"/>
733
788
  <xsl:variable name="annex-id" select="ancestor::ogc:annex/@id"/>
@@ -828,7 +883,7 @@
828
883
  <xsl:attribute name="text-align">
829
884
  <xsl:choose>
830
885
  <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
831
- <xsl:otherwise>left</xsl:otherwise>
886
+ <xsl:otherwise>center</xsl:otherwise>
832
887
  </xsl:choose>
833
888
  </xsl:attribute>
834
889
  <xsl:apply-templates/>
@@ -908,7 +963,9 @@
908
963
  </xsl:call-template>
909
964
  </fo:block>
910
965
  </xsl:if>
911
- <xsl:apply-templates/>
966
+ <xsl:apply-templates>
967
+ <xsl:with-param name="sectionNum" select="$sectionNum"/>
968
+ </xsl:apply-templates>
912
969
  </xsl:template>
913
970
  <!-- Keywords -->
914
971
  <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:keyword">
@@ -996,6 +1053,25 @@
996
1053
  </fo:block>
997
1054
  </xsl:template>
998
1055
 
1056
+ <xsl:template match="ogc:ogc-standard/ogc:preface/ogc:clause">
1057
+ <xsl:param name="sectionNum"/>
1058
+ <xsl:param name="sectionNumSkew" select="0"/>
1059
+ <xsl:variable name="sectionNum_">
1060
+ <xsl:choose>
1061
+ <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
1062
+ <xsl:when test="$sectionNumSkew != 0">
1063
+ <xsl:variable name="number"><xsl:number count="ogc:clause"/></xsl:variable>
1064
+ <xsl:value-of select="$number + $sectionNumSkew"/>
1065
+ </xsl:when>
1066
+ <xsl:otherwise>
1067
+ <xsl:number count="*"/>
1068
+ </xsl:otherwise>
1069
+ </xsl:choose>
1070
+ </xsl:variable>
1071
+ <xsl:apply-templates>
1072
+ <xsl:with-param name="sectionNum" select="$sectionNum_"/>
1073
+ </xsl:apply-templates>
1074
+ </xsl:template>
999
1075
 
1000
1076
 
1001
1077
  <xsl:template match="ogc:clause//ogc:clause[not(ogc:title)]">
@@ -1535,7 +1611,7 @@
1535
1611
 
1536
1612
 
1537
1613
  <!-- [position() &gt; 1] -->
1538
- <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references']">
1614
+ <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']">
1539
1615
  <fo:block break-after="page"/>
1540
1616
  <fo:block line-height="120%">
1541
1617
  <xsl:apply-templates/>
@@ -1545,7 +1621,7 @@
1545
1621
 
1546
1622
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
1547
1623
  <!-- <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">
1624
+ <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']/ogc:bibitem">
1549
1625
  <fo:list-block margin-bottom="12pt" provisional-distance-between-starts="12mm">
1550
1626
  <fo:list-item>
1551
1627
  <fo:list-item-label end-indent="label-end()">
@@ -1618,10 +1694,10 @@
1618
1694
  </xsl:template>
1619
1695
 
1620
1696
  <!-- <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"/>
1697
+ <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']/ogc:bibitem" mode="contents"/>
1622
1698
 
1623
1699
  <!-- <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">
1700
+ <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']/ogc:bibitem/ogc:title">
1625
1701
  <fo:inline font-style="italic">
1626
1702
  <xsl:apply-templates/>
1627
1703
  </fo:inline>
@@ -1747,7 +1823,7 @@
1747
1823
  <xsl:template match="ogc:sourcecode/ogc:name"/>
1748
1824
 
1749
1825
  <xsl:template match="ogc:example">
1750
- <fo:block font-size="10pt" margin-top="12pt" margin-bottom="12pt" font-weight="bold" keep-with-next="always">
1826
+ <fo:block font-size="10pt" text-align="center" margin-top="12pt" margin-bottom="12pt" font-weight="bold" keep-with-next="always">
1751
1827
  <xsl:variable name="title-example">
1752
1828
  <xsl:call-template name="getTitle">
1753
1829
  <xsl:with-param name="name" select="'title-example'"/>
@@ -1906,7 +1982,6 @@
1906
1982
  </fo:block>
1907
1983
  </xsl:template>
1908
1984
 
1909
-
1910
1985
  <xsl:template match="ogc:br" priority="2">
1911
1986
  <!-- <fo:block>&#xA0;</fo:block> -->
1912
1987
  <xsl:value-of select="$linebreak"/>
@@ -2047,12 +2122,13 @@
2047
2122
  </xsl:when>
2048
2123
  <xsl:when test="ancestor::ogc:preface"> <!-- if preface and there is clause(s) -->
2049
2124
  <xsl:choose>
2050
- <xsl:when test="$level = 1 and ..//ogc:clause">0</xsl:when>
2125
+ <xsl:when test="$level = 1"> <!-- and ancestor::ogc:foreword -->
2126
+ <xsl:number format="i" value="$sectionNum"/>
2127
+ </xsl:when>
2128
+ <!-- <xsl:when test="$level = 1 and ..//ogc:clause">0</xsl:when> -->
2051
2129
  <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)"/>
2130
+ <xsl:number format="i.1" level="multiple" count="ogc:clause"/>
2131
+ <!-- <xsl:value-of select="concat('0', $num)"/> -->
2056
2132
  </xsl:when>
2057
2133
  <xsl:otherwise>
2058
2134
  <!-- z<xsl:value-of select="$sectionNum"/>z -->
@@ -2765,6 +2841,7 @@
2765
2841
  <fo:inline padding-right="2mm">
2766
2842
 
2767
2843
 
2844
+
2768
2845
  <xsl:variable name="title-note">
2769
2846
  <xsl:call-template name="getTitle">
2770
2847
  <xsl:with-param name="name" select="'title-note'"/>
@@ -3840,4 +3917,35 @@
3840
3917
  </xsl:if>
3841
3918
  </xsl:template><xsl:template name="getDocumentId">
3842
3919
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
3920
+ </xsl:template><xsl:template name="namespaceCheck">
3921
+ <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
3922
+ <xsl:variable name="XSLNS">
3923
+
3924
+
3925
+
3926
+
3927
+
3928
+
3929
+ <xsl:value-of select="document('')//*/namespace::ogc"/>
3930
+
3931
+
3932
+
3933
+
3934
+
3935
+
3936
+
3937
+ </xsl:variable>
3938
+ <xsl:if test="$documentNS != $XSLNS">
3939
+ <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
3940
+ </xsl:if>
3941
+ </xsl:template><xsl:template name="getLanguage">
3942
+ <xsl:param name="lang"/>
3943
+ <xsl:variable name="language" select="java:toLowerCase(java:java.lang.String.new($lang))"/>
3944
+ <xsl:choose>
3945
+ <xsl:when test="$language = 'en'">English</xsl:when>
3946
+ <xsl:when test="$language = 'fr'">French</xsl:when>
3947
+ <xsl:when test="$language = 'de'">Deutsch</xsl:when>
3948
+ <xsl:when test="$language = 'cn'">Chinese</xsl:when>
3949
+ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
3950
+ </xsl:choose>
3843
3951
  </xsl:template></xsl:stylesheet>
@@ -18,7 +18,7 @@
18
18
  <xsl:text>© </xsl:text>
19
19
  <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:copyright/ogc:from"/>
20
20
  <xsl:text> </xsl:text>
21
- <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor/ogc:organization/ogc:name"/>
21
+ <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type = 'publisher']/ogc:organization/ogc:name"/>
22
22
  </xsl:variable>
23
23
 
24
24
  <xsl:variable name="doctitle" select="/ogc:ogc-standard/ogc:bibdata/ogc:title[@language = 'en']"/>
@@ -47,6 +47,7 @@
47
47
  </xsl:apply-templates>
48
48
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:foreword" mode="contents">
49
49
  <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ 1"/>
50
+
50
51
  </xsl:apply-templates>
51
52
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:introduction" mode="contents"/>
52
53
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name" mode="contents">
@@ -56,6 +57,12 @@
56
57
  <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ count(/ogc:ogc-standard/ogc:preface/ogc:foreword) + count(/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name) + 1"/>
57
58
  </xsl:apply-templates>
58
59
 
60
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'submitters']" mode="contents">
61
+ <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ count(/ogc:ogc-standard/ogc:preface/ogc:foreword) + count(/ogc:ogc-standard/ogc:preface/ogc:introduction) + count(/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name) + count(/ogc:ogc-standard/ogc:preface/ogc:submitters)"/>
62
+ </xsl:apply-templates>
63
+
64
+
65
+
59
66
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']" mode="contents">
60
67
  <xsl:with-param name="sectionNum" select="'1'"/>
61
68
  </xsl:apply-templates>
@@ -65,22 +72,22 @@
65
72
  </xsl:apply-templates>
66
73
 
67
74
  <!-- Normative references -->
68
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references']" mode="contents">
75
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']" mode="contents">
69
76
  <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + 1"/>
70
77
  </xsl:apply-templates>
71
78
 
72
79
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:terms" mode="contents"> <!-- Terms and definitions -->
73
- <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references']) + 1"/>
80
+ <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']) + 1"/>
74
81
  </xsl:apply-templates>
75
82
 
76
83
 
77
84
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/*[local-name() != 'terms' and not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]" mode="contents">
78
- <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references']) + count(/ogc:ogc-standard/ogc:sections/ogc:terms)"/>
85
+ <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']) + count(/ogc:ogc-standard/ogc:sections/ogc:terms)"/>
79
86
  </xsl:apply-templates>
80
87
 
81
88
 
82
89
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:annex" mode="contents"/>
83
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id != '_normative_references' and @id != '_references']" mode="contents"/> <!-- [position() &gt; 1] -->
90
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']" mode="contents"/> <!-- [position() &gt; 1] -->
84
91
 
85
92
 
86
93
  </contents>
@@ -91,7 +98,7 @@
91
98
  </xsl:variable>
92
99
 
93
100
  <xsl:template match="/">
94
- <xsl:message>INFO: Document namespace: '<xsl:value-of select="namespace-uri(/*)"/>'</xsl:message>
101
+ <xsl:call-template name="namespaceCheck"/>
95
102
  <fo:root font-family="Times New Roman, STIX2Math, HanSans" font-size="10.5pt" xml:lang="{$lang}">
96
103
  <fo:layout-master-set>
97
104
  <!-- Cover page -->
@@ -237,7 +244,7 @@
237
244
  </fo:block>
238
245
  </fo:block>
239
246
  <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"/>
247
+ <xsl:value-of select="$doctitle"/>
241
248
  </fo:block>
242
249
  <fo:block margin-bottom="12pt"> </fo:block>
243
250
  <!-- Copyright notice -->
@@ -250,6 +257,16 @@
250
257
  <fo:table-column column-width="35mm"/>
251
258
  <fo:table-column column-width="70mm"/>
252
259
  <fo:table-body>
260
+ <fo:table-row height="9mm">
261
+ <fo:table-cell>
262
+ <fo:block>Document number: </fo:block>
263
+ </fo:table-cell>
264
+ <fo:table-cell>
265
+ <fo:block>
266
+ <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:docnumber"/>
267
+ </fo:block>
268
+ </fo:table-cell>
269
+ </fo:table-row>
253
270
  <fo:table-row height="9mm">
254
271
  <fo:table-cell>
255
272
  <fo:block>Document type: </fo:block>
@@ -258,6 +275,18 @@
258
275
  <fo:block line-height-shift-adjustment="disregard-shifts">OGC<fo:inline font-size="65%" vertical-align="super">®</fo:inline><xsl:text> </xsl:text><xsl:value-of select="$doctype"/></fo:block>
259
276
  </fo:table-cell>
260
277
  </fo:table-row>
278
+ <fo:table-row height="9mm">
279
+ <fo:table-cell>
280
+ <fo:block>Document subtype: </fo:block>
281
+ </fo:table-cell>
282
+ <fo:table-cell>
283
+ <fo:block>
284
+ <xsl:call-template name="capitalizeWords">
285
+ <xsl:with-param name="str" select="/ogc:ogc-standard/ogc:bibdata/ogc:ext/ogc:docsubtype"/>
286
+ </xsl:call-template>
287
+ </fo:block>
288
+ </fo:table-cell>
289
+ </fo:table-row>
261
290
  <fo:table-row height="9mm">
262
291
  <fo:table-cell>
263
292
  <fo:block>Document stage: </fo:block>
@@ -276,7 +305,11 @@
276
305
  <fo:block>Document language: </fo:block>
277
306
  </fo:table-cell>
278
307
  <fo:table-cell>
279
- <fo:block><xsl:value-of select="$lang"/></fo:block>
308
+ <fo:block>
309
+ <xsl:call-template name="getLanguage">
310
+ <xsl:with-param name="lang" select="$lang"/>
311
+ </xsl:call-template>
312
+ </fo:block>
280
313
  </fo:table-cell>
281
314
  </fo:table-row>
282
315
  </fo:table-body>
@@ -312,7 +345,7 @@
312
345
  <fo:block> </fo:block>
313
346
  <fo:block break-after="page"/>
314
347
 
315
- <fo:block-container font-weight="bold" line-height="115%">
348
+ <fo:block-container font-weight="bold" line-height="115%" margin-bottom="36pt">
316
349
  <xsl:variable name="title-toc">
317
350
  <xsl:call-template name="getTitle">
318
351
  <xsl:with-param name="name" select="'title-toc'"/>
@@ -437,6 +470,10 @@
437
470
  <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ count(/ogc:ogc-standard/ogc:preface/ogc:foreword) + count(/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name) + 1"/>
438
471
  </xsl:apply-templates>
439
472
 
473
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'submitters']">
474
+ <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ count(/ogc:ogc-standard/ogc:preface/ogc:foreword) + count(/ogc:ogc-standard/ogc:preface/ogc:introduction) + count(/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name) + count(/ogc:ogc-standard/ogc:preface/ogc:submitters)"/>
475
+ </xsl:apply-templates>
476
+
440
477
 
441
478
  </fo:flow>
442
479
  </fo:page-sequence>
@@ -468,22 +505,22 @@
468
505
  </xsl:apply-templates>
469
506
 
470
507
  <!-- Normative references -->
471
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references']">
508
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']">
472
509
  <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + 1"/>
473
510
  </xsl:apply-templates>
474
511
 
475
512
  <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"/>
513
+ <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']) + 1"/>
477
514
  </xsl:apply-templates>
478
515
 
479
516
 
480
517
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/*[local-name() != 'terms' and not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]">
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)"/>
518
+ <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']) + count(/ogc:ogc-standard/ogc:sections/ogc:terms)"/>
482
519
  </xsl:apply-templates>
483
520
 
484
521
 
485
522
  <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] -->
523
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']"/> <!-- [position() &gt; 1] -->
487
524
 
488
525
  </fo:block>
489
526
  </fo:flow>
@@ -558,6 +595,25 @@
558
595
  </xsl:apply-templates>
559
596
  </xsl:template>
560
597
 
598
+ <xsl:template match="ogc:ogc-standard/ogc:preface/ogc:clause" mode="contents">
599
+ <xsl:param name="sectionNum"/>
600
+ <xsl:param name="sectionNumSkew" select="0"/>
601
+ <xsl:variable name="sectionNum_">
602
+ <xsl:choose>
603
+ <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
604
+ <xsl:when test="$sectionNumSkew != 0">
605
+ <xsl:variable name="number"><xsl:number count="ogc:clause"/></xsl:variable>
606
+ <xsl:value-of select="$number + $sectionNumSkew"/>
607
+ </xsl:when>
608
+ <xsl:otherwise>
609
+ <xsl:number count="*"/>
610
+ </xsl:otherwise>
611
+ </xsl:choose>
612
+ </xsl:variable>
613
+ <xsl:apply-templates mode="contents">
614
+ <xsl:with-param name="sectionNum" select="$sectionNum_"/>
615
+ </xsl:apply-templates>
616
+ </xsl:template>
561
617
 
562
618
  <!-- Any node with title element - clause, definition, annex,... -->
563
619
  <xsl:template match="ogc:title | ogc:preferred" mode="contents">
@@ -620,7 +676,7 @@
620
676
 
621
677
  </xsl:template>
622
678
 
623
- <xsl:template match="ogc:ogc-standard/ogc:preface/*" mode="contents">
679
+ <xsl:template match="ogc:ogc-standard/ogc:preface/*[not(local-name() = 'clause')]" mode="contents">
624
680
  <xsl:param name="sectionNum" select="'1'"/>
625
681
  <xsl:variable name="section">
626
682
  <xsl:number format="i" value="$sectionNum"/>
@@ -727,7 +783,6 @@
727
783
  </xsl:template>
728
784
 
729
785
 
730
-
731
786
  <xsl:template match="ogc:table[not(@unnumbered='true')]" mode="contents">
732
787
  <xsl:param name="sectionNum"/>
733
788
  <xsl:variable name="annex-id" select="ancestor::ogc:annex/@id"/>
@@ -828,7 +883,7 @@
828
883
  <xsl:attribute name="text-align">
829
884
  <xsl:choose>
830
885
  <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
831
- <xsl:otherwise>left</xsl:otherwise>
886
+ <xsl:otherwise>center</xsl:otherwise>
832
887
  </xsl:choose>
833
888
  </xsl:attribute>
834
889
  <xsl:apply-templates/>
@@ -908,7 +963,9 @@
908
963
  </xsl:call-template>
909
964
  </fo:block>
910
965
  </xsl:if>
911
- <xsl:apply-templates/>
966
+ <xsl:apply-templates>
967
+ <xsl:with-param name="sectionNum" select="$sectionNum"/>
968
+ </xsl:apply-templates>
912
969
  </xsl:template>
913
970
  <!-- Keywords -->
914
971
  <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:keyword">
@@ -996,6 +1053,25 @@
996
1053
  </fo:block>
997
1054
  </xsl:template>
998
1055
 
1056
+ <xsl:template match="ogc:ogc-standard/ogc:preface/ogc:clause">
1057
+ <xsl:param name="sectionNum"/>
1058
+ <xsl:param name="sectionNumSkew" select="0"/>
1059
+ <xsl:variable name="sectionNum_">
1060
+ <xsl:choose>
1061
+ <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
1062
+ <xsl:when test="$sectionNumSkew != 0">
1063
+ <xsl:variable name="number"><xsl:number count="ogc:clause"/></xsl:variable>
1064
+ <xsl:value-of select="$number + $sectionNumSkew"/>
1065
+ </xsl:when>
1066
+ <xsl:otherwise>
1067
+ <xsl:number count="*"/>
1068
+ </xsl:otherwise>
1069
+ </xsl:choose>
1070
+ </xsl:variable>
1071
+ <xsl:apply-templates>
1072
+ <xsl:with-param name="sectionNum" select="$sectionNum_"/>
1073
+ </xsl:apply-templates>
1074
+ </xsl:template>
999
1075
 
1000
1076
 
1001
1077
  <xsl:template match="ogc:clause//ogc:clause[not(ogc:title)]">
@@ -1535,7 +1611,7 @@
1535
1611
 
1536
1612
 
1537
1613
  <!-- [position() &gt; 1] -->
1538
- <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references']">
1614
+ <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']">
1539
1615
  <fo:block break-after="page"/>
1540
1616
  <fo:block line-height="120%">
1541
1617
  <xsl:apply-templates/>
@@ -1545,7 +1621,7 @@
1545
1621
 
1546
1622
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
1547
1623
  <!-- <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">
1624
+ <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']/ogc:bibitem">
1549
1625
  <fo:list-block margin-bottom="12pt" provisional-distance-between-starts="12mm">
1550
1626
  <fo:list-item>
1551
1627
  <fo:list-item-label end-indent="label-end()">
@@ -1618,10 +1694,10 @@
1618
1694
  </xsl:template>
1619
1695
 
1620
1696
  <!-- <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"/>
1697
+ <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']/ogc:bibitem" mode="contents"/>
1622
1698
 
1623
1699
  <!-- <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">
1700
+ <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']/ogc:bibitem/ogc:title">
1625
1701
  <fo:inline font-style="italic">
1626
1702
  <xsl:apply-templates/>
1627
1703
  </fo:inline>
@@ -1747,7 +1823,7 @@
1747
1823
  <xsl:template match="ogc:sourcecode/ogc:name"/>
1748
1824
 
1749
1825
  <xsl:template match="ogc:example">
1750
- <fo:block font-size="10pt" margin-top="12pt" margin-bottom="12pt" font-weight="bold" keep-with-next="always">
1826
+ <fo:block font-size="10pt" text-align="center" margin-top="12pt" margin-bottom="12pt" font-weight="bold" keep-with-next="always">
1751
1827
  <xsl:variable name="title-example">
1752
1828
  <xsl:call-template name="getTitle">
1753
1829
  <xsl:with-param name="name" select="'title-example'"/>
@@ -1906,7 +1982,6 @@
1906
1982
  </fo:block>
1907
1983
  </xsl:template>
1908
1984
 
1909
-
1910
1985
  <xsl:template match="ogc:br" priority="2">
1911
1986
  <!-- <fo:block>&#xA0;</fo:block> -->
1912
1987
  <xsl:value-of select="$linebreak"/>
@@ -2047,12 +2122,13 @@
2047
2122
  </xsl:when>
2048
2123
  <xsl:when test="ancestor::ogc:preface"> <!-- if preface and there is clause(s) -->
2049
2124
  <xsl:choose>
2050
- <xsl:when test="$level = 1 and ..//ogc:clause">0</xsl:when>
2125
+ <xsl:when test="$level = 1"> <!-- and ancestor::ogc:foreword -->
2126
+ <xsl:number format="i" value="$sectionNum"/>
2127
+ </xsl:when>
2128
+ <!-- <xsl:when test="$level = 1 and ..//ogc:clause">0</xsl:when> -->
2051
2129
  <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)"/>
2130
+ <xsl:number format="i.1" level="multiple" count="ogc:clause"/>
2131
+ <!-- <xsl:value-of select="concat('0', $num)"/> -->
2056
2132
  </xsl:when>
2057
2133
  <xsl:otherwise>
2058
2134
  <!-- z<xsl:value-of select="$sectionNum"/>z -->
@@ -2765,6 +2841,7 @@
2765
2841
  <fo:inline padding-right="2mm">
2766
2842
 
2767
2843
 
2844
+
2768
2845
  <xsl:variable name="title-note">
2769
2846
  <xsl:call-template name="getTitle">
2770
2847
  <xsl:with-param name="name" select="'title-note'"/>
@@ -3840,4 +3917,35 @@
3840
3917
  </xsl:if>
3841
3918
  </xsl:template><xsl:template name="getDocumentId">
3842
3919
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
3920
+ </xsl:template><xsl:template name="namespaceCheck">
3921
+ <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
3922
+ <xsl:variable name="XSLNS">
3923
+
3924
+
3925
+
3926
+
3927
+
3928
+
3929
+ <xsl:value-of select="document('')//*/namespace::ogc"/>
3930
+
3931
+
3932
+
3933
+
3934
+
3935
+
3936
+
3937
+ </xsl:variable>
3938
+ <xsl:if test="$documentNS != $XSLNS">
3939
+ <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
3940
+ </xsl:if>
3941
+ </xsl:template><xsl:template name="getLanguage">
3942
+ <xsl:param name="lang"/>
3943
+ <xsl:variable name="language" select="java:toLowerCase(java:java.lang.String.new($lang))"/>
3944
+ <xsl:choose>
3945
+ <xsl:when test="$language = 'en'">English</xsl:when>
3946
+ <xsl:when test="$language = 'fr'">French</xsl:when>
3947
+ <xsl:when test="$language = 'de'">Deutsch</xsl:when>
3948
+ <xsl:when test="$language = 'cn'">Chinese</xsl:when>
3949
+ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
3950
+ </xsl:choose>
3843
3951
  </xsl:template></xsl:stylesheet>