nokogiri 1.15.4 → 1.17.2

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.

Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +12 -19
  3. data/README.md +8 -1
  4. data/dependencies.yml +9 -8
  5. data/ext/nokogiri/extconf.rb +194 -141
  6. data/ext/nokogiri/gumbo.c +69 -53
  7. data/ext/nokogiri/html4_document.c +10 -4
  8. data/ext/nokogiri/html4_element_description.c +18 -18
  9. data/ext/nokogiri/html4_sax_parser.c +40 -0
  10. data/ext/nokogiri/html4_sax_parser_context.c +48 -58
  11. data/ext/nokogiri/html4_sax_push_parser.c +26 -25
  12. data/ext/nokogiri/libxml2_polyfill.c +114 -0
  13. data/ext/nokogiri/nokogiri.c +9 -2
  14. data/ext/nokogiri/nokogiri.h +25 -33
  15. data/ext/nokogiri/test_global_handlers.c +1 -1
  16. data/ext/nokogiri/xml_attr.c +1 -1
  17. data/ext/nokogiri/xml_cdata.c +3 -12
  18. data/ext/nokogiri/xml_comment.c +3 -8
  19. data/ext/nokogiri/xml_document.c +167 -156
  20. data/ext/nokogiri/xml_document_fragment.c +10 -25
  21. data/ext/nokogiri/xml_dtd.c +1 -1
  22. data/ext/nokogiri/xml_element_content.c +9 -9
  23. data/ext/nokogiri/xml_encoding_handler.c +4 -4
  24. data/ext/nokogiri/xml_namespace.c +6 -10
  25. data/ext/nokogiri/xml_node.c +142 -108
  26. data/ext/nokogiri/xml_node_set.c +46 -44
  27. data/ext/nokogiri/xml_reader.c +74 -100
  28. data/ext/nokogiri/xml_relax_ng.c +35 -56
  29. data/ext/nokogiri/xml_sax_parser.c +156 -88
  30. data/ext/nokogiri/xml_sax_parser_context.c +214 -128
  31. data/ext/nokogiri/xml_sax_push_parser.c +69 -50
  32. data/ext/nokogiri/xml_schema.c +51 -87
  33. data/ext/nokogiri/xml_syntax_error.c +19 -11
  34. data/ext/nokogiri/xml_text.c +3 -6
  35. data/ext/nokogiri/xml_xpath_context.c +4 -7
  36. data/ext/nokogiri/xslt_stylesheet.c +16 -11
  37. data/gumbo-parser/Makefile +18 -0
  38. data/gumbo-parser/src/error.c +76 -48
  39. data/gumbo-parser/src/error.h +5 -1
  40. data/gumbo-parser/src/nokogiri_gumbo.h +11 -2
  41. data/gumbo-parser/src/parser.c +64 -23
  42. data/gumbo-parser/src/tokenizer.c +7 -6
  43. data/lib/nokogiri/class_resolver.rb +1 -1
  44. data/lib/nokogiri/css/node.rb +6 -2
  45. data/lib/nokogiri/css/parser.rb +6 -4
  46. data/lib/nokogiri/css/parser.y +2 -2
  47. data/lib/nokogiri/css/parser_extras.rb +6 -66
  48. data/lib/nokogiri/css/selector_cache.rb +38 -0
  49. data/lib/nokogiri/css/tokenizer.rb +4 -4
  50. data/lib/nokogiri/css/tokenizer.rex +9 -8
  51. data/lib/nokogiri/css/xpath_visitor.rb +43 -27
  52. data/lib/nokogiri/css.rb +86 -20
  53. data/lib/nokogiri/decorators/slop.rb +3 -5
  54. data/lib/nokogiri/encoding_handler.rb +2 -2
  55. data/lib/nokogiri/html4/document.rb +45 -24
  56. data/lib/nokogiri/html4/document_fragment.rb +124 -12
  57. data/lib/nokogiri/html4/encoding_reader.rb +2 -2
  58. data/lib/nokogiri/html4/sax/parser.rb +23 -38
  59. data/lib/nokogiri/html4/sax/parser_context.rb +4 -9
  60. data/lib/nokogiri/html4.rb +9 -14
  61. data/lib/nokogiri/html5/builder.rb +40 -0
  62. data/lib/nokogiri/html5/document.rb +61 -30
  63. data/lib/nokogiri/html5/document_fragment.rb +130 -20
  64. data/lib/nokogiri/html5/node.rb +4 -4
  65. data/lib/nokogiri/html5.rb +114 -138
  66. data/lib/nokogiri/version/constant.rb +1 -1
  67. data/lib/nokogiri/version/info.rb +6 -5
  68. data/lib/nokogiri/xml/attr.rb +2 -2
  69. data/lib/nokogiri/xml/builder.rb +8 -1
  70. data/lib/nokogiri/xml/document.rb +74 -31
  71. data/lib/nokogiri/xml/document_fragment.rb +86 -15
  72. data/lib/nokogiri/xml/namespace.rb +1 -2
  73. data/lib/nokogiri/xml/node.rb +113 -35
  74. data/lib/nokogiri/xml/node_set.rb +12 -10
  75. data/lib/nokogiri/xml/parse_options.rb +1 -1
  76. data/lib/nokogiri/xml/pp/node.rb +6 -1
  77. data/lib/nokogiri/xml/reader.rb +51 -17
  78. data/lib/nokogiri/xml/relax_ng.rb +57 -20
  79. data/lib/nokogiri/xml/sax/document.rb +174 -83
  80. data/lib/nokogiri/xml/sax/parser.rb +115 -41
  81. data/lib/nokogiri/xml/sax/parser_context.rb +116 -8
  82. data/lib/nokogiri/xml/sax/push_parser.rb +3 -0
  83. data/lib/nokogiri/xml/sax.rb +48 -0
  84. data/lib/nokogiri/xml/schema.rb +112 -45
  85. data/lib/nokogiri/xml/searchable.rb +9 -11
  86. data/lib/nokogiri/xml/syntax_error.rb +23 -1
  87. data/lib/nokogiri/xml.rb +14 -25
  88. data/lib/nokogiri/xslt/stylesheet.rb +29 -7
  89. data/lib/nokogiri/xslt.rb +4 -10
  90. data/lib/nokogiri.rb +1 -1
  91. data/lib/xsd/xmlparser/nokogiri.rb +3 -4
  92. data/ports/archives/libxml2-2.13.5.tar.xz +0 -0
  93. data/ports/archives/libxslt-1.1.42.tar.xz +0 -0
  94. metadata +15 -14
  95. data/ext/nokogiri/libxml2_backwards_compat.c +0 -121
  96. data/patches/libxml2/0003-libxml2.la-is-in-top_builddir.patch +0 -25
  97. data/ports/archives/libxml2-2.11.5.tar.xz +0 -0
  98. data/ports/archives/libxslt-1.1.38.tar.xz +0 -0
