metanorma-ogc 1.0.9 → 1.1.0

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: 03f9f62da65c53f1c3642b819ca4d736cbdc94374acc379ceb1de60280ef91e6
4
- data.tar.gz: 94b9c283c453dbda58e9fd6b8ba7294e2238a8f72fbc07e68e9ce1bf62bbdf27
3
+ metadata.gz: c9414ccffb628182f075ac6cb325a701e3e467ec9f63e39b6dc34ffcaf292267
4
+ data.tar.gz: 813fed6e91b026a7fd2086fd881df0c8ce71398e96eb25e86d8666d90f8bde60
5
5
  SHA512:
6
- metadata.gz: 163148c85ab9d85778b4af7b91d297f6e6885118037a063e84678d8d30904ea6c74112ac8d517c91a4a7ceea9509ebb902bb9b6af69aef43b9dc6c68e146bbd2
7
- data.tar.gz: 6a6dfed692bab95234941cb46cba2dc8581acec8ac21a5c8a68e40419b320a2ee0f475eb7c0cccf5f238b60e6f15dbf5d35fc4e4d29beb54ef895019f1ffe077
6
+ metadata.gz: 92d1bc132ea6ba8fe709b3be9987032b5d07f49578ca0f47d18559f06376dd8d4f5473e10c64e25b9f888bdec005bfa165f6829bdde41260cc95392f566a4a68
7
+ data.tar.gz: 76b456a146b61ba58161226ca05ac9da0f2159ac9bfb2f97bef9012f709880b11a936fd10f07f0d50b8be48c476a8d23d23193de4cc4196f92669972cc9b1c39
@@ -52,21 +52,12 @@ module Asciidoctor
52
52
  end
53
53
  end
54
54
 
55
- def document(node)
56
- init(node)
57
- ret1 = makexml(node)
58
- ret = ret1.to_xml(indent: 2)
59
- unless node.attr("nodoc") || !node.attr("docfile")
60
- filename = node.attr("docfile").gsub(/\.adoc/, ".xml").
61
- gsub(%r{^.*/}, "")
62
- File.open(filename, "w") { |f| f.write(ret) }
63
- html_converter(node).convert filename unless node.attr("nodoc")
64
- word_converter(node).convert filename unless node.attr("nodoc")
65
- pdf_converter(node)&.convert filename unless node.attr("nodoc")
66
- end
67
- @log.write(@localdir + @filename + ".err") unless @novalid
68
- @files_to_delete.each { |f| FileUtils.rm f }
69
- ret
55
+ def outputs(node, ret)
56
+ File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
57
+ presentation_xml_converter(node).convert(@filename + ".xml")
58
+ html_converter(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}.html")
59
+ doc_converter(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}.doc")
60
+ pdf_converter(node)&.convert(@filename + ".presentation.xml", nil, false, "#{@filename}.pdf")
70
61
  end
71
62
 
72
63
  def validate(doc)
@@ -118,6 +109,10 @@ module Asciidoctor
118
109
  super
119
110
  end
120
111
 
112
+ def presentation_xml_converter(node)
113
+ IsoDoc::Ogc::PresentationXMLConvert.new(html_extract_attributes(node))
114
+ end
115
+
121
116
  def html_converter(node)
122
117
  IsoDoc::Ogc::HtmlConvert.new(html_extract_attributes(node))
123
118
  end
@@ -127,7 +122,7 @@ module Asciidoctor
127
122
  IsoDoc::Ogc::PdfConvert.new(html_extract_attributes(node))
128
123
  end
129
124
 
130
- def word_converter(node)
125
+ def doc_converter(node)
131
126
  IsoDoc::Ogc::WordConvert.new(doc_extract_attributes(node))
132
127
  end
133
128
  end
@@ -2,6 +2,8 @@ require "isodoc/ogc/metadata"
2
2
  require "isodoc/ogc/html_convert"
3
3
  require "isodoc/ogc/pdf_convert"
4
4
  require "isodoc/ogc/word_convert"
5
+ require "isodoc/ogc/presentation_xml_convert"
6
+ require "isodoc/ogc/xref"
5
7
 
6
8
  module IsoDoc
7
9
  module Ogc
@@ -8,6 +8,14 @@ require "fileutils"
8
8
  module IsoDoc
9
9
  module Ogc
10
10
  module BaseConvert
11
+ def metadata_init(lang, script, labels)
12
+ @meta = Metadata.new(lang, script, labels)
13
+ end
14
+
15
+ def xref_init(lang, script, klass, labels, options)
16
+ @xrefs = Xref.new(lang, script, klass, labels, options)
17
+ end
18
+
11
19
  def fileloc(loc)
12
20
  File.join(File.dirname(__FILE__), loc)
13
21
  end
@@ -55,19 +63,6 @@ module IsoDoc
55
63
  super.merge(y)
56
64
  end
57
65
 
58
- def preface_names_numbered(clause)
59
- return if clause.nil?
60
- @prefacenum += 1
61
- pref = RomanNumerals.to_roman(@prefacenum).downcase
62
- @anchors[clause["id"]] =
63
- { label: pref,
64
- level: 1, xref: preface_clause_name(clause), type: "clause" }
65
- clause.xpath(ns("./clause | ./terms | ./term | ./definitions | "\
66
- "./references")).each_with_index do |c, i|
67
- section_names1(c, "#{pref}.#{i + 1}", 2)
68
- end
69
- end
70
-
71
66
  def example_parse(node, out)
72
67
  name = node.at(ns("./name"))
73
68
  example_name_parse(node, out, name) #if name
@@ -78,7 +73,7 @@ module IsoDoc
78
73
  end
79
74
 
80
75
  def example_name_parse(node, div, name)
81
- lbl = anchor(node['id'], :label, false)
76
+ lbl = @xrefs.anchor(node['id'], :label, false)
82
77
  div.p **{ class: "SourceTitle", style: "text-align:center;" } do |p|
83
78
  lbl.nil? or p << l10n("#{@example_lbl} #{lbl}")
84
79
  name and !lbl.nil? and p << "&nbsp;&mdash; "
@@ -86,48 +81,9 @@ module IsoDoc
86
81
  end
87
82
  end
88
83
 
89
- def initial_anchor_names(d)
90
- @prefacenum = 0
91
- preface_names_numbered(d.at(ns("//preface/abstract")))
92
- @prefacenum += 1 if d.at(ns("//keyword"))
93
- preface_names_numbered(d.at(ns("//foreword")))
94
- preface_names_numbered(d.at(ns("//introduction")))
95
- @prefacenum += 1 if d.at(ns(SUBMITTINGORGS))
96
- preface_names_numbered(d.at(ns("//submitters")))
97
- d.xpath(ns("//preface/clause")).each do |c|
98
- preface_names_numbered(c)
99
- end
100
- preface_names_numbered(d.at(ns("//acknowledgements")))
101
- sequential_asset_names(d.xpath(ns(
102
- "//preface/abstract | //foreword | //introduction | "\
103
- "//submitters | //acknowledgements | //preface/clause")))
104
- n = section_names(d.at(ns("//clause[title = 'Scope']")), 0, 1)
105
- n = section_names(d.at(ns("//clause[title = 'Conformance']")), n, 1)
106
- n = section_names(d.at(ns(
107
- "//references[title = 'Normative References' or "\
108
- "title = 'Normative references']")), n, 1)
109
- n = section_names(
110
- d.at(ns("//sections/terms | //sections/clause[descendant::terms]")),
111
- n, 1)
112
- n = section_names(d.at(ns("//sections/definitions")), n, 1)
113
- middle_section_asset_names(d)
114
- clause_names(d, n)
115
- termnote_anchor_names(d)
116
- termexample_anchor_names(d)
117
- end
118
-
119
- MIDDLE_CLAUSE =
84
+ def middle_clause
120
85
  "//clause[parent::sections][not(xmlns:title = 'Scope' or "\
121
- "xmlns:title = 'Conformance')][not(descendant::terms)]".freeze
122
-
123
- def middle_section_asset_names(d)
124
- middle_sections = "//clause[title = 'Scope' or title = 'Conformance'] "\
125
- "| //foreword | //introduction | //preface/abstract | "\
126
- "//submitters | //acknowledgements | //preface/clause | "\
127
- "//references[title = 'Normative References' or title = "\
128
- "'Normative references'] | //sections/terms | "\
129
- "//sections/definitions | //clause[parent::sections]"
130
- sequential_asset_names(d.xpath(ns(middle_sections)))
86
+ "xmlns:title = 'Conformance')][not(descendant::terms)]"
131
87
  end
132
88
 
133
89
  def middle(isoxml, out)
@@ -12,7 +12,6 @@ module IsoDoc
12
12
  class HtmlConvert < IsoDoc::HtmlConvert
13
13
  def initialize(options)
14
14
  @libdir = File.dirname(__FILE__)
15
- @reqtlabels = {}
16
15
  super
17
16
  end
18
17
 
@@ -33,10 +32,6 @@ module IsoDoc
33
32
  }
34
33
  end
35
34
 
36
- def metadata_init(lang, script, labels)
37
- @meta = Metadata.new(lang, script, labels)
38
- end
39
-
40
35
  def googlefonts
41
36
  <<~HEAD.freeze
42
37
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet" />
@@ -1,4 +1,4 @@
1
- <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ogc="https://www.metanorma.org/ns/ogc" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" version="1.0">
1
+ <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ogc="https://www.metanorma.org/ns/ogc" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:java="http://xml.apache.org/xalan/java" exclude-result-prefixes="java" version="1.0">
2
2
 
3
3
  <xsl:output version="1.0" method="xml" encoding="UTF-8" indent="no"/>
4
4
 
@@ -161,44 +161,7 @@
161
161
 
162
162
  </fo:layout-master-set>
163
163
 
164
- <fo:declarations>
165
- <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
166
- <pdf:dictionary type="normal" key="ViewerPreferences">
167
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
168
- </pdf:dictionary>
169
- </pdf:catalog>
170
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
171
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
172
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
173
- <!-- Dublin Core properties go here -->
174
- <dc:title>
175
- <xsl:choose>
176
- <xsl:when test="$doctitle != ''">
177
- <xsl:value-of select="$doctitle"/>
178
- </xsl:when>
179
- <xsl:otherwise>
180
- <xsl:text> </xsl:text>
181
- </xsl:otherwise>
182
- </xsl:choose>
183
- </dc:title>
184
- <dc:creator/>
185
- <dc:description>
186
- <xsl:variable name="abstract">
187
- <xsl:copy-of select="/ogc:ogc-standard/ogc:bibdata/ogc:abstract//text()"/>
188
- </xsl:variable>
189
- <xsl:value-of select="normalize-space($abstract)"/>
190
- </dc:description>
191
- <pdf:Keywords>
192
- <xsl:call-template name="insertKeywords"/>
193
- </pdf:Keywords>
194
- </rdf:Description>
195
- <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
196
- <!-- XMP properties go here -->
197
- <xmp:CreatorTool/>
198
- </rdf:Description>
199
- </rdf:RDF>
200
- </x:xmpmeta>
201
- </fo:declarations>
164
+ <xsl:call-template name="addPDFUAmeta"/>
202
165
 
