nokogiri 1.3.3 → 1.4.0

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 (201) 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 +42 -6
  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/css/generated_tokenizer.rb +1 -0
  51. data/lib/nokogiri/css/node.rb +1 -9
  52. data/lib/nokogiri/css/xpath_visitor.rb +11 -21
  53. data/lib/nokogiri/ffi/html/document.rb +0 -9
  54. data/lib/nokogiri/ffi/html/sax/parser_context.rb +38 -0
  55. data/lib/nokogiri/ffi/io_callbacks.rb +4 -2
  56. data/lib/nokogiri/ffi/libxml.rb +44 -10
  57. data/lib/nokogiri/ffi/structs/common_node.rb +1 -1
  58. data/lib/nokogiri/ffi/structs/xml_attribute.rb +27 -0
  59. data/lib/nokogiri/ffi/structs/xml_dtd.rb +3 -1
  60. data/lib/nokogiri/ffi/structs/xml_element.rb +26 -0
  61. data/lib/nokogiri/ffi/structs/xml_element_content.rb +17 -0
  62. data/lib/nokogiri/ffi/structs/xml_entity.rb +32 -0
  63. data/lib/nokogiri/ffi/structs/xml_enumeration.rb +12 -0
  64. data/lib/nokogiri/ffi/structs/xml_parser_context.rb +19 -0
  65. data/lib/nokogiri/ffi/structs/xml_sax_push_parser_context.rb +4 -3
  66. data/lib/nokogiri/ffi/structs/xml_syntax_error.rb +1 -1
  67. data/lib/nokogiri/ffi/xml/attribute_decl.rb +27 -0
  68. data/lib/nokogiri/ffi/xml/comment.rb +2 -2
  69. data/lib/nokogiri/ffi/xml/document.rb +29 -12
  70. data/lib/nokogiri/ffi/xml/document_fragment.rb +0 -5
  71. data/lib/nokogiri/ffi/xml/dtd.rb +14 -3
  72. data/lib/nokogiri/ffi/xml/element_content.rb +43 -0
  73. data/lib/nokogiri/ffi/xml/element_decl.rb +19 -0
  74. data/lib/nokogiri/ffi/xml/entity_decl.rb +27 -0
  75. data/lib/nokogiri/ffi/xml/node.rb +45 -5
  76. data/lib/nokogiri/ffi/xml/node_set.rb +1 -1
  77. data/lib/nokogiri/ffi/xml/reader.rb +45 -24
  78. data/lib/nokogiri/ffi/xml/sax/parser.rb +27 -34
  79. data/lib/nokogiri/ffi/xml/sax/parser_context.rb +67 -0
  80. data/lib/nokogiri/ffi/xml/sax/push_parser.rb +5 -4
  81. data/lib/nokogiri/ffi/xml/syntax_error.rb +31 -16
  82. data/lib/nokogiri/ffi/xml/text.rb +2 -2
  83. data/lib/nokogiri/html.rb +1 -0
  84. data/lib/nokogiri/html/document.rb +39 -24
  85. data/lib/nokogiri/html/sax/parser.rb +2 -2
  86. data/lib/nokogiri/html/sax/parser_context.rb +16 -0
  87. data/lib/nokogiri/version.rb +1 -1
  88. data/lib/nokogiri/xml.rb +6 -1
  89. data/lib/nokogiri/xml/attr.rb +5 -0
  90. data/lib/nokogiri/xml/attribute_decl.rb +18 -0
  91. data/lib/nokogiri/xml/builder.rb +121 -13
  92. data/lib/nokogiri/xml/character_data.rb +7 -0
  93. data/lib/nokogiri/xml/document.rb +43 -29
  94. data/lib/nokogiri/xml/document_fragment.rb +26 -6
  95. data/lib/nokogiri/xml/dtd.rb +5 -5
  96. data/lib/nokogiri/xml/element_content.rb +36 -0
  97. data/lib/nokogiri/xml/element_decl.rb +13 -0
  98. data/lib/nokogiri/xml/entity_decl.rb +15 -0
  99. data/lib/nokogiri/xml/fragment_handler.rb +22 -11
  100. data/lib/nokogiri/xml/namespace.rb +6 -0
  101. data/lib/nokogiri/xml/node.rb +33 -15
  102. data/lib/nokogiri/xml/node_set.rb +66 -44
  103. data/lib/nokogiri/xml/pp.rb +2 -0
  104. data/lib/nokogiri/xml/pp/character_data.rb +18 -0
  105. data/lib/nokogiri/xml/pp/node.rb +56 -0
  106. data/lib/nokogiri/xml/reader.rb +8 -0
  107. data/lib/nokogiri/xml/sax.rb +1 -1
  108. data/lib/nokogiri/xml/sax/document.rb +18 -1
  109. data/lib/nokogiri/xml/sax/parser.rb +15 -8
  110. data/lib/nokogiri/xml/sax/parser_context.rb +16 -0
  111. data/lib/nokogiri/xml/sax/push_parser.rb +0 -3
  112. data/lib/nokogiri/xml/syntax_error.rb +4 -0
  113. data/lib/nokogiri/xslt/stylesheet.rb +1 -1
  114. data/test/css/test_nthiness.rb +1 -1
  115. data/test/css/test_parser.rb +1 -1
  116. data/test/css/test_tokenizer.rb +1 -1
  117. data/test/css/test_xpath_visitor.rb +1 -1
  118. data/test/ffi/test_document.rb +1 -1
  119. data/test/files/shift_jis.html +10 -0
  120. data/test/files/staff.dtd +10 -0
  121. data/test/helper.rb +12 -3
  122. data/test/html/sax/test_parser.rb +1 -1
  123. data/test/html/sax/test_parser_context.rb +48 -0
  124. data/test/html/test_builder.rb +8 -2
  125. data/test/html/test_document.rb +23 -1
  126. data/test/html/test_document_encoding.rb +15 -1
  127. data/test/html/test_document_fragment.rb +10 -1
  128. data/test/html/test_element_description.rb +1 -2
  129. data/test/html/test_named_characters.rb +1 -1
  130. data/test/html/test_node.rb +61 -1
  131. data/test/html/test_node_encoding.rb +27 -0
  132. data/test/test_convert_xpath.rb +1 -3
  133. data/test/test_css_cache.rb +1 -1
  134. data/test/test_gc.rb +1 -1
  135. data/test/test_memory_leak.rb +1 -1
  136. data/test/test_nokogiri.rb +3 -3
  137. data/test/test_reader.rb +29 -1
  138. data/test/test_xslt_transforms.rb +1 -1
  139. data/test/xml/node/test_save_options.rb +1 -1
  140. data/test/xml/node/test_subclass.rb +1 -1
  141. data/test/xml/sax/test_parser.rb +64 -3
  142. data/test/xml/sax/test_parser_context.rb +56 -0
  143. data/test/xml/sax/test_push_parser.rb +11 -1
  144. data/test/xml/test_attr.rb +1 -1
  145. data/test/xml/test_attribute_decl.rb +82 -0
  146. data/test/xml/test_builder.rb +95 -1
  147. data/test/xml/test_cdata.rb +1 -1
  148. data/test/xml/test_comment.rb +7 -1
  149. data/test/xml/test_document.rb +147 -6
  150. data/test/xml/test_document_encoding.rb +1 -1
  151. data/test/xml/test_document_fragment.rb +55 -5
  152. data/test/xml/test_dtd.rb +40 -5
  153. data/test/xml/test_dtd_encoding.rb +3 -1
  154. data/test/xml/test_element_content.rb +56 -0
  155. data/test/xml/test_element_decl.rb +73 -0
  156. data/test/xml/test_entity_decl.rb +83 -0
  157. data/test/xml/test_entity_reference.rb +1 -1
  158. data/test/xml/test_namespace.rb +21 -1
  159. data/test/xml/test_node.rb +70 -4
  160. data/test/xml/test_node_attributes.rb +1 -1
  161. data/test/xml/test_node_encoding.rb +1 -1
  162. data/test/xml/test_node_set.rb +136 -2
  163. data/test/xml/test_parse_options.rb +1 -1
  164. data/test/xml/test_processing_instruction.rb +1 -1
  165. data/test/xml/test_reader_encoding.rb +1 -1
  166. data/test/xml/test_relax_ng.rb +1 -1
  167. data/test/xml/test_schema.rb +1 -1
  168. data/test/xml/test_syntax_error.rb +27 -0
  169. data/test/xml/test_text.rb +13 -1
  170. data/test/xml/test_unparented_node.rb +1 -1
  171. data/test/xml/test_xpath.rb +1 -1
  172. metadata +57 -40
  173. data/ext/nokogiri/html_sax_parser.c +0 -57
  174. data/ext/nokogiri/html_sax_parser.h +0 -11
  175. data/lib/action-nokogiri.rb +0 -38
  176. data/lib/nokogiri/decorators.rb +0 -2
  177. data/lib/nokogiri/decorators/hpricot.rb +0 -3
  178. data/lib/nokogiri/decorators/hpricot/node.rb +0 -56
  179. data/lib/nokogiri/decorators/hpricot/node_set.rb +0 -54
  180. data/lib/nokogiri/decorators/hpricot/xpath_visitor.rb +0 -30
  181. data/lib/nokogiri/ffi/html/sax/parser.rb +0 -21
  182. data/lib/nokogiri/hpricot.rb +0 -92
  183. data/lib/nokogiri/xml/entity_declaration.rb +0 -11
  184. data/lib/nokogiri/xml/sax/legacy_handlers.rb +0 -65
  185. data/test/hpricot/files/basic.xhtml +0 -17
  186. data/test/hpricot/files/boingboing.html +0 -2266
  187. data/test/hpricot/files/cy0.html +0 -3653
  188. data/test/hpricot/files/immob.html +0 -400
  189. data/test/hpricot/files/pace_application.html +0 -1320
  190. data/test/hpricot/files/tenderlove.html +0 -16
  191. data/test/hpricot/files/uswebgen.html +0 -220
  192. data/test/hpricot/files/utf8.html +0 -1054
  193. data/test/hpricot/files/week9.html +0 -1723
  194. data/test/hpricot/files/why.xml +0 -19
  195. data/test/hpricot/load_files.rb +0 -11
  196. data/test/hpricot/test_alter.rb +0 -68
  197. data/test/hpricot/test_builder.rb +0 -20
  198. data/test/hpricot/test_parser.rb +0 -350
  199. data/test/hpricot/test_paths.rb +0 -15
  200. data/test/hpricot/test_preserved.rb +0 -77
  201. data/test/hpricot/test_xml.rb +0 -30
