nokogiri 1.3.3-x86-mingw32 → 1.4.0-x86-mingw32

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 (202) hide show
  1. data/CHANGELOG.ja.rdoc +48 -3
  2. data/CHANGELOG.rdoc +42 -0
  3. data/Manifest.txt +44 -29
  4. data/README.ja.rdoc +0 -2
  5. data/README.rdoc +4 -7
  6. data/Rakefile +14 -22
  7. data/bin/nokogiri +7 -5
  8. data/ext/nokogiri/extconf.rb +5 -21
  9. data/ext/nokogiri/html_document.c +14 -50
  10. data/ext/nokogiri/html_element_description.c +7 -7
  11. data/ext/nokogiri/html_entity_lookup.c +6 -4
  12. data/ext/nokogiri/html_sax_parser_context.c +92 -0
  13. data/ext/nokogiri/html_sax_parser_context.h +11 -0
  14. data/ext/nokogiri/nokogiri.c +9 -3
  15. data/ext/nokogiri/nokogiri.h +16 -20
  16. data/ext/nokogiri/xml_attr.c +1 -1
  17. data/ext/nokogiri/xml_attribute_decl.c +67 -0
  18. data/ext/nokogiri/xml_attribute_decl.h +9 -0
  19. data/ext/nokogiri/xml_cdata.c +6 -5
  20. data/ext/nokogiri/xml_comment.c +3 -2
  21. data/ext/nokogiri/xml_document.c +93 -23
  22. data/ext/nokogiri/xml_document_fragment.c +1 -3
  23. data/ext/nokogiri/xml_dtd.c +63 -6
  24. data/ext/nokogiri/xml_element_content.c +123 -0
  25. data/ext/nokogiri/xml_element_content.h +10 -0
  26. data/ext/nokogiri/xml_element_decl.c +69 -0
  27. data/ext/nokogiri/xml_element_decl.h +9 -0
  28. data/ext/nokogiri/xml_entity_decl.c +97 -0
  29. data/ext/nokogiri/xml_entity_decl.h +10 -0
  30. data/ext/nokogiri/xml_entity_reference.c +1 -1
  31. data/ext/nokogiri/xml_io.c +10 -3
  32. data/ext/nokogiri/xml_io.h +1 -0
  33. data/ext/nokogiri/xml_namespace.c +2 -2
  34. data/ext/nokogiri/xml_node.c +139 -34
  35. data/ext/nokogiri/xml_node.h +0 -1
  36. data/ext/nokogiri/xml_node_set.c +23 -16
  37. data/ext/nokogiri/xml_processing_instruction.c +1 -1
  38. data/ext/nokogiri/xml_reader.c +78 -50
  39. data/ext/nokogiri/xml_sax_parser.c +109 -168
  40. data/ext/nokogiri/xml_sax_parser.h +33 -0
  41. data/ext/nokogiri/xml_sax_parser_context.c +155 -0
  42. data/ext/nokogiri/xml_sax_parser_context.h +10 -0
  43. data/ext/nokogiri/xml_sax_push_parser.c +11 -6
  44. data/ext/nokogiri/xml_syntax_error.c +63 -12
  45. data/ext/nokogiri/xml_text.c +4 -3
  46. data/ext/nokogiri/xml_xpath.c +1 -1
  47. data/ext/nokogiri/xml_xpath_context.c +12 -25
  48. data/ext/nokogiri/xslt_stylesheet.c +3 -3
  49. data/lib/nokogiri.rb +4 -4
  50. data/lib/nokogiri/1.8/nokogiri.so +0 -0
  51. data/lib/nokogiri/1.9/nokogiri.so +0 -0
  52. data/lib/nokogiri/css/node.rb +1 -9
  53. data/lib/nokogiri/css/xpath_visitor.rb +11 -21
  54. data/lib/nokogiri/ffi/html/document.rb +0 -9
  55. data/lib/nokogiri/ffi/html/sax/parser_context.rb +38 -0
  56. data/lib/nokogiri/ffi/io_callbacks.rb +4 -2
  57. data/lib/nokogiri/ffi/libxml.rb +44 -10
  58. data/lib/nokogiri/ffi/structs/common_node.rb +1 -1
  59. data/lib/nokogiri/ffi/structs/xml_attribute.rb +27 -0
  60. data/lib/nokogiri/ffi/structs/xml_dtd.rb +3 -1
  61. data/lib/nokogiri/ffi/structs/xml_element.rb +26 -0
  62. data/lib/nokogiri/ffi/structs/xml_element_content.rb +17 -0
  63. data/lib/nokogiri/ffi/structs/xml_entity.rb +32 -0
  64. data/lib/nokogiri/ffi/structs/xml_enumeration.rb +12 -0
  65. data/lib/nokogiri/ffi/structs/xml_parser_context.rb +19 -0
  66. data/lib/nokogiri/ffi/structs/xml_sax_push_parser_context.rb +4 -3
  67. data/lib/nokogiri/ffi/structs/xml_syntax_error.rb +1 -1
  68. data/lib/nokogiri/ffi/xml/attribute_decl.rb +27 -0
  69. data/lib/nokogiri/ffi/xml/comment.rb +2 -2
  70. data/lib/nokogiri/ffi/xml/document.rb +29 -12
  71. data/lib/nokogiri/ffi/xml/document_fragment.rb +0 -5
  72. data/lib/nokogiri/ffi/xml/dtd.rb +14 -3
  73. data/lib/nokogiri/ffi/xml/element_content.rb +43 -0
  74. data/lib/nokogiri/ffi/xml/element_decl.rb +19 -0
  75. data/lib/nokogiri/ffi/xml/entity_decl.rb +27 -0
  76. data/lib/nokogiri/ffi/xml/node.rb +45 -5
  77. data/lib/nokogiri/ffi/xml/node_set.rb +1 -1
  78. data/lib/nokogiri/ffi/xml/reader.rb +45 -24
  79. data/lib/nokogiri/ffi/xml/sax/parser.rb +27 -34
  80. data/lib/nokogiri/ffi/xml/sax/parser_context.rb +67 -0
  81. data/lib/nokogiri/ffi/xml/sax/push_parser.rb +5 -4
  82. data/lib/nokogiri/ffi/xml/syntax_error.rb +31 -16
  83. data/lib/nokogiri/ffi/xml/text.rb +2 -2
  84. data/lib/nokogiri/html.rb +1 -0
  85. data/lib/nokogiri/html/document.rb +39 -24
  86. data/lib/nokogiri/html/sax/parser.rb +2 -2
  87. data/lib/nokogiri/html/sax/parser_context.rb +16 -0
  88. data/lib/nokogiri/version.rb +1 -1
  89. data/lib/nokogiri/xml.rb +6 -1
  90. data/lib/nokogiri/xml/attr.rb +5 -0
  91. data/lib/nokogiri/xml/attribute_decl.rb +18 -0
  92. data/lib/nokogiri/xml/builder.rb +121 -13
  93. data/lib/nokogiri/xml/character_data.rb +7 -0
  94. data/lib/nokogiri/xml/document.rb +43 -29
  95. data/lib/nokogiri/xml/document_fragment.rb +26 -6
  96. data/lib/nokogiri/xml/dtd.rb +5 -5
  97. data/lib/nokogiri/xml/element_content.rb +36 -0
  98. data/lib/nokogiri/xml/element_decl.rb +13 -0
  99. data/lib/nokogiri/xml/entity_decl.rb +15 -0
  100. data/lib/nokogiri/xml/fragment_handler.rb +22 -11
  101. data/lib/nokogiri/xml/namespace.rb +6 -0
  102. data/lib/nokogiri/xml/node.rb +33 -15
  103. data/lib/nokogiri/xml/node_set.rb +66 -44
  104. data/lib/nokogiri/xml/pp.rb +2 -0
  105. data/lib/nokogiri/xml/pp/character_data.rb +18 -0
  106. data/lib/nokogiri/xml/pp/node.rb +56 -0
  107. data/lib/nokogiri/xml/reader.rb +8 -0
  108. data/lib/nokogiri/xml/sax.rb +1 -1
  109. data/lib/nokogiri/xml/sax/document.rb +18 -1
  110. data/lib/nokogiri/xml/sax/parser.rb +15 -8
  111. data/lib/nokogiri/xml/sax/parser_context.rb +16 -0
  112. data/lib/nokogiri/xml/sax/push_parser.rb +0 -3
  113. data/lib/nokogiri/xml/syntax_error.rb +4 -0
  114. data/lib/nokogiri/xslt/stylesheet.rb +1 -1
  115. data/test/css/test_nthiness.rb +1 -1
  116. data/test/css/test_parser.rb +1 -1
  117. data/test/css/test_tokenizer.rb +1 -1
  118. data/test/css/test_xpath_visitor.rb +1 -1
  119. data/test/ffi/test_document.rb +1 -1
  120. data/test/files/shift_jis.html +10 -0
  121. data/test/files/staff.dtd +10 -0
  122. data/test/helper.rb +12 -3
  123. data/test/html/sax/test_parser.rb +1 -1
  124. data/test/html/sax/test_parser_context.rb +48 -0
  125. data/test/html/test_builder.rb +8 -2
  126. data/test/html/test_document.rb +23 -1
  127. data/test/html/test_document_encoding.rb +15 -1
  128. data/test/html/test_document_fragment.rb +10 -1
  129. data/test/html/test_element_description.rb +1 -2
  130. data/test/html/test_named_characters.rb +1 -1
  131. data/test/html/test_node.rb +61 -1
  132. data/test/html/test_node_encoding.rb +27 -0
  133. data/test/test_convert_xpath.rb +1 -3
  134. data/test/test_css_cache.rb +1 -1
  135. data/test/test_gc.rb +1 -1
  136. data/test/test_memory_leak.rb +1 -1
  137. data/test/test_nokogiri.rb +3 -3
  138. data/test/test_reader.rb +29 -1
  139. data/test/test_xslt_transforms.rb +1 -1
  140. data/test/xml/node/test_save_options.rb +1 -1
  141. data/test/xml/node/test_subclass.rb +1 -1
  142. data/test/xml/sax/test_parser.rb +64 -3
  143. data/test/xml/sax/test_parser_context.rb +56 -0
  144. data/test/xml/sax/test_push_parser.rb +11 -1
  145. data/test/xml/test_attr.rb +1 -1
  146. data/test/xml/test_attribute_decl.rb +82 -0
  147. data/test/xml/test_builder.rb +95 -1
  148. data/test/xml/test_cdata.rb +1 -1
  149. data/test/xml/test_comment.rb +7 -1
  150. data/test/xml/test_document.rb +147 -6
  151. data/test/xml/test_document_encoding.rb +1 -1
  152. data/test/xml/test_document_fragment.rb +55 -5
  153. data/test/xml/test_dtd.rb +40 -5
  154. data/test/xml/test_dtd_encoding.rb +3 -1
  155. data/test/xml/test_element_content.rb +56 -0
  156. data/test/xml/test_element_decl.rb +73 -0
  157. data/test/xml/test_entity_decl.rb +83 -0
  158. data/test/xml/test_entity_reference.rb +1 -1
  159. data/test/xml/test_namespace.rb +21 -1
  160. data/test/xml/test_node.rb +70 -4
  161. data/test/xml/test_node_attributes.rb +1 -1
  162. data/test/xml/test_node_encoding.rb +1 -1
  163. data/test/xml/test_node_set.rb +136 -2
  164. data/test/xml/test_parse_options.rb +1 -1
  165. data/test/xml/test_processing_instruction.rb +1 -1
  166. data/test/xml/test_reader_encoding.rb +1 -1
  167. data/test/xml/test_relax_ng.rb +1 -1
  168. data/test/xml/test_schema.rb +1 -1
  169. data/test/xml/test_syntax_error.rb +27 -0
  170. data/test/xml/test_text.rb +13 -1
  171. data/test/xml/test_unparented_node.rb +1 -1
  172. data/test/xml/test_xpath.rb +1 -1
  173. metadata +55 -38
  174. data/ext/nokogiri/html_sax_parser.c +0 -57
  175. data/ext/nokogiri/html_sax_parser.h +0 -11
  176. data/lib/action-nokogiri.rb +0 -38
  177. data/lib/nokogiri/decorators.rb +0 -2
  178. data/lib/nokogiri/decorators/hpricot.rb +0 -3
  179. data/lib/nokogiri/decorators/hpricot/node.rb +0 -56
  180. data/lib/nokogiri/decorators/hpricot/node_set.rb +0 -54
  181. data/lib/nokogiri/decorators/hpricot/xpath_visitor.rb +0 -30
  182. data/lib/nokogiri/ffi/html/sax/parser.rb +0 -21
  183. data/lib/nokogiri/hpricot.rb +0 -92
  184. data/lib/nokogiri/xml/entity_declaration.rb +0 -11
  185. data/lib/nokogiri/xml/sax/legacy_handlers.rb +0 -65
  186. data/test/hpricot/files/basic.xhtml +0 -17
  187. data/test/hpricot/files/boingboing.html +0 -2266
  188. data/test/hpricot/files/cy0.html +0 -3653
  189. data/test/hpricot/files/immob.html +0 -400
  190. data/test/hpricot/files/pace_application.html +0 -1320
  191. data/test/hpricot/files/tenderlove.html +0 -16
  192. data/test/hpricot/files/uswebgen.html +0 -220
  193. data/test/hpricot/files/utf8.html +0 -1054
  194. data/test/hpricot/files/week9.html +0 -1723
  195. data/test/hpricot/files/why.xml +0 -19
  196. data/test/hpricot/load_files.rb +0 -11
  197. data/test/hpricot/test_alter.rb +0 -68
  198. data/test/hpricot/test_builder.rb +0 -20
  199. data/test/hpricot/test_parser.rb +0 -350
  200. data/test/hpricot/test_paths.rb +0 -15
  201. data/test/hpricot/test_preserved.rb +0 -77
  202. data/test/hpricot/test_xml.rb +0 -30
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), '..', "helper"))
1
+ require "helper"
2
2
 