203
166
  <!-- Cover Page -->
204
167
  <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
@@ -302,8 +265,9 @@
302
265
  <fo:table-cell>
303
266
  <fo:block>
304
267
  <xsl:variable name="stage" select="/ogc:ogc-standard/ogc:bibdata/ogc:status/ogc:stage"/>
305
- <xsl:value-of select="translate(substring($stage, 1, 1), $lower, $upper)"/>
306
- <xsl:value-of select="substring($stage, 2)"/>
268
+ <xsl:call-template name="capitalize">
269
+ <xsl:with-param name="str" select="$stage"/>
270
+ </xsl:call-template>
307
271
  </fo:block>
308
272
  </fo:table-cell>
309
273
  </fo:table-row>
@@ -349,7 +313,12 @@
349
313
  <fo:block break-after="page"/>
350
314
 
351
315
  <fo:block-container font-weight="bold" line-height="115%">
352
- <fo:block font-size="14pt" margin-top="2pt" margin-bottom="15.5pt">Contents</fo:block>
316
+ <xsl:variable name="title-toc">
317
+ <xsl:call-template name="getTitle">
318
+ <xsl:with-param name="name" select="'title-toc'"/>
319
+ </xsl:call-template>
320
+ </xsl:variable>
321
+ <fo:block font-size="14pt" margin-top="2pt" margin-bottom="15.5pt"><xsl:value-of select="$title-toc"/></fo:block>
353
322
 
354
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'))] -->
355
324
 
@@ -398,7 +367,12 @@
398
367
  <xsl:if test="xalan:nodeset($contents)//item[@type = 'table']">
399
368
  <fo:block font-size="12pt"> </fo:block>
400
369
  <fo:block font-size="12pt"> </fo:block>
401
- <fo:block font-size="14pt" font-weight="bold" space-before="48pt" margin-bottom="15.5pt">List of Tables</fo:block>
370
+ <xsl:variable name="title-list-tables">
371
+ <xsl:call-template name="getTitle">
372
+ <xsl:with-param name="name" select="'title-list-tables'"/>
373
+ </xsl:call-template>
374
+ </xsl:variable>
375
+ <fo:block font-size="14pt" font-weight="bold" space-before="48pt" margin-bottom="15.5pt"><xsl:value-of select="$title-list-tables"/></fo:block>
402
376
  <xsl:for-each select="xalan:nodeset($contents)//item[@type = 'table']">
403
377
  <fo:block text-align-last="justify" margin-top="6pt">
404
378
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{@section}">
@@ -420,7 +394,12 @@
420
394
  <xsl:if test="xalan:nodeset($contents)//item[@type = 'figure']">
421
395
  <fo:block font-size="12pt"> </fo:block>
422
396
  <fo:block font-size="12pt"> </fo:block>
423
- <fo:block font-size="14pt" font-weight="bold" space-before="48pt" margin-bottom="15.5pt">List of Figures</fo:block>
397
+ <xsl:variable name="title-list-figures">
398
+ <xsl:call-template name="getTitle">
399
+ <xsl:with-param name="name" select="'title-list-figures'"/>
400
+ </xsl:call-template>
401
+ </xsl:variable>
402
+ <fo:block font-size="14pt" font-weight="bold" space-before="48pt" margin-bottom="15.5pt"><xsl:value-of select="$title-list-figures"/></fo:block>
424
403
  <xsl:for-each select="xalan:nodeset($contents)//item[@type = 'figure']">
425
404
  <fo:block text-align-last="justify" margin-top="6pt">
426
405
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{@section}">
@@ -664,7 +643,9 @@
664
643
  <xsl:choose>
665
644
  <xsl:when test="not(ogc:title)">
666
645
  <xsl:variable name="name" select="local-name()"/>
667
- <xsl:value-of select="translate(substring($name, 1, 1), $lower, $upper)"/><xsl:value-of select="substring($name, 2)"/>
646
+ <xsl:call-template name="capitalize">
647
+ <xsl:with-param name="str" select="$name"/>
648
+ </xsl:call-template>
668
649
  </xsl:when>
669
650
  <xsl:otherwise>
670
651
  <xsl:value-of select="ogc:title"/>
@@ -684,7 +665,12 @@
684
665
  <xsl:number format="i" value="$sectionNum"/>
685
666
  </xsl:variable>
686
667
  <item id="keywords" level="1" section="{$section}" display-section="true" display="true" type="abstract" root="preface">
687
- <xsl:text>Keywords</xsl:text>
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>
672
+ </xsl:variable>
673
+ <xsl:value-of select="$title-keywords"/>
688
674
  </item>
689
675
  </xsl:template>
690
676
  <!-- Submitting Organizations -->
@@ -694,7 +680,12 @@
694
680
  <xsl:number format="i" value="$sectionNum"/>
695
681
  </xsl:variable>
696
682
  <item id="submitting_orgs" level="1" section="{$section}" display-section="true" display="true" type="abstract" root="preface">
697
- <xsl:text>Submitting Organizations</xsl:text>
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>
687
+ </xsl:variable>
688
+ <xsl:value-of select="$title-submitting-organizations"/>
698
689
  </item>
699
690
  </xsl:template>
700
691
 
@@ -702,7 +693,12 @@
702
693
  <xsl:param name="sectionNum"/>
703
694
  <item level="" id="{@id}" type="figure">
704
695
  <xsl:attribute name="section">
705
- <xsl:text>Figure </xsl:text>
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"/>
706
702
  <xsl:choose>
707
703
  <xsl:when test="ancestor::ogc:annex">
708
704
  <xsl:choose>
@@ -737,7 +733,12 @@
737
733
  <xsl:variable name="annex-id" select="ancestor::ogc:annex/@id"/>
738
734
  <item level="" id="{@id}" display="false" type="table">
739
735
  <xsl:attribute name="section">
740
- <xsl:text>Table </xsl:text>
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"/>
741
742
  <xsl:choose>
742
743
  <xsl:when test="ancestor::*[local-name()='executivesummary']">
743
744
  <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered='true')]"/>
@@ -760,7 +761,12 @@
760
761
  <xsl:template match="ogc:formula" mode="contents">
761
762
  <item level="" id="{@id}" display="false">
762
763
  <xsl:attribute name="section">
763
- <xsl:text>Formula (</xsl:text><xsl:number format="A.1" level="multiple" count="ogc:annex | ogc:formula"/><xsl:text>)</xsl:text>
764
+ <xsl: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"/>
764
770
  </xsl:attribute>
765
771
  </item>
766
772
  </xsl:template>
@@ -778,7 +784,12 @@
778
784
 
779
785
  <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:edition">
780
786
  <fo:block margin-bottom="12pt">
781
- <xsl:text>Version: </xsl:text>
787
+ <xsl:variable name="title-edition">
788
+ <xsl:call-template name="getTitle">
789
+ <xsl:with-param name="name" select="'title-edition'"/>
790
+ </xsl:call-template>
791
+ </xsl:variable>
792
+ <xsl:value-of select="$title-edition"/><xsl:text>: </xsl:text>
782
793
  <xsl:value-of select="."/><xsl:text> </xsl:text>
783
794
  </fo:block>
784
795
  </xsl:template>
@@ -892,7 +903,9 @@
892
903
  <fo:block id="{$id}" font-size="13pt" font-weight="bold" margin-bottom="12pt" color="rgb(14, 26, 133)">
893
904
  <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="3mm"> </fo:inline>
894
905
  <xsl:variable name="name" select="local-name()"/>
895
- <xsl:value-of select="translate(substring($name, 1, 1), $lower, $upper)"/><xsl:value-of select="substring($name, 2)"/>
906
+ <xsl:call-template name="capitalize">
907
+ <xsl:with-param name="str" select="$name"/>
908
+ </xsl:call-template>
896
909
  </fo:block>
897
910
  </xsl:if>
898
911
  <xsl:apply-templates/>
@@ -902,7 +915,12 @@
902
915
  <xsl:param name="sectionNum" select="'1'"/>
903
916
  <fo:block id="keywords" font-size="13pt" font-weight="bold" margin-top="13.5pt" margin-bottom="12pt" color="rgb(14, 26, 133)">
904
917
  <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="2mm"> </fo:inline>
905
- <xsl:text>Keywords</xsl:text>
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"/>
906
924
  </fo:block>
907
925
  <fo:block margin-bottom="12pt">The following are keywords to be used by search engines and document catalogues.</fo:block>
908
926
  <fo:block margin-bottom="12pt">
@@ -921,7 +939,12 @@
921
939
  <xsl:param name="sectionNum" select="'1'"/>
922
940
  <fo:block id="submitting_orgs" font-size="13pt" font-weight="bold" color="rgb(14, 26, 133)" margin-top="13.5pt" margin-bottom="12pt">
923
941
  <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="3mm"> </fo:inline>
924
- <xsl:text>Submitting Organizations</xsl:text>
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"/>
925
948
  </fo:block>
926
949
  <fo:block margin-bottom="12pt">The following organizations submitted this Document to the Open Geospatial Consortium (OGC):</fo:block>
927
950
  <fo:list-block provisional-distance-between-starts="6.5mm" margin-bottom="12pt" line-height="115%">
@@ -1114,10 +1137,13 @@
1114
1137
  </xsl:attribute>
1115
1138
  <xsl:attribute name="space-after">
1116
1139
  <xsl:choose>
1117
- <xsl:when test="ancestor::ogc:li">0pt</xsl:when>
1140
+ <xsl:when test="ancestor::ogc:li">0pt</xsl:when>
1118
1141
  <xsl:otherwise>12pt</xsl:otherwise>
1119
1142
  </xsl:choose>
1120
1143
  </xsl:attribute>
1144
+ <xsl:if test="ancestor::ogc:dd and not(ancestor::ogc:table)">
1145
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1146
+ </xsl:if>
1121
1147
  <xsl:attribute name="line-height">115%</xsl:attribute>
1122
1148
  <xsl:apply-templates/>
1123
1149
  </xsl:element>
@@ -1139,7 +1165,7 @@
1139
1165
  <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
1140
1166
  </fn>
1141
1167
  -->
1142
- <xsl:template match="ogc:title/ogc:fn | ogc:p/ogc:fn[not(ancestor::ogc:table)]" priority="2">
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">
1143
1169
  <fo:footnote keep-with-previous.within-line="always">