@@ -6,11 +6,33 @@ module Nokogiri
6
6
  # This class provides information about XML SyntaxErrors. These
7
7
  # exceptions are typically stored on Nokogiri::XML::Document#errors.
8
8
  class SyntaxError < ::Nokogiri::SyntaxError
9
+ class << self
10
+ def aggregate(errors)
11
+ return nil if errors.empty?
12
+ return errors.first if errors.length == 1
13
+
14
+ messages = ["Multiple errors encountered:"]
15
+ errors.each do |error|
16
+ messages << error.to_s
17
+ end
18
+ new(messages.join("\n"))
19
+ end
20
+ end
21
+
9
22
  attr_reader :domain
10
23
  attr_reader :code
11
24
  attr_reader :level
12
25
  attr_reader :file
13
26
  attr_reader :line
27
+
28
+ # The XPath path of the node that caused the error when validating a `Nokogiri::XML::Document`.
29
+ #
30
+ # This attribute will only be non-nil when the error is emitted by `Schema#validate` on
31
+ # Document objects. It will return `nil` for DOM parsing errors and for errors emitted during
32
+ # Schema validation of files.
33
+ #
34
+ # ⚠ `#path` is not supported on JRuby, where it will always return `nil`.
35
+ attr_reader :path
14
36
  attr_reader :str1
