metanorma-cc 1.4.3 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aaec6353b69892d4cb11ddb871e78f40deac9fd7211abc4ca8453d7a90cc2e4e
4
- data.tar.gz: bc3a24bd8da38ee1f601fd4537bb2f2eaa3f64b9b65ce59d7c4e05f0a55d1034
3
+ metadata.gz: d0dd35d61e3b07c16de749842d94ba4db6b631161c959d3479ed41dda5120fb3
4
+ data.tar.gz: 18c6b93d8c11b51bf18f8dbe4e3440ae761036b8d5e644c06290fe7eaa4652f2
5
5
  SHA512:
6
- metadata.gz: 8c8783aee29ff7c0424e9757d5abacf9a8c723b0e542d93999cf0c2095854de9d2a3a51b21259b6646cd5a9a18158cbe030c1357fd73c2d385b73010919c576f
7
- data.tar.gz: b9b58534885d70c030e184e8e1f80f2b32939407aec4b22295a4c00665e6a1d8d683dc753291e6a1042b9a73f78f295cb9e9e466a017e7e468d881d0f9ea3953
6
+ metadata.gz: aa81101b38172f9b85512624e80691981c0ba5bc86f4a6a00506e4a45d794c01ca0cd90e6ba66393382cac793e1cf8affbe820bf5afc60c068381d686a9dc6bf
7
+ data.tar.gz: 462f9d6109b6c007c11a8ef10bad93ccd9b74aa7980101fcd818b42edf81137b43f695902e95d5b874a60fa02c18bef258fe1e5244d67327c060de3c3071b060
@@ -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)
@@ -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
 
@@ -24,23 +27,18 @@
24
27
  <xsl:variable name="contents">
25
28
  <contents>
26
29
  <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>
30
+
31
+ <xsl:apply-templates select="/csd:csd-standard/csd:sections/csd:clause[1]" mode="contents"/> <!-- [@id = '_scope'] -->
32
+
33
+ <!-- Normative references -->
34
+ <xsl:apply-templates select="/csd:csd-standard/csd:bibliography/csd:references[1]" mode="contents"/> <!-- [@id = '_normative_references'] -->
35
+
36
+ <xsl:apply-templates select="/csd:csd-standard/csd:sections/*[position() &gt; 1]" mode="contents"/> <!-- @id != '_scope' -->
37
+
38
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
39
 
41
- <xsl:apply-templates select="//csd:figure" mode="contents"/>
42
-
43
- <xsl:apply-templates select="//csd:table" mode="contents"/>
40
+ <!-- Bibliography -->
41
+ <xsl:apply-templates select="/csd:csd-standard/csd:bibliography/csd:references[position() &gt; 1]" mode="contents"/> <!-- @id = '_bibliography' -->
44
42
 
45
43
  </contents>
46
44
  </xsl:variable>
@@ -50,6 +48,7 @@
50
48
  </xsl:variable>
51
49
 
52
50
  <xsl:template match="/">
51
+ <xsl:call-template name="namespaceCheck"/>
53
52
  <fo:root font-family="SourceSansPro, STIX2Math, HanSans" font-size="10.5pt" xml:lang="{$lang}">
54
53
  <fo:layout-master-set>
55
54
  <!-- Cover page -->
@@ -62,13 +61,6 @@
62
61
  </fo:simple-page-master>
63
62
 
64
63
  <!-- 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
64
 
73
65
  <!-- Preface odd pages -->
74
66
  <fo:simple-page-master master-name="odd-preface" page-width="{$pageWidth}" page-height="{$pageHeight}">
@@ -245,38 +237,39 @@
245
237
  </xsl:variable>
246
238
  <fo:block font-size="14pt" margin-bottom="15.5pt"><xsl:value-of select="$title-toc"/></fo:block>
247
239
 
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 -->
240
+ <xsl:for-each select="xalan:nodeset($contents)//item"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
249
241
 
250
242
  <fo:block>
251
243
  <xsl:if test="@level = 1">
252
244
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
253
245
  </xsl:if>
246
+
247
+
254
248
  <fo:list-block>
255
249
  <xsl:attribute name="provisional-distance-between-starts">
256
250
  <xsl:choose>
257
251
  <!-- skip 0 section without subsections -->
258
- <xsl:when test="@section != '' and not(@display-section = 'false')">8mm</xsl:when>
252
+ <xsl:when test="@section != ''">8mm</xsl:when> <!-- and not(@display-section = 'false') -->
259
253
  <xsl:otherwise>0mm</xsl:otherwise>
260
254
  </xsl:choose>
261
255
  </xsl:attribute>
262
256
  <fo:list-item>
263
257
  <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>
258
+ <fo:block>
259
+ <xsl:value-of select="@section"/>
268
260
  </fo:block>
269
261
  </fo:list-item-label>
270
262
  <fo:list-item-body start-indent="body-start()">
271
263
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
272
264
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
273
- <xsl:if test="@section and @display-section = 'false'">
265
+ <!-- <xsl:if test="@section and @display-section = 'false'">
274
266
  <xsl:value-of select="@section"/><xsl:text> </xsl:text>
275
267
  </xsl:if>
276
268
  <xsl:if test="@addon != ''">
277
269
  <xsl:text>(</xsl:text><xsl:value-of select="@addon"/><xsl:text>)</xsl:text>
278
270
  </xsl:if>
279
- <xsl:text> </xsl:text><xsl:value-of select="text()"/>
271
+ <xsl:text> </xsl:text><xsl:value-of select="text()"/> -->
272
+ <xsl:apply-templates/>
280
273
  <fo:inline keep-together.within-line="always">
281
274
  <fo:leader leader-pattern="dots"/>
282
275
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
@@ -310,20 +303,17 @@
310
303
  <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:title[@language = 'en']"/>
311
304
  </fo:block>
312
305
  <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>
306
+ <xsl:apply-templates select="/csd:csd-standard/csd:sections/csd:clause[1]"/> <!-- Scope -->
307
+
316
308
  <!-- 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>
309
+ <xsl:apply-templates select="/csd:csd-standard/csd:bibliography/csd:references[1]"/>
320
310
 
321
311
  <!-- 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>
312
+ <xsl:apply-templates select="/csd:csd-standard/csd:sections/*[position() &gt; 1]"/>
325
313
 
326
314
  <xsl:apply-templates select="/csd:csd-standard/csd:annex"/>
315
+
316
+ <!-- Bibliography -->
327
317
  <xsl:apply-templates select="/csd:csd-standard/csd:bibliography/csd:references[position() &gt; 1]"/>
328
318
 
329
319
  </fo:block>
@@ -335,168 +325,53 @@
335
325
  </fo:root>
336
326
  </xsl:template>
337
327
 
338
- <!-- for pass the paremeter 'sectionNum' over templates, like 'tunnel' parameter in XSLT 2.0 -->
339
328
  <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>
329
+ <xsl:apply-templates/>
346
330
  </xsl:template>
347
331
 
348
332
  <!-- ============================= -->
349
333
  <!-- CONTENTS -->
350
334
  <!-- ============================= -->
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>
335
+ <xsl:template match="node()" mode="contents">
336
+ <xsl:apply-templates mode="contents"/>
358
337
  </xsl:template>
359
338
 
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
-
339
+ <!-- element with title -->
340
+ <xsl:template match="*[csd:title]" mode="contents">
391
341
  <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"/>
342
+ <xsl:call-template name="getLevel">
343
+ <xsl:with-param name="depth" select="csd:title/@depth"/>
398
344
  </xsl:call-template>
399
345
  </xsl:variable>
400
346
 
401
347
  <xsl:variable name="display">
402
348
  <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>
349
+ <xsl:when test="ancestor-or-self::csd:bibitem">false</xsl:when>
350
+ <xsl:when test="ancestor-or-self::csd:term">false</xsl:when>
351
+ <xsl:when test="$level &gt; 2">false</xsl:when>
414
352
  <xsl:otherwise>true</xsl:otherwise>
415
353
  </xsl:choose>
416
354
  </xsl:variable>
417
355
 
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>
356
+ <xsl:if test="$display = 'true'">
435
357
 
436
- <xsl:apply-templates mode="contents">
437
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
438
- </xsl:apply-templates>
358
+ <xsl:variable name="section">
359
+ <xsl:call-template name="getSection"/>
360
+ </xsl:variable>
361
+
362
+ <xsl:variable name="title">
363
+ <xsl:call-template name="getName"/>
364
+ </xsl:variable>
365
+
366
+ <item id="{@id}" level="{$level}" section="{$section}">
367
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
368
+ </item>
369
+ <xsl:apply-templates mode="contents"/>
370
+ </xsl:if>
439
371
 