1144
1170
  <xsl:variable name="number" select="@reference"/>
1145
1171
 
@@ -1185,10 +1211,6 @@
1185
1211
  </xsl:template>
1186
1212
 
1187
1213
  <xsl:template match="ogc:figure">
1188
- <xsl:variable name="title">
1189
- <xsl:text>Figure </xsl:text>
1190
- </xsl:variable>
1191
-
1192
1214
  <fo:block-container id="{@id}">
1193
1215
  <fo:block>
1194
1216
  <xsl:apply-templates/>
@@ -1198,7 +1220,11 @@
1198
1220
  <xsl:call-template name="note"/>
1199
1221
  </xsl:for-each>
1200
1222
  <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-top="12pt" margin-bottom="6pt" keep-with-previous="always">
1201
-
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>
1202
1228
  <xsl:choose>
1203
1229
  <xsl:when test="ancestor::ogc:annex">
1204
1230
  <xsl:choose>
@@ -1206,13 +1232,13 @@
1206
1232
  <xsl:number format="a) "/>
1207
1233
  </xsl:when>
1208
1234
  <xsl:otherwise>
1209
- <xsl:value-of select="$title"/><xsl:number format="A.1-1" level="multiple" count="ogc:annex | ogc:figure"/>
1235
+ <xsl:value-of select="$title-figure"/><xsl:number format="A.1-1" level="multiple" count="ogc:annex | ogc:figure"/>
1210
1236
  </xsl:otherwise>
1211
1237
  </xsl:choose>
1212
1238
 
1213
1239
  </xsl:when>
1214
1240
  <xsl:otherwise>
1215
- <xsl:value-of select="$title"/><xsl:number format="1" level="any" count="ogc:sourcecode[not(@unnumbered='true') and not(ancestor::ogc:example)] | ogc:figure"/>
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"/>
1216
1242
  </xsl:otherwise>
1217
1243
  </xsl:choose>
1218
1244
  <xsl:if test="ogc:name">
@@ -1295,13 +1321,13 @@
1295
1321
  </xsl:choose>
1296
1322
  </xsl:variable>
1297
1323
  <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super"> <!-- 60% baseline-shift="35%" -->
1298
- <fo:basic-link internal-destination="footnote_{../@id}" fox:alt-text="footnote {$number}">
1324
+ <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
1299
1325
  <xsl:value-of select="$number"/><!-- <xsl:text>)</xsl:text> -->
1300
1326
  </fo:basic-link>
1301
1327
  </fo:inline>
1302
1328
  <fo:footnote-body>
1303
1329
  <fo:block font-size="10pt" margin-bottom="12pt" start-indent="0pt">
1304
- <fo:inline id="footnote_{../@id}" keep-with-next.within-line="always" font-size="60%" vertical-align="super"><!-- baseline-shift="30%" padding-right="9mm" alignment-baseline="hanging" -->
1330
+ <fo:inline id="{generate-id()}" keep-with-next.within-line="always" font-size="60%" vertical-align="super"><!-- baseline-shift="30%" padding-right="9mm" alignment-baseline="hanging" -->
1305
1331
  <xsl:value-of select="$number"/><!-- <xsl:text>)</xsl:text> -->
1306
1332
  </fo:inline>
1307
1333
  <xsl:apply-templates/>
@@ -1368,6 +1394,14 @@
1368
1394
  </fo:list-item>
1369
1395
  </xsl:template>
1370
1396
 
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>
1371
1405
 
1372
1406
  <xsl:template match="ogc:preferred">
1373
1407
  <xsl:param name="sectionNum"/>
@@ -1387,7 +1421,7 @@
1387
1421
  </xsl:variable>
1388
1422
  <fo:block font-size="{$font-size}">
1389
1423
  <fo:block font-weight="bold" keep-with-next="always">
1390
- <fo:inline id="{../@id}">
1424
+ <fo:inline>
1391
1425
  <xsl:value-of select="$section"/><xsl:text>.</xsl:text>
1392
1426
  </fo:inline>
1393
1427
  </fo:block>
@@ -1404,7 +1438,12 @@
1404
1438
  </xsl:template>
1405
1439
 
1406
1440
  <xsl:template match="ogc:deprecates">
1407
- <fo:block>DEPRECATED: <xsl:apply-templates/></fo:block>
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>
1408
1447
  </xsl:template>
1409
1448
 
1410
1449
  <xsl:template match="ogc:definition[preceding-sibling::ogc:domain]">
@@ -1425,7 +1464,14 @@
1425
1464
  <fo:block margin-bottom="12pt" keep-with-previous="always">
1426
1465
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
1427
1466
  <fo:basic-link internal-destination="{ogc:origin/@bibitemid}" fox:alt-text="{ogc:origin/@citeas}">
1428
- <xsl:text>[SOURCE: </xsl:text>
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>
1429
1475
  <fo:inline color="blue" text-decoration="underline">
1430
1476
  <xsl:value-of select="ogc:origin/@citeas"/>
1431
1477
 
@@ -1438,19 +1484,20 @@
1438
1484
  </fo:block>
1439
1485
  </xsl:template>
1440
1486
 
1441
- <xsl:template match="ogc:modification">
1442
- <xsl:text>, modified — </xsl:text>
1443
- <xsl:apply-templates/>
1444
- </xsl:template>
1487
+
1445
1488
  <xsl:template match="ogc:modification/ogc:p">
1446
1489
  <fo:inline><xsl:apply-templates/></fo:inline>
1447
1490
  </xsl:template>
1448
1491
 
1449
1492
  <xsl:template match="ogc:termnote">
1450
1493
  <fo:block font-size="10pt" margin-bottom="12pt">
1451
- <xsl:text>Note </xsl:text>
1452
- <xsl:number/>
1453
- <xsl:text> to entry: </xsl:text>
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)"/>
1454
1501
  <xsl:apply-templates/>
1455
1502
  </fo:block>
1456
1503
  </xsl:template>
@@ -1466,7 +1513,12 @@
1466
1513
 
1467
1514
  <xsl:template match="ogc:termexample">
1468
1515
  <fo:block font-size="10pt" margin-bottom="12pt">
1469
- <fo:inline padding-right="10mm">EXAMPLE</fo:inline>
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>
1470
1522
  <xsl:apply-templates/>
1471
1523
  </fo:block>
1472
1524
  </xsl:template>
@@ -1595,7 +1647,7 @@
1595
1647
 
1596
1648
  <xsl:template match="ogc:source">
1597
1649
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
1598
- <xsl:value-of select="@citeas" disable-output-escaping="yes"/>
1650
+ <xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" -->
1599
1651
  <xsl:apply-templates select="ogc:localityStack"/>
1600
1652
  </fo:basic-link>
1601
1653
  </xsl:template>
@@ -1610,6 +1662,17 @@
1610
1662
  <!-- </xsl:if> -->
1611
1663
  <xsl:variable name="type" select="xalan:nodeset($contents)//item[@id = current()/@target]/@type"/>
1612
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>
1613
1676
 
1614
1677
  <xsl:choose>
1615
1678
  <xsl:when test="normalize-space(.) != ''">
@@ -1617,9 +1680,9 @@
1617
1680
  </xsl:when>
1618
1681
  <xsl:otherwise>
1619
1682
  <xsl:choose>
1620
- <xsl:when test="$type = 'clause' and $root != 'annex'">Clause </xsl:when><!-- and not (ancestor::annex) -->
1621
- <xsl:when test="$type = 'term' and ($root = 'clause' or $root = 'terms')">Clause </xsl:when>
1622
- <xsl:when test="$type = 'clause' and $root = 'annex'">Annex </xsl:when>
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>
1623
1686
  <xsl:otherwise/> <!-- <xsl:value-of select="$type"/> -->
1624
1687
  </xsl:choose>
1625
1688
  <xsl:value-of select="$section"/>
@@ -1630,19 +1693,24 @@
1630
1693
 
1631
1694
  <xsl:template match="ogc:sourcecode" priority="2">
1632
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>
1633
1701
  <xsl:choose>
1634
1702
  <xsl:when test="@unnumbered='true'"/>
1635
1703
  <xsl:when test="ancestor::ogc:example"/>
1636
1704
  <xsl:when test="ancestor::ogc:td"/>
1637
1705
  <xsl:when test="ancestor::ogc:annex">
1638
- <xsl:variable name="id_annex" select="ancestor::ogc:annex/@id"/>
1706
+ <xsl:variable name="id_annex" select="ancestor::ogc:annex/@id"/>
1639
1707
  <xsl:choose>
1640
1708
  <xsl:when test="count(//ogc:annex) = 1">
1641
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"/>
1642
1710
  </xsl:when>
1643
1711
  <xsl:otherwise>
1644
1712
  <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="12pt">
1645
- <xsl:text>Figure </xsl:text>
1713
+ <xsl:value-of select="$title-figure"/>
1646
1714
  <xsl:number format="A." level="multiple" count="ogc:annex"/>
1647
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)]"/>
1648
1716
  <xsl:if test="ogc:name">
@@ -1655,7 +1723,7 @@
1655
1723
  </xsl:when>
1656
1724
  <xsl:otherwise>
1657
1725
  <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="12pt">
1658
- <xsl:text>Figure </xsl:text>
1726
+ <xsl:value-of select="$title-figure"/>
1659
1727
  <xsl:number format="1" level="any" count="ogc:sourcecode[not(@unnumbered='true') and not(ancestor::ogc:example)] | ogc:figure"/>
1660
1728
  <xsl:if test="ogc:name">
1661
1729
  <xsl:text> — </xsl:text>
@@ -1680,7 +1748,12 @@
1680
1748
 
1681
1749
  <xsl:template match="ogc:example">
1682
1750
  <fo:block font-size="10pt" margin-top="12pt" margin-bottom="12pt" font-weight="bold" keep-with-next="always">
1683
- <xsl:text>EXAMPLE</xsl:text>
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)"/>
1684
1757
  <xsl:if test="following-sibling::ogc:example or preceding-sibling::ogc:example">
1685
1758
  <xsl:number format=" 1"/>
1686
1759
  </xsl:if>
@@ -1711,7 +1784,12 @@
1711
1784
  </xsl:if>
1712
1785
  <xsl:variable name="clauseid" select="ancestor::ogc:clause[1]/@id"/>
1713
1786
  <fo:inline padding-right="4mm">
1714
- <xsl:text>NOTE </xsl:text>
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"/>
1715
1793
  <xsl:if test="count(//ogc:note[ancestor::ogc:clause[1][@id = $clauseid]]) &gt; 1">
1716
1794
  <xsl:number count="ogc:note[ancestor::ogc:clause[1][@id = $clauseid]]" level="any"/>
1717
1795
  </xsl:if>
