libxml-ruby 5.0.6 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/{HISTORY → CHANGELOG.md} +875 -930
  3. data/LICENSE +20 -20
  4. data/README.md +67 -0
  5. data/Rakefile +13 -34
  6. data/ext/libxml/extconf.rb +34 -20
  7. data/ext/libxml/libxml.c +2 -14
  8. data/ext/libxml/ruby_libxml.h +1 -1
  9. data/ext/libxml/ruby_xml_attr.c +27 -22
  10. data/ext/libxml/ruby_xml_attr.h +1 -0
  11. data/ext/libxml/ruby_xml_attr_decl.c +19 -12
  12. data/ext/libxml/ruby_xml_attributes.c +18 -9
  13. data/ext/libxml/ruby_xml_document.c +111 -98
  14. data/ext/libxml/ruby_xml_document.h +1 -0
  15. data/ext/libxml/ruby_xml_dtd.c +49 -19
  16. data/ext/libxml/ruby_xml_dtd.h +1 -0
  17. data/ext/libxml/ruby_xml_html_parser.c +1 -1
  18. data/ext/libxml/ruby_xml_html_parser_context.c +19 -6
  19. data/ext/libxml/ruby_xml_html_parser_context.h +1 -0
  20. data/ext/libxml/ruby_xml_input_cbg.c +45 -17
  21. data/ext/libxml/ruby_xml_io.c +3 -1
  22. data/ext/libxml/ruby_xml_namespace.c +20 -12
  23. data/ext/libxml/ruby_xml_namespace.h +1 -0
  24. data/ext/libxml/ruby_xml_namespaces.c +40 -20
  25. data/ext/libxml/ruby_xml_node.c +71 -32
  26. data/ext/libxml/ruby_xml_node.h +2 -0
  27. data/ext/libxml/ruby_xml_parser.c +1 -1
  28. data/ext/libxml/ruby_xml_parser_context.c +54 -47
  29. data/ext/libxml/ruby_xml_parser_context.h +1 -0
  30. data/ext/libxml/ruby_xml_reader.c +25 -15
  31. data/ext/libxml/ruby_xml_registry.c +31 -0
  32. data/ext/libxml/ruby_xml_registry.h +22 -0
  33. data/ext/libxml/ruby_xml_relaxng.c +21 -5
  34. data/ext/libxml/ruby_xml_relaxng.h +1 -0
  35. data/ext/libxml/ruby_xml_sax_parser.c +1 -1
  36. data/ext/libxml/ruby_xml_schema.c +18 -11
  37. data/ext/libxml/ruby_xml_schema.h +1 -0
  38. data/ext/libxml/ruby_xml_schema_attribute.c +7 -7
  39. data/ext/libxml/ruby_xml_schema_element.c +8 -8
  40. data/ext/libxml/ruby_xml_schema_facet.c +7 -7
  41. data/ext/libxml/ruby_xml_schema_type.c +12 -19
  42. data/ext/libxml/ruby_xml_version.h +4 -4
  43. data/ext/libxml/ruby_xml_writer.c +18 -6
  44. data/ext/libxml/ruby_xml_xpath.c +2 -2
  45. data/ext/libxml/ruby_xml_xpath.h +1 -1
  46. data/ext/libxml/ruby_xml_xpath_context.c +72 -26
  47. data/ext/libxml/ruby_xml_xpath_expression.c +11 -5
  48. data/ext/libxml/ruby_xml_xpath_expression.h +1 -0
  49. data/ext/libxml/ruby_xml_xpath_object.c +69 -54
  50. data/ext/libxml/ruby_xml_xpath_object.h +3 -1
  51. data/ext/vc/libxml_ruby/libxml_ruby.vcxproj +271 -0
  52. data/ext/xcode/libxml-ruby.xcodeproj/project.pbxproj +633 -0
  53. data/ext/xcode/libxml-ruby.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  54. data/ext/xcode/libxml-ruby.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  55. data/ext/xcode/libxml-ruby.xcodeproj/xcshareddata/xcschemes/libxml-ruby.xcscheme +80 -0
  56. data/lib/libxml/document.rb +0 -29
  57. data/lib/libxml/error.rb +30 -3
  58. data/lib/libxml/html_parser.rb +0 -16
  59. data/lib/libxml/node.rb +1 -3
  60. data/lib/libxml/parser.rb +0 -8
  61. data/lib/libxml/schema/attribute.rb +27 -19
  62. data/lib/libxml/schema/element.rb +20 -0
  63. data/lib/libxml/schema/type.rb +44 -21
  64. data/lib/libxml/schema.rb +47 -47
  65. data/lib/libxml-ruby.rb +30 -30
  66. data/libxml-ruby.gemspec +12 -16
  67. data/test/c14n/result/1-1-without-comments/example-1 +3 -3
  68. data/test/c14n/result/1-1-without-comments/example-2 +10 -10
  69. data/test/c14n/result/1-1-without-comments/example-3 +13 -13
  70. data/test/c14n/result/1-1-without-comments/example-4 +8 -8
  71. data/test/c14n/result/1-1-without-comments/example-5 +2 -2
  72. data/test/c14n/result/with-comments/example-1 +5 -5
  73. data/test/c14n/result/with-comments/example-2 +10 -10
  74. data/test/c14n/result/with-comments/example-3 +13 -13
  75. data/test/c14n/result/with-comments/example-4 +8 -8
  76. data/test/c14n/result/with-comments/example-5 +3 -3
  77. data/test/c14n/result/without-comments/example-1 +3 -3
  78. data/test/c14n/result/without-comments/example-2 +10 -10
  79. data/test/c14n/result/without-comments/example-3 +13 -13
  80. data/test/c14n/result/without-comments/example-4 +8 -8
  81. data/test/c14n/result/without-comments/example-5 +2 -2
  82. data/test/test_attr.rb +179 -180
  83. data/test/test_attr_decl.rb +131 -131
  84. data/test/test_attributes.rb +135 -135
  85. data/test/test_canonicalize.rb +122 -120
  86. data/test/test_document.rb +2 -4
  87. data/test/test_dtd.rb +12 -4
  88. data/test/test_encoding_sax.rb +114 -114
  89. data/test/test_error.rb +1 -1
  90. data/test/test_html_parser.rb +6 -2
  91. data/test/test_html_parser_context.rb +22 -22
  92. data/test/test_input_callbacks.rb +36 -0
  93. data/test/test_namespace.rb +1 -1
  94. data/test/test_namespaces.rb +200 -200
  95. data/test/test_node.rb +16 -0
  96. data/test/test_node_cdata.rb +50 -50
  97. data/test/test_node_comment.rb +32 -32
  98. data/test/test_node_copy.rb +40 -40
  99. data/test/test_node_edit.rb +176 -158
  100. data/test/test_node_pi.rb +37 -37
  101. data/test/test_node_text.rb +69 -69
  102. data/test/test_node_xlink.rb +28 -28
  103. data/test/test_parser.rb +5 -41
  104. data/test/test_parser_context.rb +198 -198
  105. data/test/test_properties.rb +38 -38
  106. data/test/test_reader.rb +55 -6
  107. data/test/test_relaxng.rb +59 -53
  108. data/test/test_sax_parser.rb +345 -345
  109. data/test/test_schema.rb +28 -0
  110. data/test/test_traversal.rb +152 -152
  111. data/test/test_writer.rb +0 -31
  112. data/test/test_xinclude.rb +20 -20
  113. data/test/test_xml.rb +3 -7
  114. data/test/test_xpath.rb +244 -244
  115. data/test/test_xpath_context.rb +87 -87
  116. data/test/test_xpath_expression.rb +37 -37
  117. metadata +32 -25
  118. data/README.rdoc +0 -208
  119. data/ext/libxml/extconf.h +0 -4
  120. data/ext/libxml/ruby_xml_cbg.c +0 -85
  121. data/lib/libxml/hpricot.rb +0 -78
  122. data/lib/libxml.rb +0 -5
  123. data/lib/xml/libxml.rb +0 -10
  124. data/lib/xml.rb +0 -14
  125. data/script/benchmark/depixelate +0 -634
  126. data/script/benchmark/hamlet.xml +0 -9055
  127. data/script/benchmark/parsecount +0 -170
  128. data/script/benchmark/sock_entries.xml +0 -507
  129. data/script/benchmark/throughput +0 -41
  130. data/script/test +0 -6
  131. data/test/test_deprecated_require.rb +0 -12