@@ -1,3 +1,48 @@
1
+ === 1.4.0 2009年10月30日
2
+
3
+ * 今日はノコギリの満一歳のお誕生日です
4
+
5
+ * 新しい機能
6
+ * Node#at_xpath はXPathの表現に適したNodeSetの一番最初の要素に返す
7
+ * Node#at_css はCSSのセレクターに合うNodeSetの一番最初の要素に返す
8
+ * NodeSet#| は合併させる機能を果たす GH #119 (Serabe ありがとう!)
9
+ * NodeSet#inspect inspectは出力をきれいにさせる
10
+ * Node#inspect インスペクト後、普通のrubyで出力施行する
11
+ * XML::DTD#external_id を追加
12
+ * XML::DTD#system_id を追加
13
+ * XML::ElementContent はDTD要素のコンテンツを有効化させる
14
+ * Nokogiri::XML::Builder内での名前空間宣言用のサポートを改良
15
+ * XML::Node#external_subsetを追加
16
+ * XML::Node#create_external_subsetを追加
17
+ * XML::Node#create_internal_subsetを追加
18
+ * XML Builderは生成されていないstringsを付加出来る様になった
19
+ (GH #141, patch from dudleyf)
20
+ * XML::SAX::ParserContext を追加
21
+ * XML::Document#remove_namespaces! は名前空間を使いこなせない人たち用の措置
22
+
23
+ * バグの修正
24
+
25
+ * HTMLドキュメントが メタエンコーディングのタグを宣言しない時、
26
+ nilを返すようになった GH #115
27
+ * ENV['PATH'] を調節する為に、RbConfig::CONFIG['host_os']を使用できるように
28
+ なった GH #113
29
+ * NodeSet#searchが更に効率的になった GH #119 (Serabe!に感謝します)
30
+ * NodeSet#xpathがcustom xpath機能を取り扱える様になった
31
+ * XML::Reader が現時点のノード用に属性を取得する際に、
32
+ SEGVを修正するようになった
33
+ * Node#inner_html がNode#to_html と同じ独立変数を受け入れるようになった
34
+ GH #117
35
+ * DocumentFragment#css は子ノードへ委任をするようになった GH #123
36
+ * NodeSet#[]がNodeSet#lengthより大きいスライスでも機能できるようになった
37
+ GH #131
38
+ * 新たな親ノードの名前空間の維持出来るようになった GH #134
39
+ * XML::Document をNodeSetに追加の際にSEGVが修正されるようになった
40
+ * XML::SyntaxError が重複可
41
+
42
+ * 廃棄予定
43
+
44
+ * Hpricot用の互換性レイヤーを削除
45
+
1
46
  === 1.3.3 / 2009年7月26日
2
47
 
3
48
  * 新しい機能
@@ -8,12 +53,12 @@
8
53
 
9
54
  * libxml-ruby のグローバ ルエラー ハンドラー に優先するようになった
10
55
  * ParseOption#strict を修正
11
- * 空のstringを Node#inner_html= に与えた時に生じたSEGVを修正 GH #88
12
- * Ruby 1.9 で返したStringのエンコードはUTF-8になった
56
+ * 空文字列を Node#inner_html= に与えた時に生じたSEGVを修正 GH #88
57
+ * Ruby 1.9 では文字列のエンコーディングをUTF-8になるようにした
13
58
  * ドキュメントの根ノードから違うドキュメントの根ノードに移動した時に生じた
14
59
  SEGVを修正 GH #91
15
60
  * ノードをインスタンス化する時のO(n)のペナルティーを修正 GH #101
16
- * XMLのドキュメントをHTMLのドキュメントととして出力出来るようになった
61
+ * XMLのドキュメントをHTMLのドキュメントとして出力出来るようになった
17
62
 
18
63
  * 廃棄予定
19
64
 
@@ -1,3 +1,45 @@
1
+ === 1.4.0 / 2009/10/30
2
+
3
+ * Happy Birthday!
4
+
5
+ * New Features
6
+
7
+ * Node#at_xpath returns the first element of the NodeSet matching the XPath
8
+ expression.
9
+ * Node#at_css returns the first element of the NodeSet matching the CSS
10
+ selector.
11
+ * NodeSet#| for unions GH #119 (Thanks Serabe!)
12
+ * NodeSet#inspect makes prettier output
13
+ * Node#inspect implemented for more rubyish document inspecting
14
+ * Added XML::DTD#external_id
15
+ * Added XML::DTD#system_id
16
+ * Added XML::ElementContent for DTD Element content validity
17
+ * Better namespace declaration support in Nokogiri::XML::Builder
18
+ * Added XML::Node#external_subset
19
+ * Added XML::Node#create_external_subset
20
+ * Added XML::Node#create_internal_subset
21
+ * XML Builder can append raw strings (GH #141, patch from dudleyf)
22
+ * XML::SAX::ParserContext added
23
+ * XML::Document#remove_namespaces! for the namespace-impaired
24
+
25
+ * Bugfixes
26
+
27
+ * returns nil when HTML documents do not declare a meta encoding tag. GH #115
28
+ * Uses RbConfig::CONFIG['host_os'] to adjust ENV['PATH'] GH #113
29
+ * NodeSet#search is more efficient GH #119 (Thanks Serabe!)
30
+ * NodeSet#xpath handles custom xpath functions
31
+ * Fixing a SEGV when XML::Reader gets attributes for current node
32
+ * Node#inner_html takes the same arguments as Node#to_html GH #117
33
+ * DocumentFragment#css delegates to it's child nodes GH #123
34
+ * NodeSet#[] works with slices larger than NodeSet#length GH #131
35
+ * Reparented nodes maintain their namespace. GH #134
36
+ * Fixed SEGV when adding an XML::Document to NodeSet
37
+ * XML::SyntaxError can be duplicated. GH #148
38
+
39
+ * Deprecations
40
+
41
+ * Hpricot compatibility layer removed
42
+
1
43
  === 1.3.3 / 2009/07/26
2
44
 
3
45
  * New Features
@@ -13,12 +13,14 @@ ext/nokogiri/html_element_description.c
13
13
  ext/nokogiri/html_element_description.h
14
14
  ext/nokogiri/html_entity_lookup.c
15
15
  ext/nokogiri/html_entity_lookup.h
16
- ext/nokogiri/html_sax_parser.c
17
- ext/nokogiri/html_sax_parser.h
16
+ ext/nokogiri/html_sax_parser_context.c
17
+ ext/nokogiri/html_sax_parser_context.h
18
18
  ext/nokogiri/nokogiri.c
19
19
  ext/nokogiri/nokogiri.h
20
20
  ext/nokogiri/xml_attr.c
21
21
  ext/nokogiri/xml_attr.h
22
+ ext/nokogiri/xml_attribute_decl.c
23
+ ext/nokogiri/xml_attribute_decl.h
22
24
  ext/nokogiri/xml_cdata.c
23
25
  ext/nokogiri/xml_cdata.h
24
26
  ext/nokogiri/xml_comment.c
@@ -29,6 +31,12 @@ ext/nokogiri/xml_document_fragment.c
29
31
  ext/nokogiri/xml_document_fragment.h
30
32
  ext/nokogiri/xml_dtd.c
31
33
  ext/nokogiri/xml_dtd.h
34
+ ext/nokogiri/xml_element_content.c
35
+ ext/nokogiri/xml_element_content.h
36
+ ext/nokogiri/xml_element_decl.c
37
+ ext/nokogiri/xml_element_decl.h
38
+ ext/nokogiri/xml_entity_decl.c
39
+ ext/nokogiri/xml_entity_decl.h
32
40
  ext/nokogiri/xml_entity_reference.c
33
41
  ext/nokogiri/xml_entity_reference.h
34
42
  ext/nokogiri/xml_io.c
@@ -47,6 +55,8 @@ ext/nokogiri/xml_relax_ng.c
47
55
  ext/nokogiri/xml_relax_ng.h
48
56
  ext/nokogiri/xml_sax_parser.c
49
57
  ext/nokogiri/xml_sax_parser.h
58
+ ext/nokogiri/xml_sax_parser_context.c
59
+ ext/nokogiri/xml_sax_parser_context.h
50
60
  ext/nokogiri/xml_sax_push_parser.c
51
61
  ext/nokogiri/xml_sax_push_parser.h
52
62
  ext/nokogiri/xml_schema.c
@@ -61,7 +71,6 @@ ext/nokogiri/xml_xpath_context.c
61
71
  ext/nokogiri/xml_xpath_context.h
62
72
  ext/nokogiri/xslt_stylesheet.c
63
73
  ext/nokogiri/xslt_stylesheet.h
64
- lib/action-nokogiri.rb
65
74
  lib/nokogiri.rb
66
75
  lib/nokogiri/css.rb
67
76
  lib/nokogiri/css/generated_parser.rb
@@ -73,16 +82,11 @@ lib/nokogiri/css/syntax_error.rb
73
82
  lib/nokogiri/css/tokenizer.rb
74
83
  lib/nokogiri/css/tokenizer.rex
75
84
  lib/nokogiri/css/xpath_visitor.rb
76
- lib/nokogiri/decorators.rb
77
- lib/nokogiri/decorators/hpricot.rb
78
- lib/nokogiri/decorators/hpricot/node.rb
79
- lib/nokogiri/decorators/hpricot/node_set.rb
80
- lib/nokogiri/decorators/hpricot/xpath_visitor.rb
81
85
  lib/nokogiri/decorators/slop.rb
82
86
  lib/nokogiri/ffi/html/document.rb
83
87
  lib/nokogiri/ffi/html/element_description.rb
84
88
  lib/nokogiri/ffi/html/entity_lookup.rb
85
- lib/nokogiri/ffi/html/sax/parser.rb
89
+ lib/nokogiri/ffi/html/sax/parser_context.rb
86
90
  lib/nokogiri/ffi/io_callbacks.rb
87
91
  lib/nokogiri/ffi/libxml.rb
88
92
  lib/nokogiri/ffi/structs/common_node.rb
@@ -90,13 +94,19 @@ lib/nokogiri/ffi/structs/html_elem_desc.rb
90
94
  lib/nokogiri/ffi/structs/html_entity_desc.rb
91
95
  lib/nokogiri/ffi/structs/xml_alloc.rb
92
96
  lib/nokogiri/ffi/structs/xml_attr.rb
97
+ lib/nokogiri/ffi/structs/xml_attribute.rb
93
98
  lib/nokogiri/ffi/structs/xml_buffer.rb
94
99
  lib/nokogiri/ffi/structs/xml_document.rb
95
100
  lib/nokogiri/ffi/structs/xml_dtd.rb
101
+ lib/nokogiri/ffi/structs/xml_element.rb
102
+ lib/nokogiri/ffi/structs/xml_element_content.rb
103
+ lib/nokogiri/ffi/structs/xml_entity.rb
104
+ lib/nokogiri/ffi/structs/xml_enumeration.rb
96
105
  lib/nokogiri/ffi/structs/xml_node.rb
97
106
  lib/nokogiri/ffi/structs/xml_node_set.rb
98
107
  lib/nokogiri/ffi/structs/xml_notation.rb
99
108
  lib/nokogiri/ffi/structs/xml_ns.rb
109
+ lib/nokogiri/ffi/structs/xml_parser_context.rb
100
110
  lib/nokogiri/ffi/structs/xml_relax_ng.rb
101
111
  lib/nokogiri/ffi/structs/xml_sax_handler.rb
102
112
  lib/nokogiri/ffi/structs/xml_sax_push_parser_context.rb
@@ -108,11 +118,15 @@ lib/nokogiri/ffi/structs/xml_xpath_object.rb
108
118
  lib/nokogiri/ffi/structs/xml_xpath_parser_context.rb
109
119
  lib/nokogiri/ffi/structs/xslt_stylesheet.rb
110
120
  lib/nokogiri/ffi/xml/attr.rb
121
+ lib/nokogiri/ffi/xml/attribute_decl.rb
111
122
  lib/nokogiri/ffi/xml/cdata.rb
112
123
  lib/nokogiri/ffi/xml/comment.rb
113
124
  lib/nokogiri/ffi/xml/document.rb
114
125
  lib/nokogiri/ffi/xml/document_fragment.rb
115
126
  lib/nokogiri/ffi/xml/dtd.rb
127
+ lib/nokogiri/ffi/xml/element_content.rb
128
+ lib/nokogiri/ffi/xml/element_decl.rb
129
+ lib/nokogiri/ffi/xml/entity_decl.rb
116
130
  lib/nokogiri/ffi/xml/entity_reference.rb
117
131
  lib/nokogiri/ffi/xml/namespace.rb
118
132
  lib/nokogiri/ffi/xml/node.rb
@@ -121,6 +135,7 @@ lib/nokogiri/ffi/xml/processing_instruction.rb
121
135
  lib/nokogiri/ffi/xml/reader.rb
122
136
  lib/nokogiri/ffi/xml/relax_ng.rb
123
137
  lib/nokogiri/ffi/xml/sax/parser.rb
138
+ lib/nokogiri/ffi/xml/sax/parser_context.rb
124
139
  lib/nokogiri/ffi/xml/sax/push_parser.rb
125
140
  lib/nokogiri/ffi/xml/schema.rb
126
141
  lib/nokogiri/ffi/xml/syntax_error.rb
@@ -128,7 +143,6 @@ lib/nokogiri/ffi/xml/text.rb
128
143
  lib/nokogiri/ffi/xml/xpath.rb
129
144
  lib/nokogiri/ffi/xml/xpath_context.rb
130
145
  lib/nokogiri/ffi/xslt/stylesheet.rb
131
- lib/nokogiri/hpricot.rb
132
146
  lib/nokogiri/html.rb
133
147
  lib/nokogiri/html/builder.rb
134
148
  lib/nokogiri/html/document.rb
@@ -136,17 +150,22 @@ lib/nokogiri/html/document_fragment.rb
136
150
  lib/nokogiri/html/element_description.rb
137
151
  lib/nokogiri/html/entity_lookup.rb
138
152
  lib/nokogiri/html/sax/parser.rb
153
+ lib/nokogiri/html/sax/parser_context.rb
139
154
  lib/nokogiri/syntax_error.rb
140
155
  lib/nokogiri/version.rb
141
156
  lib/nokogiri/version_warning.rb
142
157
  lib/nokogiri/xml.rb
143
158
  lib/nokogiri/xml/attr.rb
159
+ lib/nokogiri/xml/attribute_decl.rb
144
160
  lib/nokogiri/xml/builder.rb
145
161
  lib/nokogiri/xml/cdata.rb
162
+ lib/nokogiri/xml/character_data.rb
146
163
  lib/nokogiri/xml/document.rb
147
164
  lib/nokogiri/xml/document_fragment.rb
148
165
  lib/nokogiri/xml/dtd.rb
149
- lib/nokogiri/xml/entity_declaration.rb
166
+ lib/nokogiri/xml/element_content.rb
167
+ lib/nokogiri/xml/element_decl.rb
168
+ lib/nokogiri/xml/entity_decl.rb
150
169
  lib/nokogiri/xml/fragment_handler.rb
151
170
  lib/nokogiri/xml/namespace.rb
152
171
  lib/nokogiri/xml/node.rb
@@ -154,13 +173,16 @@ lib/nokogiri/xml/node/save_options.rb
154
173
  lib/nokogiri/xml/node_set.rb
155
174
  lib/nokogiri/xml/notation.rb
156
175
  lib/nokogiri/xml/parse_options.rb
176
+ lib/nokogiri/xml/pp.rb
177
+ lib/nokogiri/xml/pp/character_data.rb
178
+ lib/nokogiri/xml/pp/node.rb
157
179
  lib/nokogiri/xml/processing_instruction.rb
158
180
  lib/nokogiri/xml/reader.rb
159
181
  lib/nokogiri/xml/relax_ng.rb
160
182
  lib/nokogiri/xml/sax.rb
161
183
  lib/nokogiri/xml/sax/document.rb
162
- lib/nokogiri/xml/sax/legacy_handlers.rb
163
184
  lib/nokogiri/xml/sax/parser.rb
185
+ lib/nokogiri/xml/sax/parser_context.rb
164
186
  lib/nokogiri/xml/sax/push_parser.rb
165
187
  lib/nokogiri/xml/schema.rb
166
188
  lib/nokogiri/xml/syntax_error.rb
@@ -186,31 +208,17 @@ test/files/exslt.xslt
186
208
  test/files/foo/foo.xsd
187
209
  test/files/po.xml
188
210
  test/files/po.xsd
211
+ test/files/shift_jis.html
189
212
  test/files/shift_jis.xml
190
213
  test/files/snuggles.xml
214
+ test/files/staff.dtd
191
215
  test/files/staff.xml
192
216
  test/files/staff.xslt
193
217
  test/files/tlm.html
194
218
  test/files/valid_bar.xml
195
219
  test/helper.rb
196
- test/hpricot/files/basic.xhtml
197
- test/hpricot/files/boingboing.html
198
- test/hpricot/files/cy0.html
199
- test/hpricot/files/immob.html
200
- test/hpricot/files/pace_application.html
201
- test/hpricot/files/tenderlove.html
202
- test/hpricot/files/uswebgen.html
203
- test/hpricot/files/utf8.html
204
- test/hpricot/files/week9.html
205
- test/hpricot/files/why.xml
206
- test/hpricot/load_files.rb
207
- test/hpricot/test_alter.rb
208
- test/hpricot/test_builder.rb
209
- test/hpricot/test_parser.rb
210
- test/hpricot/test_paths.rb
211
- test/hpricot/test_preserved.rb
212
- test/hpricot/test_xml.rb
213
220
  test/html/sax/test_parser.rb
221
+ test/html/sax/test_parser_context.rb
214
222
  test/html/test_builder.rb
215
223
  test/html/test_document.rb
216
224
  test/html/test_document_encoding.rb
@@ -218,6 +226,7 @@ test/html/test_document_fragment.rb
218
226
  test/html/test_element_description.rb
219
227
  test/html/test_named_characters.rb
220
228
  test/html/test_node.rb
229
+ test/html/test_node_encoding.rb
221
230
  test/test_convert_xpath.rb
222
231
  test/test_css_cache.rb
223
232
  test/test_gc.rb
@@ -228,8 +237,10 @@ test/test_xslt_transforms.rb
228
237
  test/xml/node/test_save_options.rb
229
238
  test/xml/node/test_subclass.rb
230
239
  test/xml/sax/test_parser.rb
240
+ test/xml/sax/test_parser_context.rb
231
241
  test/xml/sax/test_push_parser.rb
232
242
  test/xml/test_attr.rb
243
+ test/xml/test_attribute_decl.rb
233
244
  test/xml/test_builder.rb
234
245
  test/xml/test_cdata.rb
235
246
  test/xml/test_comment.rb
@@ -238,6 +249,9 @@ test/xml/test_document_encoding.rb
238
249
  test/xml/test_document_fragment.rb
239
250
  test/xml/test_dtd.rb
240
251
  test/xml/test_dtd_encoding.rb
252
+ test/xml/test_element_content.rb
253
+ test/xml/test_element_decl.rb
254
+ test/xml/test_entity_decl.rb
241
255
  test/xml/test_entity_reference.rb
242
256
  test/xml/test_namespace.rb
243
257
  test/xml/test_node.rb
@@ -249,6 +263,7 @@ test/xml/test_processing_instruction.rb
249
263
  test/xml/test_reader_encoding.rb
250
264
  test/xml/test_relax_ng.rb
251
265
  test/xml/test_schema.rb
266
+ test/xml/test_syntax_error.rb
252
267
  test/xml/test_text.rb
253
268
  test/xml/test_unparented_node.rb
254
269
  test/xml/test_xpath.rb
@@ -26,8 +26,6 @@ XML/HTMLの高速な解析と探索検索、ならびにCSS3セレクタとXPath
26
26
 
27
27
  * http://gist.github.com/24605
28
28
 
29
- また、NokogiriはHpricot互換の特徴を持ち、CSSやXPathも簡単に取り扱うことが出来ます。
30
-
31
29
  == SUPPORT:
32
30
 
33
31
  Nokogiriのメーリングリスト:
@@ -1,6 +1,6 @@
1
1
  = Nokogiri
2
2
 
3
- * http://nokogiri.org/
3
+ * http://nokogiri.org
4
4
  * http://github.com/tenderlove/nokogiri/wikis
5
5
  * http://github.com/tenderlove/nokogiri/tree/master
6
6
  * http://groups.google.com/group/nokogiri-talk
@@ -19,7 +19,6 @@ enough of it.
19
19
  * XPath support for document searching
20
20
  * CSS3 selector support for document searching
21
21
  * XML/HTML builder
22
- * Drop in replacement for Hpricot (though not bug for bug)
23
22
 
24
23
  Nokogiri parses and searches XML/HTML very quickly, and also has
25
24
  correctly implemented CSS3 selector support as well as XPath support.
@@ -28,12 +27,10 @@ Here is a speed test:
28
27
 
29
28
  * http://gist.github.com/24605
30
29
 
31
- Nokogiri also features an Hpricot compatibility layer to help ease the change
32
- to using correct CSS and XPath.
33
-
34
30
  == SUPPORT:
35
31
 
36
- The Nokogiri mailing list is available here:
32
+ The Nokogiri {mailing list}[http://groups.google.com/group/nokogiri-talk]
33
+ is available here:
37
34
 
38
35
  * http://groups.google.com/group/nokogiri-talk
39
36
 
@@ -87,7 +84,7 @@ The IRC channel is #nokogiri on freenode.
87
84
 
88
85
  == DEVELOPMENT:
89
86
 
90
- Developing Nokogiri requires racc and frex.
87
+ Developing Nokogiri requires racc and rexical.
91
88
 
92
89
  * rake install:deps
93
90
  * rake test
data/Rakefile CHANGED
@@ -21,18 +21,36 @@ HOE = Hoe.spec 'nokogiri' do
21
21
  self.extra_rdoc_files = FileList['*.rdoc']
22
22
  self.clean_globs = [
23
23
  'lib/nokogiri/*.{o,so,bundle,a,log,dll}',
24
+ 'lib/nokogiri/nokogiri.rb',
25
+ 'lib/nokogiri/1.{8,9}',
24
26
  GENERATED_PARSER,
25
27
  GENERATED_TOKENIZER,
26
28
  'cross',
27
29
  ]
28
30
 
29
31
  %w{ racc rexical rake-compiler }.each do |dep|
30
- self.extra_dev_deps << dep
32
+ self.extra_dev_deps << [dep, '>= 0']
31
33
  end
32
34
 
33
35
  self.spec_extras = { :extensions => ["ext/nokogiri/extconf.rb"] }
34
36
  end
35
37
 
38
+ task :ws_docs do
39
+ title = "#{HOE.name}-#{HOE.version} Documentation"
40
+
41
+ options = []
42
+ options << "--main=#{HOE.readme_file}"
43
+ options << '--format=activerecord'
44
+ options << '--threads=1'
45
+ options << "--title=#{title.inspect}"
46
+
47
+ options += HOE.spec.require_paths
48
+ options += HOE.spec.extra_rdoc_files
49
+ require 'rdoc/rdoc'
50
+ ENV['RAILS_ROOT'] ||= File.expand_path(File.join('..', 'nokogiri_ws'))
51
+ RDoc::RDoc.new.document options
52
+ end
53
+
36
54
  unless java
37
55
  gem 'rake-compiler', '>= 0.4.1'
38
56
  require "rake/extensiontask"
@@ -62,20 +80,22 @@ require "#{HOE.name}/\#{RUBY_VERSION.sub(/\\.\\d+$/, '')}/#{HOE.name}"
62
80
 
63
81
  namespace :cross do
64
82
  task :file_list do
65
- HOE.spec.platform = 'x86-mswin32'
83
+ HOE.spec.platform = 'x86-mingw32'
66
84
  HOE.spec.extensions = []
67
85
  HOE.spec.files += Dir["lib/#{HOE.name}/#{HOE.name}.rb"]
86
+ HOE.spec.files += Dir["lib/#{HOE.name}/1.{8,9}/#{HOE.name}.so"]
68
87
  HOE.spec.files += Dir["ext/nokogiri/*.dll"]
69
88
  end
70
89
  end
71
90
 
72
91
  CLOBBER.include("lib/nokogiri/nokogiri.{so,dylib,rb,bundle}")
73
92
  CLOBBER.include("lib/nokogiri/1.{8,9}")
93
+ CLOBBER.include("ext/nokogiri/*.dll")
74
94
  end
75
95
 
76
96
  namespace :gem do
77
97
  namespace :dev do
78
- task :spec do
98
+ task :spec => [ GENERATED_PARSER, GENERATED_TOKENIZER ] do
79
99
  File.open("#{HOE.name}.gemspec", 'w') do |f|
80
100
  HOE.spec.version = "#{HOE.version}.#{Time.now.strftime("%Y%m%d%H%M%S")}"
81
101
  f.write(HOE.spec.to_ruby)
@@ -96,6 +116,7 @@ namespace :gem do
96
116
  HOE.spec.platform = 'java'
97
117
  HOE.spec.files << GENERATED_PARSER
98
118
  HOE.spec.files << GENERATED_TOKENIZER
119
+ HOE.spec.files += Dir["ext/nokogiri/*.dll"]
99
120
  HOE.spec.extensions = []
100
121
  f.write(HOE.spec.to_ruby)
101
122
  end
@@ -130,7 +151,16 @@ libs = %w{
130
151
  libxslt-1.1.24.win32
131
152
  }
132
153
 
154
+ lib_dlls = {
155
+ 'iconv-1.9.2.win32' => 'iconv.dll',
156
+ 'zlib-1.2.3.win32' => 'zlib1.dll',
157
+ 'libxml2-2.7.3.win32' => 'libxml2.dll',
158
+ 'libxslt-1.1.24.win32' => 'libxslt.dll',
159
+ }
160
+
133
161
  libs.each do |lib|
162
+ libname = lib.split('-').first
163
+
134
164
  file "tmp/stash/#{lib}.zip" do |t|
135
165
  puts "downloading #{lib}"
136
166
  FileUtils.mkdir_p('tmp/stash')
@@ -140,23 +170,29 @@ libs.each do |lib|
140
170
  end
141
171
  end
142
172
 
143
- file "tmp/cross/#{lib.split('-').first}" => ["tmp/stash/#{lib}.zip"] do |t|
173
+ file "tmp/cross/#{libname}" => ["tmp/stash/#{lib}.zip"] do |t|
144
174
  puts "unzipping #{lib}.zip"
145
175
  FileUtils.mkdir_p('tmp/cross')
146
176
  Dir.chdir('tmp/cross') do
147
177
  sh "unzip ../stash/#{lib}.zip"
148
178
  sh "cp #{lib}/bin/* #{lib}/lib" # put DLL in lib, so dirconfig works
149
- sh "cp #{lib}/bin/*.dll ../../ext/nokogiri/"
150
179
  sh "mv #{lib} #{lib.split('-').first}"
151
180
  sh "touch #{lib.split('-').first}"
152
181
  end
153
182
  end
154
183
 
184
+ file "ext/nokogiri/#{lib_dlls[lib]}" => "tmp/cross/#{libname}" do |t|
185
+ Dir.chdir('tmp/cross') do
186
+ sh "cp #{libname}/bin/*.dll ../../ext/nokogiri/"
187
+ end
188
+ end
189
+
155
190
  if Rake::Task.task_defined?(:cross)
156
- Rake::Task[:cross].prerequisites << "tmp/cross/#{lib.split('-').first}"
191
+ Rake::Task[:cross].prerequisites << "ext/nokogiri/#{lib_dlls[lib]}"
157
192
  Rake::Task[:cross].prerequisites << "lib/nokogiri/nokogiri.rb"
158
193
  Rake::Task[:cross].prerequisites << "cross:file_list"
159
194
  end
195
+ Rake::Task['gem:jruby:spec'].prerequisites << "ext/nokogiri/#{lib_dlls[lib]}"
160
196
  end
161
197
 
162
198
  require 'tasks/test'