isodoc 1.6.2 → 1.6.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +2 -12
  3. data/.hound.yml +3 -1
  4. data/.rubocop.yml +4 -6
  5. data/Rakefile +2 -2
  6. data/isodoc.gemspec +3 -2
  7. data/lib/isodoc-yaml/i18n-en.yaml +1 -0
  8. data/lib/isodoc-yaml/i18n-fr.yaml +1 -0
  9. data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
  10. data/lib/isodoc.rb +0 -2
  11. data/lib/isodoc/convert.rb +7 -1
  12. data/lib/isodoc/function/blocks.rb +5 -4
  13. data/lib/isodoc/function/cleanup.rb +52 -43
  14. data/lib/isodoc/function/inline.rb +7 -7
  15. data/lib/isodoc/function/references.rb +32 -51
  16. data/lib/isodoc/function/section.rb +28 -16
  17. data/lib/isodoc/function/table.rb +21 -22
  18. data/lib/isodoc/function/terms.rb +6 -7
  19. data/lib/isodoc/function/to_word_html.rb +6 -3
  20. data/lib/isodoc/function/utils.rb +181 -163
  21. data/lib/isodoc/gem_tasks.rb +8 -9
  22. data/lib/isodoc/headlesshtml_convert.rb +8 -7
  23. data/lib/isodoc/html_convert.rb +5 -1
  24. data/lib/isodoc/html_function/comments.rb +14 -12
  25. data/lib/isodoc/html_function/footnotes.rb +14 -7
  26. data/lib/isodoc/html_function/html.rb +30 -26
  27. data/lib/isodoc/html_function/postprocess.rb +191 -182
  28. data/lib/isodoc/html_function/sectionsplit.rb +230 -0
  29. data/lib/isodoc/metadata.rb +22 -20
  30. data/lib/isodoc/metadata_contributor.rb +31 -28
  31. data/lib/isodoc/pdf_convert.rb +11 -13
  32. data/lib/isodoc/presentation_function/bibdata.rb +61 -30
  33. data/lib/isodoc/presentation_function/inline.rb +34 -27
  34. data/lib/isodoc/presentation_function/section.rb +54 -19
  35. data/lib/isodoc/presentation_xml_convert.rb +2 -0
  36. data/lib/isodoc/sassc_importer.rb +1 -1
  37. data/lib/isodoc/version.rb +1 -1
  38. data/lib/isodoc/word_function/postprocess.rb +50 -36
  39. data/lib/isodoc/xref.rb +2 -0
  40. data/lib/isodoc/xref/xref_counter.rb +1 -2
  41. data/lib/isodoc/xref/xref_gen.rb +21 -14
  42. data/lib/isodoc/xref/xref_gen_seq.rb +60 -35
  43. data/lib/isodoc/xref/xref_sect_gen.rb +15 -15
  44. data/spec/assets/scripts_override.html +3 -0
  45. data/spec/isodoc/blocks_spec.rb +624 -997
  46. data/spec/isodoc/cleanup_spec.rb +40 -42
  47. data/spec/isodoc/i18n_spec.rb +694 -821
  48. data/spec/isodoc/inline_spec.rb +482 -328
  49. data/spec/isodoc/metadata_spec.rb +384 -379
  50. data/spec/isodoc/postproc_spec.rb +163 -55
  51. data/spec/isodoc/presentation_xml_spec.rb +355 -278
  52. data/spec/isodoc/ref_spec.rb +5 -5
  53. data/spec/isodoc/section_spec.rb +216 -199
  54. data/spec/isodoc/sectionsplit_spec.rb +190 -0
  55. data/spec/isodoc/table_spec.rb +41 -42
  56. data/spec/isodoc/terms_spec.rb +84 -84
  57. data/spec/isodoc/xref_spec.rb +974 -932
  58. metadata +22 -5
@@ -1058,49 +1058,47 @@ RSpec.describe IsoDoc do
1058
1058
  c = IsoDoc::HtmlConvert.new({ i18nyaml: "spec/assets/i18n.yaml" })
1059
1059
  c.i18n_init("en", "Latn")
1060
1060
  expect(xmlpp(c.textcleanup(<<~"INPUT").to_s)).to be_equivalent_to xmlpp(<<~"OUTPUT")
1061
- #{HTML_HDR}
1062
- <p class="zzSTDTitle1"/>
1063
- <div id="_terms_and_definitions"><h1>1.&#160; Terms and Definitions</h1><p>For the purposes of this document,
1064
- the following terms and definitions apply.</p>
1065
- <p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
1066
- #{' '}
1067
- <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">&lt;rice&gt; rice retaining its husk after threshing</p>
1068
- <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example"><p class="example-title">EXAMPLE 1</p>
1069
- <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
1070
- <ul>
1071
- <li>A</li>
1072
- </ul>
1061
+ #{HTML_HDR}
1062
+ <p class="zzSTDTitle1"/>
1063
+ <div id="_terms_and_definitions"><h1>1.&#160; Terms and Definitions</h1><p>For the purposes of this document,
1064
+ the following terms and definitions apply.</p>
1065
+ <p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
1066
+ <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">&lt;rice&gt; rice retaining its husk after threshing</p>
1067
+ <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example"><p class="example-title">EXAMPLE 1</p>
1068
+ <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
1069
+ <ul>
1070
+ <li>A</li>
1071
+ </ul>
1072
+ </div>
1073
+ <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
1074
+ <ul>
1075
+ <li>A</li>
1076
+ </ul>
1077
+ </div>
1078
+ <p>[TERMREF]
1079
+ <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
1080
+ [MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
1081
+ [/TERMREF]</p>
1082
+ <p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
1083
+ <p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION] [/TERMREF]</p>
1084
+ <p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
1085
+ <p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
1086
+ <p class="AltTerms" style="text-align:left;">rough rice</p>
1087
+ <p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
1088
+ <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
1089
+ <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
1090
+ <ul>
1091
+ <li>A</li>
1092
+ </ul>
1093
+ </div>
1094
+ <div class="Note"><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
1095
+ <div class="Note"><p>Note 2 to entry: <ul><li>A</li></ul><p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></p></div>
1096
+ <p>[TERMREF]
1097
+ <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
1098
+ [/TERMREF]</p></div>
1073
1099
  </div>
1074
- <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
1075
- <ul>
1076
- <li>A</li>
1077
- </ul>
1078
- </div>
1079
- #{' '}
1080
- <p>[TERMREF]
1081
- <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
1082
- [MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
1083
- [/TERMREF]</p>
1084
- <p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
1085
- <p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION] [/TERMREF]</p>
1086
- <p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
1087
- <p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
1088
- <p class="AltTerms" style="text-align:left;">rough rice</p>
1089
- <p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
1090
- <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
1091
- <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
1092
- <ul>
1093
- <li>A</li>
1094
- </ul>
1095
- </div>
1096
- <div class="Note"><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
1097
- <div class="Note"><p>Note 2 to entry: <ul><li>A</li></ul><p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></p></div>
1098
- <p>[TERMREF]
1099
- <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
1100
- [/TERMREF]</p></div>
1101
- </div>
1102
- </body>
1103
- </html>
1100
+ </body>
1101
+ </html>
1104
1102
  INPUT
1105
1103
  <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
1106
1104
  <head/>
@@ -68,162 +68,139 @@ RSpec.describe IsoDoc do
68
68
  INPUT
69
69
 
70
70
  presxml = <<~"PRESXML"
