metanorma-cc 1.4.0 → 1.5.1

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: 56fef26c5b91b3bee1ea7a6ee062a171358e56ab8e64745d81b9ff16ede6f32d
4
- data.tar.gz: 66eef153e867f2e5854c207059efa4bca7ffc1d5753a990f191711b1092ecf0e
3
+ metadata.gz: b777189df0dcda0fc49be5e385efb30eba5cc182f5cd0461adf8bd5d05c2ed78
4
+ data.tar.gz: 698ee6cae298e5f62b5685f91f3e98065d1eddf60ef2c7c5ca0a839677219774
5
5
  SHA512:
6
- metadata.gz: 4296a74e2a8118436c957b6838230b7aaeda4dd8ee6a3319f4b9653c6557b847e01c2ca0bf8419b3bae30f09000b823a4a2cc2013a67302acea7c1e96c7a7a52
7
- data.tar.gz: 36dd42a00a2eb5ba70264ea0871a936f6174dbf3ec1938047f063e21a1dbe70439853445a3c418a6d72d63dee2c20b969781cd14b9d5107cfaf17dd23c70708b
6
+ metadata.gz: d7f991613a144f45a42794374726472da11a6471b221cb99fa23f11cd07098620b33473c3f464bfce4950fcf52c90cb4034f15c7fd91c12d095bb7b00ab79869
7
+ data.tar.gz: 5d842773cad0f757cd80074a8a8cbf4620d634066ced880298f2d1e73198c96fc7b3f0d86b8eafb0eebd5f787d1b14d6a39d802d3482b23ffe8a5379bfd0d04f
@@ -29,7 +29,6 @@ jobs:
29
29
  uses: actions/setup-ruby@v1
30
30
  with:
31
31
  ruby-version: ${{ matrix.ruby }}
32
- architecture: 'x64'
33
32
  - name: Update gems
34
33
  run: |
35
34
  sudo gem install bundler --force
@@ -31,7 +31,6 @@ jobs:
31
31
  uses: actions/setup-ruby@v1
32
32
  with:
33
33
  ruby-version: ${{ matrix.ruby }}
34
- architecture: 'x64'
35
34
  - name: Update gems
36
35
  run: |
37
36
  gem install bundler
@@ -39,15 +38,19 @@ jobs:
39
38
  - name: Run specs
40
39
  run: |
41
40
  bundle exec rake
42
- - name: Trigger dependent repositories
43
- if: github.ref == 'refs/heads/master' && matrix.ruby == '2.6'
41
+ - name: Trigger repositories
42
+ if: matrix.ruby == '2.6'
44
43
  env:
45
- GH_USERNAME: ${{ secrets.PAT_USERNAME }}
46
- GH_ACCESS_TOKEN: ${{ secrets.PAT_TOKEN }}
44
+ GH_USERNAME: metanorma-ci
45
+ GH_ACCESS_TOKEN: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
47
46
  run: |
48
47
  curl -LO --retry 3 https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/trigger-gh-actions.sh
49
48
  [[ -f ".github/workflows/dependent_repos.env" ]] && source .github/workflows/dependent_repos.env
50
- for repo in $DEPENDENT_REPOS
49
+ CLIENT_PAYLOAD=$(cat <<EOF
50
+ "{ "ref": "${GITHUB_REF}", "repo": "${GITHUB_REPOSITORY}" }"
51
+ EOF
52
+ )
53
+ for repo in $REPOS
51
54
  do
52
- sh trigger-gh-actions.sh $ORGANISATION $repo $GH_USERNAME $GH_ACCESS_TOKEN $GITHUB_REPOSITORY "{ \"ref\": \"${GITHUB_REF}\" }"
55
+ sh trigger-gh-actions.sh $ORGANISATION $repo $GH_USERNAME $GH_ACCESS_TOKEN $GITHUB_REPOSITORY "$CLIENT_PAYLOAD"
53
56
  done
@@ -29,7 +29,6 @@ jobs:
29
29
  uses: actions/setup-ruby@v1
30
30
  with:
31
31
  ruby-version: ${{ matrix.ruby }}
32
- architecture: 'x64'
33
32
  - name: Update gems
34
33
  shell: pwsh
35
34
  run: |
data/Rakefile CHANGED
@@ -1,6 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
+ require 'isodoc/gem_tasks'
3
4
 
5
+ IsoDoc::GemTasks.install
4
6
  RSpec::Core::RakeTask.new(:spec)
5
7
 
6
8
  task :default => :spec
@@ -27,9 +27,12 @@ module Asciidoctor
27
27
  def outputs(node, ret)
28
28
  File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
29
29
  presentation_xml_converter(node).convert(@filename + ".xml")
30
- html_converter(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}.html")
31
- doc_converter(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}.doc")
32
- pdf_converter(node)&.convert(@filename + ".presentation.xml", nil, false, "#{@filename}.pdf")
30
+ html_converter(node).convert(@filename + ".presentation.xml",
31
+ nil, false, "#{@filename}.html")
32
+ doc_converter(node).convert(@filename + ".presentation.xml",
33
+ nil, false, "#{@filename}.doc")
34
+ pdf_converter(node)&.convert(@filename + ".presentation.xml",
35
+ nil, false, "#{@filename}.pdf")
33
36
  end
34
37
 
35
38
  def validate(doc)
@@ -4,26 +4,9 @@ require "fileutils"
4
4
 
5
5
  module Asciidoctor
6
6
  module CC
7
-
8
7
  class Converter < Standoc::Converter
9
-
10
- def metadata_author(node, xml)
11
- xml.contributor do |c|
12
- c.role **{ type: "author" }
13
- c.organization do |a|
14
- a.name "CalConnect"
15
- end
16
- end
17
- personal_author(node, xml)
18
- end
19
-
20
- def metadata_publisher(node, xml)
21
- xml.contributor do |c|
22
- c.role **{ type: "publisher" }
23
- c.organization do |a|
24
- a.name "CalConnect"
25
- end
26
- end
8
+ def default_publisher
9
+ "CalConnect"
27
10
  end
28
11
 
29
12
  def metadata_committee(node, xml)
@@ -76,18 +59,6 @@ module Asciidoctor
76
59
  end
77
60
  d
78
61
  end
79
-
80
- def metadata_copyright(node, xml)
81
- from = node.attr("copyright-year") || Date.today.year
82
- xml.copyright do |c|
83
- c.from from
84
- c.owner do |owner|
85
- owner.organization do |o|
86
- o.name "CalConnect"
87
- end
88
- end
89
- end
90
- end
91
62
  end
92
63
  end
93
64
  end
@@ -922,6 +922,9 @@
922
922
  <optional>
923
923
  <attribute name="script"/>
924
924
  </optional>
925
+ <optional>
926
+ <attribute name="type"/>
927
+ </optional>
925
928
  <optional>
926
929
  <attribute name="obligation">
927
930
  <choice>
@@ -961,9 +964,6 @@
961
964
  </define>
962
965
  <define name="content-subsection">
963
966
  <element name="clause">
964
- <optional>
965
- <attribute name="type"/>
966
- </optional>
967
967
  <ref name="Content-Section"/>
968
968
  </element>
969
969
  </define>
@@ -992,6 +992,9 @@
992
992
  </choice>
993
993
  </attribute>
994
994
  </optional>
995
+ <optional>
996
+ <attribute name="type"/>
997
+ </optional>
995
998
  <optional>
996
999
  <ref name="section-title"/>
997
1000
  </optional>
@@ -1011,9 +1014,6 @@
1011
1014
  </define>
1012
1015
  <define name="clause">
1013
1016
  <element name="clause">
1014
- <optional>
1015
- <attribute name="type"/>
1016
- </optional>
1017
1017
  <ref name="Clause-Section"/>
1018
1018
  </element>
1019
1019
  </define>
@@ -1042,6 +1042,9 @@
1042
1042
  </choice>
1043
1043
  </attribute>
1044
1044
  </optional>
1045
+ <optional>
1046
+ <attribute name="type"/>
1047
+ </optional>
1045
1048
  <optional>
1046
1049
  <ref name="section-title"/>
1047
1050
  </optional>
@@ -1180,6 +1183,9 @@
1180
1183
  <optional>
1181
1184
  <attribute name="script"/>
1182
1185
  </optional>
1186
+ <optional>
1187
+ <attribute name="type"/>
1188
+ </optional>
1183
1189
  <optional>
1184
1190
  <attribute name="obligation">
1185
1191
  <choice>
@@ -30,9 +30,10 @@ module Asciidoctor
30
30
 
31
31
  def seqcheck(names, msg, accepted)
32
32
  n = names.shift
33
- unless accepted.include? n
33
+ return [] if n.nil?
34
+ test = accepted.map { |a| n.at(a) }
35
+ if test.all? { |a| a.nil? }
34
36
  @log.add("Style", nil, msg)
35
- names = []
36
37
  end
37
38
  names
38
39
  end
@@ -43,32 +44,20 @@ module Asciidoctor
43
44
  [
44
45
  {
45
46
  msg: "Initial section must be (content) Foreword",
46
- val: [{ tag: "foreword", title: "Foreword" }],
47
+ val: ["./self::foreword"]
47
48
  },
48
49
  {
49
50
  msg: "Prefatory material must be followed by (clause) Scope",
50
- val: [{ tag: "introduction", title: "Introduction" },
51
- { tag: "clause", title: "Scope" }],
51
+ val: ["./self::introduction", "./self::clause[@type = 'scope']" ]
52
52
  },
53
53
  {
54
54
  msg: "Prefatory material must be followed by (clause) Scope",
55
- val: [{ tag: "clause", title: "Scope" }],
55
+ val: ["./self::clause[@type = 'scope']" ]
56
56
  },
57
57
  {
58
58
  msg: "Normative References must be followed by "\
59
59
  "Terms and Definitions",
60
- val: [
61
- { tag: "terms", title: "Terms and definitions" },
62
- { tag: "clause", title: "Terms and definitions" },
63
- {
64
- tag: "terms",
65
- title: "Terms, definitions, symbols and abbreviated terms",
66
- },
67
- {
68
- tag: "clause",
69
- title: "Terms, definitions, symbols and abbreviated terms",
70
- },
71
- ],
60
+ val: ["./self::terms | .//terms"]
72
61
  },
73
62
  ].freeze
74
63
 
@@ -78,50 +67,47 @@ module Asciidoctor
78
67
  "//clause[descendant::references][not(parent::clause)]".freeze
79
68
 
80
69
  def sections_sequence_validate(root)
81
- f = root.xpath(SECTIONS_XPATH)
82
- names = f.map { |s| { tag: s.name, title: s&.at("./title")&.text } }
83
- names = seqcheck(names, SEQ[0][:msg], SEQ[0][:val]) || return
70
+ names = root.xpath(SECTIONS_XPATH)
71
+ names = seqcheck(names, SEQ[0][:msg], SEQ[0][:val])
84
72
  n = names[0]
85
- names = seqcheck(names, SEQ[1][:msg], SEQ[1][:val]) || return
86
- if n == { tag: "introduction", title: "Introduction" }
87
- names = seqcheck(names, SEQ[2][:msg], SEQ[2][:val]) || return
73
+ names = seqcheck(names, SEQ[1][:msg], SEQ[1][:val])
74
+ if n&.at("./self::introduction")
75
+ names = seqcheck(names, SEQ[2][:msg], SEQ[2][:val])
88
76
  end
89
- names = seqcheck(names, SEQ[3][:msg], SEQ[3][:val]) || return
77
+ names = seqcheck(names, SEQ[3][:msg], SEQ[3][:val])
90
78
  n = names.shift
91
- if n == { tag: "definitions", title: nil }
92
- n = names.shift || return
79
+ if n&.at("./self::definitions")
80
+ n = names.shift
93
81
  end
94
- unless n
82
+ if n.nil? || n.name != "clause"
95
83
  @log.add("Style", nil, "Document must contain at least one clause")
96
- return
97
84
  end
98
- n[:tag] == "clause" ||
85
+ n&.at("./self::clause") ||
99
86
  @log.add("Style", nil, "Document must contain clause after "\
100
87
  "Terms and Definitions")
101
- n == { tag: "clause", title: "Scope" } &&
88
+ n&.at("./self::clause[@type = 'scope']") &&
102
89
  @log.add("Style", nil, "Scope must occur before Terms and Definitions")
103
- n = names.shift || return
104
- while n[:tag] == "clause"
105
- n[:title] == "Scope" &&
90
+ n = names.shift
91
+ while n&.name == "clause"
92
+ n&.at("./self::clause[@type = 'scope']")
106
93
  @log.add("Style", nil, "Scope must occur before Terms and Definitions")
107
- n = names.shift || return
94
+ n = names.shift
108
95
  end
109
- unless n[:tag] == "annex" || n[:tag] == "references"
96
+ unless %w(annex references).include? n&.name
110
97
  @log.add("Style", nil, "Only annexes and references can follow clauses")
111
98
  end
112
- while n[:tag] == "annex"
99
+ while n&.name == "annex"
113
100
  n = names.shift
114
101
  if n.nil?
115
102
  @log.add("Style", nil, "Document must include (references) "\
116
103
  "Normative References")
117
- return
118
104
  end
119
105
  end
120
- n == { tag: "references", title: "Normative References" } ||
106
+ n&.at("./self::references[@normative = 'true']") ||
121
107
  @log.add("Style", nil, "Document must include (references) "\
122
108
  "Normative References")
123
- n = names.shift
124
- n == { tag: "references", title: "Bibliography" } ||
109
+ n = names&.shift
110
+ n&.at("./self::references[@normative = 'false']") ||
125
111
  @log.add("Style", nil, "Final section must be (references) Bibliography")
126
112
  names.empty? ||
127
113
  @log.add("Style", nil, "There are sections after the final Bibliography")
@@ -1,29 +1,8 @@
1
1
  require "isodoc"
2
- require_relative "metadata"
3
2
 
4
3
  module IsoDoc
5
4
  module CC
6
- module BaseConvert
7
- def metadata_init(lang, script, labels)
8
- @meta = Metadata.new(lang, script, labels)
9
- end
10
-
11
- def annex_name(annex, name, div)
12
- div.h1 **{ class: "Annex" } do |t|
13
- t << "#{@xrefs.anchor(annex['id'], :label)} "
14
- t.br
15
- t.b do |b|
16
- name&.children&.each { |c2| parse(c2, b) }
17
- end
18
- end
19
- end
20
-
21
- def i18n_init(lang, script)
22
- super
23
- @annex_lbl = "Appendix"
24
- @labels["annex"] = "Appendix"
25
- end
26
-
5
+ module BaseConvert
27
6
  def cleanup(docxml)
28
7
  super
29
8
  term_cleanup(docxml)
@@ -37,6 +16,6 @@ module IsoDoc
37
16
  end
38
17
  docxml
39
18
  end
40
- end
19
+ end
41
20
  end
42
21
  end
@@ -2,6 +2,9 @@
2
2
 
3
3
  <xsl:output version="1.0" method="xml" encoding="UTF-8" indent="no"/>
4
4
 
5
+ <xsl:param name="svg_images"/>
6
+ <xsl:variable name="images" select="document($svg_images)"/>
7
+
5
8
  <xsl:variable name="pageWidth" select="'210mm'"/>
6
9
  <xsl:variable name="pageHeight" select="'297mm'"/>
7
10
 
@@ -23,25 +26,8 @@
23
26
 
24
27
  <xsl:variable name="contents">
25
28
  <contents>
26
- <xsl:apply-templates select="/csd:csd-standard/csd:preface/node()" mode="contents"/>
27
- <!-- <xsl:with-param name="sectionNum" select="'0'"/>
28
- </xsl:apply-templates> -->
29
- <xsl:apply-templates select="/csd:csd-standard/csd:sections/csd:clause[1]" mode="contents"> <!-- [@id = '_scope'] -->
30
- <xsl:with-param name="sectionNum" select="'1'"/>
31
- </xsl:apply-templates>
32
- <xsl:apply-templates select="/csd:csd-standard/csd:bibliography/csd:references[1]" mode="contents"> <!-- [@id = '_normative_references'] -->
33
- <xsl:with-param name="sectionNum" select="'2'"/>
34
- </xsl:apply-templates>
35
- <xsl:apply-templates select="/csd:csd-standard/csd:sections/*[position() &gt; 1]" mode="contents"> <!-- @id != '_scope' -->
36
- <xsl:with-param name="sectionNumSkew" select="'1'"/>
37
- </xsl:apply-templates>
38
- <xsl:apply-templates select="/csd:csd-standard/csd:annex" mode="contents"/>
39
- <xsl:apply-templates select="/csd:csd-standard/csd:bibliography/csd:references[position() &gt; 1]" mode="contents"/> <!-- @id = '_bibliography' -->
40
-
41
- <xsl:apply-templates select="//csd:figure" mode="contents"/>
42
-
43
- <xsl:apply-templates select="//csd:table" mode="contents"/>
44
-
29
+ <xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
30
+ <xsl:call-template name="processMainSectionsDefault_Contents"/>
45
31
  </contents>
