libxml-ruby 0.7.0-x86-mswin32-60 → 0.8.0-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. data/CHANGES +24 -1
  2. data/README +48 -3
  3. data/benchmark/depixelate.rb +632 -0
  4. data/benchmark/hamlet.xml +9055 -0
  5. data/benchmark/sock_entries.xml +507 -0
  6. data/benchmark/throughput.rb +39 -0
  7. data/benchmark/xml_benchmarks.rb +222 -0
  8. data/doc/classes/LibXML.html +237 -0
  9. data/doc/classes/LibXML/XML.html +178 -0
  10. data/doc/classes/{XML → LibXML/XML}/Attr.html +213 -182
  11. data/doc/classes/{XML → LibXML/XML}/Attributes.html +126 -54
  12. data/doc/classes/{XML → LibXML/XML}/Document.html +299 -297
  13. data/doc/classes/{XML → LibXML/XML}/Dtd.html +10 -10
  14. data/doc/classes/{XML/XInclude → LibXML/XML}/Error.html +4 -4
  15. data/doc/classes/{XML → LibXML/XML}/HTMLParser.html +40 -40
  16. data/doc/classes/{XML → LibXML/XML}/InputCallbacks.html +10 -10
  17. data/doc/classes/{XML → LibXML/XML}/NS.html +46 -46
  18. data/doc/classes/{XML → LibXML/XML}/Node.html +935 -788
  19. data/doc/classes/LibXML/XML/Node/FailedModify.html +111 -0
  20. data/doc/classes/{XML → LibXML/XML}/Node/Set.html +69 -68
  21. data/doc/classes/{XML → LibXML/XML}/Node/SetNamespace.html +4 -4
  22. data/doc/classes/{XML/Node/FailedModify.html → LibXML/XML/Node/UnknownType.html} +4 -4
  23. data/doc/classes/{XML → LibXML/XML}/Parser.html +426 -389
  24. data/doc/classes/{XML → LibXML/XML}/Parser/Context.html +208 -208
  25. data/doc/classes/{XML → LibXML/XML}/Parser/ParseError.html +4 -4
  26. data/doc/classes/{XML → LibXML/XML}/Reader.html +288 -287
  27. data/doc/classes/{XML → LibXML/XML}/SaxParser.html +52 -52
  28. data/doc/classes/{XML/XPath/Context.html → LibXML/XML/Schema.html} +60 -32
  29. data/doc/classes/{XML → LibXML/XML}/State.html +4 -4
  30. data/doc/classes/{XML/Node/UnknownType.html → LibXML/XML/Tree.html} +5 -5
  31. data/doc/classes/{XML → LibXML/XML}/XInclude.html +5 -5
  32. data/doc/classes/{XML → LibXML/XML/XInclude}/Error.html +5 -5
  33. data/doc/classes/{XML → LibXML/XML}/XMLParserOptions.html +5 -5
  34. data/doc/classes/{XML → LibXML/XML}/XPath.html +23 -64
  35. data/doc/classes/LibXML/XML/XPath/Context.html +403 -0
  36. data/doc/classes/{XML/XPointer/Context → LibXML/XML/XPath}/InvalidPath.html +4 -4
  37. data/doc/classes/LibXML/XML/XPath/Object.html +623 -0
  38. data/doc/classes/{XML → LibXML/XML}/XPointer.html +12 -12
  39. data/doc/classes/{XML → LibXML/XML}/XPointer/Context.html +5 -5
  40. data/doc/classes/{XML/XPath → LibXML/XML/XPointer/Context}/InvalidPath.html +5 -5
  41. data/doc/classes/{XML → LibXML/XML}/XPointer/InvalidExpression.html +4 -4
  42. data/doc/classes/XML.html +17 -123
  43. data/doc/created.rid +1 -1
  44. data/doc/files/CHANGES.html +49 -25
  45. data/doc/files/LICENSE.html +1 -1
  46. data/doc/files/README.html +79 -4
  47. data/doc/files/VERSION.html +2 -2
  48. data/doc/files/ext/libxml/cbg_c.html +1 -1
  49. data/doc/files/ext/libxml/libxml_c.html +1 -1
  50. data/doc/files/ext/libxml/ruby_xml_attr_c.html +1 -1
  51. data/doc/files/ext/libxml/ruby_xml_attributes_c.html +1 -1
  52. data/doc/files/ext/libxml/ruby_xml_document_c.html +1 -1
  53. data/doc/files/ext/libxml/ruby_xml_dtd_c.html +1 -1
  54. data/doc/files/ext/libxml/ruby_xml_html_parser_c.html +1 -1
  55. data/doc/files/ext/libxml/ruby_xml_input_cbg_c.html +1 -1
  56. data/doc/files/ext/libxml/ruby_xml_node_c.html +1 -1
  57. data/doc/files/ext/libxml/ruby_xml_node_set_c.html +1 -1
  58. data/doc/files/ext/libxml/ruby_xml_ns_c.html +1 -1
  59. data/doc/files/ext/libxml/ruby_xml_parser_c.html +1 -1
  60. data/doc/files/ext/libxml/ruby_xml_parser_context_c.html +1 -1
  61. data/doc/files/ext/libxml/ruby_xml_reader_c.html +1 -1
  62. data/doc/files/ext/libxml/ruby_xml_sax_parser_c.html +1 -1
  63. data/doc/files/ext/libxml/ruby_xml_schema_c.html +1 -1
  64. data/doc/files/ext/libxml/ruby_xml_state_c.html +1 -1
  65. data/doc/files/ext/libxml/ruby_xml_xinclude_c.html +1 -1
  66. data/doc/files/ext/libxml/ruby_xml_xpath_c.html +1 -1
  67. data/doc/files/ext/libxml/ruby_xml_xpath_context_c.html +1 -1
  68. data/doc/files/ext/libxml/ruby_xml_xpath_object_c.html +1 -1
  69. data/doc/files/ext/libxml/ruby_xml_xpointer_c.html +1 -1
  70. data/doc/files/ext/libxml/ruby_xml_xpointer_context_c.html +1 -1
  71. data/doc/files/lib/libxml/attr_rb.html +108 -0
  72. data/doc/files/lib/libxml/attributes_rb.html +108 -0
  73. data/doc/files/lib/libxml/document_rb.html +108 -0
  74. data/doc/files/lib/libxml/node_rb.html +108 -0
  75. data/doc/files/lib/libxml/node_set_rb.html +108 -0
  76. data/doc/files/lib/libxml/parser_options_rb.html +107 -0
  77. data/doc/files/{ext/libxml/ruby_xml_tree_c.html → lib/libxml/parser_rb.html} +4 -4
  78. data/doc/files/lib/libxml/properties_rb.html +108 -0
  79. data/doc/files/lib/libxml/tree_rb.html +107 -0
  80. data/doc/files/lib/libxml_rb.html +12 -3
  81. data/doc/fr_class_index.html +34 -32
  82. data/doc/fr_file_index.html +9 -1
  83. data/doc/fr_method_index.html +362 -347
  84. data/ext/libxml/cbg.c +76 -76
  85. data/ext/libxml/libxml.c +4 -3
  86. data/ext/libxml/ruby_libxml.h +1 -1
  87. data/ext/libxml/ruby_xml_attr.c +4 -3
  88. data/ext/libxml/ruby_xml_attr.h +16 -16
  89. data/ext/libxml/ruby_xml_attributes.c +267 -266
  90. data/ext/libxml/ruby_xml_attributes.h +17 -17
  91. data/ext/libxml/ruby_xml_document.c +30 -59
  92. data/ext/libxml/ruby_xml_document.h +27 -27
  93. data/ext/libxml/ruby_xml_dtd.c +2 -1
  94. data/ext/libxml/ruby_xml_dtd.h +17 -17
  95. data/ext/libxml/ruby_xml_html_parser.c +3 -2
  96. data/ext/libxml/ruby_xml_html_parser.h +29 -29
  97. data/ext/libxml/ruby_xml_input_cbg.c +2 -1
  98. data/ext/libxml/ruby_xml_input_cbg.h +20 -20
  99. data/ext/libxml/ruby_xml_node.c +127 -470
  100. data/ext/libxml/ruby_xml_node.h +17 -17
  101. data/ext/libxml/ruby_xml_node_set.c +5 -4
  102. data/ext/libxml/ruby_xml_node_set.h +20 -20
  103. data/ext/libxml/ruby_xml_ns.c +3 -2
  104. data/ext/libxml/ruby_xml_ns.h +12 -12
  105. data/ext/libxml/ruby_xml_parser.c +20 -48
  106. data/ext/libxml/ruby_xml_parser.h +31 -31
  107. data/ext/libxml/ruby_xml_parser_context.c +3 -2
  108. data/ext/libxml/ruby_xml_parser_context.h +20 -20
  109. data/ext/libxml/ruby_xml_reader.c +2 -1
  110. data/ext/libxml/ruby_xml_sax_parser.c +3 -2
  111. data/ext/libxml/ruby_xml_sax_parser.h +56 -56
  112. data/ext/libxml/ruby_xml_schema.c +6 -0
  113. data/ext/libxml/ruby_xml_schema.h +16 -16
  114. data/ext/libxml/ruby_xml_state.c +13 -12
  115. data/ext/libxml/ruby_xml_state.h +1 -1
  116. data/ext/libxml/ruby_xml_xinclude.c +3 -2
  117. data/ext/libxml/ruby_xml_xinclude.h +13 -13
  118. data/ext/libxml/ruby_xml_xpath.c +35 -228
  119. data/ext/libxml/ruby_xml_xpath.h +22 -23
  120. data/ext/libxml/ruby_xml_xpath_context.c +223 -62
  121. data/ext/libxml/ruby_xml_xpath_context.h +15 -20
  122. data/ext/libxml/ruby_xml_xpath_object.c +63 -19
  123. data/ext/libxml/ruby_xml_xpointer.c +19 -15
  124. data/ext/libxml/ruby_xml_xpointer.h +27 -27
  125. data/ext/libxml/ruby_xml_xpointer_context.c +3 -2
  126. data/ext/libxml/ruby_xml_xpointer_context.h +18 -18
  127. data/ext/libxml/version.h +9 -9
  128. data/lib/libxml.rb +16 -128
  129. data/lib/libxml/attr.rb +45 -0
  130. data/lib/libxml/attributes.rb +15 -0
  131. data/lib/libxml/document.rb +54 -0
  132. data/lib/libxml/node.rb +132 -0
  133. data/lib/libxml/node_set.rb +27 -0
  134. data/lib/libxml/parser.rb +42 -0
  135. data/lib/libxml/parser_options.rb +25 -0
  136. data/lib/libxml/properties.rb +19 -0
  137. data/lib/libxml/tree.rb +29 -0
  138. data/lib/libxml_ruby.so +0 -0
  139. data/mingw/libxml_ruby.so +0 -0
  140. data/{work/task/setup → setup.rb} +1585 -1616
  141. data/test/gc.log +0 -0
  142. data/test/model/books.xml +147 -0
  143. data/{work/test/runner.rb → test/model/default_validation_bug.rb} +0 -0
  144. data/test/model/merge_bug_data.xml +58 -0
  145. data/test/model/rubynet.xml +78 -0
  146. data/test/model/rubynet_project +1 -0
  147. data/test/model/saxtest.xml +5 -0
  148. data/test/model/shiporder.xml +23 -0
  149. data/test/model/shiporder.xsd +31 -0
  150. data/test/model/simple.xml +7 -0
  151. data/test/model/soap.xml +27 -0
  152. data/test/model/xinclude.xml +5 -0
  153. data/test/tc_deprecated_require.rb +13 -0
  154. data/test/tc_xml_document.rb +57 -16
  155. data/test/tc_xml_document_write.rb +125 -10
  156. data/test/tc_xml_dtd.rb +22 -1
  157. data/test/tc_xml_node.rb +13 -0
  158. data/test/tc_xml_node_edit.rb +1 -1
  159. data/test/tc_xml_node_xlink.rb +1 -1
  160. data/test/tc_xml_parser.rb +64 -7
  161. data/test/tc_xml_properties.rb +42 -0
  162. data/test/tc_xml_reader.rb +4 -4
  163. data/test/tc_xml_sax_parser.rb +50 -50
  164. data/test/tc_xml_schema.rb +2 -2
  165. data/test/tc_xml_traversal.rb +220 -0
  166. data/test/tc_xml_xinclude.rb +12 -15
  167. data/test/tc_xml_xpath.rb +74 -6
  168. data/test/tc_xml_xpath_context.rb +72 -0
  169. data/test/test_suite.rb +6 -4
  170. data/vc/libxml_ruby.vcproj +1 -9
  171. metadata +92 -65
  172. data/doc/classes/XML/SiblingEnum.html +0 -142
  173. data/doc/classes/XML/Tree.html +0 -224
  174. data/doc/classes/XML/XPath/Object.html +0 -439
  175. data/ext/libxml/ruby_xml_tree.c +0 -43
  176. data/ext/libxml/ruby_xml_tree.h +0 -12
  177. data/test/ets_copy_bug2.rb +0 -21
  178. data/test/tc_xml_document_write2.rb +0 -54
  179. data/test/tc_xml_document_write3.rb +0 -96
  180. data/test/tc_xml_sax_parser2.rb +0 -51
  181. data/work/Rakefile +0 -247
  182. data/work/task/make +0 -26
  183. data/work/task/memory +0 -37
  184. data/work/task/rdoc +0 -39
  185. data/work/task/test +0 -29
  186. data/work/test/ets_runner.rb +0 -33
  187. data/work/test/libxml_test.rb +0 -3
  188. data/work/test/runner_ets.rb +0 -33