3
3
  module Nokogiri
4
4
  module XML
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), '..', "helper"))
1
+ require "helper"
2
2
 
3
3
  module Nokogiri
4
4
  module XML
@@ -6,6 +6,79 @@ module Nokogiri
6
6
  def setup
7
7
  super
8
8
  @xml = Nokogiri::XML(File.read(XML_FILE), XML_FILE)
9
+ @list = @xml.css('employee')
10
+ end
11
+
12
+ def test_remove_attr
13
+ @list.each { |x| x['class'] = 'blah' }
14
+ assert_equal @list, @list.remove_attr('class')
15
+ @list.each { |x| assert_nil x['class'] }
16
+ end
17
+
18
+ def test_add_class
19
+ assert_equal @list, @list.add_class('bar')
20
+ @list.each { |x| assert_equal 'bar', x['class'] }
21
+
22
+ @list.add_class('bar')
23
+ @list.each { |x| assert_equal 'bar', x['class'] }
24
+
25
+ @list.add_class('baz')
26
+ @list.each { |x| assert_equal 'bar baz', x['class'] }
27
+ end
28
+
29
+ def test_remove_class_with_no_class
30
+ assert_equal @list, @list.remove_class('bar')
31
+ @list.each { |e| assert_nil e['class'] }
32
+
33
+ @list.each { |e| e['class'] = '' }
34
+ assert_equal @list, @list.remove_class('bar')
35
+ @list.each { |e| assert_nil e['class'] }
36
+ end
37
+
38
+ def test_remove_class_single
39
+ @list.each { |e| e['class'] = 'foo bar' }
40
+
41
+ assert_equal @list, @list.remove_class('bar')
42
+ @list.each { |e| assert_equal 'foo', e['class'] }
43
+ end
44
+
45
+ def test_remove_class_completely
46
+ @list.each { |e| e['class'] = 'foo' }
47
+
48
+ assert_equal @list, @list.remove_class
49
+ @list.each { |e| assert_nil e['class'] }
50
+ end
51
+
52
+ def test_attribute_set
53
+ @list.each { |e| assert_nil e['foo'] }
54
+
55
+ [ ['attribute', 'bar'], ['attr', 'biz'], ['set', 'baz'] ].each do |t|
56
+ @list.send(t.first.to_sym, 'foo', t.last)
57
+ @list.each { |e| assert_equal t.last, e['foo'] }
58
+ end
59
+ end
60
+
61
+ def test_attribute_set_with_block
62
+ @list.each { |e| assert_nil e['foo'] }
63
+
64
+ [ ['attribute', 'bar'], ['attr', 'biz'], ['set', 'baz'] ].each do |t|
65
+ @list.send(t.first.to_sym, 'foo') { |x| t.last }
66
+ @list.each { |e| assert_equal t.last, e['foo'] }
67
+ end
68
+ end
69
+
70
+ def test_attribute_set_with_hash
71
+ @list.each { |e| assert_nil e['foo'] }
72
+
73
+ [ ['attribute', 'bar'], ['attr', 'biz'], ['set', 'baz'] ].each do |t|
74
+ @list.send(t.first.to_sym, 'foo' => t.last)
75
+ @list.each { |e| assert_equal t.last, e['foo'] }
76
+ end
77
+ end
78
+
79
+ def test_attribute_no_args
80
+ @list.first['foo'] = 'bar'
81
+ assert_equal @list.first.attribute('foo'), @list.attribute('foo')
9
82
  end