15
37
  attr_reader :str2
16
38
  attr_reader :str3
@@ -63,7 +85,7 @@ module Nokogiri
63
85
  end
64
86
 
65
87
  def location_to_s
66
- return nil if nil_or_zero?(line) && nil_or_zero?(column)
88
+ return if nil_or_zero?(line) && nil_or_zero?(column)
67
89
 
68
90
  "#{line}:#{column}"
69
91
  end
data/lib/nokogiri/xml.rb CHANGED
@@ -2,45 +2,34 @@
2
2
 
3
3
  module Nokogiri
4
4
  class << self
5
- ###
6
- # Parse XML. Convenience method for Nokogiri::XML::Document.parse
7
- def XML(thing, url = nil, encoding = nil, options = XML::ParseOptions::DEFAULT_XML, &block)
8
- Nokogiri::XML::Document.parse(thing, url, encoding, options, &block)
5
+ # Convenience method for Nokogiri::XML::Document.parse
6
+ def XML(...)
7
+ Nokogiri::XML::Document.parse(...)
9
8
  end
10
9
  end
11
10
 
12
11
  module XML
13
12
  # Original C14N 1.0 spec canonicalization
14
- XML_C14N_1_0 = 0
13
+ XML_C14N_1_0 = 0
15
14
  # Exclusive C14N 1.0 spec canonicalization
16
15
  XML_C14N_EXCLUSIVE_1_0 = 1
17
16
  # C14N 1.1 spec canonicalization
18
17
  XML_C14N_1_1 = 2
19
- class << self
20
- ###
21
- # Parse an XML document using the Nokogiri::XML::Reader API. See
22
- # Nokogiri::XML::Reader for mor information
23
- def Reader(string_or_io, url = nil, encoding = nil, options = ParseOptions::STRICT)
24
- options = Nokogiri::XML::ParseOptions.new(options) if Integer === options
25
- yield options if block_given?
26
-
27
- if string_or_io.respond_to?(:read)
28
- return Reader.from_io(string_or_io, url, encoding, options.to_i)
29
- end
30
18
 
31
- Reader.from_memory(string_or_io, url, encoding, options.to_i)
19
+ class << self
20
+ # Convenience method for Nokogiri::XML::Reader.new
21
+ def Reader(...)
22
+ Reader.new(...)
32
23
  end
33
24
 
34
- ###
35
- # Parse XML. Convenience method for Nokogiri::XML::Document.parse
36
- def parse(thing, url = nil, encoding = nil, options = ParseOptions::DEFAULT_XML, &block)
37
- Document.parse(thing, url, encoding, options, &block)
25
+ # Convenience method for Nokogiri::XML::Document.parse
26
+ def parse(...)
27
+ Document.parse(...)
38
28
  end
39
29
 
40
- ####
41
- # Parse a fragment from +string+ in to a NodeSet.
42
- def fragment(string, options = ParseOptions::DEFAULT_XML, &block)
43
- XML::DocumentFragment.parse(string, options, &block)
30
+ # Convenience method for Nokogiri::XML::DocumentFragment.parse
31
+ def fragment(...)
32
+ XML::DocumentFragment.parse(...)
44
33
  end
45
34
  end
46
35
  end
@@ -10,15 +10,37 @@ module Nokogiri
10
10
  # doc = Nokogiri::XML(File.read('some_file.xml'))
11
11
  # xslt = Nokogiri::XSLT(File.read('some_transformer.xslt'))
12
12
  #
13
- # puts xslt.transform(doc)
13
+ # xslt.transform(doc) # => Nokogiri::XML::Document
14
14
  #
