checkoff 0.200.0 → 0.203.0

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