10
83
 
11
84
  def test_search_empty_node_set
@@ -15,6 +88,39 @@ module Nokogiri
15
88
  assert_equal 0, set.search('foo').length
16
89
  end
17
90
 
91
+ def test_xpath_with_custom_object
92
+ set = @xml.xpath('//staff')
93
+ custom_employees = set.xpath('//*[awesome(.)]', Class.new {
94
+ def awesome ns
95
+ ns.select { |n| n.name == 'employee' }
96
+ end
97
+ }.new)
98
+
99
+ assert_equal @xml.xpath('//employee'), custom_employees
100
+ end
101
+
102
+ def test_css_with_custom_object
103
+ set = @xml.xpath('//staff')
104
+ custom_employees = set.css('*:awesome', Class.new {
105
+ def awesome ns
106
+ ns.select { |n| n.name == 'employee' }
107
+ end
108
+ }.new)
109
+
110
+ assert_equal @xml.xpath('//employee'), custom_employees
111
+ end
112
+
113
+ def test_search_with_custom_object
114
+ set = @xml.xpath('//staff')
115
+ custom_employees = set.search('//*[awesome(.)]', Class.new {
116
+ def awesome ns
117
+ ns.select { |n| n.name == 'employee' }
118
+ end
119
+ }.new)
120
+
121
+ assert_equal @xml.xpath('//employee'), custom_employees
122
+ end
123
+
18
124
  def test_css_searches_match_self
