libxml-ruby 5.0.5 → 6.0.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.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/{HISTORY → CHANGELOG.md} +875 -923
  3. data/LICENSE +20 -20
  4. data/README.md +67 -0
  5. data/Rakefile +77 -98
  6. data/ext/libxml/extconf.rb +34 -20
  7. data/ext/libxml/libxml.c +67 -79
  8. data/ext/libxml/ruby_libxml.h +1 -1
  9. data/ext/libxml/ruby_xml_attr.c +338 -333
  10. data/ext/libxml/ruby_xml_attr.h +13 -12
  11. data/ext/libxml/ruby_xml_attr_decl.c +19 -12
  12. data/ext/libxml/ruby_xml_attr_decl.h +11 -11
  13. data/ext/libxml/ruby_xml_attributes.c +18 -9
  14. data/ext/libxml/ruby_xml_document.c +111 -98
  15. data/ext/libxml/ruby_xml_document.h +1 -0
  16. data/ext/libxml/ruby_xml_dtd.c +49 -19
  17. data/ext/libxml/ruby_xml_dtd.h +10 -9
  18. data/ext/libxml/ruby_xml_html_parser.c +91 -91
  19. data/ext/libxml/ruby_xml_html_parser.h +10 -10
  20. data/ext/libxml/ruby_xml_html_parser_context.c +19 -6
  21. data/ext/libxml/ruby_xml_html_parser_context.h +11 -10
  22. data/ext/libxml/ruby_xml_html_parser_options.c +48 -48
  23. data/ext/libxml/ruby_xml_html_parser_options.h +10 -10
  24. data/ext/libxml/ruby_xml_input_cbg.c +45 -17
  25. data/ext/libxml/ruby_xml_input_cbg.h +20 -20
  26. data/ext/libxml/ruby_xml_io.c +49 -47
  27. data/ext/libxml/ruby_xml_io.h +10 -10
  28. data/ext/libxml/ruby_xml_namespace.c +20 -12
  29. data/ext/libxml/ruby_xml_namespace.h +11 -10
  30. data/ext/libxml/ruby_xml_namespaces.c +313 -293
  31. data/ext/libxml/ruby_xml_namespaces.h +9 -9
  32. data/ext/libxml/ruby_xml_node.c +71 -32
  33. data/ext/libxml/ruby_xml_node.h +15 -13
  34. data/ext/libxml/ruby_xml_parser.c +91 -91
  35. data/ext/libxml/ruby_xml_parser_context.c +54 -47
  36. data/ext/libxml/ruby_xml_parser_context.h +11 -10
  37. data/ext/libxml/ruby_xml_reader.c +25 -15
  38. data/ext/libxml/ruby_xml_reader.h +14 -14
  39. data/ext/libxml/ruby_xml_registry.c +31 -0
  40. data/ext/libxml/ruby_xml_registry.h +22 -0
  41. data/ext/libxml/ruby_xml_relaxng.c +21 -5
  42. data/ext/libxml/ruby_xml_relaxng.h +9 -8
  43. data/ext/libxml/ruby_xml_sax2_handler.h +10 -10
  44. data/ext/libxml/ruby_xml_sax_parser.c +1 -1
  45. data/ext/libxml/ruby_xml_sax_parser.h +10 -10
  46. data/ext/libxml/ruby_xml_schema.c +18 -11
  47. data/ext/libxml/ruby_xml_schema.h +26 -25
  48. data/ext/libxml/ruby_xml_schema_attribute.c +7 -7
  49. data/ext/libxml/ruby_xml_schema_attribute.h +37 -37
  50. data/ext/libxml/ruby_xml_schema_element.c +8 -8
  51. data/ext/libxml/ruby_xml_schema_element.h +11 -11
  52. data/ext/libxml/ruby_xml_schema_facet.c +50 -50
  53. data/ext/libxml/ruby_xml_schema_facet.h +9 -9
  54. data/ext/libxml/ruby_xml_schema_type.c +12 -19
  55. data/ext/libxml/ruby_xml_schema_type.h +9 -9
  56. data/ext/libxml/ruby_xml_version.h +4 -4
  57. data/ext/libxml/ruby_xml_writer.c +1136 -1124
  58. data/ext/libxml/ruby_xml_writer.h +6 -6
  59. data/ext/libxml/ruby_xml_xinclude.c +20 -20
  60. data/ext/libxml/ruby_xml_xinclude.h +11 -11
  61. data/ext/libxml/ruby_xml_xpath.c +195 -195
  62. data/ext/libxml/ruby_xml_xpath.h +15 -15
  63. data/ext/libxml/ruby_xml_xpath_context.c +408 -362
  64. data/ext/libxml/ruby_xml_xpath_context.h +9 -9
  65. data/ext/libxml/ruby_xml_xpath_expression.c +11 -5
  66. data/ext/libxml/ruby_xml_xpath_expression.h +11 -10
  67. data/ext/libxml/ruby_xml_xpath_object.c +69 -54
  68. data/ext/libxml/ruby_xml_xpath_object.h +19 -17
  69. data/ext/vc/libxml_ruby/libxml_ruby.vcxproj +271 -0
  70. data/ext/xcode/libxml-ruby.xcodeproj/project.pbxproj +633 -0
  71. data/ext/xcode/libxml-ruby.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  72. data/ext/xcode/libxml-ruby.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  73. data/ext/xcode/libxml-ruby.xcodeproj/xcshareddata/xcschemes/libxml-ruby.xcscheme +80 -0
  74. data/lib/libxml/document.rb +0 -29
  75. data/lib/libxml/error.rb +30 -3
  76. data/lib/libxml/html_parser.rb +0 -16
  77. data/lib/libxml/node.rb +1 -3
  78. data/lib/libxml/parser.rb +0 -8
  79. data/lib/libxml/schema/attribute.rb +27 -19
  80. data/lib/libxml/schema/element.rb +20 -0
  81. data/lib/libxml/schema/type.rb +44 -21
  82. data/lib/libxml/schema.rb +47 -47
  83. data/lib/libxml-ruby.rb +30 -30
  84. data/libxml-ruby.gemspec +12 -16
  85. data/test/c14n/result/1-1-without-comments/example-1 +3 -3
  86. data/test/c14n/result/1-1-without-comments/example-2 +10 -10
  87. data/test/c14n/result/1-1-without-comments/example-3 +13 -13
  88. data/test/c14n/result/1-1-without-comments/example-4 +8 -8
  89. data/test/c14n/result/1-1-without-comments/example-5 +2 -2
  90. data/test/c14n/result/with-comments/example-1 +5 -5
  91. data/test/c14n/result/with-comments/example-2 +10 -10
  92. data/test/c14n/result/with-comments/example-3 +13 -13
  93. data/test/c14n/result/with-comments/example-4 +8 -8
  94. data/test/c14n/result/with-comments/example-5 +3 -3
  95. data/test/c14n/result/without-comments/example-1 +3 -3
  96. data/test/c14n/result/without-comments/example-2 +10 -10
  97. data/test/c14n/result/without-comments/example-3 +13 -13
  98. data/test/c14n/result/without-comments/example-4 +8 -8
  99. data/test/c14n/result/without-comments/example-5 +2 -2
  100. data/test/test_attr.rb +179 -180
  101. data/test/test_attr_decl.rb +131 -131
  102. data/test/test_attributes.rb +135 -135
  103. data/test/test_canonicalize.rb +122 -120
  104. data/test/test_document.rb +2 -4
  105. data/test/test_dtd.rb +12 -4
  106. data/test/test_encoding_sax.rb +114 -114
  107. data/test/test_error.rb +6 -3
  108. data/test/test_helper.rb +1 -0
  109. data/test/test_html_parser.rb +6 -2
  110. data/test/test_html_parser_context.rb +22 -22
  111. data/test/test_input_callbacks.rb +36 -0
  112. data/test/test_namespace.rb +1 -1
  113. data/test/test_namespaces.rb +200 -200
  114. data/test/test_node.rb +16 -0
  115. data/test/test_node_cdata.rb +50 -50
  116. data/test/test_node_comment.rb +32 -32
  117. data/test/test_node_copy.rb +40 -40
  118. data/test/test_node_edit.rb +176 -158
  119. data/test/test_node_pi.rb +37 -37
  120. data/test/test_node_text.rb +69 -69
  121. data/test/test_node_xlink.rb +28 -28
  122. data/test/test_parser.rb +5 -41
  123. data/test/test_parser_context.rb +198 -198
  124. data/test/test_properties.rb +38 -38
  125. data/test/test_reader.rb +55 -6
  126. data/test/test_relaxng.rb +59 -53
  127. data/test/test_sax_parser.rb +345 -345
  128. data/test/test_schema.rb +28 -0
  129. data/test/test_traversal.rb +152 -152
  130. data/test/test_writer.rb +469 -468
  131. data/test/test_xinclude.rb +20 -20
  132. data/test/test_xml.rb +3 -7
  133. data/test/test_xpath.rb +244 -244
  134. data/test/test_xpath_context.rb +87 -87
  135. data/test/test_xpath_expression.rb +37 -37
  136. metadata +33 -27
  137. data/README.rdoc +0 -208
  138. data/ext/libxml/extconf.h +0 -3
  139. data/ext/libxml/ruby_xml_cbg.c +0 -85
  140. data/lib/libxml/hpricot.rb +0 -78
  141. data/lib/libxml.rb +0 -5
  142. data/lib/xml/libxml.rb +0 -10
  143. data/lib/xml.rb +0 -14
  144. data/script/benchmark/depixelate +0 -634
  145. data/script/benchmark/hamlet.xml +0 -9055
  146. data/script/benchmark/parsecount +0 -170
  147. data/script/benchmark/sock_entries.xml +0 -507
  148. data/script/benchmark/throughput +0 -41
  149. data/script/test +0 -6
  150. data/test/test.rb +0 -5
  151. data/test/test_deprecated_require.rb +0 -12
