libxml-ruby 1.1.4 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. data/{CHANGES → HISTORY} +35 -0
  2. data/LICENSE +1 -0
  3. data/MANIFEST +165 -0
  4. data/{README → README.rdoc} +2 -2
  5. data/Rakefile +47 -147
  6. data/ext/libxml/libxml.c +17 -1
  7. data/ext/libxml/ruby_libxml.h +9 -1
  8. data/ext/libxml/ruby_xml_attr.c +3 -3
  9. data/ext/libxml/ruby_xml_attr_decl.c +32 -32
  10. data/ext/libxml/ruby_xml_attributes.c +1 -1
  11. data/ext/libxml/ruby_xml_cbg.c +1 -2
  12. data/ext/libxml/ruby_xml_document.c +26 -4
  13. data/ext/libxml/ruby_xml_dtd.c +3 -3
  14. data/ext/libxml/ruby_xml_encoding.c +92 -5
  15. data/ext/libxml/ruby_xml_encoding.h +4 -0
  16. data/ext/libxml/ruby_xml_namespace.c +2 -2
  17. data/ext/libxml/ruby_xml_node.c +14 -14
  18. data/ext/libxml/ruby_xml_parser_context.c +8 -8
  19. data/ext/libxml/ruby_xml_reader.c +98 -43
  20. data/ext/libxml/ruby_xml_sax2_handler.c +13 -1
  21. data/ext/libxml/ruby_xml_sax_parser.c +4 -5
  22. data/ext/libxml/ruby_xml_version.h +5 -5
  23. data/ext/libxml/ruby_xml_xpath_context.c +9 -6
  24. data/ext/libxml/ruby_xml_xpath_object.c +1 -1
  25. data/ext/vc/libxml_ruby.sln +4 -4
  26. data/lib/libxml.rb +29 -29
  27. data/lib/libxml/attr.rb +112 -110
  28. data/lib/libxml/attr_decl.rb +2 -0
  29. data/lib/libxml/attributes.rb +13 -11
  30. data/lib/libxml/document.rb +192 -190
  31. data/lib/libxml/error.rb +89 -87
  32. data/lib/libxml/hpricot.rb +77 -75
  33. data/lib/libxml/html_parser.rb +96 -94
  34. data/lib/libxml/namespace.rb +61 -59
  35. data/lib/libxml/namespaces.rb +37 -35
  36. data/lib/libxml/node.rb +398 -384
  37. data/lib/libxml/ns.rb +21 -19
  38. data/lib/libxml/parser.rb +366 -364
  39. data/lib/libxml/properties.rb +22 -20
  40. data/lib/libxml/reader.rb +2 -0
  41. data/lib/libxml/sax_callbacks.rb +179 -177
  42. data/lib/libxml/sax_parser.rb +57 -55
  43. data/lib/libxml/tree.rb +28 -26
  44. data/lib/libxml/xpath_object.rb +15 -13
  45. data/lib/xml.rb +16 -14
  46. data/lib/xml/libxml.rb +10 -8
  47. data/libxml-ruby.gemspec +50 -0
  48. data/script/benchmark/depixelate +634 -0
  49. data/script/benchmark/hamlet.xml +9055 -0
  50. data/script/benchmark/parsecount +170 -0
  51. data/script/benchmark/sock_entries.xml +507 -0
  52. data/script/benchmark/throughput +41 -0
  53. data/script/test +6 -0
  54. data/test/etc_doc_to_s.rb +21 -19
  55. data/test/ets_doc_file.rb +17 -15
  56. data/test/ets_doc_to_s.rb +23 -21
  57. data/test/ets_gpx.rb +28 -26
  58. data/test/ets_node_gc.rb +23 -21
  59. data/test/ets_tsr.rb +11 -9
  60. data/test/model/bands.iso-8859-1.xml +5 -0
  61. data/test/model/bands.utf-8.xml +5 -0
  62. data/test/rb-magic-comment.rb +33 -0
  63. data/test/tc_attr.rb +181 -170
  64. data/test/tc_attr_decl.rb +3 -1
  65. data/test/tc_attributes.rb +134 -132
  66. data/test/tc_deprecated_require.rb +13 -11
  67. data/test/tc_document.rb +119 -113
  68. data/test/tc_document_write.rb +186 -117
  69. data/test/tc_dtd.rb +125 -123
  70. data/test/tc_error.rb +3 -1
  71. data/test/tc_html_parser.rb +139 -137
  72. data/test/tc_namespace.rb +61 -58
  73. data/test/tc_namespaces.rb +176 -173
  74. data/test/tc_node.rb +257 -180
  75. data/test/tc_node_cdata.rb +51 -49
  76. data/test/tc_node_comment.rb +33 -30
  77. data/test/tc_node_copy.rb +42 -40
  78. data/test/tc_node_edit.rb +159 -157
  79. data/test/tc_node_text.rb +71 -69
  80. data/test/tc_node_write.rb +41 -16
  81. data/test/tc_node_xlink.rb +29 -26
  82. data/test/tc_parser.rb +335 -329
  83. data/test/tc_parser_context.rb +188 -185
  84. data/test/tc_properties.rb +39 -36
  85. data/test/tc_reader.rb +297 -283
  86. data/test/tc_relaxng.rb +54 -51
  87. data/test/tc_sax_parser.rb +275 -273
  88. data/test/tc_schema.rb +53 -51
  89. data/test/tc_traversal.rb +222 -220
  90. data/test/tc_xinclude.rb +21 -19
  91. data/test/tc_xml.rb +3 -1
  92. data/test/tc_xpath.rb +195 -193
  93. data/test/tc_xpath_context.rb +80 -78
  94. data/test/tc_xpath_expression.rb +38 -35
  95. data/test/tc_xpointer.rb +74 -72
  96. data/test/test_helper.rb +14 -0
  97. data/test/test_suite.rb +39 -33
  98. metadata +65 -105
  99. data/doc/css/normal.css +0 -182
  100. data/doc/img/raze-tiny.png +0 -0
  101. data/doc/img/red-cube.jpg +0 -0
  102. data/doc/img/xml-ruby.png +0 -0
  103. data/doc/index.xml +0 -43
  104. data/doc/install.xml +0 -77
  105. data/doc/layout.rhtml +0 -38
  106. data/doc/layout.xsl +0 -67
  107. data/doc/license.xml +0 -32
  108. data/doc/log/changelog.xml +0 -1324
  109. data/doc/log/changelog.xsl +0 -42
  110. data/ext/libxml/Makefile +0 -156
  111. data/ext/libxml/extconf.h +0 -5
  112. data/ext/libxml/libxml-ruby.so.a +0 -0
  113. data/ext/libxml/libxml.o +0 -0
  114. data/ext/libxml/libxml_ruby.so +0 -0
  115. data/ext/libxml/mkmf.log +0 -129
  116. data/ext/libxml/ruby_xml.o +0 -0
  117. data/ext/libxml/ruby_xml_attr.o +0 -0
  118. data/ext/libxml/ruby_xml_attr_decl.o +0 -0
  119. data/ext/libxml/ruby_xml_attributes.o +0 -0
  120. data/ext/libxml/ruby_xml_cbg.o +0 -0
  121. data/ext/libxml/ruby_xml_document.o +0 -0
  122. data/ext/libxml/ruby_xml_dtd.o +0 -0
  123. data/ext/libxml/ruby_xml_encoding.o +0 -0
  124. data/ext/libxml/ruby_xml_error.o +0 -0
  125. data/ext/libxml/ruby_xml_html_parser.o +0 -0
  126. data/ext/libxml/ruby_xml_html_parser_context.o +0 -0
  127. data/ext/libxml/ruby_xml_html_parser_options.o +0 -0
  128. data/ext/libxml/ruby_xml_input_cbg.o +0 -0
  129. data/ext/libxml/ruby_xml_io.o +0 -0
  130. data/ext/libxml/ruby_xml_namespace.o +0 -0
  131. data/ext/libxml/ruby_xml_namespaces.o +0 -0
  132. data/ext/libxml/ruby_xml_node.o +0 -0
  133. data/ext/libxml/ruby_xml_parser.o +0 -0
  134. data/ext/libxml/ruby_xml_parser_context.o +0 -0
  135. data/ext/libxml/ruby_xml_parser_options.o +0 -0
  136. data/ext/libxml/ruby_xml_reader.o +0 -0
  137. data/ext/libxml/ruby_xml_relaxng.o +0 -0
  138. data/ext/libxml/ruby_xml_sax2_handler.o +0 -0
  139. data/ext/libxml/ruby_xml_sax_parser.o +0 -0
  140. data/ext/libxml/ruby_xml_schema.o +0 -0
  141. data/ext/libxml/ruby_xml_xinclude.o +0 -0
  142. data/ext/libxml/ruby_xml_xpath.o +0 -0
  143. data/ext/libxml/ruby_xml_xpath_context.o +0 -0
  144. data/ext/libxml/ruby_xml_xpath_expression.o +0 -0
  145. data/ext/libxml/ruby_xml_xpath_object.o +0 -0
  146. data/ext/libxml/ruby_xml_xpointer.o +0 -0
