nokogiri 1.19.3-java → 1.19.5-java
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/LICENSE-DEPENDENCIES.md +29 -0
- data/ext/java/nokogiri/XmlAttr.java +3 -0
- data/ext/java/nokogiri/XmlDocument.java +5 -1
- data/ext/java/nokogiri/XmlNode.java +69 -38
- data/ext/java/nokogiri/XmlNodeSet.java +19 -25
- data/ext/java/nokogiri/XmlReader.java +4 -1
- data/ext/java/nokogiri/XmlSchema.java +22 -9
- data/ext/java/nokogiri/XmlXpathContext.java +5 -15
- data/ext/java/nokogiri/internals/NokogiriEntityResolver.java +5 -7
- data/ext/java/nokogiri/internals/NokogiriHelpers.java +68 -0
- data/ext/java/nokogiri/internals/NokogiriXPathContext.java +37 -0
- data/ext/nokogiri/extconf.rb +1 -0
- data/ext/nokogiri/gumbo.c +83 -6
- data/ext/nokogiri/html4_document.c +10 -3
- data/ext/nokogiri/libxml2_polyfill.c +12 -0
- data/ext/nokogiri/nokogiri.c +90 -5
- data/ext/nokogiri/xml_attr.c +28 -23
- data/ext/nokogiri/xml_document.c +64 -30
- data/ext/nokogiri/xml_node.c +151 -52
- data/ext/nokogiri/xml_node_set.c +10 -10
- data/ext/nokogiri/xml_reader.c +198 -107
- data/ext/nokogiri/xml_sax_parser.c +3 -3
- data/ext/nokogiri/xml_sax_parser_context.c +38 -7
- data/ext/nokogiri/xml_sax_push_parser.c +12 -0
- data/ext/nokogiri/xml_xpath_context.c +135 -27
- data/ext/nokogiri/xslt_stylesheet.c +123 -27
- data/lib/nokogiri/css/parser.rb +35 -18
- data/lib/nokogiri/css/parser.y +35 -17
- data/lib/nokogiri/css/xpath_visitor.rb +71 -28
- data/lib/nokogiri/html5/document.rb +9 -0
- data/lib/nokogiri/html5/document_fragment.rb +16 -1
- data/lib/nokogiri/html5/node.rb +1 -1
- data/lib/nokogiri/html5.rb +16 -0
- data/lib/nokogiri/nokogiri.jar +0 -0
- data/lib/nokogiri/version/constant.rb +1 -1
- data/lib/nokogiri/version/info.rb +10 -0
- data/lib/nokogiri/xml/attr.rb +2 -0
- data/lib/nokogiri/xml/attribute_decl.rb +2 -1
- data/lib/nokogiri/xml/builder.rb +24 -32
- data/lib/nokogiri/xml/document.rb +4 -2
- data/lib/nokogiri/xml/dtd.rb +2 -1
- data/lib/nokogiri/xml/element_decl.rb +2 -1
- data/lib/nokogiri/xml/entity_decl.rb +2 -1
- data/lib/nokogiri/xml/node.rb +65 -12
- metadata +3 -2
data/lib/nokogiri/xml/dtd.rb
CHANGED
|
@@ -7,7 +7,8 @@ module Nokogiri
|
|
|
7
7
|
undef_method :attributes
|
|
8
8
|
undef_method :namespace
|
|
9
9
|
undef_method :namespace_definitions
|
|
10
|
-
undef_method :line
|
|
10
|
+
undef_method :line
|
|
11
|
+
undef_method :line= if method_defined?(:line=)
|
|
11
12
|
|
|
12
13
|
def self.new(name, doc, *args)
|
|
13
14
|
doc.create_entity(name, *args)
|
data/lib/nokogiri/xml/node.rb
CHANGED
|
@@ -505,13 +505,15 @@ module Nokogiri
|
|
|
505
505
|
end
|
|
506
506
|
|
|
507
507
|
###
|
|
508
|
-
# Set the
|
|
509
|
-
#
|
|
510
|
-
#
|
|
511
|
-
#
|
|
512
|
-
#
|
|
508
|
+
# Set the namespace of this node to the Namespace object +ns+, which must belong to this
|
|
509
|
+
# node's document. Pass +nil+ to remove the node's namespace.
|
|
510
|
+
#
|
|
511
|
+
# If no declaration of the namespace's prefix is in scope on this node, a declaration of
|
|
512
|
+
# +ns+ is added to this node.
|
|
513
|
+
#
|
|
514
|
+
# To declare a prefixed namespace without putting this node in it, use #add_namespace_definition.
|
|
513
515
|
def namespace=(ns)
|
|
514
|
-
return set_namespace(ns)
|
|
516
|
+
return set_namespace(ns) if ns.nil?
|
|
515
517
|
|
|
516
518
|
unless Nokogiri::XML::Namespace === ns
|
|
517
519
|
raise TypeError, "#{ns.class} can't be coerced into Nokogiri::XML::Namespace"
|
|
@@ -523,16 +525,67 @@ module Nokogiri
|
|
|
523
525
|
set_namespace(ns)
|
|
524
526
|
end
|
|
525
527
|
|
|
528
|
+
XINCLUDE_NAMESPACES = {
|
|
529
|
+
"xi2001" => "http://www.w3.org/2001/XInclude",
|
|
530
|
+
"xi2003" => "http://www.w3.org/2003/XInclude",
|
|
531
|
+
}.freeze
|
|
532
|
+
private_constant :XINCLUDE_NAMESPACES
|
|
533
|
+
|
|
534
|
+
# Every top-level <xi:include> in the subtree, in either XInclude namespace, excluding
|
|
535
|
+
# includes nested inside another include's fallback (libxml2 only expands those if the
|
|
536
|
+
# parent include fails).
|
|
537
|
+
XINCLUDE_QUERY =
|
|
538
|
+
"descendant-or-self::xi2001:include[not(ancestor::xi2001:include) and not(ancestor::xi2003:include)] | " \
|
|
539
|
+
"descendant-or-self::xi2003:include[not(ancestor::xi2001:include) and not(ancestor::xi2003:include)]"
|
|
540
|
+
private_constant :XINCLUDE_QUERY
|
|
541
|
+
|
|
526
542
|
###
|
|
527
|
-
#
|
|
528
|
-
#
|
|
529
|
-
#
|
|
530
|
-
|
|
543
|
+
# :call-seq:
|
|
544
|
+
# do_xinclude(options = ParseOptions::DEFAULT_XML, safe_copy: true) → self
|
|
545
|
+
# do_xinclude(options = ParseOptions::DEFAULT_XML, safe_copy: true) { |options| ... } → self
|
|
546
|
+
#
|
|
547
|
+
# Do XInclude substitution on the subtree below this node, replacing each +<xi:include>+ with
|
|
548
|
+
# the content it references.
|
|
549
|
+
#
|
|
550
|
+
# [Parameters]
|
|
551
|
+
# - +options+ (Nokogiri::XML::ParseOptions) The parser options for the substitution. (default
|
|
552
|
+
# +ParseOptions::DEFAULT_XML+)
|
|
553
|
+
#
|
|
554
|
+
# [Optional Keyword Arguments]
|
|
555
|
+
# - +safe_copy:+ (Boolean) Operate on a defensive copy of each +<xi:include>+ element, to
|
|
556
|
+
# prevent libxml2 from freeing memory that is bound to live Ruby objects. (default +true+)
|
|
557
|
+
#
|
|
558
|
+
# When +true+, each +<xi:include>+ is processed on an unwrapped copy of itself, so libxml2
|
|
559
|
+
# frees the copy while the original node is unlinked from the document and kept alive. This
|
|
560
|
+
# prevents a use-after-free when the +<xi:include>+ node, or any of its descendants or
|
|
561
|
+
# namespaces, has already been exposed to Ruby; as a consequence such a wrapped node ends up
|
|
562
|
+
# detached from the document rather than removed or converted in place.
|
|
563
|
+
#
|
|
564
|
+
# When +false+, the document is processed in place. This is faster but only safe when nothing
|
|
565
|
+
# in the subtree has been exposed to Ruby (for example, immediately after parsing), which is
|
|
566
|
+
# why Document.parse uses it.
|
|
567
|
+
#
|
|
568
|
+
# This option has no effect on the pure-Java backend, which performs XInclude substitution
|
|
569
|
+
# during parsing.
|
|
570
|
+
#
|
|
571
|
+
# [Yields]
|
|
572
|
+
# If a block is given, a Nokogiri::XML::ParseOptions object initialized from +options+ is
|
|
573
|
+
# yielded to it, which can be configured before substitution.
|
|
574
|
+
#
|
|
575
|
+
# [Returns] +self+ (Nokogiri::XML::Node)
|
|
576
|
+
def do_xinclude(options = XML::ParseOptions::DEFAULT_XML, safe_copy: true)
|
|
531
577
|
options = Nokogiri::XML::ParseOptions.new(options) if Integer === options
|
|
532
578
|
yield options if block_given?
|
|
533
579
|
|
|
534
|
-
|
|
535
|
-
|
|
580
|
+
if safe_copy && Nokogiri.uses_libxml?
|
|
581
|
+
xpath(XINCLUDE_QUERY, XINCLUDE_NAMESPACES).each do |include_node|
|
|
582
|
+
include_node.safe_process_xinclude(options.to_i)
|
|
583
|
+
end
|
|
584
|
+
else
|
|
585
|
+
process_xincludes(options.to_i)
|
|
586
|
+
end
|
|
587
|
+
|
|
588
|
+
self
|
|
536
589
|
end
|
|
537
590
|
|
|
538
591
|
alias_method :next, :next_sibling
|
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.19.
|
|
4
|
+
version: 1.19.5
|
|
5
5
|
platform: java
|
|
6
6
|
authors:
|
|
7
7
|
- Mike Dalessio
|
|
@@ -19,7 +19,7 @@ authors:
|
|
|
19
19
|
- Nobuyoshi Nakada
|
|
20
20
|
bindir: bin
|
|
21
21
|
cert_chain: []
|
|
22
|
-
date: 2026-
|
|
22
|
+
date: 2026-11-02 00:00:00.000000000 Z
|
|
23
23
|
dependencies:
|
|
24
24
|
- !ruby/object:Gem::Dependency
|
|
25
25
|
name: jar-dependencies
|
|
@@ -147,6 +147,7 @@ files:
|
|
|
147
147
|
- ext/java/nokogiri/internals/NokogiriNonStrictErrorHandler.java
|
|
148
148
|
- ext/java/nokogiri/internals/NokogiriNonStrictErrorHandler4NekoHtml.java
|
|
149
149
|
- ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
|
|
150
|
+
- ext/java/nokogiri/internals/NokogiriXPathContext.java
|
|
150
151
|
- ext/java/nokogiri/internals/NokogiriXPathFunction.java
|
|
151
152
|
- ext/java/nokogiri/internals/NokogiriXPathFunctionResolver.java
|
|
152
153
|
- ext/java/nokogiri/internals/NokogiriXPathVariableResolver.java
|