@@ -1,88 +1,88 @@
1
- # encoding: UTF-8
2
-
3
- require_relative './test_helper'
4
- require "tempfile"
5
-
6
- class TestXPathContext < Minitest::Test
7
- SOAP_PREFIX = 'soap'
8
- SOAP_URI = 'http://schemas.xmlsoap.org/soap/envelope/'
9
-
10
- NS0_PREFIX = 'ns0'
11
- NS0_URI = 'http://services.somewhere.com'
12
-
13
- def setup
14
- doc = LibXML::XML::Document.file(File.join(File.dirname(__FILE__), 'model/soap.xml'))
15
- @context = LibXML::XML::XPath::Context.new(doc)
16
- end
17
-
18
- def teardown()
19
- @context = nil
20
- end
21
-
22
- def test_no_ns
23
- error = assert_raises(LibXML::XML::Error) do
24
- @context.find('/soap:Envelope')
25
- end
26
- assert_equal("Error: Undefined namespace prefix.", error.to_s)
27
- end
28
-
29
- def test_ns_register
30
- @context.register_namespace(SOAP_PREFIX, SOAP_URI)
31
- @context.register_namespace(NS0_PREFIX, NS0_URI)
32
- nodes = @context.find('/soap:Envelope/soap:Body/ns0:getManufacturerNamesResponse')
33
- assert_equal(1, nodes.length)
34
- end
35
-
36
- def test_ns_register_string
37
- @context.register_namespaces("#{SOAP_PREFIX}:#{SOAP_URI}")
38
- @context.register_namespaces("#{NS0_PREFIX}:#{NS0_URI}")
39
- nodes = @context.find('/soap:Envelope/soap:Body/ns0:getManufacturerNamesResponse')
40
- assert_equal(1, nodes.length)
41
- end
42
-
43
- def test_ns_register_array
44
- @context.register_namespaces(["#{SOAP_PREFIX}:#{SOAP_URI}", "#{NS0_PREFIX}:#{NS0_URI}"])
45
- nodes = @context.find('/soap:Envelope/soap:Body/ns0:getManufacturerNamesResponse')
46
- assert_equal(1, nodes.length)
47
- end
48
-
49
- def test_ns_register_hash
50
- @context.register_namespaces(SOAP_PREFIX => SOAP_URI,
51
- NS0_PREFIX => NS0_URI)
52
-
53
- nodes = @context.find('/soap:Envelope/soap:Body/ns0:getManufacturerNamesResponse')
54
- assert_equal(1, nodes.length)
55
- end
56
-
57
- def test_ns_register_node
58
- @context.register_namespaces_from_node(@context.doc.root)
59
- nodes = @context.find('/soap:Envelope')
60
- assert_equal(1, nodes.length)
61
- end
62
-
63
- def test_node
64
- @context.register_namespaces_from_node(@context.doc.root)
65
-
66
- nodes = @context.find('soap:Body')
67
- assert_equal(0, nodes.length)
68
-
69
-
70
- @context.node = @context.doc.root.child.next
71
- nodes = @context.find('soap:Body')
72
- assert_equal(0, nodes.length)
73
- end
74
-
75
- def test_cache
76
- @context.enable_cache
77
- @context.enable_cache(10)
78
- @context.disable_cache
79
- end
80
-
81
- def test_require_doc
82
- doc = LibXML::XML::Document.file(File.join(File.dirname(__FILE__), 'model/soap.xml'))
83
- error = assert_raises(TypeError) do
84
- @context = LibXML::XML::XPath::Context.new(doc.root)
85
- end
86
- assert_equal("Supplied argument must be a document or node.", error.to_s)
87
- end
1
+ # encoding: UTF-8
2
+
3
+ require_relative './test_helper'
4
+ require "tempfile"
5
+
6
+ class TestXPathContext < Minitest::Test
7
+ SOAP_PREFIX = 'soap'
8
+ SOAP_URI = 'http://schemas.xmlsoap.org/soap/envelope/'
9
+
10
+ NS0_PREFIX = 'ns0'
11
+ NS0_URI = 'http://services.somewhere.com'
12
+
13
+ def setup
14
+ doc = LibXML::XML::Document.file(File.join(File.dirname(__FILE__), 'model/soap.xml'))
15
+ @context = LibXML::XML::XPath::Context.new(doc)
16
+ end
17
+
18
+ def teardown()
19
+ @context = nil
20
+ end
21
+
22
+ def test_no_ns
23
+ error = assert_raises(LibXML::XML::Error) do
24
+ @context.find('/soap:Envelope')
25
+ end
26
+ assert_match(/Error: Undefined namespace prefix/, error.to_s)
27
+ end
28
+
29
+ def test_ns_register
30
+ @context.register_namespace(SOAP_PREFIX, SOAP_URI)
31
+ @context.register_namespace(NS0_PREFIX, NS0_URI)
32
+ nodes = @context.find('/soap:Envelope/soap:Body/ns0:getManufacturerNamesResponse')
33
+ assert_equal(1, nodes.length)
34
+ end
35
+
36
+ def test_ns_register_string
37
+ @context.register_namespaces("#{SOAP_PREFIX}:#{SOAP_URI}")
38
+ @context.register_namespaces("#{NS0_PREFIX}:#{NS0_URI}")
39
+ nodes = @context.find('/soap:Envelope/soap:Body/ns0:getManufacturerNamesResponse')
40
+ assert_equal(1, nodes.length)
41
+ end
42
+
43
+ def test_ns_register_array
44
+ @context.register_namespaces(["#{SOAP_PREFIX}:#{SOAP_URI}", "#{NS0_PREFIX}:#{NS0_URI}"])
45
+ nodes = @context.find('/soap:Envelope/soap:Body/ns0:getManufacturerNamesResponse')
46
+ assert_equal(1, nodes.length)
47
+ end
48
+
49
+ def test_ns_register_hash
50
+ @context.register_namespaces(SOAP_PREFIX => SOAP_URI,
51
+ NS0_PREFIX => NS0_URI)
52
+
53
+ nodes = @context.find('/soap:Envelope/soap:Body/ns0:getManufacturerNamesResponse')
54
+ assert_equal(1, nodes.length)
55
+ end
56
+
57
+ def test_ns_register_node
58
+ @context.register_namespaces_from_node(@context.doc.root)
59
+ nodes = @context.find('/soap:Envelope')
60
+ assert_equal(1, nodes.length)
61
+ end
62
+
63
+ def test_node
64
+ @context.register_namespaces_from_node(@context.doc.root)
65
+
66
+ nodes = @context.find('soap:Body')
67
+ assert_equal(0, nodes.length)
68
+
69
+
70
+ @context.node = @context.doc.root.child.next
71
+ nodes = @context.find('soap:Body')
72
+ assert_equal(0, nodes.length)
73
+ end
74
+
75
+ def test_cache
76
+ @context.enable_cache
77
+ @context.enable_cache(10)
78
+ @context.disable_cache
79
+ end
80
+
81
+ def test_require_doc
82
+ doc = LibXML::XML::Document.file(File.join(File.dirname(__FILE__), 'model/soap.xml'))
83
+ error = assert_raises(TypeError) do
84
+ @context = LibXML::XML::XPath::Context.new(doc.root)
85
+ end
86
+ assert_equal("Supplied argument must be a document or node.", error.to_s)
87
+ end
88
88
  end