440
372
  </xsl:template>
441
373
 
442
374
 
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
375
  <!-- ============================= -->
501
376
  <!-- ============================= -->
502
377
 
@@ -546,90 +421,14 @@
546
421
  </fo:block>
547
422
  </xsl:template>
548
423
 
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
424
 
590
425
 
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
426
  <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
427
 
623
428
  <xsl:variable name="level">
624
429
  <xsl:call-template name="getLevel"/>
625
430
  </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
-
431
+
633
432
  <xsl:variable name="font-size">
634
433
  <xsl:choose>
635
434
  <xsl:when test="ancestor::csd:preface">13pt</xsl:when>
@@ -650,41 +449,16 @@
650
449
  <xsl:variable name="color" select="'rgb(14, 26, 133)'"/>
651
450
 
652
451
  <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>
452
+ <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
453
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
454
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
455
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
456
+ <xsl:attribute name="color"><xsl:value-of select="$color"/></xsl:attribute>
457
+ <xsl:if test="ancestor::csd:sections">
458
+ <xsl:attribute name="margin-top">13.5pt</xsl:attribute>
459
+ </xsl:if>
460
+ <xsl:apply-templates/>
461
+ </xsl:element>
688
462
  </xsl:template>
689
463
 
690
464
 
@@ -763,85 +537,6 @@
763
537
  <xsl:apply-templates/>
764
538
  </xsl:template>
765
539
 
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
540
 
846
541
  <xsl:template match="csd:bibitem">
847
542
  <fo:block id="{@id}" margin-bottom="6pt"> <!-- 12 pt -->
@@ -873,7 +568,7 @@
873
568
  </xsl:template>
874
569
 
875
570
 
876
- <xsl:template match="csd:bibitem/csd:note">
571
+ <xsl:template match="csd:bibitem/csd:note" priority="2">
877
572
  <fo:footnote>
878
573
  <xsl:variable name="number">
879
574
  <xsl:choose>
@@ -935,28 +630,15 @@
935
630
  </fo:block>
936
631
  </fo:list-item-label>
937
632
  <fo:list-item-body start-indent="body-start()">
938
- <xsl:apply-templates/>
633
+ <fo:block>
634
+ <xsl:apply-templates/>
635
+ </fo:block>
939
636
  </fo:list-item-body>
940
637
  </fo:list-item>
941
638
  </xsl:template>
942
639
 
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>
640
+
641
+ <xsl:template match="csd:preferred">
960
642
  <xsl:variable name="level">
961
643
  <xsl:call-template name="getLevel"/>
962
644
  </xsl:variable>
@@ -968,10 +650,7 @@
968
650
  </xsl:variable>
969
651
  <fo:block font-size="{$font-size}" line-height="1.1">
970
652
  <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>
653
+ <xsl:apply-templates select="ancestor::csd:term/csd:name" mode="presentation"/>
975
654
  </fo:block>
976
655
  <fo:block font-weight="bold" keep-with-next="always">
977
656
  <xsl:apply-templates/>
@@ -979,110 +658,15 @@
979
658
  </fo:block>
980
659
  </xsl:template>
981
660
 
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
661
 
1075
-
1076
- <xsl:template match="csd:annex">
1077
- <fo:block break-after="page"/>
1078
- <xsl:apply-templates/>
1079
- </xsl:template>
1080
662
 
1081
-
663
+
1082
664
  <!-- <xsl:template match="csd:references[@id = '_bibliography']"> -->
1083
665
  <xsl:template match="csd:references[position() &gt; 1]">
1084
666
  <fo:block break-after="page"/>
667
+ <fo:block id="{@id}">
1085
668
  <xsl:apply-templates/>
669
+ </fo:block>
1086
670
  </xsl:template>
1087
671
 
1088
672
 
@@ -1131,154 +715,19 @@
1131
715
  <xsl:apply-templates/>
1132
716
  </fo:inline>
1133
717
  </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
718
 
1156
719
 
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'))">
720
+ <xsl:template match="csd:xref" priority="2">
721
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">
722
+ <xsl:if test="not(starts-with(text(), 'Figure') or starts-with(text(), 'Table'))">
1161
723
  <xsl:attribute name="color">blue</xsl:attribute>
1162
724
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1163
725
  </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"/>
726
+ <xsl:apply-templates/>
1178
727
  </fo:basic-link>
1179
728
  </xsl:template>
1180
729
 
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
730
 
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
731
 
1283
732
  <xsl:template match="csd:admonition">
1284
733
  <fo:block margin-bottom="12pt" font-weight="bold"> <!-- text-align="center" -->
@@ -1288,17 +737,7 @@
1288
737
  </fo:block>
1289
738
  </xsl:template>
1290
739
 
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>
740
+
1302
741
 
1303
742
  <xsl:template match="csd:formula/csd:stem">
1304
743
  <fo:block margin-top="6pt" margin-bottom="12pt">
@@ -1314,29 +753,16 @@
1314
753
  </fo:table-cell>
1315
754
  <fo:table-cell display-align="center">
1316
755
  <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>
756
+ <xsl:apply-templates select="../csd:name" mode="presentation"/>
1325
757
  </fo:block>
1326
758
  </fo:table-cell>
1327
759
  </fo:table-row>
1328
760
  </fo:table-body>
1329
- </fo:table>
1330
- <fo:inline keep-together.within-line="always">
1331
- </fo:inline>
761
+ </fo:table>
1332
762
  </fo:block>
1333
763
  </xsl:template>
1334
764
 
1335
-
1336
- <xsl:template match="csd:br" priority="2">
1337
- <!-- <fo:block>&#xA0;</fo:block> -->
1338
- <xsl:value-of select="$linebreak"/>
1339
- </xsl:template>
765
+
1340
766
 
1341
767
  <xsl:template name="insertHeaderFooter">
1342
768
  <fo:static-content flow-name="header-even">
@@ -1391,139 +817,8 @@
1391
817
  </fo:static-content>
1392
818
  </xsl:template>
1393
819
 
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
820
 
1486
821
  <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
822
 
1528
823
  <title-annex lang="en">Annex </title-annex>
1529
824
  <title-annex lang="fr">Annexe </title-annex>
@@ -1531,17 +826,7 @@
1531
826
  <title-annex lang="zh">Annex </title-annex>
1532
827
 
1533
828
 
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
-
829
+
1545
830
  <title-edition lang="en">
1546
831
 
1547
832
  <xsl:text>Edition </xsl:text>
@@ -1549,9 +834,7 @@
1549
834
 
1550
835
  </title-edition>
1551
836
 
1552
- <title-formula lang="en">Formula </title-formula>
1553
- <title-formula lang="fr">Formula </title-formula>
1554
-
837
+
1555
838
  <title-toc lang="en">
1556
839
 
1557
840
  <xsl:text>Contents</xsl:text>
@@ -1586,13 +869,6 @@
1586
869
  </title-part>
1587
870
  <title-part lang="zh">第 # 部分:</title-part>
1588
871
 
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
872
  <title-modified lang="en">modified</title-modified>
1597
873
  <title-modified lang="fr">modifiée</title-modified>
1598
874
 
@@ -1606,14 +882,12 @@
1606
882
 
1607
883
  <title-deprecated lang="en">DEPRECATED</title-deprecated>
1608
884
  <title-deprecated lang="fr">DEPRECATED</title-deprecated>
1609
-
1610
- <title-submitting-organizations lang="en">Submitting Organizations</title-submitting-organizations>
1611
-
885
+
1612
886
  <title-list-tables lang="en">List of Tables</title-list-tables>
1613
887
 
1614
888
  <title-list-figures lang="en">List of Figures</title-list-figures>
1615
889
 
1616
- <title-recommendation lang="en">Recommendation </title-recommendation>
890
+ <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
1617
891
 
1618
892
  <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
1619
893
 
@@ -1623,8 +897,6 @@
1623
897
 
1624
898
  <title-in lang="en">in </title-in>
1625
899
 
1626
- <title-box lang="en">Box </title-box>
1627
-
1628
900
  <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
1629
901
  <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
1630
902
 
@@ -1647,7 +919,7 @@
1647
919
  <title-warning lang="zh">警告</title-warning>
1648
920
 
1649
921
  <title-amendment lang="en">AMENDMENT</title-amendment>