@@ -1,17 +1,17 @@
1
- /* $Id: ruby_xml_node.h 348 2008-07-09 18:18:19Z cfis $ */
2
-
3
- /* Please see the LICENSE file for copyright and distribution information */
4
-
5
- #ifndef __RUBY_XML_NODE__
6
- #define __RUBY_XML_NODE__
7
-
8
- extern VALUE cXMLNode;
9
- extern VALUE eXMLNodeSetNamespace;
10
- extern VALUE eXMLNodeFailedModify;
11
- extern VALUE eXMLNodeUnknownType;
12
-
13
- void ruby_init_xml_node(void);
14
- void ruby_xml_node_mark_common(xmlNodePtr xnode);
15
- VALUE ruby_xml_node2_wrap(VALUE class, xmlNodePtr xnode);
16
- VALUE check_string_or_symbol(VALUE val);
17
- #endif
1
+ /* $Id: ruby_xml_node.h 348 2008-07-09 18:18:19Z cfis $ */
2
+
3
+ /* Please see the LICENSE file for copyright and distribution information */
4
+
5
+ #ifndef __RUBY_XML_NODE__
6
+ #define __RUBY_XML_NODE__
7
+
8
+ extern VALUE cXMLNode;
9
+ extern VALUE eXMLNodeSetNamespace;
10
+ extern VALUE eXMLNodeFailedModify;
11
+ extern VALUE eXMLNodeUnknownType;
12
+
13
+ void ruby_init_xml_node(void);
14
+ void ruby_xml_node_mark_common(xmlNodePtr xnode);
15
+ VALUE ruby_xml_node2_wrap(VALUE class, xmlNodePtr xnode);
16
+ VALUE check_string_or_symbol(VALUE val);
17
+ #endif
@@ -1,4 +1,4 @@
1
- /* $Id: ruby_xml_node_set.c 339 2008-07-09 08:36:26Z cfis $ */
1
+ /* $Id: ruby_xml_node_set.c 461 2008-07-15 21:35:56Z cfis $ */
2
2
 