@@ -21,15 +21,21 @@
21
21
 
22
22
  VALUE cXMLXPathExpression;
23
23
 
24
- static void rxml_xpath_expression_free(xmlXPathCompExprPtr expr)
24
+ static void rxml_xpath_expression_free(void *expr)
25
25
  {
26
- xmlXPathFreeCompExpr(expr);
26
+ xmlXPathCompExprPtr compexpr = (xmlXPathCompExprPtr)expr;
27
+ xmlXPathFreeCompExpr(compexpr);
27
28
  }
28
29
 
30
+ const rb_data_type_t rxml_xpath_expression_data_type = {
31
+ .wrap_struct_name = "LibXML::XML::XPath::Expression",
32
+ .function = { .dmark = NULL, .dfree = rxml_xpath_expression_free },
33
+ .flags = RUBY_TYPED_FREE_IMMEDIATELY,
34
+ };
35
+
29
36
  static VALUE rxml_xpath_expression_alloc(VALUE klass)
30
37
  {
31
- return Data_Wrap_Struct(cXMLXPathExpression, NULL,
32
- rxml_xpath_expression_free, NULL);
38
+ return TypedData_Wrap_Struct(cXMLXPathExpression, &rxml_xpath_expression_data_type, NULL);
33
39
  }
34
40
 
35
41
  /* call-seq:
@@ -68,7 +74,7 @@ static VALUE rxml_xpath_expression_initialize(VALUE self, VALUE expression)
68
74
  rxml_raise(xerror);
69
75
  }
70
76
 
71
- DATA_PTR( self) = compexpr;
77
+ RTYPEDDATA_DATA(self) = compexpr;
72
78
  return self;
73
79
  }
74
80
 
@@ -4,6 +4,7 @@
4
4
  #define __RXML_XPATH_EXPRESSION__
5
5
 
6
6
  extern VALUE cXMLXPathExpression;
7
+ extern const rb_data_type_t rxml_xpath_expression_data_type;
7
8
 
8
9
  void rxml_init_xpath_expression(void);
9
10
 
@@ -28,8 +28,9 @@ VALUE cXMLXPathObject;
28
28
  and wraps them in Ruby objects. When the Ruby objects go out of scope
29
29
  then the namespace nodes are freed. */