19
125
  html = Nokogiri::HTML("<html><body><div class='a'></div></body></html>")
20
126
  set = html.xpath("/html/body/div")
@@ -148,7 +254,7 @@ module Nokogiri
148
254
  assert node_set = @xml.search('//employee')
149
255
  assert_equal node_set.first, node_set.at(0)
150
256
  end
151
-
257
+
152
258
  def test_percent
153
259
  assert node_set = @xml.search('//employee')
154
260
  assert_equal node_set.first, node_set % 0
@@ -284,6 +390,14 @@ module Nokogiri
284
390
  assert_equal 'employee', @xml.search("//wrapper").first.children[0].name
285
391
  end
286
392
 
393
+ def test_wrap_preserves_document_structure
394
+ assert_equal "employeeId",
395
+ @xml.at_xpath("//employee").children.detect{|j| ! j.text? }.name
396
+ @xml.xpath("//employeeId[text()='EMP0001']").wrap("<wrapper/>")
397
+ assert_equal "wrapper",
398
+ @xml.at_xpath("//employee").children.detect{|j| ! j.text? }.name
399
+ end
400
+
287
401
  def test_plus_operator
288
402
  names = @xml.search("name")
289
403
  positions = @xml.search("position")
@@ -302,6 +416,12 @@ module Nokogiri
302
416
  assert_equal result.length, names.length
303
417
  end
304
418
 
419
+ def test_union
420
+ names = @xml.search("name")
421
+
422
+ assert_equal(names.length, (names | @xml.search("name")).length)
423
+ end
424
+
305
425
  def test_minus_operator
306
426
  employees = @xml.search("//employee")
307
427
  females = @xml.search("//employee[gender[text()='Female']]")
@@ -328,6 +448,12 @@ module Nokogiri
328
448
  assert_nil employees.index(other)
329
449
  end
330
450
 