1650
- </xsl:variable><xsl:template name="getTitle">
922
+ </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1651
923
  <xsl:param name="name"/>
1652
924
  <xsl:variable name="lang">
1653
925
  <xsl:call-template name="getLang"/>
@@ -1668,6 +940,8 @@
1668
940
 
1669
941
 
1670
942
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
943
+ <xsl:attribute name="white-space">pre</xsl:attribute>
944
+ <xsl:attribute name="wrap-option">wrap</xsl:attribute>
1671
945
 
1672
946
 
1673
947
 
@@ -1681,126 +955,358 @@
1681
955
 
1682
956
 
1683
957
 
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>
958
+ </xsl:attribute-set><xsl:attribute-set name="permission-style">
1690
959
 
960
+ </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
1691
961
 
962
+ </xsl:attribute-set><xsl:attribute-set name="permission-label-style">
1692
963
 
1693
- </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
964
+ </xsl:attribute-set><xsl:attribute-set name="requirement-style">
1694
965
 
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>
966
+ </xsl:attribute-set><xsl:attribute-set name="requirement-name-style">
1698
967
 
968
+ </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
1699
969
 
970
+ </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
971
+ </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
972
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
1700
973
 
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
974
 
1722
- <!-- <xsl:if test="$namespace = 'iso'">
1723
- <fo:block space-before="6pt">&#xA0;</fo:block>
1724
- </xsl:if> -->
975
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-name-style">
1725
976
 
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
977
 
1767
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
978
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-label-style">
1768
979
 
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"/> -->
980
+ </xsl:attribute-set><xsl:attribute-set name="termexample-style">
1785
981
 
1786
982
 
983
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
984
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1787
985
 
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
986
 
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
987
 
1801
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1802
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
1803
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
988
+
989
+
990
+
991
+ </xsl:attribute-set><xsl:attribute-set name="example-style">
992
+
993
+
994
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
995
+
996
+
997
+
998
+
999
+
1000
+
1001
+
1002
+
1003
+
1004
+ </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1005
+
1006
+
1007
+ <xsl:attribute name="margin-left">12.5mm</xsl:attribute>
1008
+
1009
+ </xsl:attribute-set><xsl:attribute-set name="example-name-style">
1010
+
1011
+
1012
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1013
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1014
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1015
+
1016
+
1017
+
1018
+
1019
+
1020
+
1021
+
1022
+
1023
+
1024
+
1025
+
1026
+
1027
+
1028
+
1029
+ </xsl:attribute-set><xsl:attribute-set name="example-p-style">
1030
+
1031
+
1032
+ <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
1033
+
1034
+
1035
+
1036
+
1037
+
1038
+
1039
+
1040
+
1041
+
1042
+
1043
+ </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
1044
+
1045
+ <xsl:attribute name="padding-right">10mm</xsl:attribute>
1046
+
1047
+
1048
+
1049
+
1050
+ </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1051
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1052
+
1053
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1054
+ <xsl:attribute name="text-align">center</xsl:attribute>
1055
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1056
+
1057
+
1058
+
1059
+
1060
+
1061
+
1062
+
1063
+
1064
+
1065
+
1066
+ </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1067
+
1068
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
1069
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1070
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1071
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1072
+
1073
+
1074
+
1075
+ </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
1076
+
1077
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1078
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
1079
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1080
+
1081
+
1082
+
1083
+ </xsl:attribute-set><xsl:attribute-set name="xref-style">
1084
+
1085
+
1086
+ </xsl:attribute-set><xsl:attribute-set name="eref-style">
1087
+
1088
+
1089
+ <xsl:attribute name="color">blue</xsl:attribute>
1090
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1091
+
1092
+
1093
+ </xsl:attribute-set><xsl:attribute-set name="note-style">
1094
+
1095
+
1096
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1097
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1098
+
1099
+
1100
+
1101
+
1102
+
1103
+
1104
+
1105
+
1106
+
1107
+
1108
+
1109
+
1110
+
1111
+
1112
+ </xsl:attribute-set><xsl:attribute-set name="note-name-style">
1113
+
1114
+
1115
+ <xsl:attribute name="padding-right">6mm</xsl:attribute>
1116
+
1117
+
1118
+
1119
+
1120
+
1121
+
1122
+
1123
+
1124
+
1125
+ </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1126
+
1127
+
1128
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1129
+
1130
+
1131
+
1132
+
1133
+
1134
+
1135
+
1136
+
1137
+
1138
+
1139
+
1140
+
1141
+ </xsl:attribute-set><xsl:attribute-set name="termnote-style">
1142
+
1143
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1144
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1145
+
1146
+
1147
+
1148
+
1149
+
1150
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
1151
+
1152
+
1153
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1154
+ <xsl:attribute name="margin-left">12mm</xsl:attribute>
1155
+ <xsl:attribute name="margin-right">12mm</xsl:attribute>
1156
+
1157
+
1158
+
1159
+
1160
+
1161
+ </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
1162
+
1163
+
1164
+ <xsl:attribute name="text-align">right</xsl:attribute>
1165
+
1166
+
1167
+ </xsl:attribute-set><xsl:attribute-set name="termsource-style">
1168
+
1169
+
1170
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1171
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1172
+
1173
+
1174
+
1175
+
1176
+ </xsl:attribute-set><xsl:attribute-set name="origin-style">
1177
+
1178
+
1179
+ </xsl:attribute-set><xsl:attribute-set name="term-style">
1180
+
1181
+ </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1182
+
1183
+
1184
+
1185
+
1186
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1187
+ <xsl:attribute name="text-align">center</xsl:attribute>
1188
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1189
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1190
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1191
+
1192
+
1193
+
1194
+
1195
+
1196
+
1197
+
1198
+
1199
+
1200
+
1201
+
1202
+
1203
+
1204
+ </xsl:attribute-set><xsl:attribute-set name="formula-style">
1205
+
1206
+ </xsl:attribute-set><xsl:attribute-set name="image-style">
1207
+ <xsl:attribute name="text-align">center</xsl:attribute>
1208
+
1209
+
1210
+
1211
+
1212
+
1213
+ </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
1214
+
1215
+ </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
1216
+
1217
+ <xsl:attribute name="width">100%</xsl:attribute>
1218
+ <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
1219
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
1220
+
1221
+
1222
+
1223
+
1224
+
1225
+ </xsl:attribute-set><xsl:attribute-set name="tt-style">
1226
+
1227
+ <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
1228
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1229
+
1230
+
1231
+ </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
1232
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1233
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1234
+ <xsl:attribute name="text-align">center</xsl:attribute>
1235
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1236
+ </xsl:attribute-set><xsl:attribute-set name="domain-style">
1237
+
1238
+ </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1239
+
1240
+
1241
+ </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1242
+
1243
+ </xsl:attribute-set><xsl:attribute-set name="definition-style">
1244
+
1245
+
1246
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1247
+
1248
+ </xsl:attribute-set><xsl:template match="text()">
1249
+ <xsl:value-of select="."/>
1250
+ </xsl:template><xsl:template match="*[local-name()='br']">
1251
+ <xsl:value-of select="$linebreak"/>
1252
+ </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1253
+ <!-- <xsl:call-template name="add-zero-spaces"/> -->
1254
+ <xsl:call-template name="add-zero-spaces-java"/>
1255
+ </xsl:template><xsl:template match="*[local-name()='table']">
1256
+
1257
+ <xsl:variable name="simple-table">
1258
+ <xsl:call-template name="getSimpleTable"/>
1259
+ </xsl:variable>
1260
+
1261
+
1262
+
1263
+
1264
+
1265
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1266
+
1267
+
1268
+
1269
+ <xsl:call-template name="fn_name_display"/>
1270
+
1271
+
1272
+
1273
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1274
+
1275
+ <!-- <xsl:variable name="cols-count">
1276
+ <xsl:choose>
1277
+ <xsl:when test="*[local-name()='thead']">
1278
+ <xsl:call-template name="calculate-columns-numbers">
1279
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1280
+ </xsl:call-template>
1281
+ </xsl:when>
1282
+ <xsl:otherwise>
1283
+ <xsl:call-template name="calculate-columns-numbers">
1284
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1285
+ </xsl:call-template>
1286
+ </xsl:otherwise>
1287
+ </xsl:choose>
1288
+ </xsl:variable> -->
1289
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1290
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1291
+
1292
+
1293
+
1294
+ <xsl:variable name="colwidths">
1295
+ <xsl:call-template name="calculate-column-widths">
1296
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1297
+ <xsl:with-param name="table" select="$simple-table"/>
1298
+ </xsl:call-template>
1299
+ </xsl:variable>
1300
+
1301
+ <!-- <xsl:variable name="colwidths2">
1302
+ <xsl:call-template name="calculate-column-widths">
1303
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1304
+ </xsl:call-template>
1305
+ </xsl:variable> -->
1306
+
1307
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1308
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
1309
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1804
1310
 