15
- # See Nokogiri::XSLT::Stylesheet#transform for more transformation
16
- # information.
15
+ # Many XSLT transformations include serialization behavior to emit a non-XML document. For these
16
+ # cases, please take care to invoke the #serialize method on the result of the transformation:
17
+ #
18
+ # doc = Nokogiri::XML(File.read('some_file.xml'))
19
+ # xslt = Nokogiri::XSLT(File.read('some_transformer.xslt'))
20
+ # xslt.serialize(xslt.transform(doc)) # => String
21
+ #
22
+ # or use the #apply_to method, which is a shortcut for `serialize(transform(document))`:
23
+ #
24
+ # doc = Nokogiri::XML(File.read('some_file.xml'))
25
+ # xslt = Nokogiri::XSLT(File.read('some_transformer.xslt'))
26
+ # xslt.apply_to(doc) # => String
27
+ #
28
+ # See Nokogiri::XSLT::Stylesheet#transform for more information and examples.
17
29
  class Stylesheet
18
- ###
19
- # Apply an XSLT stylesheet to an XML::Document.
20
- # +params+ is an array of strings used as XSLT parameters.
21
- # returns serialized document
30
+ # :call-seq:
31
+ # apply_to(document, params = []) -> String
32
+ #
33
+ # Apply an XSLT stylesheet to an XML::Document and serialize it properly. This method is
34
+ # equivalent to calling #serialize on the result of #transform.
35
+ #
36
+ # [Parameters]
37
+ # - +document+ is an instance of XML::Document to transform
38
+ # - +params+ is an array of strings used as XSLT parameters, passed into #transform
39
+ #
40
+ # [Returns]
41
+ # A string containing the serialized result of the transformation.
42
+ #
43
+ # See Nokogiri::XSLT::Stylesheet#transform for more information and examples.
22
44
  def apply_to(document, params = [])
23
45
  serialize(transform(document, params))
24
46
  end
data/lib/nokogiri/xslt.rb CHANGED
@@ -3,15 +3,9 @@
3
3
 
4
4
  module Nokogiri
5
5
  class << self
6
- ###
7
- # Create a Nokogiri::XSLT::Stylesheet with +stylesheet+.
8
- #
9
- # Example:
10
- #
11
- # xslt = Nokogiri::XSLT(File.read(ARGV[0]))
12
- #
13
- def XSLT(stylesheet, modules = {})
14
- XSLT.parse(stylesheet, modules)
6
+ # Convenience method for Nokogiri::XSLT.parse
7
+ def XSLT(...)
8
+ XSLT.parse(...)
15
9
  end
16
10
  end
17
11
 
@@ -101,7 +95,7 @@ module Nokogiri
101
95
  params.flatten.each_slice(2).with_object([]) do |kv, quoted_params|
102
96
  key, value = kv.map(&:to_s)
103
97
  value = if value.include?("'")
104
- "concat('#{value.gsub(/'/, %q{', "'", '})}')"
98
+ "concat('#{value.gsub("'", %q{', "'", '})}')"
105
99
  else
106
100
  "'#{value}'"
107
101
  end
data/lib/nokogiri.rb CHANGED
@@ -94,7 +94,7 @@ module Nokogiri
94
94
 
95
95
  # :nodoc:
96
96
  def install_default_aliases
97
- warn("Nokogiri.install_default_aliases is deprecated and will be removed in a future version of Nokogiri. Please call Nokogiri::EncodingHandler.install_default_aliases instead.")
97
+ warn("Nokogiri.install_default_aliases is deprecated. Please call Nokogiri::EncodingHandler.install_default_aliases instead. This will become an error in Nokogiri v1.17.0.", uplevel: 1, category: :deprecated) # deprecated in v1.14.0, remove in v1.17.0
98
98
  Nokogiri::EncodingHandler.install_default_aliases
99
99
  end
100
100
  end
@@ -7,10 +7,9 @@ module XSD
7
7
  ###
8
8
  # Nokogiri XML parser for soap4r.
9
9
  #