3
3
  /* Please see the LICENSE file for copyright and distribution information */
4
4
 
@@ -6,7 +6,7 @@
6
6
  #include "ruby_xml_node_set.h"
7
7
 
8
8
  /*
9
- * Document-class: XML::Node::Set
9
+ * Document-class: LibXML::XML::Node::Set
10
10
  *
11
11
  * Includes Enumerable.
12
12
  */
@@ -149,14 +149,15 @@ ruby_xml_node_set_xpath_data_get(VALUE self) {
149
149
 
150
150
  // Rdoc needs to know
151
151
  #ifdef RDOC_NEVER_DEFINED
152
- mXML = rb_define_module("XML");
152
+ mLibXML = rb_define_module("LibXML");
153
+ mXML = rb_define_module_under(mLibXML, "XML");
153
154
  cXMLNode = rb_define_class_under(mXML, "Node", rb_cObject);
154
155
  #endif
155
156
 
156
157
  void
157
158
  ruby_init_xml_node_set(void) {
158
159
  cXMLNodeSet = rb_define_class_under(cXMLNode, "Set", rb_cObject);
159
- rb_include_module(cXMLNodeSet, rb_const_get(rb_cObject, rb_intern("Enumerable")));
160
+ rb_include_module(cXMLNodeSet, rb_mEnumerable);
160
161
 
161
162
  rb_define_method(cXMLNodeSet, "each", ruby_xml_node_set_each, 0);
162
163
  rb_define_method(cXMLNodeSet, "empty?", ruby_xml_node_set_empty_q, 0);
@@ -1,20 +1,20 @@
1
- /* $Id: ruby_xml_node_set.h 207 2007-11-14 07:51:46Z danj $ */
2
-
3
- /* Please see the LICENSE file for copyright and distribution information */
4
-
5
- #ifndef __RUBY_XML_NODE_SET__
6
- #define __RUBY_XML_NODE_SET__
7
-
8
- extern VALUE cXMLNodeSet;
9
-
10
- typedef struct ruby_xml_node_set {
11
- VALUE rxpop;
12
- } ruby_xml_node_set;
13
-
14
- void ruby_init_xml_node_set(void);
15
- VALUE ruby_xml_node_set_new(VALUE class, VALUE xpop);
16
- VALUE ruby_xml_node_set_new2(VALUE xpop);
17
- VALUE ruby_xml_node_set_each(VALUE self);
18
- VALUE ruby_xml_node_set_first(VALUE self);
19
-
20
- #endif
1
+ /* $Id: ruby_xml_node_set.h 207 2007-11-14 07:51:46Z danj $ */
2
+
3
+ /* Please see the LICENSE file for copyright and distribution information */
4
+
5
+ #ifndef __RUBY_XML_NODE_SET__
6
+ #define __RUBY_XML_NODE_SET__
7
+
8
+ extern VALUE cXMLNodeSet;
9
+
10
+ typedef struct ruby_xml_node_set {
11
+ VALUE rxpop;
12
+ } ruby_xml_node_set;
13
+
14
+ void ruby_init_xml_node_set(void);
15
+ VALUE ruby_xml_node_set_new(VALUE class, VALUE xpop);
16
+ VALUE ruby_xml_node_set_new2(VALUE xpop);
17
+ VALUE ruby_xml_node_set_each(VALUE self);
18
+ VALUE ruby_xml_node_set_first(VALUE self);
19
+
20
+ #endif
@@ -1,4 +1,4 @@
1
- /* $Id: ruby_xml_ns.c 351 2008-07-09 19:55:21Z cfis $ */
1
+ /* $Id: ruby_xml_ns.c 461 2008-07-15 21:35:56Z cfis $ */
2
2
 
3
3
  /* Please see the LICENSE file for copyright and distribution information */
4
4
 
@@ -127,7 +127,8 @@ ruby_xml_ns_prefix_q(VALUE self) {
127
127
 
128
128
  // Rdoc needs to know
129
129
  #ifdef RDOC_NEVER_DEFINED
130
- mXML = rb_define_module("XML");
130
+ mLibXML = rb_define_module("LibXML");
131
+ mXML = rb_define_module_under(mLibXML, "XML");
131
132
  #endif
132
133
 
133
134
  void
@@ -1,12 +1,12 @@
1
- /* $Id: ruby_xml_ns.h 324 2008-07-08 23:00:02Z cfis $ */
2
-
3
- /* Please see the LICENSE file for copyright and distribution information */
4
-
5
- #ifndef __RUBY_XML_NS__
6
- #define __RUBY_XML_NS__
7
-
8
- extern VALUE cXMLNS;
9
-
10
- void ruby_init_xml_ns(void);
11
- VALUE ruby_xml_ns_wrap(xmlNsPtr ns);
12
- #endif
1
+ /* $Id: ruby_xml_ns.h 324 2008-07-08 23:00:02Z cfis $ */
2
+
3
+ /* Please see the LICENSE file for copyright and distribution information */
4
+
5
+ #ifndef __RUBY_XML_NS__
6
+ #define __RUBY_XML_NS__
7
+
8
+ extern VALUE cXMLNS;
9
+
10
+ void ruby_init_xml_ns(void);
11
+ VALUE ruby_xml_ns_wrap(xmlNsPtr ns);
12
+ #endif
@@ -1,11 +1,10 @@
1
- /* $Id: ruby_xml_parser.c 351 2008-07-09 19:55:21Z cfis $ */
1
+ /* $Id: ruby_xml_parser.c 461 2008-07-15 21:35:56Z cfis $ */
2
2
 
3
3
  /* Please see the LICENSE file for copyright and distribution information */
4
4
 
5
5
  #include <stdarg.h>
6
6
  #include "ruby_libxml.h"
7
7
 
8
- static VALUE libxml_xmlRubyErrorProc = Qnil;
9
8
  static int id_call;
10
9
 
11
10
  VALUE cXMLParser;
@@ -764,6 +763,7 @@ ruby_xml_parser_filename_set(VALUE self, VALUE filename) {
764
763
  ruby_xml_parser *rxp;
765
764
  ruby_xml_parser_context *rxpc;
766
765
  rx_file_data *data;
766
+ int retry_count = 0;
767
767
 
768
768
  Check_Type(filename, T_STRING);
769
769
  Data_Get_Struct(self, ruby_xml_parser, rxp);
@@ -784,9 +784,17 @@ ruby_xml_parser_filename_set(VALUE self, VALUE filename) {
784
784
  data->filename = filename;
785
785
 
786
786
  Data_Get_Struct(rxp->ctxt, ruby_xml_parser_context, rxpc);
787
+ retry:
787
788
  rxpc->ctxt = xmlCreateFileParserCtxt(StringValuePtr(filename));
788
- if (rxpc->ctxt == NULL)
789
- rb_raise(rb_eIOError, StringValuePtr(filename));
789
+ if (rxpc->ctxt == NULL) {
790
+ if ((errno == EMFILE || errno == ENFILE) && retry_count == 0) {
791
+ retry_count++;
792
+ rb_gc();
793
+ goto retry;
794
+ } else {
795
+ rb_raise(rb_eIOError, StringValuePtr(filename));
796
+ }
797
+ }
790
798
 
791
799
  return(data->filename);
792
800
  }
@@ -1224,51 +1232,19 @@ ruby_xml_parser_str_set(VALUE self, VALUE str) {
1224
1232
  return(data->str);
1225
1233
  }
1226
1234
 
1227
- /*
1228
- * call-seq:
1229
- * XML::Parser.register_error_handler(lambda { |msg| ... }) -> old_handler
1230
- * XML::Parser.register_error_handler(nil) -> old_handler
1231
- *
1232
- * Register the attached block as the handler for parser errors.
1233
- * A message describing parse errors is passed to the block.
1234
- * Libxml passes error messages to the handler in parts, one per call.
1235
- * A typical error results in six calls to this proc, with arguments:
1236
- *
1237
- * "Entity: line 1: ",
1238
- * "parser ",
1239
- * "error : ",
1240
- * "Opening and ending tag mismatch: foo line 1 and foz\n",
1241
- * "<foo><bar/></foz>\n",
1242
- * " ^\n"
1243
- *
1244
- * Note that the error handler is shared by all threads.
1245
- */
1246
- VALUE
1247
- ruby_xml_parser_registerErrorHandler(VALUE self, VALUE proc) {
1248
- VALUE old_block = libxml_xmlRubyErrorProc;
1249
- libxml_xmlRubyErrorProc = proc;
1250
- return(old_block);
1251
- }
1252
-
1253
1235
  static void
1254
1236
  libxml_xmlErrorFuncHandler(ATTRIBUTE_UNUSED void *ctx, const char *msg, ...)
1255
1237
  {
1238
+ VALUE message;
1256
1239
  va_list ap;
1257
1240
  char str[1000];
1258
- VALUE rstr;
1259
1241
 
1260
- if (libxml_xmlRubyErrorProc == Qnil) {
1261
- va_start(ap, msg);
1262
- vfprintf(stderr, msg, ap);
1263
- va_end(ap);
1264
- } else {
1265
- va_start(ap, msg);
1266
- if (vsnprintf(str, 999, msg, ap) >= 998) str[999] = 0;
1267
- va_end(ap);
1242
+ va_start(ap, msg);
1243
+ if (vsnprintf(str, 999, msg, ap) >= 998) str[999] = 0;
1244
+ va_end(ap);
1268
1245
 
1269
- rstr = rb_str_new2(str);
1270
- rb_funcall2(libxml_xmlRubyErrorProc, id_call, 1, &rstr);
1271
- }
1246
+ message = rb_str_new2(str);
1247
+ rb_funcall(cXMLParser, rb_intern("xml_error_func_handler"), 1, message);
1272
1248
  }
1273
1249
 
1274
1250
  /* #define RUBY_XML_PARSER_ENABLED_INIT(func, method) \
@@ -1284,7 +1260,8 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNUSED void *ctx, const char *msg, ...)
1284
1260
 
1285
1261
  // Rdoc needs to know
1286
1262
  #ifdef RDOC_NEVER_DEFINED
1287
- mXML = rb_define_module("XML");
1263
+ mLibXML = rb_define_module("LibXML");
1264
+ mXML = rb_define_module_under(mLibXML, "XML");
1288
1265
  #endif
1289
1266
 
1290
1267
  void
@@ -1404,7 +1381,6 @@ ruby_init_parser(void) {
1404
1381
  ruby_xml_parser_memory_used, 0);
1405
1382
  rb_define_singleton_method(cXMLParser, "new", ruby_xml_parser_new, 0);
1406
1383
  rb_define_singleton_method(cXMLParser, "string", ruby_xml_parser_new_string, 1);
1407
- rb_define_singleton_method(cXMLParser, "register_error_handler", ruby_xml_parser_registerErrorHandler, 1);
1408
1384
  rb_define_method(cXMLParser, "filename", ruby_xml_parser_filename_get, 0);
1409
1385
  rb_define_method(cXMLParser, "filename=", ruby_xml_parser_filename_set, 1);
1410
1386
  rb_define_method(cXMLParser, "io", ruby_xml_parser_io_get, 0);
@@ -1418,9 +1394,5 @@ ruby_init_parser(void) {
1418
1394
  xmlSetGenericErrorFunc(NULL, libxml_xmlErrorFuncHandler);
1419
1395
  xmlThrDefSetGenericErrorFunc(NULL, libxml_xmlErrorFuncHandler);
1420
1396
 
1421
- // Ruby needs to know about this even though it's not exported, otherwise
1422
- // our error proc might get garbage collected.
1423
- rb_global_variable(&libxml_xmlRubyErrorProc);
1424
-
1425
1397
  id_call = rb_intern("call");
1426
1398
  }
@@ -1,31 +1,31 @@
1
- /* $Id: ruby_xml_parser.h 39 2006-02-21 20:40:16Z roscopeco $ */
2
-
3
- /* Please see the LICENSE file for copyright and distribution information */
4
-
5
- #ifndef __RUBY_XML_PARSER__
6
- #define __RUBY_XML_PARSER__
7
-
8
- #define MAX_LIBXML_FEATURES_LEN 50
9
-
10
- extern int ruby_xml_parser_count;
11
- extern VALUE cXMLParser;
12
- extern VALUE eXMLParserParseError;
13
-
14
- typedef struct ruby_xml_parser {
15
- VALUE ctxt;
16
- int parsed;
17
- void *data;
18
- int data_type;
19
- } ruby_xml_parser;
20
-
21
- VALUE ruby_xml_parser_default_load_external_dtd_set(VALUE class, VALUE bool);
22
- VALUE ruby_xml_parser_default_substitute_entities_set(VALUE class, VALUE bool);
23
- VALUE ruby_xml_parser_features(VALUE self);
24
- VALUE ruby_xml_parser_filename_get(VALUE self);
25
- VALUE ruby_xml_parser_filename_set(VALUE self, VALUE filename);
26
- VALUE ruby_xml_parser_new(VALUE class);
27
- VALUE ruby_xml_parser_parse(VALUE self);
28
- VALUE ruby_xml_parser_str_get(VALUE self);
29
- VALUE ruby_xml_parser_str_set(VALUE self, VALUE str);
30
-
31
- #endif
1
+ /* $Id: ruby_xml_parser.h 39 2006-02-21 20:40:16Z roscopeco $ */
2
+
3
+ /* Please see the LICENSE file for copyright and distribution information */
4
+
5
+ #ifndef __RUBY_XML_PARSER__
6
+ #define __RUBY_XML_PARSER__
7
+
8
+ #define MAX_LIBXML_FEATURES_LEN 50
9
+
10
+ extern int ruby_xml_parser_count;
11
+ extern VALUE cXMLParser;
12
+ extern VALUE eXMLParserParseError;
13
+
14
+ typedef struct ruby_xml_parser {
15
+ VALUE ctxt;
16
+ int parsed;
17
+ void *data;
18
+ int data_type;
19
+ } ruby_xml_parser;
20
+
21
+ VALUE ruby_xml_parser_default_load_external_dtd_set(VALUE class, VALUE bool);
22
+ VALUE ruby_xml_parser_default_substitute_entities_set(VALUE class, VALUE bool);
23
+ VALUE ruby_xml_parser_features(VALUE self);
24
+ VALUE ruby_xml_parser_filename_get(VALUE self);
25
+ VALUE ruby_xml_parser_filename_set(VALUE self, VALUE filename);
26
+ VALUE ruby_xml_parser_new(VALUE class);
27
+ VALUE ruby_xml_parser_parse(VALUE self);
28
+ VALUE ruby_xml_parser_str_get(VALUE self);
29
+ VALUE ruby_xml_parser_str_set(VALUE self, VALUE str);
30
+
31
+ #endif
@@ -1,4 +1,4 @@
1
- /* $Id: ruby_xml_parser_context.c 344 2008-07-09 16:15:31Z cfis $ */
1
+ /* $Id: ruby_xml_parser_context.c 461 2008-07-15 21:35:56Z cfis $ */
2
2
 
3
3
  /* Please see the LICENSE file for copyright and distribution information */
4
4
 
@@ -650,7 +650,8 @@ ruby_xml_parser_context_well_formed_q(VALUE self) {
650
650
 
651
651
  // Rdoc needs to know
652
652
  #ifdef RDOC_NEVER_DEFINED
653
- mXML = rb_define_module("XML");
653
+ mLibXML = rb_define_module("LibXML");
654
+ mXML = rb_define_module_under(mLibXML, "XML");
654
655
  cXMLParser = rb_define_class_under(mXML, "Parser", rb_cObject);
655
656
  #endif
656
657
 
@@ -1,20 +1,20 @@
1
- /* $Id: ruby_xml_parser_context.h 319 2008-07-08 07:40:27Z cfis $ */
2
-
3
- /* Please see the LICENSE file for copyright and distribution information */
4
-
5
- #ifndef __RUBY_XML_PARSER_CONTEXT__
6
- #define __RUBY_XML_PARSER_CONTEXT__
7
-
8
- extern VALUE cXMLParserContext;
9
-
10
- typedef struct ruby_xml_parser_context {
11
- xmlParserCtxtPtr ctxt;
12
- int is_ptr;
13
- } ruby_xml_parser_context;
14
-
15
- void ruby_xml_parser_context_free(ruby_xml_parser_context *ctxt);
16
- void ruby_init_xml_parser_context(void);
17
- VALUE ruby_xml_parser_context_new();
18
- VALUE ruby_xml_parser_context_each(VALUE self);
19
-
20
- #endif
1
+ /* $Id: ruby_xml_parser_context.h 319 2008-07-08 07:40:27Z cfis $ */
2
+
3
+ /* Please see the LICENSE file for copyright and distribution information */
4
+
5
+ #ifndef __RUBY_XML_PARSER_CONTEXT__
6
+ #define __RUBY_XML_PARSER_CONTEXT__
7
+
8
+ extern VALUE cXMLParserContext;
9
+
10
+ typedef struct ruby_xml_parser_context {
11
+ xmlParserCtxtPtr ctxt;
12
+ int is_ptr;
13
+ } ruby_xml_parser_context;
14
+
15
+ void ruby_xml_parser_context_free(ruby_xml_parser_context *ctxt);
16
+ void ruby_init_xml_parser_context(void);
17
+ VALUE ruby_xml_parser_context_new();
18
+ VALUE ruby_xml_parser_context_each(VALUE self);
19
+
20
+ #endif
@@ -789,7 +789,8 @@ ruby_xml_reader_valid(VALUE self)
789
789
 
790
790
  /* Rdoc needs to know. */
791
791
  #ifdef RDOC_NEVER_DEFINED
792
- mXML = rb_define_module("XML");
792
+ mLibXML = rb_define_module("LibXML");
793
+ mXML = rb_define_module_under(mLibXML, "XML");
793
794
  #endif
794
795
 
795
796
  void
@@ -1,4 +1,4 @@
1
- /* $Id: ruby_xml_sax_parser.c 339 2008-07-09 08:36:26Z cfis $ */
1
+ /* $Id: ruby_xml_sax_parser.c 461 2008-07-15 21:35:56Z cfis $ */
2
2
 
3
3
  /* Please see the LICENSE file for copyright and distribution information */
4
4
 
@@ -406,7 +406,8 @@ ruby_xml_sax_callbacks_on_external_subset(int argc, VALUE *argv, VALUE self) {
406
406
 
407
407
  // Rdoc needs to know
408
408
  #ifdef RDOC_NEVER_DEFINED
409
- mXML = rb_define_module("XML");
409
+ mLibXML = rb_define_module("LibXML");
410
+ mXML = rb_define_module_under(mLibXML, "XML");
410
411
  #endif
411
412
 
412
413
  void
@@ -1,56 +1,56 @@
1
- /* $Id: ruby_xml_sax_parser.h 111 2006-11-20 01:39:14Z roscopeco $ */
2
-
3
- /* Please see the LICENSE file for copyright and distribution information */
4
-
5
- #ifndef __RUBY_XML_SAX_PARSER__
6
- #define __RUBY_XML_SAX_PARSER__
7
-
8
- extern VALUE cXMLSaxParser;
9
- extern VALUE mXMLSaxParserCallbacks;
10
-
11
- /*
12
- typedef struct ruby_xml_sax_parser_callbacks {
13
- VALUE internalSubset;
14
- VALUE isStandalone;
15
- VALUE hasInternalSubset;
16
- VALUE hasExternalSubset;
17
- VALUE resolveEntity;
18
- VALUE getEntity;
19
- VALUE entityDecl;
20
- VALUE notationDecl;
21
- VALUE attributeDecl;
22
- VALUE elementDecl;
23
- VALUE unparsedEntityDecl;
24
- VALUE setDocumentLocator;
25
- VALUE startDocument;
26
- VALUE endDocument;
27
- VALUE startElement;
28
- VALUE endElement;
29
- VALUE reference;
30
- VALUE characters;
31
- VALUE ignorableWhitespace;
32
- VALUE processingInstruction;
33
- VALUE comment;
34
- VALUE xmlParserWarning;
35
- VALUE xmlParserError;
36
- VALUE xmlParserFatalError;
37
- VALUE getParameterEntity;
38
- VALUE cdataBlock;
39
- VALUE externalSubset;
40
- } ruby_xml_sax_parser_callbacks;
41
- */
42
-
43
- typedef struct ruby_xml_sax_parser {
44
- xmlParserCtxtPtr xpc;
45
- xmlSAXHandlerPtr xsh;
46
- //ruby_xml_sax_parser_callbacks *cbp;
47
- VALUE callbackHandler;
48
- VALUE filename;
49
- VALUE str;
50
- } ruby_xml_sax_parser;
51
-
52
- void ruby_xml_sax_parser_free(ruby_xml_sax_parser *rxsp);
53
- void ruby_init_xml_sax_parser(void);
54
- VALUE ruby_xml_sax_parser_new(VALUE class);
55
-
56
- #endif
1
+ /* $Id: ruby_xml_sax_parser.h 111 2006-11-20 01:39:14Z roscopeco $ */
2
+
3
+ /* Please see the LICENSE file for copyright and distribution information */
4
+
5
+ #ifndef __RUBY_XML_SAX_PARSER__
6
+ #define __RUBY_XML_SAX_PARSER__
7
+
8
+ extern VALUE cXMLSaxParser;
9
+ extern VALUE mXMLSaxParserCallbacks;
10
+
11
+ /*
12
+ typedef struct ruby_xml_sax_parser_callbacks {
13
+ VALUE internalSubset;
14
+ VALUE isStandalone;
15
+ VALUE hasInternalSubset;
16
+ VALUE hasExternalSubset;
17
+ VALUE resolveEntity;
18
+ VALUE getEntity;
19
+ VALUE entityDecl;
20
+ VALUE notationDecl;
21
+ VALUE attributeDecl;
22
+ VALUE elementDecl;
23
+ VALUE unparsedEntityDecl;
24
+ VALUE setDocumentLocator;
25
+ VALUE startDocument;
26
+ VALUE endDocument;
27
+ VALUE startElement;
28
+ VALUE endElement;
29
+ VALUE reference;
30
+ VALUE characters;
31
+ VALUE ignorableWhitespace;
32
+ VALUE processingInstruction;
33
+ VALUE comment;
34
+ VALUE xmlParserWarning;
35
+ VALUE xmlParserError;
36
+ VALUE xmlParserFatalError;
37
+ VALUE getParameterEntity;
38
+ VALUE cdataBlock;
39
+ VALUE externalSubset;
40
+ } ruby_xml_sax_parser_callbacks;
41
+ */
42
+
43
+ typedef struct ruby_xml_sax_parser {
44
+ xmlParserCtxtPtr xpc;
45
+ xmlSAXHandlerPtr xsh;
46
+ //ruby_xml_sax_parser_callbacks *cbp;
47
+ VALUE callbackHandler;
48
+ VALUE filename;
49
+ VALUE str;
50
+ } ruby_xml_sax_parser;
51
+
52
+ void ruby_xml_sax_parser_free(ruby_xml_sax_parser *rxsp);
53
+ void ruby_init_xml_sax_parser(void);
54
+ VALUE ruby_xml_sax_parser_new(VALUE class);
55
+
56
+ #endif