metanorma-iso 1.8.6 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a0192dfdd4d26ab4c59d50a8b7e91e36ce83a27c9835f01221444e1ecf2c278
4
- data.tar.gz: 4f4b37c785f3fe5c58777962943ebe8c27a38415cd178d8abab18dc95cf24192
3
+ metadata.gz: 2fc50a5631e4815038d720b3f8b01551c824df300760d7d5c01e0fa57adf37a0
4
+ data.tar.gz: 7f2b4cad47277b4b1b0ab49d12f873e9a008b511fbd5db2a3925b96c9f504875
5
5
  SHA512:
6
- metadata.gz: 91c94f57a7a8437f4c64366aeb1f14a5ede637357fd19485de1311e18d112ec22ff4325e35158c4322fc5a763292add832d4bc02b64c425e59b778e92ca757e8
7
- data.tar.gz: 47e01118ffc205d246a082130c25893e6e3c41bc4c2ce171949d5f3e308e30a64c7ce49b903aa9f3434537eac2f275e50443f1887014b8a256a48061e38d3250
6
+ metadata.gz: cfb9d4ca6d29cdd964118d3d7810cd71acfbe4b6d9c5c1edb3b14bfbadddbc004e73755e5495ebf91fa51670a373dc02d6b37ea4e1bac8df5d097bb3214adb44
7
+ data.tar.gz: 28b0407e858ff7ea5b8a7911b9c7bf2b82c7a9d45e9035029bd510a78a7e16016175fdfa03dbf04599d4254e2eabce2178f36b671141e833587f02d3298b008a
@@ -3,7 +3,6 @@ require "nokogiri"
3
3
  require "htmlentities"
4
4
  require "json"
5
5
  require "pathname"
6
- require "open-uri"
7
6
 
8
7
  module Asciidoctor
9
8
  module ISO
@@ -204,6 +204,18 @@
204
204
  </zeroOrMore>
205
205
  </element>
206
206
  </define>
207
+ <define name="dt">
208
+ <element name="dt">
209
+ <optional>
210
+ <attribute name="id">
211
+ <data type="ID"/>
212
+ </attribute>
213
+ </optional>
214
+ <zeroOrMore>
215
+ <ref name="TextElement"/>
216
+ </zeroOrMore>
217
+ </element>
218
+ </define>
207
219
  <define name="example">
208
220
  <element name="example">
209
221
  <attribute name="id">
@@ -899,7 +911,7 @@
899
911
  </include>
900
912
  <!-- end overrides -->
901
913
  <define name="docsubtype">
902
- <element name="docsubtype">
914
+ <element name="subdoctype">
903
915
  <ref name="DocumentSubtype"/>
904
916
  </element>
905
917
  </define>
@@ -954,6 +966,16 @@
954
966
  </define>
955
967
  <define name="concept">
956
968
  <element name="concept">
969
+ <optional>
970
+ <attribute name="ital">
971
+ <data type="boolean"/>
972
+ </attribute>
973
+ </optional>
974
+ <optional>
975
+ <attribute name="ref">
976
+ <data type="boolean"/>
977
+ </attribute>
978
+ </optional>
957
979
  <optional>
958
980
  <element name="refterm">
959
981
  <zeroOrMore>
@@ -998,6 +1020,9 @@
998
1020
  </attribute>
999
1021
  <attribute name="name"/>
1000
1022
  <attribute name="action"/>
1023
+ <optional>
1024
+ <attribute name="class"/>
1025
+ </optional>
1001
1026
  <zeroOrMore>
1002
1027
  <choice>
1003
1028
  <ref name="TextElement"/>
@@ -1490,26 +1515,26 @@
1490
1515
  <optional>
1491
1516
  <ref name="section-title"/>
1492
1517
  </optional>
1493
- <group>
1518
+ <choice>
1494
1519
  <choice>
1495
1520
  <group>
1496
- <zeroOrMore>
1521
+ <oneOrMore>
1497
1522
  <ref name="BasicBlock"/>
1498
- </zeroOrMore>
1523
+ </oneOrMore>
1499
1524
  <zeroOrMore>
1500
1525
  <ref name="note"/>
1501
1526
  </zeroOrMore>