10
- # Nokogiri may be used as the XML parser in soap4r. Simply require
11
- # 'xsd/xmlparser/nokogiri' in your soap4r applications, and soap4r
12
- # will use Nokogiri as it's XML parser. No other changes should be
13
- # required to use Nokogiri as the XML parser.
10
+ # Nokogiri may be used as the XML parser in soap4r. Require 'xsd/xmlparser/nokogiri' in your
11
+ # soap4r applications, and soap4r will use Nokogiri as its XML parser. No other changes should
12
+ # be required to use Nokogiri as the XML parser.
14
13
  #
15
14
  # Example (using UW ITS Web Services):
16
15
  #
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.15.4
4
+ version: 1.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Dalessio
@@ -17,10 +17,10 @@ authors:
17
17
  - Sergio Arbeo
18
18
  - Timothy Elliott
19
19
  - Nobuyoshi Nakada
20
- autorequire:
20
+ autorequire:
21
21
  bindir: bin
22
22
  cert_chain: []
23
- date: 2023-08-11 00:00:00.000000000 Z
23
+ date: 2024-12-12 00:00:00.000000000 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: mini_portile2
@@ -36,7 +36,6 @@ dependencies:
36
36
  - - "~>"
37
37
  - !ruby/object:Gem::Version
38
38
  version: 2.8.2
39
- force_ruby_platform: false
40
39
  - !ruby/object:Gem::Dependency
41
40
  name: racc
42
41
  requirement: !ruby/object:Gem::Requirement
@@ -51,7 +50,6 @@ dependencies:
51
50
  - - "~>"
52
51
  - !ruby/object:Gem::Version
53
52
  version: '1.4'
54
- force_ruby_platform: false
55
53
  description: |
56
54
  Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby. It provides a
57
55
  sensible, easy-to-understand API for reading, writing, modifying, and querying documents. It is
@@ -66,9 +64,10 @@ extra_rdoc_files:
66
64
  - ext/nokogiri/html4_document.c
67
65
  - ext/nokogiri/html4_element_description.c
68
66
  - ext/nokogiri/html4_entity_lookup.c
67
+ - ext/nokogiri/html4_sax_parser.c
69
68
  - ext/nokogiri/html4_sax_parser_context.c
70
69
  - ext/nokogiri/html4_sax_push_parser.c
71
- - ext/nokogiri/libxml2_backwards_compat.c
70
+ - ext/nokogiri/libxml2_polyfill.c
72
71
  - ext/nokogiri/nokogiri.c
73
72
  - ext/nokogiri/test_global_handlers.c
74
73
  - ext/nokogiri/xml_attr.c
@@ -111,9 +110,10 @@ files:
111
110
  - ext/nokogiri/html4_document.c
112
111
  - ext/nokogiri/html4_element_description.c
113
112
  - ext/nokogiri/html4_entity_lookup.c
113
+ - ext/nokogiri/html4_sax_parser.c
114
114
  - ext/nokogiri/html4_sax_parser_context.c
115
115
  - ext/nokogiri/html4_sax_push_parser.c
116
- - ext/nokogiri/libxml2_backwards_compat.c
116
+ - ext/nokogiri/libxml2_polyfill.c
117
117
  - ext/nokogiri/nokogiri.c
118
118
  - ext/nokogiri/nokogiri.h
119
119
  - ext/nokogiri/test_global_handlers.c
@@ -195,6 +195,7 @@ files:
195
195
  - lib/nokogiri/css/parser.rb
196
196
  - lib/nokogiri/css/parser.y
197
197
  - lib/nokogiri/css/parser_extras.rb
198
+ - lib/nokogiri/css/selector_cache.rb
198
199
  - lib/nokogiri/css/syntax_error.rb
199
200
  - lib/nokogiri/css/tokenizer.rb
200
201
  - lib/nokogiri/css/tokenizer.rex
@@ -216,6 +217,7 @@ files:
216
217
  - lib/nokogiri/html4/sax/parser_context.rb
217
218
  - lib/nokogiri/html4/sax/push_parser.rb
218
219
  - lib/nokogiri/html5.rb