46
32
  </xsl:variable>
47
33
 
@@ -50,6 +36,7 @@
50
36
  </xsl:variable>
51
37
 
52
38
  <xsl:template match="/">
39
+ <xsl:call-template name="namespaceCheck"/>
53
40
  <fo:root font-family="SourceSansPro, STIX2Math, HanSans" font-size="10.5pt" xml:lang="{$lang}">
54
41
  <fo:layout-master-set>
55
42
  <!-- Cover page -->
@@ -62,13 +49,6 @@
62
49
  </fo:simple-page-master>
63
50
 
64
51
  <!-- Document pages -->
65
- <!-- <fo:simple-page-master master-name="document" page-width="{$pageWidth}" page-height="{$pageHeight}">
66
- <fo:region-body margin-top="23.5mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
67
- <fo:region-before extent="23.5mm"/>
68
- <fo:region-after extent="10mm"/>
69
- <fo:region-start extent="19mm"/>
70
- <fo:region-end extent="19mm"/>
71
- </fo:simple-page-master> -->
72
52
 
73
53
  <!-- Preface odd pages -->
74
54
  <fo:simple-page-master master-name="odd-preface" page-width="{$pageWidth}" page-height="{$pageHeight}">
@@ -245,38 +225,32 @@
245
225
  </xsl:variable>
246
226
  <fo:block font-size="14pt" margin-bottom="15.5pt"><xsl:value-of select="$title-toc"/></fo:block>
247
227
 
248
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true' and @level &lt;= 2][not(@level = 2 and starts-with(@section, '0'))]"><!-- skip clause from preface -->
228
+ <xsl:for-each select="xalan:nodeset($contents)//item"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
249
229
 
250
230
  <fo:block>
251
231
  <xsl:if test="@level = 1">
252
232
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
253
233
  </xsl:if>
234
+
235
+
254
236
  <fo:list-block>
255
237
  <xsl:attribute name="provisional-distance-between-starts">
256
238
  <xsl:choose>
257
239
  <!-- skip 0 section without subsections -->
258
- <xsl:when test="@section != '' and not(@display-section = 'false')">8mm</xsl:when>
240
+ <xsl:when test="@section != ''">8mm</xsl:when> <!-- and not(@display-section = 'false') -->
259
241
  <xsl:otherwise>0mm</xsl:otherwise>
260
242
  </xsl:choose>
261
243
  </xsl:attribute>
262
244
  <fo:list-item>
263
245
  <fo:list-item-label end-indent="label-end()">
264
- <fo:block>
265
- <xsl:if test="@section and not(@display-section = 'false')"> <!-- output below -->
266
- <xsl:value-of select="@section"/><xsl:text>.</xsl:text>
267
- </xsl:if>
246
+ <fo:block>
247
+ <xsl:value-of select="@section"/>
268
248
  </fo:block>
269
249
  </fo:list-item-label>
270
250
  <fo:list-item-body start-indent="body-start()">
271
251
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
272
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
273
- <xsl:if test="@section and @display-section = 'false'">
274
- <xsl:value-of select="@section"/><xsl:text> </xsl:text>
275
- </xsl:if>
276
- <xsl:if test="@addon != ''">
277
- <xsl:text>(</xsl:text><xsl:value-of select="@addon"/><xsl:text>)</xsl:text>
278
- </xsl:if>
279
- <xsl:text> </xsl:text><xsl:value-of select="text()"/>
252
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
253
+ <xsl:apply-templates/>
280
254
  <fo:inline keep-together.within-line="always">
281
255
  <fo:leader leader-pattern="dots"/>
282
256
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
@@ -290,8 +264,8 @@
290
264
  </xsl:for-each>
291
265
  </fo:block-container>
292
266
 
293
- <!-- Foreword, Introduction -->
294
- <xsl:apply-templates select="/csd:csd-standard/csd:preface/node()"/>
267
+ <!-- Foreword, Introduction -->
268
+ <xsl:call-template name="processPrefaceSectionsDefault"/>
295
269
 
296
270
  </fo:flow>
297
271
  </fo:page-sequence>
@@ -310,22 +284,7 @@
310
284
  <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:title[@language = 'en']"/>
311
285
  </fo:block>
312
286
  <fo:block>
313
- <xsl:apply-templates select="/csd:csd-standard/csd:sections/csd:clause[1]"> <!-- Scope -->
314
- <xsl:with-param name="sectionNum" select="'1'"/>
315
- </xsl:apply-templates>
316
- <!-- Normative references -->
317
- <xsl:apply-templates select="/csd:csd-standard/csd:bibliography/csd:references[1]">
318
- <xsl:with-param name="sectionNum" select="'2'"/>
319
- </xsl:apply-templates>
320
-
321
- <!-- Other Sections -->
322
- <xsl:apply-templates select="/csd:csd-standard/csd:sections/*[position() &gt; 1]">
323
- <xsl:with-param name="sectionNumSkew" select="'1'"/>
324
- </xsl:apply-templates>
325
-
326
- <xsl:apply-templates select="/csd:csd-standard/csd:annex"/>
327
- <xsl:apply-templates select="/csd:csd-standard/csd:bibliography/csd:references[position() &gt; 1]"/>
328
-
287
+ <xsl:call-template name="processMainSectionsDefault"/>
329
288
  </fo:block>
330
289
  </fo:flow>
331
290
  </fo:page-sequence>
@@ -335,168 +294,53 @@
335
294
  </fo:root>
336
295
  </xsl:template>
337
296
 
338
- <!-- for pass the paremeter 'sectionNum' over templates, like 'tunnel' parameter in XSLT 2.0 -->
339
297
  <xsl:template match="node()">
340
- <xsl:param name="sectionNum"/>
341
- <xsl:param name="sectionNumSkew"/>
342
- <xsl:apply-templates>
343
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
344
- <xsl:with-param name="sectionNumSkew" select="$sectionNumSkew"/>
345
- </xsl:apply-templates>
298
+ <xsl:apply-templates/>
346
299
  </xsl:template>
347
300
 
348
301
  <!-- ============================= -->
349
302
  <!-- CONTENTS -->
350
303
  <!-- ============================= -->
351
- <xsl:template match="node()" mode="contents">
352
- <xsl:param name="sectionNum"/>
353
- <xsl:param name="sectionNumSkew"/>
354
- <xsl:apply-templates mode="contents">
355
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
356
- <xsl:with-param name="sectionNumSkew" select="$sectionNumSkew"/>
357
- </xsl:apply-templates>
304
+ <xsl:template match="node()" mode="contents">
305
+ <xsl:apply-templates mode="contents"/>
358
306
  </xsl:template>
359
307
 
360
-
361
- <!-- calculate main section number (1,2,3) and pass it deep into templates -->
362
- <!-- it's necessary, because there is itu:bibliography/itu:references from other section, but numbering should be sequental -->
363
- <xsl:template match="csd:csd-standard/csd:sections/*" mode="contents">
364
- <xsl:param name="sectionNum"/>
365
- <xsl:param name="sectionNumSkew" select="0"/>
366
- <xsl:variable name="sectionNum_">
367
- <xsl:choose>
368
- <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
369
- <xsl:when test="$sectionNumSkew != 0">
370
- <xsl:variable name="number"><xsl:number count="*"/></xsl:variable> <!-- csd:sections/csd:clause | csd:sections/csd:terms -->
371
- <xsl:value-of select="$number + $sectionNumSkew"/>
372
- </xsl:when>
373
- <xsl:otherwise>
374
- <xsl:number count="*"/>
375
- </xsl:otherwise>
376
- </xsl:choose>
377
- </xsl:variable>
378
- <xsl:apply-templates mode="contents">
379
- <xsl:with-param name="sectionNum" select="$sectionNum_"/>
380
- </xsl:apply-templates>
381
- </xsl:template>
382
-
383
- <!-- Any node with title element - clause, definition, annex,... -->
384
- <xsl:template match="csd:title | csd:preferred" mode="contents">
385
- <xsl:param name="sectionNum"/>
386
- <!-- sectionNum=<xsl:value-of select="$sectionNum"/> -->
387
- <xsl:variable name="id">
388
- <xsl:call-template name="getId"/>
389
- </xsl:variable>
390
-
308
+ <!-- element with title -->
309
+ <xsl:template match="*[csd:title]" mode="contents">
391
310
  <xsl:variable name="level">
392
- <xsl:call-template name="getLevel"/>
393
- </xsl:variable>
394
-
395
- <xsl:variable name="section">
396
- <xsl:call-template name="getSection">
397
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
311
+ <xsl:call-template name="getLevel">
312
+ <xsl:with-param name="depth" select="csd:title/@depth"/>
398
313
  </xsl:call-template>
399
314
  </xsl:variable>
400
315
 
401
316
  <xsl:variable name="display">
402
317
  <xsl:choose>
403
- <xsl:when test="ancestor::csd:bibitem">false</xsl:when>
404
- <xsl:when test="ancestor::csd:term">false</xsl:when>
405
- <xsl:when test="ancestor::csd:annex and $level &gt;= 2">false</xsl:when>
406
- <xsl:when test="$level &lt;= 3">true</xsl:when>
407
- <xsl:otherwise>false</xsl:otherwise>
408
- </xsl:choose>
409
- </xsl:variable>
410
-
411
- <xsl:variable name="display-section">
412
- <xsl:choose>
413
- <xsl:when test="ancestor::csd:annex">false</xsl:when>
318
+ <xsl:when test="ancestor-or-self::csd:bibitem">false</xsl:when>
319
+ <xsl:when test="ancestor-or-self::csd:term">false</xsl:when>
320
+ <xsl:when test="$level &gt; 2">false</xsl:when>
414
321
  <xsl:otherwise>true</xsl:otherwise>
415
322
  </xsl:choose>
416
323
  </xsl:variable>
417
324
 
418
- <xsl:variable name="type">
419
- <xsl:value-of select="local-name(..)"/>
420
- </xsl:variable>
421
-
422
- <xsl:variable name="root">
423
- <xsl:choose>
424
- <xsl:when test="ancestor::csd:annex">annex</xsl:when>
425
- <xsl:when test="ancestor::csd:clause">clause</xsl:when>
426
- </xsl:choose>
427
- </xsl:variable>
428
-
429
- <item id="{$id}" level="{$level}" section="{$section}" display-section="{$display-section}" display="{$display}" type="{$type}" root="{$root}">
430
- <xsl:attribute name="addon">
431
- <xsl:if test="local-name(..) = 'annex'"><xsl:value-of select="../@obligation"/></xsl:if>
432
- </xsl:attribute>
433
- <xsl:value-of select="."/>
434
- </item>
325
+ <xsl:if test="$display = 'true'">
435
326
 
436
- <xsl:apply-templates mode="contents">
437
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
438
- </xsl:apply-templates>
327
+ <xsl:variable name="section">
328
+ <xsl:call-template name="getSection"/>
329
+ </xsl:variable>
330
+
331
+ <xsl:variable name="title">
332
+ <xsl:call-template name="getName"/>
333
+ </xsl:variable>
334
+
335
+ <item id="{@id}" level="{$level}" section="{$section}">
336
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
337
+ </item>
338
+ <xsl:apply-templates mode="contents"/>
339
+ </xsl:if>
439
340
 
440
341
  </xsl:template>
441
342
 
442
343
 
443
- <xsl:template match="csd:figure" mode="contents">
444
- <item level="" id="{@id}" display="false">
445
- <xsl:attribute name="section">
446
- <xsl:variable name="title-figure">
447
- <xsl:call-template name="getTitle">
448
- <xsl:with-param name="name" select="'title-figure'"/>
449
- </xsl:call-template>
450
- </xsl:variable>
451
- <xsl:value-of select="$title-figure"/><xsl:number format="A.1-1" level="multiple" count="csd:annex | csd:figure"/>
452
- </xsl:attribute>
453
- </item>
454
- </xsl:template>
455
-
456
-
457
- <xsl:template match="csd:table" mode="contents">
458
- <xsl:param name="sectionNum"/>
459
- <xsl:variable name="annex-id" select="ancestor::csd:annex/@id"/>
460
- <item level="" id="{@id}" display="false" type="table">
461
- <xsl:attribute name="section">
462
- <xsl:variable name="title-table">
463
- <xsl:call-template name="getTitle">
464
- <xsl:with-param name="name" select="'title-table'"/>
465
- </xsl:call-template>
466
- </xsl:variable>
467
- <xsl:value-of select="$title-table"/>
468
- <xsl:choose>
469
- <xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
470
- <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table']"/>
471
- </xsl:when>
472
- <xsl:when test="ancestor::*[local-name()='annex']">
473
- <xsl:number format="A-" count="csd:annex"/>
474
- <xsl:number format="1" level="any" count="csd:table[ancestor::csd:annex[@id = $annex-id]]"/>
475
- </xsl:when>
476
- <xsl:otherwise>
477
- <!-- <xsl:number format="1"/> -->
478
- <xsl:number format="1" level="any" count="*[local-name()='sections']//*[local-name()='table']"/>
479
- </xsl:otherwise>
480
- </xsl:choose>
481
- </xsl:attribute>
482
- <xsl:value-of select="csd:name/text()"/>
483
- </item>
484
- </xsl:template>
485
-
486
-
487
-
488
- <xsl:template match="csd:formula" mode="contents">
489
- <item level="" id="{@id}" display="false">
490
- <xsl:attribute name="section">
491
- <xsl:variable name="title-formula">
492
- <xsl:call-template name="getTitle">
493
- <xsl:with-param name="name" select="'title-formula'"/>
494
- </xsl:call-template>
495
- </xsl:variable>
496
- <xsl:value-of select="$title-formula"/><xsl:number format="(A.1)" level="multiple" count="csd:annex | csd:formula"/>
497
- </xsl:attribute>
498
- </item>
499
- </xsl:template>
500
344
  <!-- ============================= -->
501
345
  <!-- ============================= -->
502
346
 
@@ -546,90 +390,14 @@
546
390
  </fo:block>
547
391
  </xsl:template>
548
392
 
549
- <!-- Foreword, Introduction -->
550
- <xsl:template match="csd:csd-standard/csd:preface/*">
551
- <fo:block break-after="page"/>
552
- <!-- <fo:block> -->
553
- <xsl:apply-templates/>
554
- <!-- </fo:block> -->
555
- </xsl:template>
556
-
557
-
558
-
559
- <!-- clause, terms, clause, ...-->
560
- <xsl:template match="csd:csd-standard/csd:sections/*">
561
- <xsl:param name="sectionNum"/>
562
- <xsl:param name="sectionNumSkew" select="0"/>
563
- <fo:block>
564
- <xsl:variable name="pos"><xsl:number count="csd:sections/csd:clause | csd:sections/csd:terms"/></xsl:variable>
565
- <xsl:if test="$pos &gt;= 2">
566
- <xsl:attribute name="space-before">18pt</xsl:attribute>
567
- </xsl:if>
568
- <!-- pos=<xsl:value-of select="$pos" /> -->
569
- <xsl:variable name="sectionNum_">
570
- <xsl:choose>
571
- <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
572
- <xsl:when test="$sectionNumSkew != 0">
573
- <xsl:variable name="number"><xsl:number count="csd:sections/csd:clause | csd:sections/csd:terms"/></xsl:variable>
574
- <xsl:value-of select="$number + $sectionNumSkew"/>
575
- </xsl:when>
576
- </xsl:choose>
577
- </xsl:variable>
578
- <xsl:if test="not(csd:title)">
579
- <fo:block margin-top="3pt" margin-bottom="12pt">
580
- <xsl:value-of select="$sectionNum_"/><xsl:number format=".1 " level="multiple" count="csd:clause"/>
581
- </fo:block>
582
- </xsl:if>
583
- <xsl:apply-templates>
584
- <xsl:with-param name="sectionNum" select="$sectionNum_"/>
585
- </xsl:apply-templates>
586
- </fo:block>
587
- </xsl:template>
588
-
589
393
 
590
394
 
591
- <xsl:template match="csd:clause//csd:clause[not(csd:title)]">
592
- <xsl:param name="sectionNum"/>
593
- <xsl:variable name="section">
594
- <xsl:call-template name="getSection">
595
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
596
- </xsl:call-template>
597
- </xsl:variable>
598
-
599
- <fo:block margin-top="3pt"><!-- margin-bottom="6pt" -->
600
- <fo:inline font-weight="bold" padding-right="3mm">
601
- <xsl:value-of select="$section"/><!-- <xsl:number format=".1 " level="multiple" count="csd:clause/csd:clause" /> -->
602
- </fo:inline>
603
- <xsl:apply-templates>
604
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
605
- <xsl:with-param name="inline" select="'true'"/>
606
- </xsl:apply-templates>
607
- </fo:block>
608
- </xsl:template>
609
-
610
-
611
395
  <xsl:template match="csd:title">