30
30
 
31
- static void rxml_xpath_object_free(rxml_xpath_object *rxpop)
31
+ static void rxml_xpath_object_free(void *data)
32
32
  {
33
+ rxml_xpath_object *rxpop = (rxml_xpath_object *)data;
33
34
  /* We positively, absolutely cannot let libxml iterate over
34
35
  the nodeTab since if the underlying document has been
35
36
  freed the majority of entries are invalid, resulting in
@@ -44,29 +45,48 @@ static void rxml_xpath_object_free(rxml_xpath_object *rxpop)
44
45
  }
45
46
 
46
47
  /* Custom free function for copied namespace nodes */
47
- static void rxml_xpath_namespace_free(xmlNsPtr xns)
48
+ static void rxml_xpath_namespace_free(void *data)
48
49
  {
50
+ xmlNsPtr xns = (xmlNsPtr)data;
49
51
  xmlFreeNs(xns);
50
52
  }
51
53
 
52
- static void rxml_xpath_object_mark(rxml_xpath_object *rxpop)
54
+ static const rb_data_type_t rxml_namespace_owned_data_type = {
55
+ .wrap_struct_name = "LibXML::XML::Namespace (owned)",
56
+ .function = { .dmark = NULL, .dfree = rxml_xpath_namespace_free },
57
+ .flags = RUBY_TYPED_FREE_IMMEDIATELY,
58
+ };
59
+
60
+ static void rxml_xpath_object_mark(void *data)
53
61
  {
54
- VALUE doc = (VALUE)rxpop->xdoc->_private;
55
- rb_gc_mark(doc);
62
+ rxml_xpath_object *rxpop = (rxml_xpath_object *)data;
63
+ rb_gc_mark(rxpop->document);
56
64
  rb_gc_mark(rxpop->nsnodes);
57
65
  }
58
66
 
59
- VALUE rxml_xpath_object_wrap(xmlDocPtr xdoc, xmlXPathObjectPtr xpop)
67
+ const rb_data_type_t rxml_xpath_object_data_type = {
68
+ .wrap_struct_name = "LibXML::XML::XPath::Object",
69
+ .function = { .dmark = rxml_xpath_object_mark, .dfree = rxml_xpath_object_free },
70
+ .flags = RUBY_TYPED_FREE_IMMEDIATELY,
71
+ };
72
+
73
+ VALUE rxml_xpath_object_wrap(VALUE document, xmlDocPtr xdoc, xmlXPathObjectPtr xpop)
60
74
  {
61
75
  int i;
62
- rxml_xpath_object *rxpop = ALLOC(rxml_xpath_object);
76
+ VALUE result;
77
+ rxml_xpath_object *rxpopp = ALLOC(rxml_xpath_object);
63
78
 
64
79
  /* Make sure Ruby's GC can find the array in the stack */
65
80
  VALUE nsnodes = rb_ary_new();
66
- rxpop->xdoc =xdoc;
67
- rxpop->xpop = xpop;
68
-
69
- /* Find all the extra namespace nodes and wrap them. */
81
+ rxpopp->document = document;
82
+ rxpopp->xdoc = xdoc;
83
+ rxpopp->xpop = xpop;
84
+
85
+ /* Find all the extra namespace nodes and wrap them. In XPath results,
86
+ libxml2 stores the parent element pointer in xns->next (a hack -- see
87
+ xmlXPathNodeSetAddNs in xpath.c). We leave that pointer intact so
88
+ that xmlC14NIsNodeInNodeset can match namespace nodes for C14N.
89
+ Namespace#next is guarded to detect this hack and return nil. */
70
90
  if (xpop->nodesetval && xpop->nodesetval->nodeNr)
71
91
  {
72
92
  for (i = 0; i < xpop->nodesetval->nodeNr; i++)
@@ -75,24 +95,19 @@ VALUE rxml_xpath_object_wrap(xmlDocPtr xdoc, xmlXPathObjectPtr xpop)
75
95
  if (xnode != NULL && xnode->type == XML_NAMESPACE_DECL)
76
96
  {
77
97
  VALUE ns = Qnil;
78
- xmlNsPtr xns = (xmlNsPtr)xnode;
79
-
80
- /* Get rid of libxml's -> next hack. The issue here is
81
- the rxml_namespace code assumes that ns->next refers
82
- to another namespace. */
83
- xns->next = NULL;
84
98
 
85
99
  /* Specify a custom free function here since by default
86
100
  namespace nodes will not be freed */
87
- ns = rxml_namespace_wrap((xmlNsPtr)xnode);
88
- RDATA(ns)->dfree = (RUBY_DATA_FUNC)rxml_xpath_namespace_free;
101
+ ns = TypedData_Wrap_Struct(cXMLNamespace, &rxml_namespace_owned_data_type, (xmlNsPtr)xnode);
89
102
  rb_ary_push(nsnodes, ns);
90
103
  }
91
104
  }
92
105
  }
93
106
 
94
- rxpop->nsnodes = nsnodes;
95
- return Data_Wrap_Struct(cXMLXPathObject, rxml_xpath_object_mark, rxml_xpath_object_free, rxpop);
107
+ rxpopp->nsnodes = nsnodes;
108
+ result = TypedData_Wrap_Struct(cXMLXPathObject, &rxml_xpath_object_data_type, rxpopp);
109
+ RB_GC_GUARD(nsnodes);
110
+ return result;
96
111
  }