71
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
72
- <bibdata>
73
- <language current="true">en</language>
74
- </bibdata>
75
- <preface>
76
- <foreword obligation='informative'>
77
- <title>Foreword</title>
78
- <p id='A'>See <xref target='M'>Clause 5</xref></p>
79
- </foreword>
80
- <introduction id='B' obligation='informative'>
81
- <title>Introduction</title>
82
- <clause id='C' inline-header='false' obligation='informative'>
83
- <title depth='2'>Introduction Subsection</title>
84
- </clause>
85
- </introduction>
86
- </preface>
87
- <sections>
88
- <clause id='D' obligation='normative' type="scope">
89
- <title depth='1'>1.<tab/>Scope</title>#{' '}
90
- <p id='E'>Text</p>
91
- </clause>
92
- <clause id='H' obligation='normative'>
93
- <title depth='1'>3.<tab/>Terms, definitions, symbols and abbreviated terms</title>
94
- <terms id='I' obligation='normative'>
95
- <title depth='2'>3.1.<tab/>Normal Terms</title>
96
- <term id='J'>
97
- <name>3.1.1.</name>
98
- <preferred>Term2</preferred>
99
- </term>
100
- </terms>
101
- <definitions id='K'>
102
- <title>3.2.</title>
103
- <dl>
104
- <dt>Symbol</dt>
105
- <dd>Definition</dd>
106
- </dl>
107
- </definitions>
108
- </clause>
109
- <definitions id='L'>
110
- <title>4.</title>
111
- <dl>
112
- <dt>Symbol</dt>
113
- <dd>Definition</dd>
114
- </dl>
115
- </definitions>
116
- <clause id='M' inline-header='false' obligation='normative'>
117
- <title depth='1'>5.<tab/>Clause 4</title>
118
- <clause id='N' inline-header='false' obligation='normative'>
119
- <title depth='2'>5.1.<tab/>Introduction</title>
120
- </clause>
121
- <clause id='O' inline-header='false' obligation='normative'>
122
- <title depth='2'>5.2.<tab/>Clause 4.2</title>
123
- </clause>
124
- </clause>
125
- </sections>
126
- <annex id='P' inline-header='false' obligation='normative'>
127
- <title>
128
- <strong>Annex A</strong>
129
- <br/>
130
- (normative)
131
- <br/>
132
- <br/>
133
- <strong>Annex</strong>
134
- </title>
135
- <clause id='Q' inline-header='false' obligation='normative'>
136
- <title depth='2'>A.1.<tab/>Annex A.1</title>
137
- <clause id='Q1' inline-header='false' obligation='normative'>
138
- <title depth='3'>A.1.1.<tab/>Annex A.1a</title>
139
- </clause>
140
- </clause>
141
- </annex>
142
- <bibliography>
143
- <references id='R' obligation='informative' normative='true'>
144
- <title depth='1'>2.<tab/>Normative References</title>
145
- </references>
146
- <clause id='S' obligation='informative'>
147
- <title depth="1">Bibliography</title>
148
- <references id='T' obligation='informative' normative='false'>
149
- <title depth="2">Bibliography Subsection</title>
150
- </references>
151
- </clause>
152
- </bibliography>
153
- </iso-standard>
71
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
72
+ <bibdata>
73
+ <language current="true">en</language>
74
+ </bibdata>
75
+ <preface>
76
+ <foreword obligation="informative" displayorder="1">
77
+ <title>Foreword</title>
78
+ <p id="A">See <xref target="M">Clause 5</xref></p>
79
+ </foreword>
80
+ <introduction id="B" obligation="informative" displayorder="2"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
81
+ <title depth="2">Introduction Subsection</title>
82
+ </clause>
83
+ </introduction></preface><sections>
84
+ <clause id="D" obligation="normative" type="scope" displayorder="3">
85
+ <title depth="1">1.<tab/>Scope</title>
86
+ <p id="E">Text</p>
87
+ </clause>
88
+ <clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
89
+ <title depth="2">3.1.<tab/>Normal Terms</title>
90
+ <term id="J"><name>3.1.1.</name>
91
+ <preferred>Term2</preferred>
92
+ </term>
93
+ </terms>
94
+ <definitions id="K"><title>3.2.</title>
95
+ <dl>
96
+ <dt>Symbol</dt>
97
+ <dd>Definition</dd>
98
+ </dl>
99
+ </definitions>
100
+ </clause>
101
+ <definitions id="L" displayorder="6"><title>4.</title>
102
+ <dl>
103
+ <dt>Symbol</dt>
104
+ <dd>Definition</dd>
105
+ </dl>
106
+ </definitions>
107
+ <clause id="M" inline-header="false" obligation="normative" displayorder="7"><title depth="1">5.<tab/>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
108
+ <title depth="2">5.1.<tab/>Introduction</title>
109
+ </clause>
110
+ <clause id="O" inline-header="false" obligation="normative">
111
+ <title depth="2">5.2.<tab/>Clause 4.2</title>
112
+ </clause></clause>
113
+ </sections><annex id="P" inline-header="false" obligation="normative" displayorder="8">
114
+ <title><strong>Annex A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
115
+ <clause id="Q" inline-header="false" obligation="normative">
116
+ <title depth="2">A.1.<tab/>Annex A.1</title>
117
+ <clause id="Q1" inline-header="false" obligation="normative">
118
+ <title depth="3">A.1.1.<tab/>Annex A.1a</title>
119
+ </clause>
120
+ </clause>
121
+ </annex><bibliography><references id="R" obligation="informative" normative="true" displayorder="4">
122
+ <title depth="1">2.<tab/>Normative References</title>
123
+ </references><clause id="S" obligation="informative" displayorder="9">
124
+ <title depth="1">Bibliography</title>
125
+ <references id="T" obligation="informative" normative="false">
126
+ <title depth="2">Bibliography Subsection</title>
127
+ </references>
128
+ </clause>
129
+ </bibliography>
130
+ </iso-standard>
154
131
  PRESXML
155
132
 
156
133
  output = <<~"OUTPUT"
157
- #{HTML_HDR}
158
- <br/>
159
- <div>
160
- <h1 class="ForewordTitle">Foreword</h1>
161
- <p id='A'>
162
- See
163
- <a href='#M'>Clause 5</a>
164
- </p>
165
- </div>
166
- <br/>
167
- <div class="Section3" id="B">
168
- <h1 class="IntroTitle">Introduction</h1>
169
- <div id="C">
170
- <h2>Introduction Subsection</h2>
171
- </div>
172
- </div>
173
- <p class="zzSTDTitle1"/>
174
- <div id="D">
175
- <h1>1.&#160; Scope</h1>
176
- <p id="E">Text</p>
177
- </div>
178
- <div>
179
- <h1>2.&#160; Normative References</h1>
180
- </div>
181
- <div id="H"><h1>3.&#160; Terms, definitions, symbols and abbreviated terms</h1>
182
- <div id="I">
183
- <h2>3.1.&#160; Normal Terms</h2>
184
- <p class="TermNum" id="J">3.1.1.</p>
185
- <p class="Terms" style="text-align:left;">Term2</p>
186
- </div><div id="K"><h2>3.2.</h2>
187
- <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
188
- </div></div>
189
- <div id="L" class="Symbols">
190
- <h1>4.</h1>
191
- <dl>
192
- <dt>
193
- <p>Symbol</p>
194
- </dt>
195
- <dd>Definition</dd>
196
- </dl>
197
- </div>
198
- <div id="M">
199
- <h1>5.&#160; Clause 4</h1>
200
- <div id="N">
201
- <h2>5.1.&#160; Introduction</h2>
202
- </div>
203
- <div id="O">
204
- <h2>5.2.&#160; Clause 4.2</h2>
205
- </div>
206
- </div>
207
- <br/>
208
- <div id="P" class="Section3">
209
- <h1 class="Annex"><b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
210
- <div id="Q">
211
- <h2>A.1.&#160; Annex A.1</h2>
212
- <div id="Q1">
213
- <h3>A.1.1.&#160; Annex A.1a</h3>
214
- </div>
215
- </div>
216
- </div>
217
- <br/>
218
- <div>
219
- <h1 class="Section3">Bibliography</h1>
220
- <div>
221
- <h2 class="Section3">Bibliography Subsection</h2>
222
- </div>
223
- </div>
224
- </div>
225
- </body>
226
- </html>
134
+ #{HTML_HDR}
135
+ <br/>
136
+ <div>
137
+ <h1 class="ForewordTitle">Foreword</h1>
138
+ <p id='A'>
139
+ See
140
+ <a href='#M'>Clause 5</a>
141
+ </p>
142
+ </div>
143
+ <br/>
144
+ <div class="Section3" id="B">
145
+ <h1 class="IntroTitle">Introduction</h1>
146
+ <div id="C">
147
+ <h2>Introduction Subsection</h2>
148
+ </div>
149
+ </div>
150
+ <p class="zzSTDTitle1"/>
151
+ <div id="D">
152
+ <h1>1.&#160; Scope</h1>
153
+ <p id="E">Text</p>
154
+ </div>
155
+ <div>
156
+ <h1>2.&#160; Normative References</h1>
157
+ </div>
158
+ <div id="H"><h1>3.&#160; Terms, definitions, symbols and abbreviated terms</h1>
159
+ <div id="I">
160
+ <h2>3.1.&#160; Normal Terms</h2>
161
+ <p class="TermNum" id="J">3.1.1.</p>
162
+ <p class="Terms" style="text-align:left;">Term2</p>
163
+ </div><div id="K"><h2>3.2.</h2>
164
+ <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
165
+ </div></div>
166
+ <div id="L" class="Symbols">
167
+ <h1>4.</h1>
168
+ <dl>
169
+ <dt>
170
+ <p>Symbol</p>
171
+ </dt>
172
+ <dd>Definition</dd>
173
+ </dl>
174
+ </div>
175
+ <div id="M">
176
+ <h1>5.&#160; Clause 4</h1>
177
+ <div id="N">
178
+ <h2>5.1.&#160; Introduction</h2>
179
+ </div>
180
+ <div id="O">
181
+ <h2>5.2.&#160; Clause 4.2</h2>
182
+ </div>
183
+ </div>
184
+ <br/>
185
+ <div id="P" class="Section3">
186
+ <h1 class="Annex"><b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
187
+ <div id="Q">
188
+ <h2>A.1.&#160; Annex A.1</h2>
189
+ <div id="Q1">
190
+ <h3>A.1.1.&#160; Annex A.1a</h3>
191
+ </div>
192
+ </div>
193
+ </div>
194
+ <br/>
195
+ <div>
196
+ <h1 class="Section3">Bibliography</h1>
197
+ <div>
198
+ <h2 class="Section3">Bibliography Subsection</h2>
199
+ </div>
200
+ </div>
201
+ </div>
202
+ </body>
203
+ </html>
227
204
  OUTPUT