612
- <xsl:param name="sectionNum"/>
613
-
614
- <xsl:variable name="parent-name" select="local-name(..)"/>
615
- <xsl:variable name="references_num_current">
616
- <xsl:number level="any" count="csd:references"/>
617
- </xsl:variable>
618
-
619
- <xsl:variable name="id">
620
- <xsl:call-template name="getId"/>
621
- </xsl:variable>
622
396
 
623
397
  <xsl:variable name="level">
624
398
  <xsl:call-template name="getLevel"/>
625
399
  </xsl:variable>
626
-
627
- <xsl:variable name="section">
628
- <xsl:call-template name="getSection">
629
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
630
- </xsl:call-template>
631
- </xsl:variable>
632
-
400
+
633
401
  <xsl:variable name="font-size">
634
402
  <xsl:choose>
635
403
  <xsl:when test="ancestor::csd:preface">13pt</xsl:when>
@@ -650,41 +418,16 @@
650
418
  <xsl:variable name="color" select="'rgb(14, 26, 133)'"/>
651
419
 
652
420
  <xsl:element name="{$element-name}">
653
- <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
654
- <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
655
- <xsl:attribute name="font-weight">bold</xsl:attribute>
656
- <!-- <xsl:attribute name="margin-top">
657
- <xsl:choose>
658
- <xsl:when test="$level = 2 and ancestor::annex">18pt</xsl:when>
659
- <xsl:when test="$level = '' or $level = 1">6pt</xsl:when>
660
- <xsl:otherwise>12pt</xsl:otherwise>
661
- </xsl:choose>
662
- </xsl:attribute> -->
663
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
664
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
665
- <xsl:attribute name="color"><xsl:value-of select="$color"/></xsl:attribute>
666
- <xsl:if test="ancestor::csd:sections">
667
- <xsl:attribute name="margin-top">13.5pt</xsl:attribute>
668
- </xsl:if>
669
- <!-- DEBUG level=<xsl:value-of select="$level"/>x -->
670
- <!-- section=<xsl:value-of select="$sectionNum"/> -->
671
- <!-- <xsl:if test="$sectionNum"> -->
672
- <xsl:if test="$section != ''">
673
- <xsl:value-of select="$section"/><xsl:text>.</xsl:text>
674
- <xsl:choose>
675
- <xsl:when test="$level &gt;= 3">
676
- <fo:inline padding-right="2mm"> </fo:inline>
677
- </xsl:when>
678
- <xsl:when test="$level = 1">
679
- <fo:inline padding-right="2mm"> </fo:inline>
680
- </xsl:when>
681
- <xsl:otherwise>
682
- <fo:inline padding-right="1mm"> </fo:inline>
683
- </xsl:otherwise>
684
- </xsl:choose>
685
- </xsl:if>
686
- <xsl:apply-templates/>
687
- </xsl:element>
421
+ <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
422
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
423
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
424
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
425
+ <xsl:attribute name="color"><xsl:value-of select="$color"/></xsl:attribute>
426
+ <xsl:if test="ancestor::csd:sections">
427
+ <xsl:attribute name="margin-top">13.5pt</xsl:attribute>
428
+ </xsl:if>
429
+ <xsl:apply-templates/>
430
+ </xsl:element>
688
431
  </xsl:template>
689
432
 
690
433
 
@@ -763,85 +506,6 @@
763
506
  <xsl:apply-templates/>
764
507
  </xsl:template>
765
508
 
766
- <xsl:template match="csd:review">
767
- <!-- comment 2019-11-29 -->
768
- <!-- <fo:block font-weight="bold">Review:</fo:block>
769
- <xsl:apply-templates /> -->
770
- </xsl:template>
771
-
772
- <xsl:template match="text()">
773
- <xsl:value-of select="."/>
774
- </xsl:template>
775
-
776
-
777
-
778
- <xsl:template match="csd:image">
779
- <fo:block-container text-align="center">
780
- <fo:block>
781
- <fo:external-graphic src="{@src}" fox:alt-text="Image {@alt}"/>
782
- </fo:block>
783
- <xsl:variable name="title-figure">
784
- <xsl:call-template name="getTitle">
785
- <xsl:with-param name="name" select="'title-figure'"/>
786
- </xsl:call-template>
787
- </xsl:variable>
788
- <fo:block font-weight="bold" margin-top="12pt" margin-bottom="12pt"><xsl:value-of select="$title-figure"/><xsl:number format="1" level="any"/></fo:block>
789
- </fo:block-container>
790
-
791
- </xsl:template>
792
-
793
- <xsl:template match="csd:figure">
794
- <fo:block-container id="{@id}">
795
- <fo:block>
796
- <xsl:apply-templates/>
797
- </fo:block>
798
- <xsl:call-template name="fn_display_figure"/>
799
- <xsl:for-each select="csd:note//csd:p">
800
- <xsl:call-template name="note"/>
801
- </xsl:for-each>
802
- <fo:block font-weight="bold" text-align="center" margin-top="12pt" margin-bottom="12pt" keep-with-previous="always">
803
- <xsl:variable name="title-figure">
804
- <xsl:call-template name="getTitle">
805
- <xsl:with-param name="name" select="'title-figure'"/>
806
- </xsl:call-template>
807
- </xsl:variable>
808
- <xsl:choose>
809
- <xsl:when test="ancestor::csd:annex">
810
- <xsl:choose>
811
- <xsl:when test="local-name(..) = 'figure'">
812
- <xsl:number format="a) "/>
813
- </xsl:when>
814
- <xsl:otherwise>
815
- <xsl:value-of select="$title-figure"/><xsl:number format="A.1-1" level="multiple" count="csd:annex | csd:figure"/>
816
- </xsl:otherwise>
817
- </xsl:choose>
818
-
819
- </xsl:when>
820
- <xsl:otherwise>
821
- <xsl:value-of select="$title-figure"/><xsl:number format="1" level="any"/>
822
- </xsl:otherwise>
823
- </xsl:choose>
824
- <xsl:if test="csd:name">
825
- <xsl:if test="not(local-name(..) = 'figure')">
826
- <xsl:text> — </xsl:text>
827
- </xsl:if>
828
- <xsl:value-of select="csd:name"/>
829
- </xsl:if>
830
- </fo:block>
831
- </fo:block-container>
832
- </xsl:template>
833
-
834
- <xsl:template match="csd:figure/csd:name"/>
835
- <xsl:template match="csd:figure/csd:fn"/>
836
- <xsl:template match="csd:figure/csd:note"/>
837
-
838
-
839
- <xsl:template match="csd:figure/csd:image">
840
- <fo:block text-align="center">
841
- <fo:external-graphic src="{@src}" content-width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/> <!-- content-width="75%" -->
842
- </fo:block>
843
- </xsl:template>
844
-
845
509
 
846
510
  <xsl:template match="csd:bibitem">
847
511
  <fo:block id="{@id}" margin-bottom="6pt"> <!-- 12 pt -->
@@ -873,7 +537,7 @@
873
537
  </xsl:template>
874
538
 
875
539
 
876
- <xsl:template match="csd:bibitem/csd:note">
540
+ <xsl:template match="csd:bibitem/csd:note" priority="2">
877
541
  <fo:footnote>
878
542
  <xsl:variable name="number">
879
543
  <xsl:choose>
@@ -935,28 +599,15 @@
935
599
  </fo:block>
936
600
  </fo:list-item-label>
937
601
  <fo:list-item-body start-indent="body-start()">
938
- <xsl:apply-templates/>
602
+ <fo:block>
603
+ <xsl:apply-templates/>
604
+ </fo:block>
939
605
  </fo:list-item-body>
940
606
  </fo:list-item>
941
607
  </xsl:template>
942
608
 
943
-
944
- <xsl:template match="csd:term">
945
- <xsl:param name="sectionNum"/>
946
- <fo:block id="{@id}">
947
- <xsl:apply-templates>
948
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
949
- </xsl:apply-templates>
950
- </fo:block>
951
- </xsl:template>
952
-
953
- <xsl:template match="csd:preferred">
954
- <xsl:param name="sectionNum"/>
955
- <xsl:variable name="section">
956
- <xsl:call-template name="getSection">
957
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
958
- </xsl:call-template>
959
- </xsl:variable>
609
+
610
+ <xsl:template match="csd:preferred">
960
611
  <xsl:variable name="level">
961
612
  <xsl:call-template name="getLevel"/>
962
613
  </xsl:variable>
@@ -968,10 +619,7 @@
968
619
  </xsl:variable>
969
620
  <fo:block font-size="{$font-size}" line-height="1.1">
970
621
  <fo:block font-weight="bold" keep-with-next="always">
971
- <fo:inline>
972
- <xsl:value-of select="$section"/><xsl:text>.</xsl:text>
973
- <!-- <xsl:value-of select="$sectionNum"/>.<xsl:number count="csd:term"/> -->
974
- </fo:inline>
622
+ <xsl:apply-templates select="ancestor::csd:term/csd:name" mode="presentation"/>
975
623
  </fo:block>
976
624
  <fo:block font-weight="bold" keep-with-next="always">
977
625
  <xsl:apply-templates/>
@@ -979,116 +627,21 @@
979
627
  </fo:block>
980
628
  </xsl:template>
981
629
 
982
- <xsl:template match="csd:admitted">
983
- <fo:block>
984
- <xsl:apply-templates/>
985
- </fo:block>
986
- </xsl:template>
987
-
988
- <xsl:template match="csd:deprecates">
989
- <xsl:variable name="title-deprecated">
990
- <xsl:call-template name="getTitle">
991
- <xsl:with-param name="name" select="'title-deprecated'"/>
992
- </xsl:call-template>
993
- </xsl:variable>
994
- <fo:block><xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/></fo:block>
995
- </xsl:template>
996
-
997
- <xsl:template match="csd:definition[preceding-sibling::csd:domain]">
998
- <xsl:apply-templates/>
999
- </xsl:template>
1000
- <xsl:template match="csd:definition[preceding-sibling::csd:domain]/csd:p">
1001
- <fo:inline> <xsl:apply-templates/></fo:inline>
1002
- <fo:block> </fo:block>
1003
- </xsl:template>
1004
-
1005
- <xsl:template match="csd:definition">
1006
- <fo:block margin-bottom="6pt">
1007
- <xsl:apply-templates/>
1008
- </fo:block>
1009
- </xsl:template>
1010
-
1011
- <xsl:template match="csd:termsource">
1012
- <fo:block margin-bottom="8pt" keep-with-previous="always">
1013
- <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
1014
- <fo:basic-link internal-destination="{csd:origin/@bibitemid}" fox:alt-text="{csd:origin/@citeas}">
1015
- <xsl:text>[</xsl:text>
1016
- <xsl:variable name="title-source">
1017
- <xsl:call-template name="getTitle">
1018
- <xsl:with-param name="name" select="'title-source'"/>
1019
- </xsl:call-template>
1020
- </xsl:variable>
1021
- <xsl:value-of select="$title-source"/>
1022
- <xsl:text>: </xsl:text>
1023
- <xsl:value-of select="csd:origin/@citeas"/>
1024
-
1025
- <xsl:apply-templates select="csd:origin/csd:localityStack"/>
1026
-
1027
- </fo:basic-link>
1028
- <xsl:apply-templates select="csd:modification"/>
1029
- <xsl:text>]</xsl:text>
1030
- </fo:block>
1031
- </xsl:template>
1032
-
1033
- <xsl:template match="csd:modification/csd:p">
1034
- <fo:inline><xsl:apply-templates/></fo:inline>
1035
- </xsl:template>
1036
-
1037
- <xsl:template match="csd:termnote">
1038
- <fo:block font-size="10pt" margin-bottom="12pt">
1039
- <xsl:variable name="num"><xsl:number/></xsl:variable>
1040
- <xsl:variable name="title-note-to-entry">
1041
- <xsl:call-template name="getTitle">
1042
- <xsl:with-param name="name" select="'title-note-to-entry'"/>
1043
- </xsl:call-template>
1044
- </xsl:variable>
1045
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($title-note-to-entry),'#',$num)"/>
1046
- <xsl:apply-templates/>
1047
- </fo:block>
1048
- </xsl:template>
1049
-
1050
- <xsl:template match="csd:termnote/csd:p">
1051
- <fo:inline><xsl:apply-templates/></fo:inline>
1052
- </xsl:template>
1053
-
1054
- <xsl:template match="csd:domain">
1055
- <fo:inline>&lt;<xsl:apply-templates/>&gt;</fo:inline>
1056
- </xsl:template>
1057
-
1058
-
1059
- <xsl:template match="csd:termexample">
1060
- <fo:block font-size="10pt" margin-bottom="12pt">
1061
- <xsl:variable name="title-example">
1062
- <xsl:call-template name="getTitle">
1063
- <xsl:with-param name="name" select="'title-example'"/>
1064
- </xsl:call-template>
1065
- </xsl:variable>
1066
- <fo:inline padding-right="10mm"><xsl:value-of select="normalize-space($title-example)"/></fo:inline>
1067
- <xsl:apply-templates/>
1068
- </fo:block>
1069
- </xsl:template>
1070
-
1071
- <xsl:template match="csd:termexample/csd:p">
1072
- <fo:inline><xsl:apply-templates/></fo:inline>
1073
- </xsl:template>
1074
630
 
1075
-
1076
- <xsl:template match="csd:annex">
1077
- <fo:block break-after="page"/>
1078
- <xsl:apply-templates/>
1079
- </xsl:template>
1080
631
 
1081
-
632
+
1082
633
  <!-- <xsl:template match="csd:references[@id = '_bibliography']"> -->
1083
- <xsl:template match="csd:references[position() &gt; 1]">
634
+ <xsl:template match="csd:references[not(@normative='true')]">
1084
635
  <fo:block break-after="page"/>
636
+ <fo:block id="{@id}">
1085
637
  <xsl:apply-templates/>
638
+ </fo:block>
1086
639
  </xsl:template>
1087
640
 
1088
641
 
1089
642
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
1090
643
  <!-- <xsl:template match="csd:references[@id = '_bibliography']/csd:bibitem"> -->
1091
- <xsl:template match="csd:references[position() &gt; 1]/csd:bibitem">
644
+ <xsl:template match="csd:references[not(@normative='true')]/csd:bibitem">
1092
645
  <fo:list-block margin-bottom="12pt" provisional-distance-between-starts="12mm">
1093
646
  <fo:list-item>
1094
647
  <fo:list-item-label end-indent="label-end()">
@@ -1123,162 +676,27 @@
1123
676
  </xsl:template>
1124
677
 
1125
678
  <!-- <xsl:template match="csd:references[@id = '_bibliography']/csd:bibitem" mode="contents"/> -->
1126
- <xsl:template match="csd:references[position() &gt; 1]/csd:bibitem" mode="contents"/>
679
+ <xsl:template match="csd:references[not(@normative='true')]/csd:bibitem" mode="contents"/>
1127
680
 
1128
681
  <!-- <xsl:template match="csd:references[@id = '_bibliography']/csd:bibitem/csd:title"> -->
1129
- <xsl:template match="csd:references[position() &gt; 1]/csd:bibitem/csd:title">
682
+ <xsl:template match="csd:references[not(@normative='true')]/csd:bibitem/csd:title">
1130
683
  <fo:inline font-style="italic">
1131
684
  <xsl:apply-templates/>
1132
685
  </fo:inline>
1133
686
  </xsl:template>
1134
-
1135
- <xsl:template match="csd:quote">
1136
- <fo:block margin-top="12pt" margin-left="12mm" margin-right="12mm">
1137
- <xsl:apply-templates select=".//csd:p"/>
1138
- </fo:block>
1139
- <fo:block text-align="right">
1140
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
1141
- <xsl:text>— </xsl:text><xsl:value-of select="csd:author"/>
1142
- <xsl:if test="csd:source">
1143
- <xsl:text>, </xsl:text>
1144
- <xsl:apply-templates select="csd:source"/>
1145
- </xsl:if>
1146
- </fo:block>
1147
- </xsl:template>
1148
-
1149
- <xsl:template match="csd:source">
1150
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
1151
- <xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" -->
1152
- <xsl:apply-templates select="csd:localityStack"/>
1153
- </fo:basic-link>
1154
- </xsl:template>
1155
687
 
1156
688
 
1157
- <xsl:template match="csd:xref">
1158
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">
1159
- <xsl:variable name="section" select="xalan:nodeset($contents)//item[@id = current()/@target]/@section"/>
1160
- <xsl:if test="not(starts-with($section, 'Figure') or starts-with($section, 'Table'))">
689
+ <xsl:template match="csd:xref" priority="2">
690
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">
691
+ <xsl:if test="not(starts-with(text(), 'Figure') or starts-with(text(), 'Table'))">
1161
692
  <xsl:attribute name="color">blue</xsl:attribute>