@@ -1,37 +1,37 @@
1
- # encoding: UTF-8
2
-
3
- require_relative './test_helper'
4
-
5
-
6
- class TestXPathExpression < Minitest::Test
7
- def setup
8
- xp = LibXML::XML::Parser.string('<ruby_array uga="booga" foo="bar"><fixnum>one</fixnum><fixnum>two</fixnum></ruby_array>')
9
- @doc = xp.parse
10
- end
11
-
12
- def teardown
13
- @doc = nil
14
- end
15
-
16
- def test_nodes
17
- expr = LibXML::XML::XPath::Expression.compile('/ruby_array/fixnum')
18
- set = @doc.find(expr)
19
- assert_instance_of(LibXML::XML::XPath::Object, set)
20
- assert_equal(2, set.size)
21
- end
22
-
23
- def test_find_class
24
- expr = LibXML::XML::XPath::Expression.new('/ruby_array/fixnum')
25
- set = @doc.find(expr)
26
- assert_instance_of(LibXML::XML::XPath::Object, set)
27
- assert_equal(2, set.size)
28
- end
29
-
30
- def test_find_invalid
31
- error = assert_raises(TypeError) do
32
- @doc.find(999)
33
- end
34
- assert_equal('Argument should be an instance of a String or XPath::Expression',
35
- error.to_s)
36
- end
37
- end
1
+ # encoding: UTF-8
2
+
3
+ require_relative './test_helper'
4
+
5
+
6
+ class TestXPathExpression < Minitest::Test
7
+ def setup
8
+ xp = LibXML::XML::Parser.string('<ruby_array uga="booga" foo="bar"><fixnum>one</fixnum><fixnum>two</fixnum></ruby_array>')
9
+ @doc = xp.parse
10
+ end
11
+
12
+ def teardown
13
+ @doc = nil
14
+ end
15
+
16
+ def test_nodes
17
+ expr = LibXML::XML::XPath::Expression.compile('/ruby_array/fixnum')
18
+ set = @doc.find(expr)
19
+ assert_instance_of(LibXML::XML::XPath::Object, set)
20
+ assert_equal(2, set.size)
21
+ end
22
+
23
+ def test_find_class
24
+ expr = LibXML::XML::XPath::Expression.new('/ruby_array/fixnum')
25
+ set = @doc.find(expr)
26
+ assert_instance_of(LibXML::XML::XPath::Object, set)
27
+ assert_equal(2, set.size)
28
+ end
29
+
30
+ def test_find_invalid
31
+ error = assert_raises(TypeError) do
32
+ @doc.find(999)
33
+ end
34
+ assert_equal('Argument should be an instance of a String or XPath::Expression',
35
+ error.to_s)
36
+ end
37
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libxml-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.5
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ross Bamform
@@ -13,7 +13,7 @@ authors:
13
13
  - Ryan Johnson
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2025-07-30 00:00:00.000000000 Z
16
+ date: 1980-01-02 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: logger
@@ -57,22 +57,33 @@ dependencies:
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0'
60
- description: |2
61
- The Libxml-Ruby project provides Ruby language bindings for the GNOME
62
- Libxml2 XML toolkit. It is free software, released under the MIT License.
63
- Libxml-ruby's primary advantage over REXML is performance - if speed
64
- is your need, these are good libraries to consider, as demonstrated
65
- by the informal benchmark below.
60
+ - !ruby/object:Gem::Dependency
61
+ name: rdoc
62
+ requirement: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ type: :development
68
+ prerelease: false
69
+ version_requirements: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ description: " libxml-Ruby provides Ruby language bindings for libxml2 It is free
75
+ software, \n released under the MIT License. libxml-ruby provides DOM, SAX, Reader,
76
+ and \n Writer APIs along with XPath support and validation via DTD, RelaxNG,
77
+ and XML Schema.\n"
66
78
  executables: []