451
+ def test_slice_too_far
452
+ employees = @xml.search("//employee")
453
+ assert_equal employees.length, employees[0, employees.length + 1].length
454
+ assert_equal employees.length, employees[0, employees.length].length
455
+ end
456
+
331
457
  def test_array_slice_with_start_and_end
332
458
  employees = @xml.search("//employee")
333
459
  assert_equal [employees[1], employees[2], employees[3]], employees[1,3].to_a
@@ -392,6 +518,14 @@ module Nokogiri
392
518
  assert_equal count, set.length
393
519
  end
394
520
 
521
+ def test_inspect
522
+ employees = @xml.search("//employee")
523
+ inspected = employees.inspect
524
+
525
+ assert_equal "[#{employees.map { |x| x.inspect }.join(', ')}]",
526
+ inspected
527
+ end
528
+
395
529
  end
396
530
  end
397
531
  end
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), '..', "helper"))
1
+ require "helper"
2
2
 
3
3
  module Nokogiri
4
4
  module XML
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), '..', "helper"))
1
+ require "helper"
2
2
 
3
3
  module Nokogiri
4
4
  module XML
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require File.expand_path(File.join(File.dirname(__FILE__), '..', "helper"))
2
+ require "helper"
3
3
 
4
4
  module Nokogiri
5
5
  module XML
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), '..', "helper"))
1
+ require "helper"
2
2
 
3
3
  module Nokogiri
4
4
  module XML
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), '..', "helper"))
1
+ require "helper"
2
2
 
3
3
  module Nokogiri
4
4
  module XML
@@ -0,0 +1,27 @@
1
+ require "helper"
2
+
3
+ module Nokogiri
4
+ module XML
5
+ class TestSyntaxError < Nokogiri::TestCase
6
+ def test_new
7
+ error = Nokogiri::XML::SyntaxError.new 'hello'
8
+ assert_equal 'hello', error.message
9
+ end
10
+
11
+ def test_exception
12
+ error = Nokogiri::XML::SyntaxError.new 'hello'
13
+ dup = error.exception 'world'
14
+ assert_equal 'hello', dup.message
15
+ assert_not_equal error.message.object_id, dup.message.object_id
16
+ end
17
+
18
+ def test_initialize_copy
19
+ error = Nokogiri::XML::SyntaxError.new 'hello'
20
+ dup = error.dup
21
+ assert_equal 'hello', dup.message
22
+ assert_not_equal error.object_id, dup.object_id
23
+ assert_not_equal error.message.object_id, dup.message.object_id
24
+ end
25
+ end
26
+ end
27
+ end
@@ -1,8 +1,13 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), '..', "helper"))
1
+ require "helper"
2
2
 
3
3
  module Nokogiri
4
4
  module XML
5
5
  class TestText < Nokogiri::TestCase
6
+ def test_inspect
7
+ node = Text.new('hello world', Document.new)
8
+ assert_equal "#<#{node.class.name}:#{sprintf("0x%x",node.object_id)} #{node.text.inspect}>", node.inspect
9
+ end
10
+
6
11
  def test_new
7
12
  node = Text.new('hello world', Document.new)
8
13
  assert node
@@ -13,6 +18,13 @@ module Nokogiri
13
18
  def test_lots_of_text
14
19
  100.times { Text.new('hello world', Document.new) }
15
20
  end
21
+
22
+ # No assertion because this was a segv
23
+ def test_new_without_document
24
+ doc = Document.new
25
+ node = Nokogiri::XML::Element.new('foo', doc)
26
+ text = Text.new('hello world', node)
27
+ end
16
28
  end
17
29
  end
18
30
  end
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), '..', "helper"))
1
+ require "helper"
2
2
 
3
3
  require 'stringio'
4
4
 
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), '..', "helper"))
1
+ require "helper"
2
2
 
3
3
  module Nokogiri
4
4
  module XML
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.3.3
4
+ version: 1.4.0
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Aaron Patterson
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-09-06 00:00:00 -07:00
13
+ date: 2009-10-30 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -86,12 +86,14 @@ files:
86
86
  - ext/nokogiri/html_element_description.h
87
87
  - ext/nokogiri/html_entity_lookup.c
88
88
  - ext/nokogiri/html_entity_lookup.h
89
- - ext/nokogiri/html_sax_parser.c
90
- - ext/nokogiri/html_sax_parser.h
89
+ - ext/nokogiri/html_sax_parser_context.c
90
+ - ext/nokogiri/html_sax_parser_context.h
91
91
  - ext/nokogiri/nokogiri.c
92
92
  - ext/nokogiri/nokogiri.h
93
93
  - ext/nokogiri/xml_attr.c
94
94
  - ext/nokogiri/xml_attr.h
95
+ - ext/nokogiri/xml_attribute_decl.c
96
+ - ext/nokogiri/xml_attribute_decl.h
95
97
  - ext/nokogiri/xml_cdata.c
96
98
  - ext/nokogiri/xml_cdata.h
97
99
  - ext/nokogiri/xml_comment.c
@@ -102,6 +104,12 @@ files:
102
104
  - ext/nokogiri/xml_document_fragment.h
103
105
  - ext/nokogiri/xml_dtd.c
104
106
  - ext/nokogiri/xml_dtd.h