1805
1311
  <xsl:variable name="margin-left">
1806
1312
  <xsl:choose>
@@ -1856,34 +1362,15 @@
1856
1362
 
1857
1363
 
1858
1364
 
1365
+
1366
+
1859
1367
  </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>
1878
-
1879
-
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/>
1368
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1369
+ <xsl:if test="normalize-space() != ''">
1370
+ <fo:block xsl:use-attribute-sets="table-name-style">
1371
+ <xsl:apply-templates/>
1372
+ </fo:block>
1373
+ </xsl:if>
1887
1374
  </xsl:template><xsl:template name="calculate-columns-numbers">
1888
1375
  <xsl:param name="table-row"/>
1889
1376
  <xsl:variable name="columns-count" select="count($table-row/*)"/>
@@ -2108,6 +1595,7 @@
2108
1595
 
2109
1596
 
2110
1597
 
1598
+
2111
1599
  <xsl:if test="@colspan">
2112
1600
  <xsl:attribute name="number-columns-spanned">
2113
1601
  <xsl:value-of select="@colspan"/>
@@ -2127,7 +1615,7 @@
2127
1615
 
2128
1616
 
2129
1617
 
2130
-
1618
+
2131
1619
 
2132
1620
 
2133
1621
 
@@ -2146,21 +1634,9 @@
2146
1634
  <fo:block>
2147
1635
 
2148
1636
  <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
-
1637
+ </fo:block>
2162
1638
  </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">
1639
+ </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
1640
 
2165
1641
 
2166
1642
  <fo:block font-size="10pt" margin-bottom="12pt">
@@ -2172,22 +1648,14 @@
2172
1648
 
2173
1649
 
2174
1650
 
2175
- <xsl:variable name="title-note">
2176
- <xsl:call-template name="getTitle">
2177
- <xsl:with-param name="name" select="'title-note'"/>
2178
- </xsl:call-template>
2179
- </xsl:variable>
2180
- <xsl:value-of select="$title-note"/>
2181
-
2182
-
2183
-
2184
- <xsl:number format="1 "/>
2185
-
1651
+
1652
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
1653
+
2186
1654
  </fo:inline>
2187
1655
  <xsl:apply-templates mode="process"/>
2188
1656
  </fo:block>
2189
1657
 
2190
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
1658
+ </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">
2191
1659
  <xsl:apply-templates/>
2192
1660
  </xsl:template><xsl:template name="fn_display">
2193
1661
  <xsl:variable name="references">
@@ -2247,7 +1715,7 @@
2247
1715
  <!-- and (not(@class) or @class !='pseudocode') -->
2248
1716
  </xsl:variable>
2249
1717
  <xsl:variable name="references">
2250
- <xsl:for-each select=".//*[local-name()='fn']">
1718
+ <xsl:for-each select=".//*[local-name()='fn'][not(parent::*[local-name()='name'])]">
2251
1719
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2252
1720
  <xsl:apply-templates/>
2253
1721
  </fn>
@@ -2514,7 +1982,7 @@
2514
1982
  <xsl:value-of select="string-length(normalize-space(.))"/>
2515
1983
  </xsl:if>
2516
1984
  </xsl:for-each>
2517
- </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']">
1985
+ </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2518
1986
  <xsl:param name="key_iso"/>
2519
1987
 
2520
1988
  <!-- <tr>
@@ -2530,12 +1998,7 @@
2530
1998
  <xsl:if test="normalize-space($key_iso) = 'true'">
2531
1999
  <xsl:attribute name="margin-top">0</xsl:attribute>
2532
2000
  </xsl:if>
2533
- <xsl:variable name="title-note">
2534
- <xsl:call-template name="getTitle">
2535
- <xsl:with-param name="name" select="'title-note'"/>
2536
- </xsl:call-template>
2537
- </xsl:variable>
2538
- <xsl:value-of select="$title-note"/>
2001
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2539
2002
  </fo:block>
2540
2003
  </fo:table-cell>
2541
2004
  <fo:table-cell>
@@ -2606,7 +2069,7 @@
2606
2069
  <fo:inline font-style="italic">
2607
2070
  <xsl:apply-templates/>
2608
2071
  </fo:inline>
2609
- </xsl:template><xsl:template match="*[local-name()='strong']">
2072
+ </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2610
2073
  <fo:inline font-weight="bold">
2611
2074
  <xsl:apply-templates/>
2612
2075
  </fo:inline>
@@ -2619,7 +2082,7 @@
2619
2082
  <xsl:apply-templates/>
2620
2083
  </fo:inline>
2621
2084
  </xsl:template><xsl:template match="*[local-name()='tt']">
2622
- <fo:inline font-family="Courier" font-size="10pt">
2085
+ <fo:inline xsl:use-attribute-sets="tt-style">
2623
2086
  <xsl:apply-templates/>
2624
2087
  </fo:inline>
2625
2088
  </xsl:template><xsl:template match="*[local-name()='del']">
@@ -2950,117 +2413,732 @@
2950
2413
  <xsl:copy-of select="."/>
2951
2414
  </fo:instream-foreign-object>
2952
2415
  </fo:inline>
2953
- </xsl:template><xsl:template match="*[local-name()='localityStack']">
2954
- <xsl:for-each select="*[local-name()='locality']">
2955
- <xsl:if test="position() =1"><xsl:text>, </xsl:text></xsl:if>
2956
- <xsl:apply-templates select="."/>
2957
- <xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if>
2958
- </xsl:for-each>
2959
- </xsl:template><xsl:template match="*[local-name()='link']" name="link">
2416
+ </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
2960
2417
  <xsl:variable name="target">
2961
2418
  <xsl:choose>