1502
1527
  </group>
1503
1528
  <ref name="amend"/>
1504
1529
  </choice>
1505
- <zeroOrMore>
1530
+ <oneOrMore>
1506
1531
  <choice>
1507
1532
  <ref name="clause-subsection"/>
1508
1533
  <ref name="terms"/>
1509
1534
  <ref name="definitions"/>
1510
1535
  </choice>
1511
- </zeroOrMore>
1512
- </group>
1536
+ </oneOrMore>
1537
+ </choice>
1513
1538
  </define>
1514
1539
  <define name="Annex-Section">
1515
1540
  <optional>
@@ -101,7 +101,11 @@
101
101
  <ref name="definitions"/>
102
102
  </optional>
103
103
  <oneOrMore>
104
- <ref name="clause"/>
104
+ <choice>
105
+ <ref name="clause"/>
106
+ <ref name="term-clause"/>
107
+ <ref name="terms"/>
108
+ </choice>
105
109
  </oneOrMore>
106
110
  </element>
107
111
  </define>
@@ -136,7 +140,7 @@
136
140
  <optional>
137
141
  <ref name="section-title"/>
138
142
  </optional>
139
- <group>
143
+ <choice>
140
144
  <choice>
141
145
  <group>
142
146
  <oneOrMore>
@@ -151,7 +155,7 @@
151
155
  <oneOrMore>
152
156
  <ref name="clause-subsection"/>
153
157
  </oneOrMore>
154
- </group>
158
+ </choice>
155
159
  </define>
156
160
  <define name="term">
157
161
  <element name="term">
@@ -33,6 +33,9 @@ module Asciidoctor
33
33
  def sectiontype(node, level = true)
34
34
  return nil if @amd
35
35
 
36
+ ret = sectiontype_streamline(sectiontype1(node))
37
+ return ret if ret == "terms and definitions" && @vocab
38
+
36
39
  super
37
40
  end
38
41
  end
@@ -32,7 +32,7 @@ module Asciidoctor
32
32
  root.xpath("//xref").each do |t|
33
33
  preceding = t.at("./preceding-sibling::text()[last()]")
34
34
  next unless !preceding.nil? &&
35
- /\b(see| refer to)\s*$/mi.match(preceding)
35
+ /\b(see| refer to)\s*\Z/mi.match(preceding)
36
36
 
37
37
  (target = root.at("//*[@id = '#{t['target']}']")) || next
38
38
  if target&.at("./ancestor-or-self::*[@obligation = 'normative']")
@@ -46,7 +46,7 @@ module Asciidoctor
46
46
  def see_erefs_validate(root)
47
47
  root.xpath("//eref").each do |t|
48
48
  prec = t.at("./preceding-sibling::text()[last()]")
49
- next unless !prec.nil? && /\b(see|refer to)\s*$/mi.match(prec)
49
+ next unless !prec.nil? && /\b(see|refer to)\s*\Z/mi.match(prec)
50
50
 
51
51
  unless target = root.at("//*[@id = '#{t['bibitemid']}']")