67
79
  extensions:
68
80
  - ext/libxml/extconf.rb
69
81
  extra_rdoc_files: []
70
82
  files:
71
- - HISTORY
83
+ - CHANGELOG.md
72
84
  - LICENSE
73
- - README.rdoc
85
+ - README.md
74
86
  - Rakefile
75
- - ext/libxml/extconf.h
76
87
  - ext/libxml/extconf.rb
77
88
  - ext/libxml/libxml.c
78
89
  - ext/libxml/libxml_ruby.def
@@ -85,7 +96,6 @@ files:
85
96
  - ext/libxml/ruby_xml_attr_decl.h
86
97
  - ext/libxml/ruby_xml_attributes.c
87
98
  - ext/libxml/ruby_xml_attributes.h
88
- - ext/libxml/ruby_xml_cbg.c
89
99
  - ext/libxml/ruby_xml_document.c
90
100
  - ext/libxml/ruby_xml_document.h
91
101
  - ext/libxml/ruby_xml_dtd.c
@@ -118,6 +128,8 @@ files:
118
128
  - ext/libxml/ruby_xml_parser_options.h
119
129
  - ext/libxml/ruby_xml_reader.c
120
130
  - ext/libxml/ruby_xml_reader.h
131
+ - ext/libxml/ruby_xml_registry.c
132
+ - ext/libxml/ruby_xml_registry.h
121
133
  - ext/libxml/ruby_xml_relaxng.c