@@ -1738,7 +1816,7 @@
1738
1816
  </xsl:if> -->
1739
1817
  <xsl:choose>
1740
1818
  <xsl:when test="@citeas and normalize-space(text()) = ''">
1741
- <xsl:value-of select="@citeas" disable-output-escaping="yes"/>
1819
+ <xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" -->
1742
1820
  </xsl:when>
1743
1821
  <xsl:when test="@bibitemid and normalize-space(text()) = ''">
1744
1822
  <xsl:value-of select="//ogc:bibitem[@id = current()/@bibitemid]/ogc:docidentifier"/>
@@ -1751,9 +1829,19 @@
1751
1829
  </xsl:template>
1752
1830
 
1753
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>
1754
1842
  <xsl:choose>
1755
- <xsl:when test="@type ='clause'">Clause </xsl:when>
1756
- <xsl:when test="@type ='annex'">Annex </xsl:when>
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>
1757
1845
  <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
1758
1846
  </xsl:choose>
1759
1847
  <xsl:text> </xsl:text><xsl:value-of select="ogc:referenceFrom"/>
@@ -1762,8 +1850,8 @@
1762
1850
  <xsl:template match="ogc:admonition">
1763
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">
1764
1852
  <fo:block-container margin-left="0mm" margin-right="0mm" padding="2mm" padding-top="3mm">
1765
- <fo:block font-size="11pt" margin-bottom="6pt" font-weight="bold" font-style="italic" text-align="center">
1766
- <xsl:value-of select="translate(@type, $lower, $upper)"/>
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))"/>
1767
1855
  </fo:block>
1768
1856
  <fo:block font-style="italic">
1769
1857
  <xsl:apply-templates/>
@@ -1774,6 +1862,12 @@
1774
1862
 
1775
1863
  </xsl:template>
1776
1864
 
1865
+ <xsl:template match="ogc:formula">
1866
+ <fo:block id="{@id}">
1867
+ <xsl:apply-templates/>
1868
+ </fo:block>
1869
+ </xsl:template>
1870
+
1777
1871
  <xsl:template match="ogc:formula/ogc:dt/ogc:stem">
1778
1872
  <fo:inline>
1779
1873
  <xsl:apply-templates/>
@@ -1781,7 +1875,7 @@
1781
1875
  </xsl:template>
1782
1876
 
1783
1877
  <xsl:template match="ogc:formula/ogc:stem">
1784
- <fo:block id="{../@id}" margin-top="6pt" margin-bottom="12pt">
1878
+ <fo:block margin-top="6pt" margin-bottom="12pt">
1785
1879
  <fo:table table-layout="fixed" width="100%">
1786
1880
  <fo:table-column column-width="95%"/>
1787
1881
  <fo:table-column column-width="5%"/>
@@ -1796,7 +1890,7 @@
1796
1890
  <fo:block text-align="right">
1797
1891
  <xsl:choose>
1798
1892
  <xsl:when test="ancestor::ogc:annex">
1799
- <xsl:text>(</xsl:text><xsl:number format="A.1" level="multiple" count="ogc:annex | ogc:formula"/><xsl:text>)</xsl:text>
1893
+ <xsl:number format="(A.1)" level="multiple" count="ogc:annex | ogc:formula"/>
1800
1894
  </xsl:when>
1801
1895
  <xsl:otherwise> <!-- not(ancestor::ogc:annex) -->
1802
1896
  <!-- <xsl:text>(</xsl:text><xsl:number level="any" count="ogc:formula"/><xsl:text>)</xsl:text> -->
@@ -1881,38 +1975,6 @@
1881
1975
  </fo:static-content>
1882
1976
  </xsl:template>
1883
1977
 
1884
- <xsl:template name="getId">
1885
- <xsl:choose>
1886
- <xsl:when test="../@id">
1887
- <xsl:value-of select="../@id"/>
1888
- </xsl:when>
1889
- <xsl:otherwise>
1890
- <xsl:value-of select="text()"/>
1891
- </xsl:otherwise>
1892
- </xsl:choose>
1893
- </xsl:template>
1894
-
1895
- <xsl:template name="getLevel">
1896
- <xsl:variable name="level_total" select="count(ancestor::*)"/>
1897
- <xsl:variable name="level">
1898
- <xsl:choose>
1899
- <xsl:when test="ancestor::ogc:preface">
1900
- <xsl:value-of select="$level_total - 2"/>
1901
- </xsl:when>
1902
- <xsl:when test="ancestor::ogc:sections">
1903
- <xsl:value-of select="$level_total - 2"/>
1904
- </xsl:when>
1905
- <xsl:when test="ancestor::ogc:bibliography">
1906
- <xsl:value-of select="$level_total - 2"/>
1907
- </xsl:when>
1908
- <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
1909
- <xsl:otherwise>
1910
- <xsl:value-of select="$level_total - 1"/>
1911
- </xsl:otherwise>
1912
- </xsl:choose>
1913
- </xsl:variable>
1914
- <xsl:value-of select="$level"/>
1915
- </xsl:template>
1916
1978
 
1917
1979
  <xsl:template name="getSection">
1918
1980
  <xsl:param name="sectionNum"/>
@@ -1932,7 +1994,7 @@
1932
1994
  </xsl:when>
1933
1995
  <xsl:when test="$level &gt;= 2">
1934
1996
  <xsl:variable name="num">
1935
- <xsl:number format=".1" level="multiple" count="ogc:clause/ogc:clause | ogc:clause/ogc:terms | ogc:terms/ogc:term | ogc:clause/ogc:term | ogc:clause/ogc:definitions | ogc:definitions/ogc:definitions | ogc:terms/ogc:definitions"/>
1997
+ <xsl:call-template name="getSubSection"/>
1936
1998
  </xsl:variable>
1937
1999
  <xsl:value-of select="concat($sectionNum, $num)"/>
1938
2000
  </xsl:when>
@@ -1956,7 +2018,12 @@
1956
2018
  <xsl:when test="ancestor::ogc:annex">
1957
2019
  <xsl:choose>
1958
2020
  <xsl:when test="$level = 1">
1959
- <xsl:text>Annex </xsl:text>
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"/>
1960
2027
  <xsl:choose>
1961
2028
  <xsl:when test="count(//ogc:annex) = 1">
1962
2029
  <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:ext/ogc:structuredidentifier/ogc:annexid"/>
@@ -1999,50 +2066,191 @@
1999
2066
  <xsl:value-of select="$section"/>
2000
2067
  </xsl:template>
2001
2068
 
2002
- <xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-table">
2069
+ <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
+
2111
+ <title-annex lang="en">Annex </title-annex>
2112
+ <title-annex lang="fr">Annexe </title-annex>
2113
+
2114
+ <title-annex lang="zh">Annex </title-annex>
2115
+
2116
+
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
+
2128
+ <title-edition lang="en">
2129
+
2130
+
2131
+ <xsl:text>Version</xsl:text>
2132
+
2133
+ </title-edition>
2134
+
2135
+ <title-formula lang="en">Formula </title-formula>
2136
+ <title-formula lang="fr">Formula </title-formula>
2137
+
2138
+ <title-toc lang="en">
2139
+
2140
+ <xsl:text>Contents</xsl:text>
2141
+
2142
+
2143
+
2144
+ </title-toc>
2145
+ <title-toc lang="fr">Sommaire</title-toc>
2146
+
2147
+ <title-toc lang="zh">Contents</title-toc>
2148
+
2149
+
2150
+
2151
+ <title-page lang="en">Page</title-page>
2152
+ <title-page lang="fr">Page</title-page>
2153
+
2154
+ <title-key lang="en">Key</title-key>
2155
+ <title-key lang="fr">Légende</title-key>
2156
+
2157
+ <title-where lang="en">where</title-where>
2158
+ <title-where lang="fr">où</title-where>
2159
+
2160
+ <title-descriptors lang="en">Descriptors</title-descriptors>
2161
+
2162
+ <title-part lang="en">
2163
+
2164
+
2165
+ </title-part>
2166
+ <title-part lang="fr">
2167
+
2168
+
2169
+ </title-part>
2170
+ <title-part lang="zh">第 # 部分:</title-part>
2171
+
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>
2003
2176
 
2004
- <xsl:text>Table </xsl:text>
2005
2177
 
2006
2178
 
2007
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-note">
2179
+ <title-modified lang="en">modified</title-modified>
2180
+ <title-modified lang="fr">modifiée</title-modified>
2008
2181
 
2009
- <xsl:text>NOTE </xsl:text>
2182
+ <title-modified lang="zh">modified</title-modified>
2010
2183
 
2011
2184
 
2012
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-figure">
2013
2185
 
2014
- <xsl:text>Figure </xsl:text>
2186
+ <title-source lang="en">SOURCE</title-source>
2015
2187
 
2188
+ <title-keywords lang="en">Keywords</title-keywords>
2016
2189
 
2017
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-example">
2190
+ <title-deprecated lang="en">DEPRECATED</title-deprecated>
2191
+ <title-deprecated lang="fr">DEPRECATED</title-deprecated>
2018
2192
 
2019
- <xsl:text>EXAMPLE </xsl:text>
2193
+ <title-submitting-organizations lang="en">Submitting Organizations</title-submitting-organizations>
2020
2194
 
2195
+ <title-list-tables lang="en">List of Tables</title-list-tables>
2021
2196
 
2022
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-inequality">Inequality </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-equation">Equation </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-annex">
2197
+ <title-list-figures lang="en">List of Figures</title-list-figures>
2023
2198
 
2024
- <xsl:text>Annex </xsl:text>
2199
+ <title-recommendation lang="en">Recommendation </title-recommendation>
2025
2200
 
2201
+ <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
2026
2202
 
2027
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-appendix">
2028
- <xsl:text>Appendix </xsl:text>
2029
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-clause">
2203
+ <title-abstract lang="en">Abstract</title-abstract>
2030
2204
 
2031
- <xsl:text>Clause </xsl:text>
2205
+ <title-summary lang="en">Summary</title-summary>
2032
2206
 
2207
+ <title-in lang="en">in </title-in>
2033
2208
 
2034
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-edition">
2035
- <xsl:text>Edition </xsl:text>
2036
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-toc">
2209
+ <title-box lang="en">Box </title-box>
2037
2210
 
2211
+ <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
2212
+ <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
2038
2213
 