220
+ - lib/nokogiri/html5/builder.rb
219
221
  - lib/nokogiri/html5/document.rb
220
222
  - lib/nokogiri/html5/document_fragment.rb
221
223
  - lib/nokogiri/html5/node.rb
@@ -267,13 +269,12 @@ files:
267
269
  - lib/xsd/xmlparser/nokogiri.rb
268
270
  - patches/libxml2/0001-Remove-script-macro-support.patch
269
271
  - patches/libxml2/0002-Update-entities-to-remove-handling-of-ssi.patch
270
- - patches/libxml2/0003-libxml2.la-is-in-top_builddir.patch
271
272
  - patches/libxml2/0009-allow-wildcard-namespaces.patch
272
273
  - patches/libxml2/0010-update-config.guess-and-config.sub-for-libxml2.patch
273
274
  - patches/libxml2/0011-rip-out-libxml2-s-libc_single_threaded-support.patch
274
275
  - patches/libxslt/0001-update-config.guess-and-config.sub-for-libxslt.patch
275
- - ports/archives/libxml2-2.11.5.tar.xz
276
- - ports/archives/libxslt-1.1.38.tar.xz
276
+ - ports/archives/libxml2-2.13.5.tar.xz
277
+ - ports/archives/libxslt-1.1.42.tar.xz
277
278
  homepage: https://nokogiri.org
278
279
  licenses:
279
280
  - MIT
@@ -284,7 +285,7 @@ metadata:
284
285
  changelog_uri: https://nokogiri.org/CHANGELOG.html
285
286
  source_code_uri: https://github.com/sparklemotion/nokogiri
286
287
  rubygems_mfa_required: 'true'
287
- post_install_message:
288
+ post_install_message:
288
289
  rdoc_options:
289
290
  - "--main"
290
291
  - README.md
@@ -294,15 +295,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
294
295
  requirements:
295
296
  - - ">="
296
297
  - !ruby/object:Gem::Version
297
- version: 2.7.0
298
+ version: 3.0.0
298
299
  required_rubygems_version: !ruby/object:Gem::Requirement
299
300
  requirements:
300
301
  - - ">="
301
302
  - !ruby/object:Gem::Version
302
303
  version: '0'
303
304
  requirements: []
304
- rubygems_version: 3.4.10
305
- signing_key:
305
+ rubygems_version: 3.3.22
306
+ signing_key:
306
307
  specification_version: 4
307
308
  summary: Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby.
308
309
  test_files: []