122
134
  - ext/libxml/ruby_xml_relaxng.h
123
135
  - ext/libxml/ruby_xml_sax2_handler.c
@@ -148,14 +160,17 @@ files:
148
160
  - ext/libxml/ruby_xml_xpath_object.c
149
161
  - ext/libxml/ruby_xml_xpath_object.h
150
162
  - ext/vc/libxml_ruby.sln
163
+ - ext/vc/libxml_ruby/libxml_ruby.vcxproj
164
+ - ext/xcode/libxml-ruby.xcodeproj/project.pbxproj
165
+ - ext/xcode/libxml-ruby.xcodeproj/project.xcworkspace/contents.xcworkspacedata
166
+ - ext/xcode/libxml-ruby.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
167
+ - ext/xcode/libxml-ruby.xcodeproj/xcshareddata/xcschemes/libxml-ruby.xcscheme
151
168
  - lib/libxml-ruby.rb
152
- - lib/libxml.rb
153
169
  - lib/libxml/attr.rb
154
170
  - lib/libxml/attr_decl.rb
155
171
  - lib/libxml/attributes.rb
156
172
  - lib/libxml/document.rb
157
173
  - lib/libxml/error.rb
158
- - lib/libxml/hpricot.rb
159
174
  - lib/libxml/html_parser.rb