2039
- </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-page">Page</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-key">Key</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-where">where</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-descriptors">Descriptors</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-part-en">Part </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-part-fr">Partie </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-note-to-entry">Note # to entry: </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-modified">modified</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-source">SOURCE</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-keywords">Keywords</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="linebreak" select="'&#8232;'"/><xsl:attribute-set xmlns:java="http://xml.apache.org/xalan/java" name="link-style">
2214
+ <title-completion-date lang="en">Completion date for this manuscript</title-completion-date>
2215
+ <title-completion-date lang="zh">本稿完成日期</title-completion-date>
2216
+
2217
+ <title-issuance-date lang="en">Issuance Date: #</title-issuance-date>
2218
+ <title-issuance-date lang="zh"># 发布</title-issuance-date>
2219
+
2220
+ <title-implementation-date lang="en">Implementation Date: #</title-implementation-date>
2221
+ <title-implementation-date lang="zh"># 实施</title-implementation-date>
2222
+
2223
+ <title-obligation-normative lang="en">normative</title-obligation-normative>
2224
+ <title-obligation-normative lang="zh">规范性附录</title-obligation-normative>
2225
+
2226
+ <title-caution lang="en">CAUTION</title-caution>
2227
+ <title-caution lang="zh">注意</title-caution>
2228
+
2229
+ <title-warning lang="en">WARNING</title-warning>
2230
+ <title-warning lang="zh">警告</title-warning>
2231
+
2232
+ <title-amendment lang="en">AMENDMENT</title-amendment>
2233
+ </xsl:variable><xsl:template name="getTitle">
2234
+ <xsl:param name="name"/>
2235
+ <xsl:variable name="lang">
2236
+ <xsl:call-template name="getLang"/>
2237
+ </xsl:variable>
2238
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
2239
+ <xsl:choose>
2240
+ <xsl:when test="normalize-space($title_) != ''">
2241
+ <xsl:value-of select="$title_"/>
2242
+ </xsl:when>
2243
+ <xsl:otherwise>
2244
+ <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
2245
+ </xsl:otherwise>
2246
+ </xsl:choose>
2247
+ </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="link-style">
2040
2248
 
2041
2249
  <xsl:attribute name="color">blue</xsl:attribute>
2042
2250
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
2043
2251
 
2044
2252
 
2045
- </xsl:attribute-set><xsl:attribute-set xmlns:java="http://xml.apache.org/xalan/java" name="sourcecode-style">
2253
+ </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
2046
2254
 
2047
2255
 
2048
2256
 
@@ -2057,7 +2265,7 @@
2057
2265
  <xsl:attribute name="line-height">113%</xsl:attribute>
2058
2266
 
2059
2267
 
2060
- </xsl:attribute-set><xsl:attribute-set xmlns:java="http://xml.apache.org/xalan/java" name="appendix-style">
2268
+ </xsl:attribute-set><xsl:attribute-set name="appendix-style">
2061
2269
 
2062
2270
  <xsl:attribute name="font-size">12pt</xsl:attribute>
2063
2271
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -2066,7 +2274,7 @@
2066
2274
 
2067
2275
 
2068
2276
 
2069
- </xsl:attribute-set><xsl:attribute-set xmlns:java="http://xml.apache.org/xalan/java" name="appendix-example-style">
2277
+ </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
2070
2278
 
2071
2279
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2072
2280
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
@@ -2074,14 +2282,14 @@
2074
2282
 
2075
2283
 
2076
2284
 
2077
- </xsl:attribute-set><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="text()">
2285
+ </xsl:attribute-set><xsl:template match="text()">
2078
2286
  <xsl:value-of select="."/>
2079
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='br']">
2287
+ </xsl:template><xsl:template match="*[local-name()='br']">
2080
2288
  <xsl:value-of select="$linebreak"/>
2081
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
2289
+ </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
2082
2290
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
2083
2291
  <xsl:call-template name="add-zero-spaces-java"/>
2084
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']">
2292
+ </xsl:template><xsl:template match="*[local-name()='table']">
2085
2293
 
2086
2294
  <xsl:variable name="simple-table">
2087
2295
  <!-- <xsl:copy> -->
@@ -2117,7 +2325,11 @@
2117
2325
 
2118
2326
 
2119
2327
 
2120
-
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>
2121
2333
  <xsl:value-of select="$title-table"/>
2122
2334
 
2123
2335
  <xsl:call-template name="getTableNumber"/>
@@ -2224,13 +2436,22 @@
2224
2436
  </xsl:otherwise>
2225
2437
  </xsl:choose>
2226
2438
  </xsl:for-each>
2227
- <xsl:apply-templates/>
2439
+
2440
+ <xsl:choose>
2441
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2442
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2443
+ </xsl:when>
2444
+ <xsl:otherwise>
2445
+ <xsl:apply-templates/>
2446
+ </xsl:otherwise>
2447
+ </xsl:choose>
2448
+
2228
2449
  </fo:table>
2229
2450
 
2230
2451
 
2231
2452
 
2232
2453
  </fo:block-container>
2233
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="getTableNumber">
2454
+ </xsl:template><xsl:template name="getTableNumber">
2234
2455
  <xsl:choose>
2235
2456
  <xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
2236
2457
  <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true']"/>
@@ -2255,15 +2476,15 @@
2255
2476
 
2256
2477
  </xsl:otherwise>
2257
2478
  </xsl:choose>
2258
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']/*[local-name()='name']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']/*[local-name()='name']" mode="process">
2479
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']"/><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="process">
2259
2480
  <xsl:apply-templates/>
2260
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="calculate-columns-numbers">
2481
+ </xsl:template><xsl:template name="calculate-columns-numbers">
2261
2482
  <xsl:param name="table-row"/>
2262
2483
  <xsl:variable name="columns-count" select="count($table-row/*)"/>
2263
2484
  <xsl:variable name="sum-colspans" select="sum($table-row/*/@colspan)"/>
2264
2485
  <xsl:variable name="columns-with-colspan" select="count($table-row/*[@colspan])"/>
2265
2486
  <xsl:value-of select="$columns-count + $sum-colspans - $columns-with-colspan"/>
2266
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="calculate-column-widths">
2487
+ </xsl:template><xsl:template name="calculate-column-widths">
2267
2488
  <xsl:param name="table"/>
2268
2489
  <xsl:param name="cols-count"/>
2269
2490
  <xsl:param name="curr-col" select="1"/>
@@ -2361,23 +2582,27 @@
2361
2582
  <xsl:with-param name="table" select="$table"/>
2362
2583
  </xsl:call-template>
2363
2584
  </xsl:if>
2364
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="text()" mode="td_text">
2585
+ </xsl:template><xsl:template match="text()" mode="td_text">
2365
2586
  <xsl:variable name="zero-space">​</xsl:variable>
2366
2587
  <xsl:value-of select="translate(., $zero-space, ' ')"/><xsl:text> </xsl:text>
2367
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='termsource']" mode="td_text">
2588
+ </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
2368
2589
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
2369
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='link']" mode="td_text">
2590
+ </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
2370
2591
  <xsl:value-of select="@target"/>
2371
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table2']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='thead']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='thead']" mode="process">
2592
+ </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
2372
2593
  <xsl:param name="cols-count"/>
2373
2594
  <!-- font-weight="bold" -->
2374
2595
  <fo:table-header>
2375
2596
 
2376
2597
  <xsl:apply-templates/>
2377
2598
  </fo:table-header>
2378
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tfoot']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tfoot']" mode="process">
2599
+ </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
2600
+ <fo:table-body>
2601
+ <xsl:apply-templates/>
2602
+ </fo:table-body>
2603
+ </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
2379
2604
  <xsl:apply-templates/>
2380
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="insertTableFooter">
2605
+ </xsl:template><xsl:template name="insertTableFooter">
2381
2606
  <xsl:param name="cols-count"/>
2382
2607
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2383
2608
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -2417,7 +2642,7 @@
2417
2642
  </fo:table-footer>
2418
2643
 
2419
2644
  </xsl:if>
2420
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tbody']">
2645
+ </xsl:template><xsl:template match="*[local-name()='tbody']">
2421
2646
 
2422
2647
  <xsl:variable name="cols-count">
2423
2648
  <xsl:choose>
@@ -2448,7 +2673,7 @@
2448
2673
 
2449
2674
  </fo:table-body>
2450
2675
 
2451
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tr']">
2676
+ </xsl:template><xsl:template match="*[local-name()='tr']">
2452
2677
  <xsl:variable name="parent-name" select="local-name(..)"/>
2453
2678
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
2454
2679
  <fo:table-row min-height="4mm">
@@ -2468,7 +2693,7 @@
2468
2693
 
2469
2694
  <xsl:apply-templates/>
2470
2695
  </fo:table-row>
2471
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='th']">
2696
+ </xsl:template><xsl:template match="*[local-name()='th']">
2472
2697
  <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
2473
2698
 
2474
2699
 
@@ -2491,7 +2716,7 @@
2491
2716
  <xsl:apply-templates/>
2492
2717
  </fo:block>
2493
2718
  </fo:table-cell>
2494
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='td']">
2719
+ </xsl:template><xsl:template match="*[local-name()='td']">
2495
2720
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
2496
2721
 
2497
2722
 
@@ -2529,7 +2754,7 @@
2529
2754
 
2530
2755
 
2531
2756
  </fo:table-cell>
