rexml 3.2.5 → 3.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +406 -2
- data/README.md +10 -1
- data/doc/rexml/tasks/rdoc/element.rdoc +2 -2
- data/doc/rexml/tutorial.rdoc +1358 -0
- data/lib/rexml/attribute.rb +14 -9
- data/lib/rexml/document.rb +1 -1
- data/lib/rexml/element.rb +19 -34
- data/lib/rexml/entity.rb +5 -37
- data/lib/rexml/formatters/pretty.rb +3 -3
- data/lib/rexml/functions.rb +1 -2
- data/lib/rexml/namespace.rb +8 -4
- data/lib/rexml/node.rb +8 -4
- data/lib/rexml/parseexception.rb +1 -0
- data/lib/rexml/parsers/baseparser.rb +421 -263
- data/lib/rexml/parsers/pullparser.rb +4 -0
- data/lib/rexml/parsers/sax2parser.rb +6 -19
- data/lib/rexml/parsers/streamparser.rb +8 -10
- data/lib/rexml/parsers/treeparser.rb +9 -21
- data/lib/rexml/parsers/xpathparser.rb +136 -86
- data/lib/rexml/rexml.rb +3 -1
- data/lib/rexml/source.rb +128 -98
- data/lib/rexml/text.rb +40 -18
- data/lib/rexml/xpath_parser.rb +7 -3
- metadata +11 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b79c22060286dad847e18d30b4b336bda21d2772ccb35413fb9ba51a0012ed2
|
4
|
+
data.tar.gz: feb56a4a3071541e983acd33b8baa6b9052f8d67d871102cfe6e69773a0cfcfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b615c95f8624212e151443ad03ba9b64f39aee8a200ea212150a10116340157cfda1bf974ab3d03161c0fb37d866e8c1c69ccc6a9549a13398452b32166af2d8
|
7
|
+
data.tar.gz: db7dcac658e1f51f30575c24d6f36dc256349331fa1951c8fdfaf214baf97a5a446a1fcc411358a76d2c6fc36388ec8b1178adeacc3225d16d5d95ac53a8c4b3
|
data/NEWS.md
CHANGED
@@ -1,15 +1,419 @@
|
|
1
1
|
# News
|
2
2
|
|
3
|
+
## 3.3.6 - 2024-08-22 {#version-3-3-6}
|
4
|
+
|
5
|
+
### Improvements
|
6
|
+
|
7
|
+
* Removed duplicated entity expansions for performance.
|
8
|
+
* GH-194
|
9
|
+
* Patch by Viktor Ivarsson.
|
10
|
+
|
11
|
+
* Improved namespace conflicted attribute check performance. It was
|
12
|
+
too slow for deep elements.
|
13
|
+
* Reported by l33thaxor.
|
14
|
+
|
15
|
+
### Fixes
|
16
|
+
|
17
|
+
* Fixed a bug that default entity expansions are counted for
|
18
|
+
security check. Default entity expansions should not be counted
|
19
|
+
because they don't have a security risk.
|
20
|
+
* GH-198
|
21
|
+
* GH-199
|
22
|
+
* Patch Viktor Ivarsson
|
23
|
+
|
24
|
+
* Fixed a parser bug that parameter entity references in internal
|
25
|
+
subsets are expanded. It's not allowed in the XML specification.
|
26
|
+
* GH-191
|
27
|
+
* Patch by NAITOH Jun.
|
28
|
+
|
29
|
+
* Fixed a stream parser bug that user-defined entity references in
|
30
|
+
text aren't expanded.
|
31
|
+
* GH-200
|
32
|
+
* Patch by NAITOH Jun.
|
33
|
+
|
34
|
+
### Thanks
|
35
|
+
|
36
|
+
* Viktor Ivarsson
|
37
|
+
|
38
|
+
* NAITOH Jun
|
39
|
+
|
40
|
+
* l33thaxor
|
41
|
+
|
42
|
+
## 3.3.5 - 2024-08-12 {#version-3-3-5}
|
43
|
+
|
44
|
+
### Fixes
|
45
|
+
|
46
|
+
* Fixed a bug that `REXML::Security.entity_expansion_text_limit`
|
47
|
+
check has wrong text size calculation in SAX and pull parsers.
|
48
|
+
* GH-193
|
49
|
+
* GH-195
|
50
|
+
* Reported by Viktor Ivarsson.
|
51
|
+
* Patch by NAITOH Jun.
|
52
|
+
|
53
|
+
### Thanks
|
54
|
+
|
55
|
+
* Viktor Ivarsson
|
56
|
+
|
57
|
+
* NAITOH Jun
|
58
|
+
|
59
|
+
## 3.3.4 - 2024-08-01 {#version-3-3-4}
|
60
|
+
|
61
|
+
### Fixes
|
62
|
+
|
63
|
+
* Fixed a bug that `REXML::Security` isn't defined when
|
64
|
+
`REXML::Parsers::StreamParser` is used and
|
65
|
+
`rexml/parsers/streamparser` is only required.
|
66
|
+
* GH-189
|
67
|
+
* Patch by takuya kodama.
|
68
|
+
|
69
|
+
### Thanks
|
70
|
+
|
71
|
+
* takuya kodama
|
72
|
+
|
73
|
+
## 3.3.3 - 2024-08-01 {#version-3-3-3}
|
74
|
+
|
75
|
+
### Improvements
|
76
|
+
|
77
|
+
* Added support for detecting invalid XML that has unsupported
|
78
|
+
content before root element
|
79
|
+
* GH-184
|
80
|
+
* Patch by NAITOH Jun.
|
81
|
+
|
82
|
+
* Added support for `REXML::Security.entity_expansion_limit=` and
|
83
|
+
`REXML::Security.entity_expansion_text_limit=` in SAX2 and pull
|
84
|
+
parsers
|
85
|
+
* GH-187
|
86
|
+
* Patch by NAITOH Jun.
|
87
|
+
|
88
|
+
* Added more tests for invalid XMLs.
|
89
|
+
* GH-183
|
90
|
+
* Patch by Watson.
|
91
|
+
|
92
|
+
* Added more performance tests.
|
93
|
+
* Patch by Watson.
|
94
|
+
|
95
|
+
* Improved parse performance.
|
96
|
+
* GH-186
|
97
|
+
* Patch by tomoya ishida.
|
98
|
+
|
99
|
+
### Thanks
|
100
|
+
|
101
|
+
* NAITOH Jun
|
102
|
+
|
103
|
+
* Watson
|
104
|
+
|
105
|
+
* tomoya ishida
|
106
|
+
|
107
|
+
## 3.3.2 - 2024-07-16 {#version-3-3-2}
|
108
|
+
|
109
|
+
### Improvements
|
110
|
+
|
111
|
+
* Improved parse performance.
|
112
|
+
* GH-160
|
113
|
+
* Patch by NAITOH Jun.
|
114
|
+
|
115
|
+
* Improved parse performance.
|
116
|
+
* GH-169
|
117
|
+
* GH-170
|
118
|
+
* GH-171
|
119
|
+
* GH-172
|
120
|
+
* GH-173
|
121
|
+
* GH-174
|
122
|
+
* GH-175
|
123
|
+
* GH-176
|
124
|
+
* GH-177
|
125
|
+
* Patch by Watson.
|
126
|
+
|
127
|
+
* Added support for raising a parse exception when an XML has extra
|
128
|
+
content after the root element.
|
129
|
+
* GH-161
|
130
|
+
* Patch by NAITOH Jun.
|
131
|
+
|
132
|
+
* Added support for raising a parse exception when an XML
|
133
|
+
declaration exists in wrong position.
|
134
|
+
* GH-162
|
135
|
+
* Patch by NAITOH Jun.
|
136
|
+
|
137
|
+
* Removed needless a space after XML declaration in pretty print mode.
|
138
|
+
* GH-164
|
139
|
+
* Patch by NAITOH Jun.
|
140
|
+
|
141
|
+
* Stopped to emit `:text` event after the root element.
|
142
|
+
* GH-167
|
143
|
+
* Patch by NAITOH Jun.
|
144
|
+
|
145
|
+
### Fixes
|
146
|
+
|
147
|
+
* Fixed a bug that SAX2 parser doesn't expand predefined entities for
|
148
|
+
`characters` callback.
|
149
|
+
* GH-168
|
150
|
+
* Patch by NAITOH Jun.
|
151
|
+
|
152
|
+
### Thanks
|
153
|
+
|
154
|
+
* NAITOH Jun
|
155
|
+
|
156
|
+
* Watson
|
157
|
+
|
158
|
+
## 3.3.1 - 2024-06-25 {#version-3-3-1}
|
159
|
+
|
160
|
+
### Improvements
|
161
|
+
|
162
|
+
* Added support for detecting malformed top-level comments.
|
163
|
+
* GH-145
|
164
|
+
* Patch by Hiroya Fujinami.
|
165
|
+
|
166
|
+
* Improved `REXML::Element#attribute` performance.
|
167
|
+
* GH-146
|
168
|
+
* Patch by Hiroya Fujinami.
|
169
|
+
|
170
|
+
* Added support for detecting malformed `<!-->` comments.
|
171
|
+
* GH-147
|
172
|
+
* Patch by Hiroya Fujinami.
|
173
|
+
|
174
|
+
* Added support for detecting unclosed `DOCTYPE`.
|
175
|
+
* GH-152
|
176
|
+
* Patch by Hiroya Fujinami.
|
177
|
+
|
178
|
+
* Added `changlog_uri` metadata to gemspec.
|
179
|
+
* GH-156
|
180
|
+
* Patch by fynsta.
|
181
|
+
|
182
|
+
* Improved parse performance.
|
183
|
+
* GH-157
|
184
|
+
* GH-158
|
185
|
+
* Patch by NAITOH Jun.
|
186
|
+
|
187
|
+
### Fixes
|
188
|
+
|
189
|
+
* Fixed a bug that large XML can't be parsed.
|
190
|
+
* GH-154
|
191
|
+
* Patch by NAITOH Jun.
|
192
|
+
|
193
|
+
* Fixed a bug that private constants are visible.
|
194
|
+
* GH-155
|
195
|
+
* Patch by NAITOH Jun.
|
196
|
+
|
197
|
+
### Thanks
|
198
|
+
|
199
|
+
* Hiroya Fujinami
|
200
|
+
|
201
|
+
* NAITOH Jun
|
202
|
+
|
203
|
+
* fynsta
|
204
|
+
|
205
|
+
## 3.3.0 - 2024-06-11 {#version-3-3-0}
|
206
|
+
|
207
|
+
### Improvements
|
208
|
+
|
209
|
+
* Added support for strscan 0.7.0 installed with Ruby 2.6.
|
210
|
+
* GH-142
|
211
|
+
* Reported by Fernando Trigoso.
|
212
|
+
|
213
|
+
### Thanks
|
214
|
+
|
215
|
+
* Fernando Trigoso
|
216
|
+
|
217
|
+
## 3.2.9 - 2024-06-09 {#version-3-2-9}
|
218
|
+
|
219
|
+
### Improvements
|
220
|
+
|
221
|
+
* Added support for old strscan.
|
222
|
+
* GH-132
|
223
|
+
* Reported by Adam.
|
224
|
+
|
225
|
+
* Improved attribute value parse performance.
|
226
|
+
* GH-135
|
227
|
+
* Patch by NAITOH Jun.
|
228
|
+
|
229
|
+
* Improved `REXML::Node#each_recursive` performance.
|
230
|
+
* GH-134
|
231
|
+
* GH-139
|
232
|
+
* Patch by Hiroya Fujinami.
|
233
|
+
|
234
|
+
* Improved text parse performance.
|
235
|
+
* Reported by mprogrammer.
|
236
|
+
|
237
|
+
### Thanks
|
238
|
+
|
239
|
+
* Adam
|
240
|
+
* NAITOH Jun
|
241
|
+
* Hiroya Fujinami
|
242
|
+
* mprogrammer
|
243
|
+
|
244
|
+
## 3.2.8 - 2024-05-16 {#version-3-2-8}
|
245
|
+
|
246
|
+
### Fixes
|
247
|
+
|
248
|
+
* Suppressed a warning
|
249
|
+
|
250
|
+
## 3.2.7 - 2024-05-16 {#version-3-2-7}
|
251
|
+
|
252
|
+
### Improvements
|
253
|
+
|
254
|
+
* Improve parse performance by using `StringScanner`.
|
255
|
+
|
256
|
+
* GH-106
|
257
|
+
* GH-107
|
258
|
+
* GH-108
|
259
|
+
* GH-109
|
260
|
+
* GH-112
|
261
|
+
* GH-113
|
262
|
+
* GH-114
|
263
|
+
* GH-115
|
264
|
+
* GH-116
|
265
|
+
* GH-117
|
266
|
+
* GH-118
|
267
|
+
* GH-119
|
268
|
+
* GH-121
|
269
|
+
|
270
|
+
* Patch by NAITOH Jun.
|
271
|
+
|
272
|
+
* Improved parse performance when an attribute has many `<`s.
|
273
|
+
|
274
|
+
* GH-126
|
275
|
+
|
276
|
+
### Fixes
|
277
|
+
|
278
|
+
* XPath: Fixed a bug of `normalize_space(array)`.
|
279
|
+
|
280
|
+
* GH-110
|
281
|
+
* GH-111
|
282
|
+
|
283
|
+
* Patch by flatisland.
|
284
|
+
|
285
|
+
* XPath: Fixed a bug that wrong position is used with nested path.
|
286
|
+
|
287
|
+
* GH-110
|
288
|
+
* GH-122
|
289
|
+
|
290
|
+
* Reported by jcavalieri.
|
291
|
+
* Patch by NAITOH Jun.
|
292
|
+
|
293
|
+
* Fixed a bug that an exception message can't be generated for
|
294
|
+
invalid encoding XML.
|
295
|
+
|
296
|
+
* GH-29
|
297
|
+
* GH-123
|
298
|
+
|
299
|
+
* Reported by DuKewu.
|
300
|
+
* Patch by NAITOH Jun.
|
301
|
+
|
302
|
+
### Thanks
|
303
|
+
|
304
|
+
* NAITOH Jun
|
305
|
+
* flatisland
|
306
|
+
* jcavalieri
|
307
|
+
* DuKewu
|
308
|
+
|
309
|
+
## 3.2.6 - 2023-07-27 {#version-3-2-6}
|
310
|
+
|
311
|
+
### Improvements
|
312
|
+
|
313
|
+
* Required Ruby 2.5 or later explicitly.
|
314
|
+
[GH-69][gh-69]
|
315
|
+
[Patch by Ivo Anjo]
|
316
|
+
|
317
|
+
* Added documentation for maintenance cycle.
|
318
|
+
[GH-71][gh-71]
|
319
|
+
[Patch by Ivo Anjo]
|
320
|
+
|
321
|
+
* Added tutorial.
|
322
|
+
[GH-77][gh-77]
|
323
|
+
[GH-78][gh-78]
|
324
|
+
[Patch by Burdette Lamar]
|
325
|
+
|
326
|
+
* Improved performance and memory usage.
|
327
|
+
[GH-94][gh-94]
|
328
|
+
[Patch by fatkodima]
|
329
|
+
|
330
|
+
* `REXML::Parsers::XPathParser#abbreviate`: Added support for
|
331
|
+
function arguments.
|
332
|
+
[GH-95][gh-95]
|
333
|
+
[Reported by pulver]
|
334
|
+
|
335
|
+
* `REXML::Parsers::XPathParser#abbreviate`: Added support for string
|
336
|
+
literal that contains double-quote.
|
337
|
+
[GH-96][gh-96]
|
338
|
+
[Patch by pulver]
|
339
|
+
|
340
|
+
* `REXML::Parsers::XPathParser#abbreviate`: Added missing `/` to
|
341
|
+
`:descendant_or_self/:self/:parent`.
|
342
|
+
[GH-97][gh-97]
|
343
|
+
[Reported by pulver]
|
344
|
+
|
345
|
+
* `REXML::Parsers::XPathParser#abbreviate`: Added support for more patterns.
|
346
|
+
[GH-97][gh-97]
|
347
|
+
[Reported by pulver]
|
348
|
+
|
349
|
+
### Fixes
|
350
|
+
|
351
|
+
* Fixed a typo in NEWS.
|
352
|
+
[GH-72][gh-72]
|
353
|
+
[Patch by Spencer Goodman]
|
354
|
+
|
355
|
+
* Fixed a typo in NEWS.
|
356
|
+
[GH-75][gh-75]
|
357
|
+
[Patch by Andrew Bromwich]
|
358
|
+
|
359
|
+
* Fixed documents.
|
360
|
+
[GH-87][gh-87]
|
361
|
+
[Patch by Alexander Ilyin]
|
362
|
+
|
363
|
+
* Fixed a bug that `Attriute` convert `'` and `'` even when
|
364
|
+
`attribute_quote: :quote` is used.
|
365
|
+
[GH-92][gh-92]
|
366
|
+
[Reported by Edouard Brière]
|
367
|
+
|
368
|
+
* Fixed links in tutorial.
|
369
|
+
[GH-99][gh-99]
|
370
|
+
[Patch by gemmaro]
|
371
|
+
|
372
|
+
|
373
|
+
### Thanks
|
374
|
+
|
375
|
+
* Ivo Anjo
|
376
|
+
|
377
|
+
* Spencer Goodman
|
378
|
+
|
379
|
+
* Andrew Bromwich
|
380
|
+
|
381
|
+
* Burdette Lamar
|
382
|
+
|
383
|
+
* Alexander Ilyin
|
384
|
+
|
385
|
+
* Edouard Brière
|
386
|
+
|
387
|
+
* fatkodima
|
388
|
+
|
389
|
+
* pulver
|
390
|
+
|
391
|
+
* gemmaro
|
392
|
+
|
393
|
+
[gh-69]:https://github.com/ruby/rexml/issues/69
|
394
|
+
[gh-71]:https://github.com/ruby/rexml/issues/71
|
395
|
+
[gh-72]:https://github.com/ruby/rexml/issues/72
|
396
|
+
[gh-75]:https://github.com/ruby/rexml/issues/75
|
397
|
+
[gh-77]:https://github.com/ruby/rexml/issues/77
|
398
|
+
[gh-87]:https://github.com/ruby/rexml/issues/87
|
399
|
+
[gh-92]:https://github.com/ruby/rexml/issues/92
|
400
|
+
[gh-94]:https://github.com/ruby/rexml/issues/94
|
401
|
+
[gh-95]:https://github.com/ruby/rexml/issues/95
|
402
|
+
[gh-96]:https://github.com/ruby/rexml/issues/96
|
403
|
+
[gh-97]:https://github.com/ruby/rexml/issues/97
|
404
|
+
[gh-98]:https://github.com/ruby/rexml/issues/98
|
405
|
+
[gh-99]:https://github.com/ruby/rexml/issues/99
|
406
|
+
|
3
407
|
## 3.2.5 - 2021-04-05 {#version-3-2-5}
|
4
408
|
|
5
409
|
### Improvements
|
6
410
|
|
7
411
|
* Add more validations to XPath parser.
|
8
412
|
|
9
|
-
* `require "rexml/
|
413
|
+
* `require "rexml/document"` by default.
|
10
414
|
[GitHub#36][Patch by Koichi ITO]
|
11
415
|
|
12
|
-
* Don't add `#
|
416
|
+
* Don't add `#dclone` method to core classes globally.
|
13
417
|
[GitHub#37][Patch by Akira Matsuda]
|
14
418
|
|
15
419
|
* Add more documentations.
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ REXML supports both tree and stream document parsing. Stream parsing is faster (
|
|
6
6
|
|
7
7
|
## API
|
8
8
|
|
9
|
-
See the
|
9
|
+
See the [API documentation](https://ruby.github.io/rexml/).
|
10
10
|
|
11
11
|
## Usage
|
12
12
|
|
@@ -33,6 +33,15 @@ doc = Document.new string
|
|
33
33
|
|
34
34
|
So parsing a string is just as easy as parsing a file.
|
35
35
|
|
36
|
+
## Support
|
37
|
+
|
38
|
+
REXML support follows the same maintenance cycle as Ruby releases, as shown on <https://www.ruby-lang.org/en/downloads/branches/>.
|
39
|
+
|
40
|
+
If you are running on an end-of-life Ruby, do not expect modern REXML releases to be compatible with it; in fact, it's recommended that you DO NOT use this gem, and instead use the REXML version that came bundled with your end-of-life Ruby version.
|
41
|
+
|
42
|
+
The `required_ruby_version` on the gemspec is kept updated on a [best-effort basis](https://github.com/ruby/rexml/pull/70) by the community.
|
43
|
+
Up to version 3.2.5, this information was not set. That version [is known broken with at least Ruby < 2.3](https://github.com/ruby/rexml/issues/69).
|
44
|
+
|
36
45
|
## Development
|
37
46
|
|
38
47
|
After checking out the repo, run `rake test` to run the tests.
|
@@ -369,7 +369,7 @@ to retrieve the first text node in a specified element:
|
|
369
369
|
|
370
370
|
Use method
|
371
371
|
{Element#has_text?}[../../../../REXML/Element.html#method-i-has_text-3F]
|
372
|
-
to determine
|
372
|
+
to determine whether the element has text:
|
373
373
|
|
374
374
|
e = REXML::Element.new('foo')
|
375
375
|
e.has_text? # => false
|
@@ -486,7 +486,7 @@ to remove a specific namespace from the element:
|
|
486
486
|
|
487
487
|
Use method
|
488
488
|
{Element#namespace}[../../../../REXML/Element.html#method-i-namespace]
|
489
|
-
to retrieve a
|
489
|
+
to retrieve a specific namespace URI for the element:
|
490
490
|
|
491
491
|
xml_string = <<-EOT
|
492
492
|
<root>
|