1162
693
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1163
694
  </xsl:if>
1164
- <xsl:variable name="type" select="xalan:nodeset($contents)//item[@id = current()/@target]/@type"/>
1165
- <xsl:variable name="root" select="xalan:nodeset($contents)//item[@id = current()/@target]/@root"/>
1166
- <xsl:variable name="title-clause">
1167
- <xsl:call-template name="getTitle">
1168
- <xsl:with-param name="name" select="'title-clause'"/>
1169
- </xsl:call-template>
1170
- </xsl:variable>
1171
-
1172
- <xsl:choose>
1173
- <xsl:when test="$type = 'clause' and $root != 'annex'"><xsl:value-of select="$title-clause"/></xsl:when><!-- and not (ancestor::annex) -->
1174
- <xsl:when test="$type = 'term' and $root = 'clause'"><xsl:value-of select="$title-clause"/></xsl:when>
1175
- <xsl:otherwise/> <!-- <xsl:value-of select="$type"/> -->
1176
- </xsl:choose>
1177
- <xsl:value-of select="$section"/>
695
+ <xsl:apply-templates/>
1178
696
  </fo:basic-link>
1179
697
  </xsl:template>
1180
698
 
1181
- <xsl:template match="csd:sourcecode" priority="2">
1182
- <xsl:call-template name="sourcecode"/>
1183
- <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="12pt">
1184
- <xsl:variable name="title-figure">
1185
- <xsl:call-template name="getTitle">
1186
- <xsl:with-param name="name" select="'title-figure'"/>
1187
- </xsl:call-template>
1188
- </xsl:variable>
1189
- <xsl:value-of select="$title-figure"/>
1190
- <xsl:number format="1" level="any"/>
1191
- </fo:block>
1192
- </xsl:template>
1193
-
1194
- <xsl:template match="csd:tt" priority="2">
1195
- <fo:inline font-family="SourceCodePro" font-size="10pt">
1196
- <xsl:apply-templates/>
1197
- </fo:inline>
1198
- </xsl:template>
1199
-
1200
- <xsl:template match="csd:example">
1201
- <fo:block font-size="10pt" margin-bottom="12pt" font-weight="bold" keep-with-next="always">
1202
- <xsl:variable name="title-example">
1203
- <xsl:call-template name="getTitle">
1204
- <xsl:with-param name="name" select="'title-example'"/>
1205
- </xsl:call-template>
1206
- </xsl:variable>
1207
- <xsl:value-of select="normalize-space($title-example)"/>
1208
- <xsl:if test="following-sibling::csd:example or preceding-sibling::csd:example">
1209
- <xsl:number format=" 1"/>
1210
- </xsl:if>
1211
- </fo:block>
1212
- <fo:block font-size="10pt" margin-left="12.5mm">
1213
- <xsl:apply-templates/>
1214
- </fo:block>
1215
- </xsl:template>
1216
-
1217
- <xsl:template match="csd:example/csd:p">
1218
- <fo:block margin-bottom="14pt">
1219
- <xsl:apply-templates/>
1220
- </fo:block>
1221
- </xsl:template>
1222
-
1223
- <xsl:template match="csd:note/csd:p" name="note">
1224
- <fo:block font-size="10pt" margin-bottom="12pt">
1225
- <xsl:variable name="title-note">
1226
- <xsl:call-template name="getTitle">
1227
- <xsl:with-param name="name" select="'title-note'"/>
1228
- </xsl:call-template>
1229
- </xsl:variable>
1230
- <fo:inline padding-right="6mm"><xsl:value-of select="$title-note"/><xsl:number count="csd:note"/></fo:inline>
1231
- <xsl:apply-templates/>
1232
- </fo:block>
1233
- </xsl:template>
1234
699
 
1235
- <!-- <eref type="inline" bibitemid="ISO20483" citeas="ISO 20483:2013"><locality type="annex"><referenceFrom>C</referenceFrom></locality></eref> -->
1236
- <xsl:template match="csd:eref">
1237
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}" color="blue" text-decoration="underline"> <!-- font-size="9pt" color="blue" vertical-align="super" -->
1238
- <xsl:if test="@type = 'footnote'">
1239
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
1240
- <xsl:attribute name="font-size">80%</xsl:attribute>
1241
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1242
- <xsl:attribute name="vertical-align">super</xsl:attribute>
1243
- </xsl:if>
1244
- <xsl:if test="@type = 'inline'">
1245
- <xsl:attribute name="color">blue</xsl:attribute>
1246
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1247
- </xsl:if>
1248
- <!-- <xsl:if test="@type = 'inline'">
1249
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1250
- </xsl:if> -->
1251
- <xsl:choose>
1252
- <xsl:when test="@citeas">
1253
- <xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" -->
1254
- </xsl:when>
1255
- <xsl:when test="@bibitemid">
1256
- <xsl:value-of select="//csd:bibitem[@id = current()/@bibitemid]/csd:docidentifier"/>
1257
- </xsl:when>
1258
- <xsl:otherwise/>
1259
- </xsl:choose>
1260
- <xsl:apply-templates select="csd:localityStack"/>
1261
- </fo:basic-link>
1262
- </xsl:template>
1263
-
1264
- <xsl:template match="csd:locality">
1265
- <xsl:variable name="title-clause">
1266
- <xsl:call-template name="getTitle">
1267
- <xsl:with-param name="name" select="'title-clause'"/>
1268
- </xsl:call-template>
1269
- </xsl:variable>
1270
- <xsl:variable name="title-annex">
1271
- <xsl:call-template name="getTitle">
1272
- <xsl:with-param name="name" select="'title-annex'"/>
1273
- </xsl:call-template>
1274
- </xsl:variable>
1275
- <xsl:choose>
1276
- <xsl:when test="@type ='clause'"><xsl:value-of select="$title-clause"/></xsl:when>
1277
- <xsl:when test="@type ='annex'"><xsl:value-of select="$title-annex"/></xsl:when>
1278
- <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
1279
- </xsl:choose>
1280
- <xsl:text> </xsl:text><xsl:value-of select="csd:referenceFrom"/>
1281
- </xsl:template>
1282
700
 
1283
701
  <xsl:template match="csd:admonition">
1284
702
  <fo:block margin-bottom="12pt" font-weight="bold"> <!-- text-align="center" -->
@@ -1288,17 +706,7 @@
1288
706
  </fo:block>
1289
707
  </xsl:template>
1290
708
 
1291
- <xsl:template match="csd:formula">
1292
- <fo:block id="{@id}">
1293
- <xsl:apply-templates/>
1294
- </fo:block>
1295
- </xsl:template>
1296
-
1297
- <xsl:template match="csd:formula/csd:dt/csd:stem">
1298
- <fo:inline>
1299
- <xsl:apply-templates/>
1300
- </fo:inline>
1301
- </xsl:template>
709
+
1302
710
 
1303
711
  <xsl:template match="csd:formula/csd:stem">
1304
712
  <fo:block margin-top="6pt" margin-bottom="12pt">
@@ -1314,29 +722,16 @@
1314
722
  </fo:table-cell>
1315
723
  <fo:table-cell display-align="center">
1316
724
  <fo:block text-align="right">
1317
- <xsl:choose>
1318
- <xsl:when test="ancestor::csd:annex">
1319
- <xsl:number format="(A.1)" level="multiple" count="csd:annex | csd:formula"/>
1320
- </xsl:when>
1321
- <xsl:otherwise> <!-- not(ancestor::csd:annex) -->
1322
- <!-- <xsl:text>(</xsl:text><xsl:number level="any" count="csd:formula"/><xsl:text>)</xsl:text> -->
1323
- </xsl:otherwise>
1324
- </xsl:choose>
725
+ <xsl:apply-templates select="../csd:name" mode="presentation"/>
1325
726
  </fo:block>
1326
727
  </fo:table-cell>
1327
728
  </fo:table-row>
1328
729
  </fo:table-body>
1329
- </fo:table>
1330
- <fo:inline keep-together.within-line="always">
1331
- </fo:inline>
730
+ </fo:table>
1332
731
  </fo:block>
1333
732
  </xsl:template>
1334
733
 
1335
-
1336
- <xsl:template match="csd:br" priority="2">
1337
- <!-- <fo:block>&#xA0;</fo:block> -->
1338
- <xsl:value-of select="$linebreak"/>
1339
- </xsl:template>
734
+
1340
735
 
1341
736
  <xsl:template name="insertHeaderFooter">
1342
737
  <fo:static-content flow-name="header-even">
@@ -1391,139 +786,8 @@
1391
786
  </fo:static-content>
1392
787
  </xsl:template>
1393
788
 
1394
-
1395
-
1396
- <xsl:template name="getSection">
1397
- <xsl:param name="sectionNum"/>
1398
- <xsl:variable name="level">
1399
- <xsl:call-template name="getLevel"/>
1400
- </xsl:variable>
1401
- <xsl:variable name="section">
1402
- <xsl:choose>
1403
- <xsl:when test="ancestor::csd:bibliography">
1404
- <xsl:value-of select="$sectionNum"/>
1405
- </xsl:when>
1406
- <xsl:when test="ancestor::csd:sections">
1407
- <!-- 1, 2, 3, 4, ... from main section (not annex, bibliography, ...) -->
1408
- <xsl:choose>
1409
- <xsl:when test="$level = 1">
1410
- <xsl:value-of select="$sectionNum"/>
1411
- </xsl:when>
1412
- <xsl:when test="$level &gt;= 2">
1413
- <xsl:variable name="num">
1414
- <xsl:call-template name="getSubSection"/>
1415
- </xsl:variable>
1416
- <xsl:value-of select="concat($sectionNum, $num)"/>
1417
- </xsl:when>
1418
- <xsl:otherwise>
1419
- <!-- z<xsl:value-of select="$sectionNum"/>z -->
1420
- </xsl:otherwise>
1421
- </xsl:choose>
1422
- <!-- <xsl:text>.</xsl:text> -->
1423
- </xsl:when>
1424
- <!-- <xsl:when test="ancestor::csd:annex[@obligation = 'informative']">
1425
- <xsl:choose>
1426
- <xsl:when test="$level = 1">
1427
- <xsl:text>Annex </xsl:text>
1428
- <xsl:number format="I" level="any" count="csd:annex[@obligation = 'informative']"/>
1429
- </xsl:when>
1430
- <xsl:otherwise>
1431
- <xsl:number format="I.1" level="multiple" count="csd:annex[@obligation = 'informative'] | csd:clause"/>
1432
- </xsl:otherwise>
1433
- </xsl:choose>
1434
- </xsl:when> -->
1435
- <xsl:when test="ancestor::csd:annex">
1436
- <xsl:choose>
1437
- <xsl:when test="$level = 1">
1438
- <xsl:variable name="title-annex">
1439
- <xsl:call-template name="getTitle">
1440
- <xsl:with-param name="name" select="'title-annex'"/>
1441
- </xsl:call-template>
1442
- </xsl:variable>
1443
- <xsl:value-of select="$title-annex"/>
1444
- <xsl:choose>
1445
- <xsl:when test="count(//csd:annex) = 1">
1446
- <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:ext/csd:structuredidentifier/csd:annexid"/>
1447
- </xsl:when>
1448
- <xsl:otherwise>
1449
- <xsl:number format="A." level="any" count="csd:annex"/>
1450
- </xsl:otherwise>
1451
- </xsl:choose>
1452
- </xsl:when>
1453
- <xsl:otherwise>
1454
- <xsl:choose>
1455
- <xsl:when test="count(//csd:annex) = 1">
1456
- <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:ext/csd:structuredidentifier/csd:annexid"/><xsl:number format=".1" level="multiple" count="csd:clause"/>
1457
- </xsl:when>
1458
- <xsl:otherwise>
1459
- <xsl:number format="A.1." level="multiple" count="csd:annex | csd:clause"/>
1460
- </xsl:otherwise>
1461
- </xsl:choose>
1462
- </xsl:otherwise>
1463
- </xsl:choose>
1464
- </xsl:when>
1465
- <xsl:when test="ancestor::csd:preface"> <!-- if preface and there is clause(s) -->
1466
- <xsl:choose>
1467
- <xsl:when test="$level = 1 and ..//csd:clause">0</xsl:when>
1468
- <xsl:when test="$level &gt;= 2">
1469
- <xsl:variable name="num">
1470
- <xsl:number format=".1." level="multiple" count="csd:clause"/>
1471
- </xsl:variable>
1472
- <xsl:value-of select="concat('0', $num)"/>
1473
- </xsl:when>
1474
- <xsl:otherwise>
1475
- <!-- z<xsl:value-of select="$sectionNum"/>z -->
1476
- </xsl:otherwise>
1477
- </xsl:choose>
1478
- </xsl:when>
1479
- <xsl:otherwise>
1480
- </xsl:otherwise>
1481
- </xsl:choose>
1482
- </xsl:variable>
1483
- <xsl:value-of select="$section"/>
1484
- </xsl:template>
1485
789
 
1486
790
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
1487
-
1488
- <title-table lang="en">Table </title-table>
1489
- <title-table lang="fr">Tableau </title-table>
1490
-
1491
- <title-table lang="zh">Table </title-table>
1492
-
1493
-
1494
-
1495
- <title-note lang="en">NOTE </title-note>
1496
- <title-note lang="fr">NOTE </title-note>
1497
-
1498
- <title-note lang="zh">NOTE </title-note>
1499
-
1500
-
1501
-
1502
- <title-figure lang="en">Figure </title-figure>
1503
- <title-figure lang="fr">Figure </title-figure>
1504
-
1505
- <title-figure lang="zh">Figure </title-figure>
1506
-
1507
-
1508
-
1509
- <title-example lang="en">EXAMPLE </title-example>
1510
- <title-example lang="fr">EXEMPLE </title-example>
1511
-
1512
- <title-example lang="zh">EXAMPLE </title-example>
1513
-
1514
-
1515
-
1516
- <title-example-xref lang="en">Example </title-example-xref>
1517
- <title-example-xref lang="fr">Exemple </title-example-xref>
1518
-
1519
- <title-section lang="en">Section </title-section>
1520
- <title-section lang="fr">Section </title-section>
1521
-
1522
- <title-inequality lang="en">Inequality </title-inequality>
1523
- <title-inequality lang="fr">Inequality </title-inequality>
1524
-
1525
- <title-equation lang="en">Equation </title-equation>
1526
- <title-equation lang="fr">Equation </title-equation>
1527
791
 
1528
792
  <title-annex lang="en">Annex </title-annex>
1529
793
  <title-annex lang="fr">Annexe </title-annex>
@@ -1531,17 +795,7 @@
1531
795
  <title-annex lang="zh">Annex </title-annex>
1532
796
 
1533
797
 
1534
-
1535
- <title-appendix lang="en">Appendix </title-appendix>
1536
- <title-appendix lang="fr">Appendix </title-appendix>
1537
-
1538
- <title-clause lang="en">Clause </title-clause>
1539
- <title-clause lang="fr">Article </title-clause>
1540
-
1541
- <title-clause lang="zh">Clause </title-clause>
1542
-
1543
-
1544
-
798
+
1545
799
  <title-edition lang="en">
1546
800
 
1547
801
  <xsl:text>Edition </xsl:text>
@@ -1549,9 +803,7 @@
1549
803
 
1550
804
  </title-edition>
1551
805
 
1552
- <title-formula lang="en">Formula </title-formula>
1553
- <title-formula lang="fr">Formula </title-formula>
1554
-
806
+
1555
807
  <title-toc lang="en">
1556
808
 
1557
809
  <xsl:text>Contents</xsl:text>
@@ -1586,13 +838,6 @@
1586
838
  </title-part>
1587
839
  <title-part lang="zh">第 # 部分:</title-part>
1588
840
 
1589
- <title-note-to-entry lang="en">Note # to entry: </title-note-to-entry>
1590
- <title-note-to-entry lang="fr">Note # à l'article: </title-note-to-entry>
1591
-
1592
- <title-note-to-entry lang="zh">Note # to entry: </title-note-to-entry>
1593
-
1594
-
1595
-
1596
841
  <title-modified lang="en">modified</title-modified>
1597
842
  <title-modified lang="fr">modifiée</title-modified>
1598
843
 
@@ -1606,14 +851,12 @@
1606
851
 
1607
852
  <title-deprecated lang="en">DEPRECATED</title-deprecated>
1608
853
  <title-deprecated lang="fr">DEPRECATED</title-deprecated>
1609
-
1610
- <title-submitting-organizations lang="en">Submitting Organizations</title-submitting-organizations>
1611
-
854
+
1612
855
  <title-list-tables lang="en">List of Tables</title-list-tables>