2962
- <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
2963
- <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
2419
+ <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
2420
+ <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
2421
+ </xsl:when>
2422
+ <xsl:otherwise>
2423
+ <xsl:value-of select="normalize-space(@target)"/>
2424
+ </xsl:otherwise>
2425
+ </xsl:choose>
2426
+ </xsl:variable>
2427
+ <fo:inline xsl:use-attribute-sets="link-style">
2428
+ <xsl:choose>
2429
+ <xsl:when test="$target = ''">
2430
+ <xsl:apply-templates/>
2431
+ </xsl:when>
2432
+ <xsl:otherwise>
2433
+ <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
2434
+ <xsl:choose>
2435
+ <xsl:when test="normalize-space(.) = ''">
2436
+ <xsl:value-of select="$target"/>
2437
+ </xsl:when>
2438
+ <xsl:otherwise>
2439
+ <xsl:apply-templates/>
2440
+ </xsl:otherwise>
2441
+ </xsl:choose>
2442
+ </fo:basic-link>
2443
+ </xsl:otherwise>
2444
+ </xsl:choose>
2445
+ </fo:inline>
2446
+ </xsl:template><xsl:template match="*[local-name()='bookmark']">
2447
+ <fo:inline id="{@id}"/>
2448
+ </xsl:template><xsl:template match="*[local-name()='appendix']">
2449
+ <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
2450
+ <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
2451
+ </fo:block>
2452
+ <xsl:apply-templates/>
2453
+ </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
2454
+ <fo:inline><xsl:apply-templates/></fo:inline>
2455
+ </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
2456
+ <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
2457
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2458
+ </fo:block>
2459
+ <xsl:apply-templates/>
2460
+ </xsl:template><xsl:template match="*[local-name() = 'callout']">
2461
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
2462
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']">
2463
+ <xsl:variable name="annotation-id" select="@id"/>
2464
+ <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
2465
+ <fo:block id="{$annotation-id}" white-space="nowrap">
2466
+ <fo:inline>
2467
+ <xsl:apply-templates>
2468
+ <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
2469
+ </xsl:apply-templates>
2470
+ </fo:inline>
2471
+ </fo:block>
2472
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
2473
+ <xsl:param name="callout"/>
2474
+ <fo:inline id="{@id}">
2475
+ <!-- for first p in annotation, put <x> -->
2476
+ <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
2477
+ <xsl:apply-templates/>
2478
+ </fo:inline>
2479
+ </xsl:template><xsl:template match="*[local-name() = 'modification']">
2480
+ <xsl:variable name="title-modified">
2481
+ <xsl:call-template name="getTitle">
2482
+ <xsl:with-param name="name" select="'title-modified'"/>
2483
+ </xsl:call-template>
2484
+ </xsl:variable>
2485
+ <xsl:choose>
2486
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
2487
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
2488
+ </xsl:choose>
2489
+ <xsl:apply-templates/>
2490
+ </xsl:template><xsl:template match="*[local-name() = 'xref']">
2491
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2492
+
2493
+ <xsl:apply-templates/>
2494
+ </fo:basic-link>
2495
+ </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
2496
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2497
+ <xsl:apply-templates/>
2498
+ </fo:block>
2499
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
2500
+ <fo:inline>
2501
+ <xsl:apply-templates/>
2502
+ </fo:inline>
2503
+ </xsl:template><xsl:template match="*[local-name() = 'admitted']/*[local-name() = 'stem']">
2504
+ <fo:inline>
2505
+ <xsl:apply-templates/>
2506
+ </fo:inline>
2507
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="presentation">
2508
+ <xsl:if test="normalize-space() != ''">
2509
+ <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
2510
+ </xsl:if>
2511
+ </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
2512
+
2513
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
2514
+
2515
+
2516
+
2517
+
2518
+ <fo:block-container margin-left="0mm">
2519
+
2520
+
2521
+
2522
+
2523
+
2524
+
2525
+
2526
+
2527
+ <fo:block>
2528
+
2529
+
2530
+
2531
+
2532
+ <fo:inline xsl:use-attribute-sets="note-name-style">
2533
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2534
+ </fo:inline>
2535
+ <xsl:apply-templates/>
2536
+ </fo:block>
2537
+
2538
+
2539
+ </fo:block-container>
2540
+ </fo:block-container>
2541
+
2542
+ </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
2543
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
2544
+ <xsl:choose>
2545
+ <xsl:when test="$num = 1">
2546
+ <fo:inline xsl:use-attribute-sets="note-p-style">
2547
+ <xsl:apply-templates/>
2548
+ </fo:inline>
2549
+ </xsl:when>
2550
+ <xsl:otherwise>
2551
+ <fo:block xsl:use-attribute-sets="note-p-style">
2552
+ <xsl:apply-templates/>
2553
+ </fo:block>
2554
+ </xsl:otherwise>
2555
+ </xsl:choose>
2556
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']">
2557
+ <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
2558
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2559
+ <xsl:apply-templates/>
2560
+ </fo:block>
2561
+ </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">
2562
+ <xsl:param name="sfx"/>
2563
+ <xsl:variable name="suffix">
2564
+ <xsl:choose>
2565
+ <xsl:when test="$sfx != ''">
2566
+ <xsl:value-of select="$sfx"/>
2567
+ </xsl:when>
2568
+ <xsl:otherwise>
2569
+
2570
+
2571
+ </xsl:otherwise>
2572
+ </xsl:choose>
2573
+ </xsl:variable>
2574
+ <xsl:if test="normalize-space() != ''">
2575
+ <xsl:apply-templates/>
2576
+ <xsl:value-of select="$suffix"/>
2577
+ </xsl:if>
2578
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']" mode="presentation">
2579
+ <xsl:param name="sfx"/>
2580
+ <xsl:variable name="suffix">
2581
+ <xsl:choose>
2582
+ <xsl:when test="$sfx != ''">
2583
+ <xsl:value-of select="$sfx"/>
2584
+ </xsl:when>
2585
+ <xsl:otherwise>
2586
+
2587
+
2588
+ </xsl:otherwise>
2589
+ </xsl:choose>
2590
+ </xsl:variable>
2591
+ <xsl:if test="normalize-space() != ''">
2592
+ <xsl:apply-templates/>
2593
+ <xsl:value-of select="$suffix"/>
2594
+ </xsl:if>
2595
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
2596
+ <fo:inline><xsl:apply-templates/></fo:inline>
2597
+ </xsl:template><xsl:template match="*[local-name() = 'terms']">
2598
+ <fo:block id="{@id}">
2599
+ <xsl:apply-templates/>
2600
+ </fo:block>
2601
+ </xsl:template><xsl:template match="*[local-name() = 'term']">
2602
+ <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
2603
+
2604
+
2605
+
2606
+ <xsl:apply-templates/>
2607
+ </fo:block>
2608
+ </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
2609
+ <xsl:if test="normalize-space() != ''">
2610
+ <fo:inline>
2611
+ <xsl:apply-templates/>
2612
+ <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
2613
+ <xsl:text>.</xsl:text>
2614
+ </xsl:if> -->
2615
+ </fo:inline>
2616
+ </xsl:if>
2617
+ </xsl:template><xsl:template match="*[local-name() = 'figure']">
2618
+ <fo:block-container id="{@id}">
2619
+ <fo:block>
2620
+ <xsl:apply-templates/>
2621
+ </fo:block>
2622
+ <xsl:call-template name="fn_display_figure"/>
2623
+ <xsl:for-each select="*[local-name() = 'note']">
2624
+ <xsl:call-template name="note"/>
2625
+ </xsl:for-each>
2626
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2627
+ </fo:block-container>
2628
+ </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
2629
+ <fo:block id="{@id}">
2630
+ <xsl:apply-templates/>
2631
+ </fo:block>
2632
+ </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
2633
+ <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
2634
+ <xsl:apply-templates/>
2635
+ </fo:block>
2636
+ </xsl:template><xsl:template match="*[local-name() = 'image']">
2637
+ <fo:block xsl:use-attribute-sets="image-style">
2638
+
2639
+
2640
+ <xsl:variable name="src">
2641
+ <xsl:choose>
2642
+ <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
2643
+ <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
2644
+ </xsl:when>
2645
+ <xsl:otherwise>
2646
+ <xsl:value-of select="@src"/>
2647
+ </xsl:otherwise>
2648
+ </xsl:choose>
2649
+ </xsl:variable>
2650
+
2651
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
2652
+ </fo:block>
2653
+ </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">
2654
+ <xsl:apply-templates mode="contents"/>
2655
+ <xsl:text> </xsl:text>
2656
+ </xsl:template><xsl:template match="text()" mode="contents">
2657
+ <xsl:value-of select="."/>
2658
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
2659
+ <xsl:if test="normalize-space() != ''">
2660
+ <fo:block xsl:use-attribute-sets="figure-name-style">
2661
+
2662
+ <xsl:apply-templates/>
2663
+ </fo:block>
2664
+ </xsl:if>
2665
+ </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">
2666
+ <xsl:apply-templates mode="contents_item"/>
2667
+ <!-- <xsl:text> </xsl:text> -->
2668
+ </xsl:template><xsl:template name="getSection">
2669
+ <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
2670
+ </xsl:template><xsl:template name="getName">
2671
+ <xsl:choose>
2672
+ <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
2673
+ <xsl:copy-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/following-sibling::node()"/>
2674
+ </xsl:when>
2675
+ <xsl:otherwise>
2676
+ <xsl:copy-of select="*[local-name() = 'title']/node()"/>
2677
+ </xsl:otherwise>
2678
+ </xsl:choose>
2679
+ </xsl:template><xsl:template name="insertTitleAsListItem">
2680
+ <xsl:param name="provisional-distance-between-starts" select="'9.5mm'"/>
2681
+ <xsl:variable name="section">
2682
+ <xsl:for-each select="..">
2683
+ <xsl:call-template name="getSection"/>
2684
+ </xsl:for-each>
2685
+ </xsl:variable>
2686
+ <fo:list-block provisional-distance-between-starts="{$provisional-distance-between-starts}">
2687
+ <fo:list-item>
2688
+ <fo:list-item-label end-indent="label-end()">
2689
+ <fo:block>
2690
+ <xsl:value-of select="$section"/>
2691
+ </fo:block>
2692
+ </fo:list-item-label>
2693
+ <fo:list-item-body start-indent="body-start()">
2694
+ <fo:block>
2695
+ <xsl:choose>
2696
+ <xsl:when test="*[local-name() = 'tab']">
2697
+ <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
2698
+ </xsl:when>
2699
+ <xsl:otherwise>
2700
+ <xsl:apply-templates/>
2701
+ </xsl:otherwise>
2702
+ </xsl:choose>
2703
+ </fo:block>
2704
+ </fo:list-item-body>
2705
+ </fo:list-item>
2706
+ </fo:list-block>
2707
+ </xsl:template><xsl:template name="extractTitle">
2708
+ <xsl:choose>
2709
+ <xsl:when test="*[local-name() = 'tab']">
2710
+ <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
2711
+ </xsl:when>
2712
+ <xsl:otherwise>
2713
+ <xsl:apply-templates/>
2714
+ </xsl:otherwise>
2715
+ </xsl:choose>
2716
+ </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">
2717
+ <xsl:text> </xsl:text>
2718
+ </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
2719
+ <xsl:copy>
2720
+ <xsl:apply-templates mode="contents_item"/>
2721
+ </xsl:copy>
2722
+ </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
2723
+ <xsl:text> </xsl:text>
2724
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
2725
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
2726
+ <xsl:apply-templates/>
2727
+ </fo:block>
2728
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2729
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()">
2730
+ <xsl:variable name="text">
2731
+ <xsl:call-template name="add-zero-spaces-equal"/>
2732
+ </xsl:variable>
2733
+ <xsl:call-template name="add-zero-spaces">
2734
+ <xsl:with-param name="text" select="$text"/>
2735
+ </xsl:call-template>
2736
+ </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
2737
+ <xsl:if test="normalize-space() != ''">
2738
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2739
+
2740
+ <xsl:apply-templates/>
2741
+ </fo:block>
2742
+ </xsl:if>
2743
+ </xsl:template><xsl:template match="*[local-name() = 'permission']">
2744
+ <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
2745
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2746
+ <xsl:apply-templates/>
2747
+ </fo:block>
2748
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']" mode="presentation">
2749
+ <xsl:if test="normalize-space() != ''">
2750
+ <fo:block xsl:use-attribute-sets="permission-name-style">
2751
+ <xsl:apply-templates/>
2752
+
2753
+ </fo:block>
2754
+ </xsl:if>
2755
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'label']">
2756
+ <fo:block xsl:use-attribute-sets="permission-label-style">
2757
+ <xsl:apply-templates/>
2758
+ </fo:block>
2759
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']">
2760
+ <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
2761
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2762
+ <xsl:apply-templates select="*[local-name()='label']" mode="presentation"/>
2763
+ <xsl:apply-templates select="@obligation" mode="presentation"/>
2764
+ <xsl:apply-templates select="*[local-name()='subject']" mode="presentation"/>
2765
+ <xsl:apply-templates/>
2766
+ </fo:block>
2767
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']" mode="presentation">
2768
+ <xsl:if test="normalize-space() != ''">
2769
+ <fo:block xsl:use-attribute-sets="requirement-name-style">
2770
+
2771
+ <xsl:apply-templates/>
2772
+
2773
+ </fo:block>
2774
+ </xsl:if>
2775
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']" mode="presentation">
2776
+ <fo:block xsl:use-attribute-sets="requirement-label-style">
2777
+ <xsl:apply-templates/>
2778
+ </fo:block>
2779
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation" mode="presentation">
2780
+ <fo:block>
2781
+ <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
2782
+ </fo:block>
2783
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
2784
+ <fo:block xsl:use-attribute-sets="requirement-subject-style">
2785
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
2786
+ </fo:block>
2787
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
2788
+ <fo:block xsl:use-attribute-sets="requirement-inherit-style">
2789
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
2790
+ </fo:block>
2791
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
2792
+ <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
2793
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2794
+ <xsl:apply-templates/>
2795
+ </fo:block>
2796
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']" mode="presentation">
2797
+ <xsl:if test="normalize-space() != ''">
2798
+ <fo:block xsl:use-attribute-sets="recommendation-name-style">
2799
+ <xsl:apply-templates/>
2800
+
2801
+ </fo:block>
2802
+ </xsl:if>
2803
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'label']">
2804
+ <fo:block xsl:use-attribute-sets="recommendation-label-style">
2805
+ <xsl:apply-templates/>
2806
+ </fo:block>
2807
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']">
2808
+ <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
2809
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2810
+ <xsl:apply-templates/>
2811
+ </fo:block>
2812
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']" mode="presentation">
2813
+ <xsl:if test="normalize-space() != ''">
2814
+ <fo:inline xsl:use-attribute-sets="termexample-name-style">
2815
+ <xsl:apply-templates/>
2816
+ </fo:inline>
2817
+ </xsl:if>
2818
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
2819
+ <fo:inline><xsl:apply-templates/></fo:inline>
2820
+ </xsl:template><xsl:template match="*[local-name() = 'example']">
2821
+ <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
2822
+
2823
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2824
+
2825
+ <xsl:variable name="element">
2826
+ block
2827
+
2828
+ </xsl:variable>
2829
+
2830
+ <xsl:choose>
2831
+ <xsl:when test="normalize-space($element) = 'block'">
2832
+ <fo:block xsl:use-attribute-sets="example-body-style">
2833
+ <xsl:apply-templates/>
2834
+ </fo:block>
2964
2835
  </xsl:when>