107
+ - ext/nokogiri/xml_element_content.c
108
+ - ext/nokogiri/xml_element_content.h
109
+ - ext/nokogiri/xml_element_decl.c
110
+ - ext/nokogiri/xml_element_decl.h
111
+ - ext/nokogiri/xml_entity_decl.c
112
+ - ext/nokogiri/xml_entity_decl.h
105
113
  - ext/nokogiri/xml_entity_reference.c
106
114
  - ext/nokogiri/xml_entity_reference.h
107
115
  - ext/nokogiri/xml_io.c
@@ -120,6 +128,8 @@ files:
120
128
  - ext/nokogiri/xml_relax_ng.h
121
129
  - ext/nokogiri/xml_sax_parser.c
122
130
  - ext/nokogiri/xml_sax_parser.h
131
+ - ext/nokogiri/xml_sax_parser_context.c
132
+ - ext/nokogiri/xml_sax_parser_context.h
123
133
  - ext/nokogiri/xml_sax_push_parser.c
124
134
  - ext/nokogiri/xml_sax_push_parser.h
125
135
  - ext/nokogiri/xml_schema.c
@@ -134,7 +144,6 @@ files:
134
144
  - ext/nokogiri/xml_xpath_context.h
135
145
  - ext/nokogiri/xslt_stylesheet.c
136
146
  - ext/nokogiri/xslt_stylesheet.h
137
- - lib/action-nokogiri.rb
138
147
  - lib/nokogiri.rb
139
148
  - lib/nokogiri/css.rb
140
149
  - lib/nokogiri/css/generated_parser.rb
@@ -146,16 +155,11 @@ files:
146
155
  - lib/nokogiri/css/tokenizer.rb
147
156
  - lib/nokogiri/css/tokenizer.rex
148
157
  - lib/nokogiri/css/xpath_visitor.rb
149
- - lib/nokogiri/decorators.rb
150
- - lib/nokogiri/decorators/hpricot.rb
151
- - lib/nokogiri/decorators/hpricot/node.rb
152
- - lib/nokogiri/decorators/hpricot/node_set.rb
153
- - lib/nokogiri/decorators/hpricot/xpath_visitor.rb
154
158
  - lib/nokogiri/decorators/slop.rb
155
159
  - lib/nokogiri/ffi/html/document.rb
156
160
  - lib/nokogiri/ffi/html/element_description.rb
157
161
  - lib/nokogiri/ffi/html/entity_lookup.rb
158
- - lib/nokogiri/ffi/html/sax/parser.rb
162
+ - lib/nokogiri/ffi/html/sax/parser_context.rb
159
163
  - lib/nokogiri/ffi/io_callbacks.rb
160
164
  - lib/nokogiri/ffi/libxml.rb
161
165
  - lib/nokogiri/ffi/structs/common_node.rb
@@ -163,13 +167,19 @@ files:
163
167
  - lib/nokogiri/ffi/structs/html_entity_desc.rb
164
168
  - lib/nokogiri/ffi/structs/xml_alloc.rb
165
169
  - lib/nokogiri/ffi/structs/xml_attr.rb
170
+ - lib/nokogiri/ffi/structs/xml_attribute.rb
166
171
  - lib/nokogiri/ffi/structs/xml_buffer.rb
167
172
  - lib/nokogiri/ffi/structs/xml_document.rb
168
173
  - lib/nokogiri/ffi/structs/xml_dtd.rb
174
+ - lib/nokogiri/ffi/structs/xml_element.rb
175
+ - lib/nokogiri/ffi/structs/xml_element_content.rb
176
+ - lib/nokogiri/ffi/structs/xml_entity.rb
177
+ - lib/nokogiri/ffi/structs/xml_enumeration.rb
169
178
  - lib/nokogiri/ffi/structs/xml_node.rb
170
179
  - lib/nokogiri/ffi/structs/xml_node_set.rb
171
180
  - lib/nokogiri/ffi/structs/xml_notation.rb
172
181
  - lib/nokogiri/ffi/structs/xml_ns.rb
182
+ - lib/nokogiri/ffi/structs/xml_parser_context.rb
173
183
  - lib/nokogiri/ffi/structs/xml_relax_ng.rb
174
184
  - lib/nokogiri/ffi/structs/xml_sax_handler.rb
175
185
  - lib/nokogiri/ffi/structs/xml_sax_push_parser_context.rb
@@ -181,11 +191,15 @@ files:
181
191
  - lib/nokogiri/ffi/structs/xml_xpath_parser_context.rb
182
192
  - lib/nokogiri/ffi/structs/xslt_stylesheet.rb
183
193
  - lib/nokogiri/ffi/xml/attr.rb
194
+ - lib/nokogiri/ffi/xml/attribute_decl.rb
184
195
  - lib/nokogiri/ffi/xml/cdata.rb
185
196
  - lib/nokogiri/ffi/xml/comment.rb
186
197
  - lib/nokogiri/ffi/xml/document.rb
187
198
  - lib/nokogiri/ffi/xml/document_fragment.rb
188
199
  - lib/nokogiri/ffi/xml/dtd.rb
200
+ - lib/nokogiri/ffi/xml/element_content.rb
201
+ - lib/nokogiri/ffi/xml/element_decl.rb
202
+ - lib/nokogiri/ffi/xml/entity_decl.rb
189
203
  - lib/nokogiri/ffi/xml/entity_reference.rb