160
175
  - lib/libxml/namespace.rb
161
176
  - lib/libxml/namespaces.rb
@@ -168,15 +183,7 @@ files:
168
183
  - lib/libxml/schema/element.rb
169
184
  - lib/libxml/schema/type.rb
170
185
  - lib/libxml/tree.rb
171
- - lib/xml.rb
172
- - lib/xml/libxml.rb
173
186
  - libxml-ruby.gemspec
174
- - script/benchmark/depixelate
175
- - script/benchmark/hamlet.xml
176
- - script/benchmark/parsecount
177
- - script/benchmark/sock_entries.xml
178
- - script/benchmark/throughput
179
- - script/test
180
187
  - test/c14n/given/doc.dtd
181
188
  - test/c14n/given/example-1.xml
182
189
  - test/c14n/given/example-2.xml
@@ -228,12 +235,10 @@ files:
228
235
  - test/model/shiporder_import.xsd
229
236
  - test/model/soap.xml
230
237
  - test/model/xinclude.xml
231
- - test/test.rb
232
238
  - test/test_attr.rb
233
239
  - test/test_attr_decl.rb
234
240
  - test/test_attributes.rb
235
241
  - test/test_canonicalize.rb
236
- - test/test_deprecated_require.rb
237
242
  - test/test_document.rb
238
243
  - test/test_document_write.rb
239
244
  - test/test_dtd.rb
@@ -243,6 +248,7 @@ files:
243
248
  - test/test_helper.rb
244
249
  - test/test_html_parser.rb
245
250
  - test/test_html_parser_context.rb
251
+ - test/test_input_callbacks.rb
246
252
  - test/test_namespace.rb
247
253
  - test/test_namespaces.rb
248
254
  - test/test_node.rb
@@ -280,14 +286,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
280
286
  requirements:
281
287
  - - ">="
282
288
  - !ruby/object:Gem::Version
283
- version: '2.5'
289
+ version: '3.2'
284
290
  required_rubygems_version: !ruby/object:Gem::Requirement
285
291
  requirements:
286
292
  - - ">="
287
293
  - !ruby/object:Gem::Version
288
294
  version: '0'
289
295
  requirements: []
290
- rubygems_version: 3.7.1
296
+ rubygems_version: 4.0.6
291
297
  specification_version: 4
292
298
  summary: Ruby Bindings for LibXML2
293
299
  test_files:
@@ -295,7 +301,6 @@ test_files:
295
301
  - test/test_attr_decl.rb
296
302
  - test/test_attributes.rb
297
303
  - test/test_canonicalize.rb
298
- - test/test_deprecated_require.rb
299
304
  - test/test_document.rb
300
305
  - test/test_document_write.rb
301
306
  - test/test_dtd.rb
@@ -305,6 +310,7 @@ test_files:
305
310
  - test/test_helper.rb
306
311
  - test/test_html_parser.rb
307
312
  - test/test_html_parser_context.rb
313
+ - test/test_input_callbacks.rb
308
314
  - test/test_namespace.rb
309
315
  - test/test_namespaces.rb
310
316
  - test/test_node.rb