data/test/tc_schema.rb CHANGED
@@ -1,51 +1,53 @@
1
- require 'xml'
2
- require 'test/unit'
3
-
4
- class TestSchema < Test::Unit::TestCase
5
- def setup
6
- file = File.join(File.dirname(__FILE__), 'model/shiporder.xml')
7
- @doc = XML::Document.file(file)
8
- end
9
-
10
- def teardown
11
- @doc = nil
12
- end
13
-
14
- def schema
15
- document = XML::Document.file(File.join(File.dirname(__FILE__), 'model/shiporder.xsd'))
16
- schema = XML::Schema.document(document)
17
- end
18
-
19
- def test_from_doc
20
- assert_instance_of(XML::Schema, schema)
21
- end
22
-
23
- def test_valid
24
- assert(@doc.validate_schema(schema))
25
- end
26
-
27
- def test_invalid
28
- new_node = XML::Node.new('invalid', 'this will mess up validation')
29
- @doc.root.child_add(new_node)
30
-
31
- error = assert_raise(XML::Error) do
32
- @doc.validate_schema(schema)
33
- end
34
-
35
- assert_not_nil(error)
36
- assert_kind_of(XML::Error, error)
37
- assert(error.message.match(/Error: Element 'invalid': This element is not expected. Expected is \( item \)/))
38
- assert_equal(XML::Error::SCHEMASV, error.domain)
39
- assert_equal(XML::Error::SCHEMAV_ELEMENT_CONTENT, error.code)
40
- assert_equal(XML::Error::ERROR, error.level)
41
- assert(error.file.match(/shiporder.xml/))
42
- assert_nil(error.line)
43
- assert_nil(error.str1)
44
- assert_nil(error.str2)
45
- assert_nil(error.str3)
46
- assert_equal(0, error.int1)
47
- assert_equal(0, error.int2)
48
- assert_not_nil(error.node)
49
- assert_equal('invalid', error.node.name)
50
- end
51
- end
1
+ # encoding: UTF-8
2
+
3
+ require './test_helper'
4
+ require 'test/unit'
5
+
6
+ class TestSchema < Test::Unit::TestCase
7
+ def setup
8
+ file = File.join(File.dirname(__FILE__), 'model/shiporder.xml')
9
+ @doc = XML::Document.file(file)
10
+ end
11
+
12
+ def teardown
13
+ @doc = nil
14
+ end
15
+
16
+ def schema
17
+ document = XML::Document.file(File.join(File.dirname(__FILE__), 'model/shiporder.xsd'))
18
+ schema = XML::Schema.document(document)
19
+ end
20
+
21
+ def test_from_doc
22
+ assert_instance_of(XML::Schema, schema)
23
+ end
24
+
25
+ def test_valid
26
+ assert(@doc.validate_schema(schema))
27
+ end
28
+
29
+ def test_invalid
30
+ new_node = XML::Node.new('invalid', 'this will mess up validation')
31
+ @doc.root << new_node
32
+
33
+ error = assert_raise(XML::Error) do
34
+ @doc.validate_schema(schema)
35
+ end
36
+
37
+ assert_not_nil(error)
38
+ assert_kind_of(XML::Error, error)
39
+ assert(error.message.match(/Error: Element 'invalid': This element is not expected. Expected is \( item \)/))
40
+ assert_equal(XML::Error::SCHEMASV, error.domain)
41
+ assert_equal(XML::Error::SCHEMAV_ELEMENT_CONTENT, error.code)
42
+ assert_equal(XML::Error::ERROR, error.level)
43
+ assert(error.file.match(/shiporder.xml/))
44
+ assert_nil(error.line)
45
+ assert_nil(error.str1)
46
+ assert_nil(error.str2)
47
+ assert_nil(error.str3)
48
+ assert_equal(0, error.int1)
49
+ assert_equal(0, error.int2)
50
+ assert_not_nil(error.node)
51
+ assert_equal('invalid', error.node.name)
52
+ end
53
+ end
data/test/tc_traversal.rb CHANGED
@@ -1,220 +1,222 @@
1
- require 'xml'
2
- require 'test/unit'
3
-
4
- class TestTranversal < Test::Unit::TestCase
5
- ROOT_NODES_LENGTH = 25
6
- ROOT_ELEMENTS_LENGTH = 12
7
-
8
- def setup
9
- filename = File.join(File.dirname(__FILE__), 'model/books.xml')
10
- @doc = XML::Document.file(filename)
11
- end
12
-
13
- def teardown
14
- @doc = nil
15
- end
16
-
17
- def test_children
18
- # Includes text nodes and such
19
- assert_equal(ROOT_NODES_LENGTH, @doc.root.children.length)
20
- end
21
-
22
- def test_children_iteration
23
- # Includes text nodes and such
24
- nodes = @doc.root.children.inject([]) do |arr, node|
25
- arr << node
26
- arr
27
- end
28
-
29
- assert_equal(ROOT_NODES_LENGTH, nodes.length)
30
- end
31
-
32
- def test_each
33
- # Includes text nodes and such
34
- nodes = @doc.root.inject([]) do |arr, node|
35
- arr << node
36
- arr
37
- end
38
-
39
- assert_equal(ROOT_NODES_LENGTH, nodes.length)
40
- end
41
-
42
- def test_each_element
43
- # Includes text nodes and such
44
- nodes = []
45
- @doc.root.each_element do |node|
46
- nodes << node
47
- end
48
-
49
- assert_equal(ROOT_ELEMENTS_LENGTH, nodes.length)
50
- end
51
-
52
- def test_next
53
- nodes = []
54
-
55
- node = @doc.root.first
56
-
57
- while node
58
- nodes << node
59
- node = node.next
60
- end
61
- assert_equal(ROOT_NODES_LENGTH, nodes.length)
62
- end
63
-
64
- def test_next?
65
- first_node = @doc.root.first
66
- assert(first_node.next?)
67
-
68
- last_node = @doc.root.last
69
- assert(!last_node.next?)
70
- end
71
-
72
- def test_prev
73
- nodes = []
74
-
75
- node = @doc.root.last
76
-
77
- while node
78
- nodes << node
79
- node = node.prev
80
- end
81
- assert_equal(ROOT_NODES_LENGTH, nodes.length)
82
- end
83
-
84
- def test_prev?
85
- first_node = @doc.root.first
86
- assert(!first_node.prev?)
87
-
88
- last_node = @doc.root.last
89
- assert(last_node.prev?)
90
- end
91
-
92
- def test_parent?
93
- assert(!@doc.parent?)
94
- assert(@doc.root.parent?)
95
- end
96
-
97
- def test_child?
98
- assert(@doc.child?)
99
- assert(!@doc.root.first.child?)
100
- end
101
-
102
- def test_next_prev_equivalence
103
- next_nodes = []
104
- last_nodes = []
105
-
106
- node = @doc.root.first
107
- while node
108
- next_nodes << node
109
- node = node.next
110
- end
111
-
112
- node = @doc.root.last
113
- while node
114
- last_nodes << node
115
- node = node.prev
116
- end
117
-
118
- assert_equal(next_nodes, last_nodes.reverse)
119
- end
120
-
121
- def test_next_children_equivalence
122
- next_nodes = []
123
-
124
- node = @doc.root.first
125
- while node
126
- next_nodes << node
127
- node = node.next
128
- end
129
-
130
- assert_equal(@doc.root.children, next_nodes)
131
- end
132
-
133
- # node = @doc.find_first('book')
134
- # node.children.each do |node|
135
- # puts 1
136
- #end
137
- # @doc.root.children do |node|
138
- # if node.node_type == XML::Node::ELEMENT_NODE
139
- # puts node.name
140
- #end
141
- #end
142
- #assert_equal(12,nodes.length)
143
- #end
144
-
145
- #def test_doc_class
146
- #assert_instance_of(XML::Document, @doc)
147
- #end
148
-
149
- #def test_root_class
150
- #assert_instance_of(XML::Node, @doc.root)
151
- #end
152
-
153
- #def test_node_class
154
- #for n in nodes
155
- #assert_instance_of(XML::Node, n)
156
- #end
157
- #end
158
-
159
- #def test_find_class
160
- #set = @doc.find('/ruby_array/fixnum')
161
- #assert_instance_of(XML::XPath::Object, set)
162
- #end
163
-
164
- #def test_node_child_get
165
- #assert_instance_of(TrueClass, @doc.root.child?)
166
- #assert_instance_of(XML::Node, @doc.root.child)
167
- #assert_equal('fixnum', @doc.root.child.name)
168
- #end
169
-
170
- #def test_node_doc
171
- #for n in nodes
172
- #assert_instance_of(XML::Document, n.doc) if n.document?
173
- #end
174
- #end
175
-
176
- #def test_node_type_name
177
- #assert_equal('element', nodes[0].node_type_name)
178
- #assert_equal('element', nodes[1].node_type_name)
179
- #end
180
-
181
- #def test_node_find
182
- #set = @doc.root.find('./fixnum').set
183
- #assert_instance_of(XML::Node::Set, set)
184
- #for node in set
185
- #assert_instance_of(XML::Node, node)
186
- #end
187
- #end
188
-
189
- #def test_equality
190
- #node_a = @doc.find('/ruby_array/fixnum').first
191
- #node_b = @doc.root.child
192
- #assert(node_a == node_b)
193
- #assert(node_a.eql?(node_b))
194
- #assert(node_a.equal?(node_b))
195
-
196
- #xp2 = XML::Parser.new()
197
- #xp2.string = '<ruby_array uga="booga" foo="bar"><fixnum>one</fixnum><fixnum>two</fixnum></ruby_array>'
198
- #doc2 = xp2.parse
199
-
200
- #node_a2 = doc2.find('/ruby_array/fixnum').first
201
-
202
- #assert(node_a.to_s == node_a2.to_s)
203
- #assert(node_a == node_a2)
204
- #assert(node_a.eql?(node_a2))
205
- #assert(!node_a.equal?(node_a2))
206
- #end
207
-
208
- #def test_content()
209
- #assert_equal('onetwo', @doc.root.content)
210
-
211
- #first = @doc.root.child
212
- #assert_equal('one', first.content)
213
- #assert_equal('two', first.next.content)
214
- #end
215
-
216
- #def test_base
217
- #doc = XML::Parser.string('<person />').parse
218
- #assert_nil(doc.root.base)
219
- #end
220
- end
1
+ # encoding: UTF-8
2
+
3
+ require './test_helper'
4
+ require 'test/unit'
5
+
6
+ class TestTranversal < Test::Unit::TestCase
7
+ ROOT_NODES_LENGTH = 25
8
+ ROOT_ELEMENTS_LENGTH = 12
9
+
10
+ def setup
11
+ filename = File.join(File.dirname(__FILE__), 'model/books.xml')
12
+ @doc = XML::Document.file(filename)
13
+ end
14
+
15
+ def teardown
16
+ @doc = nil
17
+ end
18
+
19
+ def test_children
20
+ # Includes text nodes and such
21
+ assert_equal(ROOT_NODES_LENGTH, @doc.root.children.length)
22
+ end
23
+
24
+ def test_children_iteration
25
+ # Includes text nodes and such
26
+ nodes = @doc.root.children.inject([]) do |arr, node|
27
+ arr << node
28
+ arr
29
+ end
30
+
31
+ assert_equal(ROOT_NODES_LENGTH, nodes.length)
32
+ end
33
+
34
+ def test_each
35
+ # Includes text nodes and such
36
+ nodes = @doc.root.inject([]) do |arr, node|
37
+ arr << node
38
+ arr
39
+ end
40
+
41
+ assert_equal(ROOT_NODES_LENGTH, nodes.length)
42
+ end
43
+
44
+ def test_each_element
45
+ # Includes text nodes and such
46
+ nodes = []
47
+ @doc.root.each_element do |node|
48
+ nodes << node
49
+ end
50
+
51
+ assert_equal(ROOT_ELEMENTS_LENGTH, nodes.length)
52
+ end
53
+
54
+ def test_next
55
+ nodes = []
56
+
57
+ node = @doc.root.first
58
+
59
+ while node
60
+ nodes << node
61
+ node = node.next
62
+ end
63
+ assert_equal(ROOT_NODES_LENGTH, nodes.length)
64
+ end
65
+
66
+ def test_next?
67
+ first_node = @doc.root.first
68
+ assert(first_node.next?)
69
+
70
+ last_node = @doc.root.last
71
+ assert(!last_node.next?)
72
+ end
73
+
74
+ def test_prev
75
+ nodes = []
76
+
77
+ node = @doc.root.last
78
+
79
+ while node
80
+ nodes << node
81
+ node = node.prev
82
+ end
83
+ assert_equal(ROOT_NODES_LENGTH, nodes.length)
84
+ end
85
+
86
+ def test_prev?
87
+ first_node = @doc.root.first
88
+ assert(!first_node.prev?)
89
+
90
+ last_node = @doc.root.last
91
+ assert(last_node.prev?)
92
+ end
93
+
94
+ def test_parent?
95
+ assert(!@doc.parent?)
96
+ assert(@doc.root.parent?)
97
+ end
98
+
99
+ def test_child?
100
+ assert(@doc.child?)
101
+ assert(!@doc.root.first.child?)
102
+ end
103
+
104
+ def test_next_prev_equivalence
105
+ next_nodes = []
106
+ last_nodes = []
107
+
108
+ node = @doc.root.first
109
+ while node
110
+ next_nodes << node
111
+ node = node.next
112
+ end
113
+
114
+ node = @doc.root.last
115
+ while node
116
+ last_nodes << node
117
+ node = node.prev
118
+ end
119
+
120
+ assert_equal(next_nodes, last_nodes.reverse)
121
+ end
122
+
123
+ def test_next_children_equivalence
124
+ next_nodes = []
125
+
126
+ node = @doc.root.first
127
+ while node
128
+ next_nodes << node
129
+ node = node.next
130
+ end
131
+
132
+ assert_equal(@doc.root.children, next_nodes)
133
+ end
134
+
135
+ # node = @doc.find_first('book')
136
+ # node.children.each do |node|
137
+ # puts 1
138
+ #end
139
+ # @doc.root.children do |node|
140
+ # if node.node_type == XML::Node::ELEMENT_NODE
141
+ # puts node.name
142
+ #end
143
+ #end
144
+ #assert_equal(12,nodes.length)
145
+ #end
146
+
147
+ #def test_doc_class
148
+ #assert_instance_of(XML::Document, @doc)
149
+ #end
150
+
151
+ #def test_root_class
152
+ #assert_instance_of(XML::Node, @doc.root)
153
+ #end
154
+
155
+ #def test_node_class
156
+ #for n in nodes
157
+ #assert_instance_of(XML::Node, n)
158
+ #end
159
+ #end
160
+
161
+ #def test_find_class
162
+ #set = @doc.find('/ruby_array/fixnum')
163
+ #assert_instance_of(XML::XPath::Object, set)
164
+ #end
165
+
166
+ #def test_node_child_get
167
+ #assert_instance_of(TrueClass, @doc.root.child?)
168
+ #assert_instance_of(XML::Node, @doc.root.child)
169
+ #assert_equal('fixnum', @doc.root.child.name)
170
+ #end
171
+
172
+ #def test_node_doc
173
+ #for n in nodes
174
+ #assert_instance_of(XML::Document, n.doc) if n.document?
175
+ #end
176
+ #end
177
+
178
+ #def test_node_type_name
179
+ #assert_equal('element', nodes[0].node_type_name)
180
+ #assert_equal('element', nodes[1].node_type_name)
181
+ #end
182
+
183
+ #def test_node_find
184
+ #set = @doc.root.find('./fixnum').set
185
+ #assert_instance_of(XML::Node::Set, set)
186
+ #for node in set
187
+ #assert_instance_of(XML::Node, node)
188
+ #end
189
+ #end
190
+
191
+ #def test_equality
192
+ #node_a = @doc.find('/ruby_array/fixnum').first
193
+ #node_b = @doc.root.child
194
+ #assert(node_a == node_b)
195
+ #assert(node_a.eql?(node_b))
196
+ #assert(node_a.equal?(node_b))
197
+
198
+ #xp2 = XML::Parser.new()
199
+ #xp2.string = '<ruby_array uga="booga" foo="bar"><fixnum>one</fixnum><fixnum>two</fixnum></ruby_array>'
200
+ #doc2 = xp2.parse
201
+
202
+ #node_a2 = doc2.find('/ruby_array/fixnum').first
203
+
204
+ #assert(node_a.to_s == node_a2.to_s)
205
+ #assert(node_a == node_a2)
206
+ #assert(node_a.eql?(node_a2))
207
+ #assert(!node_a.equal?(node_a2))
208
+ #end
209
+
210
+ #def test_content()
211
+ #assert_equal('onetwo', @doc.root.content)
212
+
213
+ #first = @doc.root.child
214
+ #assert_equal('one', first.content)
215
+ #assert_equal('two', first.next.content)
216
+ #end
217
+
218
+ #def test_base
219
+ #doc = XML::Parser.string('<person />').parse
220
+ #assert_nil(doc.root.base)
221
+ #end
222
+ end