190
204
  - lib/nokogiri/ffi/xml/namespace.rb
191
205
  - lib/nokogiri/ffi/xml/node.rb
@@ -194,6 +208,7 @@ files:
194
208
  - lib/nokogiri/ffi/xml/reader.rb
195
209
  - lib/nokogiri/ffi/xml/relax_ng.rb
196
210
  - lib/nokogiri/ffi/xml/sax/parser.rb
211
+ - lib/nokogiri/ffi/xml/sax/parser_context.rb
197
212
  - lib/nokogiri/ffi/xml/sax/push_parser.rb
198
213
  - lib/nokogiri/ffi/xml/schema.rb
199
214
  - lib/nokogiri/ffi/xml/syntax_error.rb
@@ -201,7 +216,6 @@ files:
201
216
  - lib/nokogiri/ffi/xml/xpath.rb
202
217
  - lib/nokogiri/ffi/xml/xpath_context.rb
203
218
  - lib/nokogiri/ffi/xslt/stylesheet.rb
204
- - lib/nokogiri/hpricot.rb
205
219
  - lib/nokogiri/html.rb
206
220
  - lib/nokogiri/html/builder.rb
207
221
  - lib/nokogiri/html/document.rb
@@ -209,17 +223,22 @@ files:
209
223
  - lib/nokogiri/html/element_description.rb
210
224
  - lib/nokogiri/html/entity_lookup.rb
211
225
  - lib/nokogiri/html/sax/parser.rb
226
+ - lib/nokogiri/html/sax/parser_context.rb
212
227
  - lib/nokogiri/syntax_error.rb
213
228
  - lib/nokogiri/version.rb
214
229
  - lib/nokogiri/version_warning.rb
215
230
  - lib/nokogiri/xml.rb
216
231
  - lib/nokogiri/xml/attr.rb
232
+ - lib/nokogiri/xml/attribute_decl.rb
217
233
  - lib/nokogiri/xml/builder.rb
218
234
  - lib/nokogiri/xml/cdata.rb
235
+ - lib/nokogiri/xml/character_data.rb
219
236
  - lib/nokogiri/xml/document.rb
220
237
  - lib/nokogiri/xml/document_fragment.rb
221
238
  - lib/nokogiri/xml/dtd.rb
222
- - lib/nokogiri/xml/entity_declaration.rb
239
+ - lib/nokogiri/xml/element_content.rb
240
+ - lib/nokogiri/xml/element_decl.rb
241
+ - lib/nokogiri/xml/entity_decl.rb
223
242
  - lib/nokogiri/xml/fragment_handler.rb
224
243
  - lib/nokogiri/xml/namespace.rb
225
244
  - lib/nokogiri/xml/node.rb
@@ -227,13 +246,16 @@ files:
227
246
  - lib/nokogiri/xml/node_set.rb
228
247
  - lib/nokogiri/xml/notation.rb
229
248
  - lib/nokogiri/xml/parse_options.rb
249
+ - lib/nokogiri/xml/pp.rb
250
+ - lib/nokogiri/xml/pp/character_data.rb
251
+ - lib/nokogiri/xml/pp/node.rb
230
252
  - lib/nokogiri/xml/processing_instruction.rb
231
253
  - lib/nokogiri/xml/reader.rb
232
254
  - lib/nokogiri/xml/relax_ng.rb
233
255
  - lib/nokogiri/xml/sax.rb
234
256
  - lib/nokogiri/xml/sax/document.rb
235
- - lib/nokogiri/xml/sax/legacy_handlers.rb
236
257
  - lib/nokogiri/xml/sax/parser.rb
258
+ - lib/nokogiri/xml/sax/parser_context.rb
237
259
  - lib/nokogiri/xml/sax/push_parser.rb
238
260
  - lib/nokogiri/xml/schema.rb
239
261
  - lib/nokogiri/xml/syntax_error.rb
@@ -259,31 +281,17 @@ files:
259
281
  - test/files/foo/foo.xsd
260
282
  - test/files/po.xml
261
283
  - test/files/po.xsd
284
+ - test/files/shift_jis.html
262
285
  - test/files/shift_jis.xml
263
286
  - test/files/snuggles.xml
287
+ - test/files/staff.dtd
264
288
  - test/files/staff.xml
265
289
  - test/files/staff.xslt
266
290
  - test/files/tlm.html
267
291
  - test/files/valid_bar.xml
268
292
  - test/helper.rb
269
- - test/hpricot/files/basic.xhtml
270
- - test/hpricot/files/boingboing.html
271
- - test/hpricot/files/cy0.html
272
- - test/hpricot/files/immob.html
273
- - test/hpricot/files/pace_application.html
274
- - test/hpricot/files/tenderlove.html
275
- - test/hpricot/files/uswebgen.html
276
- - test/hpricot/files/utf8.html
277
- - test/hpricot/files/week9.html
278
- - test/hpricot/files/why.xml
279
- - test/hpricot/load_files.rb
280
- - test/hpricot/test_alter.rb
281
- - test/hpricot/test_builder.rb
282
- - test/hpricot/test_parser.rb
283
- - test/hpricot/test_paths.rb
284
- - test/hpricot/test_preserved.rb
285
- - test/hpricot/test_xml.rb
286
293
  - test/html/sax/test_parser.rb
