metanorma-iec 1.4.4 → 1.4.5

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: a02490c7cf51e0e7d6d7bc61f6afcfd457c56b18f8cf1e98037bf48b2f8ad993
4
- data.tar.gz: 54da10f826af0d1ba39362e74a46747cd52194dfae54115464b49b9c45882beb
3
+ metadata.gz: 2cd54ae113583e981d0db28b08ed00eb92f1b07a79d395c1d907860270889b59
4
+ data.tar.gz: bb89fee2a134f6affa9a94d21da24a9ef2c827bb5a5ea03991d405325fe101b0
5
5
  SHA512:
6
- metadata.gz: 6dd8918d63ec440964bfa7902a03a3b668fd9940115dc908fd1f92353d14342c76586ad87d288454374ee18d4509696e774cec4a36634f5d53f1305cee41dc1b
7
- data.tar.gz: 19cc0bbfe41cacb566e2e84c10194d5c48bc164f08c17d060f0002454df4c0edf41baee4ef8bc367dbb959dedc57df36c25abe3080dfad2916cb6675c6238857
6
+ metadata.gz: 1b3b33b44d4f1434415774b9ceccdff08a48ce8983aee4e7717e5a217fb47bfbfa77b447d70dd4a4530e5fd0e36e9158ebc18ff9ff58a07d4e3a7d80aee82219
7
+ data.tar.gz: 4aa8430cb7caa4450916cf7a677612c937183e62a77b938787f4baf76e4d63fa4de0630283bc761cdd30063aca1df8472a8e5098bc9b453121f9eec75038c684
@@ -57,6 +57,54 @@
57
57
  <ref name="tc-sc-officers-note"/>
58
58
  </optional>
59
59
  </define>
60
+ <define name="term">
61
+ <element name="term">
62
+ <optional>
63
+ <attribute name="id">
64
+ <data type="ID"/>
65
+ </attribute>
66
+ </optional>
67
+ <optional>
68
+ <attribute name="language"/>
69
+ </optional>
70
+ <optional>
71
+ <attribute name="script"/>
72
+ </optional>
73
+ <optional>
74
+ <attribute name="tag"/>
75
+ </optional>
76
+ <optional>
77
+ <attribute name="multilingual-rendering">
78
+ <ref name="MultilingualRenderingType"/>
79
+ </attribute>
80
+ </optional>
81
+ <oneOrMore>
82
+ <ref name="preferred"/>
83
+ </oneOrMore>
84
+ <zeroOrMore>
85
+ <ref name="admitted"/>
86
+ </zeroOrMore>
87
+ <zeroOrMore>
88
+ <ref name="deprecates"/>
89
+ </zeroOrMore>
90
+ <optional>
91
+ <ref name="termdomain"/>
92
+ </optional>
93
+ <ref name="termdefinition"/>
94
+ <zeroOrMore>
95
+ <ref name="termnote"/>
96
+ </zeroOrMore>
97
+ <zeroOrMore>
98
+ <ref name="termexample"/>
99
+ </zeroOrMore>
100
+ <zeroOrMore>
101
+ <ref name="termsource"/>
102
+ </zeroOrMore>
103
+ <zeroOrMore>
104
+ <ref name="term"/>
105
+ </zeroOrMore>
106
+ </element>
107
+ </define>
60
108
  </include>
61
109
  <!-- end overrides -->
62
110
  <define name="function">
@@ -1973,7 +1973,11 @@
1973
1973
  </optional>
1974
1974
  <element name="name">
1975
1975
  <zeroOrMore>
1976
- <ref name="PureTextElement"/>
1976
+ <choice>
1977
+ <ref name="PureTextElement"/>
1978
+ <ref name="stem"/>
1979
+ <ref name="index"/>
1980
+ </choice>
1977
1981
  </zeroOrMore>
1978
1982
  </element>
1979
1983
  <optional>
@@ -1987,7 +1991,7 @@
1987
1991
  </element>
1988
1992
  </optional>
1989
1993
  <optional>
1990
- <element name="grammar-info">
1994
+ <element name="grammar">
1991
1995
  <ref name="Grammar"/>
1992
1996
  </element>
1993
1997
  </optional>
@@ -14,13 +14,17 @@ module IsoDoc
14
14
  page_break(out)
15
15
  iec_orgname(out)
16
16
  middle_title(isoxml, out)
17
- out.div **attr_code(id: f ? f["id"] : "") do |s|
17
+ foreword1(f, b, out)
18
+ end
19
+
20
+ def foreword1(sect, boilerplate, out)
21
+ out.div **attr_code(id: sect ? sect["id"] : "") do |s|
18
22
  s.h1(**{ class: "ForewordTitle" }) { |h1| h1 << @i18n.foreword }
19
23
  @meta.get[:doctype] == "Amendment" or
20
24
  s.div **attr_code(class: "boilerplate_legal") do |s1|