@@ -1,121 +0,0 @@
1
- #ifndef HAVE_XMLFIRSTELEMENTCHILD
2
- #include <nokogiri.h>
3
- /**
4
- * xmlFirstElementChild:
5
- * @parent: the parent node
6
- *
7
- * Finds the first child node of that element which is a Element node
8
- * Note the handling of entities references is different than in
9
- * the W3C DOM element traversal spec since we don't have back reference
10
- * from entities content to entities references.
11
- *
12
- * Returns the first element child or NULL if not available
13
- */
14
- xmlNodePtr
15
- xmlFirstElementChild(xmlNodePtr parent)
16
- {
17
- xmlNodePtr cur = NULL;
18
-
19
- if (parent == NULL) {
20
- return (NULL);
21
- }
22
- switch (parent->type) {
23
- case XML_ELEMENT_NODE:
24
- case XML_ENTITY_NODE:
25
- case XML_DOCUMENT_NODE:
26
- case XML_HTML_DOCUMENT_NODE:
27
- cur = parent->children;
28
- break;
29
- default:
30
- return (NULL);
31
- }
32
- while (cur != NULL) {
33
- if (cur->type == XML_ELEMENT_NODE) {
34
- return (cur);
35
- }
36
- cur = cur->next;
37
- }
38
- return (NULL);
39
- }
40
-
41
- /**
42
- * xmlNextElementSibling:
43
- * @node: the current node
44
- *
45
- * Finds the first closest next sibling of the node which is an
46
- * element node.
47
- * Note the handling of entities references is different than in
48
- * the W3C DOM element traversal spec since we don't have back reference
49
- * from entities content to entities references.
50
- *
51
- * Returns the next element sibling or NULL if not available
52
- */
53
- xmlNodePtr
54
- xmlNextElementSibling(xmlNodePtr node)
55
- {
56
- if (node == NULL) {
57
- return (NULL);
58
- }
59
- switch (node->type) {
60
- case XML_ELEMENT_NODE:
61
- case XML_TEXT_NODE:
62
- case XML_CDATA_SECTION_NODE:
63
- case XML_ENTITY_REF_NODE:
64
- case XML_ENTITY_NODE:
65
- case XML_PI_NODE:
66
- case XML_COMMENT_NODE:
67
- case XML_DTD_NODE:
68
- case XML_XINCLUDE_START:
69
- case XML_XINCLUDE_END:
70
- node = node->next;
71
- break;
72
- default:
73
- return (NULL);
74
- }
75
- while (node != NULL) {
76
- if (node->type == XML_ELEMENT_NODE) {
77
- return (node);
78
- }
79
- node = node->next;
80
- }
81
- return (NULL);
82
- }
83
-
84
- /**
85
- * xmlLastElementChild:
86
- * @parent: the parent node
87
- *
88
- * Finds the last child node of that element which is a Element node
89
- * Note the handling of entities references is different than in
90
- * the W3C DOM element traversal spec since we don't have back reference
91
- * from entities content to entities references.
92
- *
93
- * Returns the last element child or NULL if not available
94
- */
95
- xmlNodePtr
96
- xmlLastElementChild(xmlNodePtr parent)
97
- {
98
- xmlNodePtr cur = NULL;
99
-
100
- if (parent == NULL) {
101
- return (NULL);
102
- }
103
- switch (parent->type) {
104
- case XML_ELEMENT_NODE:
105
- case XML_ENTITY_NODE:
106
- case XML_DOCUMENT_NODE:
107
- case XML_HTML_DOCUMENT_NODE:
108
- cur = parent->last;
109
- break;
110
- default:
111
- return (NULL);
112
- }
113
- while (cur != NULL) {
114
- if (cur->type == XML_ELEMENT_NODE) {
115
- return (cur);
116
- }
117
- cur = cur->prev;
118
- }
119
- return (NULL);
120
- }
121
- #endif
@@ -1,25 +0,0 @@
1
- From 0b6ae484761fa01242fe8b67b54e3eb2d282d83d Mon Sep 17 00:00:00 2001
2
- From: Mike Dalessio <mike.dalessio@gmail.com>
3
- Date: Wed, 4 Dec 2019 08:43:51 -0500
4
- Subject: [PATCH] fix libxml2.la's path
5
-
6
- ---
7
- Makefile.in | 2 +-
8
- 1 file changed, 1 insertion(+), 1 deletion(-)
9
-
10
- diff --git a/Makefile.in b/Makefile.in
11
- index cf96d41..1372d8b 100644
12
- --- a/Makefile.in
13
- +++ b/Makefile.in
14
- @@ -1057,7 +1057,7 @@ clean-noinstLTLIBRARIES:
15
- rm -f $${locs}; \
16
- }
17
-
18
- -libxml2.la: $(libxml2_la_OBJECTS) $(libxml2_la_DEPENDENCIES) $(EXTRA_libxml2_la_DEPENDENCIES)
19
- +$(top_builddir)/libxml2.la: $(libxml2_la_OBJECTS) $(libxml2_la_DEPENDENCIES) $(EXTRA_libxml2_la_DEPENDENCIES)
20
- $(AM_V_CCLD)$(libxml2_la_LINK) -rpath $(libdir) $(libxml2_la_OBJECTS) $(libxml2_la_LIBADD) $(LIBS)
21
-
22
- testdso.la: $(testdso_la_OBJECTS) $(testdso_la_DEPENDENCIES) $(EXTRA_testdso_la_DEPENDENCIES)
23
- --
24
- 2.17.1
25
-
Binary file
Binary file