1613
856
 
1614
857
  <title-list-figures lang="en">List of Figures</title-list-figures>
1615
858
 
1616
- <title-recommendation lang="en">Recommendation </title-recommendation>
859
+ <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
1617
860
 
1618
861
  <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
1619
862
 
@@ -1623,8 +866,6 @@
1623
866
 
1624
867
  <title-in lang="en">in </title-in>
1625
868
 
1626
- <title-box lang="en">Box </title-box>
1627
-
1628
869
  <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
1629
870
  <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
1630
871
 
@@ -1647,7 +888,7 @@
1647
888
  <title-warning lang="zh">警告</title-warning>
1648
889
 
1649
890
  <title-amendment lang="en">AMENDMENT</title-amendment>
1650
- </xsl:variable><xsl:template name="getTitle">
891
+ </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1651
892
  <xsl:param name="name"/>
1652
893
  <xsl:variable name="lang">
1653
894
  <xsl:call-template name="getLang"/>
@@ -1668,6 +909,8 @@
1668
909
 
1669
910
 
1670
911
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
912
+ <xsl:attribute name="white-space">pre</xsl:attribute>
913
+ <xsl:attribute name="wrap-option">wrap</xsl:attribute>
1671
914
 
1672
915
 
1673
916
 
@@ -1681,220 +924,477 @@
1681
924
 
1682
925
 
1683
926
 
1684
- </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1685
-
1686
- <xsl:attribute name="font-size">12pt</xsl:attribute>
1687
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1688
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
1689
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
927
+ </xsl:attribute-set><xsl:attribute-set name="permission-style">
1690
928
 
929
+ </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
1691
930
 
931
+ </xsl:attribute-set><xsl:attribute-set name="permission-label-style">
1692
932
 
1693
- </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
933
+ </xsl:attribute-set><xsl:attribute-set name="requirement-style">
1694
934
 
1695
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1696
- <xsl:attribute name="margin-top">8pt</xsl:attribute>
1697
- <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
935
+ </xsl:attribute-set><xsl:attribute-set name="requirement-name-style">
1698
936
 
937
+ </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
1699
938
 
939
+ </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
940
+ </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
941
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
942
+
943
+
944
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-name-style">
945
+
946
+
947
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-label-style">
948
+
949
+ </xsl:attribute-set><xsl:attribute-set name="termexample-style">
950
+
951
+
952
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
953
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
954
+
955
+
956
+
957
+
958
+
959
+
960
+ </xsl:attribute-set><xsl:attribute-set name="example-style">
961
+
962
+
963
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
964
+
965
+
966
+
967
+
968
+
969
+
970
+
971
+
972
+
973
+ </xsl:attribute-set><xsl:attribute-set name="example-body-style">
974
+
975
+
976
+ <xsl:attribute name="margin-left">12.5mm</xsl:attribute>
977
+
978
+
979
+ </xsl:attribute-set><xsl:attribute-set name="example-name-style">
980
+
981
+
982
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
983
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
984
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1700
985
 
1701
- </xsl:attribute-set><xsl:template match="text()">
1702
- <xsl:value-of select="."/>
1703
- </xsl:template><xsl:template match="*[local-name()='br']">
1704
- <xsl:value-of select="$linebreak"/>
1705
- </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1706
- <!-- <xsl:call-template name="add-zero-spaces"/> -->
1707
- <xsl:call-template name="add-zero-spaces-java"/>
1708
- </xsl:template><xsl:template match="*[local-name()='table']">
1709
-
1710
- <xsl:variable name="simple-table">
1711
- <!-- <xsl:copy> -->
1712
- <xsl:call-template name="getSimpleTable"/>
1713
- <!-- </xsl:copy> -->
1714
- </xsl:variable>
1715
-
1716
- <!-- DEBUG -->
1717
- <!-- SourceTable=<xsl:copy-of select="current()"/>EndSourceTable -->
1718
- <!-- Simpletable=<xsl:copy-of select="$simple-table"/>EndSimpltable -->
1719
-
1720
- <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
1721
986
 
1722
- <!-- <xsl:if test="$namespace = 'iso'">
1723
- <fo:block space-before="6pt">&#xA0;</fo:block>
1724
- </xsl:if> -->
1725
987
 
1726
- <xsl:choose>
1727
- <xsl:when test="@unnumbered = 'true'"/>
1728
- <xsl:otherwise>
1729
-
1730
-
1731
-
1732
- <fo:block font-weight="bold" text-align="center" margin-bottom="6pt" keep-with-next="always">
1733
-
1734
-
1735
-
1736
-
1737
-
1738
-
1739
-
1740
-
1741
- <xsl:variable name="title-table">
1742
- <xsl:call-template name="getTitle">
1743
- <xsl:with-param name="name" select="'title-table'"/>
1744
- </xsl:call-template>
1745
- </xsl:variable>
1746
- <xsl:value-of select="$title-table"/>
1747
-
1748
- <xsl:call-template name="getTableNumber"/>
1749
-
1750
-
1751
- <xsl:if test="*[local-name()='name']">
1752
-
1753
-
1754
-
1755
- <xsl:text> — </xsl:text>
1756
-
1757
- <xsl:apply-templates select="*[local-name()='name']" mode="process"/>
1758
- </xsl:if>
1759
- </fo:block>
1760
-
1761
-
1762
- <xsl:call-template name="fn_name_display"/>
1763
-
1764
- </xsl:otherwise>
1765
- </xsl:choose>
1766
988
 
1767
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1768
989
 
1769
- <!-- <xsl:variable name="cols-count">
1770
- <xsl:choose>
1771
- <xsl:when test="*[local-name()='thead']">
1772
- <xsl:call-template name="calculate-columns-numbers">
1773
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1774
- </xsl:call-template>
1775
- </xsl:when>
1776
- <xsl:otherwise>
1777
- <xsl:call-template name="calculate-columns-numbers">
1778
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1779
- </xsl:call-template>
1780
- </xsl:otherwise>
1781
- </xsl:choose>
1782
- </xsl:variable> -->
1783
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1784
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1785
990
 
1786
991
 
1787
992
 
1788
- <xsl:variable name="colwidths">
1789
- <xsl:call-template name="calculate-column-widths">
1790
- <xsl:with-param name="cols-count" select="$cols-count"/>
1791
- <xsl:with-param name="table" select="$simple-table"/>
1792
- </xsl:call-template>
1793
- </xsl:variable>
1794
993
 
1795
- <!-- <xsl:variable name="colwidths2">
1796
- <xsl:call-template name="calculate-column-widths">
1797
- <xsl:with-param name="cols-count" select="$cols-count"/>
1798
- </xsl:call-template>
1799
- </xsl:variable> -->
1800
994
 
1801
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1802
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
1803
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1804
995
 
1805
- <xsl:variable name="margin-left">
1806
- <xsl:choose>
1807
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1808
- <xsl:otherwise>0</xsl:otherwise>
1809
- </xsl:choose>
1810
- </xsl:variable>
1811
996
 
1812
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1813
-
1814
-
1815
-
1816
-
1817
-
1818
-
1819
-
1820
-
1821
- <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
1822
-
1823
-
1824
997
 
998
+
999
+
1000
+
1001
+ </xsl:attribute-set><xsl:attribute-set name="example-p-style">
1002
+
1003
+
1004
+ <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
1005
+
1006
+
1007
+
1008
+
1009
+
1010
+
1011
+
1012
+
1013
+
1014
+
1015
+
1016
+
1017
+ </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
1018
+
1019
+ <xsl:attribute name="padding-right">10mm</xsl:attribute>
1020
+
1021
+
1022
+
1825
1023
 
1024
+ </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1025
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1026
+
1027
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1028
+ <xsl:attribute name="text-align">center</xsl:attribute>
1029
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1030
+
1031
+
1032
+
1033
+
1826
1034
 
1035
+
1036
+
1037
+
1827
1038
 
1039
+
1040
+
1041
+ </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1828
1042
 
1043
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
1044
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1045
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1046
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1047
+
1048
+
1049
+
1050
+ </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
1051
+
1052
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1053
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
1054
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1055
+
1056
+
1057
+
1058
+ </xsl:attribute-set><xsl:attribute-set name="xref-style">
1059
+
1829
1060
 
1061
+ </xsl:attribute-set><xsl:attribute-set name="eref-style">
1062
+
1063
+
1064
+ <xsl:attribute name="color">blue</xsl:attribute>
1065
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1066
+
1067
+
1068
+ </xsl:attribute-set><xsl:attribute-set name="note-style">
1069
+
1070
+
1071
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1072
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1073
+
1074
+
1830
1075
 
1831
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1076
+
1077
+
1078
+
1079
+
1080
+
1081
+
1082
+
1083
+
1084
+
1085
+
1086
+
1087
+ </xsl:attribute-set><xsl:attribute-set name="note-name-style">
1088
+
1089
+
1090
+ <xsl:attribute name="padding-right">6mm</xsl:attribute>
1091
+
1092
+
1093
+
1094
+
1095
+
1096
+
1097
+
1832
1098
 
1099
+
1100
+ </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1101
+
1102
+
1103
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1104
+
1105
+
1833
1106
 
1107
+
1108
+
1109
+
1110
+
1111
+
1112
+
1113
+
1114
+
1115
+
1116
+ </xsl:attribute-set><xsl:attribute-set name="termnote-style">
1117
+
1118
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1119
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1120
+
1121
+
1122
+
1123
+
1124
+
1125
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
1126
+
1127
+
1128
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1129
+ <xsl:attribute name="margin-left">12mm</xsl:attribute>
1130
+ <xsl:attribute name="margin-right">12mm</xsl:attribute>
1131
+
1132
+
1133
+
1134
+
1135
+
1136
+ </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
1137
+
1138
+
1139
+ <xsl:attribute name="text-align">right</xsl:attribute>
1834
1140
 
1835
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1836
- <xsl:choose>
1837
- <xsl:when test=". = 1 or . = 0">
1838
- <fo:table-column column-width="proportional-column-width(2)"/>
1839
- </xsl:when>
1840
- <xsl:otherwise>
1841
- <fo:table-column column-width="proportional-column-width({.})"/>
1842
- </xsl:otherwise>
1843
- </xsl:choose>
1844
- </xsl:for-each>
1845
1141
 
1846
- <xsl:choose>
1847
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1848
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1849
- </xsl:when>
1850
- <xsl:otherwise>
1851
- <xsl:apply-templates/>
1852
- </xsl:otherwise>
1853
- </xsl:choose>
1142
+ </xsl:attribute-set><xsl:attribute-set name="termsource-style">
1143
+
1144
+
1145
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1146
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1147
+
1148
+
1149
+
1150
+
1151
+ </xsl:attribute-set><xsl:attribute-set name="origin-style">
1152
+
1153
+
1154
+ </xsl:attribute-set><xsl:attribute-set name="term-style">
1155
+
1156
+ </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1854
1157
 
1855
- </fo:table>
1856
-
1857
-
1158
+
1159
+
1160
+
1161
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1162
+ <xsl:attribute name="text-align">center</xsl:attribute>
1163
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1164
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1165
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1166
+
1167
+
1168
+
1169
+
1170
+
1171
+
1172
+
1173
+
1174
+
1175
+
1176
+
1177
+
1858
1178
 
1859
- </fo:block-container>
1860
- </xsl:template><xsl:template name="getTableNumber">
1861
- <xsl:choose>
1862
- <xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
1863
- <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true']"/>
1864
- </xsl:when>
1865
- <xsl:when test="ancestor::*[local-name()='annex']">
1866
-
1867
-
1868
-
1869
-
1870
-
1871
-
1872
-
1873
-
1874
- <xsl:number format="A-1" level="multiple" count="*[local-name()='annex'] | *[local-name()='table'][not(@unnumbered) or @unnumbered != 'true'] "/>
1875
-
1876
- </xsl:when>
1877
- <xsl:otherwise>
1179
+ </xsl:attribute-set><xsl:attribute-set name="formula-style">
1180
+
1181
+ </xsl:attribute-set><xsl:attribute-set name="image-style">
1182
+ <xsl:attribute name="text-align">center</xsl:attribute>
1183
+
1184
+
1185
+
1186
+
1187
+
1188
+ </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
1189
+
1190
+ </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
1191
+
1192
+ <xsl:attribute name="width">100%</xsl:attribute>
1193
+ <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
1194
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
1195
+
1196
+
1197
+
1878
1198
 
1199
+
1200
+ </xsl:attribute-set><xsl:attribute-set name="tt-style">
1201
+
1202
+ <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
1203
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1204
+
1205
+
1206
+ </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
1207
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1208
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1209
+ <xsl:attribute name="text-align">center</xsl:attribute>
1210
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1211
+ </xsl:attribute-set><xsl:attribute-set name="domain-style">
1879
1212
 
1880
- <xsl:number format="A." count="*[local-name()='annex']"/>
1881
- <xsl:number format="1" level="any" count="//*[local-name()='table'] [not(ancestor::*[local-name()='annex']) and not(ancestor::*[local-name()='executivesummary']) and not(ancestor::*[local-name()='bibdata'])] [not(@unnumbered) or @unnumbered != 'true']"/>
1882
-
1883
- </xsl:otherwise>
1884
- </xsl:choose>
1885
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']"/><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="process">
1886
- <xsl:apply-templates/>
1887
- </xsl:template><xsl:template name="calculate-columns-numbers">
1888
- <xsl:param name="table-row"/>
1889
- <xsl:variable name="columns-count" select="count($table-row/*)"/>
1890
- <xsl:variable name="sum-colspans" select="sum($table-row/*/@colspan)"/>
1891
- <xsl:variable name="columns-with-colspan" select="count($table-row/*[@colspan])"/>
1892
- <xsl:value-of select="$columns-count + $sum-colspans - $columns-with-colspan"/>
1893
- </xsl:template><xsl:template name="calculate-column-widths">
1894
- <xsl:param name="table"/>
1895
- <xsl:param name="cols-count"/>
1896
- <xsl:param name="curr-col" select="1"/>
1897
- <xsl:param name="width" select="0"/>
1213
+ </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1214
+
1215
+
1216
+ </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1217
+
1218
+ </xsl:attribute-set><xsl:attribute-set name="definition-style">
1219
+
1220
+
1221
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1222
+
1223
+ </xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
1224
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1225
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1226
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
1227
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
1228
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
1229
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1230
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1231
+
1232
+ <!-- Normative references -->
1233
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
1234
+ <!-- Terms and definitions -->
1235
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
1236
+ <!-- Another main sections -->
1237
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
1238
+ <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1239
+ <!-- Bibliography -->
1240
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
1241
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1242
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1243
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
1244
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
1245
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
1246
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
1247
+ </xsl:template><xsl:template name="processMainSectionsDefault">
1248
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
1249
+
1250
+ <!-- Normative references -->
1251
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/>
1252
+ <!-- Terms and definitions -->
1253
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]"/>
1254
+ <!-- Another main sections -->
1255
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]"/>
1256
+ <xsl:apply-templates select="/*/*[local-name()='annex']"/>
1257
+ <!-- Bibliography -->
1258
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
1259
+ </xsl:template><xsl:template match="text()">
1260
+ <xsl:value-of select="."/>
1261
+ </xsl:template><xsl:template match="*[local-name()='br']">
1262
+ <xsl:value-of select="$linebreak"/>
1263
+ </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1264
+ <!-- <xsl:call-template name="add-zero-spaces"/> -->
1265
+ <xsl:call-template name="add-zero-spaces-java"/>
1266
+ </xsl:template><xsl:template match="*[local-name()='table']">
1267
+
1268
+ <xsl:variable name="simple-table">
1269
+ <xsl:call-template name="getSimpleTable"/>
1270
+ </xsl:variable>
1271
+
1272
+
1273
+
1274
+
1275
+
1276
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1277
+
1278
+
1279
+
1280
+ <xsl:call-template name="fn_name_display"/>
1281
+
1282
+
1283
+
1284
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1285
+
1286
+ <!-- <xsl:variable name="cols-count">
1287
+ <xsl:choose>
1288
+ <xsl:when test="*[local-name()='thead']">
1289
+ <xsl:call-template name="calculate-columns-numbers">
1290
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1291
+ </xsl:call-template>
1292
+ </xsl:when>
1293
+ <xsl:otherwise>
1294
+ <xsl:call-template name="calculate-columns-numbers">
1295
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1296
+ </xsl:call-template>
1297
+ </xsl:otherwise>
1298
+ </xsl:choose>
1299
+ </xsl:variable> -->
1300
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1301
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1302
+
1303
+
1304
+
1305
+ <xsl:variable name="colwidths">
1306
+ <xsl:call-template name="calculate-column-widths">
1307
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1308
+ <xsl:with-param name="table" select="$simple-table"/>
1309
+ </xsl:call-template>
1310
+ </xsl:variable>
1311
+
1312
+ <!-- <xsl:variable name="colwidths2">
1313
+ <xsl:call-template name="calculate-column-widths">
1314
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1315
+ </xsl:call-template>
1316
+ </xsl:variable> -->
1317
+
1318
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1319
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
1320
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1321
+
1322
+ <xsl:variable name="margin-left">
1323
+ <xsl:choose>
1324
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1325
+ <xsl:otherwise>0</xsl:otherwise>
1326
+ </xsl:choose>
1327
+ </xsl:variable>
1328
+
1329
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1330
+
1331
+
1332
+
1333
+
1334
+
1335
+
1336
+
1337
+
1338
+
1339
+ <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
1340
+
1341
+
1342
+
1343
+
1344
+
1345
+
1346
+
1347
+
1348
+
1349
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1350
+
1351
+
1352
+
1353
+
1354
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1355
+ <xsl:choose>
1356
+ <xsl:when test=". = 1 or . = 0">
1357
+ <fo:table-column column-width="proportional-column-width(2)"/>
1358
+ </xsl:when>
1359
+ <xsl:otherwise>
1360
+ <fo:table-column column-width="proportional-column-width({.})"/>
1361
+ </xsl:otherwise>
1362
+ </xsl:choose>
1363
+ </xsl:for-each>
1364
+
1365
+ <xsl:choose>
1366
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1367
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1368
+ </xsl:when>
1369
+ <xsl:otherwise>
1370
+ <xsl:apply-templates/>
1371
+ </xsl:otherwise>
1372
+ </xsl:choose>
1373
+
1374
+ </fo:table>
1375
+
1376
+
1377
+
1378
+
1379
+
1380
+ </fo:block-container>
1381
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1382
+ <xsl:if test="normalize-space() != ''">
1383
+ <fo:block xsl:use-attribute-sets="table-name-style">
1384
+ <xsl:apply-templates/>
1385
+ </fo:block>
1386
+ </xsl:if>
1387
+ </xsl:template><xsl:template name="calculate-columns-numbers">
1388
+ <xsl:param name="table-row"/>
1389
+ <xsl:variable name="columns-count" select="count($table-row/*)"/>
1390
+ <xsl:variable name="sum-colspans" select="sum($table-row/*/@colspan)"/>
1391
+ <xsl:variable name="columns-with-colspan" select="count($table-row/*[@colspan])"/>
1392
+ <xsl:value-of select="$columns-count + $sum-colspans - $columns-with-colspan"/>
1393
+ </xsl:template><xsl:template name="calculate-column-widths">
1394
+ <xsl:param name="table"/>
1395
+ <xsl:param name="cols-count"/>
1396
+ <xsl:param name="curr-col" select="1"/>
1397
+ <xsl:param name="width" select="0"/>
1898
1398
 