2965
2836
  <xsl:otherwise>
2966
- <xsl:value-of select="normalize-space(@target)"/>
2837
+ <fo:inline>
2838
+ <xsl:apply-templates/>
2839
+ </fo:inline>
2967
2840
  </xsl:otherwise>
2968
2841
  </xsl:choose>
2969
- </xsl:variable>
2970
- <fo:inline xsl:use-attribute-sets="link-style">
2842
+
2843
+ </fo:block>
2844
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']" mode="presentation">
2845
+
2846
+ <xsl:variable name="element">
2847
+ block
2848
+
2849
+ </xsl:variable>
2850
+ <xsl:choose>
2851
+ <xsl:when test="ancestor::*[local-name() = 'appendix']">
2852
+ <fo:inline>
2853
+ <xsl:apply-templates/>
2854
+ </fo:inline>
2855
+ </xsl:when>
2856
+ <xsl:when test="normalize-space($element) = 'block'">
2857
+ <fo:block xsl:use-attribute-sets="example-name-style">
2858
+ <xsl:apply-templates/>
2859
+ </fo:block>
2860
+ </xsl:when>
2861
+ <xsl:otherwise>
2862
+ <fo:inline xsl:use-attribute-sets="example-name-style">
2863
+ <xsl:apply-templates/>
2864
+ </fo:inline>
2865
+ </xsl:otherwise>
2866
+ </xsl:choose>
2867
+
2868
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
2869
+ <fo:block xsl:use-attribute-sets="example-p-style">
2870
+
2871
+ <xsl:apply-templates/>
2872
+ </fo:block>
2873
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']">
2874
+ <fo:block xsl:use-attribute-sets="termsource-style">
2875
+ <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
2876
+ <xsl:variable name="termsource_text">
2877
+ <xsl:apply-templates/>
2878
+ </xsl:variable>
2971
2879
  <xsl:choose>
2972
- <xsl:when test="$target = ''">
2880
+ <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
2973
2881
  <xsl:apply-templates/>
2974
2882
  </xsl:when>
2975
2883
  <xsl:otherwise>
2976
- <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
2977
- <xsl:choose>
2978
- <xsl:when test="normalize-space(.) = ''">
2979
- <xsl:value-of select="$target"/>
2980
- </xsl:when>
2981
- <xsl:otherwise>
2982
- <xsl:apply-templates/>
2983
- </xsl:otherwise>
2984
- </xsl:choose>
2985
- </fo:basic-link>
2884
+ <xsl:text>[</xsl:text>
2885
+ <xsl:apply-templates/>
2886
+ <xsl:text>]</xsl:text>
2986
2887
  </xsl:otherwise>
2987
2888
  </xsl:choose>
2988
- </fo:inline>
2989
- </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
2990
- <fo:block xsl:use-attribute-sets="sourcecode-style">
2991
- <!-- <xsl:choose>
2992
- <xsl:when test="@lang = 'en'"></xsl:when>
2993
- <xsl:otherwise> -->
2994
- <xsl:attribute name="white-space">pre</xsl:attribute>
2995
- <xsl:attribute name="wrap-option">wrap</xsl:attribute>
2996
- <!-- </xsl:otherwise>
2997
- </xsl:choose> -->
2998
- <xsl:apply-templates/>
2999
2889
  </fo:block>