21
- b&.elements&.each { |e| parse(e, s1) }
25
+ boilerplate&.elements&.each { |e| parse(e, s1) }
22
26
  end
23
- f&.elements&.each { |e| parse(e, s) unless e.name == "title" }
27
+ sect&.elements&.each { |e| parse(e, s) unless e.name == "title" }
24
28
  end
25
29
  end
26
30
 
@@ -31,19 +35,11 @@ module IsoDoc
31
35
  end
32
36
 
33
37
  def middle_title(_isoxml, out)
34
- title1 = @meta.get[:doctitlemain]&.sub(/\s+$/, "")
35
- @meta.get[:doctitleintro] and
36
- title1 = "#{@meta.get[:doctitleintro]} &mdash; #{title1}"
37
- if @meta.get[:doctitlepart]
38
- title1 += " &mdash;"
39
- title2 = @meta.get[:doctitlepart]&.sub(/\s+$/, "")
40
- @meta.get[:doctitlepartlabel] and
41
- title2 = "#{@meta.get[:doctitlepartlabel]}: #{title2}"
42
- end
38
+ title1, title2 = middle_title_parts(out)
43
39
  out.p(**{ class: "zzSTDTitle1" }) do |p|
44
40
  p.b { |b| b << title1 }
45
41
  end
46
- if @meta.get[:doctitlepart]
42
+ if title2
47
43
  out.p(**{ class: "zzSTDTitle1" }) { |p| p << "&nbsp;" }
48
44
  out.p(**{ class: "zzSTDTitle2" }) do |p|
49
45
  p.b { |b| b << title2 }
@@ -52,6 +48,20 @@ module IsoDoc
52
48
  out.p(**{ class: "zzSTDTitle1" }) { |p| p << "&nbsp;" }
53
49
  end
54
50
 
51
+ def middle_title_parts(out)
52
+ title1 = @meta.get[:doctitlemain]&.sub(/\s+$/, "")
53
+ @meta.get[:doctitleintro] and
54
+ title1 = "#{@meta.get[:doctitleintro]} &mdash; #{title1}"
55
+ title2 = nil
56
+ if @meta.get[:doctitlepart]
57
+ title1 += " &mdash;"
58
+ title2 = @meta.get[:doctitlepart]&.sub(/\s+$/, "")
59
+ @meta.get[:doctitlepartlabel] and
60
+ title2 = "#{@meta.get[:doctitlepartlabel]}: #{title2}"
61
+ end
62
+ [title1, title2]
63
+ end
64
+
55
65
  def bibliography(isoxml, out)
56
66
  return super unless @is_iev
57
67
  end
@@ -75,6 +75,12 @@ code *, pre *, tt *, kbd *, samp * {
75
75
  font-family: {{monospacefont}} !important;
76
76
  font-variant-ligatures: none; }
77
77
 
78
+ p code, dt code, li code, label code, legend code, caption code, th code, td code,
79
+ p tt, dt tt, li tt, label tt, legend tt, caption tt, th tt, td tt,
80
+ p kbd, dt kbd, li kbd, label kbd, legend kbd, caption kbd, th kbd, td kbd,
81
+ p samp, dt samp, li samp, label samp, legend samp, caption samp, th samp, td samp {
82
+ font-size: {{monospacefontsize}}; }
83
+
78
84
  article, aside, details, figcaption, figure,
79
85
  footer, header, hgroup, menu, nav, section {
80
86
  display: block; }