data/README.rdoc DELETED
@@ -1,208 +0,0 @@
1
- = LibXML Ruby
2
-
3
- == Overview
4
- The libxml gem provides Ruby language bindings for GNOME's Libxml2
5
- XML toolkit. It is free software, released under the MIT License.
6
-
7
- We think libxml-ruby is the best XML library for Ruby because:
8
-
9
- * Speed - Its much faster than REXML and Hpricot
10
- * Features - It provides an amazing number of featues
11
- * Conformance - It passes all 1800+ tests from the OASIS XML Tests Suite
12
-
13
- == Requirements
14
- libxml-ruby requires Ruby 3.0.0 or higher. It depends on libxml2 to
15
- function properly. libxml2, in turn, depends on:
16
-
17
- * libm (math routines: very standard)
18
- * libz (zlib)
19
- * libiconv
20
-
21
- If you are running Linux or Unix you'll need a C compiler so the
22
- extension can be compiled when it is installed. If you are running
23
- Windows, then install the x64-mingw-ucr gem or build it yourself using (Ruby
24
- for Windows)[https://rubyinstaller.org/] or directly with msys2[https://msys2.github.io/]
25
- and ucrt64.
26
-
27
- == Installation
28
- The easiest way to install libxml-ruby is via RubyGems. To install:
29
-
30
- <tt>gem install libxml-ruby</tt>
31
-
32
- If the extension compile process cannot find libxml2, you may need to indicate
33
- the location of the libxml2 configuration utility as it is used to find the
34
- required header and include files. (If you need to indicate a location for the
35
- libxml2 library or header files different than reported by <tt>xml2-config</tt>,
36
- see the additional configuration options.)
37
-
38
- This may be done with RubyGems:
39
-
40
- <tt>gem install libxml-ruby -- --with-xml2-dir=/path/to/xml2-config</tt>
41
-
42
- Or bundler:
43
-
44
- <tt>bundle config build.libxml-ruby --with-xml2-config=/path/to/xml2-config</tt>
45
-
46
- <tt>bundle install libxml-ruby</tt>
47
-
48
- If you are running Windows, then install the libxml-ruby-x64-mingw32 gem.
49
- The gem includes prebuilt extensions for Ruby 3.2 and 3.3.
50
-
51
- The gem also includes a Microsoft VC++ solution and XCode project - these
52
- are very useful for debugging.
53
-
54
- libxml-ruby's source codes lives on GitHub[https://github.com/xml4r/libxml-ruby].
55
-
56
- == Getting Started
57
- Using libxml is easy. First decide what parser you want to use:
58
-
59
- * Generally you'll want to use the LibXML::XML::Parser which provides a tree based API.
60
- * For larger documents that don't fit into memory, or if you prefer an input based API, use the LibXML::XML::Reader.
61
- * To parse HTML files use LibXML::XML::HTMLParser.
62
- * If you are masochistic, then use the LibXML::XML::SaxParser, which provides a callback API.
63
-
64
- Once you have chosen a parser, choose a datasource. Libxml can parse files, strings, URIs
65
- and IO streams. For each data source you can specify an LibXML::XML::Encoding, a base uri and
66
- various parser options. For more information, refer the LibXML::XML::Parser.document,
67
- LibXML::XML::Parser.file, LibXML::XML::Parser.io or LibXML:::XML::Parser.string methods (the
68
- same methods are defined on all four parser classes).
69
-
70
- == Advanced Functionality
71
- Beyond the basics of parsing and processing XML and HTML documents,
72
- libxml provides a wealth of additional functionality.
73
-
74
- Most commonly, you'll want to use its LibXML::XML::XPath support, which makes
75
- it easy to find data inside an XML document. Although not as popular,
76
- LibXML::XML::XPointer provides another API for finding data inside an XML document.
77
-
78
- Often times you'll need to validate data before processing it. For example,
79
- if you accept user generated content submitted over the Web, you'll
80
- want to verify that it does not contain malicious code such as embedded scripts.
81
- This can be done using libxml's powerful set of validators:
82
-
83
- * DTDs (LibXML::XML::Dtd)
84
- * Relax Schemas (LibXML::XML::RelaxNG)
85
- * XML Schema (LibXML::XML::Schema)
86
-
87
- Finally, if you'd like to use XSL Transformations to process data, then install
88
- the {libxslt gem}[https://github.com/xml4r/libxslt-rubygem].
89
-
90
- == Usage
91
- For information about using libxml-ruby please refer to its
92
- documentation[https://xml4r.github.io/libxml-ruby]. Some tutorials are also
93
- available[https://github.com/xml4r/libxml-ruby/wiki].
94
-
95
- All libxml classes are in the LibXML::XML module. The easiest
96
- way to use libxml is to <tt>require 'xml'</tt>. This will mixin
97
- the LibXML module into the global namespace, allowing you to
98
- write code like this:
99
-
100
- require 'xml'
101
- document = XML::Document.new
102
-
103
- However, when creating an application or library you plan to
104
- redistribute, it is best to not add the LibXML module to the global
105
- namespace, in which case you can either write your code like this:
106
-
107
- require 'libxml'
108
- document = LibXML::XML::Document.new
109
-
110
- Or you can utilize a namespace for your own work and include LibXML into it.
111
- For example:
112
-
113
- require 'libxml'
114
-
115
- module MyApplication
116
- include LibXML
117
-
118
- class MyClass
119
- def some_method
120
- document = XML::Document.new
121
- end
122
- end
123
- end
124
-
125
- For simplicity's sake, the documentation uses the xml module in its examples.
126
-
127
- == Tests
128
-
129
- To run tests you first need to build the shared libary:
130
-
131
- rake compile
132
-
133
- Once you have build the shared libary, you can then run tests using rake:
134
-
135
- rake test
136
-
137
- +Build status: {rdoc-image:https://github.com/xml4r/libxml-ruby/actions/workflows/mri.yml/badge.svg}[https://github.com/xml4r/libxml-ruby/actions/workflows/mri.yml]
138
-
139
- == Performance
140
-
141
- In addition to being feature rich and conformation, the main reason
142
- people use libxml-ruby is for performance. Here are the results
143
- of a couple simple benchmarks recently blogged about on the
144
- Web (you can find them in the benchmark directory of the
145
- libxml distribution).
146
-
147
- From http://depixelate.com/2008/4/23/ruby-xml-parsing-benchmarks
148
-
149
- user system total real
150
- libxml 0.032000 0.000000 0.032000 ( 0.031000)
151
- Hpricot 0.640000 0.031000 0.671000 ( 0.890000)
152
- REXML 1.813000 0.047000 1.860000 ( 2.031000)
153
-
154
- From https://svn.concord.org/svn/projects/trunk/common/ruby/xml_benchmarks/
155
-
156
- user system total real
157
- libxml 0.641000 0.031000 0.672000 ( 0.672000)
158
- hpricot 5.359000 0.062000 5.421000 ( 5.516000)
159
- rexml 22.859000 0.047000 22.906000 ( 23.203000)
160
-
161
-
162
- == Documentation
163
- Documentation is available via rdoc, and is installed automatically with the
164
- gem.
165
-
166
- libxml-ruby's {online
167
- documentation}[https://xml4r.github.io/libxml-ruby/rdoc/index.html] is generated
168
- using Hanna, which is a development gem dependency.
169
-
170
- Note that older versions of Rdoc, which ship with Ruby 1.8.x, will report
171
- a number of errors. To avoid them, install Rdoc 2.1 or higher. Once you have
172
- installed the gem, you'll have to disable the version of Rdoc that Ruby 1.8.x
173
- includes. An easy way to do that is rename the directory
174
- <tt>ruby/lib/ruby/1.8/rdoc</tt> to
175
- <tt>ruby/lib/ruby/1.8/rdoc_old</tt>.
176
-
177
- == Support
178
- If you have any questions about using libxml-ruby, please report an issue
179
- on GitHub[https://github.com/xml4r/libxml-ruby/issues].
180
-
181
- == Memory Management
182
- libxml-ruby automatically manages memory associated with the
183
- underlying libxml2 library. The bindings create a one-to-one mapping between
184
- Ruby objects and libxml documents and libxml parent nodes (ie, nodes that do not
185
- have a parent and do not belong to a document). In these cases,
186
- the bindings manage the memory. They do this by installing a free
187
- function and storing a back pointer to the Ruby object from the xmlnode
188
- using the _private member on libxml structures. When the Ruby object
189
- goes out of scope, the underlying libxml structure is freed. Libxml
190
- itself then frees all child nodes (recursively).
191
-
192
- For all other nodes (the vast majority), the bindings create temporary
193
- Ruby objects that get freed once they go out of scope. Thus there can be
194
- more than one Ruby object pointing to the same xml node. To mostly hide
195
- this from a programmer on the Ruby side, the <tt>#eql?</tt> and <tt>#==</tt> methods are
196
- overriden to check if two Ruby objects wrap the same xmlnode. If they do,
197
- then the methods return true. During the mark phase, each of these temporary
198
- objects marks its owning document, thereby keeping the Ruby document object
199
- alive and thus the xmldoc tree.
200
-
201
- In the sweep phase of the garbage collector, or when a program ends,
202
- there is no order to how Ruby objects are freed. In fact, the Ruby document
203
- object is almost always freed before any Ruby objects that wrap child nodes.
204
- However, this is ok because those Ruby objects do not have a free function
205
- and are no longer in scope (since if they were the document would not be freed).
206
-
207
- == License
208
- See LICENSE for license information.
data/ext/libxml/extconf.h DELETED
@@ -1,3 +0,0 @@
1
- #ifndef EXTCONF_H
2
- #define EXTCONF_H
3
- #endif