1899
1399
  <xsl:if test="$curr-col &lt;= $cols-count">
1900
1400
  <xsl:variable name="widths">
@@ -2101,6 +1601,16 @@
2101
1601
  </fo:table-row>
2102
1602
  </xsl:template><xsl:template match="*[local-name()='th']">
2103
1603
  <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
1604
+ <xsl:attribute name="text-align">
1605
+ <xsl:choose>
1606
+ <xsl:when test="@align">
1607
+ <xsl:value-of select="@align"/>
1608
+ </xsl:when>
1609
+ <xsl:otherwise>center</xsl:otherwise>
1610
+ </xsl:choose>
1611
+ </xsl:attribute>
1612
+
1613
+
2104
1614
 
2105
1615
 
2106
1616
 
@@ -2124,10 +1634,18 @@
2124
1634
  </fo:table-cell>
2125
1635
  </xsl:template><xsl:template match="*[local-name()='td']">
2126
1636
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
1637
+ <xsl:attribute name="text-align">
1638
+ <xsl:choose>
1639
+ <xsl:when test="@align">
1640
+ <xsl:value-of select="@align"/>
1641
+ </xsl:when>
1642
+ <xsl:otherwise>left</xsl:otherwise>
1643
+ </xsl:choose>
1644
+ </xsl:attribute>
2127
1645
 
2128
1646
 
2129
1647
 
2130
-
1648
+
2131
1649
 
2132
1650
 
2133
1651
 
@@ -2146,21 +1664,9 @@
2146
1664
  <fo:block>
2147
1665
 
2148
1666
  <xsl:apply-templates/>
2149
- </fo:block>
2150
- <!-- <xsl:choose>
2151
- <xsl:when test="count(*) = 1 and *[local-name() = 'p']">
2152
- <xsl:apply-templates />
2153
- </xsl:when>
2154
- <xsl:otherwise>
2155
- <fo:block>
2156
- <xsl:apply-templates />
2157
- </fo:block>
2158
- </xsl:otherwise>
2159
- </xsl:choose> -->
2160
-
2161
-
1667
+ </fo:block>
2162
1668
  </fo:table-cell>
2163
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
1669
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
2164
1670
 
2165
1671
 
2166
1672
  <fo:block font-size="10pt" margin-bottom="12pt">
@@ -2171,22 +1677,15 @@
2171
1677
  <fo:inline padding-right="2mm">
2172
1678
 
2173
1679
 
2174
- <xsl:variable name="title-note">
2175
- <xsl:call-template name="getTitle">
2176
- <xsl:with-param name="name" select="'title-note'"/>
2177
- </xsl:call-template>
2178
- </xsl:variable>
2179
- <xsl:value-of select="$title-note"/>
2180
-
2181
-
2182
-
2183
- <xsl:number format="1 "/>
2184
1680
 
1681
+
1682
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
1683
+
2185
1684
  </fo:inline>
2186
1685
  <xsl:apply-templates mode="process"/>
2187
1686
  </fo:block>
2188
1687
 
2189
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
1688
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
2190
1689
  <xsl:apply-templates/>
2191
1690
  </xsl:template><xsl:template name="fn_display">
2192
1691
  <xsl:variable name="references">
@@ -2246,7 +1745,7 @@
2246
1745
  <!-- and (not(@class) or @class !='pseudocode') -->
2247
1746
  </xsl:variable>
2248
1747
  <xsl:variable name="references">
2249
- <xsl:for-each select=".//*[local-name()='fn']">
1748
+ <xsl:for-each select=".//*[local-name()='fn'][not(parent::*[local-name()='name'])]">
2250
1749
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2251
1750
  <xsl:apply-templates/>
2252
1751
  </fn>
@@ -2513,7 +2012,7 @@
2513
2012
  <xsl:value-of select="string-length(normalize-space(.))"/>
2514
2013
  </xsl:if>
2515
2014
  </xsl:for-each>
2516
- </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']">
2015
+ </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2517
2016
  <xsl:param name="key_iso"/>
2518
2017
 
2519
2018
  <!-- <tr>
@@ -2529,12 +2028,7 @@
2529
2028
  <xsl:if test="normalize-space($key_iso) = 'true'">
2530
2029
  <xsl:attribute name="margin-top">0</xsl:attribute>
2531
2030
  </xsl:if>
2532
- <xsl:variable name="title-note">
2533
- <xsl:call-template name="getTitle">
2534
- <xsl:with-param name="name" select="'title-note'"/>
2535
- </xsl:call-template>
2536
- </xsl:variable>
2537
- <xsl:value-of select="$title-note"/>
2031
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2538
2032
  </fo:block>
2539
2033
  </fo:table-cell>
2540
2034
  <fo:table-cell>
@@ -2605,7 +2099,7 @@
2605
2099
  <fo:inline font-style="italic">
2606
2100
  <xsl:apply-templates/>
2607
2101
  </fo:inline>
2608
- </xsl:template><xsl:template match="*[local-name()='strong']">
2102
+ </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2609
2103
  <fo:inline font-weight="bold">
2610
2104
  <xsl:apply-templates/>
2611
2105
  </fo:inline>
@@ -2618,7 +2112,7 @@
2618
2112
  <xsl:apply-templates/>
2619
2113
  </fo:inline>
2620
2114
  </xsl:template><xsl:template match="*[local-name()='tt']">
2621
- <fo:inline font-family="Courier" font-size="10pt">
2115
+ <fo:inline xsl:use-attribute-sets="tt-style">
2622
2116
  <xsl:apply-templates/>
2623
2117
  </fo:inline>
2624
2118
  </xsl:template><xsl:template match="*[local-name()='del']">
@@ -2949,117 +2443,843 @@
2949
2443
  <xsl:copy-of select="."/>
2950
2444
  </fo:instream-foreign-object>
2951
2445
  </fo:inline>
2952
- </xsl:template><xsl:template match="*[local-name()='localityStack']">
2953
- <xsl:for-each select="*[local-name()='locality']">
2954
- <xsl:if test="position() =1"><xsl:text>, </xsl:text></xsl:if>
2955
- <xsl:apply-templates select="."/>
2956
- <xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if>
2957
- </xsl:for-each>
2958
- </xsl:template><xsl:template match="*[local-name()='link']" name="link">
2446
+ </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
2959
2447
  <xsl:variable name="target">
2960
2448
  <xsl:choose>
