nokogiri 1.11.1-java → 1.11.2-java
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of nokogiri might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/LICENSE-DEPENDENCIES.md +12 -12
- data/LICENSE.md +1 -1
- data/README.md +20 -15
- data/ext/java/nokogiri/EncodingHandler.java +78 -59
- data/ext/java/nokogiri/HtmlDocument.java +137 -114
- data/ext/java/nokogiri/HtmlElementDescription.java +104 -87
- data/ext/java/nokogiri/HtmlEntityLookup.java +31 -26
- data/ext/java/nokogiri/HtmlSaxParserContext.java +220 -192
- data/ext/java/nokogiri/HtmlSaxPushParser.java +164 -139
- data/ext/java/nokogiri/NokogiriService.java +597 -526
- data/ext/java/nokogiri/XmlAttr.java +120 -96
- data/ext/java/nokogiri/XmlAttributeDecl.java +97 -76
- data/ext/java/nokogiri/XmlCdata.java +35 -26
- data/ext/java/nokogiri/XmlComment.java +48 -37
- data/ext/java/nokogiri/XmlDocument.java +642 -540
- data/ext/java/nokogiri/XmlDocumentFragment.java +127 -107
- data/ext/java/nokogiri/XmlDtd.java +450 -384
- data/ext/java/nokogiri/XmlElement.java +25 -18
- data/ext/java/nokogiri/XmlElementContent.java +345 -286
- data/ext/java/nokogiri/XmlElementDecl.java +126 -95
- data/ext/java/nokogiri/XmlEntityDecl.java +121 -97
- data/ext/java/nokogiri/XmlEntityReference.java +51 -42
- data/ext/java/nokogiri/XmlNamespace.java +177 -145
- data/ext/java/nokogiri/XmlNode.java +1843 -1588
- data/ext/java/nokogiri/XmlNodeSet.java +361 -299
- data/ext/java/nokogiri/XmlProcessingInstruction.java +49 -39
- data/ext/java/nokogiri/XmlReader.java +513 -418
- data/ext/java/nokogiri/XmlRelaxng.java +91 -78
- data/ext/java/nokogiri/XmlSaxParserContext.java +330 -285
- data/ext/java/nokogiri/XmlSaxPushParser.java +229 -190
- data/ext/java/nokogiri/XmlSchema.java +328 -263
- data/ext/java/nokogiri/XmlSyntaxError.java +113 -83
- data/ext/java/nokogiri/XmlText.java +57 -46
- data/ext/java/nokogiri/XmlXpathContext.java +240 -206
- data/ext/java/nokogiri/XsltStylesheet.java +282 -239
- data/ext/java/nokogiri/internals/ClosedStreamException.java +5 -2
- data/ext/java/nokogiri/internals/HtmlDomParserContext.java +199 -168
- data/ext/java/nokogiri/internals/IgnoreSchemaErrorsErrorHandler.java +17 -10
- data/ext/java/nokogiri/internals/NokogiriBlockingQueueInputStream.java +43 -16
- data/ext/java/nokogiri/internals/NokogiriDomParser.java +65 -50
- data/ext/java/nokogiri/internals/NokogiriEntityResolver.java +107 -88
- data/ext/java/nokogiri/internals/NokogiriErrorHandler.java +25 -18
- data/ext/java/nokogiri/internals/NokogiriHandler.java +316 -254
- data/ext/java/nokogiri/internals/NokogiriHelpers.java +738 -622
- data/ext/java/nokogiri/internals/NokogiriNamespaceCache.java +186 -143
- data/ext/java/nokogiri/internals/NokogiriNamespaceContext.java +83 -68
- data/ext/java/nokogiri/internals/NokogiriNonStrictErrorHandler.java +66 -49
- data/ext/java/nokogiri/internals/NokogiriNonStrictErrorHandler4NekoHtml.java +86 -69
- data/ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java +44 -29
- data/ext/java/nokogiri/internals/NokogiriXPathFunction.java +118 -101
- data/ext/java/nokogiri/internals/NokogiriXPathFunctionResolver.java +34 -24
- data/ext/java/nokogiri/internals/NokogiriXPathVariableResolver.java +25 -17
- data/ext/java/nokogiri/internals/NokogiriXsltErrorListener.java +57 -42
- data/ext/java/nokogiri/internals/ParserContext.java +206 -179
- data/ext/java/nokogiri/internals/ReaderNode.java +478 -371
- data/ext/java/nokogiri/internals/SaveContextVisitor.java +822 -707
- data/ext/java/nokogiri/internals/SchemaErrorHandler.java +28 -19
- data/ext/java/nokogiri/internals/XalanDTMManagerPatch.java +129 -123
- data/ext/java/nokogiri/internals/XmlDeclHandler.java +5 -4
- data/ext/java/nokogiri/internals/XmlDomParserContext.java +208 -177
- data/ext/java/nokogiri/internals/XmlSaxParser.java +24 -17
- data/ext/java/nokogiri/internals/c14n/AttrCompare.java +71 -68
- data/ext/java/nokogiri/internals/c14n/C14nHelper.java +137 -118
- data/ext/java/nokogiri/internals/c14n/CanonicalFilter.java +27 -21
- data/ext/java/nokogiri/internals/c14n/CanonicalizationException.java +74 -61
- data/ext/java/nokogiri/internals/c14n/Canonicalizer.java +230 -205
- data/ext/java/nokogiri/internals/c14n/Canonicalizer11.java +572 -547
- data/ext/java/nokogiri/internals/c14n/Canonicalizer11_OmitComments.java +17 -10
- data/ext/java/nokogiri/internals/c14n/Canonicalizer11_WithComments.java +17 -10
- data/ext/java/nokogiri/internals/c14n/Canonicalizer20010315.java +323 -302
- data/ext/java/nokogiri/internals/c14n/Canonicalizer20010315Excl.java +232 -219
- data/ext/java/nokogiri/internals/c14n/Canonicalizer20010315ExclOmitComments.java +22 -15
- data/ext/java/nokogiri/internals/c14n/Canonicalizer20010315ExclWithComments.java +23 -16
- data/ext/java/nokogiri/internals/c14n/Canonicalizer20010315OmitComments.java +23 -16
- data/ext/java/nokogiri/internals/c14n/Canonicalizer20010315WithComments.java +22 -15
- data/ext/java/nokogiri/internals/c14n/CanonicalizerBase.java +575 -545
- data/ext/java/nokogiri/internals/c14n/CanonicalizerPhysical.java +141 -120
- data/ext/java/nokogiri/internals/c14n/CanonicalizerSpi.java +39 -38
- data/ext/java/nokogiri/internals/c14n/Constants.java +13 -10
- data/ext/java/nokogiri/internals/c14n/ElementProxy.java +279 -247
- data/ext/java/nokogiri/internals/c14n/HelperNodeList.java +66 -53
- data/ext/java/nokogiri/internals/c14n/IgnoreAllErrorHandler.java +44 -37
- data/ext/java/nokogiri/internals/c14n/InclusiveNamespaces.java +135 -120
- data/ext/java/nokogiri/internals/c14n/InvalidCanonicalizerException.java +59 -48
- data/ext/java/nokogiri/internals/c14n/NameSpaceSymbTable.java +384 -334
- data/ext/java/nokogiri/internals/c14n/NodeFilter.java +25 -24
- data/ext/java/nokogiri/internals/c14n/UtfHelpper.java +151 -140
- data/ext/java/nokogiri/internals/c14n/XMLUtils.java +456 -423
- data/ext/java/nokogiri/internals/dom2dtm/DOM2DTM.java +1466 -1500
- data/ext/java/nokogiri/internals/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java +626 -570
- data/ext/nokogiri/depend +34 -474
- data/ext/nokogiri/extconf.rb +253 -183
- data/ext/nokogiri/html_document.c +10 -15
- data/ext/nokogiri/html_element_description.c +84 -71
- data/ext/nokogiri/html_entity_lookup.c +21 -16
- data/ext/nokogiri/html_sax_parser_context.c +66 -65
- data/ext/nokogiri/html_sax_push_parser.c +29 -27
- data/ext/nokogiri/libxml2_backwards_compat.c +121 -0
- data/ext/nokogiri/nokogiri.c +171 -63
- data/ext/nokogiri/test_global_handlers.c +3 -4
- data/ext/nokogiri/xml_attr.c +15 -15
- data/ext/nokogiri/xml_attribute_decl.c +18 -18
- data/ext/nokogiri/xml_cdata.c +13 -18
- data/ext/nokogiri/xml_comment.c +19 -26
- data/ext/nokogiri/xml_document.c +221 -164
- data/ext/nokogiri/xml_document_fragment.c +13 -15
- data/ext/nokogiri/xml_dtd.c +54 -48
- data/ext/nokogiri/xml_element_content.c +30 -27
- data/ext/nokogiri/xml_element_decl.c +22 -22
- data/ext/nokogiri/xml_encoding_handler.c +17 -11
- data/ext/nokogiri/xml_entity_decl.c +32 -30
- data/ext/nokogiri/xml_entity_reference.c +16 -18
- data/ext/nokogiri/xml_namespace.c +56 -49
- data/ext/nokogiri/xml_node.c +338 -286
- data/ext/nokogiri/xml_node_set.c +168 -156
- data/ext/nokogiri/xml_processing_instruction.c +17 -19
- data/ext/nokogiri/xml_reader.c +191 -157
- data/ext/nokogiri/xml_relax_ng.c +29 -23
- data/ext/nokogiri/xml_sax_parser.c +117 -112
- data/ext/nokogiri/xml_sax_parser_context.c +100 -85
- data/ext/nokogiri/xml_sax_push_parser.c +34 -27
- data/ext/nokogiri/xml_schema.c +48 -42
- data/ext/nokogiri/xml_syntax_error.c +21 -23
- data/ext/nokogiri/xml_text.c +13 -17
- data/ext/nokogiri/xml_xpath_context.c +134 -127
- data/ext/nokogiri/xslt_stylesheet.c +157 -157
- data/lib/nokogiri.rb +1 -22
- data/lib/nokogiri/css/parser.rb +1 -1
- data/lib/nokogiri/extension.rb +26 -0
- data/lib/nokogiri/html/document_fragment.rb +15 -15
- data/lib/nokogiri/nokogiri.jar +0 -0
- data/lib/nokogiri/version/constant.rb +1 -1
- data/lib/nokogiri/version/info.rb +31 -8
- data/lib/nokogiri/xml/document.rb +31 -11
- data/lib/nokogiri/xml/node.rb +38 -42
- data/lib/nokogiri/xml/reader.rb +2 -9
- data/lib/nokogiri/xml/xpath.rb +1 -3
- data/lib/nokogiri/xml/xpath/syntax_error.rb +1 -1
- metadata +7 -8
- data/ext/nokogiri/xml_io.c +0 -63
- data/ext/nokogiri/xml_libxml2_hacks.c +0 -112
@@ -4,26 +4,26 @@ module Nokogiri
|
|
4
4
|
class DocumentFragment < Nokogiri::XML::DocumentFragment
|
5
5
|
####
|
6
6
|
# Create a Nokogiri::XML::DocumentFragment from +tags+, using +encoding+
|
7
|
-
def self.parse
|
7
|
+
def self.parse(tags, encoding = nil)
|
8
8
|
doc = HTML::Document.new
|
9
9
|
|
10
10
|
encoding ||= if tags.respond_to?(:encoding)
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
11
|
+
encoding = tags.encoding
|
12
|
+
if encoding == ::Encoding::ASCII_8BIT
|
13
|
+
'UTF-8'
|
14
|
+
else
|
15
|
+
encoding.name
|
16
|
+
end
|
17
|
+
else
|
18
|
+
'UTF-8'
|
19
|
+
end
|
20
20
|
|
21
21
|
doc.encoding = encoding
|
22
22
|
|
23
23
|
new(doc, tags)
|
24
24
|
end
|
25
25
|
|
26
|
-
def initialize
|
26
|
+
def initialize(document, tags = nil, ctx = nil)
|
27
27
|
return self unless tags
|
28
28
|
|
29
29
|
if ctx
|
@@ -33,13 +33,13 @@ module Nokogiri
|
|
33
33
|
self.errors = document.errors - preexisting_errors
|
34
34
|
else
|
35
35
|
# This is a horrible hack, but I don't care
|
36
|
-
|
37
|
-
|
36
|
+
path = if /^\s*?<body/i.match?(tags)
|
37
|
+
"/html/body"
|
38
38
|
else
|
39
|
-
|
39
|
+
"/html/body/node()"
|
40
40
|
end
|
41
41
|
|
42
|
-
temp_doc = HTML::Document.parse
|
42
|
+
temp_doc = HTML::Document.parse("<html><body>#{tags}", nil, document.encoding)
|
43
43
|
temp_doc.xpath(path).each { |child| child.parent = self }
|
44
44
|
self.errors = temp_doc.errors
|
45
45
|
end
|
data/lib/nokogiri/nokogiri.jar
CHANGED
Binary file
|
@@ -10,6 +10,14 @@ module Nokogiri
|
|
10
10
|
::JRUBY_VERSION if ::RUBY_PLATFORM == "java"
|
11
11
|
end
|
12
12
|
|
13
|
+
def windows?
|
14
|
+
::RUBY_PLATFORM =~ /mingw|mswin/
|
15
|
+
end
|
16
|
+
|
17
|
+
def ruby_minor
|
18
|
+
Gem::Version.new(::RUBY_VERSION).segments[0..1].join(".")
|
19
|
+
end
|
20
|
+
|
13
21
|
def engine
|
14
22
|
defined?(::RUBY_ENGINE) ? ::RUBY_ENGINE : "mri"
|
15
23
|
end
|
@@ -74,18 +82,38 @@ module Nokogiri
|
|
74
82
|
|
75
83
|
def to_hash
|
76
84
|
header_directory = File.expand_path(File.join(File.dirname(__FILE__), "../../../ext/nokogiri"))
|
85
|
+
|
77
86
|
{}.tap do |vi|
|
78
87
|
vi["warnings"] = []
|
79
88
|
vi["nokogiri"] = {}.tap do |nokogiri|
|
80
89
|
nokogiri["version"] = Nokogiri::VERSION
|
81
90
|
|
82
91
|
unless jruby?
|
92
|
+
# enable gems like nokogumbo to build with the following in their extconf.rb:
|
93
|
+
#
|
94
|
+
# append_cflags(Nokogiri::VERSION_INFO["nokogiri"]["cppflags"])
|
95
|
+
# append_ldflags(Nokogiri::VERSION_INFO["nokogiri"]["ldflags"])
|
96
|
+
#
|
83
97
|
cppflags = ["-I#{header_directory.shellescape}"]
|
98
|
+
ldflags = []
|
99
|
+
|
84
100
|
if libxml2_using_packaged?
|
85
|
-
cppflags << "-I#{File.join(header_directory,
|
86
|
-
cppflags << "-I#{File.join(header_directory,
|
101
|
+
cppflags << "-I#{File.join(header_directory, 'include').shellescape}"
|
102
|
+
cppflags << "-I#{File.join(header_directory, 'include/libxml2').shellescape}"
|
103
|
+
|
104
|
+
if windows?
|
105
|
+
# on windows, nokogumbo needs to link against nokogiri.so to resolve symbols. see #2167
|
106
|
+
lib_directory = File.expand_path(File.join(File.dirname(__FILE__), "../#{ruby_minor}"))
|
107
|
+
unless File.exist?(lib_directory)
|
108
|
+
lib_directory = File.expand_path(File.join(File.dirname(__FILE__), ".."))
|
109
|
+
end
|
110
|
+
ldflags << "-L#{lib_directory.shellescape}"
|
111
|
+
ldflags << "-l:nokogiri.so"
|
112
|
+
end
|
87
113
|
end
|
114
|
+
|
88
115
|
nokogiri["cppflags"] = cppflags
|
116
|
+
nokogiri["ldflags"] = ldflags
|
89
117
|
end
|
90
118
|
end
|
91
119
|
vi["ruby"] = {}.tap do |ruby|
|
@@ -170,12 +198,7 @@ module Nokogiri
|
|
170
198
|
if Nokogiri.jruby?
|
171
199
|
require "nokogiri/jruby/dependencies"
|
172
200
|
end
|
173
|
-
|
174
|
-
::RUBY_VERSION =~ /(\d+\.\d+)/
|
175
|
-
require "nokogiri/#{Regexp.last_match(1)}/nokogiri"
|
176
|
-
rescue LoadError
|
177
|
-
require "nokogiri/nokogiri"
|
178
|
-
end
|
201
|
+
require "nokogiri/extension"
|
179
202
|
|
180
203
|
# More complete version information about libxml
|
181
204
|
VERSION_INFO = VersionInfo.instance.to_hash
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# coding: utf-8
|
1
2
|
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require 'pathname'
|
@@ -79,6 +80,35 @@ module Nokogiri
|
|
79
80
|
return doc
|
80
81
|
end
|
81
82
|
|
83
|
+
##
|
84
|
+
# @!method wrap(java_document)
|
85
|
+
# @!scope class
|
86
|
+
#
|
87
|
+
# Create a {Document} using an existing Java DOM document object.
|
88
|
+
#
|
89
|
+
# The returned {Document} shares the same underlying data structure as the Java object, so
|
90
|
+
# changes in one are reflected in the other.
|
91
|
+
#
|
92
|
+
# @param java_document [Java::OrgW3cDom::Document]
|
93
|
+
# @return [Nokogiri::XML::Document]
|
94
|
+
# @note This method is only available when running JRuby.
|
95
|
+
# @note The class +Java::OrgW3cDom::Document+ is also accessible as +org.w3c.dom.Document+.
|
96
|
+
# @see #to_java
|
97
|
+
|
98
|
+
##
|
99
|
+
# @!method to_java()
|
100
|
+
#
|
101
|
+
# Returns the underlying Java DOM document object for the {Document}.
|
102
|
+
#
|
103
|
+
# The returned Java object shares the same underlying data structure as the {Document}, so
|
104
|
+
# changes in one are reflected in the other.
|
105
|
+
#
|
106
|
+
# @return [Java::OrgW3cDom::Document]
|
107
|
+
# @note This method is only available when running JRuby.
|
108
|
+
# @note The class +Java::OrgW3cDom::Document+ is also accessible as +org.w3c.dom.Document+.
|
109
|
+
# @see .wrap
|
110
|
+
|
111
|
+
|
82
112
|
# A list of Nokogiri::XML::SyntaxError found when parsing a document
|
83
113
|
attr_accessor :errors
|
84
114
|
|
@@ -262,24 +292,14 @@ module Nokogiri
|
|
262
292
|
end
|
263
293
|
alias :<< :add_child
|
264
294
|
|
265
|
-
##
|
266
|
-
# +JRuby+
|
267
|
-
# Wraps Java's org.w3c.dom.document and returns Nokogiri::XML::Document
|
268
|
-
def self.wrap(document) end if false # native-ext provides Document.wrap
|
269
|
-
|
270
|
-
##
|
271
|
-
# +JRuby+
|
272
|
-
# Returns Java's org.w3c.dom.document of this Document.
|
273
|
-
def to_java; end if false # JRuby provides #to_java
|
274
|
-
|
275
295
|
private
|
296
|
+
|
276
297
|
def self.empty_doc? string_or_io
|
277
298
|
string_or_io.nil? ||
|
278
299
|
(string_or_io.respond_to?(:empty?) && string_or_io.empty?) ||
|
279
300
|
(string_or_io.respond_to?(:eof?) && string_or_io.eof?)
|
280
301
|
end
|
281
302
|
|
282
|
-
# @private
|
283
303
|
IMPLIED_XPATH_CONTEXTS = [ '//'.freeze ].freeze # :nodoc:
|
284
304
|
|
285
305
|
def inspect_attributes
|
data/lib/nokogiri/xml/node.rb
CHANGED
@@ -5,64 +5,54 @@ require "nokogiri/xml/node/save_options"
|
|
5
5
|
|
6
6
|
module Nokogiri
|
7
7
|
module XML
|
8
|
-
|
9
|
-
# Nokogiri::XML::Node is your window to the fun filled world of dealing
|
10
|
-
#
|
11
|
-
#
|
8
|
+
##
|
9
|
+
# {Nokogiri::XML::Node} is your window to the fun filled world of dealing with XML and HTML
|
10
|
+
# tags. A {Nokogiri::XML::Node} may be treated similarly to a hash with regard to attributes. For
|
11
|
+
# example:
|
12
12
|
#
|
13
|
-
#
|
14
|
-
# => <a href
|
15
|
-
#
|
16
|
-
# => "
|
17
|
-
#
|
18
|
-
# =>
|
19
|
-
#
|
20
|
-
# => ["#foo", "link"]
|
21
|
-
# irb(main):008:0> node['class'] = 'green'
|
22
|
-
# => "green"
|
23
|
-
# irb(main):009:0> node
|
24
|
-
# => <a href="#foo" id="link" class="green">link</a>
|
25
|
-
# irb(main):010:0>
|
13
|
+
# node = Nokogiri::XML::DocumentFragment.parse("<a href='#foo' id='link'>link</a>").at_css("a")
|
14
|
+
# node.to_html # => "<a href=\"#foo\" id=\"link\">link</a>"
|
15
|
+
# node['href'] # => "#foo"
|
16
|
+
# node.keys # => ["href", "id"]
|
17
|
+
# node.values # => ["#foo", "link"]
|
18
|
+
# node['class'] = 'green' # => "green"
|
19
|
+
# node.to_html # => "<a href=\"#foo\" id=\"link\" class=\"green\">link</a>"
|
26
20
|
#
|
27
|
-
# See
|
21
|
+
# See the method group entitled "Working With Node Attributes" for the full set of methods.
|
28
22
|
#
|
29
|
-
# Nokogiri::XML::Node also has methods that let you move around your
|
23
|
+
# {Nokogiri::XML::Node} also has methods that let you move around your
|
30
24
|
# tree. For navigating your tree, see:
|
31
25
|
#
|
32
|
-
# *
|
33
|
-
# *
|
34
|
-
# *
|
35
|
-
# *
|
36
|
-
#
|
26
|
+
# * {#parent}
|
27
|
+
# * {#children}
|
28
|
+
# * {#next}
|
29
|
+
# * {#previous}
|
37
30
|
#
|
38
31
|
# When printing or otherwise emitting a document or a node (and
|
39
32
|
# its subtree), there are a few methods you might want to use:
|
40
33
|
#
|
41
|
-
# * content, text, inner_text, to_str: emit plaintext
|
42
|
-
#
|
43
|
-
#
|
44
|
-
# document, meaning that entities will be replaced (e.g., "<"
|
45
|
-
# will be replaced with "<"), meaning that any sanitizing will
|
46
|
-
# likely be un-done in the output.
|
34
|
+
# * {#content}, {#text}, {#inner_text}, {#to_str}: These methods will all <b>emit plaintext</b>,
|
35
|
+
# meaning that entities will be replaced (e.g., "<" will be replaced with "<"), meaning
|
36
|
+
# that any sanitizing will likely be un-done in the output.
|
47
37
|
#
|
48
|
-
# * to_s, to_xml, to_html, inner_html:
|
38
|
+
# * {#to_s}, {#to_xml}, {#to_html}, {#inner_html}: These methods will all <b>emit
|
39
|
+
# properly-escaped markup</b>, meaning that it's suitable for consumption by browsers,
|
40
|
+
# parsers, etc.
|
49
41
|
#
|
50
|
-
#
|
51
|
-
# that it's suitable for consumption by browsers, parsers, etc.
|
42
|
+
# You may search this node's subtree using {#xpath} and {#css}
|
52
43
|
#
|
53
|
-
# You may search this node's subtree using Searchable#xpath and Searchable#css
|
54
44
|
class Node
|
55
45
|
include Nokogiri::XML::PP::Node
|
56
46
|
include Nokogiri::XML::Searchable
|
57
47
|
include Enumerable
|
58
48
|
|
59
|
-
# Element node type, see Nokogiri::XML::Node#element?
|
49
|
+
# Element node type, see {Nokogiri::XML::Node#element?}
|
60
50
|
ELEMENT_NODE = 1
|
61
51
|
# Attribute node type
|
62
52
|
ATTRIBUTE_NODE = 2
|
63
|
-
# Text node type, see Nokogiri::XML::Node#text?
|
53
|
+
# Text node type, see {Nokogiri::XML::Node#text?}
|
64
54
|
TEXT_NODE = 3
|
65
|
-
# CDATA node type, see Nokogiri::XML::Node#cdata?
|
55
|
+
# CDATA node type, see {Nokogiri::XML::Node#cdata?}
|
66
56
|
CDATA_SECTION_NODE = 4
|
67
57
|
# Entity reference node type
|
68
58
|
ENTITY_REF_NODE = 5
|
@@ -70,9 +60,9 @@ module Nokogiri
|
|
70
60
|
ENTITY_NODE = 6
|
71
61
|
# PI node type
|
72
62
|
PI_NODE = 7
|
73
|
-
# Comment node type, see Nokogiri::XML::Node#comment?
|
63
|
+
# Comment node type, see {Nokogiri::XML::Node#comment?}
|
74
64
|
COMMENT_NODE = 8
|
75
|
-
# Document node type, see Nokogiri::XML::Node#xml?
|
65
|
+
# Document node type, see {Nokogiri::XML::Node#xml?}
|
76
66
|
DOCUMENT_NODE = 9
|
77
67
|
# Document type node type
|
78
68
|
DOCUMENT_TYPE_NODE = 10
|
@@ -80,7 +70,7 @@ module Nokogiri
|
|
80
70
|
DOCUMENT_FRAG_NODE = 11
|
81
71
|
# Notation node type
|
82
72
|
NOTATION_NODE = 12
|
83
|
-
# HTML document node type, see Nokogiri::XML::Node#html?
|
73
|
+
# HTML document node type, see {Nokogiri::XML::Node#html?}
|
84
74
|
HTML_DOCUMENT_NODE = 13
|
85
75
|
# DTD node type
|
86
76
|
DTD_NODE = 14
|
@@ -99,8 +89,14 @@ module Nokogiri
|
|
99
89
|
# DOCB document node type
|
100
90
|
DOCB_DOCUMENT_NODE = 21
|
101
91
|
|
102
|
-
|
103
|
-
|
92
|
+
##
|
93
|
+
# Create a new node with +name+ sharing GC lifecycle with +document+.
|
94
|
+
# @param name [String]
|
95
|
+
# @param document [Nokogiri::XML::Document]
|
96
|
+
# @return [Nokogiri::XML::Node]
|
97
|
+
# @see Nokogiri::XML::Node.new
|
98
|
+
def initialize(name, document)
|
99
|
+
# This is intentionally empty.
|
104
100
|
end
|
105
101
|
|
106
102
|
###
|
data/lib/nokogiri/xml/reader.rb
CHANGED
@@ -86,7 +86,8 @@ module Nokogiri
|
|
86
86
|
private :initialize
|
87
87
|
|
88
88
|
###
|
89
|
-
# Get
|
89
|
+
# Get the attributes of the current node as a Hash
|
90
|
+
# @return [Hash<String, String>] Attribute names and values
|
90
91
|
def attributes
|
91
92
|
attrs_hash = attribute_nodes.each_with_object({}) do |node, hash|
|
92
93
|
hash[node.name] = node.to_s
|
@@ -96,14 +97,6 @@ module Nokogiri
|
|
96
97
|
attrs_hash
|
97
98
|
end
|
98
99
|
|
99
|
-
###
|
100
|
-
# Get a list of attributes for the current node
|
101
|
-
def attribute_nodes
|
102
|
-
nodes = attr_nodes
|
103
|
-
nodes.each { |v| v.instance_variable_set(:@_r, self) }
|
104
|
-
nodes
|
105
|
-
end
|
106
|
-
|
107
100
|
###
|
108
101
|
# Move the cursor through the document yielding the cursor to the block
|
109
102
|
def each
|
data/lib/nokogiri/xml/xpath.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nokogiri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.2
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Mike Dalessio
|
@@ -17,7 +17,7 @@ authors:
|
|
17
17
|
autorequire:
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
|
-
date: 2021-
|
20
|
+
date: 2021-03-11 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '1.
|
69
|
+
version: '1.4'
|
70
70
|
name: hoe-markdown
|
71
71
|
type: :development
|
72
72
|
prerelease: false
|
@@ -74,7 +74,7 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - "~>"
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: '1.
|
77
|
+
version: '1.4'
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
79
|
requirement: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
@@ -213,17 +213,16 @@ extra_rdoc_files:
|
|
213
213
|
- ext/nokogiri/xml_dtd.c
|
214
214
|
- ext/nokogiri/xml_xpath_context.c
|
215
215
|
- ext/nokogiri/xml_attr.c
|
216
|
+
- ext/nokogiri/libxml2_backwards_compat.c
|
216
217
|
- ext/nokogiri/xml_comment.c
|
217
218
|
- ext/nokogiri/nokogiri.c
|
218
219
|
- ext/nokogiri/xml_sax_parser_context.c
|
219
220
|
- ext/nokogiri/xml_node_set.c
|
220
221
|
- ext/nokogiri/xml_reader.c
|
221
|
-
- ext/nokogiri/xml_libxml2_hacks.c
|
222
222
|
- ext/nokogiri/xml_cdata.c
|
223
223
|
- ext/nokogiri/xml_element_content.c
|
224
224
|
- ext/nokogiri/html_entity_lookup.c
|
225
225
|
- ext/nokogiri/xml_namespace.c
|
226
|
-
- ext/nokogiri/xml_io.c
|
227
226
|
- ext/nokogiri/xml_document.c
|
228
227
|
- ext/nokogiri/xml_element_decl.c
|
229
228
|
- ext/nokogiri/xml_schema.c
|
@@ -347,6 +346,7 @@ files:
|
|
347
346
|
- ext/nokogiri/html_entity_lookup.c
|
348
347
|
- ext/nokogiri/html_sax_parser_context.c
|
349
348
|
- ext/nokogiri/html_sax_push_parser.c
|
349
|
+
- ext/nokogiri/libxml2_backwards_compat.c
|
350
350
|
- ext/nokogiri/nokogiri.c
|
351
351
|
- ext/nokogiri/test_global_handlers.c
|
352
352
|
- ext/nokogiri/xml_attr.c
|
@@ -361,8 +361,6 @@ files:
|
|
361
361
|
- ext/nokogiri/xml_encoding_handler.c
|
362
362
|
- ext/nokogiri/xml_entity_decl.c
|
363
363
|
- ext/nokogiri/xml_entity_reference.c
|
364
|
-
- ext/nokogiri/xml_io.c
|
365
|
-
- ext/nokogiri/xml_libxml2_hacks.c
|
366
364
|
- ext/nokogiri/xml_namespace.c
|
367
365
|
- ext/nokogiri/xml_node.c
|
368
366
|
- ext/nokogiri/xml_node_set.c
|
@@ -392,6 +390,7 @@ files:
|
|
392
390
|
- lib/nokogiri/css/tokenizer.rex
|
393
391
|
- lib/nokogiri/css/xpath_visitor.rb
|
394
392
|
- lib/nokogiri/decorators/slop.rb
|
393
|
+
- lib/nokogiri/extension.rb
|
395
394
|
- lib/nokogiri/html.rb
|
396
395
|
- lib/nokogiri/html/builder.rb
|
397
396
|
- lib/nokogiri/html/document.rb
|