97
112
 
98
113
  static VALUE rxml_xpath_object_tabref(xmlXPathObjectPtr xpop, int index)
@@ -125,12 +140,12 @@ static VALUE rxml_xpath_object_tabref(xmlXPathObjectPtr xpop, int index)
125
140
  static VALUE rxml_xpath_object_to_a(VALUE self)
126
141
  {
127
142
  VALUE set_ary, nodeobj;
128
- rxml_xpath_object *rxpop;
143
+ rxml_xpath_object *rxpopp;
129
144
  xmlXPathObjectPtr xpop;
130
145
  int i;
131
146
 
132
- Data_Get_Struct(self, rxml_xpath_object, rxpop);
133
- xpop = rxpop->xpop;
147
+ TypedData_Get_Struct(self, rxml_xpath_object, &rxml_xpath_object_data_type, rxpopp);
148
+ xpop = rxpopp->xpop;
134
149
 
135
150
  set_ary = rb_ary_new();
136
151
 
@@ -154,13 +169,13 @@ static VALUE rxml_xpath_object_to_a(VALUE self)
154
169
  */
155
170
  static VALUE rxml_xpath_object_empty_q(VALUE self)
156
171
  {
157
- rxml_xpath_object *rxpop;
158
- Data_Get_Struct(self, rxml_xpath_object, rxpop);
172
+ rxml_xpath_object *rxpopp;
173
+ TypedData_Get_Struct(self, rxml_xpath_object, &rxml_xpath_object_data_type, rxpopp);
159
174
 
160
- if (rxpop->xpop->type != XPATH_NODESET)
175
+ if (rxpopp->xpop->type != XPATH_NODESET)
161
176
  return Qnil;
162
177
 
163
- return (rxpop->xpop->nodesetval == NULL || rxpop->xpop->nodesetval->nodeNr <= 0) ? Qtrue
178
+ return (rxpopp->xpop->nodesetval == NULL || rxpopp->xpop->nodesetval->nodeNr <= 0) ? Qtrue
164
179
  : Qfalse;
165
180
  }
166
181
 
@@ -172,17 +187,17 @@ static VALUE rxml_xpath_object_empty_q(VALUE self)
172
187
  */
173
188
  static VALUE rxml_xpath_object_each(VALUE self)
174
189
  {
175
- rxml_xpath_object *rxpop;
190
+ rxml_xpath_object *rxpopp;
176
191
  int i;
177
192
 
178
193
  if (rxml_xpath_object_empty_q(self) == Qtrue)
179
194
  return Qnil;
180
195
 
181
- Data_Get_Struct(self, rxml_xpath_object, rxpop);
196
+ TypedData_Get_Struct(self, rxml_xpath_object, &rxml_xpath_object_data_type, rxpopp);
182
197
 
183
- for (i = 0; i < rxpop->xpop->nodesetval->nodeNr; i++)
198
+ for (i = 0; i < rxpopp->xpop->nodesetval->nodeNr; i++)
184
199
  {
185
- rb_yield(rxml_xpath_object_tabref(rxpop->xpop, i));
200
+ rb_yield(rxml_xpath_object_tabref(rxpopp->xpop, i));
186
201
  }
187
202
  return (self);
188
203
  }
@@ -195,13 +210,13 @@ static VALUE rxml_xpath_object_each(VALUE self)
195
210
  */
196
211
  static VALUE rxml_xpath_object_first(VALUE self)
197
212
  {
198
- rxml_xpath_object *rxpop;
213
+ rxml_xpath_object *rxpopp;
199
214
 
200
215
  if (rxml_xpath_object_empty_q(self) == Qtrue)
201
216
  return Qnil;
202
217
 
203
- Data_Get_Struct(self, rxml_xpath_object, rxpop);
204
- return rxml_xpath_object_tabref(rxpop->xpop, 0);
218
+ TypedData_Get_Struct(self, rxml_xpath_object, &rxml_xpath_object_data_type, rxpopp);
219
+ return rxml_xpath_object_tabref(rxpopp->xpop, 0);
205
220
  }
206
221
 
207
222
  /*
@@ -212,13 +227,13 @@ static VALUE rxml_xpath_object_first(VALUE self)
212
227
  */
213
228
  static VALUE rxml_xpath_object_last(VALUE self)
214
229
  {
215
- rxml_xpath_object *rxpop;
230
+ rxml_xpath_object *rxpopp;
216
231
 
217
232
  if (rxml_xpath_object_empty_q(self) == Qtrue)
218
233
  return Qnil;
219
234
 
220
- Data_Get_Struct(self, rxml_xpath_object, rxpop);
221
- return rxml_xpath_object_tabref(rxpop->xpop, -1);
235
+ TypedData_Get_Struct(self, rxml_xpath_object, &rxml_xpath_object_data_type, rxpopp);
236
+ return rxml_xpath_object_tabref(rxpopp->xpop, -1);
222
237
  }
223
238
 
224
239
  /*
@@ -229,13 +244,13 @@ static VALUE rxml_xpath_object_last(VALUE self)
229
244
  */
230
245
  static VALUE rxml_xpath_object_aref(VALUE self, VALUE aref)
231
246
  {
232
- rxml_xpath_object *rxpop;
247
+ rxml_xpath_object *rxpopp;
233
248
 
234
249
  if (rxml_xpath_object_empty_q(self) == Qtrue)
235
250
  return Qnil;
236
251
 
237
- Data_Get_Struct(self, rxml_xpath_object, rxpop);
238
- return rxml_xpath_object_tabref(rxpop->xpop, NUM2INT(aref));
252
+ TypedData_Get_Struct(self, rxml_xpath_object, &rxml_xpath_object_data_type, rxpopp);
253
+ return rxml_xpath_object_tabref(rxpopp->xpop, NUM2INT(aref));
239
254
  }
240
255
 
241
256
  /*
@@ -246,13 +261,13 @@ static VALUE rxml_xpath_object_aref(VALUE self, VALUE aref)
246
261
  */
247
262
  static VALUE rxml_xpath_object_length(VALUE self)
248
263
  {
249
- rxml_xpath_object *rxpop;
264
+ rxml_xpath_object *rxpopp;
250
265
 
251
266
  if (rxml_xpath_object_empty_q(self) == Qtrue)
252
267
  return INT2FIX(0);
253
268
 
254
- Data_Get_Struct(self, rxml_xpath_object, rxpop);
255
- return INT2NUM(rxpop->xpop->nodesetval->nodeNr);
269
+ TypedData_Get_Struct(self, rxml_xpath_object, &rxml_xpath_object_data_type, rxpopp);
270
+ return INT2NUM(rxpopp->xpop->nodesetval->nodeNr);
256
271
  }
257
272
 
258
273
  /*
@@ -276,9 +291,9 @@ static VALUE rxml_xpath_object_length(VALUE self)
276
291
  */
277
292
  static VALUE rxml_xpath_object_get_type(VALUE self)
278
293
  {
279
- rxml_xpath_object *rxpop;
280
- Data_Get_Struct(self, rxml_xpath_object, rxpop);
281
- return INT2FIX(rxpop->xpop->type);
294
+ rxml_xpath_object *rxpopp;
295
+ TypedData_Get_Struct(self, rxml_xpath_object, &rxml_xpath_object_data_type, rxpopp);
296
+ return INT2FIX(rxpopp->xpop->type);
282
297
  }
283
298
 
284
299
  /*
@@ -289,14 +304,14 @@ static VALUE rxml_xpath_object_get_type(VALUE self)
289
304
  */
290
305
  static VALUE rxml_xpath_object_string(VALUE self)
291
306
  {
292
- rxml_xpath_object *rxpop;
307
+ rxml_xpath_object *rxpopp;
293
308
 
294
- Data_Get_Struct(self, rxml_xpath_object, rxpop);
309
+ TypedData_Get_Struct(self, rxml_xpath_object, &rxml_xpath_object_data_type, rxpopp);
295
310
 
296
- if (rxpop->xpop->stringval == NULL)
311
+ if (rxpopp->xpop->stringval == NULL)
297
312
  return Qnil;
298
313
 
299
- return rxml_new_cstr( rxpop->xpop->stringval, rxpop->xdoc->encoding);
314
+ return rxml_new_cstr( rxpopp->xpop->stringval, rxpopp->xdoc->encoding);
300
315
  }
301
316
 
302
317
  /*
@@ -309,9 +324,9 @@ static VALUE rxml_xpath_object_string(VALUE self)
309
324
  static VALUE rxml_xpath_object_debug(VALUE self)
310
325
  {
311
326
  #ifdef LIBXML_DEBUG_ENABLED
312
- rxml_xpath_object *rxpop;
313
- Data_Get_Struct(self, rxml_xpath_object, rxpop);
314
- xmlXPathDebugDumpObject(stdout, rxpop->xpop, 0);
327
+ rxml_xpath_object *rxpopp;
328
+ TypedData_Get_Struct(self, rxml_xpath_object, &rxml_xpath_object_data_type, rxpopp);
329
+ xmlXPathDebugDumpObject(stdout, rxpopp->xpop, 0);
315
330
  return Qtrue;
316
331
  #else
317
332
  rb_warn("libxml was compiled without debugging support.");
@@ -2,9 +2,11 @@
2
2
  #define __RXML_XPATH_OBJECT__
3
3
 
4
4
  extern VALUE cXMLXPathObject;
5
+ extern const rb_data_type_t rxml_xpath_object_data_type;
5
6
 
6
7
  typedef struct rxml_xpath_object
7
8
  {
9
+ VALUE document;
8
10
  xmlDocPtr xdoc;
9
11
  xmlXPathObjectPtr xpop;
10
12
  VALUE nsnodes;
@@ -12,6 +14,6 @@ typedef struct rxml_xpath_object
12
14
 
13
15
 
14
16
  void rxml_init_xpath_object(void);
15
- VALUE rxml_xpath_object_wrap(xmlDocPtr xdoc, xmlXPathObjectPtr xpop);
17
+ VALUE rxml_xpath_object_wrap(VALUE document, xmlDocPtr xdoc, xmlXPathObjectPtr xpop);
16
18
 
17
19
  #endif
@@ -0,0 +1,271 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <ItemGroup Label="ProjectConfigurations">
4
+ <ProjectConfiguration Include="Debug|Win32">
5
+ <Configuration>Debug</Configuration>
6
+ <Platform>Win32</Platform>
7
+ </ProjectConfiguration>
8
+ <ProjectConfiguration Include="Debug|x64">
9
+ <Configuration>Debug</Configuration>
10
+ <Platform>x64</Platform>
11
+ </ProjectConfiguration>
12
+ <ProjectConfiguration Include="Release|Win32">
13
+ <Configuration>Release</Configuration>
14
+ <Platform>Win32</Platform>
15
+ </ProjectConfiguration>
16
+ <ProjectConfiguration Include="Release|x64">
17
+ <Configuration>Release</Configuration>
18
+ <Platform>x64</Platform>
19
+ </ProjectConfiguration>
20
+ </ItemGroup>
21
+ <PropertyGroup Label="Globals">
22
+ <ProjectGuid>{0B65CD1D-EEB9-41AE-93BB-75496E504152}</ProjectGuid>
23
+ <RootNamespace>libxml</RootNamespace>
24
+ <Keyword>Win32Proj</Keyword>
25
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
26
+ </PropertyGroup>
27
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
28
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
29
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
30
+ <CharacterSet>Unicode</CharacterSet>
31
+ <WholeProgramOptimization>true</WholeProgramOptimization>
32
+ <PlatformToolset>v143</PlatformToolset>
33
+ </PropertyGroup>
34
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
35
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
36
+ <CharacterSet>Unicode</CharacterSet>
37
+ <WholeProgramOptimization>true</WholeProgramOptimization>
38
+ <PlatformToolset>v143</PlatformToolset>
39
+ </PropertyGroup>
40
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
41
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
42
+ <CharacterSet>Unicode</CharacterSet>
43
+ <PlatformToolset>v143</PlatformToolset>
44
+ </PropertyGroup>
45
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
46
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
47
+ <CharacterSet>Unicode</CharacterSet>
48
+ <PlatformToolset>v143</PlatformToolset>
49
+ </PropertyGroup>
50
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
51
+ <ImportGroup Label="ExtensionSettings">
52
+ </ImportGroup>
53
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
54
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
55
+ </ImportGroup>
56
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
57
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
58
+ </ImportGroup>
59
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
60
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
61
+ </ImportGroup>
62
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
63
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
64
+ </ImportGroup>
65
+ <PropertyGroup Label="UserMacros" />
66
+ <PropertyGroup>
67
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
68
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\lib\1.8</OutDir>
69
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
70
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
71
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
72
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
73
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
74
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
75
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
76
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.so</TargetExt>
77
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.so</TargetExt>
78
+ </PropertyGroup>
79
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
80
+ <OutDir>..\..\..\lib\4.0\</OutDir>
81
+ </PropertyGroup>
82
+ <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
83
+ <VcpkgInstalledDir>C:\Source\vcpkg</VcpkgInstalledDir>
84
+ <VcpkgHostTriplet>x64-windows</VcpkgHostTriplet>
85
+ <VcpkgConfiguration>Debug</VcpkgConfiguration>
86
+ </PropertyGroup>
87
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
88
+ <ClCompile>
89
+ <Optimization>Disabled</Optimization>
90
+ <AdditionalIncludeDirectories>C:\msys64\local\ruby240vc\include\ruby-2.4.0;C:\msys64\local\ruby240vc\include\ruby-2.4.0\x64-mswin64_140;C:\msys64\mingw64\include\libxml2;C:\msys64\mingw64\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
91
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBXML_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
92
+ <MinimalRebuild>true</MinimalRebuild>
93
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
94
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
95
+ <PrecompiledHeader>
96
+ </PrecompiledHeader>
97
+ <WarningLevel>Level3</WarningLevel>
98
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
99
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
100
+ <ShowIncludes>false</ShowIncludes>
101
+ <UndefinePreprocessorDefinitions>
102
+ </UndefinePreprocessorDefinitions>
103
+ </ClCompile>
104
+ <Link>
105
+ <AdditionalDependencies>msvcr100-ruby18.lib;libxml2.lib;%(AdditionalDependencies)</AdditionalDependencies>
106
+ <OutputFile>$(OutDir)\$(TargetName)$(TargetExt)</OutputFile>
107
+ <AdditionalLibraryDirectories>C:\msys64\local\ruby\lib;C:\msys64\mingw64\include\libxml2;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
108
+ <GenerateDebugInformation>true</GenerateDebugInformation>
109
+ <SubSystem>Windows</SubSystem>
110
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
111
+ <DataExecutionPrevention>
112
+ </DataExecutionPrevention>
113
+ <TargetMachine>MachineX86</TargetMachine>
114
+ <ModuleDefinitionFile>..\..\libxml\libxml_ruby.def</ModuleDefinitionFile>
115
+ </Link>
116
+ </ItemDefinitionGroup>
117
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
118
+ <ClCompile>
119
+ <Optimization>Disabled</Optimization>
120
+ <AdditionalIncludeDirectories>C:\msys64\usr\local\ruby-4.0.1-mswin\include\ruby-4.0.0;C:\msys64\usr\local\ruby-4.0.1-mswin\include\ruby-4.0.0\x64-mswin64_140;C:\Source\vcpkg\installed\x64-windows\include;C:\Source\vcpkg\installed\x64-windows\include\libxml2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
121
+ <PreprocessorDefinitions>WIN64;_DEBUG;_WINDOWS;_USRDLL;LIBXML_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
122
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
123
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
124
+ <PrecompiledHeader>
125
+ </PrecompiledHeader>
126
+ <WarningLevel>Level4</WarningLevel>
127
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
128
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
129
+ <ShowIncludes>false</ShowIncludes>
130
+ <UndefinePreprocessorDefinitions>LIBXML_ICONV_ENABLED;%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
131
+ </ClCompile>
132
+ <Link>
133
+ <AdditionalDependencies>x64-vcruntime140-ruby400.lib;libxml2.lib;%(AdditionalDependencies)</AdditionalDependencies>
134
+ <OutputFile>$(OutDir)\$(TargetName)$(TargetExt)</OutputFile>
135
+ <AdditionalLibraryDirectories>C:\msys64\usr\local\ruby-4.0.1-mswin\lib;C:\Source\vcpkg\installed\x64-windows\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
136
+ <GenerateDebugInformation>true</GenerateDebugInformation>
137
+ <SubSystem>Console</SubSystem>
138
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
139
+ <DataExecutionPrevention>
140
+ </DataExecutionPrevention>
141
+ <ModuleDefinitionFile>..\..\libxml\libxml_ruby.def</ModuleDefinitionFile>
142
+ </Link>
143
+ </ItemDefinitionGroup>
144
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
145
+ <ClCompile>
146
+ <AdditionalIncludeDirectories>C:\Development\ruby\lib\ruby\1.8\i386-mswin32;C:\Development\msys\local\include;C:\Development\msys\local\include\libxml2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
147
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBXML_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
148
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
149
+ <PrecompiledHeader>
150
+ </PrecompiledHeader>
151
+ <WarningLevel>Level3</WarningLevel>
152
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
153
+ </ClCompile>
154
+ <Link>
155
+ <AdditionalDependencies>msvcrt-ruby18.lib;libxml2.lib;%(AdditionalDependencies)</AdditionalDependencies>
156
+ <OutputFile>C:\Development\ruby\lib\ruby\gems\1.8\gems\libxml-ruby-1.1.2-x86-mswin32-60\lib\$(ProjectName).so</OutputFile>
157
+ <AdditionalLibraryDirectories>C:\Development\ruby\lib;C:\Development\msys\local\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
158
+ <GenerateDebugInformation>true</GenerateDebugInformation>
159
+ <SubSystem>Windows</SubSystem>
160
+ <OptimizeReferences>true</OptimizeReferences>
161
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
162
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
163
+ <DataExecutionPrevention>
164
+ </DataExecutionPrevention>
165
+ <TargetMachine>MachineX86</TargetMachine>
166
+ </Link>
167
+ </ItemDefinitionGroup>
168
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
169
+ <ClCompile>
170
+ <AdditionalIncludeDirectories>C:\Development\ruby\lib\ruby\1.8\i386-mswin32;C:\Development\msys\local\include;C:\Development\msys\local\include\libxml2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
171
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBXML_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
172
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
173
+ <PrecompiledHeader>
174
+ </PrecompiledHeader>
175
+ <WarningLevel>Level3</WarningLevel>
176
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
177
+ </ClCompile>
178
+ <Link>
179
+ <AdditionalDependencies>msvcrt-ruby18.lib;libxml2.lib;%(AdditionalDependencies)</AdditionalDependencies>
180
+ <OutputFile>C:\Development\ruby\lib\ruby\gems\1.8\gems\libxml-ruby-1.1.2-x86-mswin32-60\lib\$(ProjectName).so</OutputFile>
181
+ <AdditionalLibraryDirectories>C:\Development\ruby\lib;C:\Development\msys\local\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
182
+ <GenerateDebugInformation>true</GenerateDebugInformation>
183
+ <SubSystem>Windows</SubSystem>
184
+ <OptimizeReferences>true</OptimizeReferences>
185
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
186
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
187
+ <DataExecutionPrevention>
188
+ </DataExecutionPrevention>
189
+ </Link>
190
+ </ItemDefinitionGroup>
191
+ <ItemGroup>
192
+ <ClCompile Include="..\..\libxml\libxml.c" />
193
+ <ClCompile Include="..\..\libxml\ruby_xml.c" />
194
+ <ClCompile Include="..\..\libxml\ruby_xml_attr.c" />
195
+ <ClCompile Include="..\..\libxml\ruby_xml_attr_decl.c" />
196
+ <ClCompile Include="..\..\libxml\ruby_xml_attributes.c" />
197
+ <ClCompile Include="..\..\libxml\ruby_xml_document.c" />
198
+ <ClCompile Include="..\..\libxml\ruby_xml_dtd.c" />
199
+ <ClCompile Include="..\..\libxml\ruby_xml_encoding.c" />
200
+ <ClCompile Include="..\..\libxml\ruby_xml_error.c" />
201
+ <ClCompile Include="..\..\libxml\ruby_xml_html_parser.c" />
202
+ <ClCompile Include="..\..\libxml\ruby_xml_html_parser_context.c" />
203
+ <ClCompile Include="..\..\libxml\ruby_xml_html_parser_options.c" />
204
+ <ClCompile Include="..\..\libxml\ruby_xml_input_cbg.c" />
205
+ <ClCompile Include="..\..\libxml\ruby_xml_io.c" />
206
+ <ClCompile Include="..\..\libxml\ruby_xml_namespace.c" />
207
+ <ClCompile Include="..\..\libxml\ruby_xml_namespaces.c" />
208
+ <ClCompile Include="..\..\libxml\ruby_xml_node.c" />
209
+ <ClCompile Include="..\..\libxml\ruby_xml_parser.c" />
210
+ <ClCompile Include="..\..\libxml\ruby_xml_parser_context.c" />
211
+ <ClCompile Include="..\..\libxml\ruby_xml_parser_options.c" />
212
+ <ClCompile Include="..\..\libxml\ruby_xml_reader.c" />
213
+ <ClCompile Include="..\..\libxml\ruby_xml_registry.c" />
214
+ <ClCompile Include="..\..\libxml\ruby_xml_relaxng.c" />
215
+ <ClCompile Include="..\..\libxml\ruby_xml_sax2_handler.c" />
216
+ <ClCompile Include="..\..\libxml\ruby_xml_sax_parser.c" />
217
+ <ClCompile Include="..\..\libxml\ruby_xml_schema.c" />
218
+ <ClCompile Include="..\..\libxml\ruby_xml_schema_attribute.c" />
219
+ <ClCompile Include="..\..\libxml\ruby_xml_schema_element.c" />
220
+ <ClCompile Include="..\..\libxml\ruby_xml_schema_facet.c" />
221
+ <ClCompile Include="..\..\libxml\ruby_xml_schema_type.c" />
222
+ <ClCompile Include="..\..\libxml\ruby_xml_writer.c" />
223
+ <ClCompile Include="..\..\libxml\ruby_xml_xinclude.c" />
224
+ <ClCompile Include="..\..\libxml\ruby_xml_xpath.c" />
225
+ <ClCompile Include="..\..\libxml\ruby_xml_xpath_context.c" />
226
+ <ClCompile Include="..\..\libxml\ruby_xml_xpath_expression.c" />
227
+ <ClCompile Include="..\..\libxml\ruby_xml_xpath_object.c" />
228
+ </ItemGroup>
229
+ <ItemGroup>
230
+ <ClInclude Include="..\..\libxml\ruby_libxml.h" />
231
+ <ClInclude Include="..\..\libxml\ruby_xml.h" />
232
+ <ClInclude Include="..\..\libxml\ruby_xml_attr.h" />
233
+ <ClInclude Include="..\..\libxml\ruby_xml_attr_decl.h" />
234
+ <ClInclude Include="..\..\libxml\ruby_xml_attributes.h" />
235
+ <ClInclude Include="..\..\libxml\ruby_xml_document.h" />
236
+ <ClInclude Include="..\..\libxml\ruby_xml_dtd.h" />
237
+ <ClInclude Include="..\..\libxml\ruby_xml_encoding.h" />
238
+ <ClInclude Include="..\..\libxml\ruby_xml_error.h" />
239
+ <ClInclude Include="..\..\libxml\ruby_xml_html_parser.h" />
240
+ <ClInclude Include="..\..\libxml\ruby_xml_html_parser_context.h" />
241
+ <ClInclude Include="..\..\libxml\ruby_xml_html_parser_options.h" />
242
+ <ClInclude Include="..\..\libxml\ruby_xml_input_cbg.h" />
243
+ <ClInclude Include="..\..\libxml\ruby_xml_io.h" />
244
+ <ClInclude Include="..\..\libxml\ruby_xml_namespace.h" />
245
+ <ClInclude Include="..\..\libxml\ruby_xml_namespaces.h" />
246
+ <ClInclude Include="..\..\libxml\ruby_xml_node.h" />
247
+ <ClInclude Include="..\..\libxml\ruby_xml_parser.h" />
248
+ <ClInclude Include="..\..\libxml\ruby_xml_parser_context.h" />
249
+ <ClInclude Include="..\..\libxml\ruby_xml_parser_options.h" />
250
+ <ClInclude Include="..\..\libxml\ruby_xml_reader.h" />
251
+ <ClInclude Include="..\..\libxml\ruby_xml_registry.h" />
252
+ <ClInclude Include="..\..\libxml\ruby_xml_relaxng.h" />
253
+ <ClInclude Include="..\..\libxml\ruby_xml_sax2_handler.h" />
254
+ <ClInclude Include="..\..\libxml\ruby_xml_sax_parser.h" />
255
+ <ClInclude Include="..\..\libxml\ruby_xml_schema.h" />
256
+ <ClInclude Include="..\..\libxml\ruby_xml_schema_attribute.h" />
257
+ <ClInclude Include="..\..\libxml\ruby_xml_schema_element.h" />
258
+ <ClInclude Include="..\..\libxml\ruby_xml_schema_facet.h" />
259
+ <ClInclude Include="..\..\libxml\ruby_xml_schema_type.h" />
260
+ <ClInclude Include="..\..\libxml\ruby_xml_version.h" />
261
+ <ClInclude Include="..\..\libxml\ruby_xml_writer.h" />
262
+ <ClInclude Include="..\..\libxml\ruby_xml_xinclude.h" />
263
+ <ClInclude Include="..\..\libxml\ruby_xml_xpath.h" />
264
+ <ClInclude Include="..\..\libxml\ruby_xml_xpath_context.h" />
265
+ <ClInclude Include="..\..\libxml\ruby_xml_xpath_expression.h" />
266
+ <ClInclude Include="..\..\libxml\ruby_xml_xpath_object.h" />
267
+ </ItemGroup>
268
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
269
+ <ImportGroup Label="ExtensionTargets">
270
+ </ImportGroup>
271
+ </Project>