2961
- <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
2962
- <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
2449
+ <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
2450
+ <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
2451
+ </xsl:when>
2452
+ <xsl:otherwise>
2453
+ <xsl:value-of select="normalize-space(@target)"/>
2454
+ </xsl:otherwise>
2455
+ </xsl:choose>
2456
+ </xsl:variable>
2457
+ <fo:inline xsl:use-attribute-sets="link-style">
2458
+ <xsl:choose>
2459
+ <xsl:when test="$target = ''">
2460
+ <xsl:apply-templates/>
2461
+ </xsl:when>
2462
+ <xsl:otherwise>
2463
+ <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
2464
+ <xsl:choose>
2465
+ <xsl:when test="normalize-space(.) = ''">
2466
+ <xsl:value-of select="$target"/>
2467
+ </xsl:when>
2468
+ <xsl:otherwise>
2469
+ <xsl:apply-templates/>
2470
+ </xsl:otherwise>
2471
+ </xsl:choose>
2472
+ </fo:basic-link>
2473
+ </xsl:otherwise>
2474
+ </xsl:choose>
2475
+ </fo:inline>
2476
+ </xsl:template><xsl:template match="*[local-name()='bookmark']">
2477
+ <fo:inline id="{@id}"/>
2478
+ </xsl:template><xsl:template match="*[local-name()='appendix']">
2479
+ <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
2480
+ <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
2481
+ </fo:block>
2482
+ <xsl:apply-templates/>
2483
+ </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
2484
+ <fo:inline><xsl:apply-templates/></fo:inline>
2485
+ </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
2486
+ <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
2487
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2488
+ </fo:block>
2489
+ <xsl:apply-templates/>
2490
+ </xsl:template><xsl:template match="*[local-name() = 'callout']">
2491
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
2492
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']">
2493
+ <xsl:variable name="annotation-id" select="@id"/>
2494
+ <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
2495
+ <fo:block id="{$annotation-id}" white-space="nowrap">
2496
+ <fo:inline>
2497
+ <xsl:apply-templates>
2498
+ <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
2499
+ </xsl:apply-templates>
2500
+ </fo:inline>
2501
+ </fo:block>
2502
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
2503
+ <xsl:param name="callout"/>
2504
+ <fo:inline id="{@id}">
2505
+ <!-- for first p in annotation, put <x> -->
2506
+ <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
2507
+ <xsl:apply-templates/>
2508
+ </fo:inline>
2509
+ </xsl:template><xsl:template match="*[local-name() = 'modification']">
2510
+ <xsl:variable name="title-modified">
2511
+ <xsl:call-template name="getTitle">
2512
+ <xsl:with-param name="name" select="'title-modified'"/>
2513
+ </xsl:call-template>
2514
+ </xsl:variable>
2515
+ <xsl:choose>
2516
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
2517
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
2518
+ </xsl:choose>
2519
+ <xsl:apply-templates/>
2520
+ </xsl:template><xsl:template match="*[local-name() = 'xref']">
2521
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2522
+
2523
+ <xsl:apply-templates/>
2524
+ </fo:basic-link>
2525
+ </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
2526
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2527
+ <xsl:apply-templates/>
2528
+ </fo:block>
2529
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
2530
+ <fo:inline>
2531
+ <xsl:apply-templates/>
2532
+ </fo:inline>
2533
+ </xsl:template><xsl:template match="*[local-name() = 'admitted']/*[local-name() = 'stem']">
2534
+ <fo:inline>
2535
+ <xsl:apply-templates/>
2536
+ </fo:inline>
2537
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="presentation">
2538
+ <xsl:if test="normalize-space() != ''">
2539
+ <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
2540
+ </xsl:if>
2541
+ </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
2542
+
2543
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
2544
+
2545
+
2546
+
2547
+
2548
+ <fo:block-container margin-left="0mm">
2549
+
2550
+
2551
+
2552
+
2553
+
2554
+
2555
+
2556
+
2557
+ <fo:block>
2558
+
2559
+
2560
+
2561
+
2562
+ <fo:inline xsl:use-attribute-sets="note-name-style">
2563
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2564
+ </fo:inline>
2565
+ <xsl:apply-templates/>
2566
+ </fo:block>
2567
+
2568
+
2569
+ </fo:block-container>
2570
+ </fo:block-container>
2571
+
2572
+ </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
2573
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
2574
+ <xsl:choose>
2575
+ <xsl:when test="$num = 1">
2576
+ <fo:inline xsl:use-attribute-sets="note-p-style">
2577
+ <xsl:apply-templates/>
2578
+ </fo:inline>
2579
+ </xsl:when>
2580
+ <xsl:otherwise>
2581
+ <fo:block xsl:use-attribute-sets="note-p-style">
2582
+ <xsl:apply-templates/>
2583
+ </fo:block>
2584
+ </xsl:otherwise>
2585
+ </xsl:choose>
2586
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']">
2587
+ <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
2588
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2589
+ <xsl:apply-templates/>
2590
+ </fo:block>
2591
+ </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name'] | *[local-name() = 'termnote']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']" mode="presentation">
2592
+ <xsl:param name="sfx"/>
2593
+ <xsl:variable name="suffix">
2594
+ <xsl:choose>
2595
+ <xsl:when test="$sfx != ''">
2596
+ <xsl:value-of select="$sfx"/>
2597
+ </xsl:when>
2598
+ <xsl:otherwise>
2599
+
2600
+
2601
+ </xsl:otherwise>
2602
+ </xsl:choose>
2603
+ </xsl:variable>
2604
+ <xsl:if test="normalize-space() != ''">
2605
+ <xsl:apply-templates/>
2606
+ <xsl:value-of select="$suffix"/>
2607
+ </xsl:if>
2608
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']" mode="presentation">
2609
+ <xsl:param name="sfx"/>
2610
+ <xsl:variable name="suffix">
2611
+ <xsl:choose>
2612
+ <xsl:when test="$sfx != ''">
2613
+ <xsl:value-of select="$sfx"/>
2614
+ </xsl:when>
2615
+ <xsl:otherwise>
2616
+
2617
+
2618
+ </xsl:otherwise>
2619
+ </xsl:choose>
2620
+ </xsl:variable>
2621
+ <xsl:if test="normalize-space() != ''">
2622
+ <xsl:apply-templates/>
2623
+ <xsl:value-of select="$suffix"/>
2624
+ </xsl:if>
2625
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
2626
+ <fo:inline><xsl:apply-templates/></fo:inline>
2627
+ </xsl:template><xsl:template match="*[local-name() = 'terms']">
2628
+ <fo:block id="{@id}">
2629
+ <xsl:apply-templates/>
2630
+ </fo:block>
2631
+ </xsl:template><xsl:template match="*[local-name() = 'term']">
2632
+ <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
2633
+
2634
+
2635
+
2636
+ <xsl:apply-templates/>
2637
+ </fo:block>
2638
+ </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
2639
+ <xsl:if test="normalize-space() != ''">
2640
+ <fo:inline>
2641
+ <xsl:apply-templates/>
2642
+ <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
2643
+ <xsl:text>.</xsl:text>
2644
+ </xsl:if> -->
2645
+ </fo:inline>
2646
+ </xsl:if>
2647
+ </xsl:template><xsl:template match="*[local-name() = 'figure']">
2648
+ <fo:block-container id="{@id}">
2649
+ <fo:block>
2650
+ <xsl:apply-templates/>
2651
+ </fo:block>
2652
+ <xsl:call-template name="fn_display_figure"/>
2653
+ <xsl:for-each select="*[local-name() = 'note']">
2654
+ <xsl:call-template name="note"/>
2655
+ </xsl:for-each>
2656
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2657
+ </fo:block-container>
2658
+ </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
2659
+ <fo:block id="{@id}">
2660
+ <xsl:apply-templates/>
2661
+ </fo:block>
2662
+ </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
2663
+ <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
2664
+ <xsl:apply-templates/>
2665
+ </fo:block>
2666
+ </xsl:template><xsl:template match="*[local-name() = 'image']">
2667
+ <fo:block xsl:use-attribute-sets="image-style">
2668
+
2669
+
2670
+ <xsl:variable name="src">
2671
+ <xsl:choose>
2672
+ <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
2673
+ <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
2674
+ </xsl:when>
2675
+ <xsl:otherwise>
2676
+ <xsl:value-of select="@src"/>
2677
+ </xsl:otherwise>
2678
+ </xsl:choose>
2679
+ </xsl:variable>
2680
+
2681
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
2682
+ </fo:block>
2683
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
2684
+ <xsl:apply-templates mode="contents"/>
2685
+ <xsl:text> </xsl:text>
2686
+ </xsl:template><xsl:template match="text()" mode="contents">
2687
+ <xsl:value-of select="."/>
2688
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
2689
+ <xsl:if test="normalize-space() != ''">
2690
+ <fo:block xsl:use-attribute-sets="figure-name-style">
2691
+
2692
+ <xsl:apply-templates/>
2693
+ </fo:block>
2694
+ </xsl:if>
2695
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/><xsl:template match="*[local-name() = 'title']" mode="contents_item">
2696
+ <xsl:apply-templates mode="contents_item"/>
2697
+ <!-- <xsl:text> </xsl:text> -->
2698
+ </xsl:template><xsl:template name="getSection">
2699
+ <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
2700
+ </xsl:template><xsl:template name="getName">
2701
+ <xsl:choose>
2702
+ <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
2703
+ <xsl:copy-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/following-sibling::node()"/>
2704
+ </xsl:when>
2705
+ <xsl:otherwise>
2706
+ <xsl:copy-of select="*[local-name() = 'title']/node()"/>
2707
+ </xsl:otherwise>
2708
+ </xsl:choose>
2709
+ </xsl:template><xsl:template name="insertTitleAsListItem">
2710
+ <xsl:param name="provisional-distance-between-starts" select="'9.5mm'"/>
2711
+ <xsl:variable name="section">
2712
+ <xsl:for-each select="..">
2713
+ <xsl:call-template name="getSection"/>
2714
+ </xsl:for-each>
2715
+ </xsl:variable>
2716
+ <fo:list-block provisional-distance-between-starts="{$provisional-distance-between-starts}">
2717
+ <fo:list-item>
2718
+ <fo:list-item-label end-indent="label-end()">
2719
+ <fo:block>
2720
+ <xsl:value-of select="$section"/>
2721
+ </fo:block>
2722
+ </fo:list-item-label>
2723
+ <fo:list-item-body start-indent="body-start()">
2724
+ <fo:block>
2725
+ <xsl:choose>
2726
+ <xsl:when test="*[local-name() = 'tab']">
2727
+ <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
2728
+ </xsl:when>
2729
+ <xsl:otherwise>
2730
+ <xsl:apply-templates/>
2731
+ </xsl:otherwise>
2732
+ </xsl:choose>
2733
+ </fo:block>
2734
+ </fo:list-item-body>
2735
+ </fo:list-item>
2736
+ </fo:list-block>
2737
+ </xsl:template><xsl:template name="extractTitle">
2738
+ <xsl:choose>
2739
+ <xsl:when test="*[local-name() = 'tab']">
2740
+ <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
2741
+ </xsl:when>
2742
+ <xsl:otherwise>
2743
+ <xsl:apply-templates/>
2744
+ </xsl:otherwise>
2745
+ </xsl:choose>
2746
+ </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
2747
+ <xsl:text> </xsl:text>
2748
+ </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
2749
+ <xsl:copy>
2750
+ <xsl:apply-templates mode="contents_item"/>
2751
+ </xsl:copy>
2752
+ </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
2753
+ <xsl:text> </xsl:text>
2754
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
2755
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
2756
+ <xsl:apply-templates/>
2757
+ </fo:block>
2758
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2759
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()">
2760
+ <xsl:variable name="text">
2761
+ <xsl:call-template name="add-zero-spaces-equal"/>
2762
+ </xsl:variable>
2763
+ <xsl:call-template name="add-zero-spaces">
2764
+ <xsl:with-param name="text" select="$text"/>
2765
+ </xsl:call-template>
2766
+ </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
2767
+ <xsl:if test="normalize-space() != ''">
2768
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2769
+
2770
+ <xsl:apply-templates/>
2771
+ </fo:block>
2772
+ </xsl:if>
2773
+ </xsl:template><xsl:template match="*[local-name() = 'permission']">
2774
+ <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
2775
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2776
+ <xsl:apply-templates/>
2777
+ </fo:block>
2778
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']" mode="presentation">
2779
+ <xsl:if test="normalize-space() != ''">
2780
+ <fo:block xsl:use-attribute-sets="permission-name-style">
2781
+ <xsl:apply-templates/>
2782
+
2783
+ </fo:block>
2784
+ </xsl:if>
2785
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'label']">
2786
+ <fo:block xsl:use-attribute-sets="permission-label-style">
2787
+ <xsl:apply-templates/>
2788
+ </fo:block>
2789
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']">
2790
+ <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
2791
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2792
+ <xsl:apply-templates select="*[local-name()='label']" mode="presentation"/>
2793
+ <xsl:apply-templates select="@obligation" mode="presentation"/>
2794
+ <xsl:apply-templates select="*[local-name()='subject']" mode="presentation"/>
2795
+ <xsl:apply-templates/>
2796
+ </fo:block>
2797
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']" mode="presentation">
2798
+ <xsl:if test="normalize-space() != ''">
2799
+ <fo:block xsl:use-attribute-sets="requirement-name-style">
2800
+
2801
+ <xsl:apply-templates/>
2802
+
2803
+ </fo:block>
2804
+ </xsl:if>
2805
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']" mode="presentation">
2806
+ <fo:block xsl:use-attribute-sets="requirement-label-style">
2807
+ <xsl:apply-templates/>
2808
+ </fo:block>
2809
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation" mode="presentation">
2810
+ <fo:block>
2811
+ <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
2812
+ </fo:block>
2813
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
2814
+ <fo:block xsl:use-attribute-sets="requirement-subject-style">
2815
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
2816
+ </fo:block>
2817
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
2818
+ <fo:block xsl:use-attribute-sets="requirement-inherit-style">
2819
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
2820
+ </fo:block>
2821
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
2822
+ <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
2823
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2824
+ <xsl:apply-templates/>
2825
+ </fo:block>
2826
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']" mode="presentation">
2827
+ <xsl:if test="normalize-space() != ''">
2828
+ <fo:block xsl:use-attribute-sets="recommendation-name-style">
2829
+ <xsl:apply-templates/>
2830
+
2831
+ </fo:block>
2832
+ </xsl:if>
2833
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'label']">
2834
+ <fo:block xsl:use-attribute-sets="recommendation-label-style">
2835
+ <xsl:apply-templates/>
2836
+ </fo:block>
2837
+ </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
2838
+ <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
2839
+ <fo:block-container margin-left="0mm" margin-right="0mm">
2840
+ <fo:table id="{@id}" table-layout="fixed" width="100%" border="0pt solid black">
2841
+ <xsl:variable name="simple-table">
2842
+ <xsl:call-template name="getSimpleTable"/>
2843
+ </xsl:variable>
2844
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
2845
+ <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
2846
+ <fo:table-column column-width="35mm"/>
2847
+ <fo:table-column column-width="115mm"/>
2848
+ </xsl:if>
2849
+ <xsl:apply-templates mode="requirement"/>
2850
+ </fo:table>
2851
+ <!-- fn processing -->
2852
+ <xsl:if test=".//*[local-name() = 'fn']">
2853
+ <xsl:for-each select="*[local-name() = 'tbody']">
2854
+ <fo:block font-size="90%" border-bottom="1.pt solid black">
2855
+ <xsl:call-template name="fn_display"/>
2856
+ </fo:block>
2857
+ </xsl:for-each>
2858
+ </xsl:if>
2859
+ </fo:block-container>
2860
+ </fo:block-container>
2861
+ </xsl:template><xsl:template match="*[local-name()='thead']" mode="requirement">
2862
+ <fo:table-header>
2863
+ <xsl:apply-templates mode="requirement"/>
2864
+ </fo:table-header>
2865
+ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="requirement">
2866
+ <fo:table-body>
2867
+ <xsl:apply-templates mode="requirement"/>
2868
+ </fo:table-body>
2869
+ </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
2870
+ <fo:table-row>
2871
+ <xsl:apply-templates mode="requirement"/>
2872
+ </fo:table-row>
2873
+ </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
2874
+ <fo:table-cell text-align="{@align}">
2875
+ <xsl:attribute name="text-align">
2876
+ <xsl:choose>
2877
+ <xsl:when test="@align">
2878
+ <xsl:value-of select="@align"/>
2879
+ </xsl:when>
2880
+ <xsl:otherwise>center</xsl:otherwise>
2881
+ </xsl:choose>
2882
+ </xsl:attribute>
2883
+ <xsl:if test="@colspan">
2884
+ <xsl:attribute name="number-columns-spanned">
2885
+ <xsl:value-of select="@colspan"/>
2886
+ </xsl:attribute>
2887
+ </xsl:if>
2888
+ <xsl:if test="@rowspan">
2889
+ <xsl:attribute name="number-rows-spanned">
2890
+ <xsl:value-of select="@rowspan"/>
2891
+ </xsl:attribute>
2892
+ </xsl:if>
2893
+
2894
+ <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
2895
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2896
+ <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
2897
+ </xsl:if>
2898
+ <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
2899
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2900
+ <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
2901
+ </xsl:if>
2902
+
2903
+ <fo:block>
2904
+ <xsl:apply-templates/>
2905
+ </fo:block>
2906
+ </fo:table-cell>
2907
+ </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
2908
+ <fo:table-cell text-align="{@align}">
2909
+ <xsl:attribute name="text-align">
2910
+ <xsl:choose>
2911
+ <xsl:when test="@align">
2912
+ <xsl:value-of select="@align"/>
2913
+ </xsl:when>
2914
+ <xsl:otherwise>left</xsl:otherwise>
2915
+ </xsl:choose>
2916
+ </xsl:attribute>
2917
+ <xsl:if test="@colspan">
2918
+ <xsl:attribute name="number-columns-spanned">
2919
+ <xsl:value-of select="@colspan"/>
2920
+ </xsl:attribute>
2921
+ </xsl:if>
2922
+ <xsl:if test="@rowspan">
2923
+ <xsl:attribute name="number-rows-spanned">
2924
+ <xsl:value-of select="@rowspan"/>
2925
+ </xsl:attribute>
2926
+ </xsl:if>
2927
+
2928
+ <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
2929
+ <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
2930
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2931
+ <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])"> <!-- 2nd line and below -->
2932
+ <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
2933
+ </xsl:if>
2934
+ </xsl:if>
2935
+
2936
+ <fo:block>
2937
+ <xsl:apply-templates/>
2938
+ </fo:block>
2939
+ </fo:table-cell>
2940
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
2941
+ <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="4pt">
2942
+ <xsl:apply-templates/>
2943
+ </fo:block>
2944
+ </xsl:template><xsl:template match="*[local-name() = 'p'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
2945
+ <fo:block margin-bottom="10pt">
2946
+ <xsl:apply-templates/>
2947
+ </fo:block>
2948
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']">
2949
+ <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
2950
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2951
+ <xsl:apply-templates/>
2952
+ </fo:block>
2953
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']" mode="presentation">
2954
+ <xsl:if test="normalize-space() != ''">
2955
+ <fo:inline xsl:use-attribute-sets="termexample-name-style">
2956
+ <xsl:apply-templates/>
2957
+ </fo:inline>
2958
+ </xsl:if>
2959
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
2960
+ <fo:inline><xsl:apply-templates/></fo:inline>
2961
+ </xsl:template><xsl:template match="*[local-name() = 'example']">
2962
+ <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
2963
+
2964
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2965
+
2966
+ <xsl:variable name="element">
2967
+ block
2968
+
2969
+ </xsl:variable>
2970
+
2971
+ <xsl:choose>
2972
+ <xsl:when test="normalize-space($element) = 'block'">
2973
+ <fo:block xsl:use-attribute-sets="example-body-style">
2974
+ <xsl:apply-templates/>
2975
+ </fo:block>
2976
+ </xsl:when>
2977
+ <xsl:otherwise>
2978
+ <fo:inline>
2979
+ <xsl:apply-templates/>
2980
+ </fo:inline>
2981
+ </xsl:otherwise>
2982
+ </xsl:choose>
2983
+
2984
+ </fo:block>
2985
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']" mode="presentation">
2986
+
2987
+ <xsl:variable name="element">
2988
+ block
2989
+
2990
+ </xsl:variable>
2991
+ <xsl:choose>
2992
+ <xsl:when test="ancestor::*[local-name() = 'appendix']">
2993
+ <fo:inline>
2994
+ <xsl:apply-templates/>
2995
+ </fo:inline>
2996
+ </xsl:when>
2997
+ <xsl:when test="normalize-space($element) = 'block'">
2998
+ <fo:block xsl:use-attribute-sets="example-name-style">
2999
+ <xsl:apply-templates/>
3000
+ </fo:block>
3001
+ </xsl:when>
3002
+ <xsl:otherwise>
3003
+ <fo:inline xsl:use-attribute-sets="example-name-style">
3004
+ <xsl:apply-templates/>
3005
+ </fo:inline>
3006
+ </xsl:otherwise>
3007
+ </xsl:choose>
3008
+
3009
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3010
+ <fo:block xsl:use-attribute-sets="example-p-style">
3011
+
3012
+ <xsl:apply-templates/>
3013
+ </fo:block>
3014
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']">
3015
+ <fo:block xsl:use-attribute-sets="termsource-style">
3016
+ <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
3017
+ <xsl:variable name="termsource_text">
3018
+ <xsl:apply-templates/>
3019
+ </xsl:variable>
3020
+ <xsl:choose>
3021
+ <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
3022
+ <xsl:apply-templates/>
2963
3023
  </xsl:when>
2964
3024
  <xsl:otherwise>
2965
- <xsl:value-of select="normalize-space(@target)"/>
3025
+ <xsl:text>[</xsl:text>
3026
+ <xsl:apply-templates/>
3027
+ <xsl:text>]</xsl:text>
2966
3028
  </xsl:otherwise>
2967
3029
  </xsl:choose>
3030
+ </fo:block>
3031
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
3032
+ <xsl:if test="normalize-space() != ''">
3033
+ <xsl:value-of select="."/>
3034
+ </xsl:if>
3035
+ </xsl:template><xsl:template match="*[local-name() = 'origin']">
3036
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3037
+
3038
+ <xsl:call-template name="getTitle">
3039
+ <xsl:with-param name="name" select="'title-source'"/>
3040
+ </xsl:call-template>
3041
+ <xsl:text>: </xsl:text>
3042
+
3043
+ <fo:inline xsl:use-attribute-sets="origin-style">
3044
+ <xsl:apply-templates/>
3045
+ </fo:inline>
3046
+ </fo:basic-link>
3047
+ </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
3048
+ <fo:inline><xsl:apply-templates/></fo:inline>
3049
+ </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
3050
+ <xsl:if test="normalize-space() != ''">
3051
+ <xsl:value-of select="."/>
3052
+ </xsl:if>
3053
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
3054
+
3055
+ <fo:block xsl:use-attribute-sets="quote-style">
3056
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3057
+ </fo:block>
3058
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3059
+ <fo:block xsl:use-attribute-sets="quote-source-style">
3060
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
3061
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
3062
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
3063
+ </fo:block>
3064
+ </xsl:if>
3065
+ </xsl:template><xsl:template match="*[local-name() = 'source']">
3066
+ <xsl:if test="../*[local-name() = 'author']">
3067
+ <xsl:text>, </xsl:text>
3068
+ </xsl:if>
3069
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3070
+ <xsl:apply-templates/>
3071
+ </fo:basic-link>
3072
+ </xsl:template><xsl:template match="*[local-name() = 'author']">
3073
+ <xsl:text>— </xsl:text>
3074
+ <xsl:apply-templates/>
3075
+ </xsl:template><xsl:template match="*[local-name() = 'eref']">
3076
+ <fo:inline xsl:use-attribute-sets="eref-style">
3077
+ <xsl:if test="@type = 'footnote'">
3078
+
3079
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
3080
+ <xsl:attribute name="font-size">80%</xsl:attribute>
3081
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3082
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
3083
+
3084
+
3085
+ </xsl:if>
3086
+
3087
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3088
+
3089
+ <xsl:if test="@type = 'inline'">
3090
+
3091
+ <xsl:attribute name="color">blue</xsl:attribute>
3092
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
3093
+
3094
+
3095
+ </xsl:if>
3096
+
3097
+
3098
+ <xsl:apply-templates/>
3099
+ </fo:basic-link>
3100
+ </fo:inline>
3101
+ </xsl:template><xsl:template match="*[local-name() = 'tab']">
3102
+ <!-- zero-space char -->
3103
+ <xsl:variable name="depth">
3104
+ <xsl:call-template name="getLevel">
3105
+ <xsl:with-param name="depth" select="../@depth"/>
3106
+ </xsl:call-template>
2968
3107
  </xsl:variable>
