checkoff 0.219.0 → 0.221.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +3 -4
- data/.overcommit.yml +2 -0
- data/.rubocop.yml +4 -0
- data/.rubocop_todo.yml +2 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +42 -8
- data/Makefile +13 -7
- data/bin/tapioca +1 -1
- data/checkoff.gemspec +1 -0
- data/fix.sh +1 -0
- data/lib/checkoff/tasks.rb +8 -2
- data/lib/checkoff/version.rb +1 -1
- data/sorbet/rbi/gems/{activesupport@7.1.3.rbi → activesupport@7.1.5.rbi} +157 -160
- data/sorbet/rbi/gems/brakeman@6.2.2.rbi +222 -0
- data/sorbet/rbi/gems/{i18n@1.14.1.rbi → i18n@1.14.6.rbi} +135 -102
- data/sorbet/rbi/gems/{logger@1.6.1.rbi → logger@1.6.2.rbi} +4 -1
- data/sorbet/rbi/gems/{mutex_m@0.2.0.rbi → mutex_m@0.3.0.rbi} +15 -12
- data/sorbet/rbi/gems/{nokogiri@1.16.7.rbi → nokogiri@1.17.0.rbi} +1693 -803
- data/sorbet/rbi/gems/{racc@1.7.3.rbi → racc@1.8.1.rbi} +33 -33
- data/sorbet/rbi/gems/{rack@3.0.8.rbi → rack@3.1.8.rbi} +697 -985
- data/sorbet/rbi/gems/{rexml@3.2.6.rbi → rexml@3.3.9.rbi} +354 -278
- data/sorbet/rbi/gems/rubocop-rspec@3.0.0.rbi +7546 -0
- data/sorbet/rbi/gems/securerandom@0.4.0.rbi +75 -0
- data/sorbet/rbi/gems/solargraph-rails@1.1.0-9dc37915bd4f3b169046e34db6fb32193ab347d8.rbi +320 -0
- data/sorbet/rbi/gems/{tapioca@0.16.4.rbi → tapioca@0.16.5.rbi} +89 -76
- data/sorbet/rbi/gems/{yard@0.9.34.rbi → yard@0.9.37.rbi} +429 -270
- metadata +33 -16
- data/sorbet/rbi/gems/ostruct@0.6.1.rbi +0 -354
- /data/sorbet/rbi/gems/{drb@2.2.0.rbi → drb@2.2.1.rbi} +0 -0
- /data/sorbet/rbi/gems/{gli@2.21.1.rbi → gli@2.22.0.rbi} +0 -0
- /data/sorbet/rbi/gems/{overcommit@0.64.0.rbi → overcommit@0.64.1.rbi} +0 -0
@@ -37,25 +37,18 @@
|
|
37
37
|
# source://nokogiri//lib/nokogiri.rb#38
|
38
38
|
module Nokogiri
|
39
39
|
class << self
|
40
|
-
# source://nokogiri//lib/nokogiri/html4.rb#
|
41
|
-
def HTML(
|
40
|
+
# source://nokogiri//lib/nokogiri/html4.rb#7
|
41
|
+
def HTML(*_arg0, **_arg1, &_arg2); end
|
42
42
|
|
43
|
-
#
|
44
|
-
# HTML4(input, url = nil, encoding = nil, options = XML::ParseOptions::DEFAULT_HTML, &block) → Nokogiri::HTML4::Document
|
45
|
-
#
|
46
|
-
# Parse HTML. Convenience method for Nokogiri::HTML4::Document.parse
|
43
|
+
# Convenience method for Nokogiri::HTML4::Document.parse
|
47
44
|
#
|
48
|
-
# source://nokogiri//lib/nokogiri/html4.rb#
|
49
|
-
def HTML4(
|
45
|
+
# source://nokogiri//lib/nokogiri/html4.rb#7
|
46
|
+
def HTML4(*_arg0, **_arg1, &_arg2); end
|
50
47
|
|
51
|
-
#
|
52
|
-
#
|
53
|
-
# ⚠ HTML5 functionality is not available when running JRuby.
|
54
|
-
#
|
55
|
-
# Parse an HTML5 document. Convenience method for {Nokogiri::HTML5::Document.parse}
|
48
|
+
# Convenience method for Nokogiri::HTML5::Document.parse
|
56
49
|
#
|
57
|
-
# source://nokogiri//lib/nokogiri/html5.rb#
|
58
|
-
def HTML5(
|
50
|
+
# source://nokogiri//lib/nokogiri/html5.rb#28
|
51
|
+
def HTML5(*_arg0, **_arg1, &_arg2); end
|
59
52
|
|
60
53
|
# Parse a document and add the Slop decorator. The Slop decorator
|
61
54
|
# implements method_missing such that methods may be used instead of CSS
|
@@ -74,19 +67,15 @@ module Nokogiri
|
|
74
67
|
# source://nokogiri//lib/nokogiri.rb#91
|
75
68
|
def Slop(*args, &block); end
|
76
69
|
|
77
|
-
#
|
70
|
+
# Convenience method for Nokogiri::XML::Document.parse
|
78
71
|
#
|
79
|
-
# source://nokogiri//lib/nokogiri/xml.rb#
|
80
|
-
def XML(
|
72
|
+
# source://nokogiri//lib/nokogiri/xml.rb#6
|
73
|
+
def XML(*_arg0, **_arg1, &_arg2); end
|
81
74
|
|
82
|
-
#
|
75
|
+
# Convenience method for Nokogiri::XSLT.parse
|
83
76
|
#
|
84
|
-
#
|
85
|
-
|
86
|
-
# xslt = Nokogiri::XSLT(File.read(ARGV[0]))
|
87
|
-
#
|
88
|
-
# source://nokogiri//lib/nokogiri/xslt.rb#13
|
89
|
-
def XSLT(stylesheet, modules = T.unsafe(nil)); end
|
77
|
+
# source://nokogiri//lib/nokogiri/xslt.rb#7
|
78
|
+
def XSLT(*_arg0, **_arg1, &_arg2); end
|
90
79
|
|
91
80
|
# source://nokogiri//lib/nokogiri.rb#96
|
92
81
|
def install_default_aliases; end
|
@@ -133,37 +122,77 @@ module Nokogiri::CSS
|
|
133
122
|
def parse(selector); end
|
134
123
|
|
135
124
|
# :call-seq:
|
136
|
-
# xpath_for(
|
137
|
-
# xpath_for(
|
125
|
+
# xpath_for(selector_list) → Array<String>
|
126
|
+
# xpath_for(selector_list [, prefix:] [, ns:] [, visitor:] [, cache:]) → Array<String>
|
127
|
+
#
|
128
|
+
# Translate a CSS selector list to the equivalent XPath expressions.
|
129
|
+
#
|
130
|
+
# 💡 Note that translated queries are cached by default for performance concerns.
|
138
131
|
#
|
139
|
-
#
|
132
|
+
# ⚠ Users should prefer Nokogiri::XML::Searchable#css, which is mixed into all document and
|
133
|
+
# node classes, for querying documents with CSS selectors. This method is the underlying
|
134
|
+
# mechanism used by XML::Searchable and is provided solely for advanced users to translate
|
135
|
+
# \CSS selectors to XPath directly.
|
136
|
+
#
|
137
|
+
# Also see Nokogiri::XML::Searchable#css for documentation on supported CSS selector features,
|
138
|
+
# some extended syntax that Nokogiri supports, and advanced CSS features like pseudo-class
|
139
|
+
# functions.
|
140
140
|
#
|
141
141
|
# [Parameters]
|
142
|
-
# - +
|
142
|
+
# - +selector_list+ (String)
|
143
|
+
#
|
144
|
+
# The CSS selector to be translated into XPath. This is always a String, but that string
|
145
|
+
# value may be a {selector list}[https://www.w3.org/TR/selectors-4/#grouping] (see
|
146
|
+
# examples).
|
143
147
|
#
|
148
|
+
# [Keyword arguments]
|
144
149
|
# - +prefix:+ (String)
|
145
150
|
#
|
146
|
-
# The XPath prefix
|
147
|
-
# +
|
151
|
+
# The XPath expression prefix which determines the search context. See Nokogiri::XML::XPath
|
152
|
+
# for standard options. Default is +XPath::GLOBAL_SEARCH_PREFIX+.
|
153
|
+
#
|
154
|
+
# - +ns:+ (Hash<String ⇒ String>, nil)
|
155
|
+
#
|
156
|
+
# Namespaces that are referenced in the query, if any. This is a hash where the keys are the
|
157
|
+
# namespace prefix and the values are the namespace URIs. Default is +nil+ indicating an
|
158
|
+
# empty set of namespaces.
|
148
159
|
#
|
149
160
|
# - +visitor:+ (Nokogiri::CSS::XPathVisitor)
|
150
161
|
#
|
151
|
-
#
|
152
|
-
#
|
162
|
+
# Use this XPathVisitor object to transform the CSS AST into XPath expressions. See
|
163
|
+
# Nokogiri::CSS::XPathVisitor for more information on some of the complex behavior that can
|
164
|
+
# be customized for your document type. Default is +Nokogiri::CSS::XPathVisitor.new+.
|
165
|
+
#
|
166
|
+
# ⚠ Note that this option is mutually exclusive with +prefix+ and +ns+. If +visitor+ is
|
167
|
+
# provided, +prefix+ and +ns+ must not be present.
|
168
|
+
#
|
169
|
+
# - +cache:+ (Boolean)
|
170
|
+
#
|
171
|
+
# Whether to use the SelectorCache for the translated query to ensure that repeated queries
|
172
|
+
# don't incur the overhead of re-parsing the selector. Default is +true+.
|
173
|
+
#
|
174
|
+
# [Returns] (Array<String>) The equivalent set of XPath expressions for +selector_list+
|
153
175
|
#
|
154
|
-
#
|
176
|
+
# *Example* with a simple selector:
|
155
177
|
#
|
156
|
-
#
|
157
|
-
# the namespace prefix and the values are the namespace URIs. Default is an empty Hash.
|
178
|
+
# Nokogiri::CSS.xpath_for("div") # => ["//div"]
|
158
179
|
#
|
159
|
-
#
|
180
|
+
# *Example* with a compound selector:
|
160
181
|
#
|
161
|
-
#
|
182
|
+
# Nokogiri::CSS.xpath_for("div.xl") # => ["//div[contains(concat(' ',normalize-space(@class),' '),' xl ')]"]
|
183
|
+
#
|
184
|
+
# *Example* with a complex selector:
|
185
|
+
#
|
186
|
+
# Nokogiri::CSS.xpath_for("h1 + div") # => ["//h1/following-sibling::*[1]/self::div"]
|
187
|
+
#
|
188
|
+
# *Example* with a selector list:
|
189
|
+
#
|
190
|
+
# Nokogiri::CSS.xpath_for("h1, h2, h3") # => ["//h1", "//h2", "//h3"]
|
162
191
|
#
|
163
192
|
# @raise [TypeError]
|
164
193
|
#
|
165
|
-
# source://nokogiri//lib/nokogiri/css.rb#
|
166
|
-
def xpath_for(selector, options = T.unsafe(nil)); end
|
194
|
+
# source://nokogiri//lib/nokogiri/css.rb#83
|
195
|
+
def xpath_for(selector, options = T.unsafe(nil), prefix: T.unsafe(nil), visitor: T.unsafe(nil), ns: T.unsafe(nil), cache: T.unsafe(nil)); end
|
167
196
|
end
|
168
197
|
end
|
169
198
|
|
@@ -183,23 +212,23 @@ class Nokogiri::CSS::Node
|
|
183
212
|
|
184
213
|
# Find a node by type using +types+
|
185
214
|
#
|
186
|
-
# source://nokogiri//lib/nokogiri/css/node.rb#
|
215
|
+
# source://nokogiri//lib/nokogiri/css/node.rb#36
|
187
216
|
def find_by_type(types); end
|
188
217
|
|
189
218
|
# Convert to array
|
190
219
|
#
|
191
|
-
# source://nokogiri//lib/nokogiri/css/node.rb#
|
220
|
+
# source://nokogiri//lib/nokogiri/css/node.rb#53
|
192
221
|
def to_a; end
|
193
222
|
|
194
223
|
# Convert to_type
|
195
224
|
#
|
196
|
-
# source://nokogiri//lib/nokogiri/css/node.rb#
|
225
|
+
# source://nokogiri//lib/nokogiri/css/node.rb#46
|
197
226
|
def to_type; end
|
198
227
|
|
199
228
|
# Convert this CSS node to xpath with +prefix+ using +visitor+
|
200
229
|
#
|
201
230
|
# source://nokogiri//lib/nokogiri/css/node.rb#26
|
202
|
-
def to_xpath(
|
231
|
+
def to_xpath(visitor); end
|
203
232
|
|
204
233
|
# Get the type of this node
|
205
234
|
#
|
@@ -227,233 +256,228 @@ Nokogiri::CSS::Node::ALLOW_COMBINATOR_ON_SELF = T.let(T.unsafe(nil), Array)
|
|
227
256
|
|
228
257
|
# source://nokogiri//lib/nokogiri/css/parser_extras.rb#7
|
229
258
|
class Nokogiri::CSS::Parser < ::Racc::Parser
|
230
|
-
# Create a new CSS parser with respect to +namespaces+
|
231
|
-
#
|
232
259
|
# @return [Parser] a new instance of Parser
|
233
260
|
#
|
234
|
-
# source://nokogiri//lib/nokogiri/css/parser_extras.rb#
|
235
|
-
def initialize
|
261
|
+
# source://nokogiri//lib/nokogiri/css/parser_extras.rb#8
|
262
|
+
def initialize; end
|
236
263
|
|
237
264
|
# reduce 0 omitted
|
238
265
|
#
|
239
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
266
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#363
|
240
267
|
def _reduce_1(val, _values, result); end
|
241
268
|
|
242
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
269
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#409
|
243
270
|
def _reduce_10(val, _values, result); end
|
244
271
|
|
245
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
272
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#414
|
246
273
|
def _reduce_11(val, _values, result); end
|
247
274
|
|
248
275
|
# reduce 12 omitted
|
249
276
|
#
|
250
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
277
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#426
|
251
278
|
def _reduce_13(val, _values, result); end
|
252
279
|
|
253
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
280
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#431
|
254
281
|
def _reduce_14(val, _values, result); end
|
255
282
|
|
256
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
283
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#436
|
257
284
|
def _reduce_15(val, _values, result); end
|
258
285
|
|
259
286
|
# reduce 16 omitted
|
260
287
|
#
|
261
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
288
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#443
|
262
289
|
def _reduce_17(val, _values, result); end
|
263
290
|
|
264
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
291
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#448
|
265
292
|
def _reduce_18(val, _values, result); end
|
266
293
|
|
267
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
294
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#453
|
268
295
|
def _reduce_19(val, _values, result); end
|
269
296
|
|
270
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
297
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#369
|
271
298
|
def _reduce_2(val, _values, result); end
|
272
299
|
|
273
300
|
# reduce 20 omitted
|
274
301
|
#
|
275
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
302
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#460
|
276
303
|
def _reduce_21(val, _values, result); end
|
277
304
|
|
278
305
|
# reduce 22 omitted
|
279
306
|
#
|
280
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
307
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#467
|
281
308
|
def _reduce_23(val, _values, result); end
|
282
309
|
|
283
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
310
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#472
|
284
311
|
def _reduce_24(val, _values, result); end
|
285
312
|
|
286
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
313
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#477
|
287
314
|
def _reduce_25(val, _values, result); end
|
288
315
|
|
289
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
316
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#484
|
290
317
|
def _reduce_26(val, _values, result); end
|
291
318
|
|
292
319
|
# reduce 27 omitted
|
293
320
|
#
|
294
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
321
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#491
|
295
322
|
def _reduce_28(val, _values, result); end
|
296
323
|
|
297
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
324
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#497
|
298
325
|
def _reduce_29(val, _values, result); end
|
299
326
|
|
300
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
327
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#374
|
301
328
|
def _reduce_3(val, _values, result); end
|
302
329
|
|
303
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
330
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#503
|
304
331
|
def _reduce_30(val, _values, result); end
|
305
332
|
|
306
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
333
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#509
|
307
334
|
def _reduce_31(val, _values, result); end
|
308
335
|
|
309
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
336
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#514
|
310
337
|
def _reduce_32(val, _values, result); end
|
311
338
|
|
312
339
|
# reduce 33 omitted
|
313
340
|
#
|
314
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
341
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#521
|
315
342
|
def _reduce_34(val, _values, result); end
|
316
343
|
|
317
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
344
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#527
|
318
345
|
def _reduce_35(val, _values, result); end
|
319
346
|
|
320
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
347
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#533
|
321
348
|
def _reduce_36(val, _values, result); end
|
322
349
|
|
323
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
350
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#539
|
324
351
|
def _reduce_37(val, _values, result); end
|
325
352
|
|
326
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
353
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#545
|
327
354
|
def _reduce_38(val, _values, result); end
|
328
355
|
|
329
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
356
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#551
|
330
357
|
def _reduce_39(val, _values, result); end
|
331
358
|
|
332
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
359
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#379
|
333
360
|
def _reduce_4(val, _values, result); end
|
334
361
|
|
335
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
362
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#556
|
336
363
|
def _reduce_40(val, _values, result); end
|
337
364
|
|
338
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
365
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#561
|
339
366
|
def _reduce_41(val, _values, result); end
|
340
367
|
|
341
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
368
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#566
|
342
369
|
def _reduce_42(val, _values, result); end
|
343
370
|
|
344
371
|
# reduce 44 omitted
|
345
372
|
#
|
346
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
373
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#575
|
347
374
|
def _reduce_45(val, _values, result); end
|
348
375
|
|
349
376
|
# reduce 46 omitted
|
350
377
|
#
|
351
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
378
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#592
|
352
379
|
def _reduce_47(val, _values, result); end
|
353
380
|
|
354
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
381
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#602
|
355
382
|
def _reduce_48(val, _values, result); end
|
356
383
|
|
357
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
384
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#618
|
358
385
|
def _reduce_49(val, _values, result); end
|
359
386
|
|
360
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
387
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#384
|
361
388
|
def _reduce_5(val, _values, result); end
|
362
389
|
|
363
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
390
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#638
|
364
391
|
def _reduce_50(val, _values, result); end
|
365
392
|
|
366
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
393
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#644
|
367
394
|
def _reduce_51(val, _values, result); end
|
368
395
|
|
369
396
|
# reduce 53 omitted
|
370
397
|
#
|
371
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
398
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#653
|
372
399
|
def _reduce_54(val, _values, result); end
|
373
400
|
|
374
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
401
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#659
|
375
402
|
def _reduce_55(val, _values, result); end
|
376
403
|
|
377
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
404
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#665
|
378
405
|
def _reduce_56(val, _values, result); end
|
379
406
|
|
380
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
407
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#671
|
381
408
|
def _reduce_57(val, _values, result); end
|
382
409
|
|
383
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
410
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#677
|
384
411
|
def _reduce_58(val, _values, result); end
|
385
412
|
|
386
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
413
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#389
|
387
414
|
def _reduce_6(val, _values, result); end
|
388
415
|
|
389
416
|
# reduce 63 omitted
|
390
417
|
#
|
391
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
418
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#693
|
392
419
|
def _reduce_64(val, _values, result); end
|
393
420
|
|
394
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
421
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#698
|
395
422
|
def _reduce_65(val, _values, result); end
|
396
423
|
|
397
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
424
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#703
|
398
425
|
def _reduce_66(val, _values, result); end
|
399
426
|
|
400
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
427
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#708
|
401
428
|
def _reduce_67(val, _values, result); end
|
402
429
|
|
403
430
|
# reduce 68 omitted
|
404
431
|
#
|
405
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
432
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#715
|
406
433
|
def _reduce_69(val, _values, result); end
|
407
434
|
|
408
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
435
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#394
|
409
436
|
def _reduce_7(val, _values, result); end
|
410
437
|
|
411
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
438
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#720
|
412
439
|
def _reduce_70(val, _values, result); end
|
413
440
|
|
414
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
441
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#725
|
415
442
|
def _reduce_71(val, _values, result); end
|
416
443
|
|
417
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
444
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#730
|
418
445
|
def _reduce_72(val, _values, result); end
|
419
446
|
|
420
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
447
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#735
|
421
448
|
def _reduce_73(val, _values, result); end
|
422
449
|
|
423
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
450
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#740
|
424
451
|
def _reduce_74(val, _values, result); end
|
425
452
|
|
426
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
453
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#745
|
427
454
|
def _reduce_75(val, _values, result); end
|
428
455
|
|
429
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
456
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#750
|
430
457
|
def _reduce_76(val, _values, result); end
|
431
458
|
|
432
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
459
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#399
|
433
460
|
def _reduce_8(val, _values, result); end
|
434
461
|
|
435
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
462
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#404
|
436
463
|
def _reduce_9(val, _values, result); end
|
437
464
|
|
438
465
|
# reduce 81 omitted
|
439
466
|
#
|
440
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#
|
467
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#766
|
441
468
|
def _reduce_none(val, _values, result); end
|
442
469
|
|
443
|
-
# source://nokogiri//lib/nokogiri/css/parser_extras.rb#
|
444
|
-
def cache_key(query, prefix, visitor); end
|
445
|
-
|
446
|
-
# source://nokogiri//lib/nokogiri/css/parser_extras.rb#71
|
470
|
+
# source://nokogiri//lib/nokogiri/css/parser_extras.rb#18
|
447
471
|
def next_token; end
|
448
472
|
|
449
473
|
# On CSS parser error, raise an exception
|
450
474
|
#
|
451
475
|
# @raise [SyntaxError]
|
452
476
|
#
|
453
|
-
# source://nokogiri//lib/nokogiri/css/parser_extras.rb#
|
477
|
+
# source://nokogiri//lib/nokogiri/css/parser_extras.rb#30
|
454
478
|
def on_error(error_token_id, error_value, value_stack); end
|
455
479
|
|
456
|
-
# source://nokogiri//lib/nokogiri/css/parser_extras.rb#
|
480
|
+
# source://nokogiri//lib/nokogiri/css/parser_extras.rb#13
|
457
481
|
def parse(string); end
|
458
482
|
|
459
483
|
# source://nokogiri//lib/nokogiri/css/parser.rb#26
|
@@ -462,58 +486,46 @@ class Nokogiri::CSS::Parser < ::Racc::Parser
|
|
462
486
|
# source://nokogiri//lib/nokogiri/css/parser.rb#30
|
463
487
|
def unescape_css_string(str); end
|
464
488
|
|
465
|
-
# Get the xpath for +
|
489
|
+
# Get the xpath for +selector+ using +visitor+
|
466
490
|
#
|
467
|
-
# source://nokogiri//lib/nokogiri/css/parser_extras.rb#
|
468
|
-
def xpath_for(
|
491
|
+
# source://nokogiri//lib/nokogiri/css/parser_extras.rb#23
|
492
|
+
def xpath_for(selector, visitor); end
|
493
|
+
end
|
469
494
|
|
470
|
-
|
471
|
-
|
472
|
-
#
|
473
|
-
# source://nokogiri//lib/nokogiri/css/parser_extras.rb#25
|
474
|
-
def [](string); end
|
495
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#279
|
496
|
+
Nokogiri::CSS::Parser::Racc_arg = T.let(T.unsafe(nil), Array)
|
475
497
|
|
476
|
-
|
477
|
-
|
478
|
-
# source://nokogiri//lib/nokogiri/css/parser_extras.rb#32
|
479
|
-
def []=(string, value); end
|
498
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#357
|
499
|
+
Nokogiri::CSS::Parser::Racc_debug_parser = T.let(T.unsafe(nil), FalseClass)
|
480
500
|
|
481
|
-
|
501
|
+
# source://nokogiri//lib/nokogiri/css/parser.rb#296
|
502
|
+
Nokogiri::CSS::Parser::Racc_token_to_s_table = T.let(T.unsafe(nil), Array)
|
503
|
+
|
504
|
+
# source://nokogiri//lib/nokogiri/css/selector_cache.rb#5
|
505
|
+
module Nokogiri::CSS::SelectorCache
|
506
|
+
class << self
|
507
|
+
# Retrieve the cached XPath expressions for the key
|
482
508
|
#
|
483
|
-
#
|
509
|
+
# source://nokogiri//lib/nokogiri/css/selector_cache.rb#11
|
510
|
+
def [](key); end
|
511
|
+
|
512
|
+
# Insert the XPath expressions `value` at the cache key
|
484
513
|
#
|
485
|
-
# source://nokogiri//lib/nokogiri/css/
|
486
|
-
def
|
514
|
+
# source://nokogiri//lib/nokogiri/css/selector_cache.rb#16
|
515
|
+
def []=(key, value); end
|
487
516
|
|
488
517
|
# Clear the cache
|
489
518
|
#
|
490
|
-
# source://nokogiri//lib/nokogiri/css/
|
519
|
+
# source://nokogiri//lib/nokogiri/css/selector_cache.rb#21
|
491
520
|
def clear_cache(create_new_object = T.unsafe(nil)); end
|
492
521
|
|
493
|
-
#
|
522
|
+
# Construct a unique key cache key
|
494
523
|
#
|
495
|
-
# source://nokogiri//lib/nokogiri/css/
|
496
|
-
def
|
497
|
-
|
498
|
-
# Execute +block+ without cache
|
499
|
-
#
|
500
|
-
# source://nokogiri//lib/nokogiri/css/parser_extras.rb#50
|
501
|
-
def without_cache(&block); end
|
524
|
+
# source://nokogiri//lib/nokogiri/css/selector_cache.rb#32
|
525
|
+
def key(selector:, visitor:); end
|
502
526
|
end
|
503
527
|
end
|
504
528
|
|
505
|
-
# source://nokogiri//lib/nokogiri/css/parser_extras.rb#8
|
506
|
-
Nokogiri::CSS::Parser::CACHE_SWITCH_NAME = T.let(T.unsafe(nil), Symbol)
|
507
|
-
|
508
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#279
|
509
|
-
Nokogiri::CSS::Parser::Racc_arg = T.let(T.unsafe(nil), Array)
|
510
|
-
|
511
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#355
|
512
|
-
Nokogiri::CSS::Parser::Racc_debug_parser = T.let(T.unsafe(nil), FalseClass)
|
513
|
-
|
514
|
-
# source://nokogiri//lib/nokogiri/css/parser.rb#295
|
515
|
-
Nokogiri::CSS::Parser::Racc_token_to_s_table = T.let(T.unsafe(nil), Array)
|
516
|
-
|
517
529
|
# source://nokogiri//lib/nokogiri/css/syntax_error.rb#6
|
518
530
|
class Nokogiri::CSS::SyntaxError < ::Nokogiri::SyntaxError; end
|
519
531
|
|
@@ -587,83 +599,106 @@ class Nokogiri::CSS::XPathVisitor
|
|
587
599
|
#
|
588
600
|
# @return [XPathVisitor] a new instance of XPathVisitor
|
589
601
|
#
|
590
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
591
|
-
def initialize(builtins: T.unsafe(nil), doctype: T.unsafe(nil)); end
|
602
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#69
|
603
|
+
def initialize(builtins: T.unsafe(nil), doctype: T.unsafe(nil), prefix: T.unsafe(nil), namespaces: T.unsafe(nil)); end
|
592
604
|
|
593
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
605
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#297
|
594
606
|
def accept(node); end
|
595
607
|
|
608
|
+
# The visitor configuration set via the +builtins:+ keyword argument to XPathVisitor.new.
|
609
|
+
#
|
610
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#48
|
611
|
+
def builtins; end
|
612
|
+
|
596
613
|
# :call-seq: config() → Hash
|
597
614
|
#
|
598
615
|
# [Returns]
|
599
616
|
# a Hash representing the configuration of the XPathVisitor, suitable for use as
|
600
617
|
# part of the CSS cache key.
|
601
618
|
#
|
602
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
619
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#93
|
603
620
|
def config; end
|
604
621
|
|
605
|
-
#
|
622
|
+
# The visitor configuration set via the +doctype:+ keyword argument to XPathVisitor.new.
|
623
|
+
#
|
624
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#51
|
625
|
+
def doctype; end
|
626
|
+
|
627
|
+
# The visitor configuration set via the +namespaces:+ keyword argument to XPathVisitor.new.
|
628
|
+
#
|
629
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#57
|
630
|
+
def namespaces; end
|
631
|
+
|
632
|
+
# The visitor configuration set via the +prefix:+ keyword argument to XPathVisitor.new.
|
633
|
+
#
|
634
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#54
|
635
|
+
def prefix; end
|
636
|
+
|
637
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#293
|
606
638
|
def visit_attrib_name(node); end
|
607
639
|
|
608
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
640
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#175
|
609
641
|
def visit_attribute_condition(node); end
|
610
642
|
|
611
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
643
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#256
|
612
644
|
def visit_child_selector(node); end
|
613
645
|
|
614
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
646
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#237
|
615
647
|
def visit_class_condition(node); end
|
616
648
|
|
617
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
649
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#241
|
618
650
|
def visit_combinator(node); end
|
619
651
|
|
620
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
652
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#262
|
621
653
|
def visit_conditional_selector(node); end
|
622
654
|
|
623
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
655
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#256
|
624
656
|
def visit_descendant_selector(node); end
|
625
657
|
|
626
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
658
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#256
|
627
659
|
def visit_direct_adjacent_selector(node); end
|
628
660
|
|
629
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
661
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#267
|
630
662
|
def visit_element_name(node); end
|
631
663
|
|
632
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
664
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#256
|
633
665
|
def visit_following_selector(node); end
|
634
666
|
|
635
667
|
# :stopdoc:
|
636
668
|
#
|
637
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
669
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#98
|
638
670
|
def visit_function(node); end
|
639
671
|
|
640
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
672
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#170
|
641
673
|
def visit_id(node); end
|
642
674
|
|
643
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
675
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#161
|
644
676
|
def visit_not(node); end
|
645
677
|
|
646
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
678
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#211
|
647
679
|
def visit_pseudo_class(node); end
|
648
680
|
|
649
681
|
private
|
650
682
|
|
651
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
683
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#364
|
652
684
|
def css_class(hay, needle); end
|
653
685
|
|
654
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
686
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#309
|
655
687
|
def html5_element_name_needs_namespace_handling(node); end
|
656
688
|
|
657
689
|
# @return [Boolean]
|
658
690
|
#
|
659
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
691
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#354
|
660
692
|
def is_of_type_pseudo_class?(node); end
|
661
693
|
|
662
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
694
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#316
|
663
695
|
def nth(node, options = T.unsafe(nil)); end
|
664
696
|
|
665
|
-
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#
|
697
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#340
|
666
698
|
def read_a_and_positive_b(values); end
|
699
|
+
|
700
|
+
# source://nokogiri//lib/nokogiri/css/xpath_visitor.rb#303
|
701
|
+
def validate_xpath_function_name(name); end
|
667
702
|
end
|
668
703
|
|
669
704
|
# Enum to direct XPathVisitor when to use Nokogiri builtin XPath functions.
|
@@ -782,7 +817,7 @@ module Nokogiri::Decorators::Slop
|
|
782
817
|
|
783
818
|
# @return [Boolean]
|
784
819
|
#
|
785
|
-
# source://nokogiri//lib/nokogiri/decorators/slop.rb#
|
820
|
+
# source://nokogiri//lib/nokogiri/decorators/slop.rb#35
|
786
821
|
def respond_to_missing?(name, include_private = T.unsafe(nil)); end
|
787
822
|
end
|
788
823
|
|
@@ -815,8 +850,8 @@ Nokogiri::EncodingHandler::USEFUL_ALIASES = T.let(T.unsafe(nil), Hash)
|
|
815
850
|
# source://nokogiri//lib/nokogiri/gumbo.rb#4
|
816
851
|
module Nokogiri::Gumbo
|
817
852
|
class << self
|
818
|
-
def fragment(_arg0
|
819
|
-
def parse(_arg0
|
853
|
+
def fragment(*_arg0); end
|
854
|
+
def parse(*_arg0); end
|
820
855
|
end
|
821
856
|
end
|
822
857
|
|
@@ -848,18 +883,18 @@ Nokogiri::HTML = Nokogiri::HTML4
|
|
848
883
|
# 💡 Before v1.12.0, Nokogiri::HTML4 did not exist, and Nokogiri::HTML was the module/namespace
|
849
884
|
# for parsing HTML.
|
850
885
|
#
|
851
|
-
# source://nokogiri//lib/nokogiri/html4.rb#
|
886
|
+
# source://nokogiri//lib/nokogiri/html4.rb#16
|
852
887
|
module Nokogiri::HTML4
|
853
888
|
class << self
|
854
|
-
#
|
889
|
+
# Convenience method for Nokogiri::HTML4::DocumentFragment.parse
|
855
890
|
#
|
856
|
-
# source://nokogiri//lib/nokogiri/html4.rb#
|
857
|
-
def fragment(
|
891
|
+
# source://nokogiri//lib/nokogiri/html4.rb#24
|
892
|
+
def fragment(*_arg0, **_arg1, &_arg2); end
|
858
893
|
|
859
|
-
#
|
894
|
+
# Convenience method for Nokogiri::HTML4::Document.parse
|
860
895
|
#
|
861
|
-
# source://nokogiri//lib/nokogiri/html4.rb#
|
862
|
-
def parse(
|
896
|
+
# source://nokogiri//lib/nokogiri/html4.rb#19
|
897
|
+
def parse(*_arg0, **_arg1, &_arg2); end
|
863
898
|
end
|
864
899
|
end
|
865
900
|
|
@@ -987,37 +1022,129 @@ class Nokogiri::HTML4::Document < ::Nokogiri::XML::Document
|
|
987
1022
|
class << self
|
988
1023
|
def new(*_arg0); end
|
989
1024
|
|
990
|
-
#
|
991
|
-
#
|
992
|
-
#
|
993
|
-
#
|
994
|
-
#
|
995
|
-
#
|
996
|
-
#
|
1025
|
+
# :call-seq:
|
1026
|
+
# parse(input) { |options| ... } => Nokogiri::HTML4::Document
|
1027
|
+
#
|
1028
|
+
# Parse \HTML4 input from a String or IO object, and return a new HTML4::Document.
|
1029
|
+
#
|
1030
|
+
# [Required Parameters]
|
1031
|
+
# - +input+ (String | IO) The content to be parsed.
|
1032
|
+
#
|
1033
|
+
# [Optional Keyword Arguments]
|
1034
|
+
# - +url:+ (String) The base URI for this document.
|
1035
|
+
#
|
1036
|
+
# document. When not provided, the encoding will be determined based on the document
|
1037
|
+
# content.
|
1038
|
+
#
|
1039
|
+
# - +options:+ (Nokogiri::XML::ParseOptions) Configuration object that determines some
|
1040
|
+
# behaviors during parsing. See ParseOptions for more information. The default value is
|
1041
|
+
# +ParseOptions::DEFAULT_HTML+.
|
1042
|
+
#
|
1043
|
+
# [Yields]
|
1044
|
+
# If a block is given, a Nokogiri::XML::ParseOptions object is yielded to the block which
|
1045
|
+
# can be configured before parsing. See Nokogiri::XML::ParseOptions for more information.
|
1046
|
+
#
|
1047
|
+
# [Returns] Nokogiri::HTML4::Document
|
997
1048
|
#
|
998
1049
|
# @yield [options]
|
999
1050
|
#
|
1000
|
-
# source://nokogiri//lib/nokogiri/html4/document.rb#
|
1001
|
-
def parse(
|
1051
|
+
# source://nokogiri//lib/nokogiri/html4/document.rb#189
|
1052
|
+
def parse(input, url_ = T.unsafe(nil), encoding_ = T.unsafe(nil), options_ = T.unsafe(nil), url: T.unsafe(nil), encoding: T.unsafe(nil), options: T.unsafe(nil)); end
|
1002
1053
|
|
1003
1054
|
def read_io(_arg0, _arg1, _arg2, _arg3); end
|
1004
1055
|
def read_memory(_arg0, _arg1, _arg2, _arg3); end
|
1005
1056
|
end
|
1006
1057
|
end
|
1007
1058
|
|
1008
|
-
# source://nokogiri//lib/nokogiri/html4/document_fragment.rb#
|
1059
|
+
# source://nokogiri//lib/nokogiri/html4/document_fragment.rb#51
|
1009
1060
|
class Nokogiri::HTML4::DocumentFragment < ::Nokogiri::XML::DocumentFragment
|
1061
|
+
# :call-seq:
|
1062
|
+
# new(document) { |options| ... } → HTML4::DocumentFragment
|
1063
|
+
# new(document, input) { |options| ... } → HTML4::DocumentFragment
|
1064
|
+
# new(document, input, context:, options:) { |options| ... } → HTML4::DocumentFragment
|
1065
|
+
#
|
1066
|
+
# Parse \HTML4 fragment input from a String, and return a new HTML4::DocumentFragment.
|
1067
|
+
#
|
1068
|
+
# 💡 It's recommended to use either HTML4::DocumentFragment.parse or XML::Node#parse rather
|
1069
|
+
# than call this method directly.
|
1070
|
+
#
|
1071
|
+
# [Required Parameters]
|
1072
|
+
# - +document+ (HTML4::Document) The parent document to associate the returned fragment with.
|
1073
|
+
#
|
1074
|
+
# [Optional Parameters]
|
1075
|
+
# - +input+ (String) The content to be parsed.
|
1076
|
+
#
|
1077
|
+
# [Optional Keyword Arguments]
|
1078
|
+
# - +context:+ (Nokogiri::XML::Node) The <b>context node</b> for the subtree created. See
|
1079
|
+
# below for more information.
|
1080
|
+
#
|
1081
|
+
# - +options:+ (Nokogiri::XML::ParseOptions) Configuration object that determines some
|
1082
|
+
# behaviors during parsing. See ParseOptions for more information. The default value is
|
1083
|
+
# +ParseOptions::DEFAULT_HTML+.
|
1084
|
+
#
|
1085
|
+
# [Yields]
|
1086
|
+
# If a block is given, a Nokogiri::XML::ParseOptions object is yielded to the block which
|
1087
|
+
# can be configured before parsing. See ParseOptions for more information.
|
1088
|
+
#
|
1089
|
+
# [Returns] HTML4::DocumentFragment
|
1090
|
+
#
|
1091
|
+
# === Context \Node
|
1092
|
+
#
|
1093
|
+
# If a context node is specified using +context:+, then the fragment will be created by
|
1094
|
+
# calling XML::Node#parse on that node, so the parser will behave as if that Node is the
|
1095
|
+
# parent of the fragment subtree.
|
1096
|
+
#
|
1010
1097
|
# @return [DocumentFragment] a new instance of DocumentFragment
|
1011
1098
|
# @yield [options]
|
1012
1099
|
#
|
1013
|
-
# source://nokogiri//lib/nokogiri/html4/document_fragment.rb#
|
1014
|
-
def initialize(document,
|
1100
|
+
# source://nokogiri//lib/nokogiri/html4/document_fragment.rb#134
|
1101
|
+
def initialize(document, input = T.unsafe(nil), context_ = T.unsafe(nil), options_ = T.unsafe(nil), context: T.unsafe(nil), options: T.unsafe(nil)); end
|
1015
1102
|
|
1016
1103
|
class << self
|
1017
|
-
#
|
1104
|
+
# :call-seq:
|
1105
|
+
# parse(input) { |options| ... } → HTML4::DocumentFragment
|
1106
|
+
#
|
1107
|
+
# Parse \HTML4 fragment input from a String, and return a new HTML4::DocumentFragment. This
|
1108
|
+
# method creates a new, empty HTML4::Document to contain the fragment.
|
1109
|
+
#
|
1110
|
+
# [Required Parameters]
|
1111
|
+
# - +input+ (String | IO) The content to be parsed.
|
1112
|
+
#
|
1113
|
+
# [Optional Keyword Arguments]
|
1114
|
+
# document. When not provided, the encoding will be determined based on the document
|
1115
|
+
# content.
|
1116
|
+
#
|
1117
|
+
# - +options:+ (Nokogiri::XML::ParseOptions) Configuration object that determines some
|
1118
|
+
# behaviors during parsing. See ParseOptions for more information. The default value is
|
1119
|
+
# +ParseOptions::DEFAULT_HTML+.
|
1120
|
+
#
|
1121
|
+
# [Yields]
|
1122
|
+
# If a block is given, a Nokogiri::XML::ParseOptions object is yielded to the block which
|
1123
|
+
# can be configured before parsing. See ParseOptions for more information.
|
1124
|
+
#
|
1125
|
+
# [Returns] HTML4::DocumentFragment
|
1126
|
+
#
|
1127
|
+
# *Example:* Parsing a string
|
1128
|
+
#
|
1129
|
+
# fragment = HTML4::DocumentFragment.parse("<div>Hello World</div>")
|
1130
|
+
#
|
1131
|
+
# *Example:* Parsing an IO
|
1132
|
+
#
|
1133
|
+
# fragment = File.open("fragment.html") do |file|
|
1134
|
+
# HTML4::DocumentFragment.parse(file)
|
1135
|
+
# end
|
1018
1136
|
#
|
1019
|
-
#
|
1020
|
-
|
1137
|
+
# *Example:* Specifying encoding
|
1138
|
+
#
|
1139
|
+
#
|
1140
|
+
# *Example:* Setting parse options dynamically
|
1141
|
+
#
|
1142
|
+
# HTML4::DocumentFragment.parse("<div>Hello World") do |options|
|
1143
|
+
# options.huge.pedantic
|
1144
|
+
# end
|
1145
|
+
#
|
1146
|
+
# source://nokogiri//lib/nokogiri/html4/document_fragment.rb#52
|
1147
|
+
def parse(input, encoding_ = T.unsafe(nil), options_ = T.unsafe(nil), encoding: T.unsafe(nil), options: T.unsafe(nil), &block); end
|
1021
1148
|
end
|
1022
1149
|
end
|
1023
1150
|
|
@@ -1490,10 +1617,11 @@ end
|
|
1490
1617
|
|
1491
1618
|
# Instance of Nokogiri::HTML4::EntityLookup
|
1492
1619
|
#
|
1493
|
-
# source://nokogiri//lib/nokogiri/html4.rb#
|
1620
|
+
# source://nokogiri//lib/nokogiri/html4.rb#30
|
1494
1621
|
Nokogiri::HTML4::NamedCharacters = T.let(T.unsafe(nil), Nokogiri::HTML4::EntityLookup)
|
1495
1622
|
|
1496
|
-
# Nokogiri
|
1623
|
+
# Nokogiri provides a SAX parser to process HTML4 which will provide HTML recovery
|
1624
|
+
# ("autocorrection") features.
|
1497
1625
|
#
|
1498
1626
|
# See Nokogiri::HTML4::SAX::Parser for a basic example of using a SAX parser with HTML.
|
1499
1627
|
#
|
@@ -1502,60 +1630,51 @@ Nokogiri::HTML4::NamedCharacters = T.let(T.unsafe(nil), Nokogiri::HTML4::EntityL
|
|
1502
1630
|
# source://nokogiri//lib/nokogiri/html4/sax/parser_context.rb#5
|
1503
1631
|
module Nokogiri::HTML4::SAX; end
|
1504
1632
|
|
1505
|
-
# This
|
1633
|
+
# This parser is a SAX style parser that reads its input as it deems necessary. The parser
|
1634
|
+
# takes a Nokogiri::XML::SAX::Document, an optional encoding, then given an HTML input, sends
|
1635
|
+
# messages to the Nokogiri::XML::SAX::Document.
|
1636
|
+
#
|
1637
|
+
# ⚠ This is an HTML4 parser and so may not support some HTML5 features and behaviors.
|
1506
1638
|
#
|
1507
1639
|
# Here is a basic usage example:
|
1508
1640
|
#
|
1509
|
-
# class
|
1641
|
+
# class MyHandler < Nokogiri::XML::SAX::Document
|
1510
1642
|
# def start_element name, attributes = []
|
1511
1643
|
# puts "found a #{name}"
|
1512
1644
|
# end
|
1513
1645
|
# end
|
1514
1646
|
#
|
1515
|
-
# parser = Nokogiri::HTML4::SAX::Parser.new(
|
1516
|
-
# parser.parse(File.read(ARGV[0], mode: 'rb'))
|
1647
|
+
# parser = Nokogiri::HTML4::SAX::Parser.new(MyHandler.new)
|
1517
1648
|
#
|
1518
|
-
#
|
1649
|
+
# # Hand an IO object to the parser, which will read the HTML from the IO.
|
1650
|
+
# File.open(path_to_html) do |f|
|
1651
|
+
# parser.parse(f)
|
1652
|
+
# end
|
1519
1653
|
#
|
1520
|
-
#
|
1654
|
+
# For more information on \SAX parsers, see Nokogiri::XML::SAX or the parent class
|
1655
|
+
# Nokogiri::XML::SAX::Parser.
|
1656
|
+
#
|
1657
|
+
# Also see Nokogiri::XML::SAX::Document for the available events.
|
1658
|
+
#
|
1659
|
+
# source://nokogiri//lib/nokogiri/html4/sax/parser.rb#44
|
1521
1660
|
class Nokogiri::HTML4::SAX::Parser < ::Nokogiri::XML::SAX::Parser
|
1522
|
-
|
1523
|
-
#
|
1524
|
-
# @raise [ArgumentError]
|
1525
|
-
# @yield [ctx]
|
1526
|
-
#
|
1527
|
-
# source://nokogiri//lib/nokogiri/html4/sax/parser.rb#51
|
1528
|
-
def parse_file(filename, encoding = T.unsafe(nil)); end
|
1529
|
-
|
1530
|
-
# Parse given +io+
|
1531
|
-
#
|
1532
|
-
# @yield [ctx]
|
1533
|
-
#
|
1534
|
-
# source://nokogiri//lib/nokogiri/html4/sax/parser.rb#41
|
1535
|
-
def parse_io(io, encoding = T.unsafe(nil)); end
|
1661
|
+
private
|
1536
1662
|
|
1537
|
-
|
1538
|
-
#
|
1539
|
-
# @raise [TypeError]
|
1540
|
-
# @yield [ctx]
|
1541
|
-
#
|
1542
|
-
# source://nokogiri//lib/nokogiri/html4/sax/parser.rb#30
|
1543
|
-
def parse_memory(data, encoding = T.unsafe(nil)); end
|
1663
|
+
def initialize_native; end
|
1544
1664
|
end
|
1545
1665
|
|
1546
|
-
# Context
|
1547
|
-
#
|
1666
|
+
# Context object to invoke the HTML4 SAX parser on the SAX::Document handler.
|
1667
|
+
#
|
1668
|
+
# 💡 This class is usually not instantiated by the user. Use Nokogiri::HTML4::SAX::Parser
|
1669
|
+
# instead.
|
1548
1670
|
#
|
1549
|
-
# source://nokogiri//lib/nokogiri/html4/sax/parser_context.rb#
|
1671
|
+
# source://nokogiri//lib/nokogiri/html4/sax/parser_context.rb#11
|
1550
1672
|
class Nokogiri::HTML4::SAX::ParserContext < ::Nokogiri::XML::SAX::ParserContext
|
1551
1673
|
def parse_with(_arg0); end
|
1552
1674
|
|
1553
1675
|
class << self
|
1554
|
-
def
|
1555
|
-
def
|
1556
|
-
|
1557
|
-
# source://nokogiri//lib/nokogiri/html4/sax/parser_context.rb#10
|
1558
|
-
def new(thing, encoding = T.unsafe(nil)); end
|
1676
|
+
def native_file(_arg0, _arg1); end
|
1677
|
+
def native_memory(_arg0, _arg1); end
|
1559
1678
|
end
|
1560
1679
|
end
|
1561
1680
|
|
@@ -1604,34 +1723,36 @@ end
|
|
1604
1723
|
|
1605
1724
|
# == Usage
|
1606
1725
|
#
|
1607
|
-
# ⚠ HTML5 functionality is not available when running JRuby.
|
1608
|
-
#
|
1609
1726
|
# Parse an HTML5 document:
|
1610
1727
|
#
|
1611
|
-
# doc = Nokogiri.HTML5(
|
1728
|
+
# doc = Nokogiri.HTML5(input)
|
1612
1729
|
#
|
1613
1730
|
# Parse an HTML5 fragment:
|
1614
1731
|
#
|
1615
|
-
# fragment = Nokogiri::HTML5.fragment(
|
1732
|
+
# fragment = Nokogiri::HTML5.fragment(input)
|
1733
|
+
#
|
1734
|
+
# ⚠ HTML5 functionality is not available when running JRuby.
|
1616
1735
|
#
|
1617
1736
|
# == Parsing options
|
1618
1737
|
#
|
1619
|
-
# The document and fragment parsing methods support options that are different from
|
1738
|
+
# The document and fragment parsing methods support options that are different from
|
1739
|
+
# Nokogiri::HTML4::Document or Nokogiri::XML::Document.
|
1620
1740
|
#
|
1621
|
-
# - <tt>Nokogiri.HTML5(html, url = nil, encoding = nil, options = {})</tt>
|
1622
|
-
# - <tt>Nokogiri::HTML5.parse(html, url = nil, encoding = nil, options = {})</tt>
|
1623
|
-
# - <tt>Nokogiri::HTML5::Document.parse(html, url = nil, encoding = nil, options = {})</tt>
|
1624
|
-
# - <tt>Nokogiri::HTML5.fragment(html, encoding = nil, options = {})</tt>
|
1625
|
-
# - <tt>Nokogiri::HTML5::DocumentFragment.parse(html, encoding = nil, options = {})</tt>
|
1626
1741
|
#
|
1627
|
-
# The
|
1628
|
-
# +:max_attributes+, described below.
|
1742
|
+
# The four currently supported parse options are
|
1629
1743
|
#
|
1630
|
-
#
|
1744
|
+
# - +max_errors:+ (Integer, default 0) Maximum number of parse errors to report in HTML5::Document#errors.
|
1745
|
+
# - +max_tree_depth:+ (Integer, default +Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH+) Maximum tree depth to parse.
|
1746
|
+
# - +max_attributes:+ (Integer, default +Nokogiri::Gumbo::DEFAULT_MAX_ATTRIBUTES+) Maximum number of attributes to parse per element.
|
1747
|
+
# - +parse_noscript_content_as_text:+ (Boolean, default false) When enabled, parse +noscript+ tag content as text, mimicking the behavior of web browsers.
|
1748
|
+
#
|
1749
|
+
# These options are explained in the following sections.
|
1750
|
+
#
|
1751
|
+
# === Error reporting: +max_errors:+
|
1631
1752
|
#
|
1632
1753
|
# Nokogiri contains an experimental HTML5 parse error reporting facility. By default, no parse
|
1633
1754
|
# errors are reported but this can be configured by passing the +:max_errors+ option to
|
1634
|
-
#
|
1755
|
+
# HTML5.parse or HTML5.fragment.
|
1635
1756
|
#
|
1636
1757
|
# For example, this script:
|
1637
1758
|
#
|
@@ -1657,20 +1778,21 @@ end
|
|
1657
1778
|
#
|
1658
1779
|
# Using <tt>max_errors: -1</tt> results in an unlimited number of errors being returned.
|
1659
1780
|
#
|
1660
|
-
# The errors returned by
|
1781
|
+
# The errors returned by HTML5::Document#errors are instances of Nokogiri::XML::SyntaxError.
|
1661
1782
|
#
|
1662
|
-
# The {https://html.spec.whatwg.org/multipage/parsing.html#parse-errors
|
1783
|
+
# The {HTML standard}[https://html.spec.whatwg.org/multipage/parsing.html#parse-errors] defines a
|
1663
1784
|
# number of standard parse error codes. These error codes only cover the "tokenization" stage of
|
1664
1785
|
# parsing HTML. The parse errors in the "tree construction" stage do not have standardized error
|
1665
1786
|
# codes (yet).
|
1666
1787
|
#
|
1667
|
-
# As a convenience to Nokogiri users, the defined error codes are available
|
1668
|
-
#
|
1788
|
+
# As a convenience to Nokogiri users, the defined error codes are available
|
1789
|
+
# via Nokogiri::XML::SyntaxError#str1 method.
|
1669
1790
|
#
|
1670
1791
|
# doc = Nokogiri::HTML5.parse('<span/>Hi there!</span foo=bar />', max_errors: 10)
|
1671
1792
|
# doc.errors.each do |err|
|
1672
1793
|
# puts("#{err.line}:#{err.column}: #{err.str1}")
|
1673
1794
|
# end
|
1795
|
+
# doc = Nokogiri::HTML5.parse('<span/>Hi there!</span foo=bar />',
|
1674
1796
|
# # => 1:1: generic-parser
|
1675
1797
|
# # 1:1: non-void-html-element-start-tag-with-trailing-solidus
|
1676
1798
|
# # 1:17: end-tag-with-trailing-solidus
|
@@ -1683,40 +1805,75 @@ end
|
|
1683
1805
|
# are not part of Nokogiri's public API. That is, these are subject to change without Nokogiri's
|
1684
1806
|
# major version number changing. These may be stabilized in the future.
|
1685
1807
|
#
|
1686
|
-
# === Maximum tree depth
|
1808
|
+
# === Maximum tree depth: +max_tree_depth:+
|
1687
1809
|
#
|
1688
1810
|
# The maximum depth of the DOM tree parsed by the various parsing methods is configurable by the
|
1689
1811
|
# +:max_tree_depth+ option. If the depth of the tree would exceed this limit, then an
|
1690
|
-
#
|
1812
|
+
# +ArgumentError+ is thrown.
|
1691
1813
|
#
|
1692
|
-
# This limit (which defaults to
|
1693
|
-
#
|
1814
|
+
# This limit (which defaults to +Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH+) can be removed by
|
1815
|
+
# giving the option <tt>max_tree_depth: -1</tt>.
|
1694
1816
|
#
|
1695
1817
|
# html = '<!DOCTYPE html>' + '<div>' * 1000
|
1696
1818
|
# doc = Nokogiri.HTML5(html)
|
1697
1819
|
# # raises ArgumentError: Document tree depth limit exceeded
|
1698
1820
|
# doc = Nokogiri.HTML5(html, max_tree_depth: -1)
|
1699
1821
|
#
|
1700
|
-
# === Attribute limit per element
|
1822
|
+
# === Attribute limit per element: +max_attributes:+
|
1701
1823
|
#
|
1702
1824
|
# The maximum number of attributes per DOM element is configurable by the +:max_attributes+
|
1703
|
-
# option. If a given element would exceed this limit, then an
|
1825
|
+
# option. If a given element would exceed this limit, then an +ArgumentError+ is thrown.
|
1704
1826
|
#
|
1705
|
-
# This limit (which defaults to
|
1706
|
-
#
|
1827
|
+
# This limit (which defaults to +Nokogiri::Gumbo::DEFAULT_MAX_ATTRIBUTES+) can be removed by
|
1828
|
+
# giving the option <tt>max_attributes: -1</tt>.
|
1707
1829
|
#
|
1708
|
-
# html = '<!DOCTYPE html><div ' + (1..1000).map { |x| "attr-#{x}" }.join(' ') + '>'
|
1830
|
+
# html = '<!DOCTYPE html><div ' + (1..1000).map { |x| "attr-#{x}" }.join(' # ') + '>'
|
1709
1831
|
# # "<!DOCTYPE html><div attr-1 attr-2 attr-3 ... attr-1000>"
|
1710
1832
|
# doc = Nokogiri.HTML5(html)
|
1711
1833
|
# # raises ArgumentError: Attributes per element limit exceeded
|
1834
|
+
#
|
1712
1835
|
# doc = Nokogiri.HTML5(html, max_attributes: -1)
|
1836
|
+
# # parses successfully
|
1837
|
+
#
|
1838
|
+
# === Parse +noscript+ elements' content as text: +parse_noscript_content_as_text:+
|
1839
|
+
#
|
1840
|
+
# By default, the content of +noscript+ elements is parsed as HTML elements. Browsers that
|
1841
|
+
# support scripting parse the content of +noscript+ elements as raw text.
|
1842
|
+
#
|
1843
|
+
# The +:parse_noscript_content_as_text+ option causes Nokogiri to parse the content of +noscript+
|
1844
|
+
# elements as a single text node.
|
1845
|
+
#
|
1846
|
+
# html = "<!DOCTYPE html><noscript><meta charset='UTF-8'><link rel=stylesheet href=!></noscript>"
|
1847
|
+
# doc = Nokogiri::HTML5.parse(html, parse_noscript_content_as_text: true)
|
1848
|
+
# pp doc.at_xpath("/html/head/noscript")
|
1849
|
+
# # => #(Element:0x878c {
|
1850
|
+
# # name = "noscript",
|
1851
|
+
# # children = [ #(Text "<meta charset='UTF-8'><link rel=stylesheet href=!>")]
|
1852
|
+
# # })
|
1853
|
+
#
|
1854
|
+
# In contrast, <tt>parse_noscript_content_as_text: false</tt> (the default) causes the +noscript+
|
1855
|
+
# element in the previous example to have two children, a +meta+ element and a +link+ element.
|
1856
|
+
#
|
1857
|
+
# doc = Nokogiri::HTML5.parse(html)
|
1858
|
+
# puts doc.at_xpath("/html/head/noscript")
|
1859
|
+
# # => #(Element:0x96b4 {
|
1860
|
+
# # name = "noscript",
|
1861
|
+
# # children = [
|
1862
|
+
# # #(Element:0x97e0 { name = "meta", attribute_nodes = [ #(Attr:0x990c { name = "charset", value = "UTF-8" })] }),
|
1863
|
+
# # #(Element:0x9b00 {
|
1864
|
+
# # name = "link",
|
1865
|
+
# # attribute_nodes = [
|
1866
|
+
# # #(Attr:0x9c2c { name = "rel", value = "stylesheet" }),
|
1867
|
+
# # #(Attr:0x9dd0 { name = "href", value = "!" })]
|
1868
|
+
# # })]
|
1869
|
+
# # })
|
1713
1870
|
#
|
1714
1871
|
# == HTML Serialization
|
1715
1872
|
#
|
1716
|
-
# After parsing HTML, it may be serialized using any of the
|
1717
|
-
# methods. In particular,
|
1873
|
+
# After parsing HTML, it may be serialized using any of the Nokogiri::XML::Node serialization
|
1874
|
+
# methods. In particular, XML::Node#serialize, XML::Node#to_html, and XML::Node#to_s will
|
1718
1875
|
# serialize a given node and its children. (This is the equivalent of JavaScript's
|
1719
|
-
# +Element.outerHTML+.) Similarly,
|
1876
|
+
# +Element.outerHTML+.) Similarly, XML::Node#inner_html will serialize the children of a given
|
1720
1877
|
# node. (This is the equivalent of JavaScript's +Element.innerHTML+.)
|
1721
1878
|
#
|
1722
1879
|
# doc = Nokogiri::HTML5("<!DOCTYPE html><span>Hello world!</span>")
|
@@ -1724,12 +1881,12 @@ end
|
|
1724
1881
|
# # => <!DOCTYPE html><html><head></head><body><span>Hello world!</span></body></html>
|
1725
1882
|
#
|
1726
1883
|
# Due to quirks in how HTML is parsed and serialized, it's possible for a DOM tree to be
|
1727
|
-
# serialized and then re-parsed, resulting in a different DOM.
|
1884
|
+
# serialized and then re-parsed, resulting in a different DOM. Mostly, this happens with DOMs
|
1728
1885
|
# produced from invalid HTML. Unfortunately, even valid HTML may not survive serialization and
|
1729
1886
|
# re-parsing.
|
1730
1887
|
#
|
1731
|
-
# In particular, a newline at the start of +pre+, +listing+, and +textarea+
|
1732
|
-
# the parser.
|
1888
|
+
# In particular, a newline at the start of +pre+, +listing+, and +textarea+
|
1889
|
+
# elements is ignored by the parser.
|
1733
1890
|
#
|
1734
1891
|
# doc = Nokogiri::HTML5(<<-EOF)
|
1735
1892
|
# <!DOCTYPE html>
|
@@ -1758,81 +1915,117 @@ end
|
|
1758
1915
|
#
|
1759
1916
|
# == Encodings
|
1760
1917
|
#
|
1761
|
-
# Nokogiri always parses HTML5 using {https://en.wikipedia.org/wiki/UTF-8
|
1918
|
+
# Nokogiri always parses HTML5 using {UTF-8}[https://en.wikipedia.org/wiki/UTF-8]; however, the
|
1762
1919
|
# encoding of the input can be explicitly selected via the optional +encoding+ parameter. This is
|
1763
1920
|
# most useful when the input comes not from a string but from an IO object.
|
1764
1921
|
#
|
1765
1922
|
# When serializing a document or node, the encoding of the output string can be specified via the
|
1766
1923
|
# +:encoding+ options. Characters that cannot be encoded in the selected encoding will be encoded
|
1767
|
-
# as {
|
1768
|
-
# entities}.
|
1924
|
+
# as {HTML numeric
|
1925
|
+
# entities}[https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references].
|
1769
1926
|
#
|
1770
1927
|
# frag = Nokogiri::HTML5.fragment('<span>아는 길도 물어가라</span>')
|
1771
1928
|
# puts html
|
1772
1929
|
# # => <span>아는 길도 물어가라</span>
|
1930
|
+
#
|
1773
1931
|
# frag = Nokogiri::HTML5.fragment(html)
|
1774
1932
|
# puts frag.serialize
|
1775
1933
|
# # => <span>아는 길도 물어가라</span>
|
1776
1934
|
#
|
1777
|
-
# (There's a {https://bugs.ruby-lang.org/issues/15033
|
1935
|
+
# (There's a {bug}[https://bugs.ruby-lang.org/issues/15033] in all current versions of Ruby that
|
1778
1936
|
# can cause the entity encoding to fail. Of the mandated supported encodings for HTML, the only
|
1779
1937
|
# encoding I'm aware of that has this bug is <tt>'ISO-2022-JP'</tt>. We recommend avoiding this
|
1780
1938
|
# encoding.)
|
1781
1939
|
#
|
1782
1940
|
# == Notes
|
1783
1941
|
#
|
1784
|
-
# * The
|
1785
|
-
#
|
1786
|
-
#
|
1787
|
-
#
|
1942
|
+
# * The Nokogiri::HTML5.fragment function takes a String or IO and parses it as a HTML5 document
|
1943
|
+
# in a +body+ context. As a result, the +html+, +head+, and +body+ elements are removed from
|
1944
|
+
# this document, and any children of these elements that remain are returned as a
|
1945
|
+
# Nokogiri::HTML5::DocumentFragment; but you can pass in a different context (e.g., "html" to
|
1946
|
+
# get +head+ and +body+ tags in the result).
|
1788
1947
|
#
|
1789
|
-
# * The
|
1790
|
-
# <code>gumbo_parse_with_options</code> method, using the default options.
|
1791
|
-
#
|
1948
|
+
# * The Nokogiri::HTML5.parse function takes a String or IO and passes it to the
|
1949
|
+
# <code>gumbo_parse_with_options</code> method, using the default options. The resulting Gumbo
|
1950
|
+
# parse tree is then walked.
|
1792
1951
|
#
|
1793
1952
|
# * Instead of uppercase element names, lowercase element names are produced.
|
1794
1953
|
#
|
1795
|
-
# * Instead of returning +unknown+ as the element name for unknown tags, the
|
1796
|
-
#
|
1954
|
+
# * Instead of returning +unknown+ as the element name for unknown tags, the original tag name is
|
1955
|
+
# returned verbatim.
|
1797
1956
|
#
|
1798
1957
|
# Since v1.12.0
|
1799
1958
|
#
|
1800
1959
|
# source://nokogiri//lib/nokogiri/html5/document.rb#23
|
1801
1960
|
module Nokogiri::HTML5
|
1802
1961
|
class << self
|
1803
|
-
#
|
1804
|
-
# {Nokogiri::HTML5::DocumentFragment.parse}.
|
1962
|
+
# Convenience method for Nokogiri::HTML5::DocumentFragment.parse
|
1805
1963
|
#
|
1806
|
-
# source://nokogiri//lib/nokogiri/html5.rb#
|
1807
|
-
def fragment(
|
1964
|
+
# source://nokogiri//lib/nokogiri/html5.rb#280
|
1965
|
+
def fragment(*_arg0, **_arg1, &_arg2); end
|
1808
1966
|
|
1809
|
-
#
|
1967
|
+
# Convenience method for Nokogiri::HTML5::Document.parse
|
1810
1968
|
#
|
1811
|
-
# source://nokogiri//lib/nokogiri/html5.rb#
|
1812
|
-
def parse(
|
1969
|
+
# source://nokogiri//lib/nokogiri/html5.rb#275
|
1970
|
+
def parse(*_arg0, **_arg1, &_arg2); end
|
1813
1971
|
|
1814
|
-
# source://nokogiri//lib/nokogiri/html5.rb#
|
1972
|
+
# source://nokogiri//lib/nokogiri/html5.rb#285
|
1815
1973
|
def read_and_encode(string, encoding); end
|
1816
1974
|
|
1817
1975
|
private
|
1818
1976
|
|
1819
1977
|
# Charset sniffing is a complex and controversial topic that understandably isn't done _by
|
1820
|
-
# default_ by the Ruby Net::HTTP library.
|
1978
|
+
# default_ by the Ruby Net::HTTP library. This being said, it is a very real problem for
|
1821
1979
|
# consumers of HTML as the default for HTML is iso-8859-1, most "good" producers use utf-8, and
|
1822
1980
|
# the Gumbo parser *only* supports utf-8.
|
1823
1981
|
#
|
1824
|
-
# Accordingly, Nokogiri::HTML4::Document.parse provides limited encoding detection.
|
1982
|
+
# Accordingly, Nokogiri::HTML4::Document.parse provides limited encoding detection. Following
|
1825
1983
|
# this lead, Nokogiri::HTML5 attempts to do likewise, while attempting to more closely follow
|
1826
1984
|
# the HTML5 standard.
|
1827
1985
|
#
|
1828
1986
|
# http://bugs.ruby-lang.org/issues/2567
|
1829
1987
|
# http://www.w3.org/TR/html5/syntax.html#determining-the-character-encoding
|
1830
1988
|
#
|
1831
|
-
# source://nokogiri//lib/nokogiri/html5.rb#
|
1989
|
+
# source://nokogiri//lib/nokogiri/html5.rb#323
|
1832
1990
|
def reencode(body, content_type = T.unsafe(nil)); end
|
1833
1991
|
end
|
1834
1992
|
end
|
1835
1993
|
|
1994
|
+
# Nokogiri HTML5 builder is used for building HTML documents. It is very similar to the
|
1995
|
+
# Nokogiri::XML::Builder. In fact, you should go read the documentation for
|
1996
|
+
# Nokogiri::XML::Builder before reading this documentation.
|
1997
|
+
#
|
1998
|
+
# The construction behavior is identical to HTML4::Builder, but HTML5 documents implement the
|
1999
|
+
# [HTML5 standard's serialization
|
2000
|
+
# algorithm](https://www.w3.org/TR/2008/WD-html5-20080610/serializing.html).
|
2001
|
+
#
|
2002
|
+
# == Synopsis:
|
2003
|
+
#
|
2004
|
+
# Create an HTML5 document with a body that has an onload attribute, and a
|
2005
|
+
# span tag with a class of "bold" that has content of "Hello world".
|
2006
|
+
#
|
2007
|
+
# builder = Nokogiri::HTML5::Builder.new do |doc|
|
2008
|
+
# doc.html {
|
2009
|
+
# doc.body(:onload => 'some_func();') {
|
2010
|
+
# doc.span.bold {
|
2011
|
+
# doc.text "Hello world"
|
2012
|
+
# }
|
2013
|
+
# }
|
2014
|
+
# }
|
2015
|
+
# end
|
2016
|
+
# puts builder.to_html
|
2017
|
+
#
|
2018
|
+
# The HTML5 builder inherits from the XML builder, so make sure to read the
|
2019
|
+
# Nokogiri::XML::Builder documentation.
|
2020
|
+
#
|
2021
|
+
# source://nokogiri//lib/nokogiri/html5/builder.rb#34
|
2022
|
+
class Nokogiri::HTML5::Builder < ::Nokogiri::XML::Builder
|
2023
|
+
# Convert the builder to HTML
|
2024
|
+
#
|
2025
|
+
# source://nokogiri//lib/nokogiri/html5/builder.rb#35
|
2026
|
+
def to_html; end
|
2027
|
+
end
|
2028
|
+
|
1836
2029
|
# Since v1.12.0
|
1837
2030
|
#
|
1838
2031
|
# 💡 HTML5 functionality is not available when running JRuby.
|
@@ -1841,7 +2034,7 @@ end
|
|
1841
2034
|
class Nokogiri::HTML5::Document < ::Nokogiri::HTML4::Document
|
1842
2035
|
# @return [Document] a new instance of Document
|
1843
2036
|
#
|
1844
|
-
# source://nokogiri//lib/nokogiri/html5/document.rb#
|
2037
|
+
# source://nokogiri//lib/nokogiri/html5/document.rb#159
|
1845
2038
|
def initialize(*args); end
|
1846
2039
|
|
1847
2040
|
# :call-seq:
|
@@ -1854,21 +2047,22 @@ class Nokogiri::HTML5::Document < ::Nokogiri::HTML4::Document
|
|
1854
2047
|
# - +markup+ (String) The HTML5 markup fragment to be parsed
|
1855
2048
|
#
|
1856
2049
|
# [Returns]
|
1857
|
-
# Nokogiri::HTML5::DocumentFragment. This object's children will be empty if
|
2050
|
+
# Nokogiri::HTML5::DocumentFragment. This object's children will be empty if +markup+ is not
|
2051
|
+
# passed, is empty, or is +nil+.
|
1858
2052
|
#
|
1859
|
-
# source://nokogiri//lib/nokogiri/html5/document.rb#
|
2053
|
+
# source://nokogiri//lib/nokogiri/html5/document.rb#178
|
1860
2054
|
def fragment(markup = T.unsafe(nil)); end
|
1861
2055
|
|
1862
2056
|
# Get the parser's quirks mode value. See HTML5::QuirksMode.
|
1863
2057
|
#
|
1864
|
-
# This method returns
|
2058
|
+
# This method returns +nil+ if the parser was not invoked (e.g., Nokogiri::HTML5::Document.new).
|
1865
2059
|
#
|
1866
2060
|
# Since v1.14.0
|
1867
2061
|
#
|
1868
2062
|
# source://nokogiri//lib/nokogiri/html5/document.rb#49
|
1869
2063
|
def quirks_mode; end
|
1870
2064
|
|
1871
|
-
# source://nokogiri//lib/nokogiri/html5/document.rb#
|
2065
|
+
# source://nokogiri//lib/nokogiri/html5/document.rb#182
|
1872
2066
|
def to_xml(options = T.unsafe(nil), &block); end
|
1873
2067
|
|
1874
2068
|
# Get the url name for this document, as passed into Document.parse, Document.read_io, or
|
@@ -1884,42 +2078,60 @@ class Nokogiri::HTML5::Document < ::Nokogiri::HTML4::Document
|
|
1884
2078
|
#
|
1885
2079
|
# See CSS::XPathVisitor for more information.
|
1886
2080
|
#
|
1887
|
-
# source://nokogiri//lib/nokogiri/html5/document.rb#
|
2081
|
+
# source://nokogiri//lib/nokogiri/html5/document.rb#194
|
1888
2082
|
def xpath_doctype; end
|
1889
2083
|
|
1890
2084
|
class << self
|
1891
2085
|
# :call-seq:
|
1892
|
-
# parse(input)
|
1893
|
-
# parse(input,
|
1894
|
-
# parse(input, url=nil, encoding=nil) { |options| ... }
|
2086
|
+
# parse(input) { |options| ... } → HTML5::Document
|
2087
|
+
# parse(input, **options) → HTML5::Document
|
1895
2088
|
#
|
1896
|
-
# Parse HTML5
|
2089
|
+
# Parse \HTML input with a parser compliant with the HTML5 spec. This method uses the
|
2090
|
+
# parameter.
|
1897
2091
|
#
|
1898
|
-
# [Parameters]
|
1899
|
-
# - +input+
|
1900
|
-
#
|
2092
|
+
# [Required Parameters]
|
2093
|
+
# - +input+ (String | IO) the \HTML content to be parsed.
|
2094
|
+
#
|
2095
|
+
# [Optional Parameters]
|
2096
|
+
# - +url:+ (String) the base URI of the document.
|
2097
|
+
#
|
2098
|
+
# [Optional Keyword Arguments]
|
2099
|
+
# document. When not provided, the encoding will be determined based on the document
|
2100
|
+
# content.
|
2101
|
+
#
|
2102
|
+
# - +max_errors:+ (Integer) The maximum number of parse errors to record. (default
|
2103
|
+
# +Nokogiri::Gumbo::DEFAULT_MAX_ERRORS+ which is currently 0)
|
1901
2104
|
#
|
1902
|
-
# - +
|
2105
|
+
# - +max_tree_depth:+ (Integer) The maximum depth of the parse tree. (default
|
2106
|
+
# +Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH+)
|
1903
2107
|
#
|
1904
|
-
# - +
|
1905
|
-
#
|
2108
|
+
# - +max_attributes:+ (Integer) The maximum number of attributes allowed on an
|
2109
|
+
# element. (default +Nokogiri::Gumbo::DEFAULT_MAX_ATTRIBUTES+)
|
1906
2110
|
#
|
1907
|
-
# - +
|
1908
|
-
#
|
1909
|
-
# +:max_tree_depth+ and +:max_attributes+, described at Nokogiri::HTML5.
|
2111
|
+
# - +parse_noscript_content_as_text:+ (Boolean) Whether to parse the content of +noscript+
|
2112
|
+
# elements as text. (default +false+)
|
1910
2113
|
#
|
1911
|
-
#
|
1912
|
-
#
|
2114
|
+
# See rdoc-ref:HTML5@Parsing+options for a complete description of these parsing options.
|
2115
|
+
#
|
2116
|
+
# [Yields]
|
2117
|
+
# If present, the block will be passed a Hash object to modify with parse options before the
|
2118
|
+
# input is parsed. See rdoc-ref:HTML5@Parsing+options for a list of available options.
|
1913
2119
|
#
|
1914
|
-
# - +block+ (optional) is passed a configuration Hash on which parse options may be set. See
|
1915
|
-
# Nokogiri::HTML5 for more information and usage.
|
1916
2120
|
#
|
1917
2121
|
# [Returns] Nokogiri::HTML5::Document
|
1918
2122
|
#
|
2123
|
+
# *Example:* Parse a string with a specific encoding and custom max errors limit.
|
2124
|
+
#
|
2125
|
+
#
|
2126
|
+
# *Example:* Parse a string setting the +:parse_noscript_content_as_text+ option using the
|
2127
|
+
# configuration block parameter.
|
2128
|
+
#
|
2129
|
+
# Nokogiri::HTML5::Document.parse(input) { |c| c[:parse_noscript_content_as_text] = true }
|
2130
|
+
#
|
1919
2131
|
# @yield [options]
|
1920
2132
|
#
|
1921
|
-
# source://nokogiri//lib/nokogiri/html5/document.rb#
|
1922
|
-
def parse(string_or_io,
|
2133
|
+
# source://nokogiri//lib/nokogiri/html5/document.rb#103
|
2134
|
+
def parse(string_or_io, url_ = T.unsafe(nil), encoding_ = T.unsafe(nil), url: T.unsafe(nil), encoding: T.unsafe(nil), **options, &block); end
|
1923
2135
|
|
1924
2136
|
# Create a new document from an IO object.
|
1925
2137
|
#
|
@@ -1927,8 +2139,8 @@ class Nokogiri::HTML5::Document < ::Nokogiri::HTML4::Document
|
|
1927
2139
|
#
|
1928
2140
|
# @raise [ArgumentError]
|
1929
2141
|
#
|
1930
|
-
# source://nokogiri//lib/nokogiri/html5/document.rb#
|
1931
|
-
def read_io(io,
|
2142
|
+
# source://nokogiri//lib/nokogiri/html5/document.rb#129
|
2143
|
+
def read_io(io, url_ = T.unsafe(nil), encoding_ = T.unsafe(nil), url: T.unsafe(nil), encoding: T.unsafe(nil), **options); end
|
1932
2144
|
|
1933
2145
|
# Create a new document from a String.
|
1934
2146
|
#
|
@@ -1936,13 +2148,13 @@ class Nokogiri::HTML5::Document < ::Nokogiri::HTML4::Document
|
|
1936
2148
|
#
|
1937
2149
|
# @raise [ArgumentError]
|
1938
2150
|
#
|
1939
|
-
# source://nokogiri//lib/nokogiri/html5/document.rb#
|
1940
|
-
def read_memory(string,
|
2151
|
+
# source://nokogiri//lib/nokogiri/html5/document.rb#138
|
2152
|
+
def read_memory(string, url_ = T.unsafe(nil), encoding_ = T.unsafe(nil), url: T.unsafe(nil), encoding: T.unsafe(nil), **options); end
|
1941
2153
|
|
1942
2154
|
private
|
1943
2155
|
|
1944
|
-
# source://nokogiri//lib/nokogiri/html5/document.rb#
|
1945
|
-
def do_parse(string_or_io, url, encoding, options); end
|
2156
|
+
# source://nokogiri//lib/nokogiri/html5/document.rb#146
|
2157
|
+
def do_parse(string_or_io, url, encoding, **options); end
|
1946
2158
|
end
|
1947
2159
|
end
|
1948
2160
|
|
@@ -1952,57 +2164,136 @@ end
|
|
1952
2164
|
#
|
1953
2165
|
# source://nokogiri//lib/nokogiri/html5/document_fragment.rb#27
|
1954
2166
|
class Nokogiri::HTML5::DocumentFragment < ::Nokogiri::HTML4::DocumentFragment
|
1955
|
-
#
|
2167
|
+
# :call-seq:
|
2168
|
+
# new(document, input, **options) → HTML5::DocumentFragment
|
2169
|
+
#
|
2170
|
+
# Parse \HTML5 fragment input from a String, and return a new HTML5::DocumentFragment.
|
2171
|
+
#
|
2172
|
+
# 💡 It's recommended to use either HTML5::DocumentFragment.parse or HTML5::Node#fragment
|
2173
|
+
# rather than call this method directly.
|
2174
|
+
#
|
2175
|
+
# [Required Parameters]
|
2176
|
+
# - +document+ (HTML5::Document) The parent document to associate the returned fragment with.
|
2177
|
+
#
|
2178
|
+
# [Optional Parameters]
|
2179
|
+
# - +input+ (String) The content to be parsed.
|
2180
|
+
#
|
2181
|
+
# [Optional Keyword Arguments]
|
2182
|
+
# used when processing the document. When not provided, the encoding will be determined
|
2183
|
+
# based on the document content. Also see Nokogiri::HTML5 for a longer explanation of how
|
2184
|
+
# encoding is handled by the parser.
|
2185
|
+
#
|
2186
|
+
# - +context:+ (String | Nokogiri::XML::Node) The node, or the name of an HTML5 element, in
|
2187
|
+
# which to parse the document fragment. (default +"body"+)
|
2188
|
+
#
|
2189
|
+
# - +max_errors:+ (Integer) The maximum number of parse errors to record. (default
|
2190
|
+
# +Nokogiri::Gumbo::DEFAULT_MAX_ERRORS+ which is currently 0)
|
2191
|
+
#
|
2192
|
+
# - +max_tree_depth:+ (Integer) The maximum depth of the parse tree. (default
|
2193
|
+
# +Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH+)
|
2194
|
+
#
|
2195
|
+
# - +max_attributes:+ (Integer) The maximum number of attributes allowed on an
|
2196
|
+
# element. (default +Nokogiri::Gumbo::DEFAULT_MAX_ATTRIBUTES+)
|
2197
|
+
#
|
2198
|
+
# - +parse_noscript_content_as_text:+ (Boolean) Whether to parse the content of +noscript+
|
2199
|
+
# elements as text. (default +false+)
|
2200
|
+
#
|
2201
|
+
# See rdoc-ref:HTML5@Parsing+options for a complete description of these parsing options.
|
2202
|
+
#
|
2203
|
+
# [Returns] HTML5::DocumentFragment
|
2204
|
+
#
|
2205
|
+
# === Context \Node
|
2206
|
+
#
|
2207
|
+
# If a context node is specified using +context:+, then the parser will behave as if that
|
2208
|
+
# Node, or a hypothetical tag named as specified, is the parent of the fragment subtree.
|
1956
2209
|
#
|
1957
2210
|
# @return [DocumentFragment] a new instance of DocumentFragment
|
1958
2211
|
#
|
1959
|
-
# source://nokogiri//lib/nokogiri/html5/document_fragment.rb#
|
1960
|
-
def initialize(doc,
|
2212
|
+
# source://nokogiri//lib/nokogiri/html5/document_fragment.rb#144
|
2213
|
+
def initialize(doc, input = T.unsafe(nil), context_ = T.unsafe(nil), positional_options_hash = T.unsafe(nil), context: T.unsafe(nil), **options); end
|
1961
2214
|
|
1962
2215
|
# Returns the value of attribute document.
|
1963
2216
|
#
|
1964
|
-
# source://nokogiri//lib/nokogiri/html5/document_fragment.rb#
|
2217
|
+
# source://nokogiri//lib/nokogiri/html5/document_fragment.rb#88
|
1965
2218
|
def document; end
|
1966
2219
|
|
1967
2220
|
# Sets the attribute document
|
1968
2221
|
#
|
1969
2222
|
# @param value the value to set the attribute document to.
|
1970
2223
|
#
|
1971
|
-
# source://nokogiri//lib/nokogiri/html5/document_fragment.rb#
|
2224
|
+
# source://nokogiri//lib/nokogiri/html5/document_fragment.rb#88
|
1972
2225
|
def document=(_arg0); end
|
1973
2226
|
|
1974
2227
|
# Returns the value of attribute errors.
|
1975
2228
|
#
|
1976
|
-
# source://nokogiri//lib/nokogiri/html5/document_fragment.rb#
|
2229
|
+
# source://nokogiri//lib/nokogiri/html5/document_fragment.rb#89
|
1977
2230
|
def errors; end
|
1978
2231
|
|
1979
2232
|
# Sets the attribute errors
|
1980
2233
|
#
|
1981
2234
|
# @param value the value to set the attribute errors to.
|
1982
2235
|
#
|
1983
|
-
# source://nokogiri//lib/nokogiri/html5/document_fragment.rb#
|
2236
|
+
# source://nokogiri//lib/nokogiri/html5/document_fragment.rb#89
|
1984
2237
|
def errors=(_arg0); end
|
1985
2238
|
|
1986
|
-
# source://nokogiri//lib/nokogiri/html5/document_fragment.rb#
|
2239
|
+
# source://nokogiri//lib/nokogiri/html5/document_fragment.rb#175
|
1987
2240
|
def extract_params(params); end
|
1988
2241
|
|
1989
2242
|
# Get the parser's quirks mode value. See HTML5::QuirksMode.
|
1990
2243
|
#
|
1991
|
-
# This method returns `nil` if the parser was not invoked (e.g.,
|
2244
|
+
# This method returns `nil` if the parser was not invoked (e.g.,
|
2245
|
+
# `Nokogiri::HTML5::DocumentFragment.new(doc)`).
|
1992
2246
|
#
|
1993
2247
|
# Since v1.14.0
|
1994
2248
|
#
|
1995
|
-
# source://nokogiri//lib/nokogiri/html5/document_fragment.rb#
|
2249
|
+
# source://nokogiri//lib/nokogiri/html5/document_fragment.rb#97
|
1996
2250
|
def quirks_mode; end
|
1997
2251
|
|
1998
|
-
# source://nokogiri//lib/nokogiri/html5/document_fragment.rb#
|
2252
|
+
# source://nokogiri//lib/nokogiri/html5/document_fragment.rb#169
|
1999
2253
|
def serialize(options = T.unsafe(nil), &block); end
|
2000
2254
|
|
2001
2255
|
class << self
|
2002
|
-
#
|
2256
|
+
# :call-seq:
|
2257
|
+
# parse(input, **options) → HTML5::DocumentFragment
|
2258
|
+
#
|
2259
|
+
# Parse \HTML5 fragment input from a String, and return a new HTML5::DocumentFragment. This
|
2260
|
+
# method creates a new, empty HTML5::Document to contain the fragment.
|
2261
|
+
#
|
2262
|
+
# [Parameters]
|
2263
|
+
# - +input+ (String | IO) The HTML5 document fragment to parse.
|
2264
|
+
#
|
2265
|
+
# [Optional Keyword Arguments]
|
2266
|
+
# used when processing the document. When not provided, the encoding will be determined
|
2267
|
+
# based on the document content. Also see Nokogiri::HTML5 for a longer explanation of how
|
2268
|
+
# encoding is handled by the parser.
|
2269
|
+
#
|
2270
|
+
# - +context:+ (String | Nokogiri::XML::Node) The node, or the name of an HTML5 element, "in
|
2271
|
+
# context" of which to parse the document fragment. See below for more
|
2272
|
+
# information. (default +"body"+)
|
2273
|
+
#
|
2274
|
+
# - +max_errors:+ (Integer) The maximum number of parse errors to record. (default
|
2275
|
+
# +Nokogiri::Gumbo::DEFAULT_MAX_ERRORS+ which is currently 0)
|
2276
|
+
#
|
2277
|
+
# - +max_tree_depth:+ (Integer) The maximum depth of the parse tree. (default
|
2278
|
+
# +Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH+)
|
2279
|
+
#
|
2280
|
+
# - +max_attributes:+ (Integer) The maximum number of attributes allowed on an
|
2281
|
+
# element. (default +Nokogiri::Gumbo::DEFAULT_MAX_ATTRIBUTES+)
|
2282
|
+
#
|
2283
|
+
# - +parse_noscript_content_as_text:+ (Boolean) Whether to parse the content of +noscript+
|
2284
|
+
# elements as text. (default +false+)
|
2003
2285
|
#
|
2004
|
-
#
|
2005
|
-
|
2286
|
+
# See rdoc-ref:HTML5@Parsing+options for a complete description of these parsing options.
|
2287
|
+
#
|
2288
|
+
# [Returns] Nokogiri::HTML5::DocumentFragment
|
2289
|
+
#
|
2290
|
+
# === Context \Node
|
2291
|
+
#
|
2292
|
+
# If a context node is specified using +context:+, then the parser will behave as if that
|
2293
|
+
# Node, or a hypothetical tag named as specified, is the parent of the fragment subtree.
|
2294
|
+
#
|
2295
|
+
# source://nokogiri//lib/nokogiri/html5/document_fragment.rb#69
|
2296
|
+
def parse(input, encoding_ = T.unsafe(nil), positional_options_hash = T.unsafe(nil), encoding: T.unsafe(nil), **options); end
|
2006
2297
|
end
|
2007
2298
|
end
|
2008
2299
|
|
@@ -2065,6 +2356,7 @@ Nokogiri::LIBXML_COMPILED_VERSION = T.let(T.unsafe(nil), String)
|
|
2065
2356
|
Nokogiri::LIBXML_ICONV_ENABLED = T.let(T.unsafe(nil), TrueClass)
|
2066
2357
|
Nokogiri::LIBXML_LOADED_VERSION = T.let(T.unsafe(nil), String)
|
2067
2358
|
Nokogiri::LIBXML_MEMORY_MANAGEMENT = T.let(T.unsafe(nil), String)
|
2359
|
+
Nokogiri::LIBXML_ZLIB_ENABLED = T.let(T.unsafe(nil), TrueClass)
|
2068
2360
|
Nokogiri::LIBXSLT_COMPILED_VERSION = T.let(T.unsafe(nil), String)
|
2069
2361
|
Nokogiri::LIBXSLT_DATETIME_ENABLED = T.let(T.unsafe(nil), TrueClass)
|
2070
2362
|
Nokogiri::LIBXSLT_LOADED_VERSION = T.let(T.unsafe(nil), String)
|
@@ -2172,38 +2464,41 @@ class Nokogiri::VersionInfo
|
|
2172
2464
|
end
|
2173
2465
|
end
|
2174
2466
|
|
2175
|
-
# source://nokogiri//lib/nokogiri/xml.rb#
|
2467
|
+
# source://nokogiri//lib/nokogiri/xml.rb#11
|
2176
2468
|
module Nokogiri::XML
|
2177
2469
|
class << self
|
2178
|
-
#
|
2179
|
-
# Nokogiri::XML::Reader for mor information
|
2470
|
+
# Convenience method for Nokogiri::XML::Reader.new
|
2180
2471
|
#
|
2181
|
-
#
|
2182
|
-
|
2183
|
-
# source://nokogiri//lib/nokogiri/xml.rb#23
|
2184
|
-
def Reader(string_or_io, url = T.unsafe(nil), encoding = T.unsafe(nil), options = T.unsafe(nil)); end
|
2472
|
+
# source://nokogiri//lib/nokogiri/xml.rb#21
|
2473
|
+
def Reader(*_arg0, **_arg1, &_arg2); end
|
2185
2474
|
|
2186
|
-
#
|
2187
|
-
#
|
2475
|
+
# :call-seq:
|
2476
|
+
# RelaxNG(input) → Nokogiri::XML::RelaxNG
|
2477
|
+
# RelaxNG(input, options:) → Nokogiri::XML::RelaxNG
|
2478
|
+
#
|
2479
|
+
# Convenience method for Nokogiri::XML::RelaxNG.new
|
2188
2480
|
#
|
2189
|
-
# source://nokogiri//lib/nokogiri/xml/relax_ng.rb#
|
2190
|
-
def RelaxNG(
|
2481
|
+
# source://nokogiri//lib/nokogiri/xml/relax_ng.rb#11
|
2482
|
+
def RelaxNG(*_arg0, **_arg1, &_arg2); end
|
2191
2483
|
|
2192
|
-
#
|
2193
|
-
#
|
2484
|
+
# :call-seq:
|
2485
|
+
# Schema(input) → Nokogiri::XML::Schema
|
2486
|
+
# Schema(input, parse_options) → Nokogiri::XML::Schema
|
2487
|
+
#
|
2488
|
+
# Convenience method for Nokogiri::XML::Schema.new
|
2194
2489
|
#
|
2195
|
-
# source://nokogiri//lib/nokogiri/xml/schema.rb#
|
2196
|
-
def Schema(
|
2490
|
+
# source://nokogiri//lib/nokogiri/xml/schema.rb#11
|
2491
|
+
def Schema(*_arg0, **_arg1, &_arg2); end
|
2197
2492
|
|
2198
|
-
#
|
2493
|
+
# Convenience method for Nokogiri::XML::DocumentFragment.parse
|
2199
2494
|
#
|
2200
|
-
# source://nokogiri//lib/nokogiri/xml.rb#
|
2201
|
-
def fragment(
|
2495
|
+
# source://nokogiri//lib/nokogiri/xml.rb#31
|
2496
|
+
def fragment(*_arg0, **_arg1, &_arg2); end
|
2202
2497
|
|
2203
|
-
#
|
2498
|
+
# Convenience method for Nokogiri::XML::Document.parse
|
2204
2499
|
#
|
2205
|
-
# source://nokogiri//lib/nokogiri/xml.rb#
|
2206
|
-
def parse(
|
2500
|
+
# source://nokogiri//lib/nokogiri/xml.rb#26
|
2501
|
+
def parse(*_arg0, **_arg1, &_arg2); end
|
2207
2502
|
end
|
2208
2503
|
end
|
2209
2504
|
|
@@ -2729,28 +3024,40 @@ class Nokogiri::XML::DTD < ::Nokogiri::XML::Node
|
|
2729
3024
|
def validate(_arg0); end
|
2730
3025
|
end
|
2731
3026
|
|
2732
|
-
# Nokogiri::XML::Document is the main entry point for dealing with XML documents.
|
2733
|
-
# is created by parsing
|
2734
|
-
# on parsing.
|
3027
|
+
# Nokogiri::XML::Document is the main entry point for dealing with \XML documents. The Document
|
3028
|
+
# is created by parsing \XML content from a String or an IO object. See
|
3029
|
+
# Nokogiri::XML::Document.parse for more information on parsing.
|
2735
3030
|
#
|
2736
|
-
#
|
2737
|
-
#
|
3031
|
+
# Document inherits a great deal of functionality from its superclass Nokogiri::XML::Node, so
|
3032
|
+
# please read that class's documentation as well.
|
2738
3033
|
#
|
2739
3034
|
# source://nokogiri//lib/nokogiri/xml/document.rb#17
|
2740
3035
|
class Nokogiri::XML::Document < ::Nokogiri::XML::Node
|
2741
3036
|
# @return [Document] a new instance of Document
|
2742
3037
|
#
|
2743
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3038
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#190
|
2744
3039
|
def initialize(*args); end
|
2745
3040
|
|
2746
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3041
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#437
|
2747
3042
|
def <<(node_or_tags); end
|
2748
3043
|
|
2749
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3044
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#437
|
2750
3045
|
def add_child(node_or_tags); end
|
2751
3046
|
|
2752
3047
|
def canonicalize(*_arg0); end
|
2753
|
-
|
3048
|
+
|
3049
|
+
# :call-seq:
|
3050
|
+
# clone → Nokogiri::XML::Document
|
3051
|
+
# clone(level) → Nokogiri::XML::Document
|
3052
|
+
#
|
3053
|
+
# Clone this node.
|
3054
|
+
#
|
3055
|
+
# [Parameters]
|
3056
|
+
# - +level+ (optional Integer). 0 is a shallow copy, 1 (the default) is a deep copy.
|
3057
|
+
# [Returns] The new Nokogiri::XML::Document
|
3058
|
+
#
|
3059
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#223
|
3060
|
+
def clone(level = T.unsafe(nil)); end
|
2754
3061
|
|
2755
3062
|
# :call-seq:
|
2756
3063
|
# collect_namespaces() → Hash<String(Namespace#prefix) ⇒ String(Namespace#href)>
|
@@ -2788,17 +3095,17 @@ class Nokogiri::XML::Document < ::Nokogiri::XML::Node
|
|
2788
3095
|
#
|
2789
3096
|
# {"xmlns:foo" => "baz"}
|
2790
3097
|
#
|
2791
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3098
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#361
|
2792
3099
|
def collect_namespaces; end
|
2793
3100
|
|
2794
3101
|
# Create a CDATA Node containing +string+
|
2795
3102
|
#
|
2796
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3103
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#306
|
2797
3104
|
def create_cdata(string, &block); end
|
2798
3105
|
|
2799
3106
|
# Create a Comment Node containing +string+
|
2800
3107
|
#
|
2801
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3108
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#311
|
2802
3109
|
def create_comment(string, &block); end
|
2803
3110
|
|
2804
3111
|
# :call-seq:
|
@@ -2849,14 +3156,14 @@ class Nokogiri::XML::Document < ::Nokogiri::XML::Node
|
|
2849
3156
|
#
|
2850
3157
|
# doc.create_element("div") { |node| node["class"] = "blue" if before_noon? }
|
2851
3158
|
#
|
2852
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3159
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#276
|
2853
3160
|
def create_element(name, *contents_or_attrs, &block); end
|
2854
3161
|
|
2855
3162
|
def create_entity(*_arg0); end
|
2856
3163
|
|
2857
3164
|
# Create a Text Node with +string+
|
2858
3165
|
#
|
2859
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3166
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#301
|
2860
3167
|
def create_text_node(string, &block); end
|
2861
3168
|
|
2862
3169
|
# :call-seq: deconstruct_keys(array_of_names) → Hash
|
@@ -2898,25 +3205,37 @@ class Nokogiri::XML::Document < ::Nokogiri::XML::Node
|
|
2898
3205
|
#
|
2899
3206
|
# Since v1.14.0
|
2900
3207
|
#
|
2901
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3208
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#501
|
2902
3209
|
def deconstruct_keys(keys); end
|
2903
3210
|
|
2904
3211
|
# Apply any decorators to +node+
|
2905
3212
|
#
|
2906
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3213
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#409
|
2907
3214
|
def decorate(node); end
|
2908
3215
|
|
2909
3216
|
# Get the list of decorators given +key+
|
2910
3217
|
#
|
2911
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3218
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#368
|
2912
3219
|
def decorators(key); end
|
2913
3220
|
|
2914
3221
|
# A reference to +self+
|
2915
3222
|
#
|
2916
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3223
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#321
|
2917
3224
|
def document; end
|
2918
3225
|
|
2919
|
-
|
3226
|
+
# :call-seq:
|
3227
|
+
# dup → Nokogiri::XML::Document
|
3228
|
+
# dup(level) → Nokogiri::XML::Document
|
3229
|
+
#
|
3230
|
+
# Duplicate this node.
|
3231
|
+
#
|
3232
|
+
# [Parameters]
|
3233
|
+
# - +level+ (optional Integer). 0 is a shallow copy, 1 (the default) is a deep copy.
|
3234
|
+
# [Returns] The new Nokogiri::XML::Document
|
3235
|
+
#
|
3236
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#207
|
3237
|
+
def dup(level = T.unsafe(nil)); end
|
3238
|
+
|
2920
3239
|
def encoding; end
|
2921
3240
|
def encoding=(_arg0); end
|
2922
3241
|
|
@@ -2924,25 +3243,25 @@ class Nokogiri::XML::Document < ::Nokogiri::XML::Node
|
|
2924
3243
|
#
|
2925
3244
|
# [Returns] Array<Nokogiri::XML::SyntaxError>
|
2926
3245
|
#
|
2927
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3246
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#141
|
2928
3247
|
def errors; end
|
2929
3248
|
|
2930
3249
|
# The errors found while parsing a document.
|
2931
3250
|
#
|
2932
3251
|
# [Returns] Array<Nokogiri::XML::SyntaxError>
|
2933
3252
|
#
|
2934
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3253
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#141
|
2935
3254
|
def errors=(_arg0); end
|
2936
3255
|
|
2937
3256
|
# Create a Nokogiri::XML::DocumentFragment from +tags+
|
2938
3257
|
# Returns an empty fragment if +tags+ is nil.
|
2939
3258
|
#
|
2940
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3259
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#429
|
2941
3260
|
def fragment(tags = T.unsafe(nil)); end
|
2942
3261
|
|
2943
3262
|
# The name of this document. Always returns "document"
|
2944
3263
|
#
|
2945
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3264
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#316
|
2946
3265
|
def name; end
|
2947
3266
|
|
2948
3267
|
# When `true`, reparented elements without a namespace will inherit their new parent's
|
@@ -2991,7 +3310,7 @@ class Nokogiri::XML::Document < ::Nokogiri::XML::Node
|
|
2991
3310
|
#
|
2992
3311
|
# Since v1.12.4
|
2993
3312
|
#
|
2994
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3313
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#188
|
2995
3314
|
def namespace_inheritance; end
|
2996
3315
|
|
2997
3316
|
# When `true`, reparented elements without a namespace will inherit their new parent's
|
@@ -3040,12 +3359,12 @@ class Nokogiri::XML::Document < ::Nokogiri::XML::Node
|
|
3040
3359
|
#
|
3041
3360
|
# Since v1.12.4
|
3042
3361
|
#
|
3043
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3362
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#188
|
3044
3363
|
def namespace_inheritance=(_arg0); end
|
3045
3364
|
|
3046
3365
|
# Get the hash of namespaces on the root Nokogiri::XML::Node
|
3047
3366
|
#
|
3048
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3367
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#422
|
3049
3368
|
def namespaces; end
|
3050
3369
|
|
3051
3370
|
def remove_namespaces!; end
|
@@ -3067,18 +3386,18 @@ class Nokogiri::XML::Document < ::Nokogiri::XML::Node
|
|
3067
3386
|
# irb> doc.slop!
|
3068
3387
|
# ... which does absolutely nothing.
|
3069
3388
|
#
|
3070
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3389
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#398
|
3071
3390
|
def slop!; end
|
3072
3391
|
|
3073
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
3392
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1364
|
3074
3393
|
def to_xml(*args, &block); end
|
3075
3394
|
|
3076
3395
|
def url; end
|
3077
3396
|
|
3078
|
-
# Validate this Document against
|
3397
|
+
# Validate this Document against its DTD. Returns a list of errors on
|
3079
3398
|
# the document or +nil+ when there is no DTD.
|
3080
3399
|
#
|
3081
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3400
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#376
|
3082
3401
|
def validate; end
|
3083
3402
|
|
3084
3403
|
def version; end
|
@@ -3090,46 +3409,53 @@ class Nokogiri::XML::Document < ::Nokogiri::XML::Node
|
|
3090
3409
|
#
|
3091
3410
|
# See XPathVisitor for more information.
|
3092
3411
|
#
|
3093
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3412
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#457
|
3094
3413
|
def xpath_doctype; end
|
3095
3414
|
|
3415
|
+
protected
|
3416
|
+
|
3417
|
+
def initialize_copy_with_args(_arg0, _arg1); end
|
3418
|
+
|
3096
3419
|
private
|
3097
3420
|
|
3098
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3421
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#509
|
3099
3422
|
def inspect_attributes; end
|
3100
3423
|
|
3101
3424
|
class << self
|
3102
3425
|
def new(*_arg0); end
|
3103
3426
|
|
3104
|
-
#
|
3427
|
+
# call-seq:
|
3428
|
+
# parse(input) { |options| ... } => Nokogiri::XML::Document
|
3429
|
+
#
|
3430
|
+
# Parse \XML input from a String or IO object, and return a new XML::Document.
|
3105
3431
|
#
|
3106
|
-
#
|
3107
|
-
#
|
3432
|
+
# 🛡 By default, Nokogiri treats documents as untrusted, and so does not attempt to load DTDs
|
3433
|
+
# or access the network. See Nokogiri::XML::ParseOptions for a complete list of options; and
|
3434
|
+
# that module's DEFAULT_XML constant for what's set (and not set) by default.
|
3108
3435
|
#
|
3109
|
-
#
|
3436
|
+
# [Required Parameters]
|
3437
|
+
# - +input+ (String | IO) The content to be parsed.
|
3110
3438
|
#
|
3111
|
-
#
|
3112
|
-
#
|
3439
|
+
# [Optional Keyword Arguments]
|
3440
|
+
# - +url:+ (String) The base URI for this document.
|
3113
3441
|
#
|
3114
|
-
#
|
3115
|
-
#
|
3116
|
-
# Nokogiri::XML::ParseOptions for more information.
|
3442
|
+
# document. When not provided, the encoding will be determined based on the document
|
3443
|
+
# content.
|
3117
3444
|
#
|
3118
|
-
# +
|
3119
|
-
#
|
3445
|
+
# - +options:+ (Nokogiri::XML::ParseOptions) Configuration object that determines some
|
3446
|
+
# behaviors during parsing. See ParseOptions for more information. The default value is
|
3447
|
+
# +ParseOptions::DEFAULT_XML+.
|
3120
3448
|
#
|
3121
|
-
#
|
3122
|
-
#
|
3123
|
-
# Nokogiri::XML::ParseOptions for
|
3124
|
-
# and that module's DEFAULT_XML constant for what's set (and not
|
3125
|
-
# set) by default.
|
3449
|
+
# [Yields]
|
3450
|
+
# If a block is given, a Nokogiri::XML::ParseOptions object is yielded to the block which
|
3451
|
+
# can be configured before parsing. See Nokogiri::XML::ParseOptions for more information.
|
3126
3452
|
#
|
3127
|
-
# Nokogiri
|
3453
|
+
# [Returns] Nokogiri::XML::Document
|
3128
3454
|
#
|
3129
3455
|
# @yield [options]
|
3130
3456
|
#
|
3131
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3132
|
-
def parse(string_or_io,
|
3457
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#56
|
3458
|
+
def parse(string_or_io, url_ = T.unsafe(nil), encoding_ = T.unsafe(nil), options_ = T.unsafe(nil), url: T.unsafe(nil), encoding: T.unsafe(nil), options: T.unsafe(nil)); end
|
3133
3459
|
|
3134
3460
|
def read_io(_arg0, _arg1, _arg2, _arg3); end
|
3135
3461
|
def read_memory(_arg0, _arg1, _arg2, _arg3); end
|
@@ -3138,12 +3464,12 @@ class Nokogiri::XML::Document < ::Nokogiri::XML::Node
|
|
3138
3464
|
|
3139
3465
|
# @return [Boolean]
|
3140
3466
|
#
|
3141
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3467
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#96
|
3142
3468
|
def empty_doc?(string_or_io); end
|
3143
3469
|
end
|
3144
3470
|
end
|
3145
3471
|
|
3146
|
-
# source://nokogiri//lib/nokogiri/xml/document.rb#
|
3472
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#507
|
3147
3473
|
Nokogiri::XML::Document::IMPLIED_XPATH_CONTEXTS = T.let(T.unsafe(nil), Array)
|
3148
3474
|
|
3149
3475
|
# source://nokogiri//lib/nokogiri/xml/document.rb#19
|
@@ -3159,19 +3485,58 @@ Nokogiri::XML::Document::NCNAME_RE = T.let(T.unsafe(nil), Regexp)
|
|
3159
3485
|
# source://nokogiri//lib/nokogiri/xml/document.rb#18
|
3160
3486
|
Nokogiri::XML::Document::NCNAME_START_CHAR = T.let(T.unsafe(nil), String)
|
3161
3487
|
|
3162
|
-
# source://nokogiri//lib/nokogiri/xml/
|
3488
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#23
|
3489
|
+
Nokogiri::XML::Document::OBJECT_CLONE_METHOD = T.let(T.unsafe(nil), UnboundMethod)
|
3490
|
+
|
3491
|
+
# source://nokogiri//lib/nokogiri/xml/document.rb#22
|
3492
|
+
Nokogiri::XML::Document::OBJECT_DUP_METHOD = T.let(T.unsafe(nil), UnboundMethod)
|
3493
|
+
|
3494
|
+
# DocumentFragment represents a fragment of an \XML document. It provides the same functionality
|
3495
|
+
# exposed by XML::Node and can be used to contain one or more \XML subtrees.
|
3496
|
+
#
|
3497
|
+
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#11
|
3163
3498
|
class Nokogiri::XML::DocumentFragment < ::Nokogiri::XML::Node
|
3164
|
-
#
|
3499
|
+
# :call-seq:
|
3500
|
+
# new(document, input=nil) { |options| ... } → DocumentFragment
|
3501
|
+
# new(document, input=nil, context:, options:) → DocumentFragment
|
3502
|
+
#
|
3503
|
+
# Parse \XML fragment input from a String, and return a new DocumentFragment that is
|
3504
|
+
# associated with the given +document+.
|
3505
|
+
#
|
3506
|
+
# 💡 It's recommended to use either XML::DocumentFragment.parse or Node#parse rather than call
|
3507
|
+
# this method directly.
|
3508
|
+
#
|
3509
|
+
# [Required Parameters]
|
3510
|
+
# - +document+ (XML::Document) The parent document to associate the returned fragment with.
|
3511
|
+
#
|
3512
|
+
# [Optional Parameters]
|
3513
|
+
# - +input+ (String) The content to be parsed.
|
3514
|
+
#
|
3515
|
+
# [Optional Keyword Arguments]
|
3516
|
+
# - +context:+ (Nokogiri::XML::Node) The <b>context node</b> for the subtree created. See
|
3517
|
+
# below for more information.
|
3518
|
+
#
|
3519
|
+
# - +options:+ (Nokogiri::XML::ParseOptions) Configuration object that determines some
|
3520
|
+
# behaviors during parsing. See ParseOptions for more information. The default value is
|
3521
|
+
# +ParseOptions::DEFAULT_XML+.
|
3522
|
+
#
|
3523
|
+
# [Yields]
|
3524
|
+
# If a block is given, a Nokogiri::XML::ParseOptions object is yielded to the block which
|
3525
|
+
# can be configured before parsing. See ParseOptions for more information.
|
3526
|
+
#
|
3527
|
+
# [Returns] XML::DocumentFragment
|
3528
|
+
#
|
3529
|
+
# === Context \Node
|
3165
3530
|
#
|
3166
|
-
#
|
3167
|
-
#
|
3168
|
-
#
|
3531
|
+
# If a context node is specified using +context:+, then the fragment will be created by
|
3532
|
+
# calling Node#parse on that node, so the parser will behave as if that Node is the parent of
|
3533
|
+
# the fragment subtree, and will resolve namespaces relative to that node.
|
3169
3534
|
#
|
3170
3535
|
# @return [DocumentFragment] a new instance of DocumentFragment
|
3171
3536
|
# @yield [options]
|
3172
3537
|
#
|
3173
|
-
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#
|
3174
|
-
def initialize(document, tags = T.unsafe(nil),
|
3538
|
+
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#85
|
3539
|
+
def initialize(document, tags = T.unsafe(nil), context_ = T.unsafe(nil), options_ = T.unsafe(nil), context: T.unsafe(nil), options: T.unsafe(nil)); end
|
3175
3540
|
|
3176
3541
|
# call-seq: css *rules, [namespace-bindings, custom-pseudo-class]
|
3177
3542
|
#
|
@@ -3180,7 +3545,7 @@ class Nokogiri::XML::DocumentFragment < ::Nokogiri::XML::Node
|
|
3180
3545
|
#
|
3181
3546
|
# For more information see Nokogiri::XML::Searchable#css
|
3182
3547
|
#
|
3183
|
-
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#
|
3548
|
+
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#173
|
3184
3549
|
def css(*args); end
|
3185
3550
|
|
3186
3551
|
# :call-seq: deconstruct() → Array
|
@@ -3224,79 +3589,112 @@ class Nokogiri::XML::DocumentFragment < ::Nokogiri::XML::Node
|
|
3224
3589
|
#
|
3225
3590
|
# Since v1.14.0
|
3226
3591
|
#
|
3227
|
-
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#
|
3592
|
+
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#261
|
3228
3593
|
def deconstruct; end
|
3229
3594
|
|
3230
|
-
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#
|
3595
|
+
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#113
|
3231
3596
|
def dup; end
|
3232
3597
|
|
3233
3598
|
# A list of Nokogiri::XML::SyntaxError found when parsing a document
|
3234
3599
|
#
|
3235
|
-
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#
|
3600
|
+
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#207
|
3236
3601
|
def errors; end
|
3237
3602
|
|
3238
|
-
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#
|
3603
|
+
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#211
|
3239
3604
|
def errors=(things); end
|
3240
3605
|
|
3241
|
-
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#
|
3606
|
+
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#215
|
3242
3607
|
def fragment(data); end
|
3243
3608
|
|
3244
3609
|
# return the name for DocumentFragment
|
3245
3610
|
#
|
3246
|
-
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#
|
3611
|
+
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#125
|
3247
3612
|
def name; end
|
3248
3613
|
|
3614
|
+
# The options used to parse the document fragment. Returns the value of any options that were
|
3615
|
+
# passed into the constructor as a parameter or set in a config block, else the default
|
3616
|
+
# options for the specific subclass.
|
3617
|
+
#
|
3618
|
+
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#12
|
3619
|
+
def parse_options; end
|
3620
|
+
|
3249
3621
|
# call-seq: search *paths, [namespace-bindings, xpath-variable-bindings, custom-handler-class]
|
3250
3622
|
#
|
3251
3623
|
# Search this fragment for +paths+. +paths+ must be one or more XPath or CSS queries.
|
3252
3624
|
#
|
3253
3625
|
# For more information see Nokogiri::XML::Searchable#search
|
3254
3626
|
#
|
3255
|
-
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#
|
3627
|
+
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#192
|
3256
3628
|
def search(*rules); end
|
3257
3629
|
|
3258
3630
|
# Convert this DocumentFragment to a string
|
3259
3631
|
#
|
3260
|
-
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#
|
3632
|
+
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#131
|
3261
3633
|
def serialize; end
|
3262
3634
|
|
3263
3635
|
# Convert this DocumentFragment to html
|
3264
3636
|
# See Nokogiri::XML::NodeSet#to_html
|
3265
3637
|
#
|
3266
|
-
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#
|
3638
|
+
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#138
|
3267
3639
|
def to_html(*args); end
|
3268
3640
|
|
3269
3641
|
# Convert this DocumentFragment to a string
|
3270
3642
|
#
|
3271
|
-
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#
|
3643
|
+
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#131
|
3272
3644
|
def to_s; end
|
3273
3645
|
|
3274
3646
|
# Convert this DocumentFragment to xhtml
|
3275
3647
|
# See Nokogiri::XML::NodeSet#to_xhtml
|
3276
3648
|
#
|
3277
|
-
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#
|
3649
|
+
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#150
|
3278
3650
|
def to_xhtml(*args); end
|
3279
3651
|
|
3280
3652
|
# Convert this DocumentFragment to xml
|
3281
3653
|
# See Nokogiri::XML::NodeSet#to_xml
|
3282
3654
|
#
|
3283
|
-
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#
|
3655
|
+
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#162
|
3284
3656
|
def to_xml(*args); end
|
3285
3657
|
|
3286
3658
|
private
|
3287
3659
|
|
3288
3660
|
# fix for issue 770
|
3289
3661
|
#
|
3290
|
-
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#
|
3662
|
+
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#268
|
3291
3663
|
def namespace_declarations(ctx); end
|
3292
3664
|
|
3293
3665
|
class << self
|
3294
|
-
def
|
3666
|
+
def native_new(_arg0); end
|
3295
3667
|
|
3296
|
-
#
|
3668
|
+
# Wrapper method to separate the concerns of:
|
3669
|
+
# - the native object allocator's parameter (it only requires `document`)
|
3670
|
+
# - the initializer's parameters
|
3671
|
+
#
|
3672
|
+
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#42
|
3673
|
+
def new(document, *_arg1, **_arg2, &_arg3); end
|
3674
|
+
|
3675
|
+
# :call-seq:
|
3676
|
+
# parse(input) { |options| ... } → XML::DocumentFragment
|
3677
|
+
# parse(input, options:) → XML::DocumentFragment
|
3678
|
+
#
|
3679
|
+
# Parse \XML fragment input from a String, and return a new XML::DocumentFragment. This
|
3680
|
+
# method creates a new, empty XML::Document to contain the fragment.
|
3297
3681
|
#
|
3298
|
-
#
|
3299
|
-
|
3682
|
+
# [Required Parameters]
|
3683
|
+
# - +input+ (String) The content to be parsed.
|
3684
|
+
#
|
3685
|
+
# [Optional Keyword Arguments]
|
3686
|
+
# - +options+ (Nokogiri::XML::ParseOptions) Configuration object that determines some
|
3687
|
+
# behaviors during parsing. See ParseOptions for more information. The default value is
|
3688
|
+
# +ParseOptions::DEFAULT_XML+.
|
3689
|
+
#
|
3690
|
+
# [Yields]
|
3691
|
+
# If a block is given, a Nokogiri::XML::ParseOptions object is yielded to the block which
|
3692
|
+
# can be configured before parsing. See Nokogiri::XML::ParseOptions for more information.
|
3693
|
+
#
|
3694
|
+
# [Returns] Nokogiri::XML::DocumentFragment
|
3695
|
+
#
|
3696
|
+
# source://nokogiri//lib/nokogiri/xml/document_fragment.rb#35
|
3697
|
+
def parse(tags, options_ = T.unsafe(nil), options: T.unsafe(nil), &block); end
|
3300
3698
|
end
|
3301
3699
|
end
|
3302
3700
|
|
@@ -3566,18 +3964,18 @@ class Nokogiri::XML::Node
|
|
3566
3964
|
#
|
3567
3965
|
# Also see related method +add_child+.
|
3568
3966
|
#
|
3569
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
3967
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#292
|
3570
3968
|
def <<(node_or_tags); end
|
3571
3969
|
|
3572
3970
|
# Compare two Node objects with respect to their Document. Nodes from
|
3573
3971
|
# different documents cannot be compared.
|
3574
3972
|
#
|
3575
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
3973
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1340
|
3576
3974
|
def <=>(other); end
|
3577
3975
|
|
3578
3976
|
# Test to see if this Node is equal to +other+
|
3579
3977
|
#
|
3580
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
3978
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1330
|
3581
3979
|
def ==(other); end
|
3582
3980
|
|
3583
3981
|
# :call-seq: [](name) → (String, nil)
|
@@ -3610,7 +4008,7 @@ class Nokogiri::XML::Node
|
|
3610
4008
|
# doc.at_css("child").attribute_with_ns("size", "http://example.com/widths").value
|
3611
4009
|
# # => "broad"
|
3612
4010
|
#
|
3613
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4011
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#587
|
3614
4012
|
def [](name); end
|
3615
4013
|
|
3616
4014
|
# :call-seq: []=(name, value) → value
|
@@ -3647,12 +4045,12 @@ class Nokogiri::XML::Node
|
|
3647
4045
|
# # " <child width:size=\"broad\"></child>\n" +
|
3648
4046
|
# # "</root>\n"
|
3649
4047
|
#
|
3650
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4048
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#625
|
3651
4049
|
def []=(name, value); end
|
3652
4050
|
|
3653
4051
|
# Accept a visitor. This method calls "visit" on +visitor+ with self.
|
3654
4052
|
#
|
3655
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4053
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1324
|
3656
4054
|
def accept(visitor); end
|
3657
4055
|
|
3658
4056
|
# Add +node_or_tags+ as a child of this Node.
|
@@ -3665,7 +4063,7 @@ class Nokogiri::XML::Node
|
|
3665
4063
|
#
|
3666
4064
|
# Also see related method +<<+.
|
3667
4065
|
#
|
3668
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4066
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#184
|
3669
4067
|
def add_child(node_or_tags); end
|
3670
4068
|
|
3671
4069
|
# :call-seq: add_class(names) → self
|
@@ -3709,7 +4107,7 @@ class Nokogiri::XML::Node
|
|
3709
4107
|
# node # => <div></div>
|
3710
4108
|
# node.add_class(["section", "header"]) # => <div class="section header"></div>
|
3711
4109
|
#
|
3712
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4110
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#790
|
3713
4111
|
def add_class(names); end
|
3714
4112
|
|
3715
4113
|
def add_namespace(_arg0, _arg1); end
|
@@ -3727,7 +4125,7 @@ class Nokogiri::XML::Node
|
|
3727
4125
|
#
|
3728
4126
|
# @raise [ArgumentError]
|
3729
4127
|
#
|
3730
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4128
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#324
|
3731
4129
|
def add_next_sibling(node_or_tags); end
|
3732
4130
|
|
3733
4131
|
# Insert +node_or_tags+ before this Node (as a sibling).
|
@@ -3742,7 +4140,7 @@ class Nokogiri::XML::Node
|
|
3742
4140
|
#
|
3743
4141
|
# @raise [ArgumentError]
|
3744
4142
|
#
|
3745
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4143
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#307
|
3746
4144
|
def add_previous_sibling(node_or_tags); end
|
3747
4145
|
|
3748
4146
|
# Insert +node_or_tags+ after this node (as a sibling).
|
@@ -3754,13 +4152,13 @@ class Nokogiri::XML::Node
|
|
3754
4152
|
#
|
3755
4153
|
# Also see related method +add_next_sibling+.
|
3756
4154
|
#
|
3757
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4155
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#354
|
3758
4156
|
def after(node_or_tags); end
|
3759
4157
|
|
3760
4158
|
# Get a list of ancestor Node for this Node. If +selector+ is given,
|
3761
4159
|
# the ancestors must match +selector+
|
3762
4160
|
#
|
3763
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4161
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1293
|
3764
4162
|
def ancestors(selector = T.unsafe(nil)); end
|
3765
4163
|
|
3766
4164
|
# :call-seq: append_class(names) → self
|
@@ -3802,7 +4200,7 @@ class Nokogiri::XML::Node
|
|
3802
4200
|
# node.append_class(["section", "header"]) # => <div class="section header"></div>
|
3803
4201
|
# node.append_class(["section", "header"]) # => <div class="section header section header"></div>
|
3804
4202
|
#
|
3805
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4203
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#834
|
3806
4204
|
def append_class(names); end
|
3807
4205
|
|
3808
4206
|
# :call-seq: [](name) → (String, nil)
|
@@ -3835,7 +4233,7 @@ class Nokogiri::XML::Node
|
|
3835
4233
|
# doc.at_css("child").attribute_with_ns("size", "http://example.com/widths").value
|
3836
4234
|
# # => "broad"
|
3837
4235
|
#
|
3838
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4236
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#587
|
3839
4237
|
def attr(name); end
|
3840
4238
|
|
3841
4239
|
def attribute(_arg0); end
|
@@ -3896,7 +4294,7 @@ class Nokogiri::XML::Node
|
|
3896
4294
|
# # value = "tall"
|
3897
4295
|
# # })}
|
3898
4296
|
#
|
3899
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4297
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#684
|
3900
4298
|
def attributes; end
|
3901
4299
|
|
3902
4300
|
# Insert +node_or_tags+ before this node (as a sibling).
|
@@ -3908,19 +4306,19 @@ class Nokogiri::XML::Node
|
|
3908
4306
|
#
|
3909
4307
|
# Also see related method +add_previous_sibling+.
|
3910
4308
|
#
|
3911
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4309
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#340
|
3912
4310
|
def before(node_or_tags); end
|
3913
4311
|
|
3914
4312
|
def blank?; end
|
3915
4313
|
|
3916
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4314
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1492
|
3917
4315
|
def canonicalize(mode = T.unsafe(nil), inclusive_namespaces = T.unsafe(nil), with_comments = T.unsafe(nil)); end
|
3918
4316
|
|
3919
4317
|
# Returns true if this is a CDATA
|
3920
4318
|
#
|
3921
4319
|
# @return [Boolean]
|
3922
4320
|
#
|
3923
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4321
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1214
|
3924
4322
|
def cdata?; end
|
3925
4323
|
|
3926
4324
|
def child; end
|
@@ -3933,7 +4331,7 @@ class Nokogiri::XML::Node
|
|
3933
4331
|
#
|
3934
4332
|
# Also see related method +inner_html=+
|
3935
4333
|
#
|
3936
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4334
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#385
|
3937
4335
|
def children=(node_or_tags); end
|
3938
4336
|
|
3939
4337
|
# :call-seq: classes() → Array<String>
|
@@ -3955,24 +4353,77 @@ class Nokogiri::XML::Node
|
|
3955
4353
|
# node # => <div class="section title header"></div>
|
3956
4354
|
# node.classes # => ["section", "title", "header"]
|
3957
4355
|
#
|
3958
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4356
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#744
|
3959
4357
|
def classes; end
|
3960
4358
|
|
3961
|
-
|
4359
|
+
# :call-seq:
|
4360
|
+
# clone → Nokogiri::XML::Node
|
4361
|
+
# clone(level) → Nokogiri::XML::Node
|
4362
|
+
# clone(level, new_parent_doc) → Nokogiri::XML::Node
|
4363
|
+
#
|
4364
|
+
# Clone this node.
|
4365
|
+
#
|
4366
|
+
# [Parameters]
|
4367
|
+
# - +level+ (optional Integer). 0 is a shallow copy, 1 (the default) is a deep copy.
|
4368
|
+
# - +new_parent_doc+
|
4369
|
+
# The new node's parent Document. Defaults to the the Document of the current node.
|
4370
|
+
# [Returns] The new Nokogiri::XML::Node
|
4371
|
+
#
|
4372
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#162
|
4373
|
+
def clone(level = T.unsafe(nil), new_parent_doc = T.unsafe(nil)); end
|
3962
4374
|
|
3963
4375
|
# Returns true if this is a Comment
|
3964
4376
|
#
|
3965
4377
|
# @return [Boolean]
|
3966
4378
|
#
|
3967
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4379
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1209
|
3968
4380
|
def comment?; end
|
3969
4381
|
|
3970
4382
|
def content; end
|
3971
4383
|
|
3972
|
-
#
|
3973
|
-
#
|
4384
|
+
# call-seq:
|
4385
|
+
# content=(input)
|
4386
|
+
#
|
4387
|
+
# Set the content of this node to +input+.
|
4388
|
+
#
|
4389
|
+
# [Parameters]
|
4390
|
+
# - +input+ (String) The new content for this node. Input is considered to be raw content, and
|
4391
|
+
# so will be entity-escaped in the final DOM string.
|
4392
|
+
#
|
4393
|
+
# [Example]
|
4394
|
+
# Note how entities are handled:
|
4395
|
+
#
|
4396
|
+
# doc = Nokogiri::HTML::Document.parse(<<~HTML)
|
4397
|
+
# <html>
|
4398
|
+
# <body>
|
4399
|
+
# <div id="first">asdf</div>
|
4400
|
+
# <div id="second">asdf</div>
|
4401
|
+
# HTML
|
4402
|
+
#
|
4403
|
+
# text_node = doc.at_css("div#first").children.first
|
4404
|
+
# div_node = doc.at_css("div#second")
|
4405
|
+
#
|
4406
|
+
# value = "You & Me"
|
4407
|
+
#
|
4408
|
+
# text_node.content = value
|
4409
|
+
# div_node.content = value
|
4410
|
+
#
|
4411
|
+
# doc.css("div").to_html
|
4412
|
+
# # => "<div id=\"first\">You &amp; Me</div>
|
4413
|
+
# # <div id=\"second\">You &amp; Me</div>"
|
4414
|
+
#
|
4415
|
+
# For content that is already entity-escaped, use CGI::unescapeHTML to decode it:
|
4416
|
+
#
|
4417
|
+
# text_node.content = CGI::unescapeHTML(value)
|
4418
|
+
# div_node.content = CGI::unescapeHTML(value)
|
4419
|
+
#
|
4420
|
+
# doc.css("div").to_html
|
4421
|
+
# # => "<div id=\"first\">You & Me</div>
|
4422
|
+
# # <div id=\"second\">You & Me</div>"
|
3974
4423
|
#
|
3975
|
-
#
|
4424
|
+
# See also: #native_content=
|
4425
|
+
#
|
4426
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#487
|
3976
4427
|
def content=(string); end
|
3977
4428
|
|
3978
4429
|
def create_external_subset(_arg0, _arg1, _arg2); end
|
@@ -3980,9 +4431,11 @@ class Nokogiri::XML::Node
|
|
3980
4431
|
|
3981
4432
|
# Get the path to this node as a CSS expression
|
3982
4433
|
#
|
3983
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4434
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1284
|
3984
4435
|
def css_path; end
|
3985
4436
|
|
4437
|
+
def data_ptr?; end
|
4438
|
+
|
3986
4439
|
# :call-seq: deconstruct_keys(array_of_names) → Hash
|
3987
4440
|
#
|
3988
4441
|
# Returns a hash describing the Node, to use in pattern matching.
|
@@ -4032,12 +4485,12 @@ class Nokogiri::XML::Node
|
|
4032
4485
|
#
|
4033
4486
|
# Since v1.14.0
|
4034
4487
|
#
|
4035
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4488
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1553
|
4036
4489
|
def deconstruct_keys(keys); end
|
4037
4490
|
|
4038
4491
|
# Decorate this node with the decorators set up in this node's Document
|
4039
4492
|
#
|
4040
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4493
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#168
|
4041
4494
|
def decorate!; end
|
4042
4495
|
|
4043
4496
|
# Adds a default namespace supplied as a string +url+ href, to self.
|
@@ -4046,18 +4499,18 @@ class Nokogiri::XML::Node
|
|
4046
4499
|
# now show up in #attributes, but when this node is serialized to XML an
|
4047
4500
|
# "xmlns" attribute will appear. See also #namespace and #namespace=
|
4048
4501
|
#
|
4049
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4502
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#503
|
4050
4503
|
def default_namespace=(url); end
|
4051
4504
|
|
4052
4505
|
# Remove the attribute named +name+
|
4053
4506
|
#
|
4054
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4507
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#718
|
4055
4508
|
def delete(name); end
|
4056
4509
|
|
4057
4510
|
# Fetch the Nokogiri::HTML4::ElementDescription for this node. Returns
|
4058
4511
|
# nil on XML documents and on unknown tags.
|
4059
4512
|
#
|
4060
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4513
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1251
|
4061
4514
|
def description; end
|
4062
4515
|
|
4063
4516
|
# Do xinclude substitution on the subtree below node. If given a block, a
|
@@ -4066,7 +4519,7 @@ class Nokogiri::XML::Node
|
|
4066
4519
|
#
|
4067
4520
|
# @yield [options]
|
4068
4521
|
#
|
4069
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4522
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#530
|
4070
4523
|
def do_xinclude(options = T.unsafe(nil)); end
|
4071
4524
|
|
4072
4525
|
def document; end
|
@@ -4075,28 +4528,42 @@ class Nokogiri::XML::Node
|
|
4075
4528
|
#
|
4076
4529
|
# @return [Boolean]
|
4077
4530
|
#
|
4078
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4531
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1229
|
4079
4532
|
def document?; end
|
4080
4533
|
|
4081
|
-
|
4534
|
+
# :call-seq:
|
4535
|
+
# dup → Nokogiri::XML::Node
|
4536
|
+
# dup(level) → Nokogiri::XML::Node
|
4537
|
+
# dup(level, new_parent_doc) → Nokogiri::XML::Node
|
4538
|
+
#
|
4539
|
+
# Duplicate this node.
|
4540
|
+
#
|
4541
|
+
# [Parameters]
|
4542
|
+
# - +level+ (optional Integer). 0 is a shallow copy, 1 (the default) is a deep copy.
|
4543
|
+
# - +new_parent_doc+ (optional Nokogiri::XML::Document)
|
4544
|
+
# The new node's parent Document. Defaults to the the Document of the current node.
|
4545
|
+
# [Returns] The new Nokogiri::XML::Node
|
4546
|
+
#
|
4547
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#144
|
4548
|
+
def dup(level = T.unsafe(nil), new_parent_doc = T.unsafe(nil)); end
|
4082
4549
|
|
4083
4550
|
# Iterate over each attribute name and value pair for this Node.
|
4084
4551
|
#
|
4085
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4552
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#710
|
4086
4553
|
def each; end
|
4087
4554
|
|
4088
4555
|
# Returns true if this is an Element node
|
4089
4556
|
#
|
4090
4557
|
# @return [Boolean]
|
4091
4558
|
#
|
4092
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4559
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1265
|
4093
4560
|
def elem?; end
|
4094
4561
|
|
4095
4562
|
# Returns true if this is an Element node
|
4096
4563
|
#
|
4097
4564
|
# @return [Boolean]
|
4098
4565
|
#
|
4099
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4566
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1265
|
4100
4567
|
def element?; end
|
4101
4568
|
|
4102
4569
|
def element_children; end
|
@@ -4115,7 +4582,7 @@ class Nokogiri::XML::Node
|
|
4115
4582
|
#
|
4116
4583
|
# @return [Boolean]
|
4117
4584
|
#
|
4118
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4585
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1244
|
4119
4586
|
def fragment?; end
|
4120
4587
|
|
4121
4588
|
# :call-seq: [](name) → (String, nil)
|
@@ -4148,7 +4615,7 @@ class Nokogiri::XML::Node
|
|
4148
4615
|
# doc.at_css("child").attribute_with_ns("size", "http://example.com/widths").value
|
4149
4616
|
# # => "broad"
|
4150
4617
|
#
|
4151
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4618
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#587
|
4152
4619
|
def get_attribute(name); end
|
4153
4620
|
|
4154
4621
|
def has_attribute?(_arg0); end
|
@@ -4157,7 +4624,7 @@ class Nokogiri::XML::Node
|
|
4157
4624
|
#
|
4158
4625
|
# @return [Boolean]
|
4159
4626
|
#
|
4160
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4627
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1224
|
4161
4628
|
def html?; end
|
4162
4629
|
|
4163
4630
|
# Get the inner_html for this node's Node#children
|
@@ -4180,7 +4647,7 @@ class Nokogiri::XML::Node
|
|
4180
4647
|
#
|
4181
4648
|
# Also see related method +children=+
|
4182
4649
|
#
|
4183
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4650
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#374
|
4184
4651
|
def inner_html=(node_or_tags); end
|
4185
4652
|
|
4186
4653
|
# :section:
|
@@ -4191,7 +4658,7 @@ class Nokogiri::XML::Node
|
|
4191
4658
|
|
4192
4659
|
# Get the attribute names for this Node.
|
4193
4660
|
#
|
4194
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4661
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#704
|
4195
4662
|
def keys; end
|
4196
4663
|
|
4197
4664
|
# :call-seq:
|
@@ -4245,7 +4712,7 @@ class Nokogiri::XML::Node
|
|
4245
4712
|
#
|
4246
4713
|
# Since v1.11.0
|
4247
4714
|
#
|
4248
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4715
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#967
|
4249
4716
|
def kwattr_add(attribute_name, keywords); end
|
4250
4717
|
|
4251
4718
|
# :call-seq:
|
@@ -4294,7 +4761,7 @@ class Nokogiri::XML::Node
|
|
4294
4761
|
#
|
4295
4762
|
# Since v1.11.0
|
4296
4763
|
#
|
4297
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4764
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1020
|
4298
4765
|
def kwattr_append(attribute_name, keywords); end
|
4299
4766
|
|
4300
4767
|
# :call-seq:
|
@@ -4333,7 +4800,7 @@ class Nokogiri::XML::Node
|
|
4333
4800
|
#
|
4334
4801
|
# Since v1.11.0
|
4335
4802
|
#
|
4336
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4803
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1063
|
4337
4804
|
def kwattr_remove(attribute_name, keywords); end
|
4338
4805
|
|
4339
4806
|
# :call-seq:
|
@@ -4362,7 +4829,7 @@ class Nokogiri::XML::Node
|
|
4362
4829
|
#
|
4363
4830
|
# Since v1.11.0
|
4364
4831
|
#
|
4365
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4832
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#913
|
4366
4833
|
def kwattr_values(attribute_name); end
|
4367
4834
|
|
4368
4835
|
def lang; end
|
@@ -4375,7 +4842,7 @@ class Nokogiri::XML::Node
|
|
4375
4842
|
#
|
4376
4843
|
# @return [Boolean]
|
4377
4844
|
#
|
4378
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4845
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1090
|
4379
4846
|
def matches?(selector); end
|
4380
4847
|
|
4381
4848
|
def name; end
|
@@ -4388,7 +4855,7 @@ class Nokogiri::XML::Node
|
|
4388
4855
|
# for this node. You probably want #default_namespace= instead, or perhaps
|
4389
4856
|
# #add_namespace_definition with a nil prefix argument.
|
4390
4857
|
#
|
4391
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4858
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#513
|
4392
4859
|
def namespace=(ns); end
|
4393
4860
|
|
4394
4861
|
def namespace_definitions; end
|
@@ -4431,7 +4898,7 @@ class Nokogiri::XML::Node
|
|
4431
4898
|
# # "xmlns"=>"http://example.com/root",
|
4432
4899
|
# # "xmlns:in_scope"=>"http://example.com/in_scope"}
|
4433
4900
|
#
|
4434
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4901
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1200
|
4435
4902
|
def namespaces; end
|
4436
4903
|
|
4437
4904
|
def native_content=(_arg0); end
|
@@ -4449,7 +4916,7 @@ class Nokogiri::XML::Node
|
|
4449
4916
|
#
|
4450
4917
|
# @raise [ArgumentError]
|
4451
4918
|
#
|
4452
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4919
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#324
|
4453
4920
|
def next=(node_or_tags); end
|
4454
4921
|
|
4455
4922
|
def next_element; end
|
@@ -4461,7 +4928,7 @@ class Nokogiri::XML::Node
|
|
4461
4928
|
|
4462
4929
|
# Set the parent Node for this Node
|
4463
4930
|
#
|
4464
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4931
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#493
|
4465
4932
|
def parent=(parent_node); end
|
4466
4933
|
|
4467
4934
|
# Parse +string_or_io+ as a document fragment within the context of
|
@@ -4470,7 +4937,7 @@ class Nokogiri::XML::Node
|
|
4470
4937
|
#
|
4471
4938
|
# @yield [options]
|
4472
4939
|
#
|
4473
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4940
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1105
|
4474
4941
|
def parse(string_or_io, options = T.unsafe(nil)); end
|
4475
4942
|
|
4476
4943
|
def path; end
|
@@ -4486,7 +4953,7 @@ class Nokogiri::XML::Node
|
|
4486
4953
|
#
|
4487
4954
|
# Also see related method +add_child+.
|
4488
4955
|
#
|
4489
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4956
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#204
|
4490
4957
|
def prepend_child(node_or_tags); end
|
4491
4958
|
|
4492
4959
|
def previous; end
|
@@ -4503,7 +4970,7 @@ class Nokogiri::XML::Node
|
|
4503
4970
|
#
|
4504
4971
|
# @raise [ArgumentError]
|
4505
4972
|
#
|
4506
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4973
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#307
|
4507
4974
|
def previous=(node_or_tags); end
|
4508
4975
|
|
4509
4976
|
def previous_element; end
|
@@ -4513,21 +4980,21 @@ class Nokogiri::XML::Node
|
|
4513
4980
|
#
|
4514
4981
|
# @return [Boolean]
|
4515
4982
|
#
|
4516
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4983
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1234
|
4517
4984
|
def processing_instruction?; end
|
4518
4985
|
|
4519
4986
|
# Is this a read only node?
|
4520
4987
|
#
|
4521
4988
|
# @return [Boolean]
|
4522
4989
|
#
|
4523
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4990
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1259
|
4524
4991
|
def read_only?; end
|
4525
4992
|
|
4526
4993
|
def remove; end
|
4527
4994
|
|
4528
4995
|
# Remove the attribute named +name+
|
4529
4996
|
#
|
4530
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
4997
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#718
|
4531
4998
|
def remove_attribute(name); end
|
4532
4999
|
|
4533
5000
|
# :call-seq:
|
@@ -4576,7 +5043,7 @@ class Nokogiri::XML::Node
|
|
4576
5043
|
# node # => <div class="section header float"></div>
|
4577
5044
|
# node.remove_class(["section", "float"]) # => <div class="header"></div>
|
4578
5045
|
#
|
4579
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5046
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#884
|
4580
5047
|
def remove_class(names = T.unsafe(nil)); end
|
4581
5048
|
|
4582
5049
|
# Replace this Node with +node_or_tags+.
|
@@ -4589,7 +5056,7 @@ class Nokogiri::XML::Node
|
|
4589
5056
|
#
|
4590
5057
|
# Also see related method +swap+.
|
4591
5058
|
#
|
4592
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5059
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#405
|
4593
5060
|
def replace(node_or_tags); end
|
4594
5061
|
|
4595
5062
|
# Serialize Node using +options+. Save options can also be set using a block.
|
@@ -4604,7 +5071,7 @@ class Nokogiri::XML::Node
|
|
4604
5071
|
# config.format.as_xml
|
4605
5072
|
# end
|
4606
5073
|
#
|
4607
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5074
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1364
|
4608
5075
|
def serialize(*args, &block); end
|
4609
5076
|
|
4610
5077
|
# :call-seq: []=(name, value) → value
|
@@ -4641,7 +5108,7 @@ class Nokogiri::XML::Node
|
|
4641
5108
|
# # " <child width:size=\"broad\"></child>\n" +
|
4642
5109
|
# # "</root>\n"
|
4643
5110
|
#
|
4644
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5111
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#625
|
4645
5112
|
def set_attribute(name, value); end
|
4646
5113
|
|
4647
5114
|
# Swap this Node for +node_or_tags+
|
@@ -4653,7 +5120,7 @@ class Nokogiri::XML::Node
|
|
4653
5120
|
#
|
4654
5121
|
# Also see related method +replace+.
|
4655
5122
|
#
|
4656
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5123
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#439
|
4657
5124
|
def swap(node_or_tags); end
|
4658
5125
|
|
4659
5126
|
def text; end
|
@@ -4662,7 +5129,7 @@ class Nokogiri::XML::Node
|
|
4662
5129
|
#
|
4663
5130
|
# @return [Boolean]
|
4664
5131
|
#
|
4665
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5132
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1239
|
4666
5133
|
def text?; end
|
4667
5134
|
|
4668
5135
|
# Serialize this Node to HTML
|
@@ -4672,13 +5139,13 @@ class Nokogiri::XML::Node
|
|
4672
5139
|
# See Node#write_to for a list of +options+. For formatted output,
|
4673
5140
|
# use Node#to_xhtml instead.
|
4674
5141
|
#
|
4675
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5142
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1391
|
4676
5143
|
def to_html(options = T.unsafe(nil)); end
|
4677
5144
|
|
4678
5145
|
# Turn this node in to a string. If the document is HTML, this method
|
4679
5146
|
# returns html. If the document is XML, this method returns XML.
|
4680
5147
|
#
|
4681
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5148
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1274
|
4682
5149
|
def to_s; end
|
4683
5150
|
|
4684
5151
|
def to_str; end
|
@@ -4688,7 +5155,7 @@ class Nokogiri::XML::Node
|
|
4688
5155
|
#
|
4689
5156
|
# See Node#write_to for a list of +options+
|
4690
5157
|
#
|
4691
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5158
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1412
|
4692
5159
|
def to_xhtml(options = T.unsafe(nil)); end
|
4693
5160
|
|
4694
5161
|
# Serialize this Node to XML using +options+
|
@@ -4696,7 +5163,7 @@ class Nokogiri::XML::Node
|
|
4696
5163
|
#
|
4697
5164
|
# See Node#write_to for a list of +options+
|
4698
5165
|
#
|
4699
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5166
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1401
|
4700
5167
|
def to_xml(options = T.unsafe(nil)); end
|
4701
5168
|
|
4702
5169
|
# Yields self and all children to +block+ recursively.
|
@@ -4704,7 +5171,7 @@ class Nokogiri::XML::Node
|
|
4704
5171
|
# @yield [_self]
|
4705
5172
|
# @yieldparam _self [Nokogiri::XML::Node] the object that the method was called on
|
4706
5173
|
#
|
4707
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5174
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1317
|
4708
5175
|
def traverse(&block); end
|
4709
5176
|
|
4710
5177
|
def type; end
|
@@ -4714,12 +5181,12 @@ class Nokogiri::XML::Node
|
|
4714
5181
|
#
|
4715
5182
|
# @return [Boolean]
|
4716
5183
|
#
|
4717
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5184
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#698
|
4718
5185
|
def value?(value); end
|
4719
5186
|
|
4720
5187
|
# Get the attribute values for this Node.
|
4721
5188
|
#
|
4722
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5189
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#692
|
4723
5190
|
def values; end
|
4724
5191
|
|
4725
5192
|
# :call-seq:
|
@@ -4766,14 +5233,14 @@ class Nokogiri::XML::Node
|
|
4766
5233
|
# # <div><a>asdf</a></div>
|
4767
5234
|
# # </body></html>
|
4768
5235
|
#
|
4769
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5236
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#259
|
4770
5237
|
def wrap(node_or_tags); end
|
4771
5238
|
|
4772
5239
|
# Write Node as HTML to +io+ with +options+
|
4773
5240
|
#
|
4774
5241
|
# See Node#write_to for a list of +options+
|
4775
5242
|
#
|
4776
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5243
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1469
|
4777
5244
|
def write_html_to(io, options = T.unsafe(nil)); end
|
4778
5245
|
|
4779
5246
|
# :call-seq:
|
@@ -4807,7 +5274,7 @@ class Nokogiri::XML::Node
|
|
4807
5274
|
#
|
4808
5275
|
# See Node#write_to for a list of +options+
|
4809
5276
|
#
|
4810
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5277
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1477
|
4811
5278
|
def write_xhtml_to(io, options = T.unsafe(nil)); end
|
4812
5279
|
|
4813
5280
|
# Write Node as XML to +io+ with +options+
|
@@ -4816,23 +5283,25 @@ class Nokogiri::XML::Node
|
|
4816
5283
|
#
|
4817
5284
|
# See Node#write_to for a list of options
|
4818
5285
|
#
|
4819
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5286
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1487
|
4820
5287
|
def write_xml_to(io, options = T.unsafe(nil)); end
|
4821
5288
|
|
4822
5289
|
# Returns true if this is an XML::Document node
|
4823
5290
|
#
|
4824
5291
|
# @return [Boolean]
|
4825
5292
|
#
|
4826
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5293
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1219
|
4827
5294
|
def xml?; end
|
4828
5295
|
|
4829
5296
|
protected
|
4830
5297
|
|
4831
5298
|
# @raise [ArgumentError]
|
4832
5299
|
#
|
4833
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5300
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1567
|
4834
5301
|
def coerce(data); end
|
4835
5302
|
|
5303
|
+
def initialize_copy_with_args(_arg0, _arg1, _arg2); end
|
5304
|
+
|
4836
5305
|
private
|
4837
5306
|
|
4838
5307
|
def add_child_node(_arg0); end
|
@@ -4843,7 +5312,7 @@ class Nokogiri::XML::Node
|
|
4843
5312
|
def add_next_sibling_node(_arg0); end
|
4844
5313
|
def add_previous_sibling_node(_arg0); end
|
4845
5314
|
|
4846
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5315
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1601
|
4847
5316
|
def add_sibling(next_or_previous, node_or_tags); end
|
4848
5317
|
|
4849
5318
|
def compare(_arg0); end
|
@@ -4852,10 +5321,10 @@ class Nokogiri::XML::Node
|
|
4852
5321
|
def html_standard_serialize(_arg0); end
|
4853
5322
|
def in_context(_arg0, _arg1); end
|
4854
5323
|
|
4855
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5324
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1633
|
4856
5325
|
def inspect_attributes; end
|
4857
5326
|
|
4858
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5327
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1589
|
4859
5328
|
def keywordify(keywords); end
|
4860
5329
|
|
4861
5330
|
def native_write_to(_arg0, _arg1, _arg2, _arg3); end
|
@@ -4865,10 +5334,10 @@ class Nokogiri::XML::Node
|
|
4865
5334
|
def set(_arg0, _arg1); end
|
4866
5335
|
def set_namespace(_arg0); end
|
4867
5336
|
|
4868
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5337
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1623
|
4869
5338
|
def to_format(save_option, options); end
|
4870
5339
|
|
4871
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5340
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1628
|
4872
5341
|
def write_format_to(save_option, io, options); end
|
4873
5342
|
|
4874
5343
|
class << self
|
@@ -4896,10 +5365,10 @@ Nokogiri::XML::Node::CDATA_SECTION_NODE = T.let(T.unsafe(nil), Integer)
|
|
4896
5365
|
# source://nokogiri//lib/nokogiri/xml/node.rb#77
|
4897
5366
|
Nokogiri::XML::Node::COMMENT_NODE = T.let(T.unsafe(nil), Integer)
|
4898
5367
|
|
4899
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5368
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1500
|
4900
5369
|
Nokogiri::XML::Node::DECONSTRUCT_KEYS = T.let(T.unsafe(nil), Array)
|
4901
5370
|
|
4902
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5371
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1501
|
4903
5372
|
Nokogiri::XML::Node::DECONSTRUCT_METHODS = T.let(T.unsafe(nil), Hash)
|
4904
5373
|
|
4905
5374
|
# DOCB document node type
|
@@ -4957,7 +5426,7 @@ Nokogiri::XML::Node::ENTITY_REF_NODE = T.let(T.unsafe(nil), Integer)
|
|
4957
5426
|
# source://nokogiri//lib/nokogiri/xml/node.rb#87
|
4958
5427
|
Nokogiri::XML::Node::HTML_DOCUMENT_NODE = T.let(T.unsafe(nil), Integer)
|
4959
5428
|
|
4960
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#
|
5429
|
+
# source://nokogiri//lib/nokogiri/xml/node.rb#1637
|
4961
5430
|
Nokogiri::XML::Node::IMPLIED_XPATH_CONTEXTS = T.let(T.unsafe(nil), Array)
|
4962
5431
|
|
4963
5432
|
# Namespace declaration type
|
@@ -5116,9 +5585,6 @@ Nokogiri::XML::Node::SaveOptions::NO_XHTML = T.let(T.unsafe(nil), Integer)
|
|
5116
5585
|
# source://nokogiri//lib/nokogiri/xml/node.rb#67
|
5117
5586
|
Nokogiri::XML::Node::TEXT_NODE = T.let(T.unsafe(nil), Integer)
|
5118
5587
|
|
5119
|
-
# source://nokogiri//lib/nokogiri/xml/node.rb#1545
|
5120
|
-
Nokogiri::XML::Node::USING_LIBXML_WITH_BROKEN_SERIALIZATION = T.let(T.unsafe(nil), FalseClass)
|
5121
|
-
|
5122
5588
|
# XInclude end type
|
5123
5589
|
#
|
5124
5590
|
# source://nokogiri//lib/nokogiri/xml/node.rb#101
|
@@ -5129,11 +5595,15 @@ Nokogiri::XML::Node::XINCLUDE_END = T.let(T.unsafe(nil), Integer)
|
|
5129
5595
|
# source://nokogiri//lib/nokogiri/xml/node.rb#99
|
5130
5596
|
Nokogiri::XML::Node::XINCLUDE_START = T.let(T.unsafe(nil), Integer)
|
5131
5597
|
|
5132
|
-
# A NodeSet contains a list of Nokogiri::XML::Node objects.
|
5133
|
-
# a NodeSet is return as a result of searching a Document via
|
5134
|
-
# Nokogiri::XML::Searchable#css or Nokogiri::XML::Searchable#xpath
|
5598
|
+
# A NodeSet is an Enumerable that contains a list of Nokogiri::XML::Node objects.
|
5135
5599
|
#
|
5136
|
-
#
|
5600
|
+
# Typically a NodeSet is returned as a result of searching a Document via
|
5601
|
+
# Nokogiri::XML::Searchable#css or Nokogiri::XML::Searchable#xpath.
|
5602
|
+
#
|
5603
|
+
# Note that the `#dup` and `#clone` methods perform shallow copies; these methods do not copy
|
5604
|
+
# the Nodes contained in the NodeSet (similar to how Array and other Enumerable classes work).
|
5605
|
+
#
|
5606
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#14
|
5137
5607
|
class Nokogiri::XML::NodeSet
|
5138
5608
|
include ::Nokogiri::XML::Searchable
|
5139
5609
|
include ::Enumerable
|
@@ -5144,7 +5614,7 @@ class Nokogiri::XML::NodeSet
|
|
5144
5614
|
# @yield [_self]
|
5145
5615
|
# @yieldparam _self [Nokogiri::XML::NodeSet] the object that the method was called on
|
5146
5616
|
#
|
5147
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5617
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#22
|
5148
5618
|
def initialize(document, list = T.unsafe(nil)); end
|
5149
5619
|
|
5150
5620
|
# call-seq: search *paths, [namespace-bindings, xpath-variable-bindings, custom-handler-class]
|
@@ -5158,7 +5628,7 @@ class Nokogiri::XML::NodeSet
|
|
5158
5628
|
#
|
5159
5629
|
# node_set.at(3) # same as node_set[3]
|
5160
5630
|
#
|
5161
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5631
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#121
|
5162
5632
|
def %(*args); end
|
5163
5633
|
|
5164
5634
|
def &(_arg0); end
|
@@ -5170,7 +5640,7 @@ class Nokogiri::XML::NodeSet
|
|
5170
5640
|
# of elements and if each element is equal to the corresponding
|
5171
5641
|
# element in the other NodeSet
|
5172
5642
|
#
|
5173
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5643
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#395
|
5174
5644
|
def ==(other); end
|
5175
5645
|
|
5176
5646
|
def [](*_arg0); end
|
@@ -5180,12 +5650,12 @@ class Nokogiri::XML::NodeSet
|
|
5180
5650
|
#
|
5181
5651
|
# See Nokogiri::XML::Node#add_class for more information.
|
5182
5652
|
#
|
5183
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5653
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#141
|
5184
5654
|
def add_class(name); end
|
5185
5655
|
|
5186
5656
|
# Insert +datum+ after the last Node in this NodeSet
|
5187
5657
|
#
|
5188
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5658
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#71
|
5189
5659
|
def after(datum); end
|
5190
5660
|
|
5191
5661
|
# Append the class attribute +name+ to all Node objects in the
|
@@ -5193,7 +5663,7 @@ class Nokogiri::XML::NodeSet
|
|
5193
5663
|
#
|
5194
5664
|
# See Nokogiri::XML::Node#append_class for more information.
|
5195
5665
|
#
|
5196
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5666
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#153
|
5197
5667
|
def append_class(name); end
|
5198
5668
|
|
5199
5669
|
# call-seq: search *paths, [namespace-bindings, xpath-variable-bindings, custom-handler-class]
|
@@ -5207,7 +5677,7 @@ class Nokogiri::XML::NodeSet
|
|
5207
5677
|
#
|
5208
5678
|
# node_set.at(3) # same as node_set[3]
|
5209
5679
|
#
|
5210
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5680
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#121
|
5211
5681
|
def at(*args); end
|
5212
5682
|
|
5213
5683
|
# Set attributes on each Node in the NodeSet, or get an
|
@@ -5242,7 +5712,7 @@ class Nokogiri::XML::NodeSet
|
|
5242
5712
|
#
|
5243
5713
|
# node_set.attr("class") { |node| node.name }
|
5244
5714
|
#
|
5245
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5715
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#205
|
5246
5716
|
def attr(key, value = T.unsafe(nil), &block); end
|
5247
5717
|
|
5248
5718
|
# Set attributes on each Node in the NodeSet, or get an
|
@@ -5277,22 +5747,20 @@ class Nokogiri::XML::NodeSet
|
|
5277
5747
|
#
|
5278
5748
|
# node_set.attr("class") { |node| node.name }
|
5279
5749
|
#
|
5280
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5750
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#205
|
5281
5751
|
def attribute(key, value = T.unsafe(nil), &block); end
|
5282
5752
|
|
5283
5753
|
# Insert +datum+ before the first Node in this NodeSet
|
5284
5754
|
#
|
5285
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5755
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#65
|
5286
5756
|
def before(datum); end
|
5287
5757
|
|
5288
5758
|
# Returns a new NodeSet containing all the children of all the nodes in
|
5289
5759
|
# the NodeSet
|
5290
5760
|
#
|
5291
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5761
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#408
|
5292
5762
|
def children; end
|
5293
5763
|
|
5294
|
-
def clone; end
|
5295
|
-
|
5296
5764
|
# call-seq: css *rules, [namespace-bindings, custom-pseudo-class]
|
5297
5765
|
#
|
5298
5766
|
# Search this node set for CSS +rules+. +rules+ must be one or more CSS
|
@@ -5300,7 +5768,7 @@ class Nokogiri::XML::NodeSet
|
|
5300
5768
|
#
|
5301
5769
|
# For more information see Nokogiri::XML::Searchable#css
|
5302
5770
|
#
|
5303
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5771
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#85
|
5304
5772
|
def css(*args); end
|
5305
5773
|
|
5306
5774
|
# :call-seq: deconstruct() → Array
|
@@ -5309,55 +5777,53 @@ class Nokogiri::XML::NodeSet
|
|
5309
5777
|
#
|
5310
5778
|
# Since v1.14.0
|
5311
5779
|
#
|
5312
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5780
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#442
|
5313
5781
|
def deconstruct; end
|
5314
5782
|
|
5315
5783
|
def delete(_arg0); end
|
5316
5784
|
|
5317
5785
|
# The Document this NodeSet is associated with
|
5318
5786
|
#
|
5319
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5787
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#19
|
5320
5788
|
def document; end
|
5321
5789
|
|
5322
5790
|
# The Document this NodeSet is associated with
|
5323
5791
|
#
|
5324
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5792
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#19
|
5325
5793
|
def document=(_arg0); end
|
5326
5794
|
|
5327
|
-
def dup; end
|
5328
|
-
|
5329
5795
|
# Iterate over each node, yielding to +block+
|
5330
5796
|
#
|
5331
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5797
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#233
|
5332
5798
|
def each; end
|
5333
5799
|
|
5334
5800
|
# Is this NodeSet empty?
|
5335
5801
|
#
|
5336
5802
|
# @return [Boolean]
|
5337
5803
|
#
|
5338
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5804
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#47
|
5339
5805
|
def empty?; end
|
5340
5806
|
|
5341
5807
|
# Filter this list for nodes that match +expr+
|
5342
5808
|
#
|
5343
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5809
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#132
|
5344
5810
|
def filter(expr); end
|
5345
5811
|
|
5346
5812
|
# Get the first element of the NodeSet.
|
5347
5813
|
#
|
5348
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5814
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#31
|
5349
5815
|
def first(n = T.unsafe(nil)); end
|
5350
5816
|
|
5351
5817
|
def include?(_arg0); end
|
5352
5818
|
|
5353
5819
|
# Returns the index of the first node in self that is == to +node+ or meets the given block. Returns nil if no match is found.
|
5354
5820
|
#
|
5355
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5821
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#53
|
5356
5822
|
def index(node = T.unsafe(nil)); end
|
5357
5823
|
|
5358
5824
|
# Get the inner html of all contained Node objects
|
5359
5825
|
#
|
5360
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5826
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#262
|
5361
5827
|
def inner_html(*args); end
|
5362
5828
|
|
5363
5829
|
# Get the inner text of all contained Node objects
|
@@ -5373,17 +5839,17 @@ class Nokogiri::XML::NodeSet
|
|
5373
5839
|
#
|
5374
5840
|
# See Nokogiri::XML::Node#content for more information.
|
5375
5841
|
#
|
5376
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5842
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#255
|
5377
5843
|
def inner_text; end
|
5378
5844
|
|
5379
|
-
# Return a nicely
|
5845
|
+
# Return a nicely formatted string representation
|
5380
5846
|
#
|
5381
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5847
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#429
|
5382
5848
|
def inspect; end
|
5383
5849
|
|
5384
5850
|
# Get the last element of the NodeSet.
|
5385
5851
|
#
|
5386
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5852
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#41
|
5387
5853
|
def last; end
|
5388
5854
|
|
5389
5855
|
def length; end
|
@@ -5391,7 +5857,7 @@ class Nokogiri::XML::NodeSet
|
|
5391
5857
|
# Removes the last element from set and returns it, or +nil+ if
|
5392
5858
|
# the set is empty
|
5393
5859
|
#
|
5394
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5860
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#376
|
5395
5861
|
def pop; end
|
5396
5862
|
|
5397
5863
|
def push(_arg0); end
|
@@ -5399,12 +5865,12 @@ class Nokogiri::XML::NodeSet
|
|
5399
5865
|
|
5400
5866
|
# Remove the attributed named +name+ from all Node objects in the NodeSet
|
5401
5867
|
#
|
5402
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5868
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#225
|
5403
5869
|
def remove_attr(name); end
|
5404
5870
|
|
5405
5871
|
# Remove the attributed named +name+ from all Node objects in the NodeSet
|
5406
5872
|
#
|
5407
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5873
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#225
|
5408
5874
|
def remove_attribute(name); end
|
5409
5875
|
|
5410
5876
|
# Remove the class attribute +name+ from all Node objects in the
|
@@ -5412,13 +5878,13 @@ class Nokogiri::XML::NodeSet
|
|
5412
5878
|
#
|
5413
5879
|
# See Nokogiri::XML::Node#remove_class for more information.
|
5414
5880
|
#
|
5415
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5881
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#165
|
5416
5882
|
def remove_class(name = T.unsafe(nil)); end
|
5417
5883
|
|
5418
5884
|
# Returns a new NodeSet containing all the nodes in the NodeSet
|
5419
5885
|
# in reverse order
|
5420
5886
|
#
|
5421
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5887
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#419
|
5422
5888
|
def reverse; end
|
5423
5889
|
|
5424
5890
|
# Set attributes on each Node in the NodeSet, or get an
|
@@ -5453,13 +5919,13 @@ class Nokogiri::XML::NodeSet
|
|
5453
5919
|
#
|
5454
5920
|
# node_set.attr("class") { |node| node.name }
|
5455
5921
|
#
|
5456
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5922
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#205
|
5457
5923
|
def set(key, value = T.unsafe(nil), &block); end
|
5458
5924
|
|
5459
5925
|
# Returns the first element of the NodeSet and removes it. Returns
|
5460
5926
|
# +nil+ if the set is empty.
|
5461
5927
|
#
|
5462
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5928
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#385
|
5463
5929
|
def shift; end
|
5464
5930
|
|
5465
5931
|
def size; end
|
@@ -5478,7 +5944,7 @@ class Nokogiri::XML::NodeSet
|
|
5478
5944
|
#
|
5479
5945
|
# See Nokogiri::XML::Node#content for more information.
|
5480
5946
|
#
|
5481
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5947
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#255
|
5482
5948
|
def text; end
|
5483
5949
|
|
5484
5950
|
def to_a; end
|
@@ -5486,22 +5952,22 @@ class Nokogiri::XML::NodeSet
|
|
5486
5952
|
|
5487
5953
|
# Convert this NodeSet to HTML
|
5488
5954
|
#
|
5489
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5955
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#343
|
5490
5956
|
def to_html(*args); end
|
5491
5957
|
|
5492
5958
|
# Convert this NodeSet to a string.
|
5493
5959
|
#
|
5494
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5960
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#337
|
5495
5961
|
def to_s; end
|
5496
5962
|
|
5497
5963
|
# Convert this NodeSet to XHTML
|
5498
5964
|
#
|
5499
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5965
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#360
|
5500
5966
|
def to_xhtml(*args); end
|
5501
5967
|
|
5502
5968
|
# Convert this NodeSet to XML
|
5503
5969
|
#
|
5504
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
5970
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#366
|
5505
5971
|
def to_xml(*args); end
|
5506
5972
|
|
5507
5973
|
def unlink; end
|
@@ -5570,7 +6036,7 @@ class Nokogiri::XML::NodeSet
|
|
5570
6036
|
# # <div><a>d</a></div>
|
5571
6037
|
# # </body></html>
|
5572
6038
|
#
|
5573
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
6039
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#330
|
5574
6040
|
def wrap(node_or_tags); end
|
5575
6041
|
|
5576
6042
|
# call-seq: xpath *paths, [namespace-bindings, variable-bindings, custom-handler-class]
|
@@ -5580,13 +6046,17 @@ class Nokogiri::XML::NodeSet
|
|
5580
6046
|
#
|
5581
6047
|
# For more information see Nokogiri::XML::Searchable#xpath
|
5582
6048
|
#
|
5583
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
6049
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#101
|
5584
6050
|
def xpath(*args); end
|
5585
6051
|
|
5586
6052
|
def |(_arg0); end
|
6053
|
+
|
6054
|
+
private
|
6055
|
+
|
6056
|
+
def initialize_copy(_arg0); end
|
5587
6057
|
end
|
5588
6058
|
|
5589
|
-
# source://nokogiri//lib/nokogiri/xml/node_set.rb#
|
6059
|
+
# source://nokogiri//lib/nokogiri/xml/node_set.rb#446
|
5590
6060
|
Nokogiri::XML::NodeSet::IMPLIED_XPATH_CONTEXTS = T.let(T.unsafe(nil), Array)
|
5591
6061
|
|
5592
6062
|
# Struct representing an {XML Schema Notation}[https://www.w3.org/TR/xml/#Notations]
|
@@ -5611,7 +6081,7 @@ module Nokogiri::XML::PP::Node
|
|
5611
6081
|
# source://nokogiri//lib/nokogiri/xml/pp/node.rb#10
|
5612
6082
|
def inspect; end
|
5613
6083
|
|
5614
|
-
# source://nokogiri//lib/nokogiri/xml/pp/node.rb#
|
6084
|
+
# source://nokogiri//lib/nokogiri/xml/pp/node.rb#32
|
5615
6085
|
def pretty_print(pp); end
|
5616
6086
|
end
|
5617
6087
|
|
@@ -5997,7 +6467,7 @@ Nokogiri::XML::ParseOptions::DTDVALID = T.let(T.unsafe(nil), Integer)
|
|
5997
6467
|
|
5998
6468
|
# Relax any hardcoded limit from the parser. Off by default.
|
5999
6469
|
#
|
6000
|
-
# ⚠
|
6470
|
+
# ⚠ <b>It is UNSAFE to set this option</b> when parsing untrusted documents.
|
6001
6471
|
#
|
6002
6472
|
# source://nokogiri//lib/nokogiri/xml/parse_options.rb#144
|
6003
6473
|
Nokogiri::XML::ParseOptions::HUGE = T.let(T.unsafe(nil), Integer)
|
@@ -6102,41 +6572,42 @@ class Nokogiri::XML::ProcessingInstruction < ::Nokogiri::XML::Node
|
|
6102
6572
|
end
|
6103
6573
|
end
|
6104
6574
|
|
6105
|
-
#
|
6106
|
-
#
|
6575
|
+
# The Reader parser allows you to effectively pull parse an \XML document. Once instantiated,
|
6576
|
+
# call Nokogiri::XML::Reader#each to iterate over each node.
|
6577
|
+
#
|
6578
|
+
# Nokogiri::XML::Reader parses an \XML document similar to the way a cursor would move. The
|
6579
|
+
# Reader is given an \XML document, and yields nodes to an each block.
|
6107
6580
|
#
|
6108
|
-
# The Reader parser might be good for when you need the speed and low memory usage of
|
6109
|
-
# parser, but do not want to write a Document handler.
|
6581
|
+
# The Reader parser might be good for when you need the speed and low memory usage of a \SAX
|
6582
|
+
# parser, but do not want to write a SAX::Document handler.
|
6110
6583
|
#
|
6111
6584
|
# Here is an example of usage:
|
6112
6585
|
#
|
6113
|
-
# reader = Nokogiri::XML::Reader
|
6586
|
+
# reader = Nokogiri::XML::Reader.new <<~XML
|
6114
6587
|
# <x xmlns:tenderlove='http://tenderlovemaking.com/'>
|
6115
6588
|
# <tenderlove:foo awesome='true'>snuggles!</tenderlove:foo>
|
6116
6589
|
# </x>
|
6117
|
-
#
|
6590
|
+
# XML
|
6118
6591
|
#
|
6119
6592
|
# reader.each do |node|
|
6120
|
-
#
|
6121
6593
|
# # node is an instance of Nokogiri::XML::Reader
|
6122
6594
|
# puts node.name
|
6123
|
-
#
|
6124
6595
|
# end
|
6125
6596
|
#
|
6126
6597
|
# ⚠ Nokogiri::XML::Reader#each can only be called once! Once the cursor moves through the entire
|
6127
6598
|
# document, you must parse the document again. It may be better to capture all information you
|
6128
6599
|
# need during a single iteration.
|
6129
6600
|
#
|
6130
|
-
# ⚠ libxml2 does not support error recovery in the Reader parser. The
|
6601
|
+
# ⚠ libxml2 does not support error recovery in the Reader parser. The +RECOVER+ ParseOption is
|
6131
6602
|
# ignored. If a syntax error is encountered during parsing, an exception will be raised.
|
6132
6603
|
#
|
6133
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6604
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#34
|
6134
6605
|
class Nokogiri::XML::Reader
|
6135
6606
|
include ::Enumerable
|
6136
6607
|
|
6137
6608
|
# @return [Reader] a new instance of Reader
|
6138
6609
|
#
|
6139
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6610
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#114
|
6140
6611
|
def initialize(source, url = T.unsafe(nil), encoding = T.unsafe(nil)); end
|
6141
6612
|
|
6142
6613
|
def attribute(_arg0); end
|
@@ -6151,7 +6622,7 @@ class Nokogiri::XML::Reader
|
|
6151
6622
|
# [Returns]
|
6152
6623
|
# (Hash<String, String>) Attribute names and values, and namespace prefixes and hrefs.
|
6153
6624
|
#
|
6154
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6625
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#126
|
6155
6626
|
def attributes; end
|
6156
6627
|
|
6157
6628
|
def attributes?; end
|
@@ -6161,7 +6632,7 @@ class Nokogiri::XML::Reader
|
|
6161
6632
|
|
6162
6633
|
# Move the cursor through the document yielding the cursor to the block
|
6163
6634
|
#
|
6164
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6635
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#132
|
6165
6636
|
def each; end
|
6166
6637
|
|
6167
6638
|
def empty_element?; end
|
@@ -6169,12 +6640,12 @@ class Nokogiri::XML::Reader
|
|
6169
6640
|
|
6170
6641
|
# A list of errors encountered while parsing
|
6171
6642
|
#
|
6172
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6643
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#74
|
6173
6644
|
def errors; end
|
6174
6645
|
|
6175
6646
|
# A list of errors encountered while parsing
|
6176
6647
|
#
|
6177
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6648
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#74
|
6178
6649
|
def errors=(_arg0); end
|
6179
6650
|
|
6180
6651
|
def inner_xml; end
|
@@ -6189,9 +6660,9 @@ class Nokogiri::XML::Reader
|
|
6189
6660
|
def read; end
|
6190
6661
|
def self_closing?; end
|
6191
6662
|
|
6192
|
-
# The XML source
|
6663
|
+
# The \XML source
|
6193
6664
|
#
|
6194
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6665
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#77
|
6195
6666
|
def source; end
|
6196
6667
|
|
6197
6668
|
def state; end
|
@@ -6202,119 +6673,146 @@ class Nokogiri::XML::Reader
|
|
6202
6673
|
class << self
|
6203
6674
|
def from_io(*_arg0); end
|
6204
6675
|
def from_memory(*_arg0); end
|
6676
|
+
|
6677
|
+
# :call-seq:
|
6678
|
+
# Reader.new(input) { |options| ... } → Reader
|
6679
|
+
#
|
6680
|
+
# Create a new Reader to parse an \XML document.
|
6681
|
+
#
|
6682
|
+
# [Required Parameters]
|
6683
|
+
# - +input+ (String | IO): The \XML document to parse.
|
6684
|
+
#
|
6685
|
+
# [Optional Parameters]
|
6686
|
+
# - +url:+ (String) The base URL of the document.
|
6687
|
+
# - +options:+ (Integer | ParseOptions) Options to control the parser behavior.
|
6688
|
+
# Defaults to +ParseOptions::STRICT+.
|
6689
|
+
#
|
6690
|
+
# [Yields]
|
6691
|
+
# If present, the block will be passed a Nokogiri::XML::ParseOptions object to modify before
|
6692
|
+
# the fragment is parsed. See Nokogiri::XML::ParseOptions for more information.
|
6693
|
+
#
|
6694
|
+
# @yield [options]
|
6695
|
+
#
|
6696
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#99
|
6697
|
+
def new(string_or_io, url_ = T.unsafe(nil), encoding_ = T.unsafe(nil), options_ = T.unsafe(nil), url: T.unsafe(nil), encoding: T.unsafe(nil), options: T.unsafe(nil)); end
|
6205
6698
|
end
|
6206
6699
|
end
|
6207
6700
|
|
6208
6701
|
# Attribute node type
|
6209
6702
|
#
|
6210
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6703
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#41
|
6211
6704
|
Nokogiri::XML::Reader::TYPE_ATTRIBUTE = T.let(T.unsafe(nil), Integer)
|
6212
6705
|
|
6213
6706
|
# CDATA node type
|
6214
6707
|
#
|
6215
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6708
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#45
|
6216
6709
|
Nokogiri::XML::Reader::TYPE_CDATA = T.let(T.unsafe(nil), Integer)
|
6217
6710
|
|
6218
6711
|
# Comment node type
|
6219
6712
|
#
|
6220
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6713
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#53
|
6221
6714
|
Nokogiri::XML::Reader::TYPE_COMMENT = T.let(T.unsafe(nil), Integer)
|
6222
6715
|
|
6223
6716
|
# Document node type
|
6224
6717
|
#
|
6225
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6718
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#55
|
6226
6719
|
Nokogiri::XML::Reader::TYPE_DOCUMENT = T.let(T.unsafe(nil), Integer)
|
6227
6720
|
|
6228
6721
|
# Document Fragment node type
|
6229
6722
|
#
|
6230
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6723
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#59
|
6231
6724
|
Nokogiri::XML::Reader::TYPE_DOCUMENT_FRAGMENT = T.let(T.unsafe(nil), Integer)
|
6232
6725
|
|
6233
6726
|
# Document Type node type
|
6234
6727
|
#
|
6235
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6728
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#57
|
6236
6729
|
Nokogiri::XML::Reader::TYPE_DOCUMENT_TYPE = T.let(T.unsafe(nil), Integer)
|
6237
6730
|
|
6238
6731
|
# Element node type
|
6239
6732
|
#
|
6240
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6733
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#39
|
6241
6734
|
Nokogiri::XML::Reader::TYPE_ELEMENT = T.let(T.unsafe(nil), Integer)
|
6242
6735
|
|
6243
6736
|
# Element end node type
|
6244
6737
|
#
|
6245
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6738
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#67
|
6246
6739
|
Nokogiri::XML::Reader::TYPE_END_ELEMENT = T.let(T.unsafe(nil), Integer)
|
6247
6740
|
|
6248
6741
|
# Entity end node type
|
6249
6742
|
#
|
6250
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6743
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#69
|
6251
6744
|
Nokogiri::XML::Reader::TYPE_END_ENTITY = T.let(T.unsafe(nil), Integer)
|
6252
6745
|
|
6253
6746
|
# Entity node type
|
6254
6747
|
#
|
6255
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6748
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#49
|
6256
6749
|
Nokogiri::XML::Reader::TYPE_ENTITY = T.let(T.unsafe(nil), Integer)
|
6257
6750
|
|
6258
6751
|
# Entity Reference node type
|
6259
6752
|
#
|
6260
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6753
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#47
|
6261
6754
|
Nokogiri::XML::Reader::TYPE_ENTITY_REFERENCE = T.let(T.unsafe(nil), Integer)
|
6262
6755
|
|
6263
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6756
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#37
|
6264
6757
|
Nokogiri::XML::Reader::TYPE_NONE = T.let(T.unsafe(nil), Integer)
|
6265
6758
|
|
6266
6759
|
# Notation node type
|
6267
6760
|
#
|
6268
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6761
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#61
|
6269
6762
|
Nokogiri::XML::Reader::TYPE_NOTATION = T.let(T.unsafe(nil), Integer)
|
6270
6763
|
|
6271
6764
|
# PI node type
|
6272
6765
|
#
|
6273
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6766
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#51
|
6274
6767
|
Nokogiri::XML::Reader::TYPE_PROCESSING_INSTRUCTION = T.let(T.unsafe(nil), Integer)
|
6275
6768
|
|
6276
6769
|
# Significant Whitespace node type
|
6277
6770
|
#
|
6278
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6771
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#65
|
6279
6772
|
Nokogiri::XML::Reader::TYPE_SIGNIFICANT_WHITESPACE = T.let(T.unsafe(nil), Integer)
|
6280
6773
|
|
6281
6774
|
# Text node type
|
6282
6775
|
#
|
6283
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6776
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#43
|
6284
6777
|
Nokogiri::XML::Reader::TYPE_TEXT = T.let(T.unsafe(nil), Integer)
|
6285
6778
|
|
6286
6779
|
# Whitespace node type
|
6287
6780
|
#
|
6288
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6781
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#63
|
6289
6782
|
Nokogiri::XML::Reader::TYPE_WHITESPACE = T.let(T.unsafe(nil), Integer)
|
6290
6783
|
|
6291
|
-
# XML Declaration node type
|
6784
|
+
# \XML Declaration node type
|
6292
6785
|
#
|
6293
|
-
# source://nokogiri//lib/nokogiri/xml/reader.rb#
|
6786
|
+
# source://nokogiri//lib/nokogiri/xml/reader.rb#71
|
6294
6787
|
Nokogiri::XML::Reader::TYPE_XML_DECLARATION = T.let(T.unsafe(nil), Integer)
|
6295
6788
|
|
6296
|
-
# Nokogiri::XML::RelaxNG is used for validating XML against a
|
6297
|
-
# RelaxNG schema.
|
6789
|
+
# Nokogiri::XML::RelaxNG is used for validating \XML against a RELAX NG schema definition.
|
6298
6790
|
#
|
6299
|
-
#
|
6791
|
+
# 🛡 <b>Do not use this class for untrusted schema documents.</b> RELAX NG input is always
|
6792
|
+
# treated as *trusted*, meaning that the underlying parsing libraries <b>will access network
|
6793
|
+
# resources</b>. This is counter to Nokogiri's "untrusted by default" security policy, but is an
|
6794
|
+
# unfortunate limitation of the underlying libraries.
|
6300
6795
|
#
|
6301
|
-
#
|
6302
|
-
# that are returned and print them out:
|
6796
|
+
# *Example:* Determine whether an \XML document is valid.
|
6303
6797
|
#
|
6304
|
-
# schema
|
6305
|
-
# doc
|
6798
|
+
# schema = Nokogiri::XML::RelaxNG.new(File.read(RELAX_NG_FILE))
|
6799
|
+
# doc = Nokogiri::XML::Document.parse(File.read(XML_FILE))
|
6800
|
+
# schema.valid?(doc) # Boolean
|
6306
6801
|
#
|
6307
|
-
#
|
6308
|
-
#
|
6309
|
-
#
|
6802
|
+
# *Example:* Validate an \XML document against a \RelaxNG schema, and capture any errors that are found.
|
6803
|
+
#
|
6804
|
+
# schema = Nokogiri::XML::RelaxNG.new(File.open(RELAX_NG_FILE))
|
6805
|
+
# doc = Nokogiri::XML::Document.parse(File.open(XML_FILE))
|
6806
|
+
# errors = schema.validate(doc) # Array<SyntaxError>
|
6310
6807
|
#
|
6311
|
-
#
|
6808
|
+
# *Example:* Validate an \XML document using a Document containing a RELAX NG schema definition.
|
6312
6809
|
#
|
6313
|
-
#
|
6314
|
-
#
|
6315
|
-
#
|
6810
|
+
# schema_doc = Nokogiri::XML::Document.parse(File.read(RELAX_NG_FILE))
|
6811
|
+
# schema = Nokogiri::XML::RelaxNG.from_document(schema_doc)
|
6812
|
+
# doc = Nokogiri::XML::Document.parse(File.open(XML_FILE))
|
6813
|
+
# schema.valid?(doc) # Boolean
|
6316
6814
|
#
|
6317
|
-
# source://nokogiri//lib/nokogiri/xml/relax_ng.rb#
|
6815
|
+
# source://nokogiri//lib/nokogiri/xml/relax_ng.rb#59
|
6318
6816
|
class Nokogiri::XML::RelaxNG < ::Nokogiri::XML::Schema
|
6319
6817
|
private
|
6320
6818
|
|
@@ -6322,25 +6820,59 @@ class Nokogiri::XML::RelaxNG < ::Nokogiri::XML::Schema
|
|
6322
6820
|
|
6323
6821
|
class << self
|
6324
6822
|
def from_document(*_arg0); end
|
6325
|
-
|
6823
|
+
|
6824
|
+
# :call-seq:
|
6825
|
+
# new(input) → Nokogiri::XML::RelaxNG
|
6826
|
+
# new(input, options:) → Nokogiri::XML::RelaxNG
|
6827
|
+
#
|
6828
|
+
# Parse a RELAX NG schema definition from a String or IO to create a new Nokogiri::XML::RelaxNG.
|
6829
|
+
#
|
6830
|
+
# [Parameters]
|
6831
|
+
# - +input+ (String | IO) RELAX NG schema definition
|
6832
|
+
# - +options:+ (Nokogiri::XML::ParseOptions)
|
6833
|
+
# Defaults to Nokogiri::XML::ParseOptions::DEFAULT_SCHEMA ⚠ Unused
|
6834
|
+
#
|
6835
|
+
# [Returns] Nokogiri::XML::RelaxNG
|
6836
|
+
#
|
6837
|
+
# ⚠ +parse_options+ is currently unused by this method and is present only as a placeholder for
|
6838
|
+
# future functionality.
|
6839
|
+
#
|
6840
|
+
# Also see convenience method Nokogiri::XML::RelaxNG()
|
6841
|
+
#
|
6842
|
+
# source://nokogiri//lib/nokogiri/xml/relax_ng.rb#60
|
6843
|
+
def new(input, parse_options_ = T.unsafe(nil), options: T.unsafe(nil)); end
|
6844
|
+
|
6845
|
+
# :call-seq:
|
6846
|
+
# read_memory(input) → Nokogiri::XML::RelaxNG
|
6847
|
+
# read_memory(input, options:) → Nokogiri::XML::RelaxNG
|
6848
|
+
#
|
6849
|
+
# Convenience method for Nokogiri::XML::RelaxNG.new.
|
6850
|
+
#
|
6851
|
+
# source://nokogiri//lib/nokogiri/xml/relax_ng.rb#69
|
6852
|
+
def read_memory(*_arg0, **_arg1, &_arg2); end
|
6326
6853
|
end
|
6327
6854
|
end
|
6328
6855
|
|
6329
|
-
# SAX Parsers are event
|
6330
|
-
#
|
6331
|
-
#
|
6856
|
+
# SAX Parsers are event-driven parsers.
|
6857
|
+
#
|
6858
|
+
# Two SAX parsers for XML are available, a parser that reads from a string or IO object as it
|
6859
|
+
# feels necessary, and a parser that you explicitly feed XML in chunks. If you want to let
|
6860
|
+
# Nokogiri deal with reading your XML, use the Nokogiri::XML::SAX::Parser. If you want to have
|
6861
|
+
# fine grain control over the XML input, use the Nokogiri::XML::SAX::PushParser.
|
6862
|
+
#
|
6863
|
+
# If you want to do SAX style parsing of HTML, check out Nokogiri::HTML4::SAX.
|
6332
6864
|
#
|
6333
6865
|
# The basic way a SAX style parser works is by creating a parser, telling the parser about the
|
6334
6866
|
# events we're interested in, then giving the parser some XML to process. The parser will notify
|
6335
6867
|
# you when it encounters events you said you would like to know about.
|
6336
6868
|
#
|
6337
|
-
# To register for events,
|
6338
|
-
#
|
6869
|
+
# To register for events, subclass Nokogiri::XML::SAX::Document and implement the methods for
|
6870
|
+
# which you would like notification.
|
6339
6871
|
#
|
6340
6872
|
# For example, if I want to be notified when a document ends, and when an element starts, I
|
6341
6873
|
# would write a class like this:
|
6342
6874
|
#
|
6343
|
-
# class
|
6875
|
+
# class MyHandler < Nokogiri::XML::SAX::Document
|
6344
6876
|
# def end_document
|
6345
6877
|
# puts "the document has ended"
|
6346
6878
|
# end
|
@@ -6353,7 +6885,7 @@ end
|
|
6353
6885
|
# Then I would instantiate a SAX parser with this document, and feed the parser some XML
|
6354
6886
|
#
|
6355
6887
|
# # Create a new parser
|
6356
|
-
# parser = Nokogiri::XML::SAX::Parser.new(
|
6888
|
+
# parser = Nokogiri::XML::SAX::Parser.new(MyHandler.new)
|
6357
6889
|
#
|
6358
6890
|
# # Feed the parser some XML
|
6359
6891
|
# parser.parse(File.open(ARGV[0]))
|
@@ -6361,133 +6893,254 @@ end
|
|
6361
6893
|
# Now my document handler will be called when each node starts, and when then document ends. To
|
6362
6894
|
# see what kinds of events are available, take a look at Nokogiri::XML::SAX::Document.
|
6363
6895
|
#
|
6364
|
-
#
|
6365
|
-
# feels necessary, and a parser that lets you spoon feed it XML. If you want to let Nokogiri
|
6366
|
-
# deal with reading your XML, use the Nokogiri::XML::SAX::Parser. If you want to have fine grain
|
6367
|
-
# control over the XML input, use the Nokogiri::XML::SAX::PushParser.
|
6368
|
-
#
|
6369
|
-
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#45
|
6896
|
+
# source://nokogiri//lib/nokogiri/xml/sax.rb#46
|
6370
6897
|
module Nokogiri::XML::SAX; end
|
6371
6898
|
|
6372
|
-
#
|
6373
|
-
#
|
6374
|
-
#
|
6375
|
-
# are
|
6899
|
+
# :markup: markdown
|
6900
|
+
#
|
6901
|
+
# The SAX::Document class is used for registering types of events you are interested in
|
6902
|
+
# handling. All of the methods on this class are available as possible events while parsing an
|
6903
|
+
# \XML document. To register for any particular event, subclass this class and implement the
|
6904
|
+
# methods you are interested in knowing about.
|
6376
6905
|
#
|
6377
6906
|
# To only be notified about start and end element events, write a class like this:
|
6378
6907
|
#
|
6379
|
-
#
|
6380
|
-
#
|
6381
|
-
#
|
6382
|
-
#
|
6908
|
+
# class MyHandler < Nokogiri::XML::SAX::Document
|
6909
|
+
# def start_element name, attrs = []
|
6910
|
+
# puts "#{name} started!"
|
6911
|
+
# end
|
6383
6912
|
#
|
6384
|
-
#
|
6385
|
-
#
|
6913
|
+
# def end_element name
|
6914
|
+
# puts "#{name} ended"
|
6915
|
+
# end
|
6386
6916
|
# end
|
6387
|
-
# end
|
6388
6917
|
#
|
6389
|
-
# You can use this event handler for any SAX
|
6390
|
-
#
|
6918
|
+
# You can use this event handler for any SAX-style parser included with Nokogiri.
|
6919
|
+
#
|
6920
|
+
# See also:
|
6921
|
+
#
|
6922
|
+
# - Nokogiri::XML::SAX
|
6923
|
+
# - Nokogiri::HTML4::SAX
|
6924
|
+
#
|
6925
|
+
# ### Entity Handling
|
6926
|
+
#
|
6927
|
+
# ⚠ Entity handling is complicated in a SAX parser! Please read this section carefully if
|
6928
|
+
# you're not getting the behavior you expect.
|
6929
|
+
#
|
6930
|
+
# Entities will be reported to the user via callbacks to #characters, to #reference, or
|
6931
|
+
# possibly to both. The behavior is determined by a combination of _entity type_ and the value
|
6932
|
+
# of ParserContext#replace_entities. (Recall that the default value of
|
6933
|
+
# ParserContext#replace_entities is `false`.)
|
6934
|
+
#
|
6935
|
+
# ⚠ <b>It is UNSAFE to set ParserContext#replace_entities to `true`</b> when parsing untrusted
|
6936
|
+
# documents.
|
6391
6937
|
#
|
6392
|
-
#
|
6938
|
+
# 💡 For more information on entity types, see [Wikipedia's page on
|
6939
|
+
# DTDs](https://en.wikipedia.org/wiki/Document_type_definition#Entity_declarations).
|
6940
|
+
#
|
6941
|
+
# | Entity type | #characters | #reference |
|
6942
|
+
# |--------------------------------------|------------------------------------|-------------------------------------|
|
6943
|
+
# | Char ref (e.g., <tt>’</tt>) | always | never |
|
6944
|
+
# | Predefined (e.g., <tt>&</tt>) | always | never |
|
6945
|
+
# | Undeclared † | never | <tt>#replace_entities == false</tt> |
|
6946
|
+
# | Internal | always | <tt>#replace_entities == false</tt> |
|
6947
|
+
# | External † | <tt>#replace_entities == true</tt> | <tt>#replace_entities == false</tt> |
|
6948
|
+
#
|
6949
|
+
#
|
6950
|
+
#
|
6951
|
+
# † In the case where the replacement text for the entity is unknown (e.g., an undeclared entity
|
6952
|
+
# or an external entity that could not be resolved because of network issues), then the
|
6953
|
+
# replacement text will not be reported. If ParserContext#replace_entities is `true`, this
|
6954
|
+
# means the #characters callback will not be invoked. If ParserContext#replace_entities is
|
6955
|
+
# `false`, then the #reference callback will be invoked, but with `nil` for the `content`
|
6956
|
+
# argument.
|
6957
|
+
#
|
6958
|
+
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#65
|
6393
6959
|
class Nokogiri::XML::SAX::Document
|
6394
6960
|
# Called when cdata blocks are found
|
6395
|
-
#
|
6961
|
+
# [Parameters]
|
6962
|
+
# - +string+ contains the cdata content
|
6396
6963
|
#
|
6397
|
-
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#
|
6964
|
+
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#245
|
6398
6965
|
def cdata_block(string); end
|
6399
6966
|
|
6400
|
-
#
|
6401
|
-
#
|
6967
|
+
# Called when character data is parsed, and for parsed entities when
|
6968
|
+
# ParserContext#replace_entities is +true+.
|
6969
|
+
#
|
6970
|
+
# [Parameters]
|
6971
|
+
# - +string+ contains the character data or entity replacement text
|
6402
6972
|
#
|
6403
|
-
# +
|
6973
|
+
# ⚠ Please see Document@Entity+Handling for important information about how entities are handled.
|
6404
6974
|
#
|
6405
|
-
#
|
6975
|
+
# ⚠ This method might be called multiple times for a contiguous string of characters.
|
6976
|
+
#
|
6977
|
+
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#201
|
6406
6978
|
def characters(string); end
|
6407
6979
|
|
6408
6980
|
# Called when comments are encountered
|
6409
|
-
#
|
6981
|
+
# [Parameters]
|
6982
|
+
# - +string+ contains the comment data
|
6410
6983
|
#
|
6411
|
-
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#
|
6984
|
+
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#224
|
6412
6985
|
def comment(string); end
|
6413
6986
|
|
6414
|
-
# Called when document ends parsing
|
6987
|
+
# Called when document ends parsing.
|
6415
6988
|
#
|
6416
|
-
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#
|
6989
|
+
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#83
|
6417
6990
|
def end_document; end
|
6418
6991
|
|
6419
|
-
# Called at the end of an element
|
6420
|
-
#
|
6992
|
+
# Called at the end of an element.
|
6993
|
+
#
|
6994
|
+
# [Parameters]
|
6995
|
+
# - +name+ (String) the name of the element being closed
|
6421
6996
|
#
|
6422
|
-
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#
|
6997
|
+
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#122
|
6423
6998
|
def end_element(name); end
|
6424
6999
|
|
6425
|
-
# Called at the end of an element
|
6426
|
-
# +name+ is the element's name
|
6427
|
-
# +prefix+ is the namespace prefix associated with the element
|
6428
|
-
# +uri+ is the associated namespace URI
|
7000
|
+
# Called at the end of an element.
|
6429
7001
|
#
|
6430
|
-
#
|
7002
|
+
# [Parameters]
|
7003
|
+
# - +name+ (String) is the name of the element
|
7004
|
+
# - +prefix+ (String, nil) is the namespace prefix for the element
|
7005
|
+
# - +uri+ (String, nil) is the associated URI for the element's namespace
|
7006
|
+
#
|
7007
|
+
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#185
|
6431
7008
|
def end_element_namespace(name, prefix = T.unsafe(nil), uri = T.unsafe(nil)); end
|
6432
7009
|
|
6433
7010
|
# Called on document errors
|
6434
|
-
#
|
7011
|
+
# [Parameters]
|
7012
|
+
# - +string+ contains the error
|
6435
7013
|
#
|
6436
|
-
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#
|
7014
|
+
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#238
|
6437
7015
|
def error(string); end
|
6438
7016
|
|
6439
7017
|
# Called when processing instructions are found
|
6440
|
-
#
|
6441
|
-
# +
|
7018
|
+
# [Parameters]
|
7019
|
+
# - +name+ is the target of the instruction
|
7020
|
+
# - +content+ is the value of the instruction
|
6442
7021
|
#
|
6443
|
-
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#
|
7022
|
+
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#253
|
6444
7023
|
def processing_instruction(name, content); end
|
6445
7024
|
|
6446
|
-
# Called when
|
7025
|
+
# Called when a parsed entity is referenced and not replaced.
|
7026
|
+
#
|
7027
|
+
# [Parameters]
|
7028
|
+
# - +name+ (String) is the name of the entity
|
7029
|
+
# - +content+ (String, nil) is the replacement text for the entity, if known
|
7030
|
+
#
|
7031
|
+
# ⚠ Please see Document@Entity+Handling for important information about how entities are handled.
|
7032
|
+
#
|
7033
|
+
# ⚠ An internal entity may result in a call to both #characters and #reference.
|
7034
|
+
#
|
7035
|
+
# Since v1.17.0
|
7036
|
+
#
|
7037
|
+
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#217
|
7038
|
+
def reference(name, content); end
|
7039
|
+
|
7040
|
+
# Called when document starts parsing.
|
6447
7041
|
#
|
6448
|
-
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#
|
7042
|
+
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#78
|
6449
7043
|
def start_document; end
|
6450
7044
|
|
6451
|
-
# Called at the beginning of an element
|
6452
|
-
#
|
6453
|
-
#
|
7045
|
+
# Called at the beginning of an element.
|
7046
|
+
#
|
7047
|
+
# [Parameters]
|
7048
|
+
# - +name+ (String) the name of the element
|
7049
|
+
# - +attrs+ (Array<Array<String>>) an assoc list of namespace declarations and attributes, e.g.:
|
6454
7050
|
# [ ["xmlns:foo", "http://sample.net"], ["size", "large"] ]
|
6455
7051
|
#
|
6456
|
-
#
|
7052
|
+
# 💡If you're dealing with XML and need to handle namespaces, use the
|
7053
|
+
# #start_element_namespace method instead.
|
7054
|
+
#
|
7055
|
+
# Note that the element namespace and any attribute namespaces are not provided, and so any
|
7056
|
+
# namespaced elements or attributes will be returned as strings including the prefix:
|
7057
|
+
#
|
7058
|
+
# parser.parse(<<~XML)
|
7059
|
+
# <root xmlns:foo='http://foo.example.com/' xmlns='http://example.com/'>
|
7060
|
+
# <foo:bar foo:quux="xxx">hello world</foo:bar>
|
7061
|
+
# </root>
|
7062
|
+
# XML
|
7063
|
+
#
|
7064
|
+
# assert_pattern do
|
7065
|
+
# parser.document.start_elements => [
|
7066
|
+
# ["root", [["xmlns:foo", "http://foo.example.com/"], ["xmlns", "http://example.com/"]]],
|
7067
|
+
# ["foo:bar", [["foo:quux", "xxx"]]],
|
7068
|
+
# ]
|
7069
|
+
# end
|
7070
|
+
#
|
7071
|
+
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#113
|
6457
7072
|
def start_element(name, attrs = T.unsafe(nil)); end
|
6458
7073
|
|
6459
|
-
# Called at the beginning of an element
|
6460
|
-
# +name+ is the element name
|
6461
|
-
# +attrs+ is a list of attributes
|
6462
|
-
# +prefix+ is the namespace prefix for the element
|
6463
|
-
# +uri+ is the associated namespace URI
|
6464
|
-
# +ns+ is a hash of namespace prefix:urls associated with the element
|
7074
|
+
# Called at the beginning of an element.
|
6465
7075
|
#
|
6466
|
-
#
|
7076
|
+
# [Parameters]
|
7077
|
+
# - +name+ (String) is the name of the element
|
7078
|
+
# - +attrs+ (Array<Attribute>) is an array of structs with the following properties:
|
7079
|
+
# - +localname+ (String) the local name of the attribute
|
7080
|
+
# - +value+ (String) the value of the attribute
|
7081
|
+
# - +prefix+ (String, nil) the namespace prefix of the attribute
|
7082
|
+
# - +uri+ (String, nil) the namespace URI of the attribute
|
7083
|
+
# - +prefix+ (String, nil) is the namespace prefix for the element
|
7084
|
+
# - +uri+ (String, nil) is the associated URI for the element's namespace
|
7085
|
+
# - +ns+ (Array<Array<String, String>>) is an assoc list of namespace declarations on the element
|
7086
|
+
#
|
7087
|
+
# 💡If you're dealing with HTML or don't care about namespaces, try #start_element instead.
|
7088
|
+
#
|
7089
|
+
# [Example]
|
7090
|
+
# it "start_elements_namespace is called with namespaced attributes" do
|
7091
|
+
# parser.parse(<<~XML)
|
7092
|
+
# <root xmlns:foo='http://foo.example.com/'>
|
7093
|
+
# <foo:a foo:bar='hello' />
|
7094
|
+
# </root>
|
7095
|
+
# XML
|
7096
|
+
#
|
7097
|
+
# assert_pattern do
|
7098
|
+
# parser.document.start_elements_namespace => [
|
7099
|
+
# [
|
7100
|
+
# "root",
|
7101
|
+
# [],
|
7102
|
+
# nil, nil,
|
7103
|
+
# [["foo", "http://foo.example.com/"]], # namespace declarations
|
7104
|
+
# ], [
|
7105
|
+
# "a",
|
7106
|
+
# [Nokogiri::XML::SAX::Parser::Attribute(localname: "bar", prefix: "foo", uri: "http://foo.example.com/", value: "hello")], # prefixed attribute
|
7107
|
+
# "foo", "http://foo.example.com/", # prefix and uri for the "a" element
|
7108
|
+
# [],
|
7109
|
+
# ]
|
7110
|
+
# ]
|
7111
|
+
# end
|
7112
|
+
# end
|
7113
|
+
#
|
7114
|
+
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#166
|
6467
7115
|
def start_element_namespace(name, attrs = T.unsafe(nil), prefix = T.unsafe(nil), uri = T.unsafe(nil), ns = T.unsafe(nil)); end
|
6468
7116
|
|
6469
7117
|
# Called on document warnings
|
6470
|
-
#
|
7118
|
+
# [Parameters]
|
7119
|
+
# - +string+ contains the warning
|
6471
7120
|
#
|
6472
|
-
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#
|
7121
|
+
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#231
|
6473
7122
|
def warning(string); end
|
6474
7123
|
|
6475
|
-
# Called when an XML declaration is parsed
|
7124
|
+
# Called when an \XML declaration is parsed.
|
7125
|
+
#
|
7126
|
+
# [Parameters]
|
7127
|
+
# - +version+ (String) the version attribute
|
7128
|
+
# - +encoding+ (String, nil) the encoding of the document if present, else +nil+
|
7129
|
+
# - +standalone+ ("yes", "no", nil) the standalone attribute if present, else +nil+
|
6476
7130
|
#
|
6477
|
-
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#
|
7131
|
+
# source://nokogiri//lib/nokogiri/xml/sax/document.rb#73
|
6478
7132
|
def xmldecl(version, encoding, standalone); end
|
6479
7133
|
end
|
6480
7134
|
|
6481
|
-
# This parser is a SAX style parser that reads
|
6482
|
-
#
|
6483
|
-
#
|
6484
|
-
# the Nokogiri::XML::SAX::Document.
|
7135
|
+
# This parser is a SAX style parser that reads its input as it deems necessary. The parser
|
7136
|
+
# takes a Nokogiri::XML::SAX::Document, an optional encoding, then given an XML input, sends
|
7137
|
+
# messages to the Nokogiri::XML::SAX::Document.
|
6485
7138
|
#
|
6486
7139
|
# Here is an example of using this parser:
|
6487
7140
|
#
|
6488
7141
|
# # Create a subclass of Nokogiri::XML::SAX::Document and implement
|
6489
7142
|
# # the events we care about:
|
6490
|
-
# class
|
7143
|
+
# class MyHandler < Nokogiri::XML::SAX::Document
|
6491
7144
|
# def start_element name, attrs = []
|
6492
7145
|
# puts "starting: #{name}"
|
6493
7146
|
# end
|
@@ -6497,89 +7150,165 @@ end
|
|
6497
7150
|
# end
|
6498
7151
|
# end
|
6499
7152
|
#
|
6500
|
-
#
|
6501
|
-
# parser = Nokogiri::XML::SAX::Parser.new(MyDoc.new)
|
7153
|
+
# parser = Nokogiri::XML::SAX::Parser.new(MyHandler.new)
|
6502
7154
|
#
|
6503
|
-
# #
|
6504
|
-
#
|
7155
|
+
# # Hand an IO object to the parser, which will read the XML from the IO.
|
7156
|
+
# File.open(path_to_xml) do |f|
|
7157
|
+
# parser.parse(f)
|
7158
|
+
# end
|
7159
|
+
#
|
7160
|
+
# For more information about \SAX parsers, see Nokogiri::XML::SAX.
|
7161
|
+
#
|
7162
|
+
# Also see Nokogiri::XML::SAX::Document for the available events.
|
6505
7163
|
#
|
6506
|
-
# For
|
6507
|
-
# see Nokogiri::XML::SAX::Document for the available events.
|
7164
|
+
# For \HTML documents, use the subclass Nokogiri::HTML4::SAX::Parser.
|
6508
7165
|
#
|
6509
|
-
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#
|
7166
|
+
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#38
|
6510
7167
|
class Nokogiri::XML::SAX::Parser
|
6511
|
-
|
7168
|
+
include ::Nokogiri::ClassResolver
|
7169
|
+
|
7170
|
+
# :call-seq:
|
7171
|
+
# new ⇒ SAX::Parser
|
7172
|
+
# new(handler) ⇒ SAX::Parser
|
7173
|
+
# new(handler, encoding) ⇒ SAX::Parser
|
7174
|
+
#
|
7175
|
+
# Create a new Parser.
|
7176
|
+
#
|
7177
|
+
# [Parameters]
|
7178
|
+
# - +handler+ (optional Nokogiri::XML::SAX::Document) The document that will receive
|
7179
|
+
# events. Will create a new Nokogiri::XML::SAX::Document if not given, which is accessible
|
7180
|
+
# through the #document attribute.
|
7181
|
+
# - +encoding+ (optional Encoding, String, nil) An Encoding or encoding name to use when
|
7182
|
+
# parsing the input. (default +nil+ for auto-detection)
|
6512
7183
|
#
|
6513
7184
|
# @return [Parser] a new instance of Parser
|
6514
7185
|
#
|
6515
|
-
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#
|
7186
|
+
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#95
|
6516
7187
|
def initialize(doc = T.unsafe(nil), encoding = T.unsafe(nil)); end
|
6517
7188
|
|
6518
7189
|
# The Nokogiri::XML::SAX::Document where events will be sent.
|
6519
7190
|
#
|
6520
|
-
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#
|
7191
|
+
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#75
|
6521
7192
|
def document; end
|
6522
7193
|
|
6523
7194
|
# The Nokogiri::XML::SAX::Document where events will be sent.
|
6524
7195
|
#
|
6525
|
-
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#
|
7196
|
+
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#75
|
6526
7197
|
def document=(_arg0); end
|
6527
7198
|
|
6528
7199
|
# The encoding beings used for this document.
|
6529
7200
|
#
|
6530
|
-
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#
|
7201
|
+
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#78
|
6531
7202
|
def encoding; end
|
6532
7203
|
|
6533
7204
|
# The encoding beings used for this document.
|
6534
7205
|
#
|
6535
|
-
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#
|
7206
|
+
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#78
|
6536
7207
|
def encoding=(_arg0); end
|
6537
7208
|
|
6538
|
-
#
|
6539
|
-
#
|
7209
|
+
# :call-seq:
|
7210
|
+
# parse(input) { |parser_context| ... }
|
7211
|
+
#
|
7212
|
+
# Parse the input, sending events to the SAX::Document at #document.
|
7213
|
+
#
|
7214
|
+
# [Parameters]
|
7215
|
+
# - +input+ (String, IO) The input to parse.
|
7216
|
+
#
|
7217
|
+
# If +input+ quacks like a readable IO object, this method forwards to Parser.parse_io,
|
7218
|
+
# otherwise it forwards to Parser.parse_memory.
|
7219
|
+
#
|
7220
|
+
# [Yields]
|
7221
|
+
# If a block is given, the underlying ParserContext object will be yielded. This can be used
|
7222
|
+
# to set options on the parser context before parsing begins.
|
6540
7223
|
#
|
6541
|
-
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#
|
6542
|
-
def parse(
|
7224
|
+
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#119
|
7225
|
+
def parse(input, &block); end
|
6543
7226
|
|
6544
|
-
#
|
7227
|
+
# :call-seq:
|
7228
|
+
# parse_file(filename) { |parser_context| ... }
|
7229
|
+
# parse_file(filename, encoding) { |parser_context| ... }
|
7230
|
+
#
|
7231
|
+
# Parse a file.
|
7232
|
+
#
|
7233
|
+
# [Parameters]
|
7234
|
+
# - +filename+ (String) The path to the file to be parsed.
|
7235
|
+
# - +encoding+ (optional Encoding, String, nil) An Encoding or encoding name to use when
|
7236
|
+
# parsing the input, or +nil+ for auto-detection. (default #encoding)
|
7237
|
+
#
|
7238
|
+
# [Yields]
|
7239
|
+
# If a block is given, the underlying ParserContext object will be yielded. This can be used
|
7240
|
+
# to set options on the parser context before parsing begins.
|
6545
7241
|
#
|
6546
7242
|
# @raise [ArgumentError]
|
6547
7243
|
# @yield [ctx]
|
6548
7244
|
#
|
6549
|
-
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#
|
6550
|
-
def parse_file(filename); end
|
7245
|
+
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#187
|
7246
|
+
def parse_file(filename, encoding = T.unsafe(nil)); end
|
6551
7247
|
|
6552
|
-
#
|
7248
|
+
# :call-seq:
|
7249
|
+
# parse_io(io) { |parser_context| ... }
|
7250
|
+
# parse_io(io, encoding) { |parser_context| ... }
|
7251
|
+
#
|
7252
|
+
# Parse an input stream.
|
7253
|
+
#
|
7254
|
+
# [Parameters]
|
7255
|
+
# - +io+ (IO) The readable IO object from which to read input
|
7256
|
+
# - +encoding+ (optional Encoding, String, nil) An Encoding or encoding name to use when
|
7257
|
+
# parsing the input, or +nil+ for auto-detection. (default #encoding)
|
7258
|
+
#
|
7259
|
+
# [Yields]
|
7260
|
+
# If a block is given, the underlying ParserContext object will be yielded. This can be used
|
7261
|
+
# to set options on the parser context before parsing begins.
|
6553
7262
|
#
|
6554
7263
|
# @yield [ctx]
|
6555
7264
|
#
|
6556
|
-
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#
|
7265
|
+
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#143
|
6557
7266
|
def parse_io(io, encoding = T.unsafe(nil)); end
|
6558
7267
|
|
7268
|
+
# :call-seq:
|
7269
|
+
# parse_memory(input) { |parser_context| ... }
|
7270
|
+
# parse_memory(input, encoding) { |parser_context| ... }
|
7271
|
+
#
|
7272
|
+
# Parse an input string.
|
7273
|
+
#
|
7274
|
+
# [Parameters]
|
7275
|
+
# - +input+ (String) The input string to be parsed.
|
7276
|
+
# - +encoding+ (optional Encoding, String, nil) An Encoding or encoding name to use when
|
7277
|
+
# parsing the input, or +nil+ for auto-detection. (default #encoding)
|
7278
|
+
#
|
7279
|
+
# [Yields]
|
7280
|
+
# If a block is given, the underlying ParserContext object will be yielded. This can be used
|
7281
|
+
# to set options on the parser context before parsing begins.
|
7282
|
+
#
|
6559
7283
|
# @yield [ctx]
|
6560
7284
|
#
|
6561
|
-
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#
|
6562
|
-
def parse_memory(
|
7285
|
+
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#165
|
7286
|
+
def parse_memory(input, encoding = T.unsafe(nil)); end
|
6563
7287
|
|
6564
7288
|
private
|
6565
7289
|
|
6566
|
-
|
6567
|
-
def check_encoding(encoding); end
|
7290
|
+
def initialize_native; end
|
6568
7291
|
end
|
6569
7292
|
|
6570
|
-
#
|
7293
|
+
# Structure used for marshalling attributes for some callbacks in XML::SAX::Document.
|
7294
|
+
#
|
7295
|
+
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#43
|
6571
7296
|
class Nokogiri::XML::SAX::Parser::Attribute < ::Struct; end
|
6572
7297
|
|
6573
|
-
#
|
6574
|
-
#
|
6575
|
-
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#39
|
7298
|
+
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#46
|
6576
7299
|
Nokogiri::XML::SAX::Parser::ENCODINGS = T.let(T.unsafe(nil), Hash)
|
6577
7300
|
|
6578
|
-
#
|
6579
|
-
# by the user. Instead, you should be looking at
|
6580
|
-
# Nokogiri::XML::SAX::Parser
|
7301
|
+
# pure ASCII
|
6581
7302
|
#
|
6582
|
-
# source://nokogiri//lib/nokogiri/xml/sax/
|
7303
|
+
# source://nokogiri//lib/nokogiri/xml/sax/parser.rb#71
|
7304
|
+
Nokogiri::XML::SAX::Parser::REVERSE_ENCODINGS = T.let(T.unsafe(nil), Hash)
|
7305
|
+
|
7306
|
+
# Context object to invoke the XML SAX parser on the SAX::Document handler.
|
7307
|
+
#
|
7308
|
+
# 💡 This class is usually not instantiated by the user. Use Nokogiri::XML::SAX::Parser
|
7309
|
+
# instead.
|
7310
|
+
#
|
7311
|
+
# source://nokogiri//lib/nokogiri/xml/sax/parser_context.rb#11
|
6583
7312
|
class Nokogiri::XML::SAX::ParserContext
|
6584
7313
|
def column; end
|
6585
7314
|
def line; end
|
@@ -6590,12 +7319,91 @@ class Nokogiri::XML::SAX::ParserContext
|
|
6590
7319
|
def replace_entities=(_arg0); end
|
6591
7320
|
|
6592
7321
|
class << self
|
6593
|
-
|
6594
|
-
|
6595
|
-
|
7322
|
+
# :call-seq:
|
7323
|
+
# file(path)
|
7324
|
+
# file(path, encoding)
|
7325
|
+
#
|
7326
|
+
# Create a parser context for the file at +path+.
|
7327
|
+
#
|
7328
|
+
# [Parameters]
|
7329
|
+
# - +path+ (String) The path to the input file
|
7330
|
+
# - +encoding+ (optional) (Encoding, String) The +Encoding+ to use, or the name of an encoding to
|
7331
|
+
# use (default +nil+, encoding will be autodetected)
|
7332
|
+
#
|
7333
|
+
# [Returns] Nokogiri::XML::SAX::ParserContext
|
7334
|
+
#
|
7335
|
+
# 💡 Calling this method directly is discouraged. Use Nokogiri::XML::SAX::Parser.parse_file which
|
7336
|
+
# is more convenient for most use cases.
|
7337
|
+
#
|
7338
|
+
# source://nokogiri//lib/nokogiri/xml/sax/parser_context.rb#97
|
7339
|
+
def file(input, encoding = T.unsafe(nil)); end
|
7340
|
+
|
7341
|
+
# :call-seq:
|
7342
|
+
# io(input)
|
7343
|
+
# io(input, encoding)
|
7344
|
+
#
|
7345
|
+
# Create a parser context for an +input+ IO which will assume +encoding+
|
7346
|
+
#
|
7347
|
+
# [Parameters]
|
7348
|
+
# - +io+ (IO) The readable IO object from which to read input
|
7349
|
+
# - +encoding+ (optional) (Encoding) The +Encoding+ to use, or the name of an
|
7350
|
+
# encoding to use (default +nil+, encoding will be autodetected)
|
7351
|
+
#
|
7352
|
+
# [Returns] Nokogiri::XML::SAX::ParserContext
|
7353
|
+
#
|
7354
|
+
# 💡 Calling this method directly is discouraged. Use Nokogiri::XML::SAX::Parser parse
|
7355
|
+
# methods which are more convenient for most use cases.
|
7356
|
+
#
|
7357
|
+
# source://nokogiri//lib/nokogiri/xml/sax/parser_context.rb#56
|
7358
|
+
def io(input, encoding = T.unsafe(nil)); end
|
7359
|
+
|
7360
|
+
# :call-seq:
|
7361
|
+
# memory(input)
|
7362
|
+
# memory(input, encoding)
|
7363
|
+
#
|
7364
|
+
# Create a parser context for the +input+ String.
|
7365
|
+
#
|
7366
|
+
# [Parameters]
|
7367
|
+
# - +input+ (String) The input string to be parsed.
|
7368
|
+
# - +encoding+ (optional) (Encoding, String) The +Encoding+ to use, or the name of an encoding to
|
7369
|
+
# use (default +nil+, encoding will be autodetected)
|
7370
|
+
#
|
7371
|
+
# [Returns] Nokogiri::XML::SAX::ParserContext
|
7372
|
+
#
|
7373
|
+
# 💡 Calling this method directly is discouraged. Use Nokogiri::XML::SAX::Parser parse methods
|
7374
|
+
# which are more convenient for most use cases.
|
7375
|
+
#
|
7376
|
+
# source://nokogiri//lib/nokogiri/xml/sax/parser_context.rb#77
|
7377
|
+
def memory(input, encoding = T.unsafe(nil)); end
|
6596
7378
|
|
6597
|
-
|
6598
|
-
def
|
7379
|
+
def native_file(_arg0, _arg1); end
|
7380
|
+
def native_io(_arg0, _arg1); end
|
7381
|
+
def native_memory(_arg0, _arg1); end
|
7382
|
+
|
7383
|
+
# :call-seq:
|
7384
|
+
# new(input)
|
7385
|
+
# new(input, encoding)
|
7386
|
+
#
|
7387
|
+
# Create a parser context for an IO or a String. This is a shorthand method for
|
7388
|
+
# ParserContext.io and ParserContext.memory.
|
7389
|
+
#
|
7390
|
+
# [Parameters]
|
7391
|
+
# - +input+ (IO, String) A String or a readable IO object
|
7392
|
+
# - +encoding+ (optional) (Encoding) The +Encoding+ to use, or the name of an
|
7393
|
+
# encoding to use (default +nil+, encoding will be autodetected)
|
7394
|
+
#
|
7395
|
+
# If +input+ quacks like a readable IO object, this method forwards to ParserContext.io,
|
7396
|
+
# otherwise it forwards to ParserContext.memory.
|
7397
|
+
#
|
7398
|
+
# [Returns] Nokogiri::XML::SAX::ParserContext
|
7399
|
+
#
|
7400
|
+
# source://nokogiri//lib/nokogiri/xml/sax/parser_context.rb#31
|
7401
|
+
def new(input, encoding = T.unsafe(nil)); end
|
7402
|
+
|
7403
|
+
private
|
7404
|
+
|
7405
|
+
# source://nokogiri//lib/nokogiri/xml/sax/parser_context.rb#101
|
7406
|
+
def resolve_encoding(encoding); end
|
6599
7407
|
end
|
6600
7408
|
end
|
6601
7409
|
|
@@ -6651,7 +7459,10 @@ class Nokogiri::XML::SAX::PushParser
|
|
6651
7459
|
# Finish the parsing. This method is only necessary for
|
6652
7460
|
# Nokogiri::XML::SAX::Document#end_document to be called.
|
6653
7461
|
#
|
6654
|
-
#
|
7462
|
+
# ⚠ Note that empty documents are treated as an error when using the libxml2-based
|
7463
|
+
# implementation (CRuby), but are fine when using the Xerces-based implementation (JRuby).
|
7464
|
+
#
|
7465
|
+
# source://nokogiri//lib/nokogiri/xml/sax/push_parser.rb#58
|
6655
7466
|
def finish; end
|
6656
7467
|
|
6657
7468
|
def options; end
|
@@ -6671,66 +7482,112 @@ class Nokogiri::XML::SAX::PushParser
|
|
6671
7482
|
def native_write(_arg0, _arg1); end
|
6672
7483
|
end
|
6673
7484
|
|
6674
|
-
# Nokogiri::XML::Schema is used for validating XML against
|
6675
|
-
# (usually from an xsd file).
|
7485
|
+
# Nokogiri::XML::Schema is used for validating \XML against an \XSD schema definition.
|
6676
7486
|
#
|
6677
|
-
#
|
7487
|
+
# ⚠ Since v1.11.0, Schema treats inputs as *untrusted* by default, and so external entities are
|
7488
|
+
# not resolved from the network (+http://+ or +ftp://+). When parsing a trusted document, the
|
7489
|
+
# caller may turn off the +NONET+ option via the ParseOptions to (re-)enable external entity
|
7490
|
+
# resolution over a network connection.
|
6678
7491
|
#
|
6679
|
-
#
|
6680
|
-
#
|
7492
|
+
# 🛡 Before v1.11.0, documents were "trusted" by default during schema parsing which was counter
|
7493
|
+
# to Nokogiri's "untrusted by default" security policy.
|
6681
7494
|
#
|
6682
|
-
#
|
6683
|
-
# doc = Nokogiri::XML(File.read(PO_XML_FILE))
|
7495
|
+
# *Example:* Determine whether an \XML document is valid.
|
6684
7496
|
#
|
6685
|
-
#
|
6686
|
-
#
|
6687
|
-
#
|
7497
|
+
# schema = Nokogiri::XML::Schema.new(File.read(XSD_FILE))
|
7498
|
+
# doc = Nokogiri::XML::Document.parse(File.read(XML_FILE))
|
7499
|
+
# schema.valid?(doc) # Boolean
|
7500
|
+
#
|
7501
|
+
# *Example:* Validate an \XML document against an \XSD schema, and capture any errors that are found.
|
7502
|
+
#
|
7503
|
+
# schema = Nokogiri::XML::Schema.new(File.read(XSD_FILE))
|
7504
|
+
# doc = Nokogiri::XML::Document.parse(File.read(XML_FILE))
|
7505
|
+
# errors = schema.validate(doc) # Array<SyntaxError>
|
6688
7506
|
#
|
6689
|
-
#
|
7507
|
+
# *Example:* Validate an \XML document using a Document containing an \XSD schema definition.
|
6690
7508
|
#
|
6691
|
-
#
|
6692
|
-
#
|
6693
|
-
#
|
6694
|
-
#
|
6695
|
-
# the ParseOptions to re-enable external entity resolution over a network connection.
|
7509
|
+
# schema_doc = Nokogiri::XML::Document.parse(File.read(RELAX_NG_FILE))
|
7510
|
+
# schema = Nokogiri::XML::Schema.from_document(schema_doc)
|
7511
|
+
# doc = Nokogiri::XML::Document.parse(File.read(XML_FILE))
|
7512
|
+
# schema.valid?(doc) # Boolean
|
6696
7513
|
#
|
6697
|
-
# source://nokogiri//lib/nokogiri/xml/schema.rb#
|
7514
|
+
# source://nokogiri//lib/nokogiri/xml/schema.rb#45
|
6698
7515
|
class Nokogiri::XML::Schema
|
6699
|
-
#
|
7516
|
+
# The errors found while parsing the \XSD
|
6700
7517
|
#
|
6701
|
-
#
|
7518
|
+
# [Returns] Array<Nokogiri::XML::SyntaxError>
|
7519
|
+
#
|
7520
|
+
# source://nokogiri//lib/nokogiri/xml/schema.rb#49
|
6702
7521
|
def errors; end
|
6703
7522
|
|
6704
|
-
#
|
7523
|
+
# The errors found while parsing the \XSD
|
7524
|
+
#
|
7525
|
+
# [Returns] Array<Nokogiri::XML::SyntaxError>
|
6705
7526
|
#
|
6706
|
-
# source://nokogiri//lib/nokogiri/xml/schema.rb#
|
7527
|
+
# source://nokogiri//lib/nokogiri/xml/schema.rb#49
|
6707
7528
|
def errors=(_arg0); end
|
6708
7529
|
|
6709
|
-
# The
|
7530
|
+
# The options used to parse the schema
|
6710
7531
|
#
|
6711
|
-
#
|
7532
|
+
# [Returns] Nokogiri::XML::ParseOptions
|
7533
|
+
#
|
7534
|
+
# source://nokogiri//lib/nokogiri/xml/schema.rb#54
|
6712
7535
|
def parse_options; end
|
6713
7536
|
|
6714
|
-
# The
|
7537
|
+
# The options used to parse the schema
|
7538
|
+
#
|
7539
|
+
# [Returns] Nokogiri::XML::ParseOptions
|
6715
7540
|
#
|
6716
|
-
# source://nokogiri//lib/nokogiri/xml/schema.rb#
|
7541
|
+
# source://nokogiri//lib/nokogiri/xml/schema.rb#54
|
6717
7542
|
def parse_options=(_arg0); end
|
6718
7543
|
|
6719
|
-
#
|
6720
|
-
#
|
7544
|
+
# :call-seq: valid?(input) → Boolean
|
7545
|
+
#
|
7546
|
+
# Validate +input+ and return a Boolean indicating whether the document is valid
|
7547
|
+
#
|
7548
|
+
# [Parameters]
|
7549
|
+
# - +input+ (Nokogiri::XML::Document | String)
|
7550
|
+
# A parsed document, or a string containing a local filename.
|
7551
|
+
#
|
7552
|
+
# [Returns] Boolean
|
7553
|
+
#
|
7554
|
+
# *Example:* Validate an existing XML::Document
|
7555
|
+
#
|
7556
|
+
# schema = Nokogiri::XML::Schema.new(File.read(XSD_FILE))
|
7557
|
+
# return unless schema.valid?(document)
|
7558
|
+
#
|
7559
|
+
# *Example:* Validate an \XML document on disk
|
7560
|
+
#
|
7561
|
+
# schema = Nokogiri::XML::Schema.new(File.read(XSD_FILE))
|
7562
|
+
# return unless schema.valid?("/path/to/file.xml")
|
6721
7563
|
#
|
6722
7564
|
# @return [Boolean]
|
6723
7565
|
#
|
6724
|
-
# source://nokogiri//lib/nokogiri/xml/schema.rb#
|
6725
|
-
def valid?(
|
7566
|
+
# source://nokogiri//lib/nokogiri/xml/schema.rb#135
|
7567
|
+
def valid?(input); end
|
6726
7568
|
|
6727
|
-
#
|
6728
|
-
# Nokogiri::XML::Document object, or a filename. An Array of
|
6729
|
-
# Nokogiri::XML::SyntaxError objects found while validating the
|
6730
|
-
# +thing+ is returned.
|
7569
|
+
# :call-seq: validate(input) → Array<SyntaxError>
|
6731
7570
|
#
|
6732
|
-
#
|
6733
|
-
|
7571
|
+
# Validate +input+ and return any errors that are found.
|
7572
|
+
#
|
7573
|
+
# [Parameters]
|
7574
|
+
# - +input+ (Nokogiri::XML::Document | String)
|
7575
|
+
# A parsed document, or a string containing a local filename.
|
7576
|
+
#
|
7577
|
+
# [Returns] Array<SyntaxError>
|
7578
|
+
#
|
7579
|
+
# *Example:* Validate an existing XML::Document, and capture any errors that are found.
|
7580
|
+
#
|
7581
|
+
# schema = Nokogiri::XML::Schema.new(File.read(XSD_FILE))
|
7582
|
+
# errors = schema.validate(document)
|
7583
|
+
#
|
7584
|
+
# *Example:* Validate an \XML document on disk, and capture any errors that are found.
|
7585
|
+
#
|
7586
|
+
# schema = Nokogiri::XML::Schema.new(File.read(XSD_FILE))
|
7587
|
+
# errors = schema.validate("/path/to/file.xml")
|
7588
|
+
#
|
7589
|
+
# source://nokogiri//lib/nokogiri/xml/schema.rb#104
|
7590
|
+
def validate(input); end
|
6734
7591
|
|
6735
7592
|
private
|
6736
7593
|
|
@@ -6740,13 +7597,30 @@ class Nokogiri::XML::Schema
|
|
6740
7597
|
class << self
|
6741
7598
|
def from_document(*_arg0); end
|
6742
7599
|
|
6743
|
-
#
|
6744
|
-
#
|
7600
|
+
# :call-seq:
|
7601
|
+
# new(input) → Nokogiri::XML::Schema
|
7602
|
+
# new(input, parse_options) → Nokogiri::XML::Schema
|
7603
|
+
#
|
7604
|
+
# Parse an \XSD schema definition from a String or IO to create a new Nokogiri::XML::Schema
|
7605
|
+
#
|
7606
|
+
# [Parameters]
|
7607
|
+
# - +input+ (String | IO) \XSD schema definition
|
7608
|
+
# - +parse_options+ (Nokogiri::XML::ParseOptions)
|
7609
|
+
# Defaults to Nokogiri::XML::ParseOptions::DEFAULT_SCHEMA
|
6745
7610
|
#
|
6746
|
-
#
|
6747
|
-
|
7611
|
+
# [Returns] Nokogiri::XML::Schema
|
7612
|
+
#
|
7613
|
+
# source://nokogiri//lib/nokogiri/xml/schema.rb#69
|
7614
|
+
def new(input, parse_options_ = T.unsafe(nil), parse_options: T.unsafe(nil)); end
|
6748
7615
|
|
6749
|
-
|
7616
|
+
# :call-seq:
|
7617
|
+
# read_memory(input) → Nokogiri::XML::Schema
|
7618
|
+
# read_memory(input, parse_options) → Nokogiri::XML::Schema
|
7619
|
+
#
|
7620
|
+
# Convenience method for Nokogiri::XML::Schema.new
|
7621
|
+
#
|
7622
|
+
# source://nokogiri//lib/nokogiri/xml/schema.rb#78
|
7623
|
+
def read_memory(*_arg0, **_arg1, &_arg2); end
|
6750
7624
|
end
|
6751
7625
|
end
|
6752
7626
|
|
@@ -6978,7 +7852,7 @@ module Nokogiri::XML::Searchable
|
|
6978
7852
|
# source://nokogiri//lib/nokogiri/xml/searchable.rb#241
|
6979
7853
|
def css_rules_to_xpath(rules, ns); end
|
6980
7854
|
|
6981
|
-
# source://nokogiri//lib/nokogiri/xml/searchable.rb#
|
7855
|
+
# source://nokogiri//lib/nokogiri/xml/searchable.rb#257
|
6982
7856
|
def extract_params(params); end
|
6983
7857
|
|
6984
7858
|
# source://nokogiri//lib/nokogiri/xml/searchable.rb#229
|
@@ -7004,97 +7878,113 @@ Nokogiri::XML::Searchable::LOOKS_LIKE_XPATH = T.let(T.unsafe(nil), Regexp)
|
|
7004
7878
|
class Nokogiri::XML::SyntaxError < ::Nokogiri::SyntaxError
|
7005
7879
|
# Returns the value of attribute code.
|
7006
7880
|
#
|
7007
|
-
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#
|
7881
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#23
|
7008
7882
|
def code; end
|
7009
7883
|
|
7010
7884
|
# Returns the value of attribute column.
|
7011
7885
|
#
|
7012
|
-
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#
|
7886
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#40
|
7013
7887
|
def column; end
|
7014
7888
|
|
7015
7889
|
# Returns the value of attribute domain.
|
7016
7890
|
#
|
7017
|
-
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#
|
7891
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#22
|
7018
7892
|
def domain; end
|
7019
7893
|
|
7020
7894
|
# return true if this is an error
|
7021
7895
|
#
|
7022
7896
|
# @return [Boolean]
|
7023
7897
|
#
|
7024
|
-
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#
|
7898
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#56
|
7025
7899
|
def error?; end
|
7026
7900
|
|
7027
7901
|
# return true if this error is fatal
|
7028
7902
|
#
|
7029
7903
|
# @return [Boolean]
|
7030
7904
|
#
|
7031
|
-
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#
|
7905
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#62
|
7032
7906
|
def fatal?; end
|
7033
7907
|
|
7034
7908
|
# Returns the value of attribute file.
|
7035
7909
|
#
|
7036
|
-
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#
|
7910
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#25
|
7037
7911
|
def file; end
|
7038
7912
|
|
7039
7913
|
# Returns the value of attribute int1.
|
7040
7914
|
#
|
7041
|
-
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#
|
7915
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#39
|
7042
7916
|
def int1; end
|
7043
7917
|
|
7044
7918
|
# Returns the value of attribute level.
|
7045
7919
|
#
|
7046
|
-
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#
|
7920
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#24
|
7047
7921
|
def level; end
|
7048
7922
|
|
7049
7923
|
# Returns the value of attribute line.
|
7050
7924
|
#
|
7051
|
-
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#
|
7925
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#26
|
7052
7926
|
def line; end
|
7053
7927
|
|
7054
7928
|
# return true if this is a non error
|
7055
7929
|
#
|
7056
7930
|
# @return [Boolean]
|
7057
7931
|
#
|
7058
|
-
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#
|
7932
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#44
|
7059
7933
|
def none?; end
|
7060
7934
|
|
7935
|
+
# The XPath path of the node that caused the error when validating a `Nokogiri::XML::Document`.
|
7936
|
+
#
|
7937
|
+
# This attribute will only be non-nil when the error is emitted by `Schema#validate` on
|
7938
|
+
# Document objects. It will return `nil` for DOM parsing errors and for errors emitted during
|
7939
|
+
# Schema validation of files.
|
7940
|
+
#
|
7941
|
+
# ⚠ `#path` is not supported on JRuby, where it will always return `nil`.
|
7942
|
+
#
|
7943
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#35
|
7944
|
+
def path; end
|
7945
|
+
|
7061
7946
|
# Returns the value of attribute str1.
|
7062
7947
|
#
|
7063
|
-
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#
|
7948
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#36
|
7064
7949
|
def str1; end
|
7065
7950
|
|
7066
7951
|
# Returns the value of attribute str2.
|
7067
7952
|
#
|
7068
|
-
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#
|
7953
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#37
|
7069
7954
|
def str2; end
|
7070
7955
|
|
7071
7956
|
# Returns the value of attribute str3.
|
7072
7957
|
#
|
7073
|
-
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#
|
7958
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#38
|
7074
7959
|
def str3; end
|
7075
7960
|
|
7076
|
-
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#
|
7961
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#66
|
7077
7962
|
def to_s; end
|
7078
7963
|
|
7079
7964
|
# return true if this is a warning
|
7080
7965
|
#
|
7081
7966
|
# @return [Boolean]
|
7082
7967
|
#
|
7083
|
-
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#
|
7968
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#50
|
7084
7969
|
def warning?; end
|
7085
7970
|
|
7086
7971
|
private
|
7087
7972
|
|
7088
|
-
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#
|
7973
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#75
|
7089
7974
|
def level_to_s; end
|
7090
7975
|
|
7091
|
-
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#
|
7976
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#87
|
7092
7977
|
def location_to_s; end
|
7093
7978
|
|
7094
7979
|
# @return [Boolean]
|
7095
7980
|
#
|
7096
|
-
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#
|
7981
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#83
|
7097
7982
|
def nil_or_zero?(attribute); end
|
7983
|
+
|
7984
|
+
class << self
|
7985
|
+
# source://nokogiri//lib/nokogiri/xml/syntax_error.rb#10
|
7986
|
+
def aggregate(errors); end
|
7987
|
+
end
|
7098
7988
|
end
|
7099
7989
|
|
7100
7990
|
# source://nokogiri//lib/nokogiri/xml/text.rb#5
|
@@ -7109,17 +7999,17 @@ end
|
|
7109
7999
|
|
7110
8000
|
# Original C14N 1.0 spec canonicalization
|
7111
8001
|
#
|
7112
|
-
# source://nokogiri//lib/nokogiri/xml.rb#
|
8002
|
+
# source://nokogiri//lib/nokogiri/xml.rb#13
|
7113
8003
|
Nokogiri::XML::XML_C14N_1_0 = T.let(T.unsafe(nil), Integer)
|
7114
8004
|
|
7115
8005
|
# C14N 1.1 spec canonicalization
|
7116
8006
|
#
|
7117
|
-
# source://nokogiri//lib/nokogiri/xml.rb#
|
8007
|
+
# source://nokogiri//lib/nokogiri/xml.rb#17
|
7118
8008
|
Nokogiri::XML::XML_C14N_1_1 = T.let(T.unsafe(nil), Integer)
|
7119
8009
|
|
7120
8010
|
# Exclusive C14N 1.0 spec canonicalization
|
7121
8011
|
#
|
7122
|
-
# source://nokogiri//lib/nokogiri/xml.rb#
|
8012
|
+
# source://nokogiri//lib/nokogiri/xml.rb#15
|
7123
8013
|
Nokogiri::XML::XML_C14N_EXCLUSIVE_1_0 = T.let(T.unsafe(nil), Integer)
|
7124
8014
|
|
7125
8015
|
# source://nokogiri//lib/nokogiri/xml/xpath.rb#5
|
@@ -7171,7 +8061,7 @@ end
|
|
7171
8061
|
# See Nokogiri::XSLT::Stylesheet for creating and manipulating
|
7172
8062
|
# Stylesheet object.
|
7173
8063
|
#
|
7174
|
-
# source://nokogiri//lib/nokogiri/xslt.rb#
|
8064
|
+
# source://nokogiri//lib/nokogiri/xslt.rb#15
|
7175
8065
|
module Nokogiri::XSLT
|
7176
8066
|
class << self
|
7177
8067
|
# :call-seq:
|
@@ -7227,7 +8117,7 @@ module Nokogiri::XSLT
|
|
7227
8117
|
# # " <reverse>raB</reverse>\n" +
|
7228
8118
|
# # "</reversed>\n"
|
7229
8119
|
#
|
7230
|
-
# source://nokogiri//lib/nokogiri/xslt.rb#
|
8120
|
+
# source://nokogiri//lib/nokogiri/xslt.rb#70
|
7231
8121
|
def parse(string, modules = T.unsafe(nil)); end
|
7232
8122
|
|
7233
8123
|
# :call-seq:
|
@@ -7241,7 +8131,7 @@ module Nokogiri::XSLT
|
|
7241
8131
|
#
|
7242
8132
|
# [Returns] Array of string parameters, with quotes correctly escaped for use with XSLT::Stylesheet.transform
|
7243
8133
|
#
|
7244
|
-
# source://nokogiri//lib/nokogiri/xslt.rb#
|
8134
|
+
# source://nokogiri//lib/nokogiri/xslt.rb#94
|
7245
8135
|
def quote_params(params); end
|
7246
8136
|
|
7247
8137
|
def register(_arg0, _arg1); end
|