3000
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
3001
- <fo:inline id="{@id}"/>
3002
- </xsl:template><xsl:template match="*[local-name()='appendix']">
3003
- <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
3004
- <xsl:variable name="title-appendix">
2890
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
2891
+ <xsl:if test="normalize-space() != ''">
2892
+ <xsl:value-of select="."/>
2893
+ </xsl:if>
2894
+ </xsl:template><xsl:template match="*[local-name() = 'origin']">
2895
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
2896
+
3005
2897
  <xsl:call-template name="getTitle">
3006
- <xsl:with-param name="name" select="'title-appendix'"/>
2898
+ <xsl:with-param name="name" select="'title-source'"/>
3007
2899
  </xsl:call-template>
3008
- </xsl:variable>
3009
- <fo:inline padding-right="5mm"><xsl:value-of select="$title-appendix"/> <xsl:number/></fo:inline>
3010
- <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
3011
- </fo:block>
3012
- <xsl:apply-templates/>
3013
- </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
2900
+ <xsl:text>: </xsl:text>
2901
+
2902
+ <fo:inline xsl:use-attribute-sets="origin-style">
2903
+ <xsl:apply-templates/>
2904
+ </fo:inline>
2905
+ </fo:basic-link>
2906
+ </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
3014
2907
  <fo:inline><xsl:apply-templates/></fo:inline>
3015
- </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']">
3016
- <fo:block xsl:use-attribute-sets="appendix-example-style">
3017
- <xsl:variable name="claims_id" select="ancestor::*[local-name()='clause'][1]/@id"/>
3018
- <xsl:variable name="title-example">
3019
- <xsl:call-template name="getTitle">
3020
- <xsl:with-param name="name" select="'title-example'"/>
3021
- </xsl:call-template>
3022
- </xsl:variable>
3023
- <xsl:value-of select="$title-example"/>
3024
- <xsl:if test="count(ancestor::*[local-name()='clause'][1]//*[local-name()='example']) &gt; 1">
3025
- <xsl:number count="*[local-name()='example'][ancestor::*[local-name()='clause'][@id = $claims_id]]" level="any"/><xsl:text> </xsl:text>
3026
- </xsl:if>
3027
- <xsl:if test="*[local-name()='name']">
3028
- <xsl:text>— </xsl:text><xsl:apply-templates select="*[local-name()='name']" mode="process"/>
3029
- </xsl:if>
2908
+ </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
2909
+ <xsl:if test="normalize-space() != ''">
2910
+ <xsl:value-of select="."/>
2911
+ </xsl:if>
2912
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
2913
+
2914
+ <fo:block xsl:use-attribute-sets="quote-style">
2915
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3030
2916
  </fo:block>
3031
- <xsl:apply-templates/>
3032
- </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">
3033
- <fo:inline><xsl:apply-templates/></fo:inline>
3034
- </xsl:template><xsl:template match="*[local-name() = 'callout']">
3035
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
3036
- </xsl:template><xsl:template match="*[local-name() = 'annotation']">
3037
- <xsl:variable name="annotation-id" select="@id"/>
3038
- <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
3039
- <fo:block id="{$annotation-id}" white-space="nowrap">
3040
- <fo:inline>
3041
- <xsl:apply-templates>
3042
- <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
3043
- </xsl:apply-templates>
3044
- </fo:inline>
3045
- </fo:block>
3046
- </xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
3047
- <xsl:param name="callout"/>
3048
- <fo:inline id="{@id}">
3049
- <!-- for first p in annotation, put <x> -->
3050
- <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
2917
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
2918
+ <fo:block xsl:use-attribute-sets="quote-source-style">
2919
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
2920
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
2921
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
2922
+ </fo:block>
2923
+ </xsl:if>
2924
+ </xsl:template><xsl:template match="*[local-name() = 'source']">
2925
+ <xsl:if test="../*[local-name() = 'author']">
2926
+ <xsl:text>, </xsl:text>
2927
+ </xsl:if>
2928
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3051
2929
  <xsl:apply-templates/>
3052
- </fo:inline>
3053
- </xsl:template><xsl:template match="*[local-name() = 'modification']">
3054
- <xsl:variable name="title-modified">
3055
- <xsl:call-template name="getTitle">
3056
- <xsl:with-param name="name" select="'title-modified'"/>
2930
+ </fo:basic-link>
2931
+ </xsl:template><xsl:template match="*[local-name() = 'author']">
2932
+ <xsl:text>— </xsl:text>
2933
+ <xsl:apply-templates/>
2934
+ </xsl:template><xsl:template match="*[local-name() = 'eref']">
2935
+ <fo:inline xsl:use-attribute-sets="eref-style">
2936
+ <xsl:if test="@type = 'footnote'">
2937
+
2938
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
2939
+ <xsl:attribute name="font-size">80%</xsl:attribute>
2940
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
2941
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
2942
+
2943
+
2944
+ </xsl:if>
2945
+
2946
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
2947
+
2948
+ <xsl:if test="@type = 'inline'">
2949
+
2950
+ <xsl:attribute name="color">blue</xsl:attribute>
2951
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
2952
+
2953
+
2954
+ </xsl:if>
2955
+
2956
+
2957
+ <xsl:apply-templates/>
2958
+ </fo:basic-link>
2959
+ </fo:inline>
2960
+ </xsl:template><xsl:template match="*[local-name() = 'tab']">
2961
+ <!-- zero-space char -->
2962
+ <xsl:variable name="depth">
2963
+ <xsl:call-template name="getLevel">
2964
+ <xsl:with-param name="depth" select="../@depth"/>
3057
2965
  </xsl:call-template>
3058
2966
  </xsl:variable>
2967
+
2968
+ <xsl:variable name="padding">
2969
+
2970
+
2971
+ <xsl:choose>
2972
+ <xsl:when test="$depth &gt;= 3">3</xsl:when>
2973
+ <xsl:when test="$depth = 1">3</xsl:when>
2974
+ <xsl:otherwise>2</xsl:otherwise>
2975
+ </xsl:choose>
2976
+
2977
+
2978
+
2979
+
2980
+
2981
+
2982
+
2983
+
2984
+
2985
+
2986
+
2987
+
2988
+
2989
+
2990
+
2991
+
2992
+ </xsl:variable>
2993
+
2994
+ <xsl:variable name="padding-right">
2995
+ <xsl:choose>
2996
+ <xsl:when test="normalize-space($padding) = ''">0</xsl:when>
2997
+ <xsl:otherwise>
2998
+ <xsl:value-of select="normalize-space($padding)"/>
2999
+ </xsl:otherwise>
3000
+ </xsl:choose>
3001
+ </xsl:variable>
3002
+
3003
+ <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3004
+
3059
3005
  <xsl:choose>
3060
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3061
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
3006
+ <xsl:when test="$language = 'zh'">
3007
+ <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
3008
+ </xsl:when>
3009
+ <xsl:when test="../../@inline-header = 'true'">
3010
+ <fo:inline font-size="90%">
3011
+ <xsl:call-template name="insertNonBreakSpaces">
3012
+ <xsl:with-param name="count" select="$padding-right"/>
3013
+ </xsl:call-template>
3014
+ </fo:inline>
3015
+ </xsl:when>
3016
+ <xsl:otherwise>
3017
+ <fo:inline padding-right="{$padding-right}mm">​</fo:inline>
3018
+ </xsl:otherwise>
3062
3019
  </xsl:choose>