228
205
  expect(xmlpp(IsoDoc::PresentationXMLConvert
229
206
  .new({}).convert("test", input, true)
@@ -298,90 +275,66 @@ RSpec.describe IsoDoc do
298
275
  </bibliography>
299
276
  </iso-standard>
300
277
  INPUT
301
- <?xml version='1.0'?>
302
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
303
- <bibdata>
304
- <language current="true">tlh</language>
305
- </bibdata>
306
- <preface>
307
- <foreword obligation='informative'>
308
- <title>Foreword</title>
309
- <p id='A'>See <xref target='M'>Clause 5</xref></p>
310
- </foreword>
311
- <introduction id='B' obligation='informative'>
312
- <title>Introduction</title>
313
- <clause id='C' inline-header='false' obligation='informative'>
314
- <title depth='2'>Introduction Subsection</title>
315
- </clause>
316
- </introduction>
317
- </preface>
318
- <sections>
319
- <clause id='D' obligation='normative' type="scope">
320
- <title depth='1'>1.<tab/>Scope</title>
321
- <p id='E'>Text</p>
322
- </clause>
323
- <clause id='H' obligation='normative'>
324
- <title depth='1'>3.<tab/>Terms, definitions, symbols and abbreviated terms</title>
325
- <terms id='I' obligation='normative'>
326
- <title depth='2'>3.1.<tab/>Normal Terms</title>
327
- <term id='J'>
328
- <name>3.1.1.</name>
329
- <preferred>Term2</preferred>
330
- </term>
331
- </terms>
332
- <definitions id='K'>
333
- <title>3.2.</title>
334
- <dl>
335
- <dt>Symbol</dt>
336
- <dd>Definition</dd>
337
- </dl>
338
- </definitions>
339
- </clause>
340
- <definitions id='L'>
341
- <title>4.</title>
342
- <dl>
343
- <dt>Symbol</dt>
344
- <dd>Definition</dd>
345
- </dl>
346
- </definitions>
347
- <clause id='M' inline-header='false' obligation='normative'>
348
- <title depth='1'>5.<tab/>Clause 4</title>
349
- <clause id='N' inline-header='false' obligation='normative'>
350
- <title depth='2'>5.1.<tab/>Introduction</title>
351
- </clause>
352
- <clause id='O' inline-header='false' obligation='normative'>
353
- <title depth='2'>5.2.<tab/>Clause 4.2</title>
354
- </clause>
355
- </clause>
356
- </sections>
357
- <annex id='P' inline-header='false' obligation='normative'>
358
- <title>
359
- <strong>Annex A</strong>
360
- <br/>
361
- (normative)
362
- <br/>
363
- <br/>
364
- <strong>Annex</strong>
365
- </title>
366
- <clause id='Q' inline-header='false' obligation='normative'>
367
- <title depth='2'>A.1.<tab/>Annex A.1</title>
368
- <clause id='Q1' inline-header='false' obligation='normative'>
369
- <title depth='3'>A.1.1.<tab/>Annex A.1a</title>
370
- </clause>
371
- </clause>
372
- </annex>
373
- <bibliography>
374
- <references id='R' obligation='informative' normative='true'>
375
- <title depth='1'>2.<tab/>Normative References</title>
376
- </references>
377
- <clause id='S' obligation='informative'>
378
- <title depth="1">Bibliography</title>
379
- <references id='T' obligation='informative' normative='false'>
380
- <title depth="2">Bibliography Subsection</title>
381
- </references>
382
- </clause>
383
- </bibliography>
384
- </iso-standard>
278
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
279
+ <bibdata>
280
+ <language current="true">tlh</language>
281
+ </bibdata>
282
+ <preface>
283
+ <foreword obligation="informative" displayorder="1">
284
+ <title>Foreword</title>
285
+ <p id="A">See <xref target="M">Clause 5</xref></p>
286
+ </foreword>
287
+ <introduction id="B" obligation="informative" displayorder="2"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
288
+ <title depth="2">Introduction Subsection</title>
289
+ </clause>
290
+ </introduction></preface><sections>
291
+ <clause id="D" obligation="normative" type="scope" displayorder="3">
292
+ <title depth="1">1.<tab/>Scope</title>
293
+ <p id="E">Text</p>
294
+ </clause>
295
+ <clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
296
+ <title depth="2">3.1.<tab/>Normal Terms</title>
297
+ <term id="J"><name>3.1.1.</name>
298
+ <preferred>Term2</preferred>
299
+ </term>
300
+ </terms>
301
+ <definitions id="K"><title>3.2.</title>
302
+ <dl>
303
+ <dt>Symbol</dt>
304
+ <dd>Definition</dd>
305
+ </dl>
306
+ </definitions>
307
+ </clause>
308
+ <definitions id="L" displayorder="6"><title>4.</title>
309
+ <dl>
310
+ <dt>Symbol</dt>
311
+ <dd>Definition</dd>
312
+ </dl>
313
+ </definitions>
314
+ <clause id="M" inline-header="false" obligation="normative" displayorder="7"><title depth="1">5.<tab/>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
315
+ <title depth="2">5.1.<tab/>Introduction</title>
316
+ </clause>
317
+ <clause id="O" inline-header="false" obligation="normative">
318
+ <title depth="2">5.2.<tab/>Clause 4.2</title>
319
+ </clause></clause>
320
+ </sections><annex id="P" inline-header="false" obligation="normative" displayorder="8">
321
+ <title><strong>Annex A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
322
+ <clause id="Q" inline-header="false" obligation="normative">
323
+ <title depth="2">A.1.<tab/>Annex A.1</title>
324
+ <clause id="Q1" inline-header="false" obligation="normative">
325
+ <title depth="3">A.1.1.<tab/>Annex A.1a</title>
326
+ </clause>
327
+ </clause>
328
+ </annex><bibliography><references id="R" obligation="informative" normative="true" displayorder="4">
329
+ <title depth="1">2.<tab/>Normative References</title>
330
+ </references><clause id="S" obligation="informative" displayorder="9">
331
+ <title depth="1">Bibliography</title>
332
+ <references id="T" obligation="informative" normative="false">
333
+ <title depth="2">Bibliography Subsection</title>
334
+ </references>
335
+ </clause>
336
+ </bibliography>
337
+ </iso-standard>
385
338
  OUTPUT
386
339
  end
387
340
 
@@ -452,162 +405,139 @@ RSpec.describe IsoDoc do
452
405
  INPUT
453
406
 
454
407
  presxml = <<~"PRESXML"
455
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
456
- <bibdata>
457
- <language current="true">fr</language>
458
- </bibdata>
459
- <preface>
460
- <foreword obligation='informative'>
461
- <title>Foreword</title>
462
- <p id='A'>See <xref target='M'>Article 5</xref></p>
463
- </foreword>
464
- <introduction id='B' obligation='informative'>
465
- <title>Introduction</title>
466
- <clause id='C' inline-header='false' obligation='informative'>
467
- <title depth='2'>Introduction Subsection</title>
468
- </clause>
469
- </introduction>
470
- </preface>
471
- <sections>
472
- <clause id='D' obligation='normative' type="scope">
473
- <title depth='1'>1.<tab/>Scope</title>
474
- <p id='E'>Text</p>
475
- </clause>
476
- <clause id='H' obligation='normative'>
477
- <title depth='1'>3.<tab/>Terms, definitions, symbols and abbreviated terms</title>
478
- <terms id='I' obligation='normative'>
479
- <title depth='2'>3.1.<tab/>Normal Terms</title>
480
- <term id='J'>
481
- <name>3.1.1.</name>
482
- <preferred>Term2</preferred>
483
- </term>
484
- </terms>
485
- <definitions id='K'>
486
- <title>3.2.</title>
487
- <dl>
488
- <dt>Symbol</dt>
489
- <dd>Definition</dd>
490
- </dl>
491
- </definitions>
492
- </clause>
493
- <definitions id='L'>
494
- <title>4.</title>
495
- <dl>
496
- <dt>Symbol</dt>
497
- <dd>Definition</dd>
498
- </dl>
499
- </definitions>
500
- <clause id='M' inline-header='false' obligation='normative'>
501
- <title depth='1'>5.<tab/>Clause 4</title>
502
- <clause id='N' inline-header='false' obligation='normative'>
503
- <title depth='2'>5.1.<tab/>Introduction</title>
504
- </clause>
505
- <clause id='O' inline-header='false' obligation='normative'>
506
- <title depth='2'>5.2.<tab/>Clause 4.2</title>
507
- </clause>
508
- </clause>
509
- </sections>
510
- <annex id='P' inline-header='false' obligation='normative'>
511
- <title>
512
- <strong>Annexe A</strong>
513
- <br/>
514
- (normative)
515
- <br/>
516
- <br/>
517
- <strong>Annex</strong>
518
- </title>
519
- <clause id='Q' inline-header='false' obligation='normative'>
520
- <title depth='2'>A.1.<tab/>Annex A.1</title>
521
- <clause id='Q1' inline-header='false' obligation='normative'>
522
- <title depth='3'>A.1.1.<tab/>Annex A.1a</title>
523
- </clause>
524
- </clause>
525
- </annex>
526
- <bibliography>
527
- <references id='R' obligation='informative' normative='true'>
528
- <title depth='1'>2.<tab/>Normative References</title>
529
- </references>
530
- <clause id='S' obligation='informative'>
531
- <title depth="1">Bibliographie</title>
532
- <references id='T' obligation='informative' normative='false'>
533
- <title depth="2">Bibliography Subsection</title>
534
- </references>
535
- </clause>
536
- </bibliography>
537
- </iso-standard>
408
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
409
+ <bibdata>
410
+ <language current="true">fr</language>
411
+ </bibdata>
412
+ <preface>
413
+ <foreword obligation="informative" displayorder="1">
414
+ <title>Foreword</title>
415
+ <p id="A">See <xref target="M">Article 5</xref></p>
416
+ </foreword>
417
+ <introduction id="B" obligation="informative" displayorder="2"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
418
+ <title depth="2">Introduction Subsection</title>
419
+ </clause>
420
+ </introduction></preface><sections>
421
+ <clause id="D" obligation="normative" type="scope" displayorder="3">
422
+ <title depth="1">1.<tab/>Scope</title>
423
+ <p id="E">Text</p>
424
+ </clause>
425
+ <clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
426
+ <title depth="2">3.1.<tab/>Normal Terms</title>
427
+ <term id="J"><name>3.1.1.</name>
428
+ <preferred>Term2</preferred>
429
+ </term>
430
+ </terms>
431
+ <definitions id="K"><title>3.2.</title>
432
+ <dl>
433
+ <dt>Symbol</dt>
434
+ <dd>Definition</dd>
435
+ </dl>
436
+ </definitions>
437
+ </clause>
438
+ <definitions id="L" displayorder="6"><title>4.</title>
439
+ <dl>
440
+ <dt>Symbol</dt>
441
+ <dd>Definition</dd>
442
+ </dl>
443
+ </definitions>
444
+ <clause id="M" inline-header="false" obligation="normative" displayorder="7"><title depth="1">5.<tab/>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
445
+ <title depth="2">5.1.<tab/>Introduction</title>
446
+ </clause>
447
+ <clause id="O" inline-header="false" obligation="normative">
448
+ <title depth="2">5.2.<tab/>Clause 4.2</title>
449
+ </clause></clause>
450
+ </sections><annex id="P" inline-header="false" obligation="normative" displayorder="8">
451
+ <title><strong>Annexe A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
452
+ <clause id="Q" inline-header="false" obligation="normative">
453
+ <title depth="2">A.1.<tab/>Annex A.1</title>
454
+ <clause id="Q1" inline-header="false" obligation="normative">
455
+ <title depth="3">A.1.1.<tab/>Annex A.1a</title>
456
+ </clause>
457
+ </clause>
458
+ </annex><bibliography><references id="R" obligation="informative" normative="true" displayorder="4">
459
+ <title depth="1">2.<tab/>Normative References</title>
460
+ </references><clause id="S" obligation="informative" displayorder="9">
461
+ <title depth="1">Bibliographie</title>
462
+ <references id="T" obligation="informative" normative="false">
463
+ <title depth="2">Bibliography Subsection</title>
464
+ </references>
465
+ </clause>
466
+ </bibliography>
467
+ </iso-standard>
538
468
  PRESXML
539
469
 
540
470
  output = <<~"OUTPUT"
541
- #{HTML_HDR.gsub(/ lang="en">/, ' lang="fr">')}
542
- <br/>
543
- <div>
544
- <h1 class="ForewordTitle">Foreword</h1>
545
- <p id='A'>
546
- See
547
- <a href='#M'>Article 5</a>
548
- </p>
549
- </div>
550
- <br/>
551
- <div class="Section3" id="B">
552
- <h1 class="IntroTitle">Introduction</h1>
553
- <div id="C">
554
- <h2>Introduction Subsection</h2>
555
- </div>
556
- </div>
557
- <p class="zzSTDTitle1"/>
558
- <div id="D">
559
- <h1>1.&#160; Scope</h1>
560
- <p id="E">Text</p>
561
- </div>
562
- <div>
563
- <h1>2.&#160; Normative References</h1>
564
- </div>
565
- <div id="H"><h1>3.&#160; Terms, definitions, symbols and abbreviated terms</h1>
566
- <div id="I">
567
- <h2>3.1.&#160; Normal Terms</h2>
568
- <p class="TermNum" id="J">3.1.1.</p>
569
- <p class="Terms" style="text-align:left;">Term2</p>
570
- </div><div id="K"><h2>3.2.</h2>
571
- <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
572
- </div></div>
573
- <div id="L" class="Symbols">
574
- <h1>4.</h1>
575
- <dl>
576
- <dt>
577
- <p>Symbol</p>
578
- </dt>
579
- <dd>Definition</dd>
580
- </dl>
581
- </div>
582
- <div id="M">
583
- <h1>5.&#160; Clause 4</h1>
584
- <div id="N">
585
- <h2>5.1.&#160; Introduction</h2>
586
- </div>
587
- <div id="O">
588
- <h2>5.2.&#160; Clause 4.2</h2>
589
- </div>
590
- </div>
591
- <br/>
592
- <div id="P" class="Section3">
593
- <h1 class="Annex"><b>Annexe A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
594
- <div id="Q">
595
- <h2>A.1.&#160; Annex A.1</h2>
596
- <div id="Q1">
597
- <h3>A.1.1.&#160; Annex A.1a</h3>
598
- </div>
599
- </div>
600
- </div>
601
- <br/>
602
- <div>
603
- <h1 class="Section3">Bibliographie</h1>
604
- <div>
605
- <h2 class="Section3">Bibliography Subsection</h2>
606
- </div>
607
- </div>
608
- </div>
609
- </body>
610
- </html>
471
+ #{HTML_HDR.gsub(/ lang="en">/, ' lang="fr">')}
472
+ <br/>
473
+ <div>
474
+ <h1 class="ForewordTitle">Foreword</h1>
475
+ <p id='A'>
476
+ See
477
+ <a href='#M'>Article 5</a>
478
+ </p>
479
+ </div>
480
+ <br/>
481
+ <div class="Section3" id="B">
482
+ <h1 class="IntroTitle">Introduction</h1>
483
+ <div id="C">
484
+ <h2>Introduction Subsection</h2>
485
+ </div>
486
+ </div>
487
+ <p class="zzSTDTitle1"/>
488
+ <div id="D">
489
+ <h1>1.&#160; Scope</h1>
490
+ <p id="E">Text</p>
491
+ </div>
492
+ <div>
493
+ <h1>2.&#160; Normative References</h1>
494
+ </div>
495
+ <div id="H"><h1>3.&#160; Terms, definitions, symbols and abbreviated terms</h1>
496
+ <div id="I">
497
+ <h2>3.1.&#160; Normal Terms</h2>
498
+ <p class="TermNum" id="J">3.1.1.</p>
499
+ <p class="Terms" style="text-align:left;">Term2</p>
500
+ </div><div id="K"><h2>3.2.</h2>
501
+ <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
502
+ </div></div>
503
+ <div id="L" class="Symbols">
504
+ <h1>4.</h1>
505
+ <dl>
506
+ <dt>
507
+ <p>Symbol</p>
508
+ </dt>
509
+ <dd>Definition</dd>
510
+ </dl>
511
+ </div>
512
+ <div id="M">
513
+ <h1>5.&#160; Clause 4</h1>
514
+ <div id="N">
515
+ <h2>5.1.&#160; Introduction</h2>
516
+ </div>
517
+ <div id="O">
518
+ <h2>5.2.&#160; Clause 4.2</h2>
519
+ </div>
520
+ </div>
521
+ <br/>
522
+ <div id="P" class="Section3">
523
+ <h1 class="Annex"><b>Annexe A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
524
+ <div id="Q">
525
+ <h2>A.1.&#160; Annex A.1</h2>
526
+ <div id="Q1">
527
+ <h3>A.1.1.&#160; Annex A.1a</h3>
528
+ </div>
529
+ </div>
530
+ </div>
531
+ <br/>
532
+ <div>
533
+ <h1 class="Section3">Bibliographie</h1>
534
+ <div>
535
+ <h2 class="Section3">Bibliography Subsection</h2>
536
+ </div>
537
+ </div>
538
+ </div>
539
+ </body>
540
+ </html>
611
541
  OUTPUT
612
542
  expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
613
543
  .convert("test", input, true)
@@ -619,251 +549,227 @@ RSpec.describe IsoDoc do
619
549
 
620
550
  it "processes Simplified Chinese" do
621
551
  input = <<~"INPUT"
622
- <iso-standard xmlns="http://riboseinc.com/isoxml">
623
- <bibdata>
624
- <language>zh</language>
625
- <script>Hans</script>
626
- </bibdata>
627
- <preface>
628
- <foreword obligation="informative">
629
- <title>Foreword</title>
630
- <p id="A">See <xref target="M"/></p>
631
- </foreword>
632
- <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
633
- <title>Introduction Subsection</title>
634
- </clause>
635
- </introduction></preface><sections>
636
- <clause id="D" obligation="normative" type="scope">
637
- <title>Scope</title>
638
- <p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref></p>
639
- </clause>
640
- <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
641
- <title>Normal Terms</title>
642
- <term id="J">
643
- <preferred>Term2</preferred>
644
- </term>
645
- </terms>
646
- <definitions id="K">
647
- <dl>
648
- <dt>Symbol</dt>
649
- <dd>Definition</dd>
650
- </dl>
651
- </definitions>
652
- </clause>
653
- <definitions id="L">
654
- <dl>
655
- <dt>Symbol</dt>
656
- <dd>Definition</dd>
657
- </dl>
658
- </definitions>
659
- <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
660
- <title>Introduction</title>
661
- </clause>
662
- <clause id="O" inline-header="false" obligation="normative">
663
- <title>Clause 4.2</title>
664
- </clause></clause>
665
- </sections><annex id="P" inline-header="false" obligation="normative">
666
- <title>Annex</title>
667
- <clause id="Q" inline-header="false" obligation="normative">
668
- <title>Annex A.1</title>
669
- <clause id="Q1" inline-header="false" obligation="normative">
670
- <title>Annex A.1a</title>
671
- </clause>
672
- </clause>
673
- </annex><bibliography><references id="R" obligation="informative" normative="true">
674
- <title>Normative References</title>
675
- <bibitem id="ISO712" type="standard">
676
- <title format="text/plain">Cereals and cereal products</title>
677
- <docidentifier>ISO 712</docidentifier>
678
- <contributor>
679
- <role type="publisher"/>
680
- <organization>
681
- <abbreviation>ISO</abbreviation>
682
- </organization>
683
- </contributor>
684
- </bibitem>
685
- </references><clause id="S" obligation="informative">
686
- <title>Bibliography</title>
687
- <references id="T" obligation="informative" normative="false">
688
- <title>Bibliography Subsection</title>
689
- </references>
690
- </clause>
691
- </bibliography>
692
- </iso-standard>
552
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
553
+ <bibdata>
554
+ <language>zh</language>
555
+ <script>Hans</script>
556
+ </bibdata>
557
+ <preface>
558
+ <foreword obligation="informative">
559
+ <title>Foreword</title>
560
+ <p id="A">See <xref target="M"/></p>
561
+ </foreword>
562
+ <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
563
+ <title>Introduction Subsection</title>
564
+ </clause>
565
+ </introduction></preface><sections>
566
+ <clause id="D" obligation="normative" type="scope">
567
+ <title>Scope</title>
568
+ <p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref></p>
569
+ </clause>
570
+ <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
571
+ <title>Normal Terms</title>
572
+ <term id="J">
573
+ <preferred>Term2</preferred>
574
+ </term>
575
+ </terms>
576
+ <definitions id="K">
577
+ <dl>
578
+ <dt>Symbol</dt>
579
+ <dd>Definition</dd>
580
+ </dl>
581
+ </definitions>
582
+ </clause>
583
+ <definitions id="L">
584
+ <dl>
585
+ <dt>Symbol</dt>
586
+ <dd>Definition</dd>
587
+ </dl>
588
+ </definitions>
589
+ <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
590
+ <title>Introduction</title>
591
+ </clause>
592
+ <clause id="O" inline-header="false" obligation="normative">
593
+ <title>Clause 4.2</title>
594
+ </clause></clause>
595
+ </sections><annex id="P" inline-header="false" obligation="normative">
596
+ <title>Annex</title>
597
+ <clause id="Q" inline-header="false" obligation="normative">
598
+ <title>Annex A.1</title>
599
+ <clause id="Q1" inline-header="false" obligation="normative">
600
+ <title>Annex A.1a</title>
601
+ </clause>
602
+ </clause>
603
+ </annex><bibliography><references id="R" obligation="informative" normative="true">
604
+ <title>Normative References</title>
605
+ <bibitem id="ISO712" type="standard">
606
+ <title format="text/plain">Cereals and cereal products</title>
607
+ <docidentifier>ISO 712</docidentifier>
608
+ <contributor>
609
+ <role type="publisher"/>
610
+ <organization>
611
+ <abbreviation>ISO</abbreviation>
612
+ </organization>
613
+ </contributor>
614
+ </bibitem>
615
+ </references><clause id="S" obligation="informative">
616
+ <title>Bibliography</title>
617
+ <references id="T" obligation="informative" normative="false">
618
+ <title>Bibliography Subsection</title>
619
+ </references>
620
+ </clause>
621
+ </bibliography>
622
+ </iso-standard>
693
623
  INPUT
694
624
 
695
625
  presxml = <<~"PRESXML"
696
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
697
- <bibdata>
698
- <language current="true">zh</language>
699
- <script current="true">Hans</script>
700
- </bibdata>
701
- <preface>
702
- <foreword obligation='informative'>
703
- <title>Foreword</title>
704
- <p id='A'>See <xref target='M'>&#x6761;5</xref></p>
705
- </foreword>
706
- <introduction id='B' obligation='informative'>
707
- <title>Introduction</title>
708
- <clause id='C' inline-header='false' obligation='informative'>
709
- <title depth='2'>Introduction Subsection</title>
710
- </clause>
711
- </introduction>
712
- </preface>
713
- <sections>
714
- <clause id='D' obligation='normative' type="scope">
715
- <title depth='1'>1.<tab/>Scope</title>
716
- <p id='E'>
717
- <eref type='inline' bibitemid='ISO712'><locality type='table'><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality>ISO 712&#x3001;&#x7B2C;1&#x2013;1&#x8868;</eref></p>
718
- </clause>
719
- <clause id='H' obligation='normative'>
720
- <title depth='1'>3.<tab/>Terms, definitions, symbols and abbreviated terms</title>
721
- <terms id='I' obligation='normative'>
722
- <title depth='2'>3.1.<tab/>Normal Terms</title>
723
- <term id='J'>
724
- <name>3.1.1.</name>
725
- <preferred>Term2</preferred>
726
- </term>
727
- </terms>
728
- <definitions id='K'>
729
- <title>3.2.</title>
730
- <dl>
731
- <dt>Symbol</dt>
732
- <dd>Definition</dd>
733
- </dl>
734
- </definitions>
735
- </clause>
736
- <definitions id='L'>
737
- <title>4.</title>
738
- <dl>
739
- <dt>Symbol</dt>
740
- <dd>Definition</dd>
741
- </dl>
742
- </definitions>
743
- <clause id='M' inline-header='false' obligation='normative'>
744
- <title depth='1'>5.<tab/>Clause 4</title>
745
- <clause id='N' inline-header='false' obligation='normative'>
746
- <title depth='2'>5.1.<tab/>Introduction</title>
747
- </clause>
748
- <clause id='O' inline-header='false' obligation='normative'>
749
- <title depth='2'>5.2.<tab/>Clause 4.2</title>
750
- </clause>
751
- </clause>
752
- </sections>
753
- <annex id='P' inline-header='false' obligation='normative'>
754
- <title>
755
- <strong>&#x9644;&#x4EF6;A</strong>
756
- <br/>
757
- &#xFF08;&#x89C4;&#x8303;&#x6027;&#x9644;&#x5F55;&#xFF09;
758
- <br/>
759
- <br/>
760
- <strong>Annex</strong>
761
- </title>
762
- <clause id='Q' inline-header='false' obligation='normative'>
763
- <title depth='2'>A.1.<tab/>Annex A.1</title>
764
- <clause id='Q1' inline-header='false' obligation='normative'>
765
- <title depth='3'>A.1.1.<tab/>Annex A.1a</title>
766
- </clause>
767
- </clause>
768
- </annex>
769
- <bibliography>
770
- <references id='R' obligation='informative' normative='true'>
771
- <title depth='1'>2.<tab/>Normative References</title>
772
- <bibitem id='ISO712' type='standard'>
773
- <title format='text/plain'>Cereals and cereal products</title>
774
- <docidentifier>ISO 712</docidentifier>
775
- <contributor>
776
- <role type='publisher'/>
777
- <organization>
778
- <abbreviation>ISO</abbreviation>
779
- </organization>
780
- </contributor>
781
- </bibitem>
782
- </references>
783
- <clause id='S' obligation='informative'>
784
- <title depth="1">Bibliography</title>
785
- <references id='T' obligation='informative' normative='false'>
786
- <title depth="2">Bibliography Subsection</title>
787
- </references>
788
- </clause>
789
- </bibliography>
790
- </iso-standard>
626
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
627
+ <bibdata>
628
+ <language current="true">zh</language>
629
+ <script current="true">Hans</script>
630
+ </bibdata>
631
+ <preface>
632
+ <foreword obligation="informative" displayorder="1">
633
+ <title>Foreword</title>
634
+ <p id="A">See <xref target="M">&#x6761;5</xref></p>
635
+ </foreword>
636
+ <introduction id="B" obligation="informative" displayorder="2"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
637
+ <title depth="2">Introduction Subsection</title>
638
+ </clause>
639
+ </introduction></preface><sections>
640
+ <clause id="D" obligation="normative" type="scope" displayorder="3">
641
+ <title depth="1">1.<tab/>Scope</title>
642
+ <p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality>ISO 712&#x3001;&#x7B2C;1&#x2013;1&#x8868;</eref></p>
643
+ </clause>
644
+ <clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
645
+ <title depth="2">3.1.<tab/>Normal Terms</title>
646
+ <term id="J"><name>3.1.1.</name>
647
+ <preferred>Term2</preferred>
648
+ </term>
649
+ </terms>
650
+ <definitions id="K"><title>3.2.</title>
651
+ <dl>
652
+ <dt>Symbol</dt>
653
+ <dd>Definition</dd>
654
+ </dl>
655
+ </definitions>
656
+ </clause>
657
+ <definitions id="L" displayorder="6"><title>4.</title>
658
+ <dl>
659
+ <dt>Symbol</dt>
660
+ <dd>Definition</dd>
661
+ </dl>
662
+ </definitions>
663
+ <clause id="M" inline-header="false" obligation="normative" displayorder="7"><title depth="1">5.<tab/>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
664
+ <title depth="2">5.1.<tab/>Introduction</title>
665
+ </clause>
666
+ <clause id="O" inline-header="false" obligation="normative">
667
+ <title depth="2">5.2.<tab/>Clause 4.2</title>
668
+ </clause></clause>
669
+ </sections><annex id="P" inline-header="false" obligation="normative" displayorder="8">
670
+ <title><strong>&#x9644;&#x4EF6;A</strong><br/>&#xFF08;&#x89C4;&#x8303;&#x6027;&#x9644;&#x5F55;&#xFF09;<br/><br/><strong>Annex</strong></title>
671
+ <clause id="Q" inline-header="false" obligation="normative">
672
+ <title depth="2">A.1.<tab/>Annex A.1</title>
673
+ <clause id="Q1" inline-header="false" obligation="normative">
674
+ <title depth="3">A.1.1.<tab/>Annex A.1a</title>
675
+ </clause>
676
+ </clause>
677
+ </annex><bibliography><references id="R" obligation="informative" normative="true" displayorder="4">
678
+ <title depth="1">2.<tab/>Normative References</title>
679
+ <bibitem id="ISO712" type="standard">
680
+ <title format="text/plain">Cereals and cereal products</title>
681
+ <docidentifier>ISO 712</docidentifier>
682
+ <contributor>
683
+ <role type="publisher"/>
684
+ <organization>
685
+ <abbreviation>ISO</abbreviation>
686
+ </organization>
687
+ </contributor>
688
+ </bibitem>
689
+ </references><clause id="S" obligation="informative" displayorder="9">
690
+ <title depth="1">Bibliography</title>
691
+ <references id="T" obligation="informative" normative="false">
692
+ <title depth="2">Bibliography Subsection</title>
693
+ </references>
694
+ </clause>
695
+ </bibliography>
696
+ </iso-standard>
791
697
  PRESXML
792
698
 
793
699
  output = <<~"OUTPUT"
794
- #{HTML_HDR.gsub(/ lang="en">/, ' lang="zh">')}
795
- <br/>
796
- <div>
797
- <h1 class="ForewordTitle">Foreword</h1>
798
- <p id='A'>
799
- See
800
- <a href='#M'>&#26465;5</a>
801
- </p>
802
- </div>
803
- <br/>
804
- <div class="Section3" id="B">
805
- <h1 class="IntroTitle">Introduction</h1>
806
- <div id="C">
807
- <h2>Introduction Subsection</h2>
808
- </div>
809
- </div>
810
- <p class="zzSTDTitle1"/>
811
- <div id="D">
812
- <h1>1.&#12288;Scope</h1>
813
- <p id="E">
814
- <a href='#ISO712'>ISO 712&#12289;&#31532;1&#8211;1&#34920;</a>
815
- </p>
816
- </div>
817
- <div>
818
- <h1>2.&#12288;Normative References</h1>
819
- <p id="ISO712" class="NormRef">ISO 712, <i>Cereals and cereal products</i></p>
820
- </div>
821
- <div id="H"><h1>3.&#12288;Terms, definitions, symbols and abbreviated terms</h1>
822
- <div id="I">
823
- <h2>3.1.&#12288;Normal Terms</h2>
824
- <p class="TermNum" id="J">3.1.1.</p>
825
- <p class="Terms" style="text-align:left;">Term2</p>
826
- </div><div id="K"><h2>3.2.</h2>
827
- <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
828
- </div></div>
829
- <div id="L" class="Symbols">
830
- <h1>4.</h1>
831
- <dl>
832
- <dt>
833
- <p>Symbol</p>
834
- </dt>
835
- <dd>Definition</dd>
836
- </dl>
837
- </div>
838
- <div id="M">
839
- <h1>5.&#12288;Clause 4</h1>
840
- <div id="N">
841
- <h2>5.1.&#12288;Introduction</h2>
842
- </div>
843
- <div id="O">
844
- <h2>5.2.&#12288;Clause 4.2</h2>
845
- </div>
846
- </div>
847
- <br/>
848
- <div id="P" class="Section3">
849
- <h1 class="Annex"><b>&#38468;&#20214;A</b><br/>&#65288;&#35268;&#33539;&#24615;&#38468;&#24405;&#65289;<br/><br/><b>Annex</b></h1>
850
- <div id="Q">
851
- <h2>A.1.&#12288;Annex A.1</h2>
852
- <div id="Q1">
853
- <h3>A.1.1.&#12288;Annex A.1a</h3>
854
- </div>
855
- </div>
856
- </div>
857
- <br/>
858
- <div>
859
- <h1 class="Section3">Bibliography</h1>
860
- <div>
861
- <h2 class="Section3">Bibliography Subsection</h2>
862
- </div>
863
- </div>
864
- </div>
865
- </body>
866
- </html>
700
+ #{HTML_HDR.gsub(/ lang="en">/, ' lang="zh">')}
701
+ <br/>
702
+ <div>
703
+ <h1 class="ForewordTitle">Foreword</h1>
704
+ <p id='A'>
705
+ See
706
+ <a href='#M'>&#26465;5</a>
707
+ </p>
708
+ </div>
709
+ <br/>
710
+ <div class="Section3" id="B">
711
+ <h1 class="IntroTitle">Introduction</h1>
712
+ <div id="C">
713
+ <h2>Introduction Subsection</h2>
714
+ </div>
715
+ </div>
716
+ <p class="zzSTDTitle1"/>
717
+ <div id="D">
718
+ <h1>1.&#12288;Scope</h1>
719
+ <p id="E">
720
+ <a href='#ISO712'>ISO 712&#12289;&#31532;1&#8211;1&#34920;</a>
721
+ </p>
722
+ </div>
723
+ <div>
724
+ <h1>2.&#12288;Normative References</h1>
725
+ <p id="ISO712" class="NormRef">ISO 712, <i>Cereals and cereal products</i></p>
726
+ </div>
727
+ <div id="H"><h1>3.&#12288;Terms, definitions, symbols and abbreviated terms</h1>
728
+ <div id="I">
729
+ <h2>3.1.&#12288;Normal Terms</h2>
730
+ <p class="TermNum" id="J">3.1.1.</p>
731
+ <p class="Terms" style="text-align:left;">Term2</p>
732
+ </div><div id="K"><h2>3.2.</h2>
733
+ <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
734
+ </div></div>
735
+ <div id="L" class="Symbols">
736
+ <h1>4.</h1>
737
+ <dl>
738
+ <dt>
739
+ <p>Symbol</p>
740
+ </dt>
741
+ <dd>Definition</dd>
742
+ </dl>
743
+ </div>
744
+ <div id="M">
745
+ <h1>5.&#12288;Clause 4</h1>
746
+ <div id="N">
747
+ <h2>5.1.&#12288;Introduction</h2>
748
+ </div>
749
+ <div id="O">
750
+ <h2>5.2.&#12288;Clause 4.2</h2>
751
+ </div>
752
+ </div>
753
+ <br/>
754
+ <div id="P" class="Section3">
755
+ <h1 class="Annex"><b>&#38468;&#20214;A</b><br/>&#65288;&#35268;&#33539;&#24615;&#38468;&#24405;&#65289;<br/><br/><b>Annex</b></h1>
756
+ <div id="Q">
757
+ <h2>A.1.&#12288;Annex A.1</h2>
758
+ <div id="Q1">
759
+ <h3>A.1.1.&#12288;Annex A.1a</h3>
760
+ </div>
761
+ </div>
762
+ </div>
763
+ <br/>
764
+ <div>
765
+ <h1 class="Section3">Bibliography</h1>
766
+ <div>
767
+ <h2 class="Section3">Bibliography Subsection</h2>
768
+ </div>
769
+ </div>
770
+ </div>
771
+ </body>
772
+ </html>
867
773
  OUTPUT
868
774
  expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
869
775
  .convert("test", input, true)
@@ -876,204 +782,171 @@ RSpec.describe IsoDoc do
876
782
  it "processes i18n file" do
877
783
  mock_i18n
878
784
  input = <<~"INPUT"
879
- <iso-standard xmlns="http://riboseinc.com/isoxml">
880
- <bibdata>
881
- <language>eo</language>
882
- <script>Latn</script>
883
- <status>
884
- <stage>published</stage>
885
- <substage>withdrawn</substage>
886
- </status>
887
- <ext>
888
- <doctype>brochure</doctype>
889
- </ext>
890
- </bibdata>
891
- <preface>
892
- <foreword obligation="informative">
893
- <title>Foreword</title>
894
- <p id="A">See <xref target="M"/></p>
895
- <p id="A">See <xref target="tab"/></p>
896
- <table id="tab"/>
897
- </foreword>
898
- <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
899
- <title>Introduction Subsection</title>
900
- </clause>
901
- </introduction></preface><sections>
902
- <clause id="D" obligation="normative" type="scope">
903
- <title>Scope</title>
904
- <p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref></p>
905
- </clause>
906
- <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
907
- <title>Normal Terms</title>
908
- <term id="J">
909
- <preferred>Term2</preferred>
910
- </term>
911
- </terms>
912
- <definitions id="K">
913
- <dl>
914
- <dt>Symbol</dt>
915
- <dd>Definition</dd>
916
- </dl>
917
- </definitions>
918
- </clause>
919
- <definitions id="L">
920
- <dl>
921
- <dt>Symbol</dt>
922
- <dd>Definition</dd>
923
- </dl>
924
- </definitions>
925
- <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
926
- <title>Introduction</title>
927
- <note id="M-n1"/>
928
- </clause>
929
- <clause id="O" inline-header="false" obligation="normative">
930
- <title>Clause 4.2</title>
931
- </clause></clause>
932
- </sections><annex id="P" inline-header="false" obligation="normative">
933
- <title>Annex</title>
934
- <clause id="Q" inline-header="false" obligation="normative">
935
- <title>Annex A.1</title>
936
- <clause id="Q1" inline-header="false" obligation="normative">
937
- <title>Annex A.1a</title>
938
- </clause>
939
- </clause>
940
- </annex><bibliography><references id="R" obligation="informative" normative="true">
941
- <title>Normative References</title>
942
- <bibitem id="ISO712" type="standard">
943
- <title format="text/plain">Cereals and cereal products</title>
944
- <docidentifier>ISO 712</docidentifier>
945
- <contributor>
946
- <role type="publisher"/>
947
- <organization>
948
- <abbreviation>ISO</abbreviation>
949
- </organization>
950
- </contributor>
951
- </bibitem>
952
- </references><clause id="S" obligation="informative">
953
- <title>Bibliography</title>
954
- <references id="T" obligation="informative" normative="false">
955
- <title>Bibliography Subsection</title>
956
- </references>
957
- </clause>
958
- </bibliography>
959
- </iso-standard>
785
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
786
+ <bibdata>
787
+ <language>eo</language>
788
+ <script>Latn</script>
789
+ <status>
790
+ <stage>published</stage>
791
+ <substage>withdrawn</substage>
792
+ </status>
793
+ <ext>
794
+ <doctype>brochure</doctype>
795
+ </ext>
796
+ </bibdata>
797
+ <preface>
798
+ <foreword obligation="informative">
799
+ <title>Foreword</title>
800
+ <p id="A">See <xref target="M"/></p>
801
+ <p id="A">See <xref target="tab"/></p>
802
+ <table id="tab"/>
803
+ </foreword>
804
+ <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
805
+ <title>Introduction Subsection</title>
806
+ </clause>
807
+ </introduction></preface><sections>
808
+ <clause id="D" obligation="normative" type="scope">
809
+ <title>Scope</title>
810
+ <p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref></p>
811
+ </clause>
812
+ <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
813
+ <title>Normal Terms</title>
814
+ <term id="J">
815
+ <preferred>Term2</preferred>
816
+ </term>
817
+ </terms>
818
+ <definitions id="K">
819
+ <dl>
820
+ <dt>Symbol</dt>
821
+ <dd>Definition</dd>
822
+ </dl>
823
+ </definitions>
824
+ </clause>
825
+ <definitions id="L">
826
+ <dl>
827
+ <dt>Symbol</dt>
828
+ <dd>Definition</dd>
829
+ </dl>
830
+ </definitions>
831
+ <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
832
+ <title>Introduction</title>
833
+ <note id="M-n1"/>
834
+ </clause>
835
+ <clause id="O" inline-header="false" obligation="normative">
836
+ <title>Clause 4.2</title>
837
+ </clause></clause>
838
+ </sections><annex id="P" inline-header="false" obligation="normative">
839
+ <title>Annex</title>
840
+ <clause id="Q" inline-header="false" obligation="normative">
841
+ <title>Annex A.1</title>
842
+ <clause id="Q1" inline-header="false" obligation="normative">
843
+ <title>Annex A.1a</title>
844
+ </clause>
845
+ </clause>
846
+ </annex><bibliography><references id="R" obligation="informative" normative="true">
847
+ <title>Normative References</title>
848
+ <bibitem id="ISO712" type="standard">
849
+ <title format="text/plain">Cereals and cereal products</title>
850
+ <docidentifier>ISO 712</docidentifier>
851
+ <contributor>
852
+ <role type="publisher"/>
853
+ <organization>
854
+ <abbreviation>ISO</abbreviation>
855
+ </organization>
856
+ </contributor>
857
+ </bibitem>
858
+ </references><clause id="S" obligation="informative">
859
+ <title>Bibliography</title>
860
+ <references id="T" obligation="informative" normative="false">
861
+ <title>Bibliography Subsection</title>
862
+ </references>
863
+ </clause>
864
+ </bibliography>
865
+ </iso-standard>
960
866
  INPUT
961
867
 
962
868
  presxml = <<~OUTPUT
963
- <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
964
- <bibdata>
965
- <language current="true">eo</language>
966
- <script current="true">Latn</script>
967
- <status>
968
- <stage language=''>published</stage>
969
- <stage language='eo'>publikigita</stage>
970
- <substage language=''>withdrawn</substage>
971
- <substage language='eo'>fortirita</substage>
869
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
870
+ <bibdata>
871
+ <language current="true">eo</language>
872
+ <script current="true">Latn</script>
873
+ <status>
874
+ <stage language="">published</stage><stage language="eo">publikigita</stage>
875
+ <substage language="">withdrawn</substage><substage language="eo">fortirita</substage>
972
876
  </status>
973
877
  <ext>
974
- <doctype language=''>brochure</doctype>
975
- <doctype language='eo'>bro&#x15D;uro</doctype>
878
+ <doctype language="">brochure</doctype><doctype language="eo">bro&#x15D;uro</doctype>
976
879
  </ext>
977
- </bibdata>
978
- <localized-strings>
979
- <localized-string key='foreword' language='eo'>Anta&#x16D;parolo</localized-string>
980
- <localized-string key='introduction' language='eo'>Enkonduko</localized-string>
981
- <localized-string key='clause' language='eo'>kla&#x16D;zo</localized-string>
982
- <localized-string key='table' language='eo'>tabelo</localized-string>
983
- <localized-string key='source' language='eo'>SOURCE</localized-string>
984
- <localized-string key='modified' language='eo'>modified</localized-string>
985
- <localized-string key='scope' language='eo'>Amplekso</localized-string>
986
- <localized-string key='symbols' language='eo'>Simboloj kai mallongigitaj terminoj</localized-string>
987
- <localized-string key='annex' language='eo'>Aldono</localized-string>
988
- <localized-string key='normref' language='eo'>Normaj cita&#x135;oj</localized-string>
989
- <localized-string key='bibliography' language='eo'>Bibliografio</localized-string>
990
- <localized-string key='inform_annex' language='eo'>informa</localized-string>
991
- <localized-string key='all_parts' language='eo'>&#x109;iuj partoj</localized-string>
992
- <localized-string key='norm_annex' language='eo'>normative</localized-string>
993
- <localized-string key='note' language='eo'>NOTO</localized-string>
994
- <localized-string key='locality.table' language='eo'>Tabelo</localized-string>
995
- <localized-string key='doctype_dict.brochure' language='eo'>bro&#x15D;uro</localized-string>
996
- <localized-string key='doctype_dict.conference_proceedings' language='eo'>konferencaktoj</localized-string>
997
- <localized-string key='stage_dict.published' language='eo'>publikigita</localized-string>
998
- <localized-string key='substage_dict.withdrawn' language='eo'>fortirita</localized-string>
999
- <localized-string key='array.0' language='eo'>elem1</localized-string>
1000
- <localized-string key='array.1' language='eo'>elem2</localized-string>
1001
- <localized-string key='array.2.elem3' language='eo'>elem4</localized-string>
1002
- <localized-string key='array.2.elem5' language='eo'>elem6</localized-string>
1003
- <localized-string key='language' language='eo'>eo</localized-string>
1004
- <localized-string key='script' language='eo'>Latn</localized-string>
1005
- </localized-strings>
1006
- <preface>
1007
- <foreword obligation="informative">
1008
- <title>Foreword</title>
1009
- <p id='A'>See <xref target='M'>kla&#x16D;zo 5</xref></p>
1010
- <p id='A'>See <xref target='tab'>tabelo 1</xref></p>
1011
- <table id='tab'>
1012
- <name>Tabelo 1</name>
1013
- </table>
1014
- </foreword>
1015
- <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
1016
- <title depth="2">Introduction Subsection</title>
1017
- </clause>
1018
- </introduction></preface><sections>
1019
- <clause id="D" obligation="normative" type="scope">
1020
- <title depth="1">1.<tab/>Scope</title>
1021
- <p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality>ISO 712, Tabelo 1&#x2013;1</eref></p>
1022
- </clause>
1023
- <clause id="H" obligation="normative"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
1024
- <title depth="2">3.1.<tab/>Normal Terms</title>
1025
- <term id="J"><name>3.1.1.</name>
1026
- <preferred>Term2</preferred>
1027
- </term>
1028
- </terms>
1029
- <definitions id="K"><title>3.2.</title>
1030
- <dl>
1031
- <dt>Symbol</dt>
1032
- <dd>Definition</dd>
1033
- </dl>
1034
- </definitions>
1035
- </clause>
1036
- <definitions id="L"><title>4.</title>
1037
- <dl>
1038
- <dt>Symbol</dt>
1039
- <dd>Definition</dd>
1040
- </dl>
1041
- </definitions>
1042
- <clause id="M" inline-header="false" obligation="normative"><title depth="1">5.<tab/>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
1043
- <title depth="2">5.1.<tab/>Introduction</title>
1044
- <note id='M-n1'><name>NOTO </name></note>
1045
- </clause>
1046
- <clause id="O" inline-header="false" obligation="normative">
1047
- <title depth="2">5.2.<tab/>Clause 4.2</title>
1048
- </clause></clause>
1049
- </sections><annex id="P" inline-header="false" obligation="normative">
1050
- <title><strong>Aldono A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
1051
- <clause id="Q" inline-header="false" obligation="normative">
1052
- <title depth="2">A.1.<tab/>Annex A.1</title>
1053
- <clause id="Q1" inline-header="false" obligation="normative">
1054
- <title depth="3">A.1.1.<tab/>Annex A.1a</title>
1055
- </clause>
1056
- </clause>
1057
- </annex><bibliography><references id="R" obligation="informative" normative="true">
1058
- <title depth="1">2.<tab/>Normative References</title>
1059
- <bibitem id="ISO712" type="standard">
1060
- <title format="text/plain">Cereals and cereal products</title>
1061
- <docidentifier>ISO 712</docidentifier>
1062
- <contributor>
1063
- <role type="publisher"/>
1064
- <organization>
1065
- <abbreviation>ISO</abbreviation>
1066
- </organization>
1067
- </contributor>
1068
- </bibitem>
1069
- </references><clause id="S" obligation="informative">
1070
- <title depth="1">Bibliography</title>
1071
- <references id="T" obligation="informative" normative="false">
1072
- <title depth="2">Bibliography Subsection</title>
1073
- </references>
1074
- </clause>
1075
- </bibliography>
1076
- </iso-standard>
880
+ </bibdata><localized-strings><localized-string key="foreword" language="eo">Anta&#x16D;parolo</localized-string><localized-string key="introduction" language="eo">Enkonduko</localized-string><localized-string key="clause" language="eo">kla&#x16D;zo</localized-string><localized-string key="table" language="eo">tabelo</localized-string><localized-string key="source" language="eo">SOURCE</localized-string><localized-string key="modified" language="eo">modified</localized-string><localized-string key="scope" language="eo">Amplekso</localized-string><localized-string key="symbols" language="eo">Simboloj kai mallongigitaj terminoj</localized-string><localized-string key="annex" language="eo">Aldono</localized-string><localized-string key="normref" language="eo">Normaj cita&#x135;oj</localized-string><localized-string key="bibliography" language="eo">Bibliografio</localized-string><localized-string key="inform_annex" language="eo">informa</localized-string><localized-string key="all_parts" language="eo">&#x109;iuj partoj</localized-string><localized-string key="norm_annex" language="eo">normative</localized-string><localized-string key="note" language="eo">NOTO</localized-string><localized-string key="locality.table" language="eo">Tabelo</localized-string><localized-string key="doctype_dict.brochure" language="eo">bro&#x15D;uro</localized-string><localized-string key="doctype_dict.conference_proceedings" language="eo">konferencaktoj</localized-string><localized-string key="stage_dict.published" language="eo">publikigita</localized-string><localized-string key="substage_dict.withdrawn" language="eo">fortirita</localized-string><localized-string key="array.0" language="eo">elem1</localized-string><localized-string key="array.1" language="eo">elem2</localized-string><localized-string key="array.2.elem3" language="eo">elem4</localized-string><localized-string key="array.2.elem5" language="eo">elem6</localized-string><localized-string key="language" language="eo">eo</localized-string><localized-string key="script" language="eo">Latn</localized-string></localized-strings>
881
+ <preface>
882
+ <foreword obligation="informative" displayorder="1">
883
+ <title>Foreword</title>
884
+ <p id="A">See <xref target="M">kla&#x16D;zo 5</xref></p>
885
+ <p id="A">See <xref target="tab">tabelo 1</xref></p>
886
+ <table id="tab"><name>Tabelo 1</name></table>
887
+ </foreword>
888
+ <introduction id="B" obligation="informative" displayorder="2"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
889
+ <title depth="2">Introduction Subsection</title>
890
+ </clause>
891
+ </introduction></preface><sections>
892
+ <clause id="D" obligation="normative" type="scope" displayorder="3">
893
+ <title depth="1">1.<tab/>Scope</title>
894
+ <p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality>ISO 712, Tabelo 1&#x2013;1</eref></p>
895
+ </clause>
896
+ <clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
897
+ <title depth="2">3.1.<tab/>Normal Terms</title>
898
+ <term id="J"><name>3.1.1.</name>
899
+ <preferred>Term2</preferred>
900
+ </term>
901
+ </terms>
902
+ <definitions id="K"><title>3.2.</title>
903
+ <dl>
904
+ <dt>Symbol</dt>
905
+ <dd>Definition</dd>
906
+ </dl>
907
+ </definitions>
908
+ </clause>
909
+ <definitions id="L" displayorder="6"><title>4.</title>
910
+ <dl>
911
+ <dt>Symbol</dt>
912
+ <dd>Definition</dd>
913
+ </dl>
914
+ </definitions>
915
+ <clause id="M" inline-header="false" obligation="normative" displayorder="7"><title depth="1">5.<tab/>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
916
+ <title depth="2">5.1.<tab/>Introduction</title>
917
+ <note id="M-n1"><name>NOTO </name></note>
918
+ </clause>
919
+ <clause id="O" inline-header="false" obligation="normative">
920
+ <title depth="2">5.2.<tab/>Clause 4.2</title>
921
+ </clause></clause>
922
+ </sections><annex id="P" inline-header="false" obligation="normative" displayorder="8">
923
+ <title><strong>Aldono A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
924
+ <clause id="Q" inline-header="false" obligation="normative">
925
+ <title depth="2">A.1.<tab/>Annex A.1</title>
926
+ <clause id="Q1" inline-header="false" obligation="normative">
927
+ <title depth="3">A.1.1.<tab/>Annex A.1a</title>
928
+ </clause>
929
+ </clause>
930
+ </annex><bibliography><references id="R" obligation="informative" normative="true" displayorder="4">
931
+ <title depth="1">2.<tab/>Normative References</title>
932
+ <bibitem id="ISO712" type="standard">
933
+ <title format="text/plain">Cereals and cereal products</title>
934
+ <docidentifier>ISO 712</docidentifier>
935
+ <contributor>
936
+ <role type="publisher"/>
937
+ <organization>
938
+ <abbreviation>ISO</abbreviation>
939
+ </organization>
940
+ </contributor>
941
+ </bibitem>
942
+ </references><clause id="S" obligation="informative" displayorder="9">
943
+ <title depth="1">Bibliography</title>
944
+ <references id="T" obligation="informative" normative="false">
945
+ <title depth="2">Bibliography Subsection</title>
946
+ </references>
947
+ </clause>
948
+ </bibliography>
949
+ </iso-standard>
1077
950
  OUTPUT
1078
951
 
1079
952
  output = <<~OUTPUT