294
+ - test/html/sax/test_parser_context.rb
287
295
  - test/html/test_builder.rb
288
296
  - test/html/test_document.rb
289
297
  - test/html/test_document_encoding.rb
@@ -291,6 +299,7 @@ files:
291
299
  - test/html/test_element_description.rb
292
300
  - test/html/test_named_characters.rb
293
301
  - test/html/test_node.rb
302
+ - test/html/test_node_encoding.rb
294
303
  - test/test_convert_xpath.rb
295
304
  - test/test_css_cache.rb
296
305
  - test/test_gc.rb
@@ -301,8 +310,10 @@ files:
301
310
  - test/xml/node/test_save_options.rb
302
311
  - test/xml/node/test_subclass.rb
303
312
  - test/xml/sax/test_parser.rb
313
+ - test/xml/sax/test_parser_context.rb
304
314
  - test/xml/sax/test_push_parser.rb
305
315
  - test/xml/test_attr.rb
316
+ - test/xml/test_attribute_decl.rb
306
317
  - test/xml/test_builder.rb
307
318
  - test/xml/test_cdata.rb
308
319
  - test/xml/test_comment.rb
@@ -311,6 +322,9 @@ files:
311
322
  - test/xml/test_document_fragment.rb
312
323
  - test/xml/test_dtd.rb
313
324
  - test/xml/test_dtd_encoding.rb
325
+ - test/xml/test_element_content.rb
326
+ - test/xml/test_element_decl.rb
327
+ - test/xml/test_entity_decl.rb
314
328
  - test/xml/test_entity_reference.rb
315
329
  - test/xml/test_namespace.rb
316
330
  - test/xml/test_node.rb
@@ -322,6 +336,7 @@ files:
322
336
  - test/xml/test_reader_encoding.rb
323
337
  - test/xml/test_relax_ng.rb
324
338
  - test/xml/test_schema.rb
339
+ - test/xml/test_syntax_error.rb
325
340
  - test/xml/test_text.rb
326
341
  - test/xml/test_unparented_node.rb
327
342
  - test/xml/test_xpath.rb
@@ -334,7 +349,7 @@ files:
334
349
  - ext/nokogiri/libexslt.dll
335
350
  - ext/nokogiri/libxslt.dll
336
351
  has_rdoc: true
337
- homepage: http://nokogiri.org/
352
+ homepage: http://nokogiri.org
338
353
  licenses: []
339
354
 
340
355
  post_install_message:
@@ -366,31 +381,31 @@ summary: "Nokogiri (\xE9\x8B\xB8) is an HTML, XML, SAX, and Reader parser"
366
381
  test_files:
367
382
  - test/test_nokogiri.rb
368
383
  - test/test_convert_xpath.rb
369
- - test/hpricot/test_xml.rb
370
- - test/hpricot/test_alter.rb
371
- - test/hpricot/test_builder.rb
372
- - test/hpricot/test_paths.rb
373
- - test/hpricot/test_parser.rb
374
- - test/hpricot/test_preserved.rb
375
384
  - test/test_memory_leak.rb
376
385
  - test/html/test_document_fragment.rb
377
386
  - test/html/test_named_characters.rb
378
387
  - test/html/test_builder.rb
379
388
  - test/html/test_node.rb
380
389
  - test/html/test_document.rb
390
+ - test/html/test_node_encoding.rb
381
391
  - test/html/sax/test_parser.rb
392
+ - test/html/sax/test_parser_context.rb
382
393
  - test/html/test_document_encoding.rb
383
394
  - test/html/test_element_description.rb
384
395
  - test/xml/test_unparented_node.rb
385
396
  - test/xml/test_document_fragment.rb
397
+ - test/xml/test_attribute_decl.rb
386
398
  - test/xml/test_node_set.rb
399
+ - test/xml/test_element_content.rb
387
400
  - test/xml/test_dtd.rb
401
+ - test/xml/test_entity_decl.rb
388
402
  - test/xml/test_schema.rb
389
403
  - test/xml/test_builder.rb
390
404
  - test/xml/test_attr.rb
391
405
  - test/xml/test_processing_instruction.rb
392
406
  - test/xml/test_text.rb
393
407
  - test/xml/test_node_attributes.rb
408
+ - test/xml/test_element_decl.rb
394
409
  - test/xml/test_node.rb
395
410
  - test/xml/test_reader_encoding.rb
396
411
  - test/xml/test_comment.rb
@@ -400,10 +415,12 @@ test_files:
400
415
  - test/xml/test_cdata.rb
401
416
  - test/xml/test_dtd_encoding.rb
402
417
  - test/xml/test_document.rb
418
+ - test/xml/test_syntax_error.rb
403
419
  - test/xml/test_node_encoding.rb
404
420
  - test/xml/test_relax_ng.rb
405
421
  - test/xml/sax/test_push_parser.rb
406
422
  - test/xml/sax/test_parser.rb
423
+ - test/xml/sax/test_parser_context.rb
407
424
  - test/xml/test_namespace.rb
408
425
  - test/xml/test_document_encoding.rb
409
426
  - test/xml/test_entity_reference.rb