2969
- <fo:inline xsl:use-attribute-sets="link-style">
3108
+
3109
+ <xsl:variable name="padding">
3110
+
3111
+
3112
+ <xsl:choose>
3113
+ <xsl:when test="$depth &gt;= 3">3</xsl:when>
3114
+ <xsl:when test="$depth = 1">3</xsl:when>
3115
+ <xsl:otherwise>2</xsl:otherwise>
3116
+ </xsl:choose>
3117
+
3118
+
3119
+
3120
+
3121
+
3122
+
3123
+
3124
+
3125
+
3126
+
3127
+
3128
+
3129
+
3130
+
3131
+
3132
+
3133
+ </xsl:variable>
3134
+
3135
+ <xsl:variable name="padding-right">
2970
3136
  <xsl:choose>
2971
- <xsl:when test="$target = ''">
2972
- <xsl:apply-templates/>
2973
- </xsl:when>
3137
+ <xsl:when test="normalize-space($padding) = ''">0</xsl:when>
2974
3138
  <xsl:otherwise>
2975
- <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
2976
- <xsl:choose>
2977
- <xsl:when test="normalize-space(.) = ''">
2978
- <xsl:value-of select="$target"/>
2979
- </xsl:when>
2980
- <xsl:otherwise>
2981
- <xsl:apply-templates/>
2982
- </xsl:otherwise>
2983
- </xsl:choose>
2984
- </fo:basic-link>
3139
+ <xsl:value-of select="normalize-space($padding)"/>
2985
3140
  </xsl:otherwise>
2986
3141
  </xsl:choose>
2987
- </fo:inline>
2988
- </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
2989
- <fo:block xsl:use-attribute-sets="sourcecode-style">
2990
- <!-- <xsl:choose>
2991
- <xsl:when test="@lang = 'en'"></xsl:when>
2992
- <xsl:otherwise> -->
2993
- <xsl:attribute name="white-space">pre</xsl:attribute>
2994
- <xsl:attribute name="wrap-option">wrap</xsl:attribute>
2995
- <!-- </xsl:otherwise>
2996
- </xsl:choose> -->
3142
+ </xsl:variable>
3143
+
3144
+ <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3145
+
3146
+ <xsl:choose>
3147
+ <xsl:when test="$language = 'zh'">
3148
+ <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
3149
+ </xsl:when>
3150
+ <xsl:when test="../../@inline-header = 'true'">
3151
+ <fo:inline font-size="90%">
3152
+ <xsl:call-template name="insertNonBreakSpaces">
3153
+ <xsl:with-param name="count" select="$padding-right"/>
3154
+ </xsl:call-template>
3155
+ </fo:inline>
3156
+ </xsl:when>
3157
+ <xsl:otherwise>
3158
+ <fo:inline padding-right="{$padding-right}mm">​</fo:inline>
3159
+ </xsl:otherwise>
3160
+ </xsl:choose>
3161
+
3162
+ </xsl:template><xsl:template name="insertNonBreakSpaces">
3163
+ <xsl:param name="count"/>
3164
+ <xsl:if test="$count &gt; 0">
3165
+ <xsl:text> </xsl:text>
3166
+ <xsl:call-template name="insertNonBreakSpaces">
3167
+ <xsl:with-param name="count" select="$count - 1"/>
3168
+ </xsl:call-template>
3169
+ </xsl:if>
3170
+ </xsl:template><xsl:template match="*[local-name() = 'domain']">
3171
+ <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
3172
+ <xsl:text> </xsl:text>
3173
+ </xsl:template><xsl:template match="*[local-name() = 'admitted']">
3174
+ <fo:block xsl:use-attribute-sets="admitted-style">
2997
3175
  <xsl:apply-templates/>
2998
3176
  </fo:block>
2999
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
3000
- <fo:inline id="{@id}"/>
3001
- </xsl:template><xsl:template match="*[local-name()='appendix']">
3002
- <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
3003
- <xsl:variable name="title-appendix">
3004
- <xsl:call-template name="getTitle">
3005
- <xsl:with-param name="name" select="'title-appendix'"/>
3006
- </xsl:call-template>
3007
- </xsl:variable>
3008
- <fo:inline padding-right="5mm"><xsl:value-of select="$title-appendix"/> <xsl:number/></fo:inline>
3009
- <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
3177
+ </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3178
+ <xsl:variable name="title-deprecated">
3179
+ <xsl:call-template name="getTitle">
3180
+ <xsl:with-param name="name" select="'title-deprecated'"/>
3181
+ </xsl:call-template>
3182
+ </xsl:variable>
3183
+ <fo:block xsl:use-attribute-sets="deprecates-style">
3184
+ <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
3185
+ </fo:block>
3186
+ </xsl:template><xsl:template match="*[local-name() = 'definition']">
3187
+ <fo:block xsl:use-attribute-sets="definition-style">
3188
+ <xsl:apply-templates/>
3010
3189
  </fo:block>
3190
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
3011
3191
  <xsl:apply-templates/>
3012
- </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3013
- <fo:inline><xsl:apply-templates/></fo:inline>
3014
- </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']">
3015
- <fo:block xsl:use-attribute-sets="appendix-example-style">
3016
- <xsl:variable name="claims_id" select="ancestor::*[local-name()='clause'][1]/@id"/>
3017
- <xsl:variable name="title-example">
3018
- <xsl:call-template name="getTitle">
3019
- <xsl:with-param name="name" select="'title-example'"/>
3020
- </xsl:call-template>
3021
- </xsl:variable>
3022
- <xsl:value-of select="$title-example"/>
3023
- <xsl:if test="count(ancestor::*[local-name()='clause'][1]//*[local-name()='example']) &gt; 1">
3024
- <xsl:number count="*[local-name()='example'][ancestor::*[local-name()='clause'][@id = $claims_id]]" level="any"/><xsl:text> </xsl:text>
3192
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
3193
+ <fo:inline> <xsl:apply-templates/></fo:inline>
3194
+ <fo:block> </fo:block>
3195
+ </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
3196
+
3197
+ <fo:block>
3198
+ <xsl:call-template name="setId"/>
3199
+
3200
+
3201
+ <xsl:variable name="pos"><xsl:number count="csd:sections/csd:clause | csd:sections/csd:terms"/></xsl:variable>
3202
+ <xsl:if test="$pos &gt;= 2">
3203
+ <xsl:attribute name="space-before">18pt</xsl:attribute>
3025
3204
  </xsl:if>
3026
- <xsl:if test="*[local-name()='name']">
3027
- <xsl:text>— </xsl:text><xsl:apply-templates select="*[local-name()='name']" mode="process"/>
3028
- </xsl:if>
3205
+
3206
+
3207
+
3208
+
3209
+
3210
+
3211
+
3212
+
3213
+
3214
+ <xsl:apply-templates/>
3029
3215
  </fo:block>
3030
- <xsl:apply-templates/>
3031
- </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">
3032
- <fo:inline><xsl:apply-templates/></fo:inline>
3033
- </xsl:template><xsl:template match="*[local-name() = 'callout']">
3034
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
3035
- </xsl:template><xsl:template match="*[local-name() = 'annotation']">
3036
- <xsl:variable name="annotation-id" select="@id"/>
3037
- <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
3038
- <fo:block id="{$annotation-id}" white-space="nowrap">
3039
- <fo:inline>
3040
- <xsl:apply-templates>
3041
- <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
3042
- </xsl:apply-templates>
3043
- </fo:inline>
3044
- </fo:block>
3045
- </xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
3046
- <xsl:param name="callout"/>
3047
- <fo:inline id="{@id}">
3048
- <!-- for first p in annotation, put <x> -->
3049
- <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
3216
+
3217
+
3218
+
3219
+ </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
3220
+ <fo:block break-after="page"/>
3221
+ <fo:block>
3222
+ <xsl:call-template name="setId"/>
3050
3223
  <xsl:apply-templates/>
3051
- </fo:inline>
3052
- </xsl:template><xsl:template match="*[local-name() = 'modification']">
3053
- <xsl:variable name="title-modified">
3054
- <xsl:call-template name="getTitle">
3055
- <xsl:with-param name="name" select="'title-modified'"/>
3056
- </xsl:call-template>
3057
- </xsl:variable>
3058
- <xsl:choose>
3059
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3060
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
3061
- </xsl:choose>
3224
+ </fo:block>
3225
+ </xsl:template><xsl:template match="*[local-name() = 'clause']">
3226
+ <fo:block>
3227
+ <xsl:call-template name="setId"/>
3228
+ <xsl:apply-templates/>
3229
+ </fo:block>
3230
+ </xsl:template><xsl:template match="*[local-name() = 'definitions']">
3231
+ <fo:block id="{@id}">
3232
+ <xsl:apply-templates/>
3233
+ </fo:block>
3234
+ </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
3235
+
3236
+ <fo:block id="{@id}">
3237
+ <xsl:apply-templates/>
3238
+ </fo:block>
3239
+ </xsl:template><xsl:template match="*[local-name() = 'annex']">
3240
+ <fo:block break-after="page"/>
3241
+ <fo:block id="{@id}">
3242
+
3243
+ </fo:block>
3062
3244
  <xsl:apply-templates/>
3245
+ </xsl:template><xsl:template match="*[local-name() = 'review']">
3246
+ <!-- comment 2019-11-29 -->
3247
+ <!-- <fo:block font-weight="bold">Review:</fo:block>
3248
+ <xsl:apply-templates /> -->
3249
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
3250
+ <!-- 0xA0 to space replacement -->
3251
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3252
+ </xsl:template><xsl:template match="*[local-name() = 'errata']">
3253
+ <!-- <row>
3254
+ <date>05-07-2013</date>
3255
+ <type>Editorial</type>
3256
+ <change>Changed CA-9 Priority Code from P1 to P2 in <xref target="tabled2"/>.</change>
3257
+ <pages>D-3</pages>
3258
+ </row>
3259
+ -->
3260
+ <fo:table table-layout="fixed" width="100%" font-size="10pt" border="1pt solid black">
3261
+ <fo:table-column column-width="20mm"/>
3262
+ <fo:table-column column-width="23mm"/>
3263
+ <fo:table-column column-width="107mm"/>
3264
+ <fo:table-column column-width="15mm"/>
3265
+ <fo:table-body>
3266
+ <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
3267
+ <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
3268
+ <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
3269
+ <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
3270
+ <fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell>
3271
+ </fo:table-row>
3272
+ <xsl:apply-templates/>
3273
+ </fo:table-body>
3274
+ </fo:table>
3275
+ </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']">
3276
+ <fo:table-row>
3277
+ <xsl:apply-templates/>
3278
+ </fo:table-row>
3279
+ </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*">
3280
+ <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
3281
+ <fo:block><xsl:apply-templates/></fo:block>
3282
+ </fo:table-cell>
3063
3283
  </xsl:template><xsl:template name="convertDate">
3064
3284
  <xsl:param name="date"/>
3065
3285
  <xsl:param name="format" select="'short'"/>
@@ -3190,27 +3410,49 @@
3190
3410
  </xsl:otherwise>
3191
3411
  </xsl:choose>
3192
3412
  </xsl:template><xsl:template name="getLevel">
3193
- <xsl:variable name="level_total" select="count(ancestor::*)"/>
3194
- <xsl:variable name="level">
3195
- <xsl:choose>
3196
- <xsl:when test="ancestor::*[local-name() = 'preface']">
3197
- <xsl:value-of select="$level_total - 2"/>
3198
- </xsl:when>
3199
- <xsl:when test="ancestor::*[local-name() = 'sections']">
3200
- <xsl:value-of select="$level_total - 2"/>
3201
- </xsl:when>
3202
- <xsl:when test="ancestor::*[local-name() = 'bibliography']">
3203
- <xsl:value-of select="$level_total - 2"/>
3204
- </xsl:when>
3205
- <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
3206
- <xsl:otherwise>
3207
- <xsl:value-of select="$level_total - 1"/>
3208
- </xsl:otherwise>
3209
- </xsl:choose>
3210
- </xsl:variable>
3211
- <xsl:value-of select="$level"/>
3212
- </xsl:template><xsl:template name="getSubSection">
3213
- <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']"/>
3413
+ <xsl:param name="depth"/>
3414
+ <xsl:choose>
3415
+ <xsl:when test="normalize-space(@depth) != ''">
3416
+ <xsl:value-of select="@depth"/>
3417
+ </xsl:when>
3418
+ <xsl:when test="normalize-space($depth) != ''">
3419
+ <xsl:value-of select="$depth"/>
3420
+ </xsl:when>
3421
+ <xsl:otherwise>
3422
+ <xsl:variable name="level_total" select="count(ancestor::*)"/>
3423
+ <xsl:variable name="level">
3424
+ <xsl:choose>
3425
+ <xsl:when test="parent::*[local-name() = 'preface']">
3426
+ <xsl:value-of select="$level_total - 1"/>
3427
+ </xsl:when>
3428
+ <xsl:when test="ancestor::*[local-name() = 'preface']">
3429
+ <xsl:value-of select="$level_total - 2"/>
3430
+ </xsl:when>
3431
+ <!-- <xsl:when test="parent::*[local-name() = 'sections']">
3432
+ <xsl:value-of select="$level_total - 1"/>
3433
+ </xsl:when> -->
3434
+ <xsl:when test="ancestor::*[local-name() = 'sections']">
3435
+ <xsl:value-of select="$level_total - 1"/>
3436
+ </xsl:when>
3437
+ <xsl:when test="ancestor::*[local-name() = 'bibliography']">
3438
+ <xsl:value-of select="$level_total - 1"/>
3439
+ </xsl:when>
3440
+ <xsl:when test="parent::*[local-name() = 'annex']">
3441
+ <xsl:value-of select="$level_total - 1"/>
3442
+ </xsl:when>
3443
+ <xsl:when test="ancestor::*[local-name() = 'annex']">
3444
+ <xsl:value-of select="$level_total"/>
3445
+ </xsl:when>
3446
+ <xsl:when test="local-name() = 'annex'">1</xsl:when>
3447
+ <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
3448
+ <xsl:otherwise>
3449
+ <xsl:value-of select="$level_total - 1"/>
3450
+ </xsl:otherwise>
3451
+ </xsl:choose>
3452
+ </xsl:variable>
3453
+ <xsl:value-of select="$level"/>
3454
+ </xsl:otherwise>
3455
+ </xsl:choose>
3214
3456
  </xsl:template><xsl:template name="split">
3215
3457
  <xsl:param name="pText" select="."/>
3216
3458
  <xsl:param name="sep" select="','"/>
@@ -3225,4 +3467,47 @@
3225
3467
  </xsl:if>
3226
3468
  </xsl:template><xsl:template name="getDocumentId">
3227
3469
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
3470
+ </xsl:template><xsl:template name="namespaceCheck">
3471
+ <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
3472
+ <xsl:variable name="XSLNS">
3473
+
3474
+
3475
+
3476
+
3477
+
3478
+
3479
+
3480
+
3481
+
3482
+ <xsl:value-of select="document('')//*/namespace::csd"/>
3483
+
3484
+
3485
+
3486
+
3487
+
3488
+ </xsl:variable>
3489
+ <xsl:if test="$documentNS != $XSLNS">
3490
+ <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
3491
+ </xsl:if>
3492
+ </xsl:template><xsl:template name="getLanguage">
3493
+ <xsl:param name="lang"/>
3494
+ <xsl:variable name="language" select="java:toLowerCase(java:java.lang.String.new($lang))"/>
3495
+ <xsl:choose>
3496
+ <xsl:when test="$language = 'en'">English</xsl:when>
3497
+ <xsl:when test="$language = 'fr'">French</xsl:when>
3498
+ <xsl:when test="$language = 'de'">Deutsch</xsl:when>
3499
+ <xsl:when test="$language = 'cn'">Chinese</xsl:when>
3500
+ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
3501
+ </xsl:choose>
3502
+ </xsl:template><xsl:template name="setId">
3503
+ <xsl:attribute name="id">
3504
+ <xsl:choose>
3505
+ <xsl:when test="@id">
3506
+ <xsl:value-of select="@id"/>
3507
+ </xsl:when>
3508
+ <xsl:otherwise>
3509
+ <xsl:value-of select="generate-id()"/>
3510
+ </xsl:otherwise>
3511
+ </xsl:choose>
3512
+ </xsl:attribute>
3228
3513
  </xsl:template></xsl:stylesheet>