isodoc 1.5.4 → 1.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -4
- data/Gemfile +2 -2
- data/Rakefile +2 -2
- data/bin/rspec +1 -2
- data/isodoc.gemspec +11 -11
- data/lib/isodoc-yaml/i18n-ar.yaml +152 -0
- data/lib/isodoc-yaml/i18n-de.yaml +149 -0
- data/lib/isodoc-yaml/i18n-es.yaml +151 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +154 -0
- data/lib/isodoc/base_style/all.css +7 -0
- data/lib/isodoc/base_style/metanorma_word.css +7 -0
- data/lib/isodoc/base_style/metanorma_word.scss +8 -0
- data/lib/isodoc/base_style/reset.css +7 -0
- data/lib/isodoc/base_style/reset.scss +9 -0
- data/lib/isodoc/base_style/scripts.html +187 -0
- data/lib/isodoc/class_utils.rb +6 -5
- data/lib/isodoc/common.rb +2 -0
- data/lib/isodoc/convert.rb +30 -17
- data/lib/isodoc/css.rb +42 -28
- data/lib/isodoc/function/blocks.rb +21 -4
- data/lib/isodoc/function/blocks_example_note.rb +2 -2
- data/lib/isodoc/function/cleanup.rb +1 -2
- data/lib/isodoc/function/form.rb +51 -0
- data/lib/isodoc/function/inline.rb +32 -10
- data/lib/isodoc/function/references.rb +55 -42
- data/lib/isodoc/function/table.rb +1 -0
- data/lib/isodoc/function/to_word_html.rb +29 -28
- data/lib/isodoc/function/utils.rb +41 -38
- data/lib/isodoc/gem_tasks.rb +30 -31
- data/lib/isodoc/html_convert.rb +6 -4
- data/lib/isodoc/html_function/form.rb +62 -0
- data/lib/isodoc/html_function/postprocess.rb +35 -76
- data/lib/isodoc/html_function/postprocess_footnotes.rb +59 -0
- data/lib/isodoc/i18n.rb +33 -31
- data/lib/isodoc/pdf_convert.rb +1 -3
- data/lib/isodoc/presentation_function/bibdata.rb +13 -10
- data/lib/isodoc/presentation_function/block.rb +17 -8
- data/lib/isodoc/presentation_function/inline.rb +75 -118
- data/lib/isodoc/presentation_function/math.rb +84 -0
- data/lib/isodoc/presentation_function/section.rb +20 -22
- data/lib/isodoc/presentation_xml_convert.rb +2 -1
- data/lib/isodoc/sassc_importer.rb +1 -1
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +28 -24
- data/lib/isodoc/word_function/footnotes.rb +22 -15
- data/lib/isodoc/word_function/postprocess.rb +16 -6
- data/lib/isodoc/xref.rb +10 -11
- data/lib/isodoc/xref/xref_counter.rb +32 -17
- data/lib/isodoc/xref/xref_gen.rb +45 -32
- data/lib/isodoc/xref/xref_sect_gen.rb +33 -31
- data/lib/isodoc/xslfo_convert.rb +36 -25
- data/spec/assets/html_override.css +1 -0
- data/spec/assets/word_override.css +1 -0
- data/spec/isodoc/blocks_spec.rb +2518 -2570
- data/spec/isodoc/cleanup_spec.rb +1107 -1109
- data/spec/isodoc/footnotes_spec.rb +1 -16
- data/spec/isodoc/form_spec.rb +156 -0
- data/spec/isodoc/i18n_spec.rb +984 -972
- data/spec/isodoc/inline_spec.rb +984 -920
- data/spec/isodoc/lists_spec.rb +316 -315
- data/spec/isodoc/postproc_spec.rb +1692 -1538
- data/spec/isodoc/presentation_xml_spec.rb +345 -342
- data/spec/isodoc/ref_spec.rb +718 -723
- data/spec/isodoc/section_spec.rb +910 -902
- data/spec/isodoc/table_spec.rb +566 -556
- data/spec/isodoc/terms_spec.rb +252 -256
- data/spec/isodoc/xref_spec.rb +3040 -2985
- data/spec/isodoc/xslfo_convert_spec.rb +39 -0
- data/spec/spec_helper.rb +30 -29
- metadata +80 -70
- data/.rubocop.ribose.yml +0 -65
- data/.rubocop.tb.yml +0 -650
- data/lib/twitter-cldr/patch.rb +0 -39
@@ -155,17 +155,8 @@ RSpec.describe IsoDoc do
|
|
155
155
|
</preface>
|
156
156
|
</iso-standard>
|
157
157
|
INPUT
|
158
|
-
html = File.read("test.html").sub(/^.*<
|
158
|
+
html = File.read("test.html").sub(/^.*<main/m, "<main").sub(%r{</main>.*$}m, "</main>")
|
159
159
|
expect(xmlpp(html)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
160
|
-
<body lang="en" xml:lang="en">
|
161
|
-
<div class="title-section">
|
162
|
-
<p> </p>
|
163
|
-
</div>
|
164
|
-
<br />
|
165
|
-
<div class="prefatory-section">
|
166
|
-
<p> </p>
|
167
|
-
</div>
|
168
|
-
<br />
|
169
160
|
<main class="main-section"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
|
170
161
|
<br />
|
171
162
|
<div>
|
@@ -180,12 +171,6 @@ RSpec.describe IsoDoc do
|
|
180
171
|
</div>
|
181
172
|
<p class="zzSTDTitle1"></p>
|
182
173
|
</main>
|
183
|
-
<script type='text/x-mathjax-config'>
|
184
|
-
MathJax.Hub.Config({ "HTML-CSS": { preferredFont: "STIX" }, asciimath2jax:
|
185
|
-
{ delimiters: [['(#(', ')#)']] } });
|
186
|
-
</script>
|
187
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=MML_HTMLorMML-full" async="async"></script>
|
188
|
-
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script></body>
|
189
174
|
OUTPUT
|
190
175
|
end
|
191
176
|
|
@@ -0,0 +1,156 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe IsoDoc do
|
4
|
+
it "renders form" do
|
5
|
+
input = <<~INPUT
|
6
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
7
|
+
<sections>
|
8
|
+
<clause id="A">
|
9
|
+
<form action="/action_page.php" id="F0" name="F1">
|
10
|
+
<label for="fname">First name:</label><br/>
|
11
|
+
<input type="text" id="fname" name="fname"/><br/>
|
12
|
+
<label for="lname">Last name:</label><br/>
|
13
|
+
<input type="text" id="lname" name="lname"/><br/>
|
14
|
+
<label for="pwd">Password:</label><br/>
|
15
|
+
<input type="password" id="pwd" name="pwd"/><br/>
|
16
|
+
<input type="radio" id="male" name="gender" value="male"/>
|
17
|
+
<label for="male">Male</label><br/>
|
18
|
+
<input type="radio" id="female" name="gender" value="female"/>
|
19
|
+
<label for="female">Female</label><br/>
|
20
|
+
<input type="radio" id="other" name="gender" value="other"/>
|
21
|
+
<label for="other">Other</label><br/>
|
22
|
+
<input type="checkbox" id="vehicle1" name="vehicle1" value="Bike" checked="true"/>
|
23
|
+
<label for="vehicle1"> I have a bike</label><br/>
|
24
|
+
<input type="checkbox" id="vehicle2" name="vehicle2" value="Car"/>
|
25
|
+
<label for="vehicle2"> I have a car</label><br/>
|
26
|
+
<input type="checkbox" id="vehicle3" name="vehicle3" value="Boat"/>
|
27
|
+
<label for="vehicle3"> I have a boat</label><br/>
|
28
|
+
<input type="date" id="birthday" name="birthday"/><br/>
|
29
|
+
<label for="myfile">Select a file:</label>
|
30
|
+
<input type="file" id="myfile" name="myfile"/><br/>
|
31
|
+
<label for="cars">Select a car:</label>
|
32
|
+
<select id="cars" name="cars" value="fiat">
|
33
|
+
<option value="volvo">Volvo</option>
|
34
|
+
<option value="saab">Saab</option>
|
35
|
+
<option value="fiat">Fiat</option>
|
36
|
+
<option value="audi">Audi</option>
|
37
|
+
</select>
|
38
|
+
<textarea id="t1" name="message" rows="10" cols="30" value="The cat was playing in the garden."/>
|
39
|
+
<input type="button" value="Click Me!"/>
|
40
|
+
<input type="button"/>
|
41
|
+
<input type="submit" value="Submit"/>
|
42
|
+
</form>
|
43
|
+
</clause>
|
44
|
+
</sections>
|
45
|
+
</iso-standard>
|
46
|
+
INPUT
|
47
|
+
|
48
|
+
html = <<~HTML
|
49
|
+
#{HTML_HDR}
|
50
|
+
<p class='zzSTDTitle1'/>
|
51
|
+
<div id='A'>
|
52
|
+
<h1/>
|
53
|
+
<form id='F0' name='F1' action='/action_page.php'>
|
54
|
+
<label for='fname'>First name:</label>
|
55
|
+
<br/>
|
56
|
+
<input id='fname' name='fname' type='text'/>
|
57
|
+
<br/>
|
58
|
+
<label for='lname'>Last name:</label>
|
59
|
+
<br/>
|
60
|
+
<input id='lname' name='lname' type='text'/>
|
61
|
+
<br/>
|
62
|
+
<label for='pwd'>Password:</label>
|
63
|
+
<br/>
|
64
|
+
<input id='pwd' name='pwd' type='password'/>
|
65
|
+
<br/>
|
66
|
+
<input id='male' name='gender' type='radio' value='male'/>
|
67
|
+
<label for='male'>Male</label>
|
68
|
+
<br/>
|
69
|
+
<input id='female' name='gender' type='radio' value='female'/>
|
70
|
+
<label for='female'>Female</label>
|
71
|
+
<br/>
|
72
|
+
<input id='other' name='gender' type='radio' value='other'/>
|
73
|
+
<label for='other'>Other</label>
|
74
|
+
<br/>
|
75
|
+
<input id='vehicle1' name='vehicle1' type='checkbox' value='Bike' checked='true'/>
|
76
|
+
<label for='vehicle1'> I have a bike</label>
|
77
|
+
<br/>
|
78
|
+
<input id='vehicle2' name='vehicle2' type='checkbox' value='Car'/>
|
79
|
+
<label for='vehicle2'> I have a car</label>
|
80
|
+
<br/>
|
81
|
+
<input id='vehicle3' name='vehicle3' type='checkbox' value='Boat'/>
|
82
|
+
<label for='vehicle3'> I have a boat</label>
|
83
|
+
<br/>
|
84
|
+
<input id='birthday' name='birthday' type='date'/>
|
85
|
+
<br/>
|
86
|
+
<label for='myfile'>Select a file:</label>
|
87
|
+
<input id='myfile' name='myfile' type='file'/>
|
88
|
+
<br/>
|
89
|
+
<label for='cars'>Select a car:</label>
|
90
|
+
<select id='cars' name='cars'>
|
91
|
+
<option value='volvo'>Volvo</option>
|
92
|
+
<option value='saab'>Saab</option>
|
93
|
+
<option selected='true' value='fiat'>Fiat</option>
|
94
|
+
<option value='audi'>Audi</option>
|
95
|
+
</select>
|
96
|
+
<textarea id='t1' name='message' rows='10' cols='30'>The cat was playing in the garden.</textarea>
|
97
|
+
<input type='button' value='Click Me!'/>
|
98
|
+
<input type='button'/>
|
99
|
+
<input type='submit' value='Submit'/>
|
100
|
+
</form>
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
</body>
|
104
|
+
</html>
|
105
|
+
HTML
|
106
|
+
|
107
|
+
doc = <<~DOC
|
108
|
+
#{WORD_HDR}
|
109
|
+
<p class='zzSTDTitle1'/>
|
110
|
+
<div id='A'>
|
111
|
+
<h1/>
|
112
|
+
First name:
|
113
|
+
<br/>
|
114
|
+
__________
|
115
|
+
<br/>
|
116
|
+
Last name:
|
117
|
+
<br/>
|
118
|
+
__________
|
119
|
+
<br/>
|
120
|
+
Password:
|
121
|
+
<br/>
|
122
|
+
__________
|
123
|
+
<br/>
|
124
|
+
◎ Male
|
125
|
+
<br/>
|
126
|
+
◎ Female
|
127
|
+
<br/>
|
128
|
+
◎ Other
|
129
|
+
<br/>
|
130
|
+
☐ I have a bike
|
131
|
+
<br/>
|
132
|
+
☐ I have a car
|
133
|
+
<br/>
|
134
|
+
☐ I have a boat
|
135
|
+
<br/>
|
136
|
+
__________
|
137
|
+
<br/>
|
138
|
+
Select a file: __________
|
139
|
+
<br/>
|
140
|
+
Select a car: __________
|
141
|
+
<table border='1' width='50%'>
|
142
|
+
<tr>
|
143
|
+
<td/>
|
144
|
+
</tr>
|
145
|
+
</table>
|
146
|
+
[Click Me!] [BUTTON]
|
147
|
+
</div>
|
148
|
+
</div>
|
149
|
+
</body>
|
150
|
+
</html>
|
151
|
+
DOC
|
152
|
+
|
153
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(html)
|
154
|
+
expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(doc)
|
155
|
+
end
|
156
|
+
end
|
data/spec/isodoc/i18n_spec.rb
CHANGED
@@ -65,169 +65,172 @@ RSpec.describe IsoDoc do
|
|
65
65
|
</clause>
|
66
66
|
</bibliography>
|
67
67
|
</iso-standard>
|
68
|
-
|
68
|
+
INPUT
|
69
69
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
PRESXML
|
155
|
-
|
156
|
-
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.  Scope</h1>
|
176
|
-
<p id="E">Text</p>
|
177
|
-
</div>
|
178
|
-
<div>
|
179
|
-
<h1>2.  Normative References</h1>
|
180
|
-
</div>
|
181
|
-
<div id="H"><h1>3.  Terms, definitions, symbols and abbreviated terms</h1>
|
182
|
-
<div id="I">
|
183
|
-
<h2>3.1.  Normal Terms</h2>
|
184
|
-
<p class="TermNum" id="J">3.1.1.</p>
|
185
|
-
<p class="Terms" style="text-align:left;">Term2</p>
|
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>
|
154
|
+
PRESXML
|
186
155
|
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
156
|
+
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.  Scope</h1>
|
176
|
+
<p id="E">Text</p>
|
177
|
+
</div>
|
178
|
+
<div>
|
179
|
+
<h1>2.  Normative References</h1>
|
180
|
+
</div>
|
181
|
+
<div id="H"><h1>3.  Terms, definitions, symbols and abbreviated terms</h1>
|
182
|
+
<div id="I">
|
183
|
+
<h2>3.1.  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.  Clause 4</h1>
|
200
|
+
<div id="N">
|
201
|
+
<h2>5.1.  Introduction</h2>
|
202
|
+
</div>
|
203
|
+
<div id="O">
|
204
|
+
<h2>5.2.  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.  Annex A.1</h2>
|
212
|
+
<div id="Q1">
|
213
|
+
<h3>A.1.1.  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>
|
228
227
|
OUTPUT
|
229
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert
|
230
|
-
|
228
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert
|
229
|
+
.new({}).convert("test", input, true)
|
230
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
231
|
+
.to be_equivalent_to xmlpp(presxml)
|
232
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
233
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
231
234
|
end
|
232
235
|
|
233
236
|
it "defaults to English" do
|
@@ -294,91 +297,91 @@ PRESXML
|
|
294
297
|
</clause>
|
295
298
|
</bibliography>
|
296
299
|
</iso-standard>
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
300
|
+
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>
|
382
385
|
OUTPUT
|
383
386
|
end
|
384
387
|
|
@@ -446,759 +449,768 @@ PRESXML
|
|
446
449
|
</clause>
|
447
450
|
</bibliography>
|
448
451
|
</iso-standard>
|
449
|
-
|
452
|
+
INPUT
|
450
453
|
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
454
|
+
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>
|
538
|
+
PRESXML
|
536
539
|
|
537
540
|
output = <<~"OUTPUT"
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
</p>
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
</html>
|
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.  Scope</h1>
|
560
|
+
<p id="E">Text</p>
|
561
|
+
</div>
|
562
|
+
<div>
|
563
|
+
<h1>2.  Normative References</h1>
|
564
|
+
</div>
|
565
|
+
<div id="H"><h1>3.  Terms, definitions, symbols and abbreviated terms</h1>
|
566
|
+
<div id="I">
|
567
|
+
<h2>3.1.  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.  Clause 4</h1>
|
584
|
+
<div id="N">
|
585
|
+
<h2>5.1.  Introduction</h2>
|
586
|
+
</div>
|
587
|
+
<div id="O">
|
588
|
+
<h2>5.2.  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.  Annex A.1</h2>
|
596
|
+
<div id="Q1">
|
597
|
+
<h3>A.1.1.  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>
|
609
611
|
OUTPUT
|
610
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
611
|
-
|
612
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
613
|
+
.convert("test", input, true)
|
614
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
615
|
+
.to be_equivalent_to xmlpp(presxml)
|
616
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
617
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
612
618
|
end
|
613
619
|
|
614
620
|
it "processes Simplified Chinese" do
|
615
621
|
input = <<~"INPUT"
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
</
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
</iso-standard>
|
689
|
-
INPUT
|
690
|
-
|
691
|
-
presxml = <<~"PRESXML"
|
692
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
693
|
-
<bibdata>
|
694
|
-
<language current="true">zh</language>
|
695
|
-
<script current="true">Hans</script>
|
696
|
-
</bibdata>
|
697
|
-
<preface>
|
698
|
-
<foreword obligation='informative'>
|
699
|
-
<title>Foreword</title>
|
700
|
-
<p id='A'>See <xref target='M'>条5</xref></p>
|
701
|
-
</foreword>
|
702
|
-
<introduction id='B' obligation='informative'>
|
703
|
-
<title>Introduction</title>
|
704
|
-
<clause id='C' inline-header='false' obligation='informative'>
|
705
|
-
<title depth='2'>Introduction Subsection</title>
|
706
|
-
</clause>
|
707
|
-
</introduction>
|
708
|
-
</preface>
|
709
|
-
<sections>
|
710
|
-
<clause id='D' obligation='normative' type="scope">
|
711
|
-
<title depth='1'>1.<tab/>Scope</title>
|
712
|
-
<p id='E'>
|
713
|
-
<eref type='inline' bibitemid='ISO712'><locality type='table'><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality>ISO 712、第1–1表</eref></p>
|
714
|
-
</clause>
|
715
|
-
<clause id='H' obligation='normative'>
|
716
|
-
<title depth='1'>3.<tab/>Terms, definitions, symbols and abbreviated terms</title>
|
717
|
-
<terms id='I' obligation='normative'>
|
718
|
-
<title depth='2'>3.1.<tab/>Normal Terms</title>
|
719
|
-
<term id='J'>
|
720
|
-
<name>3.1.1.</name>
|
721
|
-
<preferred>Term2</preferred>
|
722
|
-
</term>
|
723
|
-
</terms>
|
724
|
-
<definitions id='K'>
|
725
|
-
<title>3.2.</title>
|
726
|
-
<dl>
|
727
|
-
<dt>Symbol</dt>
|
728
|
-
<dd>Definition</dd>
|
729
|
-
</dl>
|
730
|
-
</definitions>
|
731
|
-
</clause>
|
732
|
-
<definitions id='L'>
|
733
|
-
<title>4.</title>
|
734
|
-
<dl>
|
735
|
-
<dt>Symbol</dt>
|
736
|
-
<dd>Definition</dd>
|
737
|
-
</dl>
|
738
|
-
</definitions>
|
739
|
-
<clause id='M' inline-header='false' obligation='normative'>
|
740
|
-
<title depth='1'>5.<tab/>Clause 4</title>
|
741
|
-
<clause id='N' inline-header='false' obligation='normative'>
|
742
|
-
<title depth='2'>5.1.<tab/>Introduction</title>
|
743
|
-
</clause>
|
744
|
-
<clause id='O' inline-header='false' obligation='normative'>
|
745
|
-
<title depth='2'>5.2.<tab/>Clause 4.2</title>
|
746
|
-
</clause>
|
747
|
-
</clause>
|
748
|
-
</sections>
|
749
|
-
<annex id='P' inline-header='false' obligation='normative'>
|
750
|
-
<title>
|
751
|
-
<strong>附件A</strong>
|
752
|
-
<br/>
|
753
|
-
(规范性附录)
|
754
|
-
<br/>
|
755
|
-
<br/>
|
756
|
-
<strong>Annex</strong>
|
757
|
-
</title>
|
758
|
-
<clause id='Q' inline-header='false' obligation='normative'>
|
759
|
-
<title depth='2'>A.1.<tab/>Annex A.1</title>
|
760
|
-
<clause id='Q1' inline-header='false' obligation='normative'>
|
761
|
-
<title depth='3'>A.1.1.<tab/>Annex A.1a</title>
|
762
|
-
</clause>
|
763
|
-
</clause>
|
764
|
-
</annex>
|
765
|
-
<bibliography>
|
766
|
-
<references id='R' obligation='informative' normative='true'>
|
767
|
-
<title depth='1'>2.<tab/>Normative References</title>
|
768
|
-
<bibitem id='ISO712' type='standard'>
|
769
|
-
<title format='text/plain'>Cereals and cereal products</title>
|
770
|
-
<docidentifier>ISO 712</docidentifier>
|
771
|
-
<contributor>
|
772
|
-
<role type='publisher'/>
|
773
|
-
<organization>
|
774
|
-
<abbreviation>ISO</abbreviation>
|
775
|
-
</organization>
|
776
|
-
</contributor>
|
777
|
-
</bibitem>
|
778
|
-
</references>
|
779
|
-
<clause id='S' obligation='informative'>
|
780
|
-
<title depth="1">Bibliography</title>
|
781
|
-
<references id='T' obligation='informative' normative='false'>
|
782
|
-
<title depth="2">Bibliography Subsection</title>
|
783
|
-
</references>
|
784
|
-
</clause>
|
785
|
-
</bibliography>
|
786
|
-
</iso-standard>
|
787
|
-
PRESXML
|
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>
|
693
|
+
INPUT
|
788
694
|
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
</
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
695
|
+
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'>条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、第1–1表</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>附件A</strong>
|
756
|
+
<br/>
|
757
|
+
(规范性附录)
|
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>
|
791
|
+
PRESXML
|
822
792
|
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
793
|
+
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'>条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. Scope</h1>
|
813
|
+
<p id="E">
|
814
|
+
<a href='#ISO712'>ISO 712、第1–1表</a>
|
815
|
+
</p>
|
816
|
+
</div>
|
817
|
+
<div>
|
818
|
+
<h1>2. 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. Terms, definitions, symbols and abbreviated terms</h1>
|
822
|
+
<div id="I">
|
823
|
+
<h2>3.1. 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. Clause 4</h1>
|
840
|
+
<div id="N">
|
841
|
+
<h2>5.1. Introduction</h2>
|
842
|
+
</div>
|
843
|
+
<div id="O">
|
844
|
+
<h2>5.2. Clause 4.2</h2>
|
845
|
+
</div>
|
846
|
+
</div>
|
847
|
+
<br/>
|
848
|
+
<div id="P" class="Section3">
|
849
|
+
<h1 class="Annex"><b>附件A</b><br/>(规范性附录)<br/><br/><b>Annex</b></h1>
|
850
|
+
<div id="Q">
|
851
|
+
<h2>A.1. Annex A.1</h2>
|
852
|
+
<div id="Q1">
|
853
|
+
<h3>A.1.1. 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>
|
864
867
|
OUTPUT
|
865
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
866
|
-
|
868
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
869
|
+
.convert("test", input, true)
|
870
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
871
|
+
.to be_equivalent_to xmlpp(presxml)
|
872
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
873
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
867
874
|
end
|
868
875
|
|
869
876
|
it "processes i18n file" do
|
870
877
|
mock_i18n
|
871
878
|
input = <<~"INPUT"
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
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>
|
960
|
+
INPUT
|
899
961
|
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
</
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
<
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
<
|
969
|
-
<
|
970
|
-
<
|
971
|
-
</
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
<
|
976
|
-
<
|
977
|
-
<
|
978
|
-
|
979
|
-
|
980
|
-
<
|
981
|
-
<
|
982
|
-
<
|
983
|
-
|
984
|
-
<
|
985
|
-
<
|
986
|
-
|
987
|
-
|
988
|
-
<
|
989
|
-
<
|
990
|
-
<
|
991
|
-
<
|
992
|
-
<
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
<
|
997
|
-
<
|
998
|
-
<
|
999
|
-
<
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
</
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
<p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality>ISO 712, Tabelo 1–1</eref></p>
|
1017
|
-
</clause>
|
1018
|
-
|
1019
|
-
<clause id="H" obligation="normative"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
1020
|
-
<title depth="2">3.1.<tab/>Normal Terms</title>
|
1021
|
-
<term id="J"><name>3.1.1.</name>
|
1022
|
-
<preferred>Term2</preferred>
|
1023
|
-
</term>
|
1024
|
-
</terms>
|
1025
|
-
<definitions id="K"><title>3.2.</title>
|
1026
|
-
<dl>
|
1027
|
-
<dt>Symbol</dt>
|
1028
|
-
<dd>Definition</dd>
|
1029
|
-
</dl>
|
1030
|
-
</definitions>
|
1031
|
-
</clause>
|
1032
|
-
<definitions id="L"><title>4.</title>
|
1033
|
-
<dl>
|
1034
|
-
<dt>Symbol</dt>
|
1035
|
-
<dd>Definition</dd>
|
1036
|
-
</dl>
|
1037
|
-
</definitions>
|
1038
|
-
<clause id="M" inline-header="false" obligation="normative"><title depth="1">5.<tab/>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
|
1039
|
-
<title depth="2">5.1.<tab/>Introduction</title>
|
1040
|
-
<note id='M-n1'><name>NOTO </name></note>
|
1041
|
-
</clause>
|
1042
|
-
<clause id="O" inline-header="false" obligation="normative">
|
1043
|
-
<title depth="2">5.2.<tab/>Clause 4.2</title>
|
1044
|
-
</clause></clause>
|
1045
|
-
|
1046
|
-
</sections><annex id="P" inline-header="false" obligation="normative">
|
1047
|
-
<title><strong>Aldono A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
|
1048
|
-
<clause id="Q" inline-header="false" obligation="normative">
|
1049
|
-
<title depth="2">A.1.<tab/>Annex A.1</title>
|
1050
|
-
<clause id="Q1" inline-header="false" obligation="normative">
|
1051
|
-
<title depth="3">A.1.1.<tab/>Annex A.1a</title>
|
1052
|
-
</clause>
|
1053
|
-
</clause>
|
1054
|
-
</annex><bibliography><references id="R" obligation="informative" normative="true">
|
1055
|
-
<title depth="1">2.<tab/>Normative References</title>
|
1056
|
-
<bibitem id="ISO712" type="standard">
|
1057
|
-
<title format="text/plain">Cereals and cereal products</title>
|
1058
|
-
<docidentifier>ISO 712</docidentifier>
|
1059
|
-
<contributor>
|
1060
|
-
<role type="publisher"/>
|
1061
|
-
<organization>
|
1062
|
-
<abbreviation>ISO</abbreviation>
|
1063
|
-
</organization>
|
1064
|
-
</contributor>
|
1065
|
-
</bibitem>
|
1066
|
-
</references><clause id="S" obligation="informative">
|
1067
|
-
<title depth="1">Bibliography</title>
|
1068
|
-
<references id="T" obligation="informative" normative="false">
|
1069
|
-
<title depth="2">Bibliography Subsection</title>
|
1070
|
-
</references>
|
1071
|
-
</clause>
|
1072
|
-
</bibliography>
|
1073
|
-
</iso-standard>
|
1074
|
-
OUTPUT
|
962
|
+
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>
|
972
|
+
</status>
|
973
|
+
<ext>
|
974
|
+
<doctype language=''>brochure</doctype>
|
975
|
+
<doctype language='eo'>broŝuro</doctype>
|
976
|
+
</ext>
|
977
|
+
</bibdata>
|
978
|
+
<localized-strings>
|
979
|
+
<localized-string key='foreword' language='eo'>Antaŭparolo</localized-string>
|
980
|
+
<localized-string key='introduction' language='eo'>Enkonduko</localized-string>
|
981
|
+
<localized-string key='clause' language='eo'>klaŭ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ĵ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'>ĉ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ŝ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ŭ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–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>
|
1077
|
+
OUTPUT
|
1075
1078
|
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
<br/>
|
1084
|
-
<div class='prefatory-section'>
|
1085
|
-
<p> </p>
|
1086
|
-
</div>
|
1087
|
-
<br/>
|
1088
|
-
<div class='main-section'>
|
1089
|
-
<br/>
|
1090
|
-
<div>
|
1091
|
-
<h1 class='ForewordTitle'>Foreword</h1>
|
1092
|
-
<p id='A'>
|
1093
|
-
See
|
1094
|
-
<a href='#M'>klaŭzo 5</a>
|
1095
|
-
</p>
|
1096
|
-
<p id='A'>
|
1097
|
-
See
|
1098
|
-
<a href='#tab'>tabelo 1</a>
|
1099
|
-
</p>
|
1100
|
-
<p class='TableTitle' style='text-align:center;'>Tabelo 1</p>
|
1101
|
-
<table id='tab' class='MsoISOTable' style='border-width:1px;border-spacing:0;'/>
|
1102
|
-
</div>
|
1103
|
-
<br/>
|
1104
|
-
<div class='Section3' id='B'>
|
1105
|
-
<h1 class='IntroTitle'>Introduction</h1>
|
1106
|
-
<div id='C'>
|
1107
|
-
<h2>Introduction Subsection</h2>
|
1108
|
-
</div>
|
1109
|
-
</div>
|
1110
|
-
<p class='zzSTDTitle1'/>
|
1111
|
-
<div id='D'>
|
1112
|
-
<h1>1.  Scope</h1>
|
1113
|
-
<p id='E'>
|
1114
|
-
<a href='#ISO712'>ISO 712, Tabelo 1–1</a>
|
1115
|
-
</p>
|
1116
|
-
</div>
|
1117
|
-
<div>
|
1118
|
-
<h1>2.  Normative References</h1>
|
1119
|
-
<p id='ISO712' class='NormRef'>
|
1120
|
-
ISO 712,
|
1121
|
-
<i>Cereals and cereal products</i>
|
1122
|
-
</p>
|
1123
|
-
</div>
|
1124
|
-
<div id='H'>
|
1125
|
-
<h1>3.  Terms, definitions, symbols and abbreviated terms</h1>
|
1126
|
-
<div id='I'>
|
1127
|
-
<h2>3.1.  Normal Terms</h2>
|
1128
|
-
<p class='TermNum' id='J'>3.1.1.</p>
|
1129
|
-
<p class='Terms' style='text-align:left;'>Term2</p>
|
1130
|
-
</div>
|
1131
|
-
<div id='K'>
|
1132
|
-
<h2>3.2.</h2>
|
1133
|
-
<dl>
|
1134
|
-
<dt>
|
1135
|
-
<p>Symbol</p>
|
1136
|
-
</dt>
|
1137
|
-
<dd>Definition</dd>
|
1138
|
-
</dl>
|
1139
|
-
</div>
|
1140
|
-
</div>
|
1141
|
-
<div id='L' class='Symbols'>
|
1142
|
-
<h1>4.</h1>
|
1143
|
-
<dl>
|
1144
|
-
<dt>
|
1145
|
-
<p>Symbol</p>
|
1146
|
-
</dt>
|
1147
|
-
<dd>Definition</dd>
|
1148
|
-
</dl>
|
1149
|
-
</div>
|
1150
|
-
<div id='M'>
|
1151
|
-
<h1>5.  Clause 4</h1>
|
1152
|
-
<div id='N'>
|
1153
|
-
<h2>5.1.  Introduction</h2>
|
1154
|
-
<div id='M-n1' class='Note'>
|
1155
|
-
<p>
|
1156
|
-
<span class='note_label'>NOTO </span>
|
1157
|
-
 
|
1158
|
-
</p>
|
1159
|
-
</div>
|
1160
|
-
</div>
|
1161
|
-
<div id='O'>
|
1162
|
-
<h2>5.2.  Clause 4.2</h2>
|
1163
|
-
</div>
|
1164
|
-
</div>
|
1165
|
-
<br/>
|
1166
|
-
<div id='P' class='Section3'>
|
1167
|
-
<h1 class='Annex'>
|
1168
|
-
<b>Aldono A</b>
|
1169
|
-
<br/>
|
1170
|
-
(normative)
|
1079
|
+
output = <<~OUTPUT
|
1080
|
+
<html lang='eo'>
|
1081
|
+
<head/>
|
1082
|
+
<body lang='eo'>
|
1083
|
+
<div class='title-section'>
|
1084
|
+
<p> </p>
|
1085
|
+
</div>
|
1171
1086
|
<br/>
|
1087
|
+
<div class='prefatory-section'>
|
1088
|
+
<p> </p>
|
1089
|
+
</div>
|
1172
1090
|
<br/>
|
1173
|
-
<
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1091
|
+
<div class='main-section'>
|
1092
|
+
<br/>
|
1093
|
+
<div>
|
1094
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
1095
|
+
<p id='A'>
|
1096
|
+
See
|
1097
|
+
<a href='#M'>klaŭzo 5</a>
|
1098
|
+
</p>
|
1099
|
+
<p id='A'>
|
1100
|
+
See
|
1101
|
+
<a href='#tab'>tabelo 1</a>
|
1102
|
+
</p>
|
1103
|
+
<p class='TableTitle' style='text-align:center;'>Tabelo 1</p>
|
1104
|
+
<table id='tab' class='MsoISOTable' style='border-width:1px;border-spacing:0;'/>
|
1105
|
+
</div>
|
1106
|
+
<br/>
|
1107
|
+
<div class='Section3' id='B'>
|
1108
|
+
<h1 class='IntroTitle'>Introduction</h1>
|
1109
|
+
<div id='C'>
|
1110
|
+
<h2>Introduction Subsection</h2>
|
1111
|
+
</div>
|
1112
|
+
</div>
|
1113
|
+
<p class='zzSTDTitle1'/>
|
1114
|
+
<div id='D'>
|
1115
|
+
<h1>1.  Scope</h1>
|
1116
|
+
<p id='E'>
|
1117
|
+
<a href='#ISO712'>ISO 712, Tabelo 1–1</a>
|
1118
|
+
</p>
|
1119
|
+
</div>
|
1120
|
+
<div>
|
1121
|
+
<h1>2.  Normative References</h1>
|
1122
|
+
<p id='ISO712' class='NormRef'>
|
1123
|
+
ISO 712,
|
1124
|
+
<i>Cereals and cereal products</i>
|
1125
|
+
</p>
|
1126
|
+
</div>
|
1127
|
+
<div id='H'>
|
1128
|
+
<h1>3.  Terms, definitions, symbols and abbreviated terms</h1>
|
1129
|
+
<div id='I'>
|
1130
|
+
<h2>3.1.  Normal Terms</h2>
|
1131
|
+
<p class='TermNum' id='J'>3.1.1.</p>
|
1132
|
+
<p class='Terms' style='text-align:left;'>Term2</p>
|
1133
|
+
</div>
|
1134
|
+
<div id='K'>
|
1135
|
+
<h2>3.2.</h2>
|
1136
|
+
<dl>
|
1137
|
+
<dt>
|
1138
|
+
<p>Symbol</p>
|
1139
|
+
</dt>
|
1140
|
+
<dd>Definition</dd>
|
1141
|
+
</dl>
|
1142
|
+
</div>
|
1143
|
+
</div>
|
1144
|
+
<div id='L' class='Symbols'>
|
1145
|
+
<h1>4.</h1>
|
1146
|
+
<dl>
|
1147
|
+
<dt>
|
1148
|
+
<p>Symbol</p>
|
1149
|
+
</dt>
|
1150
|
+
<dd>Definition</dd>
|
1151
|
+
</dl>
|
1152
|
+
</div>
|
1153
|
+
<div id='M'>
|
1154
|
+
<h1>5.  Clause 4</h1>
|
1155
|
+
<div id='N'>
|
1156
|
+
<h2>5.1.  Introduction</h2>
|
1157
|
+
<div id='M-n1' class='Note'>
|
1158
|
+
<p>
|
1159
|
+
<span class='note_label'>NOTO </span>
|
1160
|
+
 
|
1161
|
+
</p>
|
1162
|
+
</div>
|
1163
|
+
</div>
|
1164
|
+
<div id='O'>
|
1165
|
+
<h2>5.2.  Clause 4.2</h2>
|
1166
|
+
</div>
|
1167
|
+
</div>
|
1168
|
+
<br/>
|
1169
|
+
<div id='P' class='Section3'>
|
1170
|
+
<h1 class='Annex'>
|
1171
|
+
<b>Aldono A</b>
|
1172
|
+
<br/>
|
1173
|
+
(normative)
|
1174
|
+
<br/>
|
1175
|
+
<br/>
|
1176
|
+
<b>Annex</b>
|
1177
|
+
</h1>
|
1178
|
+
<div id='Q'>
|
1179
|
+
<h2>A.1.  Annex A.1</h2>
|
1180
|
+
<div id='Q1'>
|
1181
|
+
<h3>A.1.1.  Annex A.1a</h3>
|
1182
|
+
</div>
|
1183
|
+
</div>
|
1184
|
+
</div>
|
1185
|
+
<br/>
|
1186
|
+
<div>
|
1187
|
+
<h1 class='Section3'>Bibliography</h1>
|
1188
|
+
<div>
|
1189
|
+
<h2 class='Section3'>Bibliography Subsection</h2>
|
1190
|
+
</div>
|
1191
|
+
</div>
|
1179
1192
|
</div>
|
1180
|
-
</
|
1181
|
-
</
|
1182
|
-
|
1183
|
-
<div>
|
1184
|
-
<h1 class='Section3'>Bibliography</h1>
|
1185
|
-
<div>
|
1186
|
-
<h2 class='Section3'>Bibliography Subsection</h2>
|
1187
|
-
</div>
|
1188
|
-
</div>
|
1189
|
-
</div>
|
1190
|
-
</body>
|
1191
|
-
</html>
|
1192
|
-
OUTPUT
|
1193
|
+
</body>
|
1194
|
+
</html>
|
1195
|
+
OUTPUT
|
1193
1196
|
|
1194
|
-
|
1195
|
-
|
1197
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert
|
1198
|
+
.new({ i18nyaml: "spec/assets/i18n.yaml" })
|
1199
|
+
.convert("test", input, true)))
|
1200
|
+
.to be_equivalent_to xmlpp(presxml)
|
1201
|
+
expect(xmlpp(IsoDoc::HtmlConvert
|
1202
|
+
.new({ i18nyaml: "spec/assets/i18n.yaml" })
|
1203
|
+
.convert("test", presxml, true)))
|
1204
|
+
.to be_equivalent_to xmlpp(output)
|
1196
1205
|
end
|
1197
1206
|
|
1198
1207
|
private
|
1199
1208
|
|
1200
1209
|
def mock_i18n
|
1201
|
-
allow_any_instance_of(::IsoDoc::I18n)
|
1210
|
+
allow_any_instance_of(::IsoDoc::I18n)
|
1211
|
+
.to receive(:load_yaml)
|
1212
|
+
.with("eo", "Latn", "spec/assets/i18n.yaml")
|
1213
|
+
.and_return(IsoDoc::I18n.new("eo", "Latn")
|
1214
|
+
.normalise_hash(YAML.load_file("spec/assets/i18n.yaml")))
|
1202
1215
|
end
|
1203
|
-
|
1204
1216
|
end
|