e621_export_downloader 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. checksums.yaml +7 -0
  2. data/.irbrc +14 -0
  3. data/.ruby-version +1 -0
  4. data/LICENSE +21 -0
  5. data/README.md +148 -0
  6. data/Rakefile +8 -0
  7. data/exe/e621-export-downloader +112 -0
  8. data/lib/e621_export_downloader/client/options/builder/parsers.rb +42 -0
  9. data/lib/e621_export_downloader/client/options/builder.rb +44 -0
  10. data/lib/e621_export_downloader/client/options.rb +37 -0
  11. data/lib/e621_export_downloader/client.rb +120 -0
  12. data/lib/e621_export_downloader/constants.rb +17 -0
  13. data/lib/e621_export_downloader/export.rb +128 -0
  14. data/lib/e621_export_downloader/export_helper.rb +83 -0
  15. data/lib/e621_export_downloader/models/pool.rb +69 -0
  16. data/lib/e621_export_downloader/models/post.rb +166 -0
  17. data/lib/e621_export_downloader/models/tag.rb +41 -0
  18. data/lib/e621_export_downloader/models/tag_alias.rb +46 -0
  19. data/lib/e621_export_downloader/models/tag_implication.rb +46 -0
  20. data/lib/e621_export_downloader/models/wiki_page.rb +61 -0
  21. data/lib/e621_export_downloader/types.rb +14 -0
  22. data/lib/e621_export_downloader/version.rb +10 -0
  23. data/lib/e621_export_downloader.rb +12 -0
  24. data/sorbet/config +5 -0
  25. data/sorbet/rbi/annotations/.gitattributes +1 -0
  26. data/sorbet/rbi/annotations/faraday.rbi +17 -0
  27. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  28. data/sorbet/rbi/gems/.gitattributes +1 -0
  29. data/sorbet/rbi/gems/ast@2.4.3.rbi +550 -0
  30. data/sorbet/rbi/gems/benchmark@0.5.0.rbi +621 -0
  31. data/sorbet/rbi/gems/csv@3.3.5.rbi +4462 -0
  32. data/sorbet/rbi/gems/date@3.5.1.rbi +391 -0
  33. data/sorbet/rbi/gems/erb@6.0.4.rbi +1538 -0
  34. data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
  35. data/sorbet/rbi/gems/faraday-net_http@3.4.2.rbi +9 -0
  36. data/sorbet/rbi/gems/faraday@2.14.1.rbi +9 -0
  37. data/sorbet/rbi/gems/io-console@0.8.2.rbi +9 -0
  38. data/sorbet/rbi/gems/json@2.19.5.rbi +2240 -0
  39. data/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi +9 -0
  40. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +189 -0
  41. data/sorbet/rbi/gems/logger@1.7.0.rbi +896 -0
  42. data/sorbet/rbi/gems/net-http@0.9.1.rbi +4029 -0
  43. data/sorbet/rbi/gems/netrc@0.11.0.rbi +147 -0
  44. data/sorbet/rbi/gems/parallel@2.1.0.rbi +321 -0
  45. data/sorbet/rbi/gems/parser@3.3.11.1.rbi +5229 -0
  46. data/sorbet/rbi/gems/pp@0.6.3.rbi +377 -0
  47. data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +455 -0
  48. data/sorbet/rbi/gems/prism@1.9.0.rbi +42224 -0
  49. data/sorbet/rbi/gems/psych@5.3.1.rbi +2374 -0
  50. data/sorbet/rbi/gems/racc@1.8.1.rbi +165 -0
  51. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +362 -0
  52. data/sorbet/rbi/gems/rake@13.4.2.rbi +3130 -0
  53. data/sorbet/rbi/gems/rbi@0.3.11.rbi +5505 -0
  54. data/sorbet/rbi/gems/rbs@4.0.2.rbi +6908 -0
  55. data/sorbet/rbi/gems/rdoc@7.2.0.rbi +9 -0
  56. data/sorbet/rbi/gems/regexp_parser@2.12.0.rbi +3398 -0
  57. data/sorbet/rbi/gems/reline@0.6.3.rbi +2446 -0
  58. data/sorbet/rbi/gems/require-hooks@0.4.0.rbi +152 -0
  59. data/sorbet/rbi/gems/rexml@3.4.4.rbi +4905 -0
  60. data/sorbet/rbi/gems/rubocop-ast@1.49.1.rbi +7062 -0
  61. data/sorbet/rbi/gems/rubocop-rake@0.7.1.rbi +314 -0
  62. data/sorbet/rbi/gems/rubocop@1.86.1.rbi +62227 -0
  63. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +988 -0
  64. data/sorbet/rbi/gems/rubydex@0.2.0.rbi +663 -0
  65. data/sorbet/rbi/gems/spoom@1.7.13.rbi +6151 -0
  66. data/sorbet/rbi/gems/stringio@3.2.0.rbi +9 -0
  67. data/sorbet/rbi/gems/tapioca@0.19.1.rbi +3555 -0
  68. data/sorbet/rbi/gems/thor@1.5.0.rbi +3870 -0
  69. data/sorbet/rbi/gems/tsort@0.2.0.rbi +389 -0
  70. data/sorbet/rbi/gems/unicode-display_width@3.2.0.rbi +130 -0
  71. data/sorbet/rbi/gems/unicode-emoji@4.2.0.rbi +332 -0
  72. data/sorbet/rbi/gems/uri@1.1.1.rbi +2400 -0
  73. data/sorbet/rbi/gems/zeitwerk@2.7.5.rbi +1090 -0
  74. data/sorbet/rbi/shims/faraday.rbi +42 -0
  75. data/sorbet/rbi/todo.rbi +7 -0
  76. data/sorbet/tapioca/config.yml +13 -0
  77. data/sorbet/tapioca/require.rb +4 -0
  78. metadata +177 -0