52
52
  @log.add("Bibliography", t,
@@ -80,23 +80,11 @@ module Asciidoctor
80
80
  xmldoc.xpath("//term").each do |t|
81
81
  para = t.at("./definition") || return
82
82
  term = t.at("./preferred").text
83
- termdef_warn(para.text, /^(the|a)\b/i, t, term,
83
+ termdef_warn(para.text, /\A(the|a)\b/i, t, term,
84
84
  "term definition starts with article")
85
- termdef_warn(para.text, /\.$/i, t, term,
85
+ termdef_warn(para.text, /\.\Z/i, t, term,
86
86
  "term definition ends with period")
87
87
  end
88
- cited_term_style(xmldoc)
89
- end
90
-
91
- # ISO/IEC DIR 2, 16.5.10
92
- def cited_term_style(xmldoc)
93
- xmldoc.xpath("//term//xref").each do |x|
94
- next unless xmldoc.at("//term[@id = '#{x['target']}']")
95
-
96
- x&.previous&.text == " (" and x&.previous&.previous&.name == "em" or
97
- style_warning(x, "term citation not preceded with italicised term",
98
- x.parent.text)
99
- end
100
88
  end
101
89
 
102
90
  def doctype_validate(xmldoc)
@@ -150,7 +138,6 @@ module Asciidoctor
150
138
  isosubgroup_validate(doc.root)
151
139
  onlychild_clause_validate(doc.root)
152
140
  termdef_style(doc.root)
153
- iev_validate(doc.root)
154
141
  see_xrefs_validate(doc.root)
155
142
  see_erefs_validate(doc.root)
156
143
  locality_erefs_validate(doc.root)
@@ -42,7 +42,7 @@ module Asciidoctor
42
42
  f.empty? && return
43
43
  (f.size == 1) || @log.add("Style", f.first, ONE_SYMBOLS_WARNING)
44
44
  f.first.elements.each do |e|
45
- unless e.name == "dl"
45
+ unless %w(title dl).include? e.name
46
46
  @log.add("Style", f.first, NON_DL_SYMBOLS_WARNING)
47
47
  return
48
48
  end
@@ -99,57 +99,73 @@ module Asciidoctor
99
99
  "//clause[descendant::references][not(parent::clause)]".freeze
100
100
 
101
101
  def sections_sequence_validate(root)
102
- vocab = root&.at("//bibdata/ext/subdoctype")&.text == "vocabulary"
102
+ names, n = sections_sequence_validate_start(root)
103
+ if root&.at("//bibdata/ext/subdoctype")&.text == "vocabulary"
104
+ names, n = sections_sequence_validate_body_vocab(names, n)
105
+ else
106
+ names, n = sections_sequence_validate_body(names, n)
107
+ end
108
+ sections_sequence_validate_end(names, n)
109
+ end
110
+
111
+ def sections_sequence_validate_start(root)
103
112
  names = root.xpath(SECTIONS_XPATH)
104
113
  names = seqcheck(names, SEQ[0][:msg], SEQ[0][:val])
105
114
  n = names[0]
106
115
  names = seqcheck(names, SEQ[1][:msg], SEQ[1][:val])
107
- if n&.at("./self::introduction")
116
+ n&.at("./self::introduction") and
108
117
  names = seqcheck(names, SEQ[2][:msg], SEQ[2][:val])
109
- end
110
118
  names = seqcheck(names, SEQ[3][:msg], SEQ[3][:val])
111
119
  n = names.shift
112
- if n&.at("./self::definitions")
113
- n = names.shift
114
- end
115
- if n.nil? || n.name != "clause"
116
- @log.add("Style", n, "Document must contain at least one clause")
120
+ n = names.shift if n&.at("./self::definitions")
121
+ [names, n]
122
+ end
123
+
124
+ def sections_sequence_validate_body(names, elem)
125
+ if elem.nil? || elem.name != "clause"
126
+ @log.add("Style", elem, "Document must contain at least one clause")
117
127
  end
118
- n&.at("./self::clause") ||
119
- @log.add("Style", n, "Document must contain clause after "\
128
+ elem&.at("./self::clause") ||
129
+ @log.add("Style", elem, "Document must contain clause after "\
120
130
  "Terms and Definitions")
121
- n&.at("./self::clause[@type = 'scope']") &&
122
- @log.add("Style", n, "Scope must occur before Terms and Definitions")
123
- n = names.shift
124
- while n&.name == "clause" || (vocab && n&.name == "terms")
125
- n&.at("./self::clause[@type = 'scope']")
126
- @log.add("Style", n, "Scope must occur before Terms and Definitions")
127
- n = names.shift
131
+ elem&.at("./self::clause[@type = 'scope']") &&
132
+ @log.add("Style", elem, "Scope must occur before Terms and Definitions")
133
+ elem = names.shift
134
+ while elem&.name == "clause"
135
+ elem&.at("./self::clause[@type = 'scope']")
136
+ @log.add("Style", elem, "Scope must occur before Terms and Definitions")
137
+ elem = names.shift
128
138
  end
129
- if vocab
130
- unless %w(annex references terms).include? n&.name
131
- @log.add("Style", n, "Only terms, annexes and references can follow clauses")
132
- end
133
- else
134
- unless %w(annex references).include? n&.name
135
- @log.add("Style", n, "Only annexes and references can follow clauses")
136
- end
139
+ %w(annex references).include? elem&.name or
140
+ @log.add("Style", elem, "Only annexes and references can follow clauses")
141
+ [names, elem]
142
+ end
143
+
144
+ def sections_sequence_validate_body_vocab(names, elem)
145
+ while elem && %w(clause terms).include?(elem.name)
146
+ elem = names.shift
137
147
  end
138
- while n&.name == "annex"
139
- n = names.shift
140
- if n.nil?
148
+ %w(annex references).include? elem&.name or
149
+ @log.add("Style", elem, "Only annexes and references can follow terms and clauses")
150
+ [names, elem]
151
+ end
152
+
153
+ def sections_sequence_validate_end(names, elem)
154
+ while elem&.name == "annex"
155
+ elem = names.shift
156
+ if elem.nil?
141
157
  @log.add("Style", nil, "Document must include (references) "\
142
158
  "Normative References")
143
159
  end
144
160
  end
145
- n&.at("./self::references[@normative = 'true']") ||
161
+ elem&.at("./self::references[@normative = 'true']") ||
146
162
  @log.add("Style", nil, "Document must include (references) "\
147
163
  "Normative References")
148
- n = names&.shift
149
- n&.at("./self::references[@normative = 'false']") ||
150
- @log.add("Style", n, "Final section must be (references) Bibliography")
164
+ elem = names&.shift
165
+ elem&.at("./self::references[@normative = 'false']") ||
166
+ @log.add("Style", elem, "Final section must be (references) Bibliography")
151
167
  names.empty? ||
152
- @log.add("Style", n, "There are sections after the final Bibliography")
168
+ @log.add("Style", elem, "There are sections after the final Bibliography")
153
169
  end
154
170
 
155
171
  def style_warning(node, msg, text = nil)
@@ -102,8 +102,8 @@ module Asciidoctor
102
102
  # ISO/IEC DIR 2, Table B.1
103
103
  def style_number(node, text)
104
104
  style_two_regex_not_prev(
105
- node, text, /^(?<num>-?[0-9]{4,}[,0-9]*)$/,
106
- %r{\b(ISO|IEC|IEEE/|(in|January|February|March|April|May|June|August|September|October|November|December)\b)$},
105
+ node, text, /^(?<num>-?[0-9]{4,}[,0-9]*)\Z/,
106
+ %r{\b(ISO|IEC|IEEE/|(in|January|February|March|April|May|June|August|September|October|November|December)\b)\Z},
107
107
  "number not broken up in threes"
108
108
  )
109
109
  style_regex(/\b(?<num>[0-9]+\.[0-9]+)/i,
@@ -123,7 +123,7 @@ module Asciidoctor
123
123
  # ISO/IEC DIR 2, 8.4
124
124
  # ISO/IEC DIR 2, 9.3
125
125
  def style_abbrev(node, text)
126
- style_regex(/(^|\s)(?!e\.g\.|i\.e\.)
126
+ style_regex(/(\A|\s)(?!e\.g\.|i\.e\.)
127
127
  (?<num>[a-z]{1,2}\.([a-z]{1,2}|\.))\b/ix,
128
128
  "no dots in abbreviations", node, text)
129
129
  style_regex(/\b(?<num>ppm)\b/i,
@@ -112,9 +112,9 @@ module IsoDoc
112
112
 
113
113
  def formula_where(dlist, out)
114
114
  return if dlist.nil?
115
- return super unless (dlist&.xpath(ns("./dt"))&.size == 1 &&
116
- dlist&.at(ns("./dd"))&.elements&.size == 1 &&
117
- dlist&.at(ns("./dd/p")))
115
+ return super unless dlist&.xpath(ns("./dt"))&.size == 1 &&
116
+ dlist&.at(ns("./dd"))&.elements&.size == 1 &&
117
+ dlist&.at(ns("./dd/p"))
118
118
 
119
119
  out.span **{ class: "zzMoveToFollowing" } do |s|
120
120
  s << "#{@i18n.where} "
@@ -128,8 +128,11 @@ module IsoDoc
128
128
  type = node["type"]
129
129
  name = admonition_name(node, type)
130
130
  out.div **{ id: node["id"], class: admonition_class(node) } do |div|
131
- node.first_element_child.name == "p" ?
132
- admonition_p_parse(node, div, name) : admonition_parse1(node, div, name)
131
+ if node.first_element_child.name == "p"
132
+ admonition_p_parse(node, div, name)
133
+ else
134
+ admonition_parse1(node, div, name)
135
+ end
133
136
  end
134
137
  end
135
138
 
@@ -160,10 +163,32 @@ module IsoDoc
160
163
  end
161
164
 
162
165
  def middle(isoxml, out)
163
- super
166
+ middle_title(isoxml, out)
167
+ middle_admonitions(isoxml, out)
168
+ i = scope isoxml, out, 0
169
+ i = norm_ref isoxml, out, i
170
+ # i = terms_defs isoxml, out, i
171
+ # symbols_abbrevs isoxml, out, i
172
+ clause_etc isoxml, out, i
173
+ annex isoxml, out
174
+ bibliography isoxml, out
164
175
  indexsect isoxml, out
165
176
  end
166
177
 
178
+ def clause_etc(isoxml, out, num)
179
+ isoxml.xpath(ns("//sections/clause[not(@type = 'scope')] | "\
180
+ "//sections/terms | //sections/definitions")).each do |f|
181
+ out.div **attr_code(id: f["id"],
182
+ class: f.name == "definitions" ? "Symbols" : nil) do |div|
183
+ num = num + 1
184
+ clause_name(num, f&.at(ns("./title")), div, nil)
185
+ f.elements.each do |e|
186
+ parse(e, div) unless %w{title source}.include? e.name
187
+ end
188
+ end
189
+ end
190
+ end
191
+
167
192
  def indexsect(isoxml, out)
168
193
  isoxml.xpath(ns("//indexsect")).each do |i|
169
194
  clause_parse(i, out)
@@ -2099,88 +2099,6 @@
2099
2099
  <xsl:text>iVBORw0KGgoAAAANSUhEUgAAAFEAAABHCAIAAADwYjznAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAA66SURBVHhezZt5sM/VG8fNVH7JruxkSZKQ3TAYS7aGajKpFBnRxBjjkhrLrRgmYwm59hrGjC0miSmmIgoVZYu00GJtxkyMkV2/1+fzPh7nfr7fe33v/X6/9/d7/3HmOc/nLM/7PM95zjnfS6F//xc4f/786dOnXaXAUdCcjx071rt373vvvbdChQrNmzdfuXKl+1CAKFDOR44cqVWrVqFChf4T4vbbb7/zzjsnT57sPhcUCo7ztWvX2rRpc9tttxUtWvSuEAgwp/z0009dowJBwXGeM2dO4cKFRZWySJEikvF2o0aNrly54tqlHwXE+cyZM9WrV4czJMW5WLFixv+OO+6YPn26a5p+FBDnjIwM/Ak9AHMcm5mZyWY2TeXKlf/66y/XOs0oCM4HDhwoU6aMMSSqs7Kyfv75Z5jjYXmeff7yyy+7DmlGQXB+7LHHcLKFcdu2bXft2vXtt9/Onz9fS8AnVqRkyZLff/+965NOpJ3zhg0bIsQ4k7/55psvv/xy9+7dnTp1MlezLp07d3bd0on0cr569WqTJk18VlxI9uzZs3XrVjhv37597dq199xzD2vBV9aFo2vVqlWuc9qQXs6zZs2CcLCJ77oLPlWqVOEohqo4U8L/hRdesEVBe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yVZK8GUrfZjeBCsFk4MWubYJPnswvSFSFVBu3ryZJ5fj+e+//wVuVmgt0lkFPgAAAABJRU5ErkJggg==</xsl:text>
2100
2100
  </xsl:variable>
2101
2101
 
2102
- <xsl:template name="number-to-words">
2103
- <xsl:param name="number"/>
2104
- <xsl:variable name="words">
2105
- <words>
2106
- <word cardinal="1">One-</word>
2107
- <word ordinal="1">First </word>
2108
- <word cardinal="2">Two-</word>
2109
- <word ordinal="2">Second </word>
2110
- <word cardinal="3">Three-</word>
2111
- <word ordinal="3">Third </word>
2112
- <word cardinal="4">Four-</word>
2113
- <word ordinal="4">Fourth </word>
2114
- <word cardinal="5">Five-</word>
2115
- <word ordinal="5">Fifth </word>
2116
- <word cardinal="6">Six-</word>
2117
- <word ordinal="6">Sixth </word>
2118
- <word cardinal="7">Seven-</word>
2119
- <word ordinal="7">Seventh </word>
2120
- <word cardinal="8">Eight-</word>
2121
- <word ordinal="8">Eighth </word>
2122
- <word cardinal="9">Nine-</word>
2123
- <word ordinal="9">Ninth </word>
2124
- <word ordinal="10">Tenth </word>
2125
- <word ordinal="11">Eleventh </word>
2126
- <word ordinal="12">Twelfth </word>
2127
- <word ordinal="13">Thirteenth </word>
2128
- <word ordinal="14">Fourteenth </word>
2129
- <word ordinal="15">Fifteenth </word>
2130
- <word ordinal="16">Sixteenth </word>
2131
- <word ordinal="17">Seventeenth </word>
2132
- <word ordinal="18">Eighteenth </word>
2133
- <word ordinal="19">Nineteenth </word>
2134
- <word cardinal="20">Twenty-</word>
2135
- <word ordinal="20">Twentieth </word>
2136
- <word cardinal="30">Thirty-</word>
2137
- <word ordinal="30">Thirtieth </word>
2138
- <word cardinal="40">Forty-</word>
2139
- <word ordinal="40">Fortieth </word>
2140
- <word cardinal="50">Fifty-</word>
2141
- <word ordinal="50">Fiftieth </word>
2142
- <word cardinal="60">Sixty-</word>
2143
- <word ordinal="60">Sixtieth </word>
2144
- <word cardinal="70">Seventy-</word>
2145
- <word ordinal="70">Seventieth </word>
2146
- <word cardinal="80">Eighty-</word>
2147
- <word ordinal="80">Eightieth </word>
2148
- <word cardinal="90">Ninety-</word>
2149
- <word ordinal="90">Ninetieth </word>
2150
- <word cardinal="100">Hundred-</word>
2151
- <word ordinal="100">Hundredth </word>
2152
- </words>
2153
- </xsl:variable>
2154
-
2155
- <xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
2156
-
2157
- <xsl:choose>
2158
- <xsl:when test="$ordinal != ''">
2159
- <xsl:value-of select="$ordinal"/>
2160
- </xsl:when>
2161
- <xsl:otherwise>
2162
- <xsl:choose>
2163
- <xsl:when test="$number &lt; 100">
2164
- <xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
2165
- <xsl:variable name="digit" select="substring($number,2)"/>
2166
- <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
2167
- <xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
2168
- </xsl:when>
2169
- <xsl:otherwise>
2170
- <!-- more 100 -->
2171
- <xsl:variable name="hundred" select="substring($number,1,1)"/>
2172
- <xsl:variable name="digits" select="number(substring($number,2))"/>
2173
- <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
2174
- <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
2175
- <xsl:call-template name="number-to-words">
2176
- <xsl:with-param name="number" select="$digits"/>
2177
- </xsl:call-template>
2178
- </xsl:otherwise>
2179
- </xsl:choose>
2180
- </xsl:otherwise>
2181
- </xsl:choose>
2182
- </xsl:template>
2183
-
2184
2102
  <xsl:template name="printEdition">
2185
2103
  <xsl:variable name="edition" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:edition)"/>
2186
2104
  <xsl:text> </xsl:text>
@@ -3424,6 +3342,7 @@
3424
3342
  <fo:table-row>
3425
3343
  <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
3426
3344
 
3345
+
3427
3346
  <xsl:attribute name="border-top">solid black 0pt</xsl:attribute>
3428
3347
 
3429
3348
 
@@ -3436,6 +3355,10 @@
3436
3355
 
3437
3356
 
3438
3357
 
3358
+
3359
+ <!-- for BSI (not PAS) display Notes before footnotes -->
3360
+
3361
+
3439
3362
  <!-- except gb -->
3440
3363
 
3441
3364
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
@@ -3461,6 +3384,10 @@
3461
3384
  <!-- fn processing -->
3462
3385
  <xsl:call-template name="fn_display"/>
3463
3386
 
3387
+
3388
+ <!-- for PAS display Notes after footnotes -->
3389
+
3390
+
3464
3391
  </fo:table-cell>
3465
3392
  </fo:table-row>
3466
3393
  </fo:table-body>
@@ -3569,6 +3496,7 @@
3569
3496
  </xsl:if>
3570
3497
  <xsl:if test="$parent-name = 'tfoot'">
3571
3498
 
3499
+
3572
3500
  <xsl:attribute name="font-size">9pt</xsl:attribute>
3573
3501
  <xsl:attribute name="border-left">solid black 1pt</xsl:attribute>
3574
3502
  <xsl:attribute name="border-right">solid black 1pt</xsl:attribute>
@@ -3704,6 +3632,7 @@
3704
3632
 
3705
3633
  <fo:block font-size="10pt" margin-bottom="12pt">
3706
3634
 
3635
+
3707
3636
  <xsl:attribute name="font-size">9pt</xsl:attribute>
3708
3637
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3709
3638
 
@@ -3713,8 +3642,12 @@
3713
3642
 
3714
3643
 
3715
3644
 
3645
+ <!-- Table's note name (NOTE, for example) -->
3646
+
3716
3647
  <fo:inline padding-right="2mm">
3717
3648
 
3649
+
3650
+
3718
3651
 
3719
3652
 
3720
3653
 
@@ -3722,6 +3655,8 @@
3722
3655
 
3723
3656
  </fo:inline>
3724
3657
 
3658
+
3659
+
3725
3660
  <xsl:apply-templates mode="process"/>
3726
3661
  </fo:block>
3727
3662
 
@@ -3741,6 +3676,8 @@
3741
3676
  <xsl:variable name="reference" select="@reference"/>
3742
3677
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
3743
3678
  <fo:block margin-bottom="12pt">
3679
+
3680
+
3744
3681
 
3745
3682
  <xsl:attribute name="font-size">9pt</xsl:attribute>
3746
3683
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -3763,6 +3700,7 @@
3763
3700
  <xsl:value-of select="@reference"/>
3764
3701
 
3765
3702
 
3703
+
3766
3704
  </fo:inline>
3767
3705
  <fo:inline>
3768
3706
 
@@ -3918,6 +3856,7 @@
3918
3856
 
3919
3857
  <xsl:value-of select="@reference"/>
3920
3858
 
3859
+
3921
3860
  </fo:basic-link>
3922
3861
  </fo:inline>
3923
3862
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -4944,6 +4883,7 @@
4944
4883
 
4945
4884
 
4946
4885
 
4886
+
4947
4887
  <fo:block-container margin-left="0mm">
4948
4888
 
4949
4889
 
@@ -6151,9 +6091,10 @@
6151
6091
 
6152
6092
 
6153
6093
  </xsl:if>
6154
-
6094
+
6095
+
6096
+
6155
6097
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
6156
-
6157
6098
  <xsl:if test="normalize-space(@citeas) = ''">
6158
6099
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
6159
6100
  </xsl:if>
@@ -6161,6 +6102,7 @@
6161
6102
 
6162
6103
 
6163
6104
 
6105
+
6164
6106
  </xsl:if>
6165
6107
 
6166
6108
  <xsl:apply-templates/>
@@ -7105,4 +7047,100 @@
7105
7047
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
7106
7048
  </xsl:choose>
7107
7049
  </xsl:attribute>
7050
+ </xsl:template><xsl:template name="number-to-words">
7051
+ <xsl:param name="number"/>
7052
+ <xsl:param name="first"/>
7053
+ <xsl:if test="$number != ''">
7054
+ <xsl:variable name="words">
7055
+ <words>
7056
+ <word cardinal="1">One-</word>
7057
+ <word ordinal="1">First </word>
7058
+ <word cardinal="2">Two-</word>
7059
+ <word ordinal="2">Second </word>
7060
+ <word cardinal="3">Three-</word>
7061
+ <word ordinal="3">Third </word>
7062
+ <word cardinal="4">Four-</word>
7063
+ <word ordinal="4">Fourth </word>
7064
+ <word cardinal="5">Five-</word>
7065
+ <word ordinal="5">Fifth </word>
7066
+ <word cardinal="6">Six-</word>
7067
+ <word ordinal="6">Sixth </word>
7068
+ <word cardinal="7">Seven-</word>
7069
+ <word ordinal="7">Seventh </word>
7070
+ <word cardinal="8">Eight-</word>
7071
+ <word ordinal="8">Eighth </word>
7072
+ <word cardinal="9">Nine-</word>
7073
+ <word ordinal="9">Ninth </word>
7074
+ <word ordinal="10">Tenth </word>
7075
+ <word ordinal="11">Eleventh </word>
7076
+ <word ordinal="12">Twelfth </word>
7077
+ <word ordinal="13">Thirteenth </word>
7078
+ <word ordinal="14">Fourteenth </word>
7079
+ <word ordinal="15">Fifteenth </word>
7080
+ <word ordinal="16">Sixteenth </word>
7081
+ <word ordinal="17">Seventeenth </word>
7082
+ <word ordinal="18">Eighteenth </word>
7083
+ <word ordinal="19">Nineteenth </word>
7084
+ <word cardinal="20">Twenty-</word>
7085
+ <word ordinal="20">Twentieth </word>
7086
+ <word cardinal="30">Thirty-</word>
7087
+ <word ordinal="30">Thirtieth </word>
7088
+ <word cardinal="40">Forty-</word>
7089
+ <word ordinal="40">Fortieth </word>
7090
+ <word cardinal="50">Fifty-</word>
7091
+ <word ordinal="50">Fiftieth </word>
7092
+ <word cardinal="60">Sixty-</word>
7093
+ <word ordinal="60">Sixtieth </word>
7094
+ <word cardinal="70">Seventy-</word>
7095
+ <word ordinal="70">Seventieth </word>
7096
+ <word cardinal="80">Eighty-</word>
7097
+ <word ordinal="80">Eightieth </word>
7098
+ <word cardinal="90">Ninety-</word>
7099
+ <word ordinal="90">Ninetieth </word>
7100
+ <word cardinal="100">Hundred-</word>
7101
+ <word ordinal="100">Hundredth </word>
7102
+ </words>
7103
+ </xsl:variable>
7104
+
7105
+ <xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
7106
+
7107
+ <xsl:variable name="value">
7108
+ <xsl:choose>
7109
+ <xsl:when test="$ordinal != ''">
7110
+ <xsl:value-of select="$ordinal"/>
7111
+ </xsl:when>
7112
+ <xsl:otherwise>
7113
+ <xsl:choose>
7114
+ <xsl:when test="$number &lt; 100">
7115
+ <xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
7116
+ <xsl:variable name="digit" select="substring($number,2)"/>
7117
+ <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
7118
+ <xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
7119
+ </xsl:when>
7120
+ <xsl:otherwise>
7121
+ <!-- more 100 -->
7122
+ <xsl:variable name="hundred" select="substring($number,1,1)"/>
7123
+ <xsl:variable name="digits" select="number(substring($number,2))"/>
7124
+ <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
7125
+ <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
7126
+ <xsl:call-template name="number-to-words">
7127
+ <xsl:with-param name="number" select="$digits"/>
7128
+ </xsl:call-template>
7129
+ </xsl:otherwise>
7130
+ </xsl:choose>
7131
+ </xsl:otherwise>
7132
+ </xsl:choose>
7133
+ </xsl:variable>
7134
+ <xsl:choose>
7135
+ <xsl:when test="$first = 'true'">
7136
+ <xsl:variable name="value_lc" select="java:toLowerCase(java:java.lang.String.new($value))"/>
7137
+ <xsl:call-template name="capitalize">
7138
+ <xsl:with-param name="str" select="$value_lc"/>
7139
+ </xsl:call-template>
7140
+ </xsl:when>
7141
+ <xsl:otherwise>
7142
+ <xsl:value-of select="$value"/>
7143
+ </xsl:otherwise>
7144
+ </xsl:choose>
7145
+ </xsl:if>
7108
7146
  </xsl:template></xsl:stylesheet>