3020
+
3021
+ </xsl:template><xsl:template name="insertNonBreakSpaces">
3022
+ <xsl:param name="count"/>
3023
+ <xsl:if test="$count &gt; 0">
3024
+ <xsl:text> </xsl:text>
3025
+ <xsl:call-template name="insertNonBreakSpaces">
3026
+ <xsl:with-param name="count" select="$count - 1"/>
3027
+ </xsl:call-template>
3028
+ </xsl:if>
3029
+ </xsl:template><xsl:template match="*[local-name() = 'domain']">
3030
+ <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
3031
+ <xsl:text> </xsl:text>
3032
+ </xsl:template><xsl:template match="*[local-name() = 'admitted']">
3033
+ <fo:block xsl:use-attribute-sets="admitted-style">
3034
+ <xsl:apply-templates/>
3035
+ </fo:block>
3036
+ </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3037
+ <xsl:variable name="title-deprecated">
3038
+ <xsl:call-template name="getTitle">
3039
+ <xsl:with-param name="name" select="'title-deprecated'"/>
3040
+ </xsl:call-template>
3041
+ </xsl:variable>
3042
+ <fo:block xsl:use-attribute-sets="deprecates-style">
3043
+ <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
3044
+ </fo:block>
3045
+ </xsl:template><xsl:template match="*[local-name() = 'definition']">
3046
+ <fo:block xsl:use-attribute-sets="definition-style">
3047
+ <xsl:apply-templates/>
3048
+ </fo:block>
3049
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
3050
+ <xsl:apply-templates/>
3051
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
3052
+ <fo:inline> <xsl:apply-templates/></fo:inline>
3053
+ <fo:block> </fo:block>
3054
+ </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
3055
+
3056
+ <fo:block>
3057
+ <xsl:call-template name="setId"/>
3058
+
3059
+
3060
+ <xsl:variable name="pos"><xsl:number count="csd:sections/csd:clause | csd:sections/csd:terms"/></xsl:variable>
3061
+ <xsl:if test="$pos &gt;= 2">
3062
+ <xsl:attribute name="space-before">18pt</xsl:attribute>
3063
+ </xsl:if>
3064
+
3065
+
3066
+
3067
+
3068
+
3069
+
3070
+
3071
+
3072
+
3073
+ <xsl:apply-templates/>
3074
+ </fo:block>
3075
+
3076
+
3077
+
3078
+ </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
3079
+ <fo:block break-after="page"/>
3080
+ <fo:block>
3081
+ <xsl:call-template name="setId"/>
3082
+ <xsl:apply-templates/>
3083
+ </fo:block>
3084
+ </xsl:template><xsl:template match="*[local-name() = 'clause']">
3085
+ <fo:block>
3086
+ <xsl:call-template name="setId"/>
3087
+ <xsl:apply-templates/>
3088
+ </fo:block>
3089
+ </xsl:template><xsl:template match="*[local-name() = 'definitions']">
3090
+ <fo:block id="{@id}">
3091
+ <xsl:apply-templates/>
3092
+ </fo:block>
3093
+ </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@id = '_normative_references' or @id = '_references']">
3094
+
3095
+ <fo:block id="{@id}">
3096
+ <xsl:apply-templates/>
3097
+ </fo:block>
3098
+ </xsl:template><xsl:template match="*[local-name() = 'annex']">
3099
+ <fo:block break-after="page"/>
3100
+ <fo:block id="{@id}">
3101
+
3102
+ </fo:block>
3063
3103
  <xsl:apply-templates/>
3104
+ </xsl:template><xsl:template match="*[local-name() = 'review']">
3105
+ <!-- comment 2019-11-29 -->
3106
+ <!-- <fo:block font-weight="bold">Review:</fo:block>
3107
+ <xsl:apply-templates /> -->
3108
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
3109
+ <!-- 0xA0 to space replacement -->
3110
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3111
+ </xsl:template><xsl:template match="*[local-name() = 'errata']">
3112
+ <!-- <row>
3113
+ <date>05-07-2013</date>
3114
+ <type>Editorial</type>
3115
+ <change>Changed CA-9 Priority Code from P1 to P2 in <xref target="tabled2"/>.</change>
3116
+ <pages>D-3</pages>
3117
+ </row>
3118
+ -->
3119
+ <fo:table table-layout="fixed" width="100%" font-size="10pt" border="1pt solid black">
3120
+ <fo:table-column column-width="20mm"/>
3121
+ <fo:table-column column-width="23mm"/>
3122
+ <fo:table-column column-width="107mm"/>
3123
+ <fo:table-column column-width="15mm"/>
3124
+ <fo:table-body>
3125
+ <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
3126
+ <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
3127
+ <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
3128
+ <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
3129
+ <fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell>
3130
+ </fo:table-row>
3131
+ <xsl:apply-templates/>
3132
+ </fo:table-body>
3133
+ </fo:table>
3134
+ </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']">
3135
+ <fo:table-row>
3136
+ <xsl:apply-templates/>
3137
+ </fo:table-row>
3138
+ </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*">
3139
+ <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
3140
+ <fo:block><xsl:apply-templates/></fo:block>
3141
+ </fo:table-cell>
3064
3142
  </xsl:template><xsl:template name="convertDate">
3065
3143
  <xsl:param name="date"/>
3066
3144
  <xsl:param name="format" select="'short'"/>
@@ -3191,27 +3269,49 @@
3191
3269
  </xsl:otherwise>
3192
3270
  </xsl:choose>
3193
3271
  </xsl:template><xsl:template name="getLevel">
3194
- <xsl:variable name="level_total" select="count(ancestor::*)"/>
3195
- <xsl:variable name="level">
3196
- <xsl:choose>
3197
- <xsl:when test="ancestor::*[local-name() = 'preface']">
3198
- <xsl:value-of select="$level_total - 2"/>
3199
- </xsl:when>
3200
- <xsl:when test="ancestor::*[local-name() = 'sections']">
3201
- <xsl:value-of select="$level_total - 2"/>
3202
- </xsl:when>
3203
- <xsl:when test="ancestor::*[local-name() = 'bibliography']">
3204
- <xsl:value-of select="$level_total - 2"/>
3205
- </xsl:when>
3206
- <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
3207
- <xsl:otherwise>
3208
- <xsl:value-of select="$level_total - 1"/>
3209
- </xsl:otherwise>
3210
- </xsl:choose>
3211
- </xsl:variable>
3212
- <xsl:value-of select="$level"/>
3213
- </xsl:template><xsl:template name="getSubSection">
3214
- <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']"/>
3272
+ <xsl:param name="depth"/>
3273
+ <xsl:choose>
3274
+ <xsl:when test="normalize-space(@depth) != ''">
3275
+ <xsl:value-of select="@depth"/>
3276
+ </xsl:when>
3277
+ <xsl:when test="normalize-space($depth) != ''">
3278
+ <xsl:value-of select="$depth"/>
3279
+ </xsl:when>
3280
+ <xsl:otherwise>
3281
+ <xsl:variable name="level_total" select="count(ancestor::*)"/>
3282
+ <xsl:variable name="level">
3283
+ <xsl:choose>
3284
+ <xsl:when test="parent::*[local-name() = 'preface']">
3285
+ <xsl:value-of select="$level_total - 1"/>
3286
+ </xsl:when>
3287
+ <xsl:when test="ancestor::*[local-name() = 'preface']">
3288
+ <xsl:value-of select="$level_total - 2"/>
3289
+ </xsl:when>
3290
+ <!-- <xsl:when test="parent::*[local-name() = 'sections']">
3291
+ <xsl:value-of select="$level_total - 1"/>
3292
+ </xsl:when> -->
3293
+ <xsl:when test="ancestor::*[local-name() = 'sections']">
3294
+ <xsl:value-of select="$level_total - 1"/>
3295
+ </xsl:when>
3296
+ <xsl:when test="ancestor::*[local-name() = 'bibliography']">
3297
+ <xsl:value-of select="$level_total - 1"/>
3298
+ </xsl:when>
3299
+ <xsl:when test="parent::*[local-name() = 'annex']">
3300
+ <xsl:value-of select="$level_total - 1"/>
3301
+ </xsl:when>
3302
+ <xsl:when test="ancestor::*[local-name() = 'annex']">
3303
+ <xsl:value-of select="$level_total"/>
3304
+ </xsl:when>
3305
+ <xsl:when test="local-name() = 'annex'">1</xsl:when>
3306
+ <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
3307
+ <xsl:otherwise>
3308
+ <xsl:value-of select="$level_total - 1"/>
3309
+ </xsl:otherwise>
3310
+ </xsl:choose>
3311
+ </xsl:variable>
3312
+ <xsl:value-of select="$level"/>
3313
+ </xsl:otherwise>
3314
+ </xsl:choose>
3215
3315
  </xsl:template><xsl:template name="split">
3216
3316
  <xsl:param name="pText" select="."/>
3217
3317
  <xsl:param name="sep" select="','"/>
@@ -3257,4 +3357,15 @@
3257
3357
  <xsl:when test="$language = 'cn'">Chinese</xsl:when>
3258
3358
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
3259
3359
  </xsl:choose>
3360
+ </xsl:template><xsl:template name="setId">
3361
+ <xsl:attribute name="id">
3362
+ <xsl:choose>
3363
+ <xsl:when test="@id">
3364
+ <xsl:value-of select="@id"/>
3365
+ </xsl:when>
3366
+ <xsl:otherwise>
3367
+ <xsl:value-of select="generate-id()"/>
3368
+ </xsl:otherwise>
3369
+ </xsl:choose>
3370
+ </xsl:attribute>
3260
3371
  </xsl:template></xsl:stylesheet>