2532
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']/*[local-name()='note']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']/*[local-name()='note']" mode="process">
2757
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
2533
2758
 
2534
2759
 
2535
2760
  <fo:block font-size="10pt" margin-bottom="12pt">
@@ -2540,6 +2765,11 @@
2540
2765
  <fo:inline padding-right="2mm">
2541
2766
 
2542
2767
 
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>
2543
2773
  <xsl:value-of select="$title-note"/>
2544
2774
 
2545
2775
  <xsl:variable name="id" select="ancestor::*[local-name() = 'table'][1]/@id"/>
@@ -2554,9 +2784,9 @@
2554
2784
  <xsl:apply-templates mode="process"/>
2555
2785
  </fo:block>
2556
2786
 
2557
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
2787
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
2558
2788
  <xsl:apply-templates/>
2559
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="fn_display">
2789
+ </xsl:template><xsl:template name="fn_display">
2560
2790
  <xsl:variable name="references">
2561
2791
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
2562
2792
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -2599,7 +2829,7 @@
2599
2829
  </fo:block>
2600
2830
  </xsl:if>
2601
2831
  </xsl:for-each>
2602
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="fn_name_display">
2832
+ </xsl:template><xsl:template name="fn_name_display">
2603
2833
  <!-- <xsl:variable name="references">
2604
2834
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
2605
2835
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -2615,7 +2845,7 @@
2615
2845
  <xsl:apply-templates/>
2616
2846
  </fo:block>
2617
2847
  </xsl:for-each>
2618
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="fn_display_figure">
2848
+ </xsl:template><xsl:template name="fn_display_figure">
2619
2849
  <xsl:variable name="key_iso">
2620
2850
  <!-- and (not(@class) or @class !='pseudocode') -->
2621
2851
  </xsl:variable>
@@ -2626,6 +2856,36 @@
2626
2856
  </fn>
2627
2857
  </xsl:for-each>
2628
2858
  </xsl:variable>
2859
+
2860
+ <!-- current hierarchy is 'figure' element -->
2861
+ <xsl:variable name="following_dl_colwidths">
2862
+ <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
2863
+ <xsl:variable name="html-table">
2864
+ <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2865
+ <xsl:element name="{$ns}:table">
2866
+ <xsl:for-each select="*[local-name() = 'dl'][1]">
2867
+ <tbody>
2868
+ <xsl:apply-templates mode="dl"/>
2869
+ </tbody>
2870
+ </xsl:for-each>
2871
+ </xsl:element>
2872
+ </xsl:variable>
2873
+
2874
+ <xsl:call-template name="calculate-column-widths">
2875
+ <xsl:with-param name="cols-count" select="2"/>
2876
+ <xsl:with-param name="table" select="$html-table"/>
2877
+ </xsl:call-template>
2878
+
2879
+ </xsl:if>
2880
+ </xsl:variable>
2881
+
2882
+
2883
+ <xsl:variable name="maxlength_dt">
2884
+ <xsl:for-each select="*[local-name() = 'dl'][1]">
2885
+ <xsl:call-template name="getMaxLength_dt"/>
2886
+ </xsl:for-each>
2887
+ </xsl:variable>
2888
+
2629
2889
  <xsl:if test="xalan:nodeset($references)//fn">
2630
2890
  <fo:block>
2631
2891
  <fo:table width="95%" table-layout="fixed">
@@ -2633,8 +2893,19 @@
2633
2893
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2634
2894
 
2635
2895
  </xsl:if>
2636
- <fo:table-column column-width="15%"/>
2637
- <fo:table-column column-width="85%"/>
2896
+ <xsl:choose>
2897
+ <!-- if there 'dl', then set same columns width -->
2898
+ <xsl:when test="xalan:nodeset($following_dl_colwidths)//column">
2899
+ <xsl:call-template name="setColumnWidth_dl">
2900
+ <xsl:with-param name="colwidths" select="$following_dl_colwidths"/>
2901
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2902
+ </xsl:call-template>
2903
+ </xsl:when>
2904
+ <xsl:otherwise>
2905
+ <fo:table-column column-width="15%"/>
2906
+ <fo:table-column column-width="85%"/>
2907
+ </xsl:otherwise>
2908
+ </xsl:choose>
2638
2909
  <fo:table-body>
2639
2910
  <xsl:for-each select="xalan:nodeset($references)//fn">
2640
2911
  <xsl:variable name="reference" select="@reference"/>
@@ -2666,7 +2937,7 @@
2666
2937
  </fo:block>
2667
2938
  </xsl:if>
2668
2939
 
2669
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='fn']">
2940
+ </xsl:template><xsl:template match="*[local-name()='fn']">
2670
2941
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
2671
2942
  <fo:inline font-size="80%" keep-with-previous.within-line="always">
2672
2943
 
@@ -2688,11 +2959,11 @@
2688
2959
  <xsl:value-of select="@reference"/>
2689
2960
  </fo:basic-link>
2690
2961
  </fo:inline>
2691
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='fn']/*[local-name()='p']">
2962
+ </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
2692
2963
  <fo:inline>
2693
2964
  <xsl:apply-templates/>
2694
2965
  </fo:inline>
2695
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dl']">
2966
+ </xsl:template><xsl:template match="*[local-name()='dl']">
2696
2967
  <xsl:variable name="parent" select="local-name(..)"/>
2697
2968
 
2698
2969
  <xsl:variable name="key_iso">
@@ -2705,6 +2976,11 @@
2705
2976
 
2706
2977
  <fo:block margin-bottom="12pt" text-align="left">
2707
2978
 
2979
+ <xsl:variable name="title-where">
2980
+ <xsl:call-template name="getTitle">
2981
+ <xsl:with-param name="name" select="'title-where'"/>
2982
+ </xsl:call-template>
2983
+ </xsl:variable>
2708
2984
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2709
2985
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
2710
2986
  <xsl:text/>
@@ -2718,14 +2994,24 @@
2718
2994
 
2719
2995
 
2720
2996
 
2997
+ <xsl:variable name="title-where">
2998
+ <xsl:call-template name="getTitle">
2999
+ <xsl:with-param name="name" select="'title-where'"/>
3000
+ </xsl:call-template>
3001
+ </xsl:variable>
2721
3002
  <xsl:value-of select="$title-where"/>
2722
3003
  </fo:block>
2723
3004
  </xsl:when>
2724
3005
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2725
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt">
3006
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2726
3007
 
2727
3008
 
2728
3009
 
3010
+ <xsl:variable name="title-key">
3011
+ <xsl:call-template name="getTitle">
3012
+ <xsl:with-param name="name" select="'title-key'"/>
3013
+ </xsl:call-template>
3014
+ </xsl:variable>
2729
3015
  <xsl:value-of select="$title-key"/>
2730
3016
  </fo:block>
2731
3017
  </xsl:when>
@@ -2742,23 +3028,6 @@
2742
3028
 
2743
3029
 
2744
3030
 
2745
- <!-- create virtual html table for dl/[dt and dd] -->
2746
- <xsl:variable name="html-table">
2747
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2748
- <xsl:element name="{$ns}:table">
2749
- <tbody>
2750
- <xsl:apply-templates mode="dl"/>
2751
- </tbody>
2752
- </xsl:element>
2753
- </xsl:variable>
2754
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
2755
- <xsl:variable name="colwidths">
2756
- <xsl:call-template name="calculate-column-widths">
2757
- <xsl:with-param name="cols-count" select="2"/>
2758
- <xsl:with-param name="table" select="$html-table"/>
2759
- </xsl:call-template>
2760
- </xsl:variable>
2761
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2762
3031
 
2763
3032
  <fo:table width="95%" table-layout="fixed">
2764
3033
 
@@ -2771,42 +3040,30 @@
2771
3040
 
2772
3041
  </xsl:when>
2773
3042
  </xsl:choose>
2774
- <xsl:choose>
2775
- <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
2776
- <fo:table-column column-width="50%"/>
2777
- <fo:table-column column-width="50%"/>
2778
- </xsl:when>
2779
- <xsl:otherwise>
2780
- <xsl:choose>
2781
- <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
2782
- <fo:table-column column-width="60%"/>
2783
- <fo:table-column column-width="40%"/>
2784
- </xsl:when> -->
2785
- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.3">
2786
- <fo:table-column column-width="50%"/>
2787
- <fo:table-column column-width="50%"/>
2788
- </xsl:when>
2789
- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 0.5">
2790
- <fo:table-column column-width="40%"/>
2791
- <fo:table-column column-width="60%"/>
2792
- </xsl:when>
2793
- <xsl:otherwise>
2794
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2795
- <xsl:choose>
2796
- <xsl:when test=". = 1 or . = 0">
2797
- <fo:table-column column-width="proportional-column-width(2)"/>
2798
- </xsl:when>
2799
- <xsl:otherwise>
2800
- <fo:table-column column-width="proportional-column-width({.})"/>
2801
- </xsl:otherwise>
2802
- </xsl:choose>
2803
- </xsl:for-each>
2804
- </xsl:otherwise>
2805
- </xsl:choose>
2806
- <!-- <fo:table-column column-width="15%"/>
2807
- <fo:table-column column-width="85%"/> -->
2808
- </xsl:otherwise>
2809
- </xsl:choose>
3043
+ <!-- create virtual html table for dl/[dt and dd] -->
3044
+ <xsl:variable name="html-table">
3045
+ <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
3046
+ <xsl:element name="{$ns}:table">
3047
+ <tbody>
3048
+ <xsl:apply-templates mode="dl"/>
3049
+ </tbody>
3050
+ </xsl:element>
3051
+ </xsl:variable>
3052
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
3053
+ <xsl:variable name="colwidths">
3054
+ <xsl:call-template name="calculate-column-widths">
3055
+ <xsl:with-param name="cols-count" select="2"/>
3056
+ <xsl:with-param name="table" select="$html-table"/>
3057
+ </xsl:call-template>
3058
+ </xsl:variable>
3059
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
3060
+ <xsl:variable name="maxlength_dt">
3061
+ <xsl:call-template name="getMaxLength_dt"/>
3062
+ </xsl:variable>
3063
+ <xsl:call-template name="setColumnWidth_dl">
3064
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3065
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
3066
+ </xsl:call-template>
2810
3067
  <fo:table-body>
2811
3068
  <xsl:apply-templates>
2812
3069
  <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
@@ -2816,7 +3073,61 @@
2816
3073
  </fo:block>
2817
3074
  </fo:block>
2818
3075
  </xsl:if>
2819
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dl']/*[local-name()='note']">
3076
+ </xsl:template><xsl:template name="setColumnWidth_dl">
3077
+ <xsl:param name="colwidths"/>
3078
+ <xsl:param name="maxlength_dt"/>
3079
+ <xsl:choose>
3080
+ <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
3081
+ <fo:table-column column-width="50%"/>
3082
+ <fo:table-column column-width="50%"/>
3083
+ </xsl:when>
3084
+ <xsl:otherwise>
3085
+ <xsl:choose>
3086
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
3087
+ <fo:table-column column-width="5%"/>
3088
+ <fo:table-column column-width="95%"/>
3089
+ </xsl:when>
3090
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
3091
+ <fo:table-column column-width="10%"/>
3092
+ <fo:table-column column-width="90%"/>
3093
+ </xsl:when>
3094
+ <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
3095
+ <fo:table-column column-width="60%"/>
3096
+ <fo:table-column column-width="40%"/>
3097
+ </xsl:when> -->
3098
+ <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.3">
3099
+ <fo:table-column column-width="50%"/>
3100
+ <fo:table-column column-width="50%"/>
3101
+ </xsl:when>
3102
+ <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 0.5">
3103
+ <fo:table-column column-width="40%"/>
3104
+ <fo:table-column column-width="60%"/>
3105
+ </xsl:when>
3106
+ <xsl:otherwise>
3107
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3108
+ <xsl:choose>
3109
+ <xsl:when test=". = 1 or . = 0">
3110
+ <fo:table-column column-width="proportional-column-width(2)"/>
3111
+ </xsl:when>
3112
+ <xsl:otherwise>
3113
+ <fo:table-column column-width="proportional-column-width({.})"/>
3114
+ </xsl:otherwise>
3115
+ </xsl:choose>
3116
+ </xsl:for-each>
3117
+ </xsl:otherwise>
3118
+ </xsl:choose>
3119
+ <!-- <fo:table-column column-width="15%"/>
3120
+ <fo:table-column column-width="85%"/> -->
3121
+ </xsl:otherwise>
3122
+ </xsl:choose>
3123
+ </xsl:template><xsl:template name="getMaxLength_dt">
3124
+ <xsl:for-each select="*[local-name()='dt']">
3125
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
3126
+ <xsl:if test="position() = 1">
3127
+ <xsl:value-of select="string-length(normalize-space(.))"/>
3128
+ </xsl:if>
3129
+ </xsl:for-each>
3130
+ </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']">
2820
3131
  <xsl:param name="key_iso"/>
2821
3132
 
2822
3133
  <!-- <tr>
@@ -2832,6 +3143,11 @@
2832
3143
  <xsl:if test="normalize-space($key_iso) = 'true'">
2833
3144
  <xsl:attribute name="margin-top">0</xsl:attribute>
2834
3145
  </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>
2835
3151
  <xsl:value-of select="$title-note"/>
2836
3152
  </fo:block>
2837
3153
  </fo:table-cell>
@@ -2841,7 +3157,7 @@
2841
3157
  </fo:block>
2842
3158
  </fo:table-cell>
2843
3159
  </fo:table-row>
2844
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dt']" mode="dl">
3160
+ </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl">
2845
3161
  <tr>
2846
3162
  <td>
2847
3163
  <xsl:apply-templates/>
@@ -2854,7 +3170,7 @@
2854
3170
  </td>
2855
3171
  </tr>
2856
3172
 
2857
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dt']">
3173
+ </xsl:template><xsl:template match="*[local-name()='dt']">
2858
3174
  <xsl:param name="key_iso"/>
2859
3175
 
2860
3176
  <fo:table-row>
@@ -2872,8 +3188,15 @@
2872
3188
 
2873
3189
 
2874
3190
 
2875
- <xsl:apply-templates/>
3191
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
3192
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2876
3193
 
3194
+ <xsl:apply-templates/>
3195
+ <!-- <xsl:if test="$namespace = 'gb'">
3196
+ <xsl:if test="ancestor::*[local-name()='formula']">
3197
+ <xsl:text>—</xsl:text>
3198
+ </xsl:if>
3199
+ </xsl:if> -->
2877
3200
  </fo:block>
2878
3201
  </fo:table-cell>
2879
3202
  <fo:table-cell>
@@ -2887,37 +3210,37 @@
2887
3210
  </fo:table-cell>
2888
3211
  </fo:table-row>
2889
3212
 
2890
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dd']" mode="dl"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dd']" mode="dl_process">
3213
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
2891
3214
  <xsl:apply-templates/>
2892
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dd']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dd']" mode="process">
3215
+ </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
2893
3216
  <xsl:apply-templates/>
2894
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
3217
+ </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
2895
3218
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
2896
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='em']">
3219
+ </xsl:template><xsl:template match="*[local-name()='em']">
2897
3220
  <fo:inline font-style="italic">
2898
3221
  <xsl:apply-templates/>
2899
3222
  </fo:inline>
2900
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='strong']">
3223
+ </xsl:template><xsl:template match="*[local-name()='strong']">
2901
3224
  <fo:inline font-weight="bold">
2902
3225
  <xsl:apply-templates/>
2903
3226
  </fo:inline>
2904
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='sup']">
3227
+ </xsl:template><xsl:template match="*[local-name()='sup']">
2905
3228
  <fo:inline font-size="80%" vertical-align="super">
2906
3229
  <xsl:apply-templates/>
2907
3230
  </fo:inline>
2908
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='sub']">
3231
+ </xsl:template><xsl:template match="*[local-name()='sub']">
2909
3232
  <fo:inline font-size="80%" vertical-align="sub">
2910
3233
  <xsl:apply-templates/>
2911
3234
  </fo:inline>
2912
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tt']">
3235
+ </xsl:template><xsl:template match="*[local-name()='tt']">
2913
3236
  <fo:inline font-family="Courier" font-size="10pt">
2914
3237
  <xsl:apply-templates/>
2915
3238
  </fo:inline>
2916
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='del']">
3239
+ </xsl:template><xsl:template match="*[local-name()='del']">
2917
3240
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2918
3241
  <xsl:apply-templates/>
2919
3242
  </fo:inline>
2920
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="text()[ancestor::*[local-name()='smallcap']]">
3243
+ </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
2921
3244
  <xsl:variable name="text" select="normalize-space(.)"/>
2922
3245
  <fo:inline font-size="75%">
2923
3246
  <xsl:if test="string-length($text) &gt; 0">
@@ -2926,10 +3249,11 @@
2926
3249
  </xsl:call-template>
2927
3250
  </xsl:if>
2928
3251
  </fo:inline>
2929
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="recursiveSmallCaps">
3252
+ </xsl:template><xsl:template name="recursiveSmallCaps">
2930
3253
  <xsl:param name="text"/>
2931
3254
  <xsl:variable name="char" select="substring($text,1,1)"/>
2932
- <xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/>
3255
+ <!-- <xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/> -->
3256
+ <xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
2933
3257
  <xsl:choose>
2934
3258
  <xsl:when test="$char=$upperCase">
2935
3259
  <fo:inline font-size="{100 div 0.75}%">
@@ -2945,7 +3269,7 @@
2945
3269
  <xsl:with-param name="text" select="substring($text,2)"/>
2946
3270
  </xsl:call-template>
2947
3271
  </xsl:if>
2948
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="tokenize">
3272
+ </xsl:template><xsl:template name="tokenize">
2949
3273
  <xsl:param name="text"/>
2950
3274
  <xsl:param name="separator" select="' '"/>
2951
3275
  <xsl:choose>
@@ -2993,7 +3317,7 @@
2993
3317
  </xsl:call-template>
2994
3318
  </xsl:otherwise>
2995
3319
  </xsl:choose>
2996
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="max_length">
3320
+ </xsl:template><xsl:template name="max_length">
2997
3321
  <xsl:param name="words"/>
2998
3322
  <xsl:for-each select="$words//word">
2999
3323
  <xsl:sort select="." data-type="number" order="descending"/>
@@ -3001,11 +3325,11 @@
3001
3325
  <xsl:value-of select="."/>
3002
3326
  </xsl:if>
3003
3327
  </xsl:for-each>
3004
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="add-zero-spaces-java">
3328
+ </xsl:template><xsl:template name="add-zero-spaces-java">
3005
3329
  <xsl:param name="text" select="."/>
3006
3330
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
3007
3331
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
3008
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="add-zero-spaces">
3332
+ </xsl:template><xsl:template name="add-zero-spaces">
3009
3333
  <xsl:param name="text" select="."/>
3010
3334
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
3011
3335
  <xsl:variable name="zero-space-after-dot">.</xsl:variable>
@@ -3058,7 +3382,7 @@
3058
3382
  <xsl:value-of select="$text"/>
3059
3383
  </xsl:otherwise>
3060
3384
  </xsl:choose>
3061
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="add-zero-spaces-equal">
3385
+ </xsl:template><xsl:template name="add-zero-spaces-equal">
3062
3386
  <xsl:param name="text" select="."/>
3063
3387
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
3064
3388
  <xsl:variable name="zero-space-after-equal">=</xsl:variable>
@@ -3084,7 +3408,7 @@
3084
3408
  <xsl:value-of select="$text"/>
3085
3409
  </xsl:otherwise>
3086
3410
  </xsl:choose>
3087
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="getSimpleTable">
3411
+ </xsl:template><xsl:template name="getSimpleTable">
3088
3412
  <xsl:variable name="simple-table">
3089
3413
 
3090
3414
  <!-- Step 1. colspan processing -->
@@ -3111,9 +3435,9 @@
3111
3435
  </xsl:choose> -->
3112
3436
  </xsl:variable>
3113
3437
  <xsl:copy-of select="$simple-table"/>
3114
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
3438
+ </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
3115
3439
  <xsl:apply-templates mode="simple-table-colspan"/>
3116
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='fn']" mode="simple-table-colspan"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='th'] | *[local-name()='td']" mode="simple-table-colspan">
3440
+ </xsl:template><xsl:template match="*[local-name()='fn']" mode="simple-table-colspan"/><xsl:template match="*[local-name()='th'] | *[local-name()='td']" mode="simple-table-colspan">
3117
3441
  <xsl:choose>
3118
3442
  <xsl:when test="@colspan">
3119
3443
  <xsl:variable name="td">
@@ -3135,16 +3459,16 @@
3135
3459
  </xsl:element>
3136
3460
  </xsl:otherwise>
3137
3461
  </xsl:choose>
3138
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="@colspan" mode="simple-table-colspan"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tr']" mode="simple-table-colspan">
3462
+ </xsl:template><xsl:template match="@colspan" mode="simple-table-colspan"/><xsl:template match="*[local-name()='tr']" mode="simple-table-colspan">
3139
3463
  <xsl:element name="tr">
3140
3464
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
3141
3465
  <xsl:apply-templates mode="simple-table-colspan"/>
3142
3466
  </xsl:element>
3143
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="@*|node()" mode="simple-table-colspan">
3467
+ </xsl:template><xsl:template match="@*|node()" mode="simple-table-colspan">
3144
3468
  <xsl:copy>
3145
3469
  <xsl:apply-templates select="@*|node()" mode="simple-table-colspan"/>
3146
3470
  </xsl:copy>
3147
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="repeatNode">
3471
+ </xsl:template><xsl:template name="repeatNode">
3148
3472
  <xsl:param name="count"/>
3149
3473
  <xsl:param name="node"/>
3150
3474
 
@@ -3155,18 +3479,18 @@
3155
3479
  </xsl:call-template>
3156
3480
  <xsl:copy-of select="$node"/>
3157
3481
  </xsl:if>
3158
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="@*|node()" mode="simple-table-rowspan">
3482
+ </xsl:template><xsl:template match="@*|node()" mode="simple-table-rowspan">
3159
3483
  <xsl:copy>
3160
3484
  <xsl:apply-templates select="@*|node()" mode="simple-table-rowspan"/>
3161
3485
  </xsl:copy>
3162
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="tbody" mode="simple-table-rowspan">
3486
+ </xsl:template><xsl:template match="tbody" mode="simple-table-rowspan">
3163
3487
  <xsl:copy>
3164
3488
  <xsl:copy-of select="tr[1]"/>
3165
3489
  <xsl:apply-templates select="tr[2]" mode="simple-table-rowspan">
3166
3490
  <xsl:with-param name="previousRow" select="tr[1]"/>
3167
3491
  </xsl:apply-templates>
3168
3492
  </xsl:copy>
3169
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="tr" mode="simple-table-rowspan">
3493
+ </xsl:template><xsl:template match="tr" mode="simple-table-rowspan">
3170
3494
  <xsl:param name="previousRow"/>
3171
3495
  <xsl:variable name="currentRow" select="."/>
3172
3496
 
@@ -3200,43 +3524,53 @@
3200
3524
  <xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan">
3201
3525
  <xsl:with-param name="previousRow" select="$newRow"/>
3202
3526
  </xsl:apply-templates>
3203
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="getLang">
3527
+ </xsl:template><xsl:template name="getLang">
3204
3528
  <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3205
3529
  <xsl:choose>
3206
3530
  <xsl:when test="$language = 'English'">en</xsl:when>
3207
3531
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
3208
3532
  </xsl:choose>
3209
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="capitalizeWords">
3533
+ </xsl:template><xsl:template name="capitalizeWords">
3210
3534
  <xsl:param name="str"/>
3211
3535
  <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
3212
3536
  <xsl:choose>
3213
3537
  <xsl:when test="contains($str2, ' ')">
3214
3538
  <xsl:variable name="substr" select="substring-before($str2, ' ')"/>
3215
- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
3216
- <xsl:value-of select="substring($substr, 2)"/>
3539
+ <!-- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
3540
+ <xsl:value-of select="substring($substr, 2)"/> -->
3541
+ <xsl:call-template name="capitalize">
3542
+ <xsl:with-param name="str" select="$substr"/>
3543
+ </xsl:call-template>
3217
3544
  <xsl:text> </xsl:text>
3218
3545
  <xsl:call-template name="capitalizeWords">
3219
3546
  <xsl:with-param name="str" select="substring-after($str2, ' ')"/>
3220
3547
  </xsl:call-template>
3221
3548
  </xsl:when>
3222
3549
  <xsl:otherwise>
3223
- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
3224
- <xsl:value-of select="substring($str2, 2)"/>
3550
+ <!-- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
3551
+ <xsl:value-of select="substring($str2, 2)"/> -->
3552
+ <xsl:call-template name="capitalize">
3553
+ <xsl:with-param name="str" select="$str2"/>
3554
+ </xsl:call-template>
3225
3555
  </xsl:otherwise>
3226
3556
  </xsl:choose>
3227
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="mathml:math">
3557
+ </xsl:template><xsl:template name="capitalize">
3558
+ <xsl:param name="str"/>
3559
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
3560
+ <xsl:value-of select="substring($str, 2)"/>
3561
+ </xsl:template><xsl:template match="mathml:math">
3228
3562
  <fo:inline font-family="STIX2Math">
3229
3563
  <fo:instream-foreign-object fox:alt-text="Math">
3230
3564
  <xsl:copy-of select="."/>
3231
3565
  </fo:instream-foreign-object>
3232
3566
  </fo:inline>
3233
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='localityStack']">
3567
+ </xsl:template><xsl:template match="*[local-name()='localityStack']">
3234
3568
  <xsl:for-each select="*[local-name()='locality']">
3235
3569
  <xsl:if test="position() =1"><xsl:text>, </xsl:text></xsl:if>
3236
3570
  <xsl:apply-templates select="."/>
3237
3571
  <xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if>
3238
3572
  </xsl:for-each>
3239
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='link']" name="link">
3573
+ </xsl:template><xsl:template match="*[local-name()='link']" name="link">
3240
3574
  <xsl:variable name="target">
3241
3575
  <xsl:choose>
3242
3576
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
@@ -3266,7 +3600,7 @@
3266
3600
  </xsl:otherwise>
3267
3601
  </xsl:choose>
3268
3602
  </fo:inline>
3269
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='sourcecode']" name="sourcecode">
3603
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
3270
3604
  <fo:block xsl:use-attribute-sets="sourcecode-style">
3271
3605
  <!-- <xsl:choose>
3272
3606
  <xsl:when test="@lang = 'en'"></xsl:when>
@@ -3277,19 +3611,29 @@
3277
3611
  </xsl:choose> -->
3278
3612
  <xsl:apply-templates/>
3279
3613
  </fo:block>
3280
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='bookmark']">
3614
+ </xsl:template><xsl:template match="*[local-name()='bookmark']">
3281
3615
  <fo:inline id="{@id}"/>
3282
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']">
3616
+ </xsl:template><xsl:template match="*[local-name()='appendix']">
3283
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>
3284
3623
  <fo:inline padding-right="5mm"><xsl:value-of select="$title-appendix"/> <xsl:number/></fo:inline>
3285
3624
  <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
3286
3625
  </fo:block>
3287
3626
  <xsl:apply-templates/>
3288
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3627
+ </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3289
3628
  <fo:inline><xsl:apply-templates/></fo:inline>
3290
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']//*[local-name()='example']">
3629
+ </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']">
3291
3630
  <fo:block xsl:use-attribute-sets="appendix-example-style">
3292
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>
3293
3637
  <xsl:value-of select="$title-example"/>
3294
3638
  <xsl:if test="count(ancestor::*[local-name()='clause'][1]//*[local-name()='example']) &gt; 1">
3295
3639
  <xsl:number count="*[local-name()='example'][ancestor::*[local-name()='clause'][@id = $claims_id]]" level="any"/><xsl:text> </xsl:text>
@@ -3299,11 +3643,11 @@
3299
3643
  </xsl:if>
3300
3644
  </fo:block>
3301
3645
  <xsl:apply-templates/>
3302
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']//*[local-name()='example']/*[local-name()='name']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']//*[local-name()='example']/*[local-name()='name']" mode="process">
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">
3303
3647
  <fo:inline><xsl:apply-templates/></fo:inline>
3304
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name() = 'callout']">
3648
+ </xsl:template><xsl:template match="*[local-name() = 'callout']">
3305
3649
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
3306
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name() = 'annotation']">
3650
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']">
3307
3651
  <xsl:variable name="annotation-id" select="@id"/>
3308
3652
  <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
3309
3653
  <fo:block id="{$annotation-id}" white-space="nowrap">
@@ -3313,14 +3657,25 @@
3313
3657
  </xsl:apply-templates>
3314
3658
  </fo:inline>
3315
3659
  </fo:block>
3316
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name() = 'annotation']/*[local-name() = 'p']">
3660
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
3317
3661
  <xsl:param name="callout"/>
3318
3662
  <fo:inline id="{@id}">
3319
3663
  <!-- for first p in annotation, put <x> -->
3320
3664
  <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
3321
3665
  <xsl:apply-templates/>
3322
3666
  </fo:inline>
3323
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="convertDate">
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>
3673
+ <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>
3676
+ </xsl:choose>
3677
+ <xsl:apply-templates/>
3678
+ </xsl:template><xsl:template name="convertDate">
3324
3679
  <xsl:param name="date"/>
3325
3680
  <xsl:param name="format" select="'short'"/>
3326
3681
  <xsl:variable name="year" select="substring($date, 1, 4)"/>
@@ -3353,7 +3708,7 @@
3353
3708
  </xsl:choose>
3354
3709
  </xsl:variable>
3355
3710
  <xsl:value-of select="$result"/>
3356
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="insertKeywords">
3711
+ </xsl:template><xsl:template name="insertKeywords">
3357
3712
  <xsl:param name="sorting" select="'true'"/>
3358
3713
  <xsl:param name="charAtEnd" select="'.'"/>
3359
3714
  <xsl:param name="charDelim" select="', '"/>
@@ -3376,7 +3731,7 @@
3376
3731
  </xsl:for-each>
3377
3732
  </xsl:otherwise>
3378
3733
  </xsl:choose>
3379
- </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="insertKeyword">
3734
+ </xsl:template><xsl:template name="insertKeyword">
3380
3735
  <xsl:param name="charAtEnd"/>
3381
3736
  <xsl:param name="charDelim"/>
3382
3737
  <xsl:apply-templates/>
@@ -3384,4 +3739,105 @@
3384
3739
  <xsl:when test="position() != last()"><xsl:value-of select="$charDelim"/></xsl:when>
3385
3740
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
3386
3741
  </xsl:choose>
3742
+ </xsl:template><xsl:template name="addPDFUAmeta">
3743
+ <fo:declarations>
3744
+ <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
3745
+ <pdf:dictionary type="normal" key="ViewerPreferences">
3746
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
3747
+ </pdf:dictionary>
3748
+ </pdf:catalog>
3749
+ <x:xmpmeta xmlns:x="adobe:ns:meta/">
3750
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
3751
+ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
3752
+ <!-- Dublin Core properties go here -->
3753
+ <dc:title>
3754
+ <xsl:variable name="title">
3755
+
3756
+
3757
+ <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en']"/>
3758
+
3759
+
3760
+
3761
+ </xsl:variable>
3762
+ <xsl:choose>
3763
+ <xsl:when test="normalize-space($title) != ''">
3764
+ <xsl:value-of select="$title"/>
3765
+ </xsl:when>
3766
+ <xsl:otherwise>
3767
+ <xsl:text> </xsl:text>
3768
+ </xsl:otherwise>
3769
+ </xsl:choose>
3770
+ </dc:title>
3771
+ <dc:creator>
3772
+
3773
+
3774
+ </dc:creator>
3775
+ <dc:description>
3776
+ <xsl:variable name="abstract">
3777
+
3778
+
3779
+
3780
+
3781
+ <xsl:copy-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'abstract']//text()"/>
3782
+
3783
+ </xsl:variable>
3784
+ <xsl:value-of select="normalize-space($abstract)"/>
3785
+ </dc:description>
3786
+ <pdf:Keywords>
3787
+ <xsl:call-template name="insertKeywords"/>
3788
+ </pdf:Keywords>
3789
+ </rdf:Description>
3790
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
3791
+ <!-- XMP properties go here -->
3792
+ <xmp:CreatorTool/>
3793
+ </rdf:Description>
3794
+ </rdf:RDF>
3795
+ </x:xmpmeta>
3796
+ </fo:declarations>
3797
+ </xsl:template><xsl:template name="getId">
3798
+ <xsl:choose>
3799
+ <xsl:when test="../@id">
3800
+ <xsl:value-of select="../@id"/>
3801
+ </xsl:when>
3802
+ <xsl:otherwise>
3803
+ <!-- <xsl:value-of select="concat(local-name(..), '_', text())"/> -->
3804
+ <xsl:value-of select="concat(generate-id(..), '_', text())"/>
3805
+ </xsl:otherwise>
3806
+ </xsl:choose>
3807
+ </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']"/>
3829
+ </xsl:template><xsl:template name="split">
3830
+ <xsl:param name="pText" select="."/>
3831
+ <xsl:param name="sep" select="','"/>
3832
+ <xsl:if test="string-length($pText) &gt;0">
3833
+ <item>
3834
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
3835
+ </item>
3836
+ <xsl:call-template name="split">
3837
+ <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
3838
+ <xsl:with-param name="sep" select="$sep"/>
3839
+ </xsl:call-template>
3840
+ </xsl:if>
3841
+ </xsl:template><xsl:template name="getDocumentId">
3842
+ <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
3387
3843
  </xsl:template></xsl:stylesheet>