@@ -0,0 +1,4905 @@
1
+ # typed: false
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `rexml` gem.
5
+ # Please instead update this file by running `bin/tapioca gem rexml`.
6
+
7
+
8
+ # This class needs:
9
+ # * Documentation
10
+ # * Work! Not all types of attlists are intelligently parsed, so we just
11
+ # spew back out what we get in. This works, but it would be better if
12
+ # we formatted the output ourselves.
13
+ #
14
+ # AttlistDecls provide *just* enough support to allow namespace
15
+ # declarations. If you need some sort of generalized support, or have an
16
+ # interesting idea about how to map the hideous, terrible design of DTD
17
+ # AttlistDecls onto an intuitive Ruby interface, let me know. I'm desperate
18
+ # for anything to make DTDs more palateable.
19
+ #
20
+ # pkg:gem/rexml#lib/rexml/attlistdecl.rb:18
21
+ class REXML::AttlistDecl < ::REXML::Child
22
+ include ::Enumerable
23
+
24
+ # Create an AttlistDecl, pulling the information from a Source. Notice
25
+ # that this isn't very convenient; to create an AttlistDecl, you basically
26
+ # have to format it yourself, and then have the initializer parse it.
27
+ # Sorry, but for the foreseeable future, DTD support in REXML is pretty
28
+ # weak on convenience. Have I mentioned how much I hate DTDs?
29
+ #
30
+ # pkg:gem/rexml#lib/rexml/attlistdecl.rb:29
31
+ def initialize(source); end
32
+
33
+ # Access the attlist attribute/value pairs.
34
+ # value = attlist_decl[ attribute_name ]
35
+ #
36
+ # pkg:gem/rexml#lib/rexml/attlistdecl.rb:38
37
+ def [](key); end
38
+
39
+ # Iterate over the key/value pairs:
40
+ # attlist_decl.each { |attribute_name, attribute_value| ... }
41
+ #
42
+ # pkg:gem/rexml#lib/rexml/attlistdecl.rb:50
43
+ def each(&block); end
44
+
45
+ # What is this? Got me.
46
+ #
47
+ # pkg:gem/rexml#lib/rexml/attlistdecl.rb:22
48
+ def element_name; end
49
+
50
+ # Whether an attlist declaration includes the given attribute definition
51
+ # if attlist_decl.include? "xmlns:foobar"
52
+ #
53
+ # pkg:gem/rexml#lib/rexml/attlistdecl.rb:44
54
+ def include?(key); end
55
+
56
+ # pkg:gem/rexml#lib/rexml/attlistdecl.rb:59
57
+ def node_type; end
58
+
59
+ # Write out exactly what we got in.
60
+ #
61
+ # pkg:gem/rexml#lib/rexml/attlistdecl.rb:55
62
+ def write(out, indent = T.unsafe(nil)); end
63
+ end
64
+
65
+ # Defines an Element Attribute; IE, a attribute=value pair, as in:
66
+ # <element attribute="value"/>. Attributes can be in their own
67
+ # namespaces. General users of REXML will not interact with the
68
+ # Attribute class much.
69
+ #
70
+ # pkg:gem/rexml#lib/rexml/attribute.rb:10
71
+ class REXML::Attribute
72
+ include ::REXML::Node
73
+ include ::REXML::XMLTokens
74
+ include ::REXML::Namespace
75
+
76
+ # Constructor.
77
+ # FIXME: The parser doesn't catch illegal characters in attributes
78
+ #
79
+ # first::
80
+ # Either: an Attribute, which this new attribute will become a
81
+ # clone of; or a String, which is the name of this attribute
82
+ # second::
83
+ # If +first+ is an Attribute, then this may be an Element, or nil.
84
+ # If nil, then the Element parent of this attribute is the parent
85
+ # of the +first+ Attribute. If the first argument is a String,
86
+ # then this must also be a String, and is the content of the attribute.
87
+ # If this is the content, it must be fully normalized (contain no
88
+ # illegal characters).
89
+ # parent::
90
+ # Ignored unless +first+ is a String; otherwise, may be the Element
91
+ # parent of this attribute, or nil.
92
+ #
93
+ #
94
+ # Attribute.new( attribute_to_clone )
95
+ # Attribute.new( attribute_to_clone, parent_element )
96
+ # Attribute.new( "attr", "attr_value" )
97
+ # Attribute.new( "attr", "attr_value", parent_element )
98
+ #
99
+ # pkg:gem/rexml#lib/rexml/attribute.rb:42
100
+ def initialize(first, second = T.unsafe(nil), parent = T.unsafe(nil)); end
101
+
102
+ # Returns true if other is an Attribute and has the same name and value,
103
+ # false otherwise.
104
+ #
105
+ # pkg:gem/rexml#lib/rexml/attribute.rb:106
106
+ def ==(other); end
107
+
108
+ # Returns a copy of this attribute
109
+ #
110
+ # pkg:gem/rexml#lib/rexml/attribute.rb:161
111
+ def clone; end
112
+
113
+ # pkg:gem/rexml#lib/rexml/attribute.rb:132
114
+ def doctype; end
115
+
116
+ # pkg:gem/rexml#lib/rexml/attribute.rb:205
117
+ def document; end
118
+
119
+ # The element to which this attribute belongs
120
+ #
121
+ # pkg:gem/rexml#lib/rexml/attribute.rb:15
122
+ def element; end
123
+
124
+ # Sets the element of which this object is an attribute. Normally, this
125
+ # is not directly called.
126
+ #
127
+ # Returns this attribute
128
+ #
129
+ # pkg:gem/rexml#lib/rexml/attribute.rb:169
130
+ def element=(element); end
131
+
132
+ # Creates (and returns) a hash from both the name and value
133
+ #
134
+ # pkg:gem/rexml#lib/rexml/attribute.rb:111
135
+ def hash; end
136
+
137
+ # pkg:gem/rexml#lib/rexml/attribute.rb:195
138
+ def inspect; end
139
+
140
+ # Returns the namespace URL, if defined, or nil otherwise
141
+ #
142
+ # e = Element.new("el")
143
+ # e.add_namespace("ns", "http://url")
144
+ # e.add_attribute("ns:a", "b")
145
+ # e.add_attribute("nsx:a", "c")
146
+ # e.attribute("ns:a").namespace # => "http://url"
147
+ # e.attribute("nsx:a").namespace # => nil
148
+ #
149
+ # This method always returns "" for no namespace attribute. Because
150
+ # the default namespace doesn't apply to attribute names.
151
+ #
152
+ # From https://www.w3.org/TR/xml-names/#uniqAttrs
153
+ #
154
+ # > the default namespace does not apply to attribute names
155
+ #
156
+ # e = REXML::Element.new("el")
157
+ # e.add_namespace("", "http://example.com/")
158
+ # e.namespace # => "http://example.com/"
159
+ # e.add_attribute("a", "b")
160
+ # e.attribute("a").namespace # => ""
161
+ #
162
+ # pkg:gem/rexml#lib/rexml/attribute.rb:95
163
+ def namespace(arg = T.unsafe(nil)); end
164
+
165
+ # pkg:gem/rexml#lib/rexml/attribute.rb:191
166
+ def node_type; end
167
+
168
+ # The normalized value of this attribute. That is, the attribute with
169
+ # entities intact.
170
+ #
171
+ # pkg:gem/rexml#lib/rexml/attribute.rb:155
172
+ def normalized=(new_normalized); end
173
+
174
+ # Returns the namespace of the attribute.
175
+ #
176
+ # e = Element.new( "elns:myelement" )
177
+ # e.add_attribute( "nsa:a", "aval" )
178
+ # e.add_attribute( "b", "bval" )
179
+ # e.attributes.get_attribute( "a" ).prefix # -> "nsa"
180
+ # e.attributes.get_attribute( "b" ).prefix # -> ""
181
+ # a = Attribute.new( "x", "y" )
182
+ # a.prefix # -> ""
183
+ #
184
+ # pkg:gem/rexml#lib/rexml/attribute.rb:70
185
+ def prefix; end
186
+
187
+ # Removes this Attribute from the tree, and returns true if successful
188
+ #
189
+ # This method is usually not called directly.
190
+ #
191
+ # pkg:gem/rexml#lib/rexml/attribute.rb:182
192
+ def remove; end
193
+
194
+ # Returns the attribute value, with entities replaced
195
+ #
196
+ # pkg:gem/rexml#lib/rexml/attribute.rb:137
197
+ def to_s; end
198
+
199
+ # Returns this attribute out as XML source, expanding the name
200
+ #
201
+ # a = Attribute.new( "x", "y" )
202
+ # a.to_string # -> "x='y'"
203
+ # b = Attribute.new( "ns:x", "y" )
204
+ # b.to_string # -> "ns:x='y'"
205
+ #
206
+ # pkg:gem/rexml#lib/rexml/attribute.rb:121
207
+ def to_string; end
208
+
209
+ # Returns the UNNORMALIZED value of this attribute. That is, entities
210
+ # have been expanded to their values
211
+ #
212
+ # pkg:gem/rexml#lib/rexml/attribute.rb:146
213
+ def value; end
214
+
215
+ # Writes this attribute (EG, puts 'key="value"' to the output)
216
+ #
217
+ # pkg:gem/rexml#lib/rexml/attribute.rb:187
218
+ def write(output, indent = T.unsafe(nil)); end
219
+
220
+ # pkg:gem/rexml#lib/rexml/attribute.rb:201
221
+ def xpath; end
222
+ end
223
+
224
+ # A class that defines the set of Attributes of an Element and provides
225
+ # operations for accessing elements in that set.
226
+ #
227
+ # pkg:gem/rexml#lib/rexml/element.rb:2131
228
+ class REXML::Attributes < ::Hash
229
+ # :call-seq:
230
+ # new(element)
231
+ #
232
+ # Creates and returns a new \REXML::Attributes object.
233
+ # The element given by argument +element+ is stored,
234
+ # but its own attributes are not modified:
235
+ #
236
+ # ele = REXML::Element.new('foo')
237
+ # attrs = REXML::Attributes.new(ele)
238
+ # attrs.object_id == ele.attributes.object_id # => false
239
+ #
240
+ # Other instance methods in class \REXML::Attributes may refer to:
241
+ #
242
+ # - +element.document+.
243
+ # - +element.prefix+.
244
+ # - +element.expanded_name+.
245
+ #
246
+ # pkg:gem/rexml#lib/rexml/element.rb:2150
247
+ def initialize(element); end
248
+
249
+ # pkg:gem/rexml#lib/rexml/element.rb:2520
250
+ def <<(attribute); end
251
+
252
+ # :call-seq:
253
+ # [name] -> attribute_value or nil
254
+ #
255
+ # Returns the value for the attribute given by +name+,
256
+ # if it exists; otherwise +nil+.
257
+ # The value returned is the unnormalized attribute value,
258
+ # with entities expanded:
259
+ #
260
+ # xml_string = <<-EOT
261
+ # <root xmlns:foo="http://foo" xmlns:bar="http://bar">
262
+ # <ele foo:att='1' bar:att='2' att='&lt;'/>
263
+ # </root>
264
+ # EOT
265
+ # d = REXML::Document.new(xml_string)
266
+ # ele = d.elements['//ele'] # => <a foo:att='1' bar:att='2' att='&lt;'/>
267
+ # ele.attributes['att'] # => "<"
268
+ # ele.attributes['bar:att'] # => "2"
269
+ # ele.attributes['nosuch'] # => nil
270
+ #
271
+ # Related: get_attribute (returns an \Attribute object).
272
+ #
273
+ # pkg:gem/rexml#lib/rexml/element.rb:2175
274
+ def [](name); end
275
+
276
+ # :call-seq:
277
+ # [name] = value -> value
278
+ #
279
+ # When +value+ is non-+nil+,
280
+ # assigns that to the attribute for the given +name+,
281
+ # overwriting the previous value if it exists:
282
+ #
283
+ # xml_string = <<-EOT
284
+ # <root xmlns:foo="http://foo" xmlns:bar="http://bar">
285
+ # <ele foo:att='1' bar:att='2' att='&lt;'/>
286
+ # </root>
287
+ # EOT
288
+ # d = REXML::Document.new(xml_string)
289
+ # ele = d.root.elements['//ele'] # => <a foo:att='1' bar:att='2' att='&lt;'/>
290
+ # attrs = ele.attributes
291
+ # attrs['foo:att'] = '2' # => "2"
292
+ # attrs['baz:att'] = '3' # => "3"
293
+ #
294
+ # When +value+ is +nil+, deletes the attribute if it exists:
295
+ #
296
+ # attrs['baz:att'] = nil
297
+ # attrs.include?('baz:att') # => false
298
+ #
299
+ # pkg:gem/rexml#lib/rexml/element.rb:2358
300
+ def []=(name, value); end
301
+
302
+ # :call-seq:
303
+ # add(attribute) -> attribute
304
+ #
305
+ # Adds attribute +attribute+, replacing the previous
306
+ # attribute of the same name if it exists;
307
+ # returns +attribute+:
308
+ #
309
+ # xml_string = <<-EOT
310
+ # <root xmlns:foo="http://foo" xmlns:bar="http://bar">
311
+ # <ele foo:att='1' bar:att='2' att='&lt;'/>
312
+ # </root>
313
+ # EOT
314
+ # d = REXML::Document.new(xml_string)
315
+ # ele = d.root.elements['//ele'] # => <a foo:att='1' bar:att='2' att='&lt;'/>
316
+ # attrs = ele.attributes
317
+ # attrs # => {"att"=>{"foo"=>foo:att='1', "bar"=>bar:att='2', ""=>att='&lt;'}}
318
+ # attrs.add(REXML::Attribute.new('foo:att', '2')) # => foo:att='2'
319
+ # attrs.add(REXML::Attribute.new('baz', '3')) # => baz='3'
320
+ # attrs.include?('baz') # => true
321
+ #
322
+ # pkg:gem/rexml#lib/rexml/element.rb:2516
323
+ def add(attribute); end
324
+
325
+ # :call-seq:
326
+ # delete(name) -> element
327
+ # delete(attribute) -> element
328
+ #
329
+ # Removes a specified attribute if it exists;
330
+ # returns the attributes' element.
331
+ #
332
+ # When string argument +name+ is given,
333
+ # removes the attribute of that name if it exists:
334
+ #
335
+ # xml_string = <<-EOT
336
+ # <root xmlns:foo="http://foo" xmlns:bar="http://bar">
337
+ # <ele foo:att='1' bar:att='2' att='&lt;'/>
338
+ # </root>
339
+ # EOT
340
+ # d = REXML::Document.new(xml_string)
341
+ # ele = d.root.elements['//ele'] # => <a foo:att='1' bar:att='2' att='&lt;'/>
342
+ # attrs = ele.attributes
343
+ # attrs.delete('foo:att') # => <ele bar:att='2' att='&lt;'/>
344
+ # attrs.delete('foo:att') # => <ele bar:att='2' att='&lt;'/>
345
+ #
346
+ # When attribute argument +attribute+ is given,
347
+ # removes that attribute if it exists:
348
+ #
349
+ # attr = REXML::Attribute.new('bar:att', '2')
350
+ # attrs.delete(attr) # => <ele att='&lt;'/> # => <ele att='&lt;'/>
351
+ # attrs.delete(attr) # => <ele att='&lt;'/> # => <ele/>
352
+ #
353
+ # pkg:gem/rexml#lib/rexml/element.rb:2471
354
+ def delete(attribute); end
355
+
356
+ # :call-seq:
357
+ # delete_all(name) -> array_of_removed_attributes
358
+ #
359
+ # Removes all attributes matching the given +name+;
360
+ # returns an array of the removed attributes:
361
+ #
362
+ # xml_string = <<-EOT
363
+ # <root xmlns:foo="http://foo" xmlns:bar="http://bar">
364
+ # <ele foo:att='1' bar:att='2' att='&lt;'/>
365
+ # </root>
366
+ # EOT
367
+ # d = REXML::Document.new(xml_string)
368
+ # ele = d.root.elements['//ele'] # => <a foo:att='1' bar:att='2' att='&lt;'/>
369
+ # attrs = ele.attributes
370
+ # attrs.delete_all('att') # => [att='&lt;']
371
+ #
372
+ # pkg:gem/rexml#lib/rexml/element.rb:2538
373
+ def delete_all(name); end
374
+
375
+ # :call-seq:
376
+ # each {|expanded_name, value| ... }
377
+ #
378
+ # Calls the given block with each expanded-name/value pair:
379
+ #
380
+ # xml_string = <<-EOT
381
+ # <root xmlns:foo="http://foo" xmlns:bar="http://bar">
382
+ # <ele foo:att='1' bar:att='2' att='&lt;'/>
383
+ # </root>
384
+ # EOT
385
+ # d = REXML::Document.new(xml_string)
386
+ # ele = d.root.elements['//ele'] # => <a foo:att='1' bar:att='2' att='&lt;'/>
387
+ # ele.attributes.each do |expanded_name, value|
388
+ # p [expanded_name, value]
389
+ # end
390
+ #
391
+ # Output:
392
+ #
393
+ # ["foo:att", "1"]
394
+ # ["bar:att", "2"]
395
+ # ["att", "<"]
396
+ #
397
+ # pkg:gem/rexml#lib/rexml/element.rb:2276
398
+ def each; end
399
+
400
+ # :call-seq:
401
+ # each_attribute {|attr| ... }
402
+ #
403
+ # Calls the given block with each \REXML::Attribute object:
404
+ #
405
+ # xml_string = <<-EOT
406
+ # <root xmlns:foo="http://foo" xmlns:bar="http://bar">
407
+ # <ele foo:att='1' bar:att='2' att='&lt;'/>
408
+ # </root>
409
+ # EOT
410
+ # d = REXML::Document.new(xml_string)
411
+ # ele = d.root.elements['//ele'] # => <a foo:att='1' bar:att='2' att='&lt;'/>
412
+ # ele.attributes.each_attribute do |attr|
413
+ # p [attr.class, attr]
414
+ # end
415
+ #
416
+ # Output:
417
+ #
418
+ # [REXML::Attribute, foo:att='1']
419
+ # [REXML::Attribute, bar:att='2']
420
+ # [REXML::Attribute, att='&lt;']
421
+ #
422
+ # pkg:gem/rexml#lib/rexml/element.rb:2243
423
+ def each_attribute; end
424
+
425
+ # :call-seq:
426
+ # get_attribute(name) -> attribute_object or nil
427
+ #
428
+ # Returns the \REXML::Attribute object for the given +name+:
429
+ #
430
+ # xml_string = <<-EOT
431
+ # <root xmlns:foo="http://foo" xmlns:bar="http://bar">
432
+ # <ele foo:att='1' bar:att='2' att='&lt;'/>
433
+ # </root>
434
+ # EOT
435
+ # d = REXML::Document.new(xml_string)
436
+ # ele = d.root.elements['//ele'] # => <a foo:att='1' bar:att='2' att='&lt;'/>
437
+ # attrs = ele.attributes
438
+ # attrs.get_attribute('foo:att') # => foo:att='1'
439
+ # attrs.get_attribute('foo:att').class # => REXML::Attribute
440
+ # attrs.get_attribute('bar:att') # => bar:att='2'
441
+ # attrs.get_attribute('att') # => att='&lt;'
442
+ # attrs.get_attribute('nosuch') # => nil
443
+ #
444
+ # pkg:gem/rexml#lib/rexml/element.rb:2302
445
+ def get_attribute(name); end
446
+
447
+ # :call-seq:
448
+ # get_attribute_ns(namespace, name)
449
+ #
450
+ # Returns the \REXML::Attribute object among the attributes
451
+ # that matches the given +namespace+ and +name+:
452
+ #
453
+ # xml_string = <<-EOT
454
+ # <root xmlns:foo="http://foo" xmlns:bar="http://bar">
455
+ # <ele foo:att='1' bar:att='2' att='&lt;'/>
456
+ # </root>
457
+ # EOT
458
+ # d = REXML::Document.new(xml_string)
459
+ # ele = d.root.elements['//ele'] # => <a foo:att='1' bar:att='2' att='&lt;'/>
460
+ # attrs = ele.attributes
461
+ # attrs.get_attribute_ns('http://foo', 'att') # => foo:att='1'
462
+ # attrs.get_attribute_ns('http://foo', 'nosuch') # => nil
463
+ #
464
+ # pkg:gem/rexml#lib/rexml/element.rb:2564
465
+ def get_attribute_ns(namespace, name); end
466
+
467
+ # :call-seq:
468
+ # length
469
+ #
470
+ # Returns the count of attributes:
471
+ #
472
+ # xml_string = <<-EOT
473
+ # <root xmlns:foo="http://foo" xmlns:bar="http://bar">
474
+ # <ele foo:att='1' bar:att='2' att='&lt;'/>
475
+ # </root>
476
+ # EOT
477
+ # d = REXML::Document.new(xml_string)
478
+ # ele = d.root.elements['//ele'] # => <a foo:att='1' bar:att='2' att='&lt;'/>
479
+ # ele.attributes.length # => 3
480
+ #
481
+ # pkg:gem/rexml#lib/rexml/element.rb:2214
482
+ def length; end
483
+
484
+ # :call-seq:
485
+ # namespaces
486
+ #
487
+ # Returns a hash of name/value pairs for the namespaces:
488
+ #
489
+ # xml_string = '<a xmlns="foo" xmlns:x="bar" xmlns:y="twee" z="glorp"/>'
490
+ # d = REXML::Document.new(xml_string)
491
+ # d.root.attributes.namespaces # => {"xmlns"=>"foo", "x"=>"bar", "y"=>"twee"}
492
+ #
493
+ # pkg:gem/rexml#lib/rexml/element.rb:2426
494
+ def namespaces; end
495
+
496
+ # :call-seq:
497
+ # prefixes -> array_of_prefix_strings
498
+ #
499
+ # Returns an array of prefix strings in the attributes.
500
+ # The array does not include the default
501
+ # namespace declaration, if one exists.
502
+ #
503
+ # xml_string = '<a xmlns="foo" xmlns:x="bar" xmlns:y="twee" z="glorp"/>'
504
+ # d = REXML::Document.new(xml_string)
505
+ # d.root.attributes.prefixes # => ["x", "y"]
506
+ #
507
+ # pkg:gem/rexml#lib/rexml/element.rb:2400
508
+ def prefixes; end
509
+
510
+ # pkg:gem/rexml#lib/rexml/element.rb:2219
511
+ def size; end
512
+
513
+ # :call-seq:
514
+ # to_a -> array_of_attribute_objects
515
+ #
516
+ # Returns an array of \REXML::Attribute objects representing
517
+ # the attributes:
518
+ #
519
+ # xml_string = <<-EOT
520
+ # <root xmlns:foo="http://foo" xmlns:bar="http://bar">
521
+ # <ele foo:att='1' bar:att='2' att='&lt;'/>
522
+ # </root>
523
+ # EOT
524
+ # d = REXML::Document.new(xml_string)
525
+ # ele = d.root.elements['//ele'] # => <a foo:att='1' bar:att='2' att='&lt;'/>
526
+ # attrs = ele.attributes.to_a # => [foo:att='1', bar:att='2', att='&lt;']
527
+ # attrs.first.class # => REXML::Attribute
528
+ #
529
+ # pkg:gem/rexml#lib/rexml/element.rb:2196
530
+ def to_a; end
531
+ end
532
+
533
+ # pkg:gem/rexml#lib/rexml/cdata.rb:5
534
+ class REXML::CData < ::REXML::Text
535
+ # Constructor. CData is data between <![CDATA[ ... ]]>
536
+ #
537
+ # _Examples_
538
+ # CData.new( source )
539
+ # CData.new( "Here is some CDATA" )
540
+ # CData.new( "Some unprocessed data", respect_whitespace_TF, parent_element )
541
+ #
542
+ # pkg:gem/rexml#lib/rexml/cdata.rb:16
543
+ def initialize(first, whitespace = T.unsafe(nil), parent = T.unsafe(nil)); end
544
+
545
+ # Make a copy of this object
546
+ #
547
+ # _Examples_
548
+ # c = CData.new( "Some text" )
549
+ # d = c.clone
550
+ # d.to_s # -> "Some text"
551
+ #
552
+ # pkg:gem/rexml#lib/rexml/cdata.rb:26
553
+ def clone; end
554
+
555
+ # Returns the content of this CData object
556
+ #
557
+ # _Examples_
558
+ # c = CData.new( "Some text" )
559
+ # c.to_s # -> "Some text"
560
+ #
561
+ # pkg:gem/rexml#lib/rexml/cdata.rb:35
562
+ def to_s; end
563
+
564
+ # pkg:gem/rexml#lib/rexml/cdata.rb:39
565
+ def value; end
566
+
567
+ # == DEPRECATED
568
+ # See the rexml/formatters package
569
+ #
570
+ # Generates XML output of this object
571
+ #
572
+ # output::
573
+ # Where to write the string. Defaults to $stdout
574
+ # indent::
575
+ # The amount to indent this node by
576
+ # transitive::
577
+ # Ignored
578
+ # ie_hack::
579
+ # Ignored
580
+ #
581
+ # _Examples_
582
+ # c = CData.new( " Some text " )
583
+ # c.write( $stdout ) #-> <![CDATA[ Some text ]]>
584
+ #
585
+ # pkg:gem/rexml#lib/rexml/cdata.rb:60
586
+ def write(output = T.unsafe(nil), indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
587
+ end
588
+
589
+ # A Child object is something contained by a parent, and this class
590
+ # contains methods to support that. Most user code will not use this
591
+ # class directly.
592
+ #
593
+ # pkg:gem/rexml#lib/rexml/child.rb:9
594
+ class REXML::Child
595
+ include ::REXML::Node
596
+
597
+ # Constructor. Any inheritors of this class should call super to make
598
+ # sure this method is called.
599
+ # parent::
600
+ # if supplied, the parent of this child will be set to the
601
+ # supplied value, and self will be added to the parent
602
+ #
603
+ # pkg:gem/rexml#lib/rexml/child.rb:18
604
+ def initialize(parent = T.unsafe(nil)); end
605
+
606
+ # This doesn't yet handle encodings
607
+ #
608
+ # pkg:gem/rexml#lib/rexml/child.rb:90
609
+ def bytes; end
610
+
611
+ # Returns:: the document this child belongs to, or nil if this child
612
+ # belongs to no document
613
+ #
614
+ # pkg:gem/rexml#lib/rexml/child.rb:85
615
+ def document; end
616
+
617
+ # pkg:gem/rexml#lib/rexml/child.rb:58
618
+ def next_sibling; end
619
+
620
+ # Sets the next sibling of this child. This can be used to insert a child
621
+ # after some other child.
622
+ # a = Element.new("a")
623
+ # b = a.add_element("b")
624
+ # c = Element.new("c")
625
+ # b.next_sibling = c
626
+ # # => <a><b/><c/></a>
627
+ #
628
+ # pkg:gem/rexml#lib/rexml/child.rb:68
629
+ def next_sibling=(other); end
630
+
631
+ # pkg:gem/rexml#lib/rexml/child.rb:11
632
+ def parent; end
633
+
634
+ # Sets the parent of this child to the supplied argument.
635
+ #
636
+ # other::
637
+ # Must be a Parent object. If this object is the same object as the
638
+ # existing parent of this child, no action is taken. Otherwise, this
639
+ # child is removed from the current parent (if one exists), and is added
640
+ # to the new parent.
641
+ # Returns:: The parent added
642
+ #
643
+ # pkg:gem/rexml#lib/rexml/child.rb:52
644
+ def parent=(other); end
645
+
646
+ # pkg:gem/rexml#lib/rexml/child.rb:59
647
+ def previous_sibling; end
648
+
649
+ # Sets the previous sibling of this child. This can be used to insert a
650
+ # child before some other child.
651
+ # a = Element.new("a")
652
+ # b = a.add_element("b")
653
+ # c = Element.new("c")
654
+ # b.previous_sibling = c
655
+ # # => <a><b/><c/></a>
656
+ #
657
+ # pkg:gem/rexml#lib/rexml/child.rb:79
658
+ def previous_sibling=(other); end
659
+
660
+ # Removes this child from the parent.
661
+ #
662
+ # Returns:: self
663
+ #
664
+ # pkg:gem/rexml#lib/rexml/child.rb:37
665
+ def remove; end
666
+
667
+ # Replaces this object with another object. Basically, calls
668
+ # Parent.replace_child
669
+ #
670
+ # Returns:: self
671
+ #
672
+ # pkg:gem/rexml#lib/rexml/child.rb:29
673
+ def replace_with(child); end
674
+ end
675
+
676
+ # Represents an XML comment; that is, text between \<!-- ... -->
677
+ #
678
+ # pkg:gem/rexml#lib/rexml/comment.rb:7
679
+ class REXML::Comment < ::REXML::Child
680
+ include ::Comparable
681
+
682
+ # Constructor. The first argument can be one of three types:
683
+ # @param first If String, the contents of this comment are set to the
684
+ # argument. If Comment, the argument is duplicated. If
685
+ # Source, the argument is scanned for a comment.
686
+ # @param second If the first argument is a Source, this argument
687
+ # should be nil, not supplied, or a Parent to be set as the parent
688
+ # of this object
689
+ #
690
+ # pkg:gem/rexml#lib/rexml/comment.rb:24
691
+ def initialize(first, second = T.unsafe(nil)); end
692
+
693
+ # Compares this Comment to another; the contents of the comment are used
694
+ # in the comparison.
695
+ #
696
+ # pkg:gem/rexml#lib/rexml/comment.rb:63
697
+ def <=>(other); end
698
+
699
+ # Compares this Comment to another; the contents of the comment are used
700
+ # in the comparison.
701
+ #
702
+ # pkg:gem/rexml#lib/rexml/comment.rb:70
703
+ def ==(other); end
704
+
705
+ # pkg:gem/rexml#lib/rexml/comment.rb:33
706
+ def clone; end
707
+
708
+ # pkg:gem/rexml#lib/rexml/comment.rb:75
709
+ def node_type; end
710
+
711
+ # The content text
712
+ #
713
+ # pkg:gem/rexml#lib/rexml/comment.rb:14
714
+ def string; end
715
+
716
+ # The content text
717
+ #
718
+ # pkg:gem/rexml#lib/rexml/comment.rb:14
719
+ def string=(_arg0); end
720
+
721
+ # pkg:gem/rexml#lib/rexml/comment.rb:58
722
+ def to_s; end
723
+
724
+ # == DEPRECATED
725
+ # See REXML::Formatters
726
+ #
727
+ # output::
728
+ # Where to write the string
729
+ # indent::
730
+ # An integer. If -1, no indenting will be used; otherwise, the
731
+ # indentation will be this number of spaces, and children will be
732
+ # indented an additional amount.
733
+ # transitive::
734
+ # Ignored by this class. The contents of comments are never modified.
735
+ # ie_hack::
736
+ # Needed for conformity to the child API, but not used by this class.
737
+ #
738
+ # pkg:gem/rexml#lib/rexml/comment.rb:50
739
+ def write(output, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
740
+ end
741
+
742
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:11
743
+ module REXML::DClonable; end
744
+
745
+ # This is an abstract class. You never use this directly; it serves as a
746
+ # parent class for the specific declarations.
747
+ #
748
+ # pkg:gem/rexml#lib/rexml/doctype.rb:238
749
+ class REXML::Declaration < ::REXML::Child
750
+ # pkg:gem/rexml#lib/rexml/doctype.rb:239
751
+ def initialize(src); end
752
+
753
+ # pkg:gem/rexml#lib/rexml/doctype.rb:244
754
+ def to_s; end
755
+
756
+ # == DEPRECATED
757
+ # See REXML::Formatters
758
+ #
759
+ # pkg:gem/rexml#lib/rexml/doctype.rb:251
760
+ def write(output, indent); end
761
+ end
762
+
763
+ # Represents an XML DOCTYPE declaration; that is, the contents of <!DOCTYPE
764
+ # ... >. DOCTYPES can be used to declare the DTD of a document, as well as
765
+ # being used to declare entities used in the document.
766
+ #
767
+ # pkg:gem/rexml#lib/rexml/doctype.rb:51
768
+ class REXML::DocType < ::REXML::Parent
769
+ include ::REXML::XMLTokens
770
+
771
+ # Constructor
772
+ #
773
+ # dt = DocType.new( 'foo', '-//I/Hate/External/IDs' )
774
+ # # <!DOCTYPE foo '-//I/Hate/External/IDs'>
775
+ # dt = DocType.new( doctype_to_clone )
776
+ # # Incomplete. Shallow clone of doctype
777
+ #
778
+ # +Note+ that the constructor:
779
+ #
780
+ # Doctype.new( Source.new( "<!DOCTYPE foo 'bar'>" ) )
781
+ #
782
+ # is _deprecated_. Do not use it. It will probably disappear.
783
+ #
784
+ # pkg:gem/rexml#lib/rexml/doctype.rb:80
785
+ def initialize(first, parent = T.unsafe(nil)); end
786
+
787
+ # pkg:gem/rexml#lib/rexml/doctype.rb:181
788
+ def add(child); end
789
+
790
+ # pkg:gem/rexml#lib/rexml/doctype.rb:125
791
+ def attribute_of(element, attribute); end
792
+
793
+ # pkg:gem/rexml#lib/rexml/doctype.rb:115
794
+ def attributes_of(element); end
795
+
796
+ # pkg:gem/rexml#lib/rexml/doctype.rb:135
797
+ def clone; end
798
+
799
+ # pkg:gem/rexml#lib/rexml/doctype.rb:173
800
+ def context; end
801
+
802
+ # name is the name of the doctype
803
+ # external_id is the referenced DTD, if given
804
+ #
805
+ # pkg:gem/rexml#lib/rexml/doctype.rb:66
806
+ def entities; end
807
+
808
+ # pkg:gem/rexml#lib/rexml/doctype.rb:177
809
+ def entity(name); end
810
+
811
+ # name is the name of the doctype
812
+ # external_id is the referenced DTD, if given
813
+ #
814
+ # pkg:gem/rexml#lib/rexml/doctype.rb:66
815
+ def external_id; end
816
+
817
+ # name is the name of the doctype
818
+ # external_id is the referenced DTD, if given
819
+ #
820
+ # pkg:gem/rexml#lib/rexml/doctype.rb:66
821
+ def name; end
822
+
823
+ # name is the name of the doctype
824
+ # external_id is the referenced DTD, if given
825
+ #
826
+ # pkg:gem/rexml#lib/rexml/doctype.rb:66
827
+ def namespaces; end
828
+
829
+ # pkg:gem/rexml#lib/rexml/doctype.rb:111
830
+ def node_type; end
831
+
832
+ # Retrieves a named notation. Only notations declared in the internal
833
+ # DTD subset can be retrieved.
834
+ #
835
+ # Method contributed by Henrik Martensson
836
+ #
837
+ # pkg:gem/rexml#lib/rexml/doctype.rb:225
838
+ def notation(name); end
839
+
840
+ # This method returns a list of notations that have been declared in the
841
+ # _internal_ DTD subset. Notations in the external DTD subset are not
842
+ # listed.
843
+ #
844
+ # Method contributed by Henrik Martensson
845
+ #
846
+ # pkg:gem/rexml#lib/rexml/doctype.rb:217
847
+ def notations; end
848
+
849
+ # This method retrieves the public identifier identifying the document's
850
+ # DTD.
851
+ #
852
+ # Method contributed by Henrik Martensson
853
+ #
854
+ # pkg:gem/rexml#lib/rexml/doctype.rb:191
855
+ def public; end
856
+
857
+ # This method retrieves the system identifier identifying the document's DTD
858
+ #
859
+ # Method contributed by Henrik Martensson
860
+ #
861
+ # pkg:gem/rexml#lib/rexml/doctype.rb:203
862
+ def system; end
863
+
864
+ # output::
865
+ # Where to write the string
866
+ # indent::
867
+ # An integer. If -1, no indentation will be used; otherwise, the
868
+ # indentation will be this number of spaces, and children will be
869
+ # indented an additional amount.
870
+ # transitive::
871
+ # Ignored
872
+ # ie_hack::
873
+ # Ignored
874
+ #
875
+ # pkg:gem/rexml#lib/rexml/doctype.rb:149
876
+ def write(output, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
877
+ end
878
+
879
+ # Represents an XML document.
880
+ #
881
+ # A document may have:
882
+ #
883
+ # - A single child that may be accessed via method #root.
884
+ # - An XML declaration.
885
+ # - A document type.
886
+ # - Processing instructions.
887
+ #
888
+ # == In a Hurry?
889
+ #
890
+ # If you're somewhat familiar with XML
891
+ # and have a particular task in mind,
892
+ # you may want to see the
893
+ # {tasks pages}[../doc/rexml/tasks/tocs/master_toc_rdoc.html],
894
+ # and in particular, the
895
+ # {tasks page for documents}[../doc/rexml/tasks/tocs/document_toc_rdoc.html].
896
+ #
897
+ # pkg:gem/rexml#lib/rexml/document.rb:35
898
+ class REXML::Document < ::REXML::Element
899
+ # :call-seq:
900
+ # new(string = nil, context = {}) -> new_document
901
+ # new(io_stream = nil, context = {}) -> new_document
902
+ # new(document = nil, context = {}) -> new_document
903
+ #
904
+ # Returns a new \REXML::Document object.
905
+ #
906
+ # When no arguments are given,
907
+ # returns an empty document:
908
+ #
909
+ # d = REXML::Document.new
910
+ # d.to_s # => ""
911
+ #
912
+ # When argument +string+ is given, it must be a string
913
+ # containing a valid XML document:
914
+ #
915
+ # xml_string = '<root><foo>Foo</foo><bar>Bar</bar></root>'
916
+ # d = REXML::Document.new(xml_string)
917
+ # d.to_s # => "<root><foo>Foo</foo><bar>Bar</bar></root>"
918
+ #
919
+ # When argument +io_stream+ is given, it must be an \IO object
920
+ # that is opened for reading, and when read must return a valid XML document:
921
+ #
922
+ # File.write('t.xml', xml_string)
923
+ # d = File.open('t.xml', 'r') do |io|
924
+ # REXML::Document.new(io)
925
+ # end
926
+ # d.to_s # => "<root><foo>Foo</foo><bar>Bar</bar></root>"
927
+ #
928
+ # When argument +document+ is given, it must be an existing
929
+ # document object, whose context and attributes (but not children)
930
+ # are cloned into the new document:
931
+ #
932
+ # d = REXML::Document.new(xml_string)
933
+ # d.children # => [<root> ... </>]
934
+ # d.context = {raw: :all, compress_whitespace: :all}
935
+ # d.add_attributes({'bar' => 0, 'baz' => 1})
936
+ # d1 = REXML::Document.new(d)
937
+ # d1.children # => []
938
+ # d1.context # => {:raw=>:all, :compress_whitespace=>:all}
939
+ # d1.attributes # => {"bar"=>bar='0', "baz"=>baz='1'}
940
+ #
941
+ # When argument +context+ is given, it must be a hash
942
+ # containing context entries for the document;
943
+ # see {Element Context}[../doc/rexml/context_rdoc.html]:
944
+ #
945
+ # context = {raw: :all, compress_whitespace: :all}
946
+ # d = REXML::Document.new(xml_string, context)
947
+ # d.context # => {:raw=>:all, :compress_whitespace=>:all}
948
+ #
949
+ # pkg:gem/rexml#lib/rexml/document.rb:92
950
+ def initialize(source = T.unsafe(nil), context = T.unsafe(nil)); end
951
+
952
+ # pkg:gem/rexml#lib/rexml/document.rb:205
953
+ def <<(child); end
954
+
955
+ # :call-seq:
956
+ # add(xml_decl) -> self
957
+ # add(doc_type) -> self
958
+ # add(object) -> self
959
+ #
960
+ # Adds an object to the document; returns +self+.
961
+ #
962
+ # When argument +xml_decl+ is given,
963
+ # it must be an REXML::XMLDecl object,
964
+ # which becomes the XML declaration for the document,
965
+ # replacing the previous XML declaration if any:
966
+ #
967
+ # d = REXML::Document.new
968
+ # d.xml_decl.to_s # => ""
969
+ # d.add(REXML::XMLDecl.new('2.0'))
970
+ # d.xml_decl.to_s # => "<?xml version='2.0'?>"
971
+ #
972
+ # When argument +doc_type+ is given,
973
+ # it must be an REXML::DocType object,
974
+ # which becomes the document type for the document,
975
+ # replacing the previous document type, if any:
976
+ #
977
+ # d = REXML::Document.new
978
+ # d.doctype.to_s # => ""
979
+ # d.add(REXML::DocType.new('foo'))
980
+ # d.doctype.to_s # => "<!DOCTYPE foo>"
981
+ #
982
+ # When argument +object+ (not an REXML::XMLDecl or REXML::DocType object)
983
+ # is given it is added as the last child:
984
+ #
985
+ # d = REXML::Document.new
986
+ # d.add(REXML::Element.new('foo'))
987
+ # d.to_s # => "<foo/>"
988
+ #
989
+ # pkg:gem/rexml#lib/rexml/document.rb:174
990
+ def add(child); end
991
+
992
+ # :call-seq:
993
+ # add_element(name_or_element = nil, attributes = nil) -> new_element
994
+ #
995
+ # Adds an element to the document by calling REXML::Element.add_element:
996
+ #
997
+ # REXML::Element.add_element(name_or_element, attributes)
998
+ #
999
+ # pkg:gem/rexml#lib/rexml/document.rb:213
1000
+ def add_element(arg = T.unsafe(nil), arg2 = T.unsafe(nil)); end
1001
+
1002
+ # :call-seq:
1003
+ # clone -> new_document
1004
+ #
1005
+ # Returns the new document resulting from executing
1006
+ # <tt>Document.new(self)</tt>. See Document.new.
1007
+ #
1008
+ # pkg:gem/rexml#lib/rexml/document.rb:124
1009
+ def clone; end
1010
+
1011
+ # :call-seq:
1012
+ # doctype -> doc_type or nil
1013
+ #
1014
+ # Returns the DocType object for the document, if it exists, otherwise +nil+:
1015
+ #
1016
+ # d = REXML::Document.new('<!DOCTYPE document SYSTEM "subjects.dtd">')
1017
+ # d.doctype.class # => REXML::DocType
1018
+ # d = REXML::Document.new('')
1019
+ # d.doctype.class # => nil
1020
+ #
1021
+ # pkg:gem/rexml#lib/rexml/document.rb:245
1022
+ def doctype; end
1023
+
1024
+ # pkg:gem/rexml#lib/rexml/document.rb:448
1025
+ def document; end
1026
+
1027
+ # :call-seq:
1028
+ # encoding -> encoding_string
1029
+ #
1030
+ # Returns the XMLDecl encoding of the document,
1031
+ #
1032
+ # d = REXML::Document.new('<?xml version="1.0" encoding="UTF-16"?>')
1033
+ # d.encoding # => "UTF-16"
1034
+ # d = REXML::Document.new('')
1035
+ # d.encoding # => "UTF-8"
1036
+ #
1037
+ # pkg:gem/rexml#lib/rexml/document.rb:294
1038
+ def encoding; end
1039
+
1040
+ # pkg:gem/rexml#lib/rexml/document.rb:437
1041
+ def entity_expansion_count; end
1042
+
1043
+ # pkg:gem/rexml#lib/rexml/document.rb:438
1044
+ def entity_expansion_limit=(_arg0); end
1045
+
1046
+ # pkg:gem/rexml#lib/rexml/document.rb:439
1047
+ def entity_expansion_text_limit; end
1048
+
1049
+ # pkg:gem/rexml#lib/rexml/document.rb:439
1050
+ def entity_expansion_text_limit=(_arg0); end
1051
+
1052
+ # :call-seq:
1053
+ # expanded_name -> empty_string
1054
+ #
1055
+ # Returns an empty string.
1056
+ #
1057
+ # pkg:gem/rexml#lib/rexml/document.rb:133
1058
+ def expanded_name; end
1059
+
1060
+ # pkg:gem/rexml#lib/rexml/document.rb:138
1061
+ def name; end
1062
+
1063
+ # :call-seq:
1064
+ # node_type -> :document
1065
+ #
1066
+ # Returns the symbol +:document+.
1067
+ #
1068
+ # pkg:gem/rexml#lib/rexml/document.rb:114
1069
+ def node_type; end
1070
+
1071
+ # pkg:gem/rexml#lib/rexml/document.rb:441
1072
+ def record_entity_expansion; end
1073
+
1074
+ # :call-seq:
1075
+ # root -> root_element or nil
1076
+ #
1077
+ # Returns the root element of the document, if it exists, otherwise +nil+:
1078
+ #
1079
+ # d = REXML::Document.new('<root></root>')
1080
+ # d.root # => <root/>
1081
+ # d = REXML::Document.new('')
1082
+ # d.root # => nil
1083
+ #
1084
+ # pkg:gem/rexml#lib/rexml/document.rb:229
1085
+ def root; end
1086
+
1087
+ # :call-seq:
1088
+ # stand_alone?
1089
+ #
1090
+ # Returns the XMLDecl standalone value of the document as a string,
1091
+ # if it has been set, otherwise the default standalone value:
1092
+ #
1093
+ # d = REXML::Document.new('<?xml standalone="yes"?>')
1094
+ # d.stand_alone? # => "yes"
1095
+ # d = REXML::Document.new('')
1096
+ # d.stand_alone? # => nil
1097
+ #
1098
+ # pkg:gem/rexml#lib/rexml/document.rb:309
1099
+ def stand_alone?; end
1100
+
1101
+ # :call-seq:
1102
+ # version -> version_string
1103
+ #
1104
+ # Returns the XMLDecl version of this document as a string,
1105
+ # if it has been set, otherwise the default version:
1106
+ #
1107
+ # d = REXML::Document.new('<?xml version="2.0" encoding="UTF-8"?>')
1108
+ # d.version # => "2.0"
1109
+ # d = REXML::Document.new('')
1110
+ # d.version # => "1.0"
1111
+ #
1112
+ # pkg:gem/rexml#lib/rexml/document.rb:279
1113
+ def version; end
1114
+
1115
+ # :call-seq:
1116
+ # doc.write(output=$stdout, indent=-1, transitive=false, ie_hack=false, encoding=nil)
1117
+ # doc.write(options={:output => $stdout, :indent => -1, :transitive => false, :ie_hack => false, :encoding => nil})
1118
+ #
1119
+ # Write the XML tree out, optionally with indent. This writes out the
1120
+ # entire XML document, including XML declarations, doctype declarations,
1121
+ # and processing instructions (if any are given).
1122
+ #
1123
+ # A controversial point is whether Document should always write the XML
1124
+ # declaration (<?xml version='1.0'?>) whether or not one is given by the
1125
+ # user (or source document). REXML does not write one if one was not
1126
+ # specified, because it adds unnecessary bandwidth to applications such
1127
+ # as XML-RPC.
1128
+ #
1129
+ # Accept Nth argument style and options Hash style as argument.
1130
+ # The recommended style is options Hash style for one or more
1131
+ # arguments case.
1132
+ #
1133
+ # _Examples_
1134
+ # Document.new("<a><b/></a>").write
1135
+ #
1136
+ # output = ""
1137
+ # Document.new("<a><b/></a>").write(output)
1138
+ #
1139
+ # output = ""
1140
+ # Document.new("<a><b/></a>").write(:output => output, :indent => 2)
1141
+ #
1142
+ # See also the classes in the rexml/formatters package for the proper way
1143
+ # to change the default formatting of XML output.
1144
+ #
1145
+ # _Examples_
1146
+ #
1147
+ # output = ""
1148
+ # tr = Transitive.new
1149
+ # tr.write(Document.new("<a><b/></a>"), output)
1150
+ #
1151
+ # output::
1152
+ # output an object which supports '<< string'; this is where the
1153
+ # document will be written.
1154
+ # indent::
1155
+ # An integer. If -1, no indenting will be used; otherwise, the
1156
+ # indentation will be twice this number of spaces, and children will be
1157
+ # indented an additional amount. For a value of 3, every item will be
1158
+ # indented 3 more levels, or 6 more spaces (2 * 3). Defaults to -1
1159
+ # transitive::
1160
+ # If transitive is true and indent is >= 0, then the output will be
1161
+ # pretty-printed in such a way that the added whitespace does not affect
1162
+ # the absolute *value* of the document -- that is, it leaves the value
1163
+ # and number of Text nodes in the document unchanged.
1164
+ # ie_hack::
1165
+ # This hack inserts a space before the /> on empty tags to address
1166
+ # a limitation of Internet Explorer. Defaults to false
1167
+ # Encoding name as String. Change output encoding to specified encoding
1168
+ # instead of encoding in XML declaration.
1169
+ # Defaults to nil. It means encoding in XML declaration is used.
1170
+ #
1171
+ # pkg:gem/rexml#lib/rexml/document.rb:369
1172
+ def write(*arguments); end
1173
+
1174
+ # :call-seq:
1175
+ # xml_decl -> xml_decl
1176
+ #
1177
+ # Returns the XMLDecl object for the document, if it exists,
1178
+ # otherwise the default XMLDecl object:
1179
+ #
1180
+ # d = REXML::Document.new('<?xml version="1.0" encoding="UTF-8"?>')
1181
+ # d.xml_decl.class # => REXML::XMLDecl
1182
+ # d.xml_decl.to_s # => "<?xml version='1.0' encoding='UTF-8'?>"
1183
+ # d = REXML::Document.new('')
1184
+ # d.xml_decl.class # => REXML::XMLDecl
1185
+ # d.xml_decl.to_s # => ""
1186
+ #
1187
+ # pkg:gem/rexml#lib/rexml/document.rb:262
1188
+ def xml_decl; end
1189
+
1190
+ private
1191
+
1192
+ # pkg:gem/rexml#lib/rexml/document.rb:467
1193
+ def build(source); end
1194
+
1195
+ # New document level cache is created and available in this block.
1196
+ # This API is thread unsafe. Users can't change this document in this block.
1197
+ #
1198
+ # pkg:gem/rexml#lib/rexml/document.rb:458
1199
+ def enable_cache; end
1200
+
1201
+ # pkg:gem/rexml#lib/rexml/document.rb:454
1202
+ def namespaces_cache; end
1203
+
1204
+ # pkg:gem/rexml#lib/rexml/document.rb:454
1205
+ def namespaces_cache=(_arg0); end
1206
+
1207
+ class << self
1208
+ # Get the entity expansion limit. By default the limit is set to 10000.
1209
+ #
1210
+ # Deprecated. Use REXML::Security.entity_expansion_limit= instead.
1211
+ #
1212
+ # pkg:gem/rexml#lib/rexml/document.rb:419
1213
+ def entity_expansion_limit; end
1214
+
1215
+ # Set the entity expansion limit. By default the limit is set to 10000.
1216
+ #
1217
+ # Deprecated. Use REXML::Security.entity_expansion_limit= instead.
1218
+ #
1219
+ # pkg:gem/rexml#lib/rexml/document.rb:412
1220
+ def entity_expansion_limit=(val); end
1221
+
1222
+ # Get the entity expansion limit. By default the limit is set to 10240.
1223
+ #
1224
+ # Deprecated. Use REXML::Security.entity_expansion_text_limit instead.
1225
+ #
1226
+ # pkg:gem/rexml#lib/rexml/document.rb:433
1227
+ def entity_expansion_text_limit; end
1228
+
1229
+ # Set the entity expansion limit. By default the limit is set to 10240.
1230
+ #
1231
+ # Deprecated. Use REXML::Security.entity_expansion_text_limit= instead.
1232
+ #
1233
+ # pkg:gem/rexml#lib/rexml/document.rb:426
1234
+ def entity_expansion_text_limit=(val); end
1235
+
1236
+ # pkg:gem/rexml#lib/rexml/document.rb:405
1237
+ def parse_stream(source, listener); end
1238
+ end
1239
+ end
1240
+
1241
+ # An \REXML::Element object represents an XML element.
1242
+ #
1243
+ # An element:
1244
+ #
1245
+ # - Has a name (string).
1246
+ # - May have a parent (another element).
1247
+ # - Has zero or more children
1248
+ # (other elements, text, CDATA, processing instructions, and comments).
1249
+ # - Has zero or more siblings
1250
+ # (other elements, text, CDATA, processing instructions, and comments).
1251
+ # - Has zero or more named attributes.
1252
+ #
1253
+ # == In a Hurry?
1254
+ #
1255
+ # If you're somewhat familiar with XML
1256
+ # and have a particular task in mind,
1257
+ # you may want to see the
1258
+ # {tasks pages}[../doc/rexml/tasks/tocs/master_toc_rdoc.html],
1259
+ # and in particular, the
1260
+ # {tasks page for elements}[../doc/rexml/tasks/tocs/element_toc_rdoc.html].
1261
+ #
1262
+ # === Name
1263
+ #
1264
+ # An element has a name, which is initially set when the element is created:
1265
+ #
1266
+ # e = REXML::Element.new('foo')
1267
+ # e.name # => "foo"
1268
+ #
1269
+ # The name may be changed:
1270
+ #
1271
+ # e.name = 'bar'
1272
+ # e.name # => "bar"
1273
+ #
1274
+ #
1275
+ # === \Parent
1276
+ #
1277
+ # An element may have a parent.
1278
+ #
1279
+ # Its parent may be assigned explicitly when the element is created:
1280
+ #
1281
+ # e0 = REXML::Element.new('foo')
1282
+ # e1 = REXML::Element.new('bar', e0)
1283
+ # e1.parent # => <foo> ... </>
1284
+ #
1285
+ # Note: the representation of an element always shows the element's name.
1286
+ # If the element has children, the representation indicates that
1287
+ # by including an ellipsis (<tt>...</tt>).
1288
+ #
1289
+ # The parent may be assigned explicitly at any time:
1290
+ #
1291
+ # e2 = REXML::Element.new('baz')
1292
+ # e1.parent = e2
1293
+ # e1.parent # => <baz/>
1294
+ #
1295
+ # When an element is added as a child, its parent is set automatically:
1296
+ #
1297
+ # e1.add_element(e0)
1298
+ # e0.parent # => <bar> ... </>
1299
+ #
1300
+ # For an element that has no parent, method +parent+ returns +nil+.
1301
+ #
1302
+ # === Children
1303
+ #
1304
+ # An element has zero or more children.
1305
+ # The children are an ordered collection
1306
+ # of all objects whose parent is the element itself.
1307
+ #
1308
+ # The children may include any combination of elements, text, comments,
1309
+ # processing instructions, and CDATA.
1310
+ # (This example keeps things clean by controlling whitespace
1311
+ # via a +context+ setting.)
1312
+ #
1313
+ # xml_string = <<-EOT
1314
+ # <root>
1315
+ # <ele_0/>
1316
+ # text 0
1317
+ # <!--comment 0-->
1318
+ # <?target_0 pi_0?>
1319
+ # <![CDATA[cdata 0]]>
1320
+ # <ele_1/>
1321
+ # text 1
1322
+ # <!--comment 1-->
1323
+ # <?target_0 pi_1?>
1324
+ # <![CDATA[cdata 1]]>
1325
+ # </root>
1326
+ # EOT
1327
+ # context = {ignore_whitespace_nodes: :all, compress_whitespace: :all}
1328
+ # d = REXML::Document.new(xml_string, context)
1329
+ # root = d.root
1330
+ # root.children.size # => 10
1331
+ # root.each {|child| p "#{child.class}: #{child}" }
1332
+ #
1333
+ # Output:
1334
+ #
1335
+ # "REXML::Element: <ele_0/>"
1336
+ # "REXML::Text: \n text 0\n "
1337
+ # "REXML::Comment: comment 0"
1338
+ # "REXML::Instruction: <?target_0 pi_0?>"
1339
+ # "REXML::CData: cdata 0"
1340
+ # "REXML::Element: <ele_1/>"
1341
+ # "REXML::Text: \n text 1\n "
1342
+ # "REXML::Comment: comment 1"
1343
+ # "REXML::Instruction: <?target_0 pi_1?>"
1344
+ # "REXML::CData: cdata 1"
1345
+ #
1346
+ # A child may be added using inherited methods
1347
+ # Parent#insert_before or Parent#insert_after:
1348
+ #
1349
+ # xml_string = '<root><a/><c/><d/></root>'
1350
+ # d = REXML::Document.new(xml_string)
1351
+ # root = d.root
1352
+ # c = d.root[1] # => <c/>
1353
+ # root.insert_before(c, REXML::Element.new('b'))
1354
+ # root.to_a # => [<a/>, <b/>, <c/>, <d/>]
1355
+ #
1356
+ # A child may be replaced using Parent#replace_child:
1357
+ #
1358
+ # root.replace_child(c, REXML::Element.new('x'))
1359
+ # root.to_a # => [<a/>, <b/>, <x/>, <d/>]
1360
+ #
1361
+ # A child may be removed using Parent#delete:
1362
+ #
1363
+ # x = root[2] # => <x/>
1364
+ # root.delete(x)
1365
+ # root.to_a # => [<a/>, <b/>, <d/>]
1366
+ #
1367
+ # === Siblings
1368
+ #
1369
+ # An element has zero or more siblings,
1370
+ # which are the other children of the element's parent.
1371
+ #
1372
+ # In the example above, element +ele_1+ is between a CDATA sibling
1373
+ # and a text sibling:
1374
+ #
1375
+ # ele_1 = root[5] # => <ele_1/>
1376
+ # ele_1.previous_sibling # => "cdata 0"
1377
+ # ele_1.next_sibling # => "\n text 1\n "
1378
+ #
1379
+ # === \Attributes
1380
+ #
1381
+ # An element has zero or more named attributes.
1382
+ #
1383
+ # A new element has no attributes:
1384
+ #
1385
+ # e = REXML::Element.new('foo')
1386
+ # e.attributes # => {}
1387
+ #
1388
+ # Attributes may be added:
1389
+ #
1390
+ # e.add_attribute('bar', 'baz')
1391
+ # e.add_attribute('bat', 'bam')
1392
+ # e.attributes.size # => 2
1393
+ # e['bar'] # => "baz"
1394
+ # e['bat'] # => "bam"
1395
+ #
1396
+ # An existing attribute may be modified:
1397
+ #
1398
+ # e.add_attribute('bar', 'bad')
1399
+ # e.attributes.size # => 2
1400
+ # e['bar'] # => "bad"
1401
+ #
1402
+ # An existing attribute may be deleted:
1403
+ #
1404
+ # e.delete_attribute('bar')
1405
+ # e.attributes.size # => 1
1406
+ # e['bar'] # => nil
1407
+ #
1408
+ # == What's Here
1409
+ #
1410
+ # To begin with, what's elsewhere?
1411
+ #
1412
+ # \Class \REXML::Element inherits from its ancestor classes:
1413
+ #
1414
+ # - REXML::Child
1415
+ # - REXML::Parent
1416
+ #
1417
+ # \REXML::Element itself and its ancestors also include modules:
1418
+ #
1419
+ # - {Enumerable}[https://docs.ruby-lang.org/en/master/Enumerable.html]
1420
+ # - REXML::Namespace
1421
+ # - REXML::Node
1422
+ # - REXML::XMLTokens
1423
+ #
1424
+ # === Methods for Creating an \Element
1425
+ #
1426
+ # ::new:: Returns a new empty element.
1427
+ # #clone:: Returns a clone of another element.
1428
+ #
1429
+ # === Methods for Attributes
1430
+ #
1431
+ # {[attribute_name]}[#method-i-5B-5D]:: Returns an attribute value.
1432
+ # #add_attribute:: Adds a new attribute.
1433
+ # #add_attributes:: Adds multiple new attributes.
1434
+ # #attribute:: Returns the attribute value for a given name and optional namespace.
1435
+ # #delete_attribute:: Removes an attribute.
1436
+ #
1437
+ # === Methods for Children
1438
+ #
1439
+ # {[index]}[#method-i-5B-5D]:: Returns the child at the given offset.
1440
+ # #add_element:: Adds an element as the last child.
1441
+ # #delete_element:: Deletes a child element.
1442
+ # #each_element:: Calls the given block with each child element.
1443
+ # #each_element_with_attribute:: Calls the given block with each child element
1444
+ # that meets given criteria,
1445
+ # which can include the attribute name.
1446
+ # #each_element_with_text:: Calls the given block with each child element
1447
+ # that meets given criteria,
1448
+ # which can include text.
1449
+ # #get_elements:: Returns an array of element children that match a given xpath.
1450
+ #
1451
+ # === Methods for \Text Children
1452
+ #
1453
+ # #add_text:: Adds a text node to the element.
1454
+ # #get_text:: Returns a text node that meets specified criteria.
1455
+ # #text:: Returns the text string from the first node that meets specified criteria.
1456
+ # #texts:: Returns an array of the text children of the element.
1457
+ # #text=:: Adds, removes, or replaces the first text child of the element
1458
+ #
1459
+ # === Methods for Other Children
1460
+ #
1461
+ # #cdatas:: Returns an array of the cdata children of the element.
1462
+ # #comments:: Returns an array of the comment children of the element.
1463
+ # #instructions:: Returns an array of the instruction children of the element.
1464
+ #
1465
+ # === Methods for Namespaces
1466
+ #
1467
+ # #add_namespace:: Adds a namespace to the element.
1468
+ # #delete_namespace:: Removes a namespace from the element.
1469
+ # #namespace:: Returns the string namespace URI for the element.
1470
+ # #namespaces:: Returns a hash of all defined namespaces in the element.
1471
+ # #prefixes:: Returns an array of the string prefixes (names)
1472
+ # of all defined namespaces in the element
1473
+ #
1474
+ # === Methods for Querying
1475
+ #
1476
+ # #document:: Returns the document, if any, that the element belongs to.
1477
+ # #root:: Returns the most distant element (not document) ancestor of the element.
1478
+ # #root_node:: Returns the most distant ancestor of the element.
1479
+ # #xpath:: Returns the string xpath to the element
1480
+ # relative to the most distant parent
1481
+ # #has_attributes?:: Returns whether the element has attributes.
1482
+ # #has_elements?:: Returns whether the element has elements.
1483
+ # #has_text?:: Returns whether the element has text.
1484
+ # #next_element:: Returns the next sibling that is an element.
1485
+ # #previous_element:: Returns the previous sibling that is an element.
1486
+ # #raw:: Returns whether raw mode is set for the element.
1487
+ # #whitespace:: Returns whether whitespace is respected for the element.
1488
+ # #ignore_whitespace_nodes:: Returns whether whitespace nodes
1489
+ # are to be ignored for the element.
1490
+ # #node_type:: Returns symbol <tt>:element</tt>.
1491
+ #
1492
+ # === One More Method
1493
+ #
1494
+ # #inspect:: Returns a string representation of the element.
1495
+ #
1496
+ # === Accessors
1497
+ #
1498
+ # #elements:: Returns the REXML::Elements object for the element.
1499
+ # #attributes:: Returns the REXML::Attributes object for the element.
1500
+ # #context:: Returns or sets the context hash for the element.
1501
+ #
1502
+ # pkg:gem/rexml#lib/rexml/element.rb:271
1503
+ class REXML::Element < ::REXML::Parent
1504
+ include ::REXML::XMLTokens
1505
+ include ::REXML::Namespace
1506
+
1507
+ # :call-seq:
1508
+ # Element.new(name = 'UNDEFINED', parent = nil, context = nil) -> new_element
1509
+ # Element.new(element, parent = nil, context = nil) -> new_element
1510
+ #
1511
+ # Returns a new \REXML::Element object.
1512
+ #
1513
+ # When no arguments are given,
1514
+ # returns an element with name <tt>'UNDEFINED'</tt>:
1515
+ #
1516
+ # e = REXML::Element.new # => <UNDEFINED/>
1517
+ # e.class # => REXML::Element
1518
+ # e.name # => "UNDEFINED"
1519
+ #
1520
+ # When only argument +name+ is given,
1521
+ # returns an element of the given name:
1522
+ #
1523
+ # REXML::Element.new('foo') # => <foo/>
1524
+ #
1525
+ # When only argument +element+ is given, it must be an \REXML::Element object;
1526
+ # returns a shallow copy of the given element:
1527
+ #
1528
+ # e0 = REXML::Element.new('foo')
1529
+ # e1 = REXML::Element.new(e0) # => <foo/>
1530
+ #
1531
+ # When argument +parent+ is also given, it must be an REXML::Parent object:
1532
+ #
1533
+ # e = REXML::Element.new('foo', REXML::Parent.new)
1534
+ # e.parent # => #<REXML::Parent @parent=nil, @children=[<foo/>]>
1535
+ #
1536
+ # When argument +context+ is also given, it must be a hash
1537
+ # representing the context for the element;
1538
+ # see {Element Context}[../doc/rexml/context_rdoc.html]:
1539
+ #
1540
+ # e = REXML::Element.new('foo', nil, {raw: :all})
1541
+ # e.context # => {:raw=>:all}
1542
+ #
1543
+ # pkg:gem/rexml#lib/rexml/element.rb:319
1544
+ def initialize(arg = T.unsafe(nil), parent = T.unsafe(nil), context = T.unsafe(nil)); end
1545
+
1546
+ # :call-seq:
1547
+ # [index] -> object
1548
+ # [attr_name] -> attr_value
1549
+ # [attr_sym] -> attr_value
1550
+ #
1551
+ # With integer argument +index+ given,
1552
+ # returns the child at offset +index+, or +nil+ if none:
1553
+ #
1554
+ # d = REXML::Document.new '><root><a/>text<b/>more<c/></root>'
1555
+ # root = d.root
1556
+ # (0..root.size).each do |index|
1557
+ # node = root[index]
1558
+ # p "#{index}: #{node} (#{node.class})"
1559
+ # end
1560
+ #
1561
+ # Output:
1562
+ #
1563
+ # "0: <a/> (REXML::Element)"
1564
+ # "1: text (REXML::Text)"
1565
+ # "2: <b/> (REXML::Element)"
1566
+ # "3: more (REXML::Text)"
1567
+ # "4: <c/> (REXML::Element)"
1568
+ # "5: (NilClass)"
1569
+ #
1570
+ # With string argument +attr_name+ given,
1571
+ # returns the string value for the given attribute name if it exists,
1572
+ # otherwise +nil+:
1573
+ #
1574
+ # d = REXML::Document.new('<root attr="value"></root>')
1575
+ # root = d.root
1576
+ # root['attr'] # => "value"
1577
+ # root['nosuch'] # => nil
1578
+ #
1579
+ # With symbol argument +attr_sym+ given,
1580
+ # returns <tt>[attr_sym.to_s]</tt>:
1581
+ #
1582
+ # root[:attr] # => "value"
1583
+ # root[:nosuch] # => nil
1584
+ #
1585
+ # pkg:gem/rexml#lib/rexml/element.rb:1238
1586
+ def [](name_or_index); end
1587
+
1588
+ # :call-seq:
1589
+ # add_attribute(name, value) -> value
1590
+ # add_attribute(attribute) -> attribute
1591
+ #
1592
+ # Adds an attribute to this element, overwriting any existing attribute
1593
+ # by the same name.
1594
+ #
1595
+ # With string argument +name+ and object +value+ are given,
1596
+ # adds the attribute created with that name and value:
1597
+ #
1598
+ # e = REXML::Element.new
1599
+ # e.add_attribute('attr', 'value') # => "value"
1600
+ # e['attr'] # => "value"
1601
+ # e.add_attribute('attr', 'VALUE') # => "VALUE"
1602
+ # e['attr'] # => "VALUE"
1603
+ #
1604
+ # With only attribute object +attribute+ given,
1605
+ # adds the given attribute:
1606
+ #
1607
+ # a = REXML::Attribute.new('attr', 'value')
1608
+ # e.add_attribute(a) # => attr='value'
1609
+ # e['attr'] # => "value"
1610
+ # a = REXML::Attribute.new('attr', 'VALUE')
1611
+ # e.add_attribute(a) # => attr='VALUE'
1612
+ # e['attr'] # => "VALUE"
1613
+ #
1614
+ # pkg:gem/rexml#lib/rexml/element.rb:1336
1615
+ def add_attribute(key, value = T.unsafe(nil)); end
1616
+
1617
+ # :call-seq:
1618
+ # add_attributes(hash) -> hash
1619
+ # add_attributes(array)
1620
+ #
1621
+ # Adds zero or more attributes to the element;
1622
+ # returns the argument.
1623
+ #
1624
+ # If hash argument +hash+ is given,
1625
+ # each key must be a string;
1626
+ # adds each attribute created with the key/value pair:
1627
+ #
1628
+ # e = REXML::Element.new
1629
+ # h = {'foo' => 'bar', 'baz' => 'bat'}
1630
+ # e.add_attributes(h)
1631
+ #
1632
+ # If argument +array+ is given,
1633
+ # each array member must be a 2-element array <tt>[name, value];
1634
+ # each name must be a string:
1635
+ #
1636
+ # e = REXML::Element.new
1637
+ # a = [['foo' => 'bar'], ['baz' => 'bat']]
1638
+ # e.add_attributes(a)
1639
+ #
1640
+ # pkg:gem/rexml#lib/rexml/element.rb:1367
1641
+ def add_attributes(hash); end
1642
+
1643
+ # :call-seq:
1644
+ # add_element(name, attributes = nil) -> new_element
1645
+ # add_element(element, attributes = nil) -> element
1646
+ #
1647
+ # Adds a child element, optionally setting attributes
1648
+ # on the added element; returns the added element.
1649
+ #
1650
+ # With string argument +name+, creates a new element with that name
1651
+ # and adds the new element as a child:
1652
+ #
1653
+ # e0 = REXML::Element.new('foo')
1654
+ # e0.add_element('bar')
1655
+ # e0[0] # => <bar/>
1656
+ #
1657
+ #
1658
+ # With argument +name+ and hash argument +attributes+,
1659
+ # sets attributes on the new element:
1660
+ #
1661
+ # e0.add_element('baz', {'bat' => '0', 'bam' => '1'})
1662
+ # e0[1] # => <baz bat='0' bam='1'/>
1663
+ #
1664
+ # With element argument +element+, adds that element as a child:
1665
+ #
1666
+ # e0 = REXML::Element.new('foo')
1667
+ # e1 = REXML::Element.new('bar')
1668
+ # e0.add_element(e1)
1669
+ # e0[0] # => <bar/>
1670
+ #
1671
+ # With argument +element+ and hash argument +attributes+,
1672
+ # sets attributes on the added element:
1673
+ #
1674
+ # e0.add_element(e1, {'bat' => '0', 'bam' => '1'})
1675
+ # e0[1] # => <bar bat='0' bam='1'/>
1676
+ #
1677
+ # pkg:gem/rexml#lib/rexml/element.rb:725
1678
+ def add_element(element, attrs = T.unsafe(nil)); end
1679
+
1680
+ # :call-seq:
1681
+ # add_namespace(prefix, uri = nil) -> self
1682
+ #
1683
+ # Adds a namespace to the element; returns +self+.
1684
+ #
1685
+ # With the single argument +prefix+,
1686
+ # adds a namespace using the given +prefix+ and the namespace URI:
1687
+ #
1688
+ # e = REXML::Element.new('foo')
1689
+ # e.add_namespace('bar')
1690
+ # e.namespaces # => {"xmlns"=>"bar"}
1691
+ #
1692
+ # With both arguments +prefix+ and +uri+ given,
1693
+ # adds a namespace using both arguments:
1694
+ #
1695
+ # e.add_namespace('baz', 'bat')
1696
+ # e.namespaces # => {"xmlns"=>"bar", "baz"=>"bat"}
1697
+ #
1698
+ # pkg:gem/rexml#lib/rexml/element.rb:648
1699
+ def add_namespace(prefix, uri = T.unsafe(nil)); end
1700
+
1701
+ # :call-seq:
1702
+ # add_text(string) -> nil
1703
+ # add_text(text_node) -> self
1704
+ #
1705
+ # Adds text to the element.
1706
+ #
1707
+ # When string argument +string+ is given, returns +nil+.
1708
+ #
1709
+ # If the element has no child text node,
1710
+ # creates a \REXML::Text object using the string,
1711
+ # honoring the current settings for whitespace and raw,
1712
+ # then adds that node to the element:
1713
+ #
1714
+ # d = REXML::Document.new('<a><b/></a>')
1715
+ # a = d.root
1716
+ # a.add_text('foo')
1717
+ # a.to_a # => [<b/>, "foo"]
1718
+ #
1719
+ # If the element has child text nodes,
1720
+ # appends the string to the _last_ text node:
1721
+ #
1722
+ # d = REXML::Document.new('<a>foo<b/>bar</a>')
1723
+ # a = d.root
1724
+ # a.add_text('baz')
1725
+ # a.to_a # => ["foo", <b/>, "barbaz"]
1726
+ # a.add_text('baz')
1727
+ # a.to_a # => ["foo", <b/>, "barbazbaz"]
1728
+ #
1729
+ # When text node argument +text_node+ is given,
1730
+ # appends the node as the last text node in the element;
1731
+ # returns +self+:
1732
+ #
1733
+ # d = REXML::Document.new('<a>foo<b/>bar</a>')
1734
+ # a = d.root
1735
+ # a.add_text(REXML::Text.new('baz'))
1736
+ # a.to_a # => ["foo", <b/>, "bar", "baz"]
1737
+ # a.add_text(REXML::Text.new('baz'))
1738
+ # a.to_a # => ["foo", <b/>, "bar", "baz", "baz"]
1739
+ #
1740
+ # pkg:gem/rexml#lib/rexml/element.rb:1139
1741
+ def add_text(text); end
1742
+
1743
+ # :call-seq:
1744
+ # attribute(name, namespace = nil)
1745
+ #
1746
+ # Returns the string value for the given attribute name.
1747
+ #
1748
+ # With only argument +name+ given,
1749
+ # returns the value of the named attribute if it exists, otherwise +nil+:
1750
+ #
1751
+ # xml_string = <<-EOT
1752
+ # <root xmlns="ns0">
1753
+ # <a xmlns="ns1" attr="value"></a>
1754
+ # <b xmlns="ns2" attr="value"></b>
1755
+ # <c attr="value"/>
1756
+ # </root>
1757
+ # EOT
1758
+ # d = REXML::Document.new(xml_string)
1759
+ # root = d.root
1760
+ # a = root[1] # => <a xmlns='ns1' attr='value'/>
1761
+ # a.attribute('attr') # => attr='value'
1762
+ # a.attribute('nope') # => nil
1763
+ #
1764
+ # With arguments +name+ and +namespace+ given,
1765
+ # returns the value of the named attribute if it exists, otherwise +nil+:
1766
+ #
1767
+ # xml_string = "<root xmlns:a='a' a:x='a:x' x='x'/>"
1768
+ # document = REXML::Document.new(xml_string)
1769
+ # document.root.attribute("x") # => x='x'
1770
+ # document.root.attribute("x", "a") # => a:x='a:x'
1771
+ #
1772
+ # pkg:gem/rexml#lib/rexml/element.rb:1279
1773
+ def attribute(name, namespace = T.unsafe(nil)); end
1774
+
1775
+ # Mechanisms for accessing attributes and child elements of this
1776
+ # element.
1777
+ #
1778
+ # pkg:gem/rexml#lib/rexml/element.rb:278
1779
+ def attributes; end
1780
+
1781
+ # :call-seq:
1782
+ # cdatas -> array_of_cdata_children
1783
+ #
1784
+ # Returns a frozen array of the REXML::CData children of the element:
1785
+ #
1786
+ # xml_string = <<-EOT
1787
+ # <root>
1788
+ # <![CDATA[foo]]>
1789
+ # <![CDATA[bar]]>
1790
+ # </root>
1791
+ # EOT
1792
+ # d = REXML::Document.new(xml_string)
1793
+ # cds = d.root.cdatas # => ["foo", "bar"]
1794
+ # cds.frozen? # => true
1795
+ # cds.map {|cd| cd.class } # => [REXML::CData, REXML::CData]
1796
+ #
1797
+ # pkg:gem/rexml#lib/rexml/element.rb:1411
1798
+ def cdatas; end
1799
+
1800
+ # :call-seq:
1801
+ # clone -> new_element
1802
+ #
1803
+ # Returns a shallow copy of the element, containing the name and attributes,
1804
+ # but not the parent or children:
1805
+ #
1806
+ # e = REXML::Element.new('foo')
1807
+ # e.add_attributes({'bar' => 0, 'baz' => 1})
1808
+ # e.clone # => <foo bar='0' baz='1'/>
1809
+ #
1810
+ # pkg:gem/rexml#lib/rexml/element.rb:383
1811
+ def clone; end
1812
+
1813
+ # :call-seq:
1814
+ # comments -> array_of_comment_children
1815
+ #
1816
+ # Returns a frozen array of the REXML::Comment children of the element:
1817
+ #
1818
+ # xml_string = <<-EOT
1819
+ # <root>
1820
+ # <!--foo-->
1821
+ # <!--bar-->
1822
+ # </root>
1823
+ # EOT
1824
+ # d = REXML::Document.new(xml_string)
1825
+ # cs = d.root.comments
1826
+ # cs.frozen? # => true
1827
+ # cs.map {|c| c.class } # => [REXML::Comment, REXML::Comment]
1828
+ # cs.map {|c| c.to_s } # => ["foo", "bar"]
1829
+ #
1830
+ # pkg:gem/rexml#lib/rexml/element.rb:1432
1831
+ def comments; end
1832
+
1833
+ # The context holds information about the processing environment, such as
1834
+ # whitespace handling.
1835
+ #
1836
+ # pkg:gem/rexml#lib/rexml/element.rb:281
1837
+ def context; end
1838
+
1839
+ # The context holds information about the processing environment, such as
1840
+ # whitespace handling.
1841
+ #
1842
+ # pkg:gem/rexml#lib/rexml/element.rb:281
1843
+ def context=(_arg0); end
1844
+
1845
+ # :call-seq:
1846
+ # delete_attribute(name) -> removed_attribute or nil
1847
+ #
1848
+ # Removes a named attribute if it exists;
1849
+ # returns the removed attribute if found, otherwise +nil+:
1850
+ #
1851
+ # e = REXML::Element.new('foo')
1852
+ # e.add_attribute('bar', 'baz')
1853
+ # e.delete_attribute('bar') # => <bar/>
1854
+ # e.delete_attribute('bar') # => nil
1855
+ #
1856
+ # pkg:gem/rexml#lib/rexml/element.rb:1386
1857
+ def delete_attribute(key); end
1858
+
1859
+ # :call-seq:
1860
+ # delete_element(index) -> removed_element or nil
1861
+ # delete_element(element) -> removed_element or nil
1862
+ # delete_element(xpath) -> removed_element or nil
1863
+ #
1864
+ # Deletes a child element.
1865
+ #
1866
+ # When 1-based integer argument +index+ is given,
1867
+ # removes and returns the child element at that offset if it exists;
1868
+ # indexing does not include text nodes;
1869
+ # returns +nil+ if the element does not exist:
1870
+ #
1871
+ # d = REXML::Document.new '<a><b/>text<c/></a>'
1872
+ # a = d.root # => <a> ... </>
1873
+ # a.delete_element(1) # => <b/>
1874
+ # a.delete_element(1) # => <c/>
1875
+ # a.delete_element(1) # => nil
1876
+ #
1877
+ # When element argument +element+ is given,
1878
+ # removes and returns that child element if it exists,
1879
+ # otherwise returns +nil+:
1880
+ #
1881
+ # d = REXML::Document.new '<a><b/>text<c/></a>'
1882
+ # a = d.root # => <a> ... </>
1883
+ # c = a[2] # => <c/>
1884
+ # a.delete_element(c) # => <c/>
1885
+ # a.delete_element(c) # => nil
1886
+ #
1887
+ # When xpath argument +xpath+ is given,
1888
+ # removes and returns the element at xpath if it exists,
1889
+ # otherwise returns +nil+:
1890
+ #
1891
+ # d = REXML::Document.new '<a><b/>text<c/></a>'
1892
+ # a = d.root # => <a> ... </>
1893
+ # a.delete_element('//c') # => <c/>
1894
+ # a.delete_element('//c') # => nil
1895
+ #
1896
+ # pkg:gem/rexml#lib/rexml/element.rb:771
1897
+ def delete_element(element); end
1898
+
1899
+ # :call-seq:
1900
+ # delete_namespace(namespace = 'xmlns') -> self
1901
+ #
1902
+ # Removes a namespace from the element.
1903
+ #
1904
+ # With no argument, removes the default namespace:
1905
+ #
1906
+ # d = REXML::Document.new "<a xmlns:foo='bar' xmlns='twiddle'/>"
1907
+ # d.to_s # => "<a xmlns:foo='bar' xmlns='twiddle'/>"
1908
+ # d.root.delete_namespace # => <a xmlns:foo='bar'/>
1909
+ # d.to_s # => "<a xmlns:foo='bar'/>"
1910
+ #
1911
+ # With argument +namespace+, removes the specified namespace:
1912
+ #
1913
+ # d.root.delete_namespace('foo')
1914
+ # d.to_s # => "<a/>"
1915
+ #
1916
+ # Does nothing if no such namespace is found:
1917
+ #
1918
+ # d.root.delete_namespace('nosuch')
1919
+ # d.to_s # => "<a/>"
1920
+ #
1921
+ # pkg:gem/rexml#lib/rexml/element.rb:680
1922
+ def delete_namespace(namespace = T.unsafe(nil)); end
1923
+
1924
+ # :call-seq:
1925
+ # document -> document or nil
1926
+ #
1927
+ # If the element is part of a document, returns that document:
1928
+ #
1929
+ # d = REXML::Document.new('<a><b><c/></b></a>')
1930
+ # top_element = d.first
1931
+ # child = top_element.first
1932
+ # top_element.document == d # => true
1933
+ # child.document == d # => true
1934
+ #
1935
+ # If the element is not part of a document, returns +nil+:
1936
+ #
1937
+ # REXML::Element.new.document # => nil
1938
+ #
1939
+ # For a document, returns +self+:
1940
+ #
1941
+ # d.document == d # => true
1942
+ #
1943
+ # Related: #root, #root_node.
1944
+ #
1945
+ # pkg:gem/rexml#lib/rexml/element.rb:475
1946
+ def document; end
1947
+
1948
+ # :call-seq:
1949
+ # each_element {|e| ... }
1950
+ #
1951
+ # Calls the given block with each child element:
1952
+ #
1953
+ # d = REXML::Document.new '<a><b>b</b><c>b</c><d>d</d><e/></a>'
1954
+ # a = d.root
1955
+ # a.each_element {|e| p e }
1956
+ #
1957
+ # Output:
1958
+ #
1959
+ # <b> ... </>
1960
+ # <c> ... </>
1961
+ # <d> ... </>
1962
+ # <e/>
1963
+ #
1964
+ # pkg:gem/rexml#lib/rexml/element.rb:923
1965
+ def each_element(xpath = T.unsafe(nil), &block); end
1966
+
1967
+ # :call-seq:
1968
+ # each_element_with_attribute(attr_name, value = nil, max = 0, xpath = nil) {|e| ... }
1969
+ #
1970
+ # Calls the given block with each child element that meets given criteria.
1971
+ #
1972
+ # When only string argument +attr_name+ is given,
1973
+ # calls the block with each child element that has that attribute:
1974
+ #
1975
+ # d = REXML::Document.new '<a><b id="1"/><c id="2"/><d id="1"/><e/></a>'
1976
+ # a = d.root
1977
+ # a.each_element_with_attribute('id') {|e| p e }
1978
+ #
1979
+ # Output:
1980
+ #
1981
+ # <b id='1'/>
1982
+ # <c id='2'/>
1983
+ # <d id='1'/>
1984
+ #
1985
+ # With argument +attr_name+ and string argument +value+ given,
1986
+ # calls the block with each child element that has that attribute
1987
+ # with that value:
1988
+ #
1989
+ # a.each_element_with_attribute('id', '1') {|e| p e }
1990
+ #
1991
+ # Output:
1992
+ #
1993
+ # <b id='1'/>
1994
+ # <d id='1'/>
1995
+ #
1996
+ # With arguments +attr_name+, +value+, and integer argument +max+ given,
1997
+ # calls the block with at most +max+ child elements:
1998
+ #
1999
+ # a.each_element_with_attribute('id', '1', 1) {|e| p e }
2000
+ #
2001
+ # Output:
2002
+ #
2003
+ # <b id='1'/>
2004
+ #
2005
+ # With all arguments given, including +xpath+,
2006
+ # calls the block with only those child elements
2007
+ # that meet the first three criteria,
2008
+ # and also match the given +xpath+:
2009
+ #
2010
+ # a.each_element_with_attribute('id', '1', 2, '//d') {|e| p e }
2011
+ #
2012
+ # Output:
2013
+ #
2014
+ # <d id='1'/>
2015
+ #
2016
+ # pkg:gem/rexml#lib/rexml/element.rb:840
2017
+ def each_element_with_attribute(key, value = T.unsafe(nil), max = T.unsafe(nil), name = T.unsafe(nil), &block); end
2018
+
2019
+ # :call-seq:
2020
+ # each_element_with_text(text = nil, max = 0, xpath = nil) {|e| ... }
2021
+ #
2022
+ # Calls the given block with each child element that meets given criteria.
2023
+ #
2024
+ # With no arguments, calls the block with each child element that has text:
2025
+ #
2026
+ # d = REXML::Document.new '<a><b>b</b><c>b</c><d>d</d><e/></a>'
2027
+ # a = d.root
2028
+ # a.each_element_with_text {|e| p e }
2029
+ #
2030
+ # Output:
2031
+ #
2032
+ # <b> ... </>
2033
+ # <c> ... </>
2034
+ # <d> ... </>
2035
+ #
2036
+ # With the single string argument +text+,
2037
+ # calls the block with each element that has exactly that text:
2038
+ #
2039
+ # a.each_element_with_text('b') {|e| p e }
2040
+ #
2041
+ # Output:
2042
+ #
2043
+ # <b> ... </>
2044
+ # <c> ... </>
2045
+ #
2046
+ # With argument +text+ and integer argument +max+,
2047
+ # calls the block with at most +max+ elements:
2048
+ #
2049
+ # a.each_element_with_text('b', 1) {|e| p e }
2050
+ #
2051
+ # Output:
2052
+ #
2053
+ # <b> ... </>
2054
+ #
2055
+ # With all arguments given, including +xpath+,
2056
+ # calls the block with only those child elements
2057
+ # that meet the first two criteria,
2058
+ # and also match the given +xpath+:
2059
+ #
2060
+ # a.each_element_with_text('b', 2, '//c') {|e| p e }
2061
+ #
2062
+ # Output:
2063
+ #
2064
+ # <c> ... </>
2065
+ #
2066
+ # pkg:gem/rexml#lib/rexml/element.rb:897
2067
+ def each_element_with_text(text = T.unsafe(nil), max = T.unsafe(nil), name = T.unsafe(nil), &block); end
2068
+
2069
+ # Mechanisms for accessing attributes and child elements of this
2070
+ # element.
2071
+ #
2072
+ # pkg:gem/rexml#lib/rexml/element.rb:278
2073
+ def elements; end
2074
+
2075
+ # :call-seq:
2076
+ # get_elements(xpath)
2077
+ #
2078
+ # Returns an array of the elements that match the given +xpath+:
2079
+ #
2080
+ # xml_string = <<-EOT
2081
+ # <root>
2082
+ # <a level='1'>
2083
+ # <a level='2'/>
2084
+ # </a>
2085
+ # </root>
2086
+ # EOT
2087
+ # d = REXML::Document.new(xml_string)
2088
+ # d.root.get_elements('//a') # => [<a level='1'> ... </>, <a level='2'/>]
2089
+ #
2090
+ # pkg:gem/rexml#lib/rexml/element.rb:942
2091
+ def get_elements(xpath); end
2092
+
2093
+ # :call-seq:
2094
+ # get_text(xpath = nil) -> text_node or nil
2095
+ #
2096
+ # Returns the first text node child in a specified element, if it exists,
2097
+ # +nil+ otherwise.
2098
+ #
2099
+ # With no argument, returns the first text node from +self+:
2100
+ #
2101
+ # d = REXML::Document.new "<p>some text <b>this is bold!</b> more text</p>"
2102
+ # d.root.get_text.class # => REXML::Text
2103
+ # d.root.get_text # => "some text "
2104
+ #
2105
+ # With argument +xpath+, returns the first text node from the element
2106
+ # that matches +xpath+:
2107
+ #
2108
+ # d.root.get_text(1) # => "this is bold!"
2109
+ #
2110
+ # pkg:gem/rexml#lib/rexml/element.rb:1045
2111
+ def get_text(path = T.unsafe(nil)); end
2112
+
2113
+ # :call-seq:
2114
+ # has_attributes? -> true or false
2115
+ #
2116
+ # Returns +true+ if the element has attributes, +false+ otherwise:
2117
+ #
2118
+ # d = REXML::Document.new('<root><a attr="val"/><b/></root>')
2119
+ # a, b = *d.root
2120
+ # a.has_attributes? # => true
2121
+ # b.has_attributes? # => false
2122
+ #
2123
+ # pkg:gem/rexml#lib/rexml/element.rb:1306
2124
+ def has_attributes?; end
2125
+
2126
+ # :call-seq:
2127
+ # has_elements?
2128
+ #
2129
+ # Returns +true+ if the element has one or more element children,
2130
+ # +false+ otherwise:
2131
+ #
2132
+ # d = REXML::Document.new '<a><b/>text<c/></a>'
2133
+ # a = d.root # => <a> ... </>
2134
+ # a.has_elements? # => true
2135
+ # b = a[0] # => <b/>
2136
+ # b.has_elements? # => false
2137
+ #
2138
+ # pkg:gem/rexml#lib/rexml/element.rb:787
2139
+ def has_elements?; end
2140
+
2141
+ # :call-seq:
2142
+ # has_text? -> true or false
2143
+ #
2144
+ # Returns +true+ if the element has one or more text noded,
2145
+ # +false+ otherwise:
2146
+ #
2147
+ # d = REXML::Document.new '<a><b/>text<c/></a>'
2148
+ # a = d.root
2149
+ # a.has_text? # => true
2150
+ # b = a[0]
2151
+ # b.has_text? # => false
2152
+ #
2153
+ # pkg:gem/rexml#lib/rexml/element.rb:995
2154
+ def has_text?; end
2155
+
2156
+ # :call-seq:
2157
+ # ignore_whitespace_nodes
2158
+ #
2159
+ # Returns +true+ if whitespace nodes are ignored for the element.
2160
+ #
2161
+ # See {Element Context}[../doc/rexml/context_rdoc.html].
2162
+ #
2163
+ # pkg:gem/rexml#lib/rexml/element.rb:512
2164
+ def ignore_whitespace_nodes; end
2165
+
2166
+ # :call-seq:
2167
+ # inspect -> string
2168
+ #
2169
+ # Returns a string representation of the element.
2170
+ #
2171
+ # For an element with no attributes and no children, shows the element name:
2172
+ #
2173
+ # REXML::Element.new.inspect # => "<UNDEFINED/>"
2174
+ #
2175
+ # Shows attributes, if any:
2176
+ #
2177
+ # e = REXML::Element.new('foo')
2178
+ # e.add_attributes({'bar' => 0, 'baz' => 1})
2179
+ # e.inspect # => "<foo bar='0' baz='1'/>"
2180
+ #
2181
+ # Shows an ellipsis (<tt>...</tt>), if there are child elements:
2182
+ #
2183
+ # e.add_element(REXML::Element.new('bar'))
2184
+ # e.add_element(REXML::Element.new('baz'))
2185
+ # e.inspect # => "<foo bar='0' baz='1'> ... </>"
2186
+ #
2187
+ # pkg:gem/rexml#lib/rexml/element.rb:358
2188
+ def inspect; end
2189
+
2190
+ # :call-seq:
2191
+ # instructions -> array_of_instruction_children
2192
+ #
2193
+ # Returns a frozen array of the REXML::Instruction children of the element:
2194
+ #
2195
+ # xml_string = <<-EOT
2196
+ # <root>
2197
+ # <?target0 foo?>
2198
+ # <?target1 bar?>
2199
+ # </root>
2200
+ # EOT
2201
+ # d = REXML::Document.new(xml_string)
2202
+ # is = d.root.instructions
2203
+ # is.frozen? # => true
2204
+ # is.map {|i| i.class } # => [REXML::Instruction, REXML::Instruction]
2205
+ # is.map {|i| i.to_s } # => ["<?target0 foo?>", "<?target1 bar?>"]
2206
+ #
2207
+ # pkg:gem/rexml#lib/rexml/element.rb:1453
2208
+ def instructions; end
2209
+
2210
+ # :call-seq:
2211
+ # namespace(prefix = nil) -> string_uri or nil
2212
+ #
2213
+ # Returns the string namespace URI for the element,
2214
+ # possibly deriving from one of its ancestors.
2215
+ #
2216
+ # xml_string = <<-EOT
2217
+ # <root>
2218
+ # <a xmlns='1' xmlns:y='2'>
2219
+ # <b/>
2220
+ # <c xmlns:z='3'/>
2221
+ # </a>
2222
+ # </root>
2223
+ # EOT
2224
+ # d = REXML::Document.new(xml_string)
2225
+ # b = d.elements['//b']
2226
+ # b.namespace # => "1"
2227
+ # b.namespace('y') # => "2"
2228
+ # b.namespace('nosuch') # => nil
2229
+ #
2230
+ # pkg:gem/rexml#lib/rexml/element.rb:619
2231
+ def namespace(prefix = T.unsafe(nil)); end
2232
+
2233
+ # :call-seq:
2234
+ # namespaces -> array_of_namespace_names
2235
+ #
2236
+ # Returns a hash of all defined namespaces
2237
+ # in the element and its ancestors:
2238
+ #
2239
+ # xml_string = <<-EOT
2240
+ # <root>
2241
+ # <a xmlns:x='1' xmlns:y='2'>
2242
+ # <b/>
2243
+ # <c xmlns:z='3'/>
2244
+ # </a>
2245
+ # </root>
2246
+ # EOT
2247
+ # d = REXML::Document.new(xml_string)
2248
+ # d.elements['//a'].namespaces # => {"x"=>"1", "y"=>"2"}
2249
+ # d.elements['//b'].namespaces # => {"x"=>"1", "y"=>"2"}
2250
+ # d.elements['//c'].namespaces # => {"x"=>"1", "y"=>"2", "z"=>"3"}
2251
+ #
2252
+ # pkg:gem/rexml#lib/rexml/element.rb:590
2253
+ def namespaces; end
2254
+
2255
+ # :call-seq:
2256
+ # next_element
2257
+ #
2258
+ # Returns the next sibling that is an element if it exists,
2259
+ # +niL+ otherwise:
2260
+ #
2261
+ # d = REXML::Document.new '<a><b/>text<c/></a>'
2262
+ # d.root.elements['b'].next_element #-> <c/>
2263
+ # d.root.elements['c'].next_element #-> nil
2264
+ #
2265
+ # pkg:gem/rexml#lib/rexml/element.rb:956
2266
+ def next_element; end
2267
+
2268
+ # :call-seq:
2269
+ # node_type -> :element
2270
+ #
2271
+ # Returns symbol <tt>:element</tt>:
2272
+ #
2273
+ # d = REXML::Document.new('<a/>')
2274
+ # a = d.root # => <a/>
2275
+ # a.node_type # => :element
2276
+ #
2277
+ # pkg:gem/rexml#lib/rexml/element.rb:1160
2278
+ def node_type; end
2279
+
2280
+ # :call-seq:
2281
+ # prefixes -> array_of_namespace_prefixes
2282
+ #
2283
+ # Returns an array of the string prefixes (names) of all defined namespaces
2284
+ # in the element and its ancestors:
2285
+ #
2286
+ # xml_string = <<-EOT
2287
+ # <root>
2288
+ # <a xmlns:x='1' xmlns:y='2'>
2289
+ # <b/>
2290
+ # <c xmlns:z='3'/>
2291
+ # </a>
2292
+ # </root>
2293
+ # EOT
2294
+ # d = REXML::Document.new(xml_string, {compress_whitespace: :all})
2295
+ # d.elements['//a'].prefixes # => ["x", "y"]
2296
+ # d.elements['//b'].prefixes # => ["x", "y"]
2297
+ # d.elements['//c'].prefixes # => ["x", "y", "z"]
2298
+ #
2299
+ # pkg:gem/rexml#lib/rexml/element.rb:564
2300
+ def prefixes; end
2301
+
2302
+ # :call-seq:
2303
+ # previous_element
2304
+ #
2305
+ # Returns the previous sibling that is an element if it exists,
2306
+ # +niL+ otherwise:
2307
+ #
2308
+ # d = REXML::Document.new '<a><b/>text<c/></a>'
2309
+ # d.root.elements['c'].previous_element #-> <b/>
2310
+ # d.root.elements['b'].previous_element #-> nil
2311
+ #
2312
+ # pkg:gem/rexml#lib/rexml/element.rb:972
2313
+ def previous_element; end
2314
+
2315
+ # :call-seq:
2316
+ # raw
2317
+ #
2318
+ # Returns +true+ if raw mode is set for the element.
2319
+ #
2320
+ # See {Element Context}[../doc/rexml/context_rdoc.html].
2321
+ #
2322
+ # The evaluation is tested against +expanded_name+, and so is namespace
2323
+ # sensitive.
2324
+ #
2325
+ # pkg:gem/rexml#lib/rexml/element.rb:532
2326
+ def raw; end
2327
+
2328
+ # :call-seq:
2329
+ # root -> element
2330
+ #
2331
+ # Returns the most distant _element_ (not document) ancestor of the element:
2332
+ #
2333
+ # d = REXML::Document.new('<a><b><c/></b></a>')
2334
+ # top_element = d.first
2335
+ # child = top_element.first
2336
+ # top_element.root == top_element # => true
2337
+ # child.root == top_element # => true
2338
+ #
2339
+ # For a document, returns the topmost element:
2340
+ #
2341
+ # d.root == top_element # => true
2342
+ #
2343
+ # Related: #root_node, #document.
2344
+ #
2345
+ # pkg:gem/rexml#lib/rexml/element.rb:443
2346
+ def root; end
2347
+
2348
+ # :call-seq:
2349
+ # root_node -> document or element
2350
+ #
2351
+ # Returns the most distant ancestor of +self+.
2352
+ #
2353
+ # When the element is part of a document,
2354
+ # returns the root node of the document.
2355
+ # Note that the root node is different from the document element;
2356
+ # in this example +a+ is document element and the root node is its parent:
2357
+ #
2358
+ # d = REXML::Document.new('<a><b><c/></b></a>')
2359
+ # top_element = d.first # => <a> ... </>
2360
+ # child = top_element.first # => <b> ... </>
2361
+ # d.root_node == d # => true
2362
+ # top_element.root_node == d # => true
2363
+ # child.root_node == d # => true
2364
+ #
2365
+ # When the element is not part of a document, but does have ancestor elements,
2366
+ # returns the most distant ancestor element:
2367
+ #
2368
+ # e0 = REXML::Element.new('foo')
2369
+ # e1 = REXML::Element.new('bar')
2370
+ # e1.parent = e0
2371
+ # e2 = REXML::Element.new('baz')
2372
+ # e2.parent = e1
2373
+ # e2.root_node == e0 # => true
2374
+ #
2375
+ # When the element has no ancestor elements,
2376
+ # returns +self+:
2377
+ #
2378
+ # e = REXML::Element.new('foo')
2379
+ # e.root_node == e # => true
2380
+ #
2381
+ # Related: #root, #document.
2382
+ #
2383
+ # pkg:gem/rexml#lib/rexml/element.rb:422
2384
+ def root_node; end
2385
+
2386
+ # :call-seq:
2387
+ # text(xpath = nil) -> text_string or nil
2388
+ #
2389
+ # Returns the text string from the first text node child
2390
+ # in a specified element, if it exists, +nil+ otherwise.
2391
+ #
2392
+ # With no argument, returns the text from the first text node in +self+:
2393
+ #
2394
+ # d = REXML::Document.new "<p>some text <b>this is bold!</b> more text</p>"
2395
+ # d.root.text.class # => String
2396
+ # d.root.text # => "some text "
2397
+ #
2398
+ # With argument +xpath+, returns text from the first text node
2399
+ # in the element that matches +xpath+:
2400
+ #
2401
+ # d.root.text(1) # => "this is bold!"
2402
+ #
2403
+ # Note that an element may have multiple text nodes,
2404
+ # possibly separated by other non-text children, as above.
2405
+ # Even so, the returned value is the string text from the first such node.
2406
+ #
2407
+ # Note also that the text note is retrieved by method get_text,
2408
+ # and so is always normalized text.
2409
+ #
2410
+ # pkg:gem/rexml#lib/rexml/element.rb:1023
2411
+ def text(path = T.unsafe(nil)); end
2412
+
2413
+ # :call-seq:
2414
+ # text = string -> string
2415
+ # text = nil -> nil
2416
+ #
2417
+ # Adds, replaces, or removes the first text node child in the element.
2418
+ #
2419
+ # With string argument +string+,
2420
+ # creates a new \REXML::Text node containing that string,
2421
+ # honoring the current settings for whitespace and row,
2422
+ # then places the node as the first text child in the element;
2423
+ # returns +string+.
2424
+ #
2425
+ # If the element has no text child, the text node is added:
2426
+ #
2427
+ # d = REXML::Document.new '<a><b/></a>'
2428
+ # d.root.text = 'foo' #-> '<a><b/>foo</a>'
2429
+ #
2430
+ # If the element has a text child, it is replaced:
2431
+ #
2432
+ # d.root.text = 'bar' #-> '<a><b/>bar</a>'
2433
+ #
2434
+ # With argument +nil+, removes the first text child:
2435
+ #
2436
+ # d.root.text = nil #-> '<a><b/><c/></a>'
2437
+ #
2438
+ # pkg:gem/rexml#lib/rexml/element.rb:1081
2439
+ def text=(text); end
2440
+
2441
+ # :call-seq:
2442
+ # texts -> array_of_text_children
2443
+ #
2444
+ # Returns a frozen array of the REXML::Text children of the element:
2445
+ #
2446
+ # xml_string = '<root><a/>text<b/>more<c/></root>'
2447
+ # d = REXML::Document.new(xml_string)
2448
+ # ts = d.root.texts
2449
+ # ts.frozen? # => true
2450
+ # ts.map {|t| t.class } # => [REXML::Text, REXML::Text]
2451
+ # ts.map {|t| t.to_s } # => ["text", "more"]
2452
+ #
2453
+ # pkg:gem/rexml#lib/rexml/element.rb:1469
2454
+ def texts; end
2455
+
2456
+ # :call-seq:
2457
+ # whitespace
2458
+ #
2459
+ # Returns +true+ if whitespace is respected for this element,
2460
+ # +false+ otherwise.
2461
+ #
2462
+ # See {Element Context}[../doc/rexml/context_rdoc.html].
2463
+ #
2464
+ # The evaluation is tested against the element's +expanded_name+,
2465
+ # and so is namespace-sensitive.
2466
+ #
2467
+ # pkg:gem/rexml#lib/rexml/element.rb:489
2468
+ def whitespace; end
2469
+
2470
+ # == DEPRECATED
2471
+ # See REXML::Formatters
2472
+ #
2473
+ # Writes out this element, and recursively, all children.
2474
+ # output::
2475
+ # output an object which supports '<< string'; this is where the
2476
+ # document will be written.
2477
+ # indent::
2478
+ # An integer. If -1, no indenting will be used; otherwise, the
2479
+ # indentation will be this number of spaces, and children will be
2480
+ # indented an additional amount. Defaults to -1
2481
+ # transitive::
2482
+ # If transitive is true and indent is >= 0, then the output will be
2483
+ # pretty-printed in such a way that the added whitespace does not affect
2484
+ # the parse tree of the document
2485
+ # ie_hack::
2486
+ # This hack inserts a space before the /> on empty tags to address
2487
+ # a limitation of Internet Explorer. Defaults to false
2488
+ #
2489
+ # out = ''
2490
+ # doc.write( out ) #-> doc is written to the string 'out'
2491
+ # doc.write( $stdout ) #-> doc written to the console
2492
+ #
2493
+ # pkg:gem/rexml#lib/rexml/element.rb:1495
2494
+ def write(output = T.unsafe(nil), indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
2495
+
2496
+ # :call-seq:
2497
+ # xpath -> string_xpath
2498
+ #
2499
+ # Returns the string xpath to the element
2500
+ # relative to the most distant parent:
2501
+ #
2502
+ # d = REXML::Document.new('<a><b><c/></b></a>')
2503
+ # a = d.root # => <a> ... </>
2504
+ # b = a[0] # => <b> ... </>
2505
+ # c = b[0] # => <c/>
2506
+ # d.xpath # => ""
2507
+ # a.xpath # => "/a"
2508
+ # b.xpath # => "/a/b"
2509
+ # c.xpath # => "/a/b/c"
2510
+ #
2511
+ # If there is no parent, returns the expanded name of the element:
2512
+ #
2513
+ # e = REXML::Element.new('foo')
2514
+ # e.xpath # => "foo"
2515
+ #
2516
+ # pkg:gem/rexml#lib/rexml/element.rb:1184
2517
+ def xpath; end
2518
+
2519
+ private
2520
+
2521
+ # pkg:gem/rexml#lib/rexml/element.rb:1519
2522
+ def __to_xpath_helper(node); end
2523
+
2524
+ # pkg:gem/rexml#lib/rexml/element.rb:1511
2525
+ def calculate_namespaces; end
2526
+
2527
+ # A private helper method
2528
+ #
2529
+ # pkg:gem/rexml#lib/rexml/element.rb:1534
2530
+ def each_with_something(test, max = T.unsafe(nil), name = T.unsafe(nil)); end
2531
+ end
2532
+
2533
+ # pkg:gem/rexml#lib/rexml/doctype.rb:257
2534
+ class REXML::ElementDecl < ::REXML::Declaration
2535
+ # pkg:gem/rexml#lib/rexml/doctype.rb:258
2536
+ def initialize(src); end
2537
+ end
2538
+
2539
+ # A class which provides filtering of children for Elements, and
2540
+ # XPath search support. You are expected to only encounter this class as
2541
+ # the <tt>element.elements</tt> object. Therefore, you are
2542
+ # _not_ expected to instantiate this yourself.
2543
+ #
2544
+ # xml_string = <<-EOT
2545
+ # <?xml version="1.0" encoding="UTF-8"?>
2546
+ # <bookstore>
2547
+ # <book category="cooking">
2548
+ # <title lang="en">Everyday Italian</title>
2549
+ # <author>Giada De Laurentiis</author>
2550
+ # <year>2005</year>
2551
+ # <price>30.00</price>
2552
+ # </book>
2553
+ # <book category="children">
2554
+ # <title lang="en">Harry Potter</title>
2555
+ # <author>J K. Rowling</author>
2556
+ # <year>2005</year>
2557
+ # <price>29.99</price>
2558
+ # </book>
2559
+ # <book category="web">
2560
+ # <title lang="en">XQuery Kick Start</title>
2561
+ # <author>James McGovern</author>
2562
+ # <author>Per Bothner</author>
2563
+ # <author>Kurt Cagle</author>
2564
+ # <author>James Linn</author>
2565
+ # <author>Vaidyanathan Nagarajan</author>
2566
+ # <year>2003</year>
2567
+ # <price>49.99</price>
2568
+ # </book>
2569
+ # <book category="web" cover="paperback">
2570
+ # <title lang="en">Learning XML</title>
2571
+ # <author>Erik T. Ray</author>
2572
+ # <year>2003</year>
2573
+ # <price>39.95</price>
2574
+ # </book>
2575
+ # </bookstore>
2576
+ # EOT
2577
+ # d = REXML::Document.new(xml_string)
2578
+ # elements = d.root.elements
2579
+ # elements # => #<REXML::Elements @element=<bookstore> ... </>>
2580
+ #
2581
+ # pkg:gem/rexml#lib/rexml/element.rb:1589
2582
+ class REXML::Elements
2583
+ include ::Enumerable
2584
+
2585
+ # :call-seq:
2586
+ # new(parent) -> new_elements_object
2587
+ #
2588
+ # Returns a new \Elements object with the given +parent+.
2589
+ # Does _not_ assign <tt>parent.elements = self</tt>:
2590
+ #
2591
+ # d = REXML::Document.new(xml_string)
2592
+ # eles = REXML::Elements.new(d.root)
2593
+ # eles # => #<REXML::Elements @element=<bookstore> ... </>>
2594
+ # eles == d.root.elements # => false
2595
+ #
2596
+ # pkg:gem/rexml#lib/rexml/element.rb:1602
2597
+ def initialize(parent); end
2598
+
2599
+ # pkg:gem/rexml#lib/rexml/element.rb:1927
2600
+ def <<(element = T.unsafe(nil)); end
2601
+
2602
+ # :call-seq:
2603
+ # elements[index] -> element or nil
2604
+ # elements[xpath] -> element or nil
2605
+ # elements[n, name] -> element or nil
2606
+ #
2607
+ # Returns the first \Element object selected by the arguments,
2608
+ # if any found, or +nil+ if none found.
2609
+ #
2610
+ # Notes:
2611
+ # - The +index+ is 1-based, not 0-based, so that:
2612
+ # - The first element has index <tt>1</tt>
2613
+ # - The _nth_ element has index +n+.
2614
+ # - The selection ignores non-\Element nodes.
2615
+ #
2616
+ # When the single argument +index+ is given,
2617
+ # returns the element given by the index, if any; otherwise, +nil+:
2618
+ #
2619
+ # d = REXML::Document.new(xml_string)
2620
+ # eles = d.root.elements
2621
+ # eles # => #<REXML::Elements @element=<bookstore> ... </>>
2622
+ # eles[1] # => <book category='cooking'> ... </>
2623
+ # eles.size # => 4
2624
+ # eles[4] # => <book category='web' cover='paperback'> ... </>
2625
+ # eles[5] # => nil
2626
+ #
2627
+ # The node at this index is not an \Element, and so is not returned:
2628
+ #
2629
+ # eles = d.root.first.first # => <title lang='en'> ... </>
2630
+ # eles.to_a # => ["Everyday Italian"]
2631
+ # eles[1] # => nil
2632
+ #
2633
+ # When the single argument +xpath+ is given,
2634
+ # returns the first element found via that +xpath+, if any; otherwise, +nil+:
2635
+ #
2636
+ # eles = d.root.elements # => #<REXML::Elements @element=<bookstore> ... </>>
2637
+ # eles['/bookstore'] # => <bookstore> ... </>
2638
+ # eles['//book'] # => <book category='cooking'> ... </>
2639
+ # eles['//book [@category="children"]'] # => <book category='children'> ... </>
2640
+ # eles['/nosuch'] # => nil
2641
+ # eles['//nosuch'] # => nil
2642
+ # eles['//book [@category="nosuch"]'] # => nil
2643
+ # eles['.'] # => <bookstore> ... </>
2644
+ # eles['..'].class # => REXML::Document
2645
+ #
2646
+ # With arguments +n+ and +name+ given,
2647
+ # returns the _nth_ found element that has the given +name+,
2648
+ # or +nil+ if there is no such _nth_ element:
2649
+ #
2650
+ # eles = d.root.elements # => #<REXML::Elements @element=<bookstore> ... </>>
2651
+ # eles[1, 'book'] # => <book category='cooking'> ... </>
2652
+ # eles[4, 'book'] # => <book category='web' cover='paperback'> ... </>
2653
+ # eles[5, 'book'] # => nil
2654
+ #
2655
+ # pkg:gem/rexml#lib/rexml/element.rb:1674
2656
+ def [](index, name = T.unsafe(nil)); end
2657
+
2658
+ # :call-seq:
2659
+ # elements[] = index, replacement_element -> replacement_element or nil
2660
+ #
2661
+ # Replaces or adds an element.
2662
+ #
2663
+ # When <tt>eles[index]</tt> exists, replaces it with +replacement_element+
2664
+ # and returns +replacement_element+:
2665
+ #
2666
+ # d = REXML::Document.new(xml_string)
2667
+ # eles = d.root.elements # => #<REXML::Elements @element=<bookstore> ... </>>
2668
+ # eles[1] # => <book category='cooking'> ... </>
2669
+ # eles[1] = REXML::Element.new('foo')
2670
+ # eles[1] # => <foo/>
2671
+ #
2672
+ # Does nothing (or raises an exception)
2673
+ # if +replacement_element+ is not an \Element:
2674
+ # eles[2] # => <book category='web' cover='paperback'> ... </>
2675
+ # eles[2] = REXML::Text.new('bar')
2676
+ # eles[2] # => <book category='web' cover='paperback'> ... </>
2677
+ #
2678
+ # When <tt>eles[index]</tt> does not exist,
2679
+ # adds +replacement_element+ to the element and returns
2680
+ #
2681
+ # d = REXML::Document.new(xml_string)
2682
+ # eles = d.root.elements # => #<REXML::Elements @element=<bookstore> ... </>>
2683
+ # eles.size # => 4
2684
+ # eles[50] = REXML::Element.new('foo') # => <foo/>
2685
+ # eles.size # => 5
2686
+ # eles[5] # => <foo/>
2687
+ #
2688
+ # Does nothing (or raises an exception)
2689
+ # if +replacement_element+ is not an \Element:
2690
+ #
2691
+ # eles[50] = REXML::Text.new('bar') # => "bar"
2692
+ # eles.size # => 5
2693
+ #
2694
+ # pkg:gem/rexml#lib/rexml/element.rb:1725
2695
+ def []=(index, element); end
2696
+
2697
+ # :call-seq:
2698
+ # add -> new_element
2699
+ # add(name) -> new_element
2700
+ # add(element) -> element
2701
+ #
2702
+ # Adds an element; returns the element added.
2703
+ #
2704
+ # With no argument, creates and adds a new element.
2705
+ # The new element has:
2706
+ #
2707
+ # - No name.
2708
+ # - \Parent from the \Elements object.
2709
+ # - Context from the that parent.
2710
+ #
2711
+ # Example:
2712
+ #
2713
+ # d = REXML::Document.new(xml_string)
2714
+ # elements = d.root.elements
2715
+ # parent = elements.parent # => <bookstore> ... </>
2716
+ # parent.context = {raw: :all}
2717
+ # elements.size # => 4
2718
+ # new_element = elements.add # => </>
2719
+ # elements.size # => 5
2720
+ # new_element.name # => nil
2721
+ # new_element.parent # => <bookstore> ... </>
2722
+ # new_element.context # => {:raw=>:all}
2723
+ #
2724
+ # With string argument +name+, creates and adds a new element.
2725
+ # The new element has:
2726
+ #
2727
+ # - Name +name+.
2728
+ # - \Parent from the \Elements object.
2729
+ # - Context from the that parent.
2730
+ #
2731
+ # Example:
2732
+ #
2733
+ # d = REXML::Document.new(xml_string)
2734
+ # elements = d.root.elements
2735
+ # parent = elements.parent # => <bookstore> ... </>
2736
+ # parent.context = {raw: :all}
2737
+ # elements.size # => 4
2738
+ # new_element = elements.add('foo') # => <foo/>
2739
+ # elements.size # => 5
2740
+ # new_element.name # => "foo"
2741
+ # new_element.parent # => <bookstore> ... </>
2742
+ # new_element.context # => {:raw=>:all}
2743
+ #
2744
+ # With argument +element+,
2745
+ # creates and adds a clone of the given +element+.
2746
+ # The new element has name, parent, and context from the given +element+.
2747
+ #
2748
+ # d = REXML::Document.new(xml_string)
2749
+ # elements = d.root.elements
2750
+ # elements.size # => 4
2751
+ # e0 = REXML::Element.new('foo')
2752
+ # e1 = REXML::Element.new('bar', e0, {raw: :all})
2753
+ # element = elements.add(e1) # => <bar/>
2754
+ # elements.size # => 5
2755
+ # element.name # => "bar"
2756
+ # element.parent # => <bookstore> ... </>
2757
+ # element.context # => {:raw=>:all}
2758
+ #
2759
+ # pkg:gem/rexml#lib/rexml/element.rb:1915
2760
+ def add(element = T.unsafe(nil)); end
2761
+
2762
+ # :call-seq:
2763
+ # collect(xpath = nil) {|element| ... } -> array
2764
+ #
2765
+ # Iterates over the elements; returns the array of block return values.
2766
+ #
2767
+ # With no argument, iterates over all elements:
2768
+ #
2769
+ # d = REXML::Document.new(xml_string)
2770
+ # elements = d.root.elements
2771
+ # elements.collect {|element| element.size } # => [9, 9, 17, 9]
2772
+ #
2773
+ # With argument +xpath+, iterates over elements that match
2774
+ # the given +xpath+:
2775
+ #
2776
+ # xpath = '//book [@category="web"]'
2777
+ # elements.collect(xpath) {|element| element.size } # => [17, 9]
2778
+ #
2779
+ # pkg:gem/rexml#lib/rexml/element.rb:1978
2780
+ def collect(xpath = T.unsafe(nil)); end
2781
+
2782
+ # :call-seq:
2783
+ # delete(index) -> removed_element or nil
2784
+ # delete(element) -> removed_element or nil
2785
+ # delete(xpath) -> removed_element or nil
2786
+ #
2787
+ # Removes an element; returns the removed element, or +nil+ if none removed.
2788
+ #
2789
+ # With integer argument +index+ given,
2790
+ # removes the child element at that offset:
2791
+ #
2792
+ # d = REXML::Document.new(xml_string)
2793
+ # elements = d.root.elements
2794
+ # elements.size # => 4
2795
+ # elements[2] # => <book category='children'> ... </>
2796
+ # elements.delete(2) # => <book category='children'> ... </>
2797
+ # elements.size # => 3
2798
+ # elements[2] # => <book category='web'> ... </>
2799
+ # elements.delete(50) # => nil
2800
+ #
2801
+ # With element argument +element+ given,
2802
+ # removes that child element:
2803
+ #
2804
+ # d = REXML::Document.new(xml_string)
2805
+ # elements = d.root.elements
2806
+ # ele_1, ele_2, ele_3, ele_4 = *elements
2807
+ # elements.size # => 4
2808
+ # elements[2] # => <book category='children'> ... </>
2809
+ # elements.delete(ele_2) # => <book category='children'> ... </>
2810
+ # elements.size # => 3
2811
+ # elements[2] # => <book category='web'> ... </>
2812
+ # elements.delete(ele_2) # => nil
2813
+ #
2814
+ # With string argument +xpath+ given,
2815
+ # removes the first element found via that xpath:
2816
+ #
2817
+ # d = REXML::Document.new(xml_string)
2818
+ # elements = d.root.elements
2819
+ # elements.delete('//book') # => <book category='cooking'> ... </>
2820
+ # elements.delete('//book [@category="children"]') # => <book category='children'> ... </>
2821
+ # elements.delete('//nosuch') # => nil
2822
+ #
2823
+ # pkg:gem/rexml#lib/rexml/element.rb:1815
2824
+ def delete(element); end
2825
+
2826
+ # :call-seq:
2827
+ # delete_all(xpath)
2828
+ #
2829
+ # Removes all elements found via the given +xpath+;
2830
+ # returns the array of removed elements, if any, else +nil+.
2831
+ #
2832
+ # d = REXML::Document.new(xml_string)
2833
+ # elements = d.root.elements
2834
+ # elements.size # => 4
2835
+ # deleted_elements = elements.delete_all('//book [@category="web"]')
2836
+ # deleted_elements.size # => 2
2837
+ # elements.size # => 2
2838
+ # deleted_elements = elements.delete_all('//book')
2839
+ # deleted_elements.size # => 2
2840
+ # elements.size # => 0
2841
+ # elements.delete_all('//book') # => []
2842
+ #
2843
+ # pkg:gem/rexml#lib/rexml/element.rb:1841
2844
+ def delete_all(xpath); end
2845
+
2846
+ # :call-seq:
2847
+ # each(xpath = nil) {|element| ... } -> self
2848
+ #
2849
+ # Iterates over the elements.
2850
+ #
2851
+ # With no argument, calls the block with each element:
2852
+ #
2853
+ # d = REXML::Document.new(xml_string)
2854
+ # elements = d.root.elements
2855
+ # elements.each {|element| p element }
2856
+ #
2857
+ # Output:
2858
+ #
2859
+ # <book category='cooking'> ... </>
2860
+ # <book category='children'> ... </>
2861
+ # <book category='web'> ... </>
2862
+ # <book category='web' cover='paperback'> ... </>
2863
+ #
2864
+ # With argument +xpath+, calls the block with each element
2865
+ # that matches the given +xpath+:
2866
+ #
2867
+ # elements.each('//book [@category="web"]') {|element| p element }
2868
+ #
2869
+ # Output:
2870
+ #
2871
+ # <book category='web'> ... </>
2872
+ # <book category='web' cover='paperback'> ... </>
2873
+ #
2874
+ # pkg:gem/rexml#lib/rexml/element.rb:1957
2875
+ def each(xpath = T.unsafe(nil)); end
2876
+
2877
+ # :call-seq:
2878
+ # empty? -> true or false
2879
+ #
2880
+ # Returns +true+ if there are no children, +false+ otherwise.
2881
+ #
2882
+ # d = REXML::Document.new('')
2883
+ # d.elements.empty? # => true
2884
+ # d = REXML::Document.new(xml_string)
2885
+ # d.elements.empty? # => false
2886
+ #
2887
+ # pkg:gem/rexml#lib/rexml/element.rb:1745
2888
+ def empty?; end
2889
+
2890
+ # :call-seq:
2891
+ # index(element)
2892
+ #
2893
+ # Returns the 1-based index of the given +element+, if found;
2894
+ # otherwise, returns -1:
2895
+ #
2896
+ # d = REXML::Document.new(xml_string)
2897
+ # elements = d.root.elements
2898
+ # ele_1, ele_2, ele_3, ele_4 = *elements
2899
+ # elements.index(ele_4) # => 4
2900
+ # elements.delete(ele_3)
2901
+ # elements.index(ele_4) # => 3
2902
+ # elements.index(ele_3) # => -1
2903
+ #
2904
+ # pkg:gem/rexml#lib/rexml/element.rb:1763
2905
+ def index(element); end
2906
+
2907
+ # :call-seq:
2908
+ # inject(xpath = nil, initial = nil) -> object
2909
+ #
2910
+ # Calls the block with elements; returns the last block return value.
2911
+ #
2912
+ # With no argument, iterates over the elements, calling the block
2913
+ # <tt>elements.size - 1</tt> times.
2914
+ #
2915
+ # - The first call passes the first and second elements.
2916
+ # - The second call passes the first block return value and the third element.
2917
+ # - The third call passes the second block return value and the fourth element.
2918
+ # - And so on.
2919
+ #
2920
+ # In this example, the block returns the passed element,
2921
+ # which is then the object argument to the next call:
2922
+ #
2923
+ # d = REXML::Document.new(xml_string)
2924
+ # elements = d.root.elements
2925
+ # elements.inject do |object, element|
2926
+ # p [elements.index(object), elements.index(element)]
2927
+ # element
2928
+ # end
2929
+ #
2930
+ # Output:
2931
+ #
2932
+ # [1, 2]
2933
+ # [2, 3]
2934
+ # [3, 4]
2935
+ #
2936
+ # With the single argument +xpath+, calls the block only with
2937
+ # elements matching that xpath:
2938
+ #
2939
+ # elements.inject('//book [@category="web"]') do |object, element|
2940
+ # p [elements.index(object), elements.index(element)]
2941
+ # element
2942
+ # end
2943
+ #
2944
+ # Output:
2945
+ #
2946
+ # [3, 4]
2947
+ #
2948
+ # With argument +xpath+ given as +nil+
2949
+ # and argument +initial+ also given,
2950
+ # calls the block once for each element.
2951
+ #
2952
+ # - The first call passes the +initial+ and the first element.
2953
+ # - The second call passes the first block return value and the second element.
2954
+ # - The third call passes the second block return value and the third element.
2955
+ # - And so on.
2956
+ #
2957
+ # In this example, the first object index is <tt>-1</tt>
2958
+ #
2959
+ # elements.inject(nil, 'Initial') do |object, element|
2960
+ # p [elements.index(object), elements.index(element)]
2961
+ # element
2962
+ # end
2963
+ #
2964
+ # Output:
2965
+ #
2966
+ # [-1, 1]
2967
+ # [1, 2]
2968
+ # [2, 3]
2969
+ # [3, 4]
2970
+ #
2971
+ # In this form the passed object can be used as an accumulator:
2972
+ #
2973
+ # elements.inject(nil, 0) do |total, element|
2974
+ # total += element.size
2975
+ # end # => 44
2976
+ #
2977
+ # With both arguments +xpath+ and +initial+ are given,
2978
+ # calls the block only with elements matching that xpath:
2979
+ #
2980
+ # elements.inject('//book [@category="web"]', 0) do |total, element|
2981
+ # total += element.size
2982
+ # end # => 26
2983
+ #
2984
+ # pkg:gem/rexml#lib/rexml/element.rb:2063
2985
+ def inject(xpath = T.unsafe(nil), initial = T.unsafe(nil)); end
2986
+
2987
+ # :call-seq:
2988
+ # parent
2989
+ #
2990
+ # Returns the parent element cited in creating the \Elements object.
2991
+ # This element is also the default starting point for searching
2992
+ # in the \Elements object.
2993
+ #
2994
+ # d = REXML::Document.new(xml_string)
2995
+ # elements = REXML::Elements.new(d.root)
2996
+ # elements.parent == d.root # => true
2997
+ #
2998
+ # pkg:gem/rexml#lib/rexml/element.rb:1617
2999
+ def parent; end
3000
+
3001
+ # :call-seq:
3002
+ # size -> integer
3003
+ #
3004
+ # Returns the count of \Element children:
3005
+ #
3006
+ # d = REXML::Document.new '<a>sean<b/>elliott<b/>russell<b/></a>'
3007
+ # d.root.elements.size # => 3 # Three elements.
3008
+ # d.root.size # => 6 # Three elements plus three text nodes..
3009
+ #
3010
+ # pkg:gem/rexml#lib/rexml/element.rb:2087
3011
+ def size; end
3012
+
3013
+ # :call-seq:
3014
+ # to_a(xpath = nil) -> array_of_elements
3015
+ #
3016
+ # Returns an array of element children (not including non-element children).
3017
+ #
3018
+ # With no argument, returns an array of all element children:
3019
+ #
3020
+ # d = REXML::Document.new '<a>sean<b/>elliott<c/></a>'
3021
+ # elements = d.root.elements
3022
+ # elements.to_a # => [<b/>, <c/>] # Omits non-element children.
3023
+ # children = d.root.children
3024
+ # children # => ["sean", <b/>, "elliott", <c/>] # Includes non-element children.
3025
+ #
3026
+ # With argument +xpath+, returns an array of element children
3027
+ # that match the xpath:
3028
+ #
3029
+ # elements.to_a('//c') # => [<c/>]
3030
+ #
3031
+ # pkg:gem/rexml#lib/rexml/element.rb:2111
3032
+ def to_a(xpath = T.unsafe(nil)); end
3033
+
3034
+ private
3035
+
3036
+ # Private helper class. Removes quotes from quoted strings
3037
+ #
3038
+ # pkg:gem/rexml#lib/rexml/element.rb:2119
3039
+ def literalize(name); end
3040
+ end
3041
+
3042
+ # pkg:gem/rexml#lib/rexml/encoding.rb:4
3043
+ module REXML::Encoding
3044
+ # pkg:gem/rexml#lib/rexml/encoding.rb:26
3045
+ def decode(string); end
3046
+
3047
+ # pkg:gem/rexml#lib/rexml/encoding.rb:22
3048
+ def encode(string); end
3049
+
3050
+ # ID ---> Encoding name
3051
+ #
3052
+ # pkg:gem/rexml#lib/rexml/encoding.rb:6
3053
+ def encoding; end
3054
+
3055
+ # pkg:gem/rexml#lib/rexml/encoding.rb:7
3056
+ def encoding=(encoding); end
3057
+
3058
+ private
3059
+
3060
+ # pkg:gem/rexml#lib/rexml/encoding.rb:31
3061
+ def find_encoding(name); end
3062
+ end
3063
+
3064
+ # pkg:gem/rexml#lib/rexml/entity.rb:7
3065
+ class REXML::Entity < ::REXML::Child
3066
+ include ::REXML::XMLTokens
3067
+
3068
+ # Create a new entity. Simple entities can be constructed by passing a
3069
+ # name, value to the constructor; this creates a generic, plain entity
3070
+ # reference. For anything more complicated, you have to pass a Source to
3071
+ # the constructor with the entity definition, or use the accessor methods.
3072
+ # +WARNING+: There is no validation of entity state except when the entity
3073
+ # is read from a stream. If you start poking around with the accessors,
3074
+ # you can easily create a non-conformant Entity.
3075
+ #
3076
+ # e = Entity.new( 'amp', '&' )
3077
+ #
3078
+ # pkg:gem/rexml#lib/rexml/entity.rb:34
3079
+ def initialize(stream, value = T.unsafe(nil), parent = T.unsafe(nil), reference = T.unsafe(nil)); end
3080
+
3081
+ # pkg:gem/rexml#lib/rexml/entity.rb:23
3082
+ def external; end
3083
+
3084
+ # pkg:gem/rexml#lib/rexml/entity.rb:23
3085
+ def name; end
3086
+
3087
+ # pkg:gem/rexml#lib/rexml/entity.rb:23
3088
+ def ndata; end
3089
+
3090
+ # Returns the value of this entity unprocessed -- raw. This is the
3091
+ # normalized value; that is, with all %ent; and &ent; entities intact
3092
+ #
3093
+ # pkg:gem/rexml#lib/rexml/entity.rb:86
3094
+ def normalized; end
3095
+
3096
+ # pkg:gem/rexml#lib/rexml/entity.rb:23
3097
+ def pubid; end
3098
+
3099
+ # pkg:gem/rexml#lib/rexml/entity.rb:23
3100
+ def ref; end
3101
+
3102
+ # Returns this entity as a string. See write().
3103
+ #
3104
+ # pkg:gem/rexml#lib/rexml/entity.rb:120
3105
+ def to_s; end
3106
+
3107
+ # Evaluates to the unnormalized value of this entity; that is, replacing
3108
+ # &ent; entities.
3109
+ #
3110
+ # pkg:gem/rexml#lib/rexml/entity.rb:73
3111
+ def unnormalized; end
3112
+
3113
+ # pkg:gem/rexml#lib/rexml/entity.rb:23
3114
+ def value; end
3115
+
3116
+ # Write out a fully formed, correct entity definition (assuming the Entity
3117
+ # object itself is valid.)
3118
+ #
3119
+ # out::
3120
+ # An object implementing <TT>&lt;&lt;</TT> to which the entity will be
3121
+ # output
3122
+ # indent::
3123
+ # *DEPRECATED* and ignored
3124
+ #
3125
+ # pkg:gem/rexml#lib/rexml/entity.rb:98
3126
+ def write(out, indent = T.unsafe(nil)); end
3127
+
3128
+ class << self
3129
+ # Evaluates whether the given string matches an entity definition,
3130
+ # returning true if so, and false otherwise.
3131
+ #
3132
+ # pkg:gem/rexml#lib/rexml/entity.rb:67
3133
+ def matches?(string); end
3134
+ end
3135
+ end
3136
+
3137
+ # pkg:gem/rexml#lib/rexml/doctype.rb:263
3138
+ class REXML::ExternalEntity < ::REXML::Child
3139
+ # pkg:gem/rexml#lib/rexml/doctype.rb:264
3140
+ def initialize(src); end
3141
+
3142
+ # pkg:gem/rexml#lib/rexml/doctype.rb:268
3143
+ def to_s; end
3144
+
3145
+ # pkg:gem/rexml#lib/rexml/doctype.rb:271
3146
+ def write(output, indent); end
3147
+ end
3148
+
3149
+ # pkg:gem/rexml#lib/rexml/formatters/default.rb:5
3150
+ class REXML::Formatters::Default
3151
+ # Prints out the XML document with no formatting -- except if ie_hack is
3152
+ # set.
3153
+ #
3154
+ # ie_hack::
3155
+ # If set to true, then inserts whitespace before the close of an empty
3156
+ # tag, so that IE's bad XML parser doesn't choke.
3157
+ #
3158
+ # pkg:gem/rexml#lib/rexml/formatters/default.rb:12
3159
+ def initialize(ie_hack = T.unsafe(nil)); end
3160
+
3161
+ # Writes the node to some output.
3162
+ #
3163
+ # node::
3164
+ # The node to write
3165
+ # output::
3166
+ # A class implementing <TT>&lt;&lt;</TT>. Pass in an Output object to
3167
+ # change the output encoding.
3168
+ #
3169
+ # pkg:gem/rexml#lib/rexml/formatters/default.rb:23
3170
+ def write(node, output); end
3171
+
3172
+ protected
3173
+
3174
+ # pkg:gem/rexml#lib/rexml/formatters/default.rb:98
3175
+ def write_cdata(node, output); end
3176
+
3177
+ # pkg:gem/rexml#lib/rexml/formatters/default.rb:92
3178
+ def write_comment(node, output); end
3179
+
3180
+ # pkg:gem/rexml#lib/rexml/formatters/default.rb:61
3181
+ def write_document(node, output); end
3182
+
3183
+ # pkg:gem/rexml#lib/rexml/formatters/default.rb:65
3184
+ def write_element(node, output); end
3185
+
3186
+ # pkg:gem/rexml#lib/rexml/formatters/default.rb:104
3187
+ def write_instruction(node, output); end
3188
+
3189
+ # pkg:gem/rexml#lib/rexml/formatters/default.rb:88
3190
+ def write_text(node, output); end
3191
+ end
3192
+
3193
+ # Pretty-prints an XML document. This destroys whitespace in text nodes
3194
+ # and will insert carriage returns and indentations.
3195
+ #
3196
+ # TODO: Add an option to print attributes on new lines
3197
+ #
3198
+ # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:10
3199
+ class REXML::Formatters::Pretty < ::REXML::Formatters::Default
3200
+ # Create a new pretty printer.
3201
+ #
3202
+ # output::
3203
+ # An object implementing '<<(String)', to which the output will be written.
3204
+ # indentation::
3205
+ # An integer greater than 0. The indentation of each level will be
3206
+ # this number of spaces. If this is < 1, the behavior of this object
3207
+ # is undefined. Defaults to 2.
3208
+ # ie_hack::
3209
+ # If true, the printer will insert whitespace before closing empty
3210
+ # tags, thereby allowing Internet Explorer's XML parser to
3211
+ # function. Defaults to false.
3212
+ #
3213
+ # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:30
3214
+ def initialize(indentation = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
3215
+
3216
+ # If compact is set to true, then the formatter will attempt to use as
3217
+ # little space as possible
3218
+ #
3219
+ # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:14
3220
+ def compact; end
3221
+
3222
+ # If compact is set to true, then the formatter will attempt to use as
3223
+ # little space as possible
3224
+ #
3225
+ # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:14
3226
+ def compact=(_arg0); end
3227
+
3228
+ # The width of a page. Used for formatting text
3229
+ #
3230
+ # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:16
3231
+ def width; end
3232
+
3233
+ # The width of a page. Used for formatting text
3234
+ #
3235
+ # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:16
3236
+ def width=(_arg0); end
3237
+
3238
+ protected
3239
+
3240
+ # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:102
3241
+ def write_cdata(node, output); end
3242
+
3243
+ # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:97
3244
+ def write_comment(node, output); end
3245
+
3246
+ # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:107
3247
+ def write_document(node, output); end
3248
+
3249
+ # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:39
3250
+ def write_element(node, output); end
3251
+
3252
+ # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:88
3253
+ def write_text(node, output); end
3254
+
3255
+ private
3256
+
3257
+ # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:124
3258
+ def indent_text(string, level = T.unsafe(nil), style = T.unsafe(nil), indentfirstline = T.unsafe(nil)); end
3259
+
3260
+ # pkg:gem/rexml#lib/rexml/formatters/pretty.rb:129
3261
+ def wrap(string, width); end
3262
+ end
3263
+
3264
+ # If you add a method, keep in mind two things:
3265
+ # (1) the first argument will always be a list of nodes from which to
3266
+ # filter. In the case of context methods (such as position), the function
3267
+ # should return an array with a value for each child in the array.
3268
+ # (2) all method calls from XML will have "-" replaced with "_".
3269
+ # Therefore, in XML, "local-name()" is identical (and actually becomes)
3270
+ # "local_name()"
3271
+ #
3272
+ # pkg:gem/rexml#lib/rexml/functions.rb:10
3273
+ module REXML::Functions
3274
+ class << self
3275
+ # pkg:gem/rexml#lib/rexml/functions.rb:317
3276
+ def boolean(object = T.unsafe(nil)); end
3277
+
3278
+ # pkg:gem/rexml#lib/rexml/functions.rb:417
3279
+ def ceiling(number); end
3280
+
3281
+ # pkg:gem/rexml#lib/rexml/functions.rb:370
3282
+ def compare_language(lang1, lang2); end
3283
+
3284
+ # pkg:gem/rexml#lib/rexml/functions.rb:190
3285
+ def concat(*objects); end
3286
+
3287
+ # Fixed by Mike Stok
3288
+ #
3289
+ # pkg:gem/rexml#lib/rexml/functions.rb:204
3290
+ def contains(string, test); end
3291
+
3292
+ # pkg:gem/rexml#lib/rexml/functions.rb:38
3293
+ def context=(value); end
3294
+
3295
+ # Returns the size of the given list of nodes.
3296
+ #
3297
+ # pkg:gem/rexml#lib/rexml/functions.rb:60
3298
+ def count(node_set); end
3299
+
3300
+ # UNTESTED
3301
+ #
3302
+ # pkg:gem/rexml#lib/rexml/functions.rb:347
3303
+ def false; end
3304
+
3305
+ # pkg:gem/rexml#lib/rexml/functions.rb:413
3306
+ def floor(number); end
3307
+
3308
+ # Helper method.
3309
+ #
3310
+ # pkg:gem/rexml#lib/rexml/functions.rb:87
3311
+ def get_namespace(node_set = T.unsafe(nil)); end
3312
+
3313
+ # Since REXML is non-validating, this method is not implemented as it
3314
+ # requires a DTD
3315
+ #
3316
+ # pkg:gem/rexml#lib/rexml/functions.rb:66
3317
+ def id(object); end
3318
+
3319
+ # UNTESTED
3320
+ #
3321
+ # pkg:gem/rexml#lib/rexml/functions.rb:352
3322
+ def lang(language); end
3323
+
3324
+ # Returns the last node of the given list of nodes.
3325
+ #
3326
+ # pkg:gem/rexml#lib/rexml/functions.rb:51
3327
+ def last; end
3328
+
3329
+ # pkg:gem/rexml#lib/rexml/functions.rb:69
3330
+ def local_name(node_set = T.unsafe(nil)); end
3331
+
3332
+ # pkg:gem/rexml#lib/rexml/functions.rb:80
3333
+ def name(node_set = T.unsafe(nil)); end
3334
+
3335
+ # pkg:gem/rexml#lib/rexml/functions.rb:35
3336
+ def namespace_context; end
3337
+
3338
+ # pkg:gem/rexml#lib/rexml/functions.rb:33
3339
+ def namespace_context=(x); end
3340
+
3341
+ # pkg:gem/rexml#lib/rexml/functions.rb:76
3342
+ def namespace_uri(node_set = T.unsafe(nil)); end
3343
+
3344
+ # pkg:gem/rexml#lib/rexml/functions.rb:265
3345
+ def normalize_space(string = T.unsafe(nil)); end
3346
+
3347
+ # UNTESTED
3348
+ #
3349
+ # pkg:gem/rexml#lib/rexml/functions.rb:337
3350
+ def not(object); end
3351
+
3352
+ # a string that consists of optional whitespace followed by an optional
3353
+ # minus sign followed by a Number followed by whitespace is converted to
3354
+ # the IEEE 754 number that is nearest (according to the IEEE 754
3355
+ # round-to-nearest rule) to the mathematical value represented by the
3356
+ # string; any other string is converted to NaN
3357
+ #
3358
+ # boolean true is converted to 1; boolean false is converted to 0
3359
+ #
3360
+ # a node-set is first converted to a string as if by a call to the string
3361
+ # function and then converted in the same way as a string argument
3362
+ #
3363
+ # an object of a type other than the four basic types is converted to a
3364
+ # number in a way that is dependent on that type
3365
+ #
3366
+ # pkg:gem/rexml#lib/rexml/functions.rb:387
3367
+ def number(object = T.unsafe(nil)); end
3368
+
3369
+ # pkg:gem/rexml#lib/rexml/functions.rb:55
3370
+ def position; end
3371
+
3372
+ # pkg:gem/rexml#lib/rexml/functions.rb:432
3373
+ def processing_instruction(node); end
3374
+
3375
+ # pkg:gem/rexml#lib/rexml/functions.rb:421
3376
+ def round(number); end
3377
+
3378
+ # pkg:gem/rexml#lib/rexml/functions.rb:436
3379
+ def send(name, *args); end
3380
+
3381
+ # pkg:gem/rexml#lib/rexml/functions.rb:26
3382
+ def singleton_method_added(name); end
3383
+
3384
+ # Fixed by Mike Stok
3385
+ #
3386
+ # pkg:gem/rexml#lib/rexml/functions.rb:199
3387
+ def starts_with(string, test); end
3388
+
3389
+ # A node-set is converted to a string by returning the string-value of the
3390
+ # node in the node-set that is first in document order. If the node-set is
3391
+ # empty, an empty string is returned.
3392
+ #
3393
+ # A number is converted to a string as follows
3394
+ #
3395
+ # NaN is converted to the string NaN
3396
+ #
3397
+ # positive zero is converted to the string 0
3398
+ #
3399
+ # negative zero is converted to the string 0
3400
+ #
3401
+ # positive infinity is converted to the string Infinity
3402
+ #
3403
+ # negative infinity is converted to the string -Infinity
3404
+ #
3405
+ # if the number is an integer, the number is represented in decimal form
3406
+ # as a Number with no decimal point and no leading zeros, preceded by a
3407
+ # minus sign (-) if the number is negative
3408
+ #
3409
+ # otherwise, the number is represented in decimal form as a Number
3410
+ # including a decimal point with at least one digit before the decimal
3411
+ # point and at least one digit after the decimal point, preceded by a
3412
+ # minus sign (-) if the number is negative; there must be no leading zeros
3413
+ # before the decimal point apart possibly from the one required digit
3414
+ # immediately before the decimal point; beyond the one required digit
3415
+ # after the decimal point there must be as many, but only as many, more
3416
+ # digits as are needed to uniquely distinguish the number from all other
3417
+ # IEEE 754 numeric values.
3418
+ #
3419
+ # The boolean false value is converted to the string false. The boolean
3420
+ # true value is converted to the string true.
3421
+ #
3422
+ # An object of a type other than the four basic types is converted to a
3423
+ # string in a way that is dependent on that type.
3424
+ #
3425
+ # pkg:gem/rexml#lib/rexml/functions.rb:138
3426
+ def string(object = T.unsafe(nil)); end
3427
+
3428
+ # UNTESTED
3429
+ #
3430
+ # pkg:gem/rexml#lib/rexml/functions.rb:261
3431
+ def string_length(string); end
3432
+
3433
+ # A node-set is converted to a string by
3434
+ # returning the concatenation of the string-value
3435
+ # of each of the children of the node in the
3436
+ # node-set that is first in document order.
3437
+ # If the node-set is empty, an empty string is returned.
3438
+ #
3439
+ # pkg:gem/rexml#lib/rexml/functions.rb:178
3440
+ def string_value(o); end
3441
+
3442
+ # Take equal portions of Mike Stok and Sean Russell; mix
3443
+ # vigorously, and pour into a tall, chilled glass. Serves 10,000.
3444
+ #
3445
+ # pkg:gem/rexml#lib/rexml/functions.rb:228
3446
+ def substring(string, start, length = T.unsafe(nil)); end
3447
+
3448
+ # Kouhei fixed this too
3449
+ #
3450
+ # pkg:gem/rexml#lib/rexml/functions.rb:220
3451
+ def substring_after(string, test); end
3452
+
3453
+ # Kouhei fixed this
3454
+ #
3455
+ # pkg:gem/rexml#lib/rexml/functions.rb:209
3456
+ def substring_before(string, test); end
3457
+
3458
+ # pkg:gem/rexml#lib/rexml/functions.rb:408
3459
+ def sum(nodes); end
3460
+
3461
+ # pkg:gem/rexml#lib/rexml/functions.rb:40
3462
+ def text; end
3463
+
3464
+ # This is entirely Mike Stok's beast
3465
+ #
3466
+ # pkg:gem/rexml#lib/rexml/functions.rb:275
3467
+ def translate(string, tr1, tr2); end
3468
+
3469
+ # UNTESTED
3470
+ #
3471
+ # pkg:gem/rexml#lib/rexml/functions.rb:342
3472
+ def true; end
3473
+
3474
+ # pkg:gem/rexml#lib/rexml/functions.rb:36
3475
+ def variables; end
3476
+
3477
+ # pkg:gem/rexml#lib/rexml/functions.rb:34
3478
+ def variables=(x); end
3479
+ end
3480
+ end
3481
+
3482
+ # A Source that wraps an IO. See the Source class for method
3483
+ # documentation
3484
+ #
3485
+ # pkg:gem/rexml#lib/rexml/source.rb:220
3486
+ class REXML::IOSource < ::REXML::Source
3487
+ # block_size has been deprecated
3488
+ #
3489
+ # pkg:gem/rexml#lib/rexml/source.rb:224
3490
+ def initialize(arg, block_size = T.unsafe(nil), encoding = T.unsafe(nil)); end
3491
+
3492
+ # @return the current line in the source
3493
+ #
3494
+ # pkg:gem/rexml#lib/rexml/source.rb:329
3495
+ def current_line; end
3496
+
3497
+ # pkg:gem/rexml#lib/rexml/source.rb:324
3498
+ def empty?; end
3499
+
3500
+ # pkg:gem/rexml#lib/rexml/source.rb:284
3501
+ def ensure_buffer; end
3502
+
3503
+ # pkg:gem/rexml#lib/rexml/source.rb:288
3504
+ def match(pattern, cons = T.unsafe(nil)); end
3505
+
3506
+ # pkg:gem/rexml#lib/rexml/source.rb:307
3507
+ def match?(pattern, cons = T.unsafe(nil)); end
3508
+
3509
+ # pkg:gem/rexml#lib/rexml/source.rb:245
3510
+ def read(term = T.unsafe(nil), min_bytes = T.unsafe(nil)); end
3511
+
3512
+ # pkg:gem/rexml#lib/rexml/source.rb:266
3513
+ def read_until(term); end
3514
+
3515
+ private
3516
+
3517
+ # pkg:gem/rexml#lib/rexml/source.rb:376
3518
+ def encoding_updated; end
3519
+
3520
+ # pkg:gem/rexml#lib/rexml/source.rb:351
3521
+ def readline(term = T.unsafe(nil)); end
3522
+ end
3523
+
3524
+ # Represents an XML Instruction; IE, <? ... ?>
3525
+ # TODO: Add parent arg (3rd arg) to constructor
3526
+ #
3527
+ # pkg:gem/rexml#lib/rexml/instruction.rb:9
3528
+ class REXML::Instruction < ::REXML::Child
3529
+ # Constructs a new Instruction
3530
+ # @param target can be one of a number of things. If String, then
3531
+ # the target of this instruction is set to this. If an Instruction,
3532
+ # then the Instruction is shallowly cloned (target and content are
3533
+ # copied).
3534
+ # @param content Must be either a String, or a Parent. Can only
3535
+ # be a Parent if the target argument is a Source. Otherwise, this
3536
+ # String is set as the content of this instruction.
3537
+ #
3538
+ # pkg:gem/rexml#lib/rexml/instruction.rb:25
3539
+ def initialize(target, content = T.unsafe(nil)); end
3540
+
3541
+ # @return true if other is an Instruction, and the content and target
3542
+ # of the other matches the target and content of this object.
3543
+ #
3544
+ # pkg:gem/rexml#lib/rexml/instruction.rb:65
3545
+ def ==(other); end
3546
+
3547
+ # pkg:gem/rexml#lib/rexml/instruction.rb:44
3548
+ def clone; end
3549
+
3550
+ # target is the "name" of the Instruction; IE, the "tag" in <?tag ...?>
3551
+ # content is everything else.
3552
+ #
3553
+ # pkg:gem/rexml#lib/rexml/instruction.rb:15
3554
+ def content; end
3555
+
3556
+ # target is the "name" of the Instruction; IE, the "tag" in <?tag ...?>
3557
+ # content is everything else.
3558
+ #
3559
+ # pkg:gem/rexml#lib/rexml/instruction.rb:15
3560
+ def content=(_arg0); end
3561
+
3562
+ # pkg:gem/rexml#lib/rexml/instruction.rb:75
3563
+ def inspect; end
3564
+
3565
+ # pkg:gem/rexml#lib/rexml/instruction.rb:71
3566
+ def node_type; end
3567
+
3568
+ # target is the "name" of the Instruction; IE, the "tag" in <?tag ...?>
3569
+ # content is everything else.
3570
+ #
3571
+ # pkg:gem/rexml#lib/rexml/instruction.rb:15
3572
+ def target; end
3573
+
3574
+ # target is the "name" of the Instruction; IE, the "tag" in <?tag ...?>
3575
+ # content is everything else.
3576
+ #
3577
+ # pkg:gem/rexml#lib/rexml/instruction.rb:15
3578
+ def target=(_arg0); end
3579
+
3580
+ # == DEPRECATED
3581
+ # See the rexml/formatters package
3582
+ #
3583
+ # pkg:gem/rexml#lib/rexml/instruction.rb:51
3584
+ def write(writer, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
3585
+ end
3586
+
3587
+ # Adds named attributes to an object.
3588
+ #
3589
+ # pkg:gem/rexml#lib/rexml/namespace.rb:7
3590
+ module REXML::Namespace
3591
+ include ::REXML::XMLTokens
3592
+
3593
+ # The name of the object, valid if set
3594
+ #
3595
+ # pkg:gem/rexml#lib/rexml/namespace.rb:9
3596
+ def expanded_name; end
3597
+
3598
+ # Fully expand the name, even if the prefix wasn't specified in the
3599
+ # source file.
3600
+ #
3601
+ # pkg:gem/rexml#lib/rexml/namespace.rb:57
3602
+ def fully_expanded_name; end
3603
+
3604
+ # Compares names optionally WITH namespaces
3605
+ #
3606
+ # pkg:gem/rexml#lib/rexml/namespace.rb:43
3607
+ def has_name?(other, ns = T.unsafe(nil)); end
3608
+
3609
+ # pkg:gem/rexml#lib/rexml/namespace.rb:53
3610
+ def local_name; end
3611
+
3612
+ # The name of the object, valid if set
3613
+ #
3614
+ # pkg:gem/rexml#lib/rexml/namespace.rb:9
3615
+ def name; end
3616
+
3617
+ # Sets the name and the expanded name
3618
+ #
3619
+ # pkg:gem/rexml#lib/rexml/namespace.rb:17
3620
+ def name=(name); end
3621
+
3622
+ # The expanded name of the object, valid if name is set
3623
+ #
3624
+ # pkg:gem/rexml#lib/rexml/namespace.rb:11
3625
+ def prefix; end
3626
+
3627
+ # The expanded name of the object, valid if name is set
3628
+ #
3629
+ # pkg:gem/rexml#lib/rexml/namespace.rb:11
3630
+ def prefix=(_arg0); end
3631
+ end
3632
+
3633
+ # pkg:gem/rexml#lib/rexml/namespace.rb:13
3634
+ REXML::Namespace::NAME_WITHOUT_NAMESPACE = T.let(T.unsafe(nil), Regexp)
3635
+
3636
+ # Represents a node in the tree. Nodes are never encountered except as
3637
+ # superclasses of other objects. Nodes have siblings.
3638
+ #
3639
+ # pkg:gem/rexml#lib/rexml/node.rb:9
3640
+ module REXML::Node
3641
+ # Visit all subnodes of +self+ recursively
3642
+ #
3643
+ # pkg:gem/rexml#lib/rexml/node.rb:54
3644
+ def each_recursive(&block); end
3645
+
3646
+ # Find (and return) first subnode (recursively) for which the block
3647
+ # evaluates to true. Returns +nil+ if none was found.
3648
+ #
3649
+ # pkg:gem/rexml#lib/rexml/node.rb:67
3650
+ def find_first_recursive(&block); end
3651
+
3652
+ # pkg:gem/rexml#lib/rexml/node.rb:39
3653
+ def indent(to, ind); end
3654
+
3655
+ # Returns the position that +self+ holds in its parent's array, indexed
3656
+ # from 1.
3657
+ #
3658
+ # pkg:gem/rexml#lib/rexml/node.rb:76
3659
+ def index_in_parent; end
3660
+
3661
+ # @return the next sibling (nil if unset)
3662
+ #
3663
+ # pkg:gem/rexml#lib/rexml/node.rb:11
3664
+ def next_sibling_node; end
3665
+
3666
+ # pkg:gem/rexml#lib/rexml/node.rb:48
3667
+ def parent?; end
3668
+
3669
+ # @return the previous sibling (nil if unset)
3670
+ #
3671
+ # pkg:gem/rexml#lib/rexml/node.rb:17
3672
+ def previous_sibling_node; end
3673
+
3674
+ # indent::
3675
+ # *DEPRECATED* This parameter is now ignored. See the formatters in the
3676
+ # REXML::Formatters package for changing the output style.
3677
+ #
3678
+ # pkg:gem/rexml#lib/rexml/node.rb:27
3679
+ def to_s(indent = T.unsafe(nil)); end
3680
+ end
3681
+
3682
+ # pkg:gem/rexml#lib/rexml/doctype.rb:276
3683
+ class REXML::NotationDecl < ::REXML::Child
3684
+ # pkg:gem/rexml#lib/rexml/doctype.rb:278
3685
+ def initialize(name, middle, pub, sys); end
3686
+
3687
+ # This method retrieves the name of the notation.
3688
+ #
3689
+ # Method contributed by Henrik Martensson
3690
+ #
3691
+ # pkg:gem/rexml#lib/rexml/doctype.rb:302
3692
+ def name; end
3693
+
3694
+ # pkg:gem/rexml#lib/rexml/doctype.rb:277
3695
+ def public; end
3696
+
3697
+ # pkg:gem/rexml#lib/rexml/doctype.rb:277
3698
+ def public=(_arg0); end
3699
+
3700
+ # pkg:gem/rexml#lib/rexml/doctype.rb:277
3701
+ def system; end
3702
+
3703
+ # pkg:gem/rexml#lib/rexml/doctype.rb:277
3704
+ def system=(_arg0); end
3705
+
3706
+ # pkg:gem/rexml#lib/rexml/doctype.rb:286
3707
+ def to_s; end
3708
+
3709
+ # pkg:gem/rexml#lib/rexml/doctype.rb:295
3710
+ def write(output, indent = T.unsafe(nil)); end
3711
+ end
3712
+
3713
+ # pkg:gem/rexml#lib/rexml/output.rb:5
3714
+ class REXML::Output
3715
+ include ::REXML::Encoding
3716
+
3717
+ # pkg:gem/rexml#lib/rexml/output.rb:10
3718
+ def initialize(real_IO, encd = T.unsafe(nil)); end
3719
+
3720
+ # pkg:gem/rexml#lib/rexml/output.rb:22
3721
+ def <<(content); end
3722
+
3723
+ # pkg:gem/rexml#lib/rexml/output.rb:8
3724
+ def encoding; end
3725
+
3726
+ # pkg:gem/rexml#lib/rexml/output.rb:26
3727
+ def to_s; end
3728
+ end
3729
+
3730
+ # A parent has children, and has methods for accessing them. The Parent
3731
+ # class is never encountered except as the superclass for some other
3732
+ # object.
3733
+ #
3734
+ # pkg:gem/rexml#lib/rexml/parent.rb:8
3735
+ class REXML::Parent < ::REXML::Child
3736
+ include ::Enumerable
3737
+
3738
+ # Constructor
3739
+ # @param parent if supplied, will be set as the parent of this object
3740
+ #
3741
+ # pkg:gem/rexml#lib/rexml/parent.rb:13
3742
+ def initialize(parent = T.unsafe(nil)); end
3743
+
3744
+ # pkg:gem/rexml#lib/rexml/parent.rb:25
3745
+ def <<(object); end
3746
+
3747
+ # Fetches a child at a given index
3748
+ # @param index the Integer index of the child to fetch
3749
+ #
3750
+ # pkg:gem/rexml#lib/rexml/parent.rb:57
3751
+ def [](index); end
3752
+
3753
+ # Set an index entry. See Array.[]=
3754
+ # @param index the index of the element to set
3755
+ # @param opt either the object to set, or an Integer length
3756
+ # @param child if opt is an Integer, this is the child to set
3757
+ # @return the parent (self)
3758
+ #
3759
+ # pkg:gem/rexml#lib/rexml/parent.rb:70
3760
+ def []=(*args); end
3761
+
3762
+ # pkg:gem/rexml#lib/rexml/parent.rb:18
3763
+ def add(object); end
3764
+
3765
+ # pkg:gem/rexml#lib/rexml/parent.rb:160
3766
+ def children; end
3767
+
3768
+ # Deeply clones this object. This creates a complete duplicate of this
3769
+ # Parent, including all descendants.
3770
+ #
3771
+ # pkg:gem/rexml#lib/rexml/parent.rb:148
3772
+ def deep_clone; end
3773
+
3774
+ # pkg:gem/rexml#lib/rexml/parent.rb:32
3775
+ def delete(object); end
3776
+
3777
+ # pkg:gem/rexml#lib/rexml/parent.rb:47
3778
+ def delete_at(index); end
3779
+
3780
+ # pkg:gem/rexml#lib/rexml/parent.rb:43
3781
+ def delete_if(&block); end
3782
+
3783
+ # pkg:gem/rexml#lib/rexml/parent.rb:39
3784
+ def each(&block); end
3785
+
3786
+ # pkg:gem/rexml#lib/rexml/parent.rb:61
3787
+ def each_child(&block); end
3788
+
3789
+ # pkg:gem/rexml#lib/rexml/parent.rb:51
3790
+ def each_index(&block); end
3791
+
3792
+ # Fetches the index of a given child
3793
+ # @param child the child to get the index of
3794
+ # @return the index of the child, or nil if the object is not a child
3795
+ # of this parent.
3796
+ #
3797
+ # pkg:gem/rexml#lib/rexml/parent.rb:123
3798
+ def index(child); end
3799
+
3800
+ # Inserts an child after another child
3801
+ # @param child1 this is either an xpath or an Element. If an Element,
3802
+ # child2 will be inserted after child1 in the child list of the parent.
3803
+ # If an xpath, child2 will be inserted after the first child to match
3804
+ # the xpath.
3805
+ # @param child2 the child to insert
3806
+ # @return the parent (self)
3807
+ #
3808
+ # pkg:gem/rexml#lib/rexml/parent.rb:102
3809
+ def insert_after(child1, child2); end
3810
+
3811
+ # Inserts an child before another child
3812
+ # @param child1 this is either an xpath or an Element. If an Element,
3813
+ # child2 will be inserted before child1 in the child list of the parent.
3814
+ # If an xpath, child2 will be inserted before the first child to match
3815
+ # the xpath.
3816
+ # @param child2 the child to insert
3817
+ # @return the parent (self)
3818
+ #
3819
+ # pkg:gem/rexml#lib/rexml/parent.rb:82
3820
+ def insert_before(child1, child2); end
3821
+
3822
+ # pkg:gem/rexml#lib/rexml/parent.rb:134
3823
+ def length; end
3824
+
3825
+ # pkg:gem/rexml#lib/rexml/parent.rb:162
3826
+ def parent?; end
3827
+
3828
+ # pkg:gem/rexml#lib/rexml/parent.rb:24
3829
+ def push(object); end
3830
+
3831
+ # Replaces one child with another, making sure the nodelist is correct
3832
+ # @param to_replace the child to replace (must be a Child)
3833
+ # @param replacement the child to insert into the nodelist (must be a
3834
+ # Child)
3835
+ #
3836
+ # pkg:gem/rexml#lib/rexml/parent.rb:140
3837
+ def replace_child(to_replace, replacement); end
3838
+
3839
+ # @return the number of children of this parent
3840
+ #
3841
+ # pkg:gem/rexml#lib/rexml/parent.rb:130
3842
+ def size; end
3843
+
3844
+ # pkg:gem/rexml#lib/rexml/parent.rb:115
3845
+ def to_a; end
3846
+
3847
+ # pkg:gem/rexml#lib/rexml/parent.rb:27
3848
+ def unshift(object); end
3849
+ end
3850
+
3851
+ # pkg:gem/rexml#lib/rexml/parseexception.rb:3
3852
+ class REXML::ParseException < ::RuntimeError
3853
+ # pkg:gem/rexml#lib/rexml/parseexception.rb:6
3854
+ def initialize(message, source = T.unsafe(nil), parser = T.unsafe(nil), exception = T.unsafe(nil)); end
3855
+
3856
+ # pkg:gem/rexml#lib/rexml/parseexception.rb:49
3857
+ def context; end
3858
+
3859
+ # pkg:gem/rexml#lib/rexml/parseexception.rb:4
3860
+ def continued_exception; end
3861
+
3862
+ # pkg:gem/rexml#lib/rexml/parseexception.rb:4
3863
+ def continued_exception=(_arg0); end
3864
+
3865
+ # pkg:gem/rexml#lib/rexml/parseexception.rb:44
3866
+ def line; end
3867
+
3868
+ # pkg:gem/rexml#lib/rexml/parseexception.rb:4
3869
+ def parser; end
3870
+
3871
+ # pkg:gem/rexml#lib/rexml/parseexception.rb:4
3872
+ def parser=(_arg0); end
3873
+
3874
+ # pkg:gem/rexml#lib/rexml/parseexception.rb:39
3875
+ def position; end
3876
+
3877
+ # pkg:gem/rexml#lib/rexml/parseexception.rb:4
3878
+ def source; end
3879
+
3880
+ # pkg:gem/rexml#lib/rexml/parseexception.rb:4
3881
+ def source=(_arg0); end
3882
+
3883
+ # pkg:gem/rexml#lib/rexml/parseexception.rb:13
3884
+ def to_s; end
3885
+ end
3886
+
3887
+ # = Using the Pull Parser
3888
+ # <em>This API is experimental, and subject to change.</em>
3889
+ # parser = PullParser.new( "<a>text<b att='val'/>txet</a>" )
3890
+ # while parser.has_next?
3891
+ # res = parser.next
3892
+ # puts res[1]['att'] if res.start_tag? and res[0] == 'b'
3893
+ # end
3894
+ # See the PullEvent class for information on the content of the results.
3895
+ # The data is identical to the arguments passed for the various events to
3896
+ # the StreamListener API.
3897
+ #
3898
+ # Notice that:
3899
+ # parser = PullParser.new( "<a>BAD DOCUMENT" )
3900
+ # while parser.has_next?
3901
+ # res = parser.next
3902
+ # raise res[1] if res.error?
3903
+ # end
3904
+ #
3905
+ # Nat Price gave me some good ideas for the API.
3906
+ #
3907
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:57
3908
+ class REXML::Parsers::BaseParser
3909
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:164
3910
+ def initialize(source); end
3911
+
3912
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:175
3913
+ def add_listener(listener); end
3914
+
3915
+ # Returns true if there are no more events
3916
+ #
3917
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:210
3918
+ def empty?; end
3919
+
3920
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:537
3921
+ def entity(reference, entities); end
3922
+
3923
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:180
3924
+ def entity_expansion_count; end
3925
+
3926
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:181
3927
+ def entity_expansion_limit=(_arg0); end
3928
+
3929
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:182
3930
+ def entity_expansion_text_limit=(_arg0); end
3931
+
3932
+ # Returns true if there are more events. Synonymous with !empty?
3933
+ #
3934
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:215
3935
+ def has_next?; end
3936
+
3937
+ # Escapes all possible entities
3938
+ #
3939
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:548
3940
+ def normalize(input, entities = T.unsafe(nil), entity_filter = T.unsafe(nil)); end
3941
+
3942
+ # Peek at the +depth+ event in the stack. The first element on the stack
3943
+ # is at depth 0. If +depth+ is -1, will parse to the end of the input
3944
+ # stream and return the last event, which is always :end_document.
3945
+ # Be aware that this causes the stream to be parsed up to the +depth+
3946
+ # event, so you can effectively pre-parse the entire document (pull the
3947
+ # entire thing into memory) using this method.
3948
+ #
3949
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:231
3950
+ def peek(depth = T.unsafe(nil)); end
3951
+
3952
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:200
3953
+ def position; end
3954
+
3955
+ # Returns the next event. This is a +PullEvent+ object.
3956
+ #
3957
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:246
3958
+ def pull; end
3959
+
3960
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:189
3961
+ def reset; end
3962
+
3963
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:179
3964
+ def source; end
3965
+
3966
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:184
3967
+ def stream=(source); end
3968
+
3969
+ # Unescapes all possible entities
3970
+ #
3971
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:564
3972
+ def unnormalize(string, entities = T.unsafe(nil), filter = T.unsafe(nil)); end
3973
+
3974
+ # Push an event back on the head of the stream. This method
3975
+ # has (theoretically) infinite depth.
3976
+ #
3977
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:221
3978
+ def unshift(token); end
3979
+
3980
+ private
3981
+
3982
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:613
3983
+ def add_namespace(prefix, uri); end
3984
+
3985
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:646
3986
+ def need_source_encoding_update?(xml_declaration_encoding); end
3987
+
3988
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:652
3989
+ def normalize_xml_declaration_encoding(xml_declaration_encoding); end
3990
+
3991
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:849
3992
+ def parse_attribute_value_with_equal(name); end
3993
+
3994
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:868
3995
+ def parse_attributes(prefixes); end
3996
+
3997
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:669
3998
+ def parse_id(base_error_message, accept_external_id:, accept_public_id:); end
3999
+
4000
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:697
4001
+ def parse_id_invalid_details(accept_external_id:, accept_public_id:); end
4002
+
4003
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:656
4004
+ def parse_name(base_error_message); end
4005
+
4006
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:628
4007
+ def pop_namespaces_restore; end
4008
+
4009
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:735
4010
+ def process_comment; end
4011
+
4012
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:747
4013
+ def process_instruction; end
4014
+
4015
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:256
4016
+ def pull_event; end
4017
+
4018
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:622
4019
+ def push_namespaces_restore; end
4020
+
4021
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:639
4022
+ def record_entity_expansion(delta = T.unsafe(nil)); end
4023
+
4024
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:835
4025
+ def scan_quote; end
4026
+
4027
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:769
4028
+ def xml_declaration; end
4029
+ end
4030
+
4031
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:130
4032
+ REXML::Parsers::BaseParser::EXTERNAL_ID_PUBLIC = T.let(T.unsafe(nil), Regexp)
4033
+
4034
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:131
4035
+ REXML::Parsers::BaseParser::EXTERNAL_ID_SYSTEM = T.let(T.unsafe(nil), Regexp)
4036
+
4037
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:132
4038
+ REXML::Parsers::BaseParser::PUBLIC_ID = T.let(T.unsafe(nil), Regexp)
4039
+
4040
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:143
4041
+ module REXML::Parsers::BaseParser::Private; end
4042
+
4043
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:148
4044
+ REXML::Parsers::BaseParser::Private::ATTLISTDECL_END = T.let(T.unsafe(nil), Regexp)
4045
+
4046
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:153
4047
+ REXML::Parsers::BaseParser::Private::CARRIAGE_RETURN_NEWLINE_PATTERN = T.let(T.unsafe(nil), Regexp)
4048
+
4049
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:154
4050
+ REXML::Parsers::BaseParser::Private::CHARACTER_REFERENCES = T.let(T.unsafe(nil), Regexp)
4051
+
4052
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:146
4053
+ REXML::Parsers::BaseParser::Private::CLOSE_PATTERN = T.let(T.unsafe(nil), Regexp)
4054
+
4055
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:155
4056
+ REXML::Parsers::BaseParser::Private::DEFAULT_ENTITIES_PATTERNS = T.let(T.unsafe(nil), Hash)
4057
+
4058
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:152
4059
+ REXML::Parsers::BaseParser::Private::ENTITYDECL_PATTERN = T.let(T.unsafe(nil), Regexp)
4060
+
4061
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:147
4062
+ REXML::Parsers::BaseParser::Private::EQUAL_PATTERN = T.let(T.unsafe(nil), Regexp)
4063
+
4064
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:150
4065
+ REXML::Parsers::BaseParser::Private::GEDECL_PATTERN = T.let(T.unsafe(nil), String)
4066
+
4067
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:149
4068
+ REXML::Parsers::BaseParser::Private::NAME_PATTERN = T.let(T.unsafe(nil), Regexp)
4069
+
4070
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:151
4071
+ REXML::Parsers::BaseParser::Private::PEDECL_PATTERN = T.let(T.unsafe(nil), String)
4072
+
4073
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:144
4074
+ REXML::Parsers::BaseParser::Private::PEREFERENCE_PATTERN = T.let(T.unsafe(nil), Regexp)
4075
+
4076
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:145
4077
+ REXML::Parsers::BaseParser::Private::TAG_PATTERN = T.let(T.unsafe(nil), Regexp)
4078
+
4079
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:160
4080
+ REXML::Parsers::BaseParser::Private::XML_PREFIXED_NAMESPACE = T.let(T.unsafe(nil), String)
4081
+
4082
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:66
4083
+ REXML::Parsers::BaseParser::QNAME = T.let(T.unsafe(nil), Regexp)
4084
+
4085
+ # pkg:gem/rexml#lib/rexml/parsers/baseparser.rb:65
4086
+ REXML::Parsers::BaseParser::QNAME_STR = T.let(T.unsafe(nil), String)
4087
+
4088
+ # pkg:gem/rexml#lib/rexml/parsers/streamparser.rb:6
4089
+ class REXML::Parsers::StreamParser
4090
+ # pkg:gem/rexml#lib/rexml/parsers/streamparser.rb:7
4091
+ def initialize(source, listener); end
4092
+
4093
+ # pkg:gem/rexml#lib/rexml/parsers/streamparser.rb:13
4094
+ def add_listener(listener); end
4095
+
4096
+ # pkg:gem/rexml#lib/rexml/parsers/streamparser.rb:17
4097
+ def entity_expansion_count; end
4098
+
4099
+ # pkg:gem/rexml#lib/rexml/parsers/streamparser.rb:21
4100
+ def entity_expansion_limit=(limit); end
4101
+
4102
+ # pkg:gem/rexml#lib/rexml/parsers/streamparser.rb:25
4103
+ def entity_expansion_text_limit=(limit); end
4104
+
4105
+ # pkg:gem/rexml#lib/rexml/parsers/streamparser.rb:29
4106
+ def parse; end
4107
+ end
4108
+
4109
+ # pkg:gem/rexml#lib/rexml/parsers/treeparser.rb:7
4110
+ class REXML::Parsers::TreeParser
4111
+ # pkg:gem/rexml#lib/rexml/parsers/treeparser.rb:8
4112
+ def initialize(source, build_context = T.unsafe(nil)); end
4113
+
4114
+ # pkg:gem/rexml#lib/rexml/parsers/treeparser.rb:13
4115
+ def add_listener(listener); end
4116
+
4117
+ # pkg:gem/rexml#lib/rexml/parsers/treeparser.rb:17
4118
+ def parse; end
4119
+ end
4120
+
4121
+ # You don't want to use this class. Really. Use XPath, which is a wrapper
4122
+ # for this class. Believe me. You don't want to poke around in here.
4123
+ # There is strange, dark magic at work in this code. Beware. Go back! Go
4124
+ # back while you still can!
4125
+ #
4126
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:12
4127
+ class REXML::Parsers::XPathParser
4128
+ include ::REXML::XMLTokens
4129
+
4130
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:42
4131
+ def abbreviate(path_or_parsed); end
4132
+
4133
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:132
4134
+ def expand(path_or_parsed); end
4135
+
4136
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:16
4137
+ def namespaces=(namespaces); end
4138
+
4139
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:21
4140
+ def parse(path); end
4141
+
4142
+ # For backward compatibility
4143
+ #
4144
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:221
4145
+ def preciate_to_string(parsed, &block); end
4146
+
4147
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:36
4148
+ def predicate(path); end
4149
+
4150
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:174
4151
+ def predicate_to_path(parsed, &block); end
4152
+
4153
+ private
4154
+
4155
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:505
4156
+ def AdditiveExpr(path, parsed); end
4157
+
4158
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:438
4159
+ def AndExpr(path, parsed); end
4160
+
4161
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:457
4162
+ def EqualityExpr(path, parsed); end
4163
+
4164
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:608
4165
+ def FilterExpr(path, parsed); end
4166
+
4167
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:663
4168
+ def FunctionCall(rest, parsed); end
4169
+
4170
+ # LocationPath
4171
+ # | RelativeLocationPath
4172
+ # | '/' RelativeLocationPath?
4173
+ # | '//' RelativeLocationPath
4174
+ #
4175
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:243
4176
+ def LocationPath(path, parsed); end
4177
+
4178
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:528
4179
+ def MultiplicativeExpr(path, parsed); end
4180
+
4181
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:343
4182
+ def NodeTest(path, parsed); end
4183
+
4184
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:419
4185
+ def OrExpr(path, parsed); end
4186
+
4187
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:590
4188
+ def PathExpr(path, parsed); end
4189
+
4190
+ # Filters the supplied nodeset on the predicate(s)
4191
+ #
4192
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:395
4193
+ def Predicate(path, parsed); end
4194
+
4195
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:626
4196
+ def PrimaryExpr(path, parsed); end
4197
+
4198
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:480
4199
+ def RelationalExpr(path, parsed); end
4200
+
4201
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:267
4202
+ def RelativeLocationPath(path, parsed); end
4203
+
4204
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:553
4205
+ def UnaryExpr(path, parsed); end
4206
+
4207
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:571
4208
+ def UnionExpr(path, parsed); end
4209
+
4210
+ # get_group( '[foo]bar' ) -> ['bar', '[foo]']
4211
+ #
4212
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:676
4213
+ def get_group(string); end
4214
+
4215
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:694
4216
+ def parse_args(string); end
4217
+
4218
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:224
4219
+ def quote_literal(literal); end
4220
+ end
4221
+
4222
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:339
4223
+ REXML::Parsers::XPathParser::LOCAL_NAME_WILDCARD = T.let(T.unsafe(nil), Regexp)
4224
+
4225
+ # Returns a 1-1 map of the nodeset
4226
+ # The contents of the resulting array are either:
4227
+ # true/false, if a positive match
4228
+ # String, if a name match
4229
+ # NodeTest
4230
+ # | ('*' | NCNAME ':' '*' | QNAME) NameTest
4231
+ # | '*' ':' NCNAME NameTest since XPath 2.0
4232
+ # | NODE_TYPE '(' ')' NodeType
4233
+ # | PI '(' LITERAL ')' PI
4234
+ # | '[' expr ']' Predicate
4235
+ #
4236
+ # pkg:gem/rexml#lib/rexml/parsers/xpathparser.rb:338
4237
+ REXML::Parsers::XPathParser::PREFIX_WILDCARD = T.let(T.unsafe(nil), Regexp)
4238
+
4239
+ # pkg:gem/rexml#lib/rexml/doctype.rb:10
4240
+ class REXML::ReferenceWriter
4241
+ # pkg:gem/rexml#lib/rexml/doctype.rb:11
4242
+ def initialize(id_type, public_id_literal, system_literal, context = T.unsafe(nil)); end
4243
+
4244
+ # pkg:gem/rexml#lib/rexml/doctype.rb:25
4245
+ def write(output); end
4246
+ end
4247
+
4248
+ # pkg:gem/rexml#lib/rexml/security.rb:3
4249
+ module REXML::Security
4250
+ class << self
4251
+ # Get the entity expansion limit. By default the limit is set to 10000.
4252
+ #
4253
+ # pkg:gem/rexml#lib/rexml/security.rb:12
4254
+ def entity_expansion_limit; end
4255
+
4256
+ # Set the entity expansion limit. By default the limit is set to 10000.
4257
+ #
4258
+ # pkg:gem/rexml#lib/rexml/security.rb:7
4259
+ def entity_expansion_limit=(val); end
4260
+
4261
+ # Get the entity expansion limit. By default the limit is set to 10240.
4262
+ #
4263
+ # pkg:gem/rexml#lib/rexml/security.rb:24
4264
+ def entity_expansion_text_limit; end
4265
+
4266
+ # Set the entity expansion limit. By default the limit is set to 10240.
4267
+ #
4268
+ # pkg:gem/rexml#lib/rexml/security.rb:19
4269
+ def entity_expansion_text_limit=(val); end
4270
+ end
4271
+ end
4272
+
4273
+ # A Source can be searched for patterns, and wraps buffers and other
4274
+ # objects and provides consumption of text
4275
+ #
4276
+ # pkg:gem/rexml#lib/rexml/source.rb:61
4277
+ class REXML::Source
4278
+ include ::REXML::Encoding
4279
+
4280
+ # Constructor
4281
+ # @param arg must be a String, and should be a valid XML document
4282
+ # @param encoding if non-null, sets the encoding of the source to this
4283
+ # value, overriding all encoding detection
4284
+ #
4285
+ # pkg:gem/rexml#lib/rexml/source.rb:88
4286
+ def initialize(arg, encoding = T.unsafe(nil)); end
4287
+
4288
+ # The current buffer (what we're going to read next)
4289
+ #
4290
+ # pkg:gem/rexml#lib/rexml/source.rb:101
4291
+ def buffer; end
4292
+
4293
+ # pkg:gem/rexml#lib/rexml/source.rb:111
4294
+ def buffer_encoding=(encoding); end
4295
+
4296
+ # @return the current line in the source
4297
+ #
4298
+ # pkg:gem/rexml#lib/rexml/source.rb:180
4299
+ def current_line; end
4300
+
4301
+ # pkg:gem/rexml#lib/rexml/source.rb:105
4302
+ def drop_parsed_content; end
4303
+
4304
+ # @return true if the Source is exhausted
4305
+ #
4306
+ # pkg:gem/rexml#lib/rexml/source.rb:175
4307
+ def empty?; end
4308
+
4309
+ # pkg:gem/rexml#lib/rexml/source.rb:65
4310
+ def encoding; end
4311
+
4312
+ # Inherited from Encoding
4313
+ # Overridden to support optimized en/decoding
4314
+ #
4315
+ # pkg:gem/rexml#lib/rexml/source.rb:117
4316
+ def encoding=(enc); end
4317
+
4318
+ # pkg:gem/rexml#lib/rexml/source.rb:135
4319
+ def ensure_buffer; end
4320
+
4321
+ # The line number of the last consumed text
4322
+ #
4323
+ # pkg:gem/rexml#lib/rexml/source.rb:64
4324
+ def line; end
4325
+
4326
+ # pkg:gem/rexml#lib/rexml/source.rb:138
4327
+ def match(pattern, cons = T.unsafe(nil)); end
4328
+
4329
+ # pkg:gem/rexml#lib/rexml/source.rb:146
4330
+ def match?(pattern, cons = T.unsafe(nil)); end
4331
+
4332
+ # pkg:gem/rexml#lib/rexml/source.rb:166
4333
+ def peek_byte; end
4334
+
4335
+ # pkg:gem/rexml#lib/rexml/source.rb:158
4336
+ def position; end
4337
+
4338
+ # pkg:gem/rexml#lib/rexml/source.rb:162
4339
+ def position=(pos); end
4340
+
4341
+ # pkg:gem/rexml#lib/rexml/source.rb:122
4342
+ def read(term = T.unsafe(nil)); end
4343
+
4344
+ # pkg:gem/rexml#lib/rexml/source.rb:125
4345
+ def read_until(term); end
4346
+
4347
+ # pkg:gem/rexml#lib/rexml/source.rb:170
4348
+ def scan_byte; end
4349
+
4350
+ # pkg:gem/rexml#lib/rexml/source.rb:154
4351
+ def skip_spaces; end
4352
+
4353
+ private
4354
+
4355
+ # pkg:gem/rexml#lib/rexml/source.rb:189
4356
+ def detect_encoding; end
4357
+
4358
+ # pkg:gem/rexml#lib/rexml/source.rb:207
4359
+ def encoding_updated; end
4360
+ end
4361
+
4362
+ # pkg:gem/rexml#lib/rexml/source.rb:67
4363
+ module REXML::Source::Private; end
4364
+
4365
+ # pkg:gem/rexml#lib/rexml/source.rb:70
4366
+ REXML::Source::Private::PRE_DEFINED_TERM_PATTERNS = T.let(T.unsafe(nil), Hash)
4367
+
4368
+ # pkg:gem/rexml#lib/rexml/source.rb:69
4369
+ REXML::Source::Private::SCANNER_RESET_SIZE = T.let(T.unsafe(nil), Integer)
4370
+
4371
+ # pkg:gem/rexml#lib/rexml/source.rb:68
4372
+ REXML::Source::Private::SPACES_PATTERN = T.let(T.unsafe(nil), Regexp)
4373
+
4374
+ # Generates Source-s. USE THIS CLASS.
4375
+ #
4376
+ # pkg:gem/rexml#lib/rexml/source.rb:38
4377
+ class REXML::SourceFactory
4378
+ class << self
4379
+ # Generates a Source object
4380
+ # @param arg Either a String, or an IO
4381
+ # @return a Source, or nil if a bad argument was given
4382
+ #
4383
+ # pkg:gem/rexml#lib/rexml/source.rb:42
4384
+ def create_from(arg); end
4385
+ end
4386
+ end
4387
+
4388
+ # Represents text nodes in an XML document
4389
+ #
4390
+ # pkg:gem/rexml#lib/rexml/text.rb:11
4391
+ class REXML::Text < ::REXML::Child
4392
+ include ::Comparable
4393
+
4394
+ # Constructor
4395
+ # +arg+ if a String, the content is set to the String. If a Text,
4396
+ # the object is shallowly cloned.
4397
+ #
4398
+ # +respect_whitespace+ (boolean, false) if true, whitespace is
4399
+ # respected
4400
+ #
4401
+ # +parent+ (nil) if this is a Parent object, the parent
4402
+ # will be set to this.
4403
+ #
4404
+ # +raw+ (nil) This argument can be given three values.
4405
+ # If true, then the value of used to construct this object is expected to
4406
+ # contain no unescaped XML markup, and REXML will not change the text. If
4407
+ # this value is false, the string may contain any characters, and REXML will
4408
+ # escape any and all defined entities whose values are contained in the
4409
+ # text. If this value is nil (the default), then the raw value of the
4410
+ # parent will be used as the raw value for this node. If there is no raw
4411
+ # value for the parent, and no value is supplied, the default is false.
4412
+ # Use this field if you have entities defined for some text, and you don't
4413
+ # want REXML to escape that text in output.
4414
+ # Text.new( "<&", false, nil, false ) #-> "&lt;&amp;"
4415
+ # Text.new( "&lt;&amp;", false, nil, false ) #-> "&amp;lt;&amp;amp;"
4416
+ # Text.new( "<&", false, nil, true ) #-> Parse exception
4417
+ # Text.new( "&lt;&amp;", false, nil, true ) #-> "&lt;&amp;"
4418
+ # # Assume that the entity "s" is defined to be "sean"
4419
+ # # and that the entity "r" is defined to be "russell"
4420
+ # Text.new( "sean russell" ) #-> "&s; &r;"
4421
+ # Text.new( "sean russell", false, nil, true ) #-> "sean russell"
4422
+ #
4423
+ # +entity_filter+ (nil) This can be an array of entities to match in the
4424
+ # supplied text. This argument is only useful if +raw+ is set to false.
4425
+ # Text.new( "sean russell", false, nil, false, ["s"] ) #-> "&s; russell"
4426
+ # Text.new( "sean russell", false, nil, true, ["s"] ) #-> "sean russell"
4427
+ # In the last example, the +entity_filter+ argument is ignored.
4428
+ #
4429
+ # +illegal+ INTERNAL USE ONLY
4430
+ #
4431
+ # pkg:gem/rexml#lib/rexml/text.rb:79
4432
+ def initialize(arg, respect_whitespace = T.unsafe(nil), parent = T.unsafe(nil), raw = T.unsafe(nil), entity_filter = T.unsafe(nil), illegal = T.unsafe(nil)); end
4433
+
4434
+ # Appends text to this text node. The text is appended in the +raw+ mode
4435
+ # of this text node.
4436
+ #
4437
+ # +returns+ the text itself to enable method chain like
4438
+ # 'text << "XXX" << "YYY"'.
4439
+ #
4440
+ # pkg:gem/rexml#lib/rexml/text.rb:189
4441
+ def <<(to_append); end
4442
+
4443
+ # +other+ a String or a Text
4444
+ # +returns+ the result of (to_s <=> arg.to_s)
4445
+ #
4446
+ # pkg:gem/rexml#lib/rexml/text.rb:198
4447
+ def <=>(other); end
4448
+
4449
+ # pkg:gem/rexml#lib/rexml/text.rb:179
4450
+ def clone; end
4451
+
4452
+ # pkg:gem/rexml#lib/rexml/text.rb:202
4453
+ def doctype; end
4454
+
4455
+ # pkg:gem/rexml#lib/rexml/text.rb:174
4456
+ def empty?; end
4457
+
4458
+ # pkg:gem/rexml#lib/rexml/text.rb:271
4459
+ def indent_text(string, level = T.unsafe(nil), style = T.unsafe(nil), indentfirstline = T.unsafe(nil)); end
4460
+
4461
+ # pkg:gem/rexml#lib/rexml/text.rb:225
4462
+ def inspect; end
4463
+
4464
+ # pkg:gem/rexml#lib/rexml/text.rb:170
4465
+ def node_type; end
4466
+
4467
+ # pkg:gem/rexml#lib/rexml/text.rb:110
4468
+ def parent=(parent); end
4469
+
4470
+ # If +raw+ is true, then REXML leaves the value alone
4471
+ #
4472
+ # pkg:gem/rexml#lib/rexml/text.rb:21
4473
+ def raw; end
4474
+
4475
+ # If +raw+ is true, then REXML leaves the value alone
4476
+ #
4477
+ # pkg:gem/rexml#lib/rexml/text.rb:21
4478
+ def raw=(_arg0); end
4479
+
4480
+ # Returns the string value of this text node. This string is always
4481
+ # escaped, meaning that it is a valid XML text node string, and all
4482
+ # entities that can be escaped, have been inserted. This method respects
4483
+ # the entity filter set in the constructor.
4484
+ #
4485
+ # # Assume that the entity "s" is defined to be "sean", and that the
4486
+ # # entity "r" is defined to be "russell"
4487
+ # t = Text.new( "< & sean russell", false, nil, false, ['s'] )
4488
+ # t.to_s #-> "&lt; &amp; &s; russell"
4489
+ # t = Text.new( "< & &s; russell", false, nil, false )
4490
+ # t.to_s #-> "&lt; &amp; &s; russell"
4491
+ # u = Text.new( "sean russell", false, nil, true )
4492
+ # u.to_s #-> "sean russell"
4493
+ #
4494
+ # pkg:gem/rexml#lib/rexml/text.rb:220
4495
+ def to_s; end
4496
+
4497
+ # Returns the string value of this text. This is the text without
4498
+ # entities, as it might be used programmatically, or printed to the
4499
+ # console. This ignores the 'raw' attribute setting, and any
4500
+ # entity_filter.
4501
+ #
4502
+ # # Assume that the entity "s" is defined to be "sean", and that the
4503
+ # # entity "r" is defined to be "russell"
4504
+ # t = Text.new( "< & sean russell", false, nil, false, ['s'] )
4505
+ # t.value #-> "< & sean russell"
4506
+ # t = Text.new( "< & &s; russell", false, nil, false )
4507
+ # t.value #-> "< & sean russell"
4508
+ # u = Text.new( "sean russell", false, nil, true )
4509
+ # u.value #-> "sean russell"
4510
+ #
4511
+ # pkg:gem/rexml#lib/rexml/text.rb:242
4512
+ def value; end
4513
+
4514
+ # Sets the contents of this text node. This expects the text to be
4515
+ # unnormalized. It returns self.
4516
+ #
4517
+ # e = Element.new( "a" )
4518
+ # e.add_text( "foo" ) # <a>foo</a>
4519
+ # e[0].value = "bar" # <a>bar</a>
4520
+ # e[0].value = "<a>" # <a>&lt;a&gt;</a>
4521
+ #
4522
+ # pkg:gem/rexml#lib/rexml/text.rb:254
4523
+ def value=(val); end
4524
+
4525
+ # pkg:gem/rexml#lib/rexml/text.rb:260
4526
+ def wrap(string, width, addnewline = T.unsafe(nil)); end
4527
+
4528
+ # == DEPRECATED
4529
+ # See REXML::Formatters
4530
+ #
4531
+ # pkg:gem/rexml#lib/rexml/text.rb:288
4532
+ def write(writer, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
4533
+
4534
+ # Writes out text, substituting special characters beforehand.
4535
+ # +out+ A String, IO, or any other object supporting <<( String )
4536
+ # +input+ the text to substitute and the write out
4537
+ #
4538
+ # z=utf8.unpack("U*")
4539
+ # ascOut=""
4540
+ # z.each{|r|
4541
+ # if r < 0x100
4542
+ # ascOut.concat(r.chr)
4543
+ # else
4544
+ # ascOut.concat(sprintf("&#x%x;", r))
4545
+ # end
4546
+ # }
4547
+ # puts ascOut
4548
+ #
4549
+ # pkg:gem/rexml#lib/rexml/text.rb:318
4550
+ def write_with_substitution(out, input); end
4551
+
4552
+ # FIXME
4553
+ # This probably won't work properly
4554
+ #
4555
+ # pkg:gem/rexml#lib/rexml/text.rb:300
4556
+ def xpath; end
4557
+
4558
+ private
4559
+
4560
+ # pkg:gem/rexml#lib/rexml/text.rb:331
4561
+ def clear_cache; end
4562
+
4563
+ class << self
4564
+ # check for illegal characters
4565
+ #
4566
+ # pkg:gem/rexml#lib/rexml/text.rb:116
4567
+ def check(string, pattern, doctype = T.unsafe(nil)); end
4568
+
4569
+ # pkg:gem/rexml#lib/rexml/text.rb:401
4570
+ def expand(ref, doctype, filter); end
4571
+
4572
+ # Escapes all possible entities
4573
+ #
4574
+ # pkg:gem/rexml#lib/rexml/text.rb:363
4575
+ def normalize(input, doctype = T.unsafe(nil), entity_filter = T.unsafe(nil)); end
4576
+
4577
+ # Reads text, substituting entities
4578
+ #
4579
+ # pkg:gem/rexml#lib/rexml/text.rb:337
4580
+ def read_with_substitution(input, illegal = T.unsafe(nil)); end
4581
+
4582
+ # Unescapes all possible entities
4583
+ #
4584
+ # pkg:gem/rexml#lib/rexml/text.rb:387
4585
+ def unnormalize(string, doctype = T.unsafe(nil), filter = T.unsafe(nil), illegal = T.unsafe(nil), entity_expansion_text_limit: T.unsafe(nil)); end
4586
+ end
4587
+ end
4588
+
4589
+ # pkg:gem/rexml#lib/rexml/undefinednamespaceexception.rb:4
4590
+ class REXML::UndefinedNamespaceException < ::REXML::ParseException
4591
+ # pkg:gem/rexml#lib/rexml/undefinednamespaceexception.rb:5
4592
+ def initialize(prefix, source, parser); end
4593
+ end
4594
+
4595
+ # pkg:gem/rexml#lib/rexml/validation/validationexception.rb:4
4596
+ class REXML::Validation::ValidationException < ::RuntimeError
4597
+ # pkg:gem/rexml#lib/rexml/validation/validationexception.rb:5
4598
+ def initialize(msg); end
4599
+ end
4600
+
4601
+ # NEEDS DOCUMENTATION
4602
+ #
4603
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:8
4604
+ class REXML::XMLDecl < ::REXML::Child
4605
+ include ::REXML::Encoding
4606
+
4607
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:20
4608
+ def initialize(version = T.unsafe(nil), encoding = T.unsafe(nil), standalone = T.unsafe(nil)); end
4609
+
4610
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:56
4611
+ def ==(other); end
4612
+
4613
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:39
4614
+ def clone; end
4615
+
4616
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:102
4617
+ def dowrite; end
4618
+
4619
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:76
4620
+ def encoding=(enc); end
4621
+
4622
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:106
4623
+ def inspect; end
4624
+
4625
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:69
4626
+ def node_type; end
4627
+
4628
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:98
4629
+ def nowrite; end
4630
+
4631
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:74
4632
+ def old_enc=(encoding); end
4633
+
4634
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:73
4635
+ def stand_alone?; end
4636
+
4637
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:17
4638
+ def standalone; end
4639
+
4640
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:17
4641
+ def standalone=(_arg0); end
4642
+
4643
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:17
4644
+ def version; end
4645
+
4646
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:17
4647
+ def version=(_arg0); end
4648
+
4649
+ # indent::
4650
+ # Ignored. There must be no whitespace before an XML declaration
4651
+ # transitive::
4652
+ # Ignored
4653
+ # ie_hack::
4654
+ # Ignored
4655
+ #
4656
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:49
4657
+ def write(writer, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
4658
+
4659
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:18
4660
+ def writeencoding; end
4661
+
4662
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:18
4663
+ def writethis; end
4664
+
4665
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:63
4666
+ def xmldecl(version, encoding, standalone); end
4667
+
4668
+ private
4669
+
4670
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:111
4671
+ def content(enc); end
4672
+
4673
+ class << self
4674
+ # Only use this if you do not want the XML declaration to be written;
4675
+ # this object is ignored by the XML writer. Otherwise, instantiate your
4676
+ # own XMLDecl and add it to the document.
4677
+ #
4678
+ # Note that XML 1.1 documents *must* include an XML declaration
4679
+ #
4680
+ # pkg:gem/rexml#lib/rexml/xmldecl.rb:92
4681
+ def default; end
4682
+ end
4683
+ end
4684
+
4685
+ # Wrapper class. Use this class to access the XPath functions.
4686
+ #
4687
+ # pkg:gem/rexml#lib/rexml/xpath.rb:7
4688
+ class REXML::XPath
4689
+ include ::REXML::Functions
4690
+
4691
+ class << self
4692
+ # Iterates over nodes that match the given path, calling the supplied
4693
+ # block with the match.
4694
+ # element::
4695
+ # The context element
4696
+ # path::
4697
+ # The xpath to search for. If not supplied or nil, defaults to '*'
4698
+ # namespaces::
4699
+ # If supplied, a Hash which defines a namespace mapping
4700
+ # variables::
4701
+ # If supplied, a Hash which maps $variables in the query
4702
+ # to values. This can be used to avoid XPath injection attacks
4703
+ # or to automatically handle escaping string values.
4704
+ #
4705
+ # XPath.each( node ) { |el| ... }
4706
+ # XPath.each( node, '/*[@attr='v']' ) { |el| ... }
4707
+ # XPath.each( node, 'ancestor::x' ) { |el| ... }
4708
+ # XPath.each( node, '/book/publisher/text()=$publisher', {}, {"publisher"=>"O'Reilly"}) \
4709
+ # {|el| ... }
4710
+ #
4711
+ # pkg:gem/rexml#lib/rexml/xpath.rb:55
4712
+ def each(element, path = T.unsafe(nil), namespaces = T.unsafe(nil), variables = T.unsafe(nil), options = T.unsafe(nil), &block); end
4713
+
4714
+ # Finds and returns the first node that matches the supplied xpath.
4715
+ # element::
4716
+ # The context element
4717
+ # path::
4718
+ # The xpath to search for. If not supplied or nil, returns the first
4719
+ # node matching '*'.
4720
+ # namespaces::
4721
+ # If supplied, a Hash which defines a namespace mapping.
4722
+ # variables::
4723
+ # If supplied, a Hash which maps $variables in the query
4724
+ # to values. This can be used to avoid XPath injection attacks
4725
+ # or to automatically handle escaping string values.
4726
+ #
4727
+ # XPath.first( node )
4728
+ # XPath.first( doc, "//b"} )
4729
+ # XPath.first( node, "a/x:b", { "x"=>"http://doofus" } )
4730
+ # XPath.first( node, '/book/publisher/text()=$publisher', {}, {"publisher"=>"O'Reilly"})
4731
+ #
4732
+ # pkg:gem/rexml#lib/rexml/xpath.rb:31
4733
+ def first(element, path = T.unsafe(nil), namespaces = T.unsafe(nil), variables = T.unsafe(nil), options = T.unsafe(nil)); end
4734
+
4735
+ # Returns an array of nodes matching a given XPath.
4736
+ #
4737
+ # pkg:gem/rexml#lib/rexml/xpath.rb:62
4738
+ def match(element, path = T.unsafe(nil), namespaces = T.unsafe(nil), variables = T.unsafe(nil), options = T.unsafe(nil)); end
4739
+ end
4740
+ end
4741
+
4742
+ # @private
4743
+ #
4744
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:965
4745
+ class REXML::XPathNode
4746
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:967
4747
+ def initialize(node, context = T.unsafe(nil)); end
4748
+
4749
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:966
4750
+ def context; end
4751
+
4752
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:976
4753
+ def position; end
4754
+
4755
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:966
4756
+ def raw_node; end
4757
+ end
4758
+
4759
+ # You don't want to use this class. Really. Use XPath, which is a wrapper
4760
+ # for this class. Believe me. You don't want to poke around in here.
4761
+ # There is strange, dark magic at work in this code. Beware. Go back! Go
4762
+ # back while you still can!
4763
+ #
4764
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:54
4765
+ class REXML::XPathParser
4766
+ include ::REXML::XMLTokens
4767
+
4768
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:60
4769
+ def initialize(strict: T.unsafe(nil)); end
4770
+
4771
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:107
4772
+ def []=(variable_name, value); end
4773
+
4774
+ # Performs a depth-first (document order) XPath search, and returns the
4775
+ # first match. This is the fastest, lightest way to return a single result.
4776
+ #
4777
+ # FIXME: This method is incomplete!
4778
+ #
4779
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:116
4780
+ def first(path_stack, node); end
4781
+
4782
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:97
4783
+ def get_first(path, node); end
4784
+
4785
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:153
4786
+ def match(path_stack, node); end
4787
+
4788
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:69
4789
+ def namespaces=(namespaces = T.unsafe(nil)); end
4790
+
4791
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:79
4792
+ def parse(path, node); end
4793
+
4794
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:102
4795
+ def predicate(path, node); end
4796
+
4797
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:74
4798
+ def variables=(vars = T.unsafe(nil)); end
4799
+
4800
+ private
4801
+
4802
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:781
4803
+ def child(nodeset); end
4804
+
4805
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:922
4806
+ def compare(a, operator, b); end
4807
+
4808
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:687
4809
+ def descendant(nodeset, include_self); end
4810
+
4811
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:698
4812
+ def descendant_recursive(raw_node, new_nodeset, new_nodes, include_self); end
4813
+
4814
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:944
4815
+ def each_unnode(nodeset); end
4816
+
4817
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:646
4818
+ def enter(tag, *args); end
4819
+
4820
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:821
4821
+ def equality_relational_compare(set1, op, set2); end
4822
+
4823
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:596
4824
+ def evaluate_predicate(expression, nodesets); end
4825
+
4826
+ # Expr takes a stack of path elements and a set of nodes (either a Parent
4827
+ # or an Array and returns an Array of matching nodes
4828
+ #
4829
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:186
4830
+ def expr(path_stack, nodeset, context = T.unsafe(nil)); end
4831
+
4832
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:587
4833
+ def filter_nodeset(nodeset); end
4834
+
4835
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:754
4836
+ def following(node); end
4837
+
4838
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:765
4839
+ def following_node_of(node); end
4840
+
4841
+ # Returns a String namespace for a node, given a prefix
4842
+ # The rules are:
4843
+ #
4844
+ # 1. Use the supplied namespace mapping first.
4845
+ # 2. If no mapping was supplied, use the context node to look up the namespace
4846
+ #
4847
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:174
4848
+ def get_namespace(node, prefix); end
4849
+
4850
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:651
4851
+ def leave(tag, *args); end
4852
+
4853
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:771
4854
+ def next_sibling_node(node); end
4855
+
4856
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:488
4857
+ def node_test(path_stack, nodesets, any_type: T.unsafe(nil)); end
4858
+
4859
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:808
4860
+ def norm(b); end
4861
+
4862
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:896
4863
+ def normalize_compare_values(a, operator, b); end
4864
+
4865
+ # Builds a nodeset of all of the preceding nodes of the supplied node,
4866
+ # in reverse document order
4867
+ # preceding:: includes every element in the document that precedes this node,
4868
+ # except for ancestors
4869
+ #
4870
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:717
4871
+ def preceding(node); end
4872
+
4873
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:739
4874
+ def preceding_node_of(node); end
4875
+
4876
+ # Reorders an array of nodes so that they are in document order
4877
+ # It tries to do this efficiently.
4878
+ #
4879
+ # FIXME: I need to get rid of this, but the issue is that most of the XPath
4880
+ # interpreter functions as a filter, which means that we lose context going
4881
+ # in and out of function calls. If I knew what the index of the nodes was,
4882
+ # I wouldn't have to do this. Maybe add a document IDX for each node?
4883
+ # Problems with mutable documents. Or, rewrite everything.
4884
+ #
4885
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:664
4886
+ def sort(array_of_nodes, order); end
4887
+
4888
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:452
4889
+ def step(path_stack, any_type: T.unsafe(nil), order: T.unsafe(nil)); end
4890
+
4891
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:165
4892
+ def strict?; end
4893
+
4894
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:639
4895
+ def trace(*args); end
4896
+
4897
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:956
4898
+ def unnode(nodeset); end
4899
+
4900
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:883
4901
+ def value_type(value); end
4902
+ end
4903
+
4904
+ # pkg:gem/rexml#lib/rexml/xpath_parser.rb:58
4905
+ REXML::XPathParser::DEBUG = T.let(T.unsafe(nil), FalseClass)