@@ -86,6 +92,9 @@ table {
86
92
  h1, h2, h3, h4, h5, h6 {
87
93
  font-family: {{headerfont}}; }
88
94
 
95
+ .h1, .h2, .h3, .h4, .h5, .h6 {
96
+ font-family: {{headerfont}}; }
97
+
89
98
  blockquote, q {
90
99
  quotes: none; }
91
100
  blockquote:before, blockquote:after, q:before, q:after {
@@ -298,19 +307,19 @@ span.partlabel {
298
307
  font-size: 0.9em; }
299
308
 
300
309
  /* TYPOGRAPHY */
301
- h1 {
310
+ h1, .h1 {
302
311
  font-size: 1.5em;
303
312
  line-height: 2em;
304
313
  margin-top: 2em;
305
314
  margin-bottom: 1em; }
306
315
 
307
- h2 {
316
+ h2, .h2 {
308
317
  font-size: 1.2em;
309
318
  line-height: 1.5em;
310
319
  margin-top: 2em;
311
320
  margin-bottom: 1em; }
312
321
 
313
- h1, h2, h3, h4, h5, h6 {
322
+ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
314
323
  line-height: 1.2; }
315
324
 
316
325
  p {
@@ -337,7 +346,7 @@ nav a {
337
346
  text-decoration: none;
338
347
  color: black; }
339
348
 
340
- h2 p {
349
+ h2 p, .h2 p {
341
350
  display: inline; }
342
351
 
343
352
  ul > li {
@@ -104,21 +104,21 @@ span.partlabel {
104
104
 
105
105
  /* TYPOGRAPHY */
106
106
 
107
- h1 {
107
+ h1, .h1 {
108
108
  font-size: 1.5em;
109
109
  line-height: 2em;
110
110
  margin-top: 2em;
111
111
  margin-bottom: 1em;
112
112
  }
113
113
 
114
- h2 {
114
+ h2, .h2 {
115
115
  font-size: 1.2em;
116
116
  line-height: 1.5em;
117
117
  margin-top: 2em;
118
118
  margin-bottom: 1em;
119
119
  }
120
120
 
121
- h1, h2, h3, h4, h5, h6 {
121
+ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
122
122
  line-height: 1.2;
123
123
  }
124
124
 
@@ -152,7 +152,7 @@ nav a {
152
152
  color: black;
153
153
  }
154
154
 
155
- h2 p {
155
+ h2 p, .h2 p {
156
156
  display: inline;
157
157
  }
158
158
 
@@ -207,7 +207,7 @@ p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxS
207
207
  div.figure, p.figure {
208
208
  text-align: center; }
209
209
 
210
- h1.main {
210
+ h1.main, .h1 {
211
211
  mso-style-unhide: no;
212
212
  mso-style-qformat: yes;
213
213
  mso-style-name: "Heading 1";
@@ -221,8 +221,6 @@ h1.main {
221
221
  text-indent: -19.85pt;
222
222
  mso-pagination: widow-orphan;
223
223
  page-break-after: avoid;
224
- mso-outline-level: 1;
225
- mso-list: l26 level1 lfo40;
226
224
  mso-hyphenate: none;
227
225
  tab-stops: list 19.85pt;
228
226
  layout-grid-mode: char;
@@ -234,6 +232,10 @@ h1.main {
234
232
  mso-fareast-language: ZH-CN;
235
233
  font-weight: bold; }
236
234
 
235
+ h1.main {
236
+ mso-outline-level: 1;
237
+ mso-list: l26 level1 lfo40; }
238
+
237
239
  /* IEC: p.ANNEXtitle */
238
240
  h1.Annex {
239
241
  mso-style-name: ANNEX_title;
@@ -265,7 +267,7 @@ h1.Annex {
265
267
  h1
266
268
  { mso-list:l26 level1 lfo40;}
267
269
  */
268
- .h2Annex, h2 {
270
+ .h2Annex, h2, .h3 {
269
271
  mso-style-unhide: no;
270
272
  mso-style-qformat: yes;
271
273
  mso-style-parent: "Heading 1";
@@ -293,7 +295,7 @@ h2 {
293
295
  mso-list: l26 level2 lfo40;
294
296
  mso-outline-level: 2; }
295
297
 
296
- .h3Annex, h3 {
298
+ .h3Annex, h3, .h3 {
297
299
  mso-style-unhide: no;
298
300
  mso-style-qformat: yes;
299
301
  mso-style-name: "Heading 3";
@@ -321,7 +323,7 @@ h3 {
321
323
  mso-list: l26 level3 lfo40;
322
324
  mso-outline-level: 3; }
323
325
 
324
- .h4Annex, h4 {
326
+ .h4Annex, h4, .h4 {
325
327
  mso-style-unhide: no;
326
328
  mso-style-qformat: yes;
327
329
  mso-style-name: "Heading 4";
@@ -349,7 +351,7 @@ h4 {
349
351
  mso-list: l26 level2 lfo40;
350
352
  mso-outline-level: 4; }
351
353
 
352
- .h5Annex, h5 {
354
+ .h5Annex, h5, .h5 {
353
355
  mso-style-unhide: no;
354
356
  mso-style-qformat: yes;
355
357
  mso-style-name: "Heading 5";
@@ -377,7 +379,7 @@ h5 {
377
379
  mso-list: l26 level5 lfo40;
378
380
  mso-outline-level: 5; }
379
381
 
380
- h6 {
382
+ h6, .h6 {
381
383
  mso-style-unhide: no;
382
384
  mso-style-qformat: yes;
383
385
  mso-style-name: "Heading 6";
@@ -405,7 +407,7 @@ h6 {
405
407
  mso-list: l26 level6 lfo40;
406
408
  mso-outline-level: 6; }
407
409
 
408
- p.MsoHeading7, li.MsoHeading7, div.MsoHeading7 {
410
+ p.MsoHeading7, li.MsoHeading7, div.MsoHeading7, .h7 {
409
411
  mso-style-unhide: no;
410
412
  mso-style-qformat: yes;
411
413
  mso-style-name: "Heading 7";
@@ -434,7 +436,7 @@ p.MsoHeading7, li.MsoHeading7, div.MsoHeading7 {
434
436
  p.MsoHeading7 {
435
437
  mso-list: l26 level7 lfo40; }
436
438
 
437
- p.MsoHeading8, li.MsoHeading8, div.MsoHeading8 {
439
+ p.MsoHeading8, li.MsoHeading8, div.MsoHeading8, .h8 {
438
440
  mso-style-unhide: no;
439
441
  mso-style-qformat: yes;
440
442
  mso-style-name: "Heading 8";
@@ -463,7 +465,7 @@ p.MsoHeading8, li.MsoHeading8, div.MsoHeading8 {
463
465
  p.MsoHeading8 {
464
466
  mso-list: l26 level8 lfo40; }
465
467
 
466
- p.MsoHeading9, li.MsoHeading9, div.MsoHeading9 {
468
+ p.MsoHeading9, li.MsoHeading9, div.MsoHeading9, .h9 {
467
469
  mso-style-unhide: no;
468
470
  mso-style-qformat: yes;
469
471
  mso-style-name: "Heading 9";
@@ -190,7 +190,7 @@ p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxS
190
190
  div.figure, p.figure
191
191
  {text-align: center;}
192
192
 
193
- h1.main
193
+ h1.main, .h1
194
194
  {mso-style-unhide:no;
195
195
  mso-style-qformat:yes;
196
196
  mso-style-name:"Heading 1";
@@ -204,8 +204,6 @@ h1.main
204
204
  text-indent:-19.85pt;
205
205
  mso-pagination:widow-orphan;
206
206
  page-break-after:avoid;
207
- mso-outline-level:1;
208
- mso-list:l26 level1 lfo40;
209
207
  mso-hyphenate:none;
210
208
  tab-stops:list 19.85pt;
211
209
  layout-grid-mode:char;
@@ -216,6 +214,10 @@ h1.main
216
214
  mso-ansi-language:EN-GB;
217
215
  mso-fareast-language:ZH-CN;
218
216
  font-weight:bold;}
217
+ h1.main {
218
+ mso-outline-level:1;
219
+ mso-list:l26 level1 lfo40;
220
+ }
219
221
  /* IEC: p.ANNEXtitle */
220
222
  h1.Annex
221
223
  {mso-style-name:ANNEX_title;
@@ -246,7 +248,7 @@ h1.Annex
246
248
  h1
247
249
  { mso-list:l26 level1 lfo40;}
248
250
  */
249
- .h2Annex, h2
251
+ .h2Annex, h2, .h3
250
252
  {mso-style-unhide:no;
251
253
  mso-style-qformat:yes;
252
254
  mso-style-parent:"Heading 1";
@@ -273,7 +275,7 @@ h2
273
275
  { mso-list:l26 level2 lfo40;
274
276
  mso-outline-level:2;
275
277
  }
276
- .h3Annex, h3
278
+ .h3Annex, h3, .h3
277
279
  {mso-style-unhide:no;
278
280
  mso-style-qformat:yes;
279
281
  mso-style-name:"Heading 3";
@@ -299,7 +301,7 @@ h2
299
301
  h3 {mso-list:l26 level3 lfo40;
300
302
  mso-outline-level:3;
301
303
  }
302
- .h4Annex, h4
304
+ .h4Annex, h4, .h4
303
305
  {mso-style-unhide:no;
304
306
  mso-style-qformat:yes;
305
307
  mso-style-name:"Heading 4";
@@ -325,7 +327,7 @@ h3 {mso-list:l26 level3 lfo40;
325
327
  h4 {mso-list:l26 level2 lfo40;
326
328
  mso-outline-level:4;
327
329
  }
328
- .h5Annex, h5
330
+ .h5Annex, h5, .h5
329
331
  {mso-style-unhide:no;
330
332
  mso-style-qformat:yes;
331
333
  mso-style-name:"Heading 5";
@@ -351,7 +353,7 @@ h4 {mso-list:l26 level2 lfo40;
351
353
  h5 {mso-list:l26 level5 lfo40;
352
354
  mso-outline-level:5;
353
355
  }
354
- h6
356
+ h6, .h6
355
357
  {mso-style-unhide:no;
356
358
  mso-style-qformat:yes;
357
359
  mso-style-name:"Heading 6";
@@ -377,7 +379,7 @@ h6
377
379
  h6 {mso-list:l26 level6 lfo40;
378
380
  mso-outline-level:6;
379
381
  }
380
- p.MsoHeading7, li.MsoHeading7, div.MsoHeading7
382
+ p.MsoHeading7, li.MsoHeading7, div.MsoHeading7, .h7
381
383
  {mso-style-unhide:no;
382
384
  mso-style-qformat:yes;
383
385
  mso-style-name:"Heading 7";
@@ -403,7 +405,7 @@ p.MsoHeading7, li.MsoHeading7, div.MsoHeading7
403
405
  mso-fareast-language:ZH-CN;
404
406
  font-weight:bold;}
405
407
  p.MsoHeading7 {mso-list:l26 level7 lfo40;}
406
- p.MsoHeading8, li.MsoHeading8, div.MsoHeading8
408
+ p.MsoHeading8, li.MsoHeading8, div.MsoHeading8 ,.h8
407
409
  {mso-style-unhide:no;
408
410
  mso-style-qformat:yes;
409
411
  mso-style-name:"Heading 8";
@@ -429,7 +431,7 @@ p.MsoHeading8, li.MsoHeading8, div.MsoHeading8
429
431
  mso-fareast-language:ZH-CN;
430
432
  font-weight:bold;}
431
433
  p.MsoHeading8 {mso-list:l26 level8 lfo40;}
432
- p.MsoHeading9, li.MsoHeading9, div.MsoHeading9
434
+ p.MsoHeading9, li.MsoHeading9, div.MsoHeading9, .h9
433
435
  {mso-style-unhide:no;
434
436
  mso-style-qformat:yes;
435
437
  mso-style-name:"Heading 9";
@@ -1962,7 +1962,7 @@
1962
1962
  </xsl:template>
1963
1963
 
1964
1964
 
1965
- <xsl:template match="iec:title">
1965
+ <xsl:template match="iec:title" name="title">
1966
1966
 
1967
1967
  <xsl:variable name="level">
1968
1968
  <xsl:call-template name="getLevel"/>
@@ -2058,6 +2058,7 @@
2058
2058
  <!-- <xsl:if test="ancestor::iec:dl and ancestor::iec:figure">
2059
2059
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
2060
2060
  </xsl:if> -->
2061
+ <xsl:apply-templates select="@language"/>
2061
2062
  <xsl:apply-templates/>
2062
2063
  </xsl:element>
2063
2064
  </xsl:when>
@@ -2162,12 +2163,11 @@
2162
2163
  <xsl:template match="iec:li">
2163
2164
  <fo:list-item>
2164
2165
  <fo:list-item-label end-indent="label-end()">
2165
- <xsl:if test="local-name(..) = 'ul'">
2166
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2167
- </xsl:if>
2168
2166
  <fo:block>
2169
2167
  <xsl:choose>
2170
- <xsl:when test="local-name(..) = 'ul'">•</xsl:when> <!-- &#x2014; dash -->
2168
+ <xsl:when test="local-name(..) = 'ul'">
2169
+ <xsl:call-template name="setULLabel"/>
2170
+ </xsl:when>
2171
2171
  <xsl:otherwise> <!-- for ordered lists -->
2172
2172
  <xsl:choose>
2173
2173
  <xsl:when test="../@type = 'arabic'">
@@ -4863,6 +4863,7 @@
4863
4863
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
4864
4864
  <xsl:apply-templates/>
4865
4865
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
4866
+ <xsl:apply-templates select="@language"/>
4866
4867
  <xsl:apply-templates/>
4867
4868
  </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
4868
4869
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
@@ -7057,6 +7058,53 @@
7057
7058
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
7058
7059
  <!-- 0xA0 to space replacement -->
7059
7060
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
7061
+ </xsl:template><xsl:variable name="ul_labels_">
7062
+
7063
+
7064
+
7065
+
7066
+
7067
+ <label level="1" font-size="10pt">•</label>
7068
+ <label level="2" font-size="10pt">—</label><!-- em dash -->
7069
+ <label level="3" font-size="75%">o</label> <!-- white circle -->
7070
+
7071
+
7072
+
7073
+
7074
+
7075
+
7076
+
7077
+
7078
+
7079
+
7080
+
7081
+
7082
+
7083
+ </xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
7084
+ <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
7085
+ <xsl:variable name="list_level">
7086
+ <xsl:choose>
7087
+ <xsl:when test="$list_level_ &lt;= 3"><xsl:value-of select="$list_level_"/></xsl:when>
7088
+ <xsl:otherwise><xsl:value-of select="$list_level_ mod 3"/></xsl:otherwise>
7089
+ </xsl:choose>
7090
+ </xsl:variable>
7091
+ <xsl:choose>
7092
+ <xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels -->
7093
+ <xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/>
7094
+ </xsl:when>
7095
+ <xsl:when test="$list_level mod 3 = 0">
7096
+ <xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/>
7097
+ </xsl:when>
7098
+ <xsl:when test="$list_level mod 2 = 0">
7099
+ <xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/>
7100
+ </xsl:when>
7101
+ <xsl:otherwise>
7102
+ <xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
7103
+ </xsl:otherwise>
7104
+ </xsl:choose>
7105
+ </xsl:template><xsl:template match="label" mode="ul_labels">
7106
+ <xsl:copy-of select="@*[not(local-name() = 'level')]"/>
7107
+ <xsl:value-of select="."/>
7060
7108
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
7061
7109
  <xsl:choose>
7062
7110
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
@@ -7510,6 +7558,10 @@
7510
7558
  </svg>
7511
7559
  </fo:instream-foreign-object>
7512
7560
  </fo:inline>
7561
+ </xsl:template><xsl:template match="@language">
7562
+ <xsl:copy-of select="."/>
7563
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="4">
7564
+ <xsl:call-template name="title"/>
7513
7565
  </xsl:template><xsl:template name="convertDate">
7514
7566
  <xsl:param name="date"/>
7515
7567
  <xsl:param name="format" select="'short'"/>
@@ -63,7 +63,7 @@ module IsoDoc
63
63
  end
64
64
  docpart = docxml&.at(ns("//bibdata/ext/structuredidentifier/"\
65
65
  "project-number/@part"))&.text or return
66
- docxml.xpath(ns("//concept/termref[@base = 'IEV']")).each do |t|
66
+ docxml.xpath(ns("//termref[@base = 'IEV']")).each do |t|
67
67
  concept_iev1(t, docpart, labels)
68
68
  end
69
69
  end
@@ -120,36 +120,66 @@ module IsoDoc
120
120
  p = d.parent
121
121
  designation_annotate(p, d.at(ns("./name")))
122
122
  m << { lang: lg, script: Metanorma::Utils.default_script(lg),
123
- designation: l10n_recursive(p.remove, lg) }
123
+ designation: l10n_recursive(p.remove, lg).to_xml.strip }
124
124
  end
125
125
  end
126
126
 
127
127
  def l10n_recursive(xml, lang)
128
128
  script = Metanorma::Utils.default_script(lang)
129
+ c = HTMLEntities.new
129
130
  xml.traverse do |x|
130
131
  next unless x.text?
131
132
 
132
- x.replace(l10n(x, lang, script))
133
+ text = c.encode(c.decode(x.text), :hexadecimal)
134
+ x.replace(cleanup_entities(l10n(text, lang, script), is_xml: false))
133
135
  end
134
136
  xml
135
137
  end
136
138
 
139
+ def merge_otherlang_designations(desgn)
140
+ h = desgn.each_with_object({}) do |e, m|
141
+ if m[e[:lang]]
142
+ m[e[:lang]][:designation] += e[:designation]
143
+ else m[e[:lang]] = e
144
+ end
145
+ end
146
+ h.keys.sort.each_with_object([]) { |k, m| m << h[k] }
147
+ end
148
+
137
149
  def otherlang_designations1(term, lgs)
138
- pr = extract_otherlang_designations(term, lgs)
150
+ pr = merge_otherlang_designations(
151
+ extract_otherlang_designations(term, lgs),
152
+ )
139
153
  return if pr.empty?
140
154
 
141
155
  prefs = pr.map do |p|
142
156
  "<dt>#{p[:lang]}</dt>"\
143
157
  "<dd language='#{p[:lang]}' script='#{p[:script]}'>"\
144
- "#{p[:designation].to_xml}</dd>"
158
+ "#{cleanup_entities(p[:designation])}</dd>"
145
159
  end
146
160
  term << "<dl type='other-lang'>#{prefs.join}</dl>"
147
161
  end
148
162
 
163
+ def related(docxml)
164
+ docxml.xpath(ns("//term[related]")).each { |f| move_related(f) }
165
+ super
166
+ end
167
+
168
+ def move_related(term)
169
+ defn = term.at(ns("./definition")) or return
170
+ term.xpath(ns("./related")).reverse.each do |r|
171
+ defn.next = r.remove
172
+ end
173
+ end
174
+
149
175
  def related1(node)
150
176
  lg = node&.at("./ancestor::xmlns:term/@language")&.text
151
177
  @i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
152
- super
178
+ p = node.at(ns("./preferred"))
179
+ ref = node.at(ns("./xref | ./eref | ./termref"))
180
+ label = @i18n.relatedterms[node["type"]].upcase
181
+ node.replace(l10n("<p>#{label}: "\
182
+ "#{p.children.to_xml} (#{ref.to_xml})</p>"))
153
183
  @i18n = @i18n_lg["default"]
154
184
  end
155
185
 
@@ -171,7 +201,7 @@ module IsoDoc
171
201
 
172
202
  def termsource1_iev(elem)
173
203
  while elem&.next_element&.name == "termsource"
174
- elem << "; #{elem.next_element.remove.children.to_xml}"
204
+ elem << l10n("; #{elem.next_element.remove.children.to_xml}")
175
205
  end
176
206
  elem.children = l10n("#{@i18n.source}: #{elem.children.to_xml.strip}")
177
207
  end
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "1.4.4".freeze
3
+ VERSION = "1.4.5".freeze
4
4
  end
5
5
  end
6
6
 
@@ -661,10 +661,11 @@ RSpec.describe IsoDoc do
661
661
  <terms id="_general" obligation="normative"><title>General</title>
662
662
  <term id="item" language="en" tag="item">
663
663
  <preferred><expression language="en"><name>system</name></expression><field-of-application>in dependability</field-of-application></preferred>
664
- <preferred><expression language="ar"><name>نظام،</name></expression><field-of-application>في الاعتمادیة</field-of-application></preferred>
665
664
  <preferred><expression language="de"><name>Betrachtungseinheit</name<grammar><gender>feminine</gender></grammar></expression></preferred>
666
- <preferred><expression language="de"><name>Einheit</name><grammar><gender>feminine</gender></grammar></expression></preferred>
667
665
  <preferred><expression language="ja"><name>アイテム</name></expression></preferred>
666
+ <preferred><expression language="de"><name>Einheit</name><grammar><gender>feminine</gender></grammar></expression></preferred>
667
+ <preferred><expression language="zh"><name>&#20135;&#21697;</name></expression><field-of-application>在可靠性方面</field-of-application></preferred>
668
+ <preferred><expression language="ar"><name>نظام،</name></expression><field-of-application>في الاعتمادیة</field-of-application></preferred>
668
669
  <admitted><expression><name>paddy rice</name></expression></admitted>
669
670
  <admitted><expression><name>rough rice</name></expression></admitted>
670
671
  <deprecates><expression><name>cargo rice</name></expression></deprecates>
@@ -688,6 +689,7 @@ RSpec.describe IsoDoc do
688
689
  <field-of-application>en sûreté de fonctionnement</field-of-application>
689
690
  </preferred>
690
691
  <related type='contrast'><preferred><expression><name>Designation cinquième</name></expression></preferred><xref target="paddy1"/></related>
692
+ <related type='see'><preferred><expression><name>Designation sixième</name></expression></preferred><xref target="paddy1"/></related>
691
693
  <definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747d">ensemble d’entités reliées entre elles qui satisfont collectivement à une exigence</p></verbal-definition></definition>
692
694
  <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74c">
693
695
  <p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">Un système est considéré comme ayant une frontière définie, réelle ou abstraite.</p>
@@ -712,7 +714,7 @@ RSpec.describe IsoDoc do
712
714
  INPUT
713
715
 
714
716
  presxml = <<~PRESXML
715
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
717
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
716
718
  <bibdata type='standard'>
717
719
  <docidentifier type='ISO'>IEC 60050-192 ED 1</docidentifier>
718
720
  <docnumber>60050</docnumber>
@@ -735,20 +737,23 @@ RSpec.describe IsoDoc do
735
737
  <admitted>paddy rice</admitted>
736
738
  <admitted>rough rice</admitted>
737
739
  <deprecates>cargo rice</deprecates>
740
+ <definition>
741
+ <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>set of interrelated items that collectively fulfil a requirement</p>
742
+ </definition>
738
743
  <p>
739
- <strong>CONTRAST:</strong>
740
- <em>
741
- <preferred>
742
- <strong>Fifth Designation</strong>
743
- </preferred>
744
- </em>
744
+ CONTRAST:
745
+ <strong>Fifth Designation</strong>
745
746
  (
746
747
  <xref target='paddy1'>192-01-02</xref>
747
748
  )
748
749
  </p>
749
- <definition>
750
- <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>set of interrelated items that collectively fulfil a requirement</p>
751
- </definition>
750
+ <termexample id='_671a1994-4783-40d0-bc81-987d06ffb740'>
751
+ <name>EXAMPLE</name>
752
+ <p id='_19830f33-e46c-42cc-94ca-a5ef101132d0'>
753
+ External resources (from outside the system boundary) may be
754
+ required for the system to operate.
755
+ </p>
756
+ </termexample>
752
757
  <termnote id='_671a1994-4783-40d0-bc81-987d06ffb74e'>
753
758
  <name>Note 1 to entry</name>
754
759
  <p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>A system is considered to have a defined real or abstract boundary.</p>
@@ -760,43 +765,48 @@ RSpec.describe IsoDoc do
760
765
  required for the system to operate.
761
766
  </p>
762
767
  </termnote>
763
- <termexample id='_671a1994-4783-40d0-bc81-987d06ffb740'>
764
- <name>EXAMPLE</name>
765
- <p id='_19830f33-e46c-42cc-94ca-a5ef101132d0'>
766
- External resources (from outside the system boundary) may be
767
- required for the system to operate.
768
- </p>
769
- </termexample>
770
- <termsource status='modified'>SOURCE:
768
+ <termsource status='modified'>
769
+ SOURCE:
771
770
  <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'>
772
771
  <locality type='clause'>
773
772
  <referenceFrom>3.1</referenceFrom>
774
773
  </locality>
775
774
  ISO 7301:2011, 3.1
776
- </origin>, modified &#x2013;
777
- modified by extension to suit the dependability context
775
+ </origin>
776
+ , modified &#x2013; modified by extension to suit the dependability
777
+ context
778
778
  </termsource>
779
779
  <preferred>
780
780
  <strong>entit&#xE9;</strong>
781
781
  , &#x3c;en s&#xFB;ret&#xE9; de fonctionnement&#x3e;, m
782
782
  </preferred>
783
- <p>
784
- <strong>CONTRASTEZ:</strong>
785
- <em>
786
- <preferred>
787
- <strong>Designation cinqui&#xE8;me</strong>
788
- </preferred>
789
- </em>
790
- (
791
- <xref target='paddy1'>192-01-02</xref>
792
- )
793
- </p>
794
783
  <definition>
795
784
  <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747d'>
796
785
  ensemble d&#x2019;entit&#xE9;s reli&#xE9;es entre elles qui
797
786
  satisfont collectivement &#xE0; une exigence
798
787
  </p>
799
788
  </definition>
789
+ <p>
790
+ CONTRASTEZ:
791
+ <strong>Designation cinqui&#xE8;me</strong>
792
+ (
793
+ <xref target='paddy1'>192-01-02</xref>
794
+ )
795
+ </p>
796
+ <p>
797
+ VOIR:
798
+ <strong>Designation sixi&#xE8;me</strong>
799
+ (
800
+ <xref target='paddy1'>192-01-02</xref>
801
+ )
802
+ </p>
803
+ <termexample id='_671a1994-4783-40d0-bc81-987d06ffb741'>
804
+ <name>EXEMPLE</name>
805
+ <p id='_19830f33-e46c-42cc-94ca-a5ef101132d1'>
806
+ External resources (from outside the system boundary) may be
807
+ required for the system to operate.
808
+ </p>
809
+ </termexample>
800
810
  <termnote id='_671a1994-4783-40d0-bc81-987d06ffb74c'>
801
811
  <name>Note 1 &#xE0; l&#x2019;article</name>
802
812
  <p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
@@ -812,51 +822,50 @@ RSpec.describe IsoDoc do
812
822
  fonctionnement du syst&#xE8;me.
813
823
  </p>
814
824
  </termnote>
815
- <termexample id='_671a1994-4783-40d0-bc81-987d06ffb741'>
816
- <name>EXEMPLE</name>
817
- <p id='_19830f33-e46c-42cc-94ca-a5ef101132d1'>
818
- External resources (from outside the system boundary) may be
819
- required for the system to operate.
820
- </p>
821
- </termexample>
822
- <termsource status='modified'>SOURCE:
825
+ <termsource status='modified'>
826
+ SOURCE:
823
827
  <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'>
824
828
  <locality type='clause'>
825
829
  <referenceFrom>3.1</referenceFrom>
826
830
  </locality>
827
831
  ISO 7301:2011, 3.1
828
- </origin>, modifi&#xE9; &#x2013;
829
- modifi&#xE9; pour adapter au contexte de la s&#xFB;ret&#xE9; de fonctionnement
832
+ </origin>
833
+ , modifi&#xE9; &#x2013; modifi&#xE9; pour adapter au contexte de la
834
+ s&#xFB;ret&#xE9; de fonctionnement
830
835
  </termsource>
831
836
  <dl type='other-lang'>
832
837
  <dt>ar</dt>
833
- <dd language="ar" script="Arab">
838
+ <dd language='ar' script='Arab'>
834
839
  <preferred>
835
- <strong>&#x61C;&#x646;&#x638;&#x627;&#x645;&#x60C;&#x61C;</strong>
836
- &#x61C;, &#x3c;&#x641;&#x64A;
837
- &#x627;&#x644;&#x627;&#x639;&#x62A;&#x645;&#x627;&#x62F;&#x6CC;&#x629;&#x3e;&#x61C;
840
+ <strong>&#x61C;&#x646;&#x638;&#x627;&#x645;&#x60C;&#x61C;</strong>
841
+ &#x61C;, &#x3c;&#x641;&#x64A;
842
+ &#x627;&#x644;&#x627;&#x639;&#x62A;&#x645;&#x627;&#x62F;&#x6CC;&#x629;&#x3e;&#x61C;
838
843
  </preferred>
839
844
  </dd>
840
845
  <dt>de</dt>
841
- <dd language="de" script="Latn">
846
+ <dd language='de' script='Latn'>
842
847
  <preferred>
843
848
  <strong>Betrachtungseinheit</strong>
844
849
  , f
845
850
  </preferred>
846
- </dd>
847
- <dt>de</dt>
848
- <dd language="de" script="Latn">
849
851
  <preferred>
850
852
  <strong>Einheit</strong>
851
853
  , f
852
854
  </preferred>
853
855
  </dd>
854
856
  <dt>ja</dt>
855
- <dd language="ja" script="Jpan">
857
+ <dd language='ja' script='Jpan'>
856
858
  <preferred>
857
859
  <strong>&#x30A2;&#x30A4;&#x30C6;&#x30E0;</strong>
858
860
  </preferred>
859
861
  </dd>
862
+ <dt>zh</dt>
863
+ <dd language='zh' script='Hans'>
864
+ <preferred>
865
+ <strong>&#x4EA7;&#x54C1;</strong>
866
+ &#x3001;&#x3c;&#x5728;&#x53EF;&#x9760;&#x6027;&#x65B9;&#x9762;&#x3e;
867
+ </preferred>
868
+ </dd>
860
869
  </dl>
861
870
  </term>
862
871
  <term id='paddy1'>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-13 00:00:00.000000000 Z
11
+ date: 2021-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso