metanorma-itu 1.0.0 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -25,7 +25,7 @@ p.pseudocode, li.pseudocode, div.pseudocode
25
25
  text-align:left;
26
26
  mso-pagination:widow-orphan;
27
27
  tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
28
- font-size:10.0pt;
28
+ font-size:12.0pt;
29
29
  font-family:$bodyfont;
30
30
  mso-fareast-font-family:Calibri;
31
31
  mso-bidi-font-family:"Courier New";
@@ -113,7 +113,7 @@ p.SourceTitle
113
113
  mso-fareast-font-family:$bodyfont;
114
114
  mso-bidi-font-family:$bodyfont;
115
115
  mso-ansi-language:EN-GB;}
116
- p.AdmonitionTitle
116
+ p.AdmonitionTitle, p.RecommendationTitle
117
117
  {mso-style-unhide:no;
118
118
  mso-style-qformat:yes;
119
119
  mso-style-parent:"";
@@ -762,6 +762,25 @@ p.RecNo, li.RecNo, div.RecNo
762
762
  mso-fareast-language:EN-US;
763
763
  font-weight:bold;
764
764
  mso-bidi-font-weight:normal;}
765
+ p.boilerplateHdr {
766
+ text-align:center;
767
+ font-family:$bodyfont;
768
+ font-size:11.0pt;
769
+ }
770
+ p.boilerplate {
771
+ font-family:$bodyfont;
772
+ font-size:11.0pt;
773
+ text-align:justify;
774
+ margin-top:6.0pt;
775
+ margin-bottom:0.0pt;
776
+ }
777
+ p.draftwarningHdr {
778
+ text-align:center;
779
+ font-family:$bodyfont;
780
+ font-weight:bold;
781
+ font-size:16.0pt;
782
+ font-style:italic;
783
+ }
765
784
  span.addition {
766
785
  color: blue;
767
786
  }
@@ -125,162 +125,9 @@ style='mso-ansi-language:EN-US'> 

125
125
  <p><br clear=all
126
126
  style='page-break-before:always'></p>
127
127
 
128
- <p class=MsoNormal align=center style='margin-top:24.0pt;text-align:center'><span
129
- style='mso-bookmark:_Hlk526346232'><span lang=EN-US style='font-size:11.0pt;
130
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'>FOREWORD<o:p></o:p></span></span></p>
131
-
132
- <p class=MsoNormal><span style='mso-bookmark:_Hlk526346232'><span lang=EN-US
133
- style='font-size:11.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'>The
134
- International Telecommunication Union (ITU) is the United Nations specialized
135
- agency in the field of tele­com­mu­ni­ca­tions</span></span><span
136
- style='mso-bookmark:_Hlk526346232'><span lang=EN-US style='font-size:11.0pt;
137
- mso-ansi-language:EN-US'>, information and communication technologies (ICTs).</span></span><span
138
- style='mso-bookmark:_Hlk526346232'><span lang=EN-US style='font-size:11.0pt;
139
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'> The ITU Telecommunication
140
- Standardization Sector (ITU-T) is a permanent organ of ITU. ITU-T is
141
- responsible for studying technical, operating and tariff questions and issuing
142
- Recommendations on them with a view to standardizing telecommunications on a
143
- worldwide basis.<o:p></o:p></span></span></p>
144
-
145
- <p class=MsoNormal><span style='mso-bookmark:_Hlk526346232'><span lang=EN-US
146
- style='font-size:11.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'>The <a
147
- name=iitexte>World Telecommunication Standardization Assembly (WTSA), which
148
- meets every four years, establishes the topics for study by the ITU‑T study
149
- groups which, in turn, produce Recommendations on these topics.<o:p></o:p></a></span></span></p>
150
-
151
- <p class=MsoNormal><span style='mso-bookmark:_Hlk526346232'><span
152
- style='mso-bookmark:iitexte'><span lang=EN-US style='font-size:11.0pt;
153
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'>The approval of ITU-T
154
- Recommendations is covered by the procedure laid down in WTSA Resolution&nbsp;1</span></span></span><span
155
- style='mso-bookmark:_Hlk526346232'><span lang=EN-US style='font-size:11.0pt;
156
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'>.<o:p></o:p></span></span></p>
157
-
158
- <p class=MsoNormal><span style='mso-bookmark:_Hlk526346232'><span lang=EN-US
159
- style='font-size:11.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'>In
160
- some areas of information technology which fall within ITU-T's purview, the
161
- necessary standards are prepared on a collaborative basis with ISO and IEC.<o:p></o:p></span></span></p>
162
-
163
- <p class=MsoNormal align=center style='text-align:center'><span
164
- style='mso-bookmark:_Hlk526346232'><span lang=EN-US style='font-size:11.0pt;
165
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></span></p>
166
-
167
- <p class=MsoNormal align=center style='text-align:center'><span
168
- style='mso-bookmark:_Hlk526346232'><span lang=EN-US style='font-size:11.0pt;
169
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></span></p>
170
-
171
- <p class=MsoNormal align=center style='text-align:center'><span
172
- style='mso-bookmark:_Hlk526346232'><span lang=EN-US style='font-size:11.0pt;
173
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></span></p>
174
-
175
- <p class=MsoNormal align=center style='text-align:center'><span
176
- style='mso-bookmark:_Hlk526346232'><span lang=EN-US style='font-size:11.0pt;
177
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'>NOTE<o:p></o:p></span></span></p>
178
-
179
- <p class=MsoNormal style='margin-top:9.0pt'><span style='mso-bookmark:_Hlk526346232'><span
180
- lang=EN-GB style='font-size:11.0pt;mso-bidi-font-size:10.0pt'>In <a
181
- name=iitextea>this Recommendation, the expression &quot;Administration&quot; is
182
- used for conciseness to indicate both a telecommunication administration and a
183
- recognized operating agency</a></span></span><span style='mso-bookmark:_Hlk526346232'><span
184
- style='mso-bookmark:iitextea'><span lang=EN-US style='font-size:11.0pt;
185
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'>.<o:p></o:p></span></span></span></p>
186
-
187
- <p class=MsoNormal style='margin-top:9.0pt'><span style='mso-bookmark:_Hlk526346232'><span
188
- style='mso-bookmark:iitextea'><span lang=EN-US style='font-size:11.0pt;
189
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'>Compliance with this
190
- Recommendation is voluntary. However, the Recommendation may contain certain
191
- mandatory provisions (to ensure, e.g., interoperability or applicability) and
192
- compliance with the Recommendation is achieved when all of these mandatory
193
- provisions are met. The words &quot;shall&quot; or some other obligatory
194
- language such as &quot;must&quot; and the negative equivalents are used to
195
- express requirements. The use of such words does not suggest that compliance
196
- with the Recommendation is required of any party</span></span></span><span
197
- style='mso-bookmark:_Hlk526346232'><span lang=EN-US style='font-size:11.0pt;
198
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'>.<o:p></o:p></span></span></p>
199
-
200
- <p class=MsoNormal align=center style='text-align:center'><span
201
- style='mso-bookmark:_Hlk526346232'><span lang=EN-US style='font-size:11.0pt;
202
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></span></p>
203
-
204
- <p class=MsoNormal align=center style='text-align:center'><span
205
- style='mso-bookmark:_Hlk526346232'><span lang=EN-US style='font-size:11.0pt;
206
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></span></p>
207
-
208
- <p class=MsoNormal align=center style='text-align:center'><span
209
- style='mso-bookmark:_Hlk526346232'><span lang=EN-US style='font-size:11.0pt;
210
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></span></p>
211
-
212
- <p class=MsoNormal align=center style='text-align:center'><span
213
- style='mso-bookmark:_Hlk526346232'><span lang=EN-US style='font-size:11.0pt;
214
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></span></p>
215
-
216
- <p class=MsoNormal align=center style='text-align:center'><span
217
- style='mso-bookmark:_Hlk526346232'><span lang=EN-US style='font-size:11.0pt;
218
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'>INTELLECTUAL PROPERTY RIGHTS</span></span><span
219
- style='mso-bookmark:_Hlk526346232'><span lang=EN-US style='font-size:11.0pt;
220
- mso-bidi-font-size:10.0pt;font-family:Symbol;mso-ansi-language:EN-US'><o:p></o:p></span></span></p>
221
-
222
- <p class=MsoNormal><span style='mso-bookmark:_Hlk526346232'><span lang=EN-US
223
- style='font-size:11.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'>ITU <a
224
- name=iitexteb>draws attention to the possibility that the practice or
225
- implementation of this Recommendation may involve the use of a claimed
226
- Intellectual Property Right. ITU takes no position concerning the evidence,
227
- validity or applicability of claimed Intellectual Property Rights, whether
228
- asserted by ITU members or others outside of the Recommendation development
229
- process.<o:p></o:p></a></span></span></p>
230
-
231
- {% if unpublished %}
232
- <p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;
233
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'>As of the date of approval
234
- of this Recommendation, ITU [had/had not] received notice of intellectual property,
235
- protected by patents, which may be required to implement this Recommendation.
236
- However, implementers are cautioned that this may not represent the latest
237
- information and are therefore strongly urged to consult the TSB patent database at
238
- <a href="http://www.itu.int/ITU-T/ipr/">http://www.itu.int/ITU-T/ipr/</a>.</span></p>
239
- {% else %}
240
- {% if ip_notice_received %}
241
- <p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;
242
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'>As of the date of approval
243
- of this Recommendation, ITU had received notice of intellectual property,
244
- protected by patents, which may be required to implement this Recommendation.
245
- However, implementers are cautioned that this may not represent the latest
246
- information and are therefore strongly urged to consult the TSB patent database at
247
- <a href="http://www.itu.int/ITU-T/ipr/">http://www.itu.int/ITU-T/ipr/</a>.</span></p>
248
- {% else %}
249
- <p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;
250
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'>As of the date of approval
251
- of this Recommendation, ITU had not received notice of intellectual property,
252
- protected by patents, which may be required to implement this Recommendation.
253
- However, implementers are cautioned that this may not represent the latest
254
- information and are therefore strongly urged to consult the TSB patent database at
255
- <a href="http://www.itu.int/ITU-T/ipr/">http://www.itu.int/ITU-T/ipr/</a>.</span></p>
256
- {% endif %}
257
- {% endif %}
258
-
259
- <p class=MsoNormal align=center style='text-align:center'><span
260
- style='mso-bookmark:_Hlk526346232'><span lang=EN-US style='font-size:11.0pt;
261
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></span></p>
262
-
263
- <p class=MsoNormal align=center style='text-align:center'><span
264
- style='mso-bookmark:_Hlk526346232'><span lang=EN-US style='font-size:11.0pt;
265
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></span></p>
266
-
267
- <p class=MsoNormal align=center style='text-align:center'><span
268
- style='mso-bookmark:_Hlk526346232'><span lang=EN-US style='font-size:11.0pt;
269
- mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></span></p>
270
-
271
- <p class=MsoNormal align=center style='text-align:center'><span
272
- style='mso-bookmark:_Hlk526346232'><span lang=EN-US style='font-size:11.0pt;
273
- mso-bidi-font-size:10.0pt;font-family:Symbol;mso-ascii-font-family:"Times New Roman";
274
- mso-hansi-font-family:"Times New Roman";mso-ansi-language:EN-US;mso-char-type:
275
- symbol;mso-symbol-font-family:Symbol'><span style='mso-char-type:symbol;
276
- mso-symbol-font-family:Symbol'>ã</span></span></span><span style='mso-bookmark:
277
- _Hlk526346232'><span lang=EN-US style='font-size:11.0pt;mso-bidi-font-size:
278
- 10.0pt;mso-ansi-language:EN-US'>&nbsp;ITU&nbsp;<a name=iiannee></a>2019<o:p></o:p></span></span></p>
279
-
280
- <p class=MsoNormal><span style='mso-bookmark:_Hlk526346232'><span lang=EN-US
281
- style='font-size:11.0pt;mso-bidi-font-size:10.0pt;mso-ansi-language:EN-US'>All
282
- rights reserved. No part of this publication may be reproduced, by any means
283
- whatsoever, without the prior written permission of ITU.<o:p></o:p></span></span></p>
128
+ <div id="legal"/>
129
+ <div id="license"/>
130
+ <div id="copyright"/>
284
131
 
285
132
  <b style='mso-bidi-font-weight:normal'><span lang=EN-US style='font-size:12.0pt;
286
133
  mso-bidi-font-size:10.0pt;font-family:"Times New Roman",serif;mso-fareast-font-family:
@@ -221,21 +221,7 @@
221
221
  none;border-bottom:solid windowtext 2.25pt;border-right:solid windowtext 2.25pt;
222
222
  mso-border-top-alt:solid windowtext 2.25pt;mso-border-left-alt:solid windowtext 2.25pt;
223
223
  padding:0cm 5.4pt 0cm 5.4pt;height:4.0cm;mso-height-rule:exactly'>
224
- <p class="MsoNormal" align="center" style='text-align:center'><b
225
- style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
226
- lang="EN-GB" style='font-size:16.0pt;mso-bidi-font-size:10.0pt'>CAUTION !<o:p></o:p></span></i></b></p>
227
- <p class="MsoNormal" align="center" style='margin-top:3.0pt;text-align:center'><span
228
- class="SpellE"><b style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:
229
- normal'><span lang="EN-GB" style='font-size:16.0pt;mso-bidi-font-size:10.0pt'>PREPUBLISHED</span></i></b></span><b
230
- style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
231
- lang="EN-GB" style='font-size:16.0pt;mso-bidi-font-size:10.0pt'><span
232
- style='mso-spacerun:yes'>  </span>{{ doctype | upcase }}<o:p></o:p></span></i></b></p>
233
- <p class="MsoNormal" style='tab-stops:right 17.0cm'><span lang="EN-GB">This
234
- prepublication is an unedited version of a recently approved {{doctype}}.
235
- It&#xA0;will be replaced by the published version after editing. Therefore,
236
- there will be differences between this prepublication and the published
237
- version.</span><span lang="EN-GB" style='font-size:9.0pt;mso-bidi-font-size:
238
- 10.0pt;font-family:"Arial",sans-serif;mso-bidi-font-family:"Times New Roman"'><o:p></o:p></span></p>
224
+ <div class="draft-warning"/>
239
225
  </td>
240
226
  </tr>
241
227
  {% else %}
@@ -15,12 +15,6 @@ module IsoDoc
15
15
  super
16
16
  end
17
17
 
18
- #def convert1(docxml, filename, dir)
19
- # FileUtils.cp html_doc_path('Logo_ITU.jpg'), "#{@localdir}/Logo_ITU.jpg"
20
- # @files_to_delete << "#{@localdir}/Logo_ITU.jpg"
21
- # super
22
- #end
23
-
24
18
  def default_fonts(options)
25
19
  {
26
20
  bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Open Sans",sans-serif'),
@@ -55,6 +49,7 @@ module IsoDoc
55
49
 
56
50
  def make_body3(body, docxml)
57
51
  body.div **{ class: "main-section" } do |div3|
52
+ boilerplate docxml, div3
58
53
  abstract docxml, div3
59
54
  preface docxml, div3
60
55
  middle docxml, div3
@@ -63,7 +58,26 @@ module IsoDoc
63
58
  end
64
59
  end
65
60
 
66
- include BaseConvert
61
+ def html_preface(docxml)
62
+ super
63
+ authority_cleanup(docxml)
64
+ docxml
65
+ end
66
+
67
+ def authority_cleanup(docxml)
68
+ dest = docxml.at("//div[@class = 'draft-warning']")
69
+ auth = docxml.at("//div[@id = 'draft-warning']")
70
+ auth&.xpath(".//h1 | .//h2")&.each { |h| h["class"] = "IntroTitle" }
71
+ dest and auth and dest.replace(auth.remove)
72
+ %w(copyright license legal).each do |t|
73
+ dest = docxml.at("//div[@id = '#{t}']")
74
+ auth = docxml.at("//div[@class = '#{t}']")
75
+ auth&.xpath(".//h1 | .//h2")&.each { |h| h["class"] = "IntroTitle" }
76
+ dest and auth and dest.replace(auth.remove)
77
+ end
78
+ end
79
+
80
+ include BaseConvert
67
81
  end
68
82
  end
69
83
  end
@@ -57,6 +57,7 @@ module IsoDoc
57
57
 
58
58
  def make_body3(body, docxml)
59
59
  body.div **{ class: "main-section" } do |div3|
60
+ boilerplate docxml, div3
60
61
  abstract docxml, div3
61
62
  preface docxml, div3
62
63
  middle docxml, div3
@@ -65,6 +66,25 @@ module IsoDoc
65
66
  end
66
67
  end
67
68
 
69
+ def html_preface(docxml)
70
+ super
71
+ authority_cleanup(docxml)
72
+ docxml
73
+ end
74
+
75
+ def authority_cleanup(docxml)
76
+ dest = docxml.at("//div[@class = 'draft-warning']")
77
+ auth = docxml.at("//div[@id = 'draft-warning']")
78
+ auth&.xpath(".//h1 | .//h2")&.each { |h| h["class"] = "IntroTitle" }
79
+ dest and auth and dest.replace(auth.remove)
80
+ %w(copyright license legal).each do |t|
81
+ dest = docxml.at("//div[@id = '#{t}']")
82
+ auth = docxml.at("//div[@class = '#{t}']")
83
+ auth&.xpath(".//h1 | .//h2")&.each { |h| h["class"] = "IntroTitle" }
84
+ dest and auth and dest.replace(auth.remove)
85
+ end
86
+ end
87
+
68
88
  include BaseConvert
69
89
  end
70
90
  end
@@ -26,6 +26,7 @@ module IsoDoc
26
26
  def make_body2(body, docxml)
27
27
  body.div **{ class: "WordSection2" } do |div2|
28
28
  info docxml, div2
29
+ boilerplate docxml, div2
29
30
  abstract docxml, div2
30
31
  keywords docxml, div2
31
32
  preface docxml, div2
@@ -70,7 +71,9 @@ module IsoDoc
70
71
  word_preface_cleanup(docxml)
71
72
  word_term_cleanup(docxml)
72
73
  word_history_cleanup(docxml)
74
+ authority_hdr_cleanup(docxml)
73
75
  super
76
+ authority_cleanup(docxml)
74
77
  docxml
75
78
  end
76
79
 
@@ -124,15 +127,6 @@ module IsoDoc
124
127
  end
125
128
  end
126
129
 
127
- #def convert1(docxml, filename, dir)
128
- #FileUtils.cp html_doc_path('itu-document-comb.png'),
129
- #File.join(@localdir, "itu-document-comb.png")
130
- #FileUtils.cp html_doc_path('logo.png'), File.join(@localdir, "logo.png")
131
- #@files_to_delete << File.join(@localdir, "itu-document-comb.png")
132
- #@files_to_delete << File.join(@localdir, "logo.png")
133
- #super
134
- #end
135
-
136
130
  def default_fonts(options)
137
131
  { bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' :
138
132
  '"Times New Roman",serif'),
@@ -161,16 +155,16 @@ module IsoDoc
161
155
  end
162
156
  end
163
157
 
164
- def toWord(result, filename, dir, header)
165
- result = populate_template(result, :word)
166
- result = from_xhtml(word_cleanup(to_xhtml(result)))
167
- Html2Doc.process(result, filename: filename, stylesheet: @wordstylesheet&.path,
168
- header_file: header&.path, dir: dir,
169
- asciimathdelims: [@openmathdelim, @closemathdelim],
170
- liststyles: { ul: @ulstyle, ol: @olstyle, steps: "l4" })
171
- header&.unlink
172
- @wordstylesheet&.unlink
173
- end
158
+ def toWord(result, filename, dir, header)
159
+ result = populate_template(result, :word)
160
+ result = from_xhtml(word_cleanup(to_xhtml(result)))
161
+ Html2Doc.process(result, filename: filename, stylesheet: @wordstylesheet&.path,
162
+ header_file: header&.path, dir: dir,
163
+ asciimathdelims: [@openmathdelim, @closemathdelim],
164
+ liststyles: { ul: @ulstyle, ol: @olstyle, steps: "l4" })
165
+ header&.unlink
166
+ @wordstylesheet&.unlink
167
+ end
174
168
 
175
169
  =begin
176
170
  def eref_parse(node, out)
@@ -189,15 +183,52 @@ module IsoDoc
189
183
  end
190
184
  =end
191
185
 
192
- def link_parse(node, out)
193
- out.a **attr_code(href: node["target"], title: node["alt"], class: "url") do |l|
194
- if node.text.empty?
195
- l << node["target"].sub(/^mailto:/, "")
196
- else
197
- node.children.each { |n| parse(n, l) }
186
+ def link_parse(node, out)
187
+ out.a **attr_code(href: node["target"], title: node["alt"], class: "url") do |l|
188
+ if node.text.empty?
189
+ l << node["target"].sub(/^mailto:/, "")
190
+ else
191
+ node.children.each { |n| parse(n, l) }
192
+ end
193
+ end
194
+ end
195
+
196
+ def authority_hdr_cleanup(docxml)
197
+ docxml&.xpath("//div[@id = 'draft-warning']").each do |d|
198
+ d.xpath(".//h1 | .//h2").each do |p|
199
+ p.name = "p"
200
+ p["class"] = "draftwarningHdr"
201
+ end
202
+ end
203
+ %w(copyright license legal).each do |t|
204
+ docxml&.xpath("//div[@class = '#{t}']").each do |d|
205
+ p = d&.at("./descendant::h1[2]") and
206
+ p.previous = "<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>"
207
+ d.xpath(".//h1 | .//h2").each do |p|
208
+ p.name = "p"
209
+ p["class"] = "boilerplateHdr"
210
+ end
211
+ end
212
+ end
213
+ end
214
+
215
+ def authority_cleanup(docxml)
216
+ dest = docxml.at("//div[@class = 'draft-warning']")
217
+ auth = docxml.at("//div[@id = 'draft-warning']")
218
+ dest and auth and dest.replace(auth.remove)
219
+ %w(copyright license legal).each do |t|
220
+ dest = docxml.at("//div[@id = '#{t}']")
221
+ auth = docxml.at("//div[@class = '#{t}']")
222
+ next unless auth && dest
223
+ t == "copyright" and p = auth&.at(".//p[@class = 'Normalaftertitle']") and
224
+ p["class"] = "boilerplateHdr"
225
+ auth&.xpath(".//p[not(@class) or @class = 'Normalaftertitle']")&.each do |p|
226
+ p["class"] = "boilerplate"
227
+ end
228
+ auth << "<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>" unless t == "copyright"
229
+ dest.replace(auth.remove)
198
230
  end
199
231
  end
200
- end
201
232
 
202
233
  include BaseConvert
203
234
  end
@@ -46,9 +46,8 @@ module IsoDoc
46
46
  end
47
47
 
48
48
  def initial_anchor_names(d)
49
- d.xpath("//xmlns:preface/child::*").each do |c|
50
- preface_names(c)
51
- end
49
+ d.xpath(ns("//boilerplate//clause")).each { |c| preface_names(c) }
50
+ d.xpath("//xmlns:preface/child::*").each { |c| preface_names(c) }
52
51
  @hierarchical_assets ?
53
52
  hierarchical_asset_names(d.xpath("//xmlns:preface/child::*"), "Preface") :
54
53
  sequential_asset_names(d.xpath("//xmlns:preface/child::*"))
@@ -83,7 +82,7 @@ module IsoDoc
83
82
  def sequential_figure_names(clause)
84
83
  c = IsoDoc::Function::XrefGen::Counter.new
85
84
  j = 0
86
- clause.xpath(ns(".//figure[not(@type = 'pseudocode')]")).each do |t|
85
+ clause.xpath(ns(".//figure | .//sourcecode[not(ancestor::example)]")).each do |t|
87
86
  if t.parent.name == "figure" then j += 1
88
87
  else
89
88
  j = 0
@@ -99,7 +98,7 @@ module IsoDoc
99
98
  def hierarchical_figure_names(clause, num)
100
99
  c = IsoDoc::Function::XrefGen::Counter.new
101
100
  j = 0
102
- clause.xpath(ns(".//figure[not(@type = 'pseudocode')]")).each do |t|
101
+ clause.xpath(ns(".//figure | .//sourcecode[not(ancestor::example)]")).each do |t|
103
102
  if t.parent.name == "figure" then j += 1
104
103
  else
105
104
  j = 0