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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. data/CHANGES +42 -0
  2. data/README +123 -117
  3. data/doc/classes/XML.html +226 -0
  4. data/doc/classes/XML/Attr.html +969 -0
  5. data/doc/classes/XML/Attributes.html +487 -0
  6. data/doc/classes/XML/Document.html +1423 -0
  7. data/doc/classes/XML/Dtd.html +159 -0
  8. data/doc/classes/XML/Error.html +111 -0
  9. data/doc/classes/XML/HTMLParser.html +330 -0
  10. data/doc/classes/XML/InputCallbacks.html +154 -0
  11. data/doc/classes/XML/NS.html +366 -0
  12. data/doc/classes/XML/Node.html +3292 -0
  13. data/doc/classes/XML/Node/FailedModify.html +111 -0
  14. data/doc/classes/XML/Node/Set.html +435 -0
  15. data/doc/classes/XML/Node/SetNamespace.html +111 -0
  16. data/doc/classes/XML/Node/UnknownType.html +111 -0
  17. data/doc/classes/XML/Parser.html +2178 -0
  18. data/doc/classes/XML/Parser/Context.html +1233 -0
  19. data/doc/classes/XML/Parser/ParseError.html +111 -0
  20. data/doc/classes/XML/Reader.html +2173 -0
  21. data/doc/classes/XML/SaxParser.html +396 -0
  22. data/doc/classes/XML/SiblingEnum.html +142 -0
  23. data/doc/classes/XML/State.html +118 -0
  24. data/doc/classes/XML/Tree.html +224 -0
  25. data/doc/classes/XML/XInclude.html +117 -0
  26. data/doc/classes/XML/XInclude/Error.html +111 -0
  27. data/doc/classes/XML/XMLParserOptions.html +198 -0
  28. data/doc/classes/XML/XPath.html +269 -0
  29. data/doc/classes/XML/XPath/Context.html +193 -0
  30. data/doc/classes/XML/XPath/InvalidPath.html +111 -0
  31. data/doc/classes/XML/XPath/Object.html +439 -0
  32. data/doc/classes/XML/XPointer.html +164 -0
  33. data/doc/classes/XML/XPointer/Context.html +117 -0
  34. data/doc/classes/XML/XPointer/Context/InvalidPath.html +111 -0
  35. data/doc/classes/XML/XPointer/InvalidExpression.html +111 -0
  36. data/doc/classes/singleton.html +114 -0
  37. data/doc/created.rid +1 -0
  38. data/doc/files/CHANGES.html +375 -0
  39. data/doc/files/LICENSE.html +133 -0
  40. data/doc/files/README.html +279 -0
  41. data/doc/files/VERSION.html +107 -0
  42. data/doc/files/ext/libxml/cbg_c.html +101 -0
  43. data/doc/files/ext/libxml/libxml_c.html +101 -0
  44. data/doc/files/ext/libxml/ruby_xml_attr_c.html +101 -0
  45. data/doc/files/ext/libxml/ruby_xml_attributes_c.html +101 -0
  46. data/doc/files/ext/libxml/ruby_xml_document_c.html +101 -0
  47. data/doc/files/ext/libxml/ruby_xml_dtd_c.html +101 -0
  48. data/doc/files/ext/libxml/ruby_xml_html_parser_c.html +101 -0
  49. data/doc/files/ext/libxml/ruby_xml_input_cbg_c.html +101 -0
  50. data/doc/files/ext/libxml/ruby_xml_node_c.html +101 -0
  51. data/doc/files/ext/libxml/ruby_xml_node_set_c.html +101 -0
  52. data/doc/files/ext/libxml/ruby_xml_ns_c.html +101 -0
  53. data/doc/files/ext/libxml/ruby_xml_parser_c.html +101 -0
  54. data/doc/files/ext/libxml/ruby_xml_parser_context_c.html +101 -0
  55. data/doc/files/ext/libxml/ruby_xml_reader_c.html +101 -0
  56. data/doc/files/ext/libxml/ruby_xml_sax_parser_c.html +101 -0
  57. data/doc/files/ext/libxml/ruby_xml_schema_c.html +101 -0
  58. data/doc/files/ext/libxml/ruby_xml_state_c.html +101 -0
  59. data/doc/files/ext/libxml/ruby_xml_tree_c.html +101 -0
  60. data/doc/files/ext/libxml/ruby_xml_xinclude_c.html +101 -0
  61. data/doc/files/ext/libxml/ruby_xml_xpath_c.html +101 -0
  62. data/doc/files/ext/libxml/ruby_xml_xpath_context_c.html +101 -0
  63. data/doc/files/ext/libxml/ruby_xml_xpath_object_c.html +101 -0
  64. data/doc/files/ext/libxml/ruby_xml_xpointer_c.html +101 -0
  65. data/doc/files/ext/libxml/ruby_xml_xpointer_context_c.html +101 -0
  66. data/doc/files/lib/libxml_rb.html +115 -0
  67. data/doc/files/lib/xml/libxml_rb.html +114 -0
  68. data/doc/fr_class_index.html +60 -0
  69. data/doc/fr_file_index.html +56 -0
  70. data/doc/fr_method_index.html +373 -0
  71. data/doc/index.html +24 -0
  72. data/doc/rdoc-style.css +208 -0
  73. data/ext/libxml/cbg.c +76 -76
  74. data/ext/libxml/extconf.rb +308 -308
  75. data/ext/libxml/libxml.c +58 -62
  76. data/ext/libxml/ruby_libxml.h +1 -0
  77. data/ext/libxml/ruby_xml_attr.c +201 -113
  78. data/ext/libxml/ruby_xml_attr.h +6 -9
  79. data/ext/libxml/ruby_xml_attributes.c +268 -0
  80. data/ext/libxml/ruby_xml_attributes.h +17 -0
  81. data/ext/libxml/ruby_xml_document.c +80 -66
  82. data/ext/libxml/ruby_xml_dtd.c +2 -2
  83. data/ext/libxml/ruby_xml_dtd.h +17 -17
  84. data/ext/libxml/ruby_xml_html_parser.c +18 -19
  85. data/ext/libxml/ruby_xml_html_parser.h +29 -29
  86. data/ext/libxml/ruby_xml_input_cbg.c +6 -0
  87. data/ext/libxml/ruby_xml_input_cbg.h +20 -20
  88. data/ext/libxml/ruby_xml_node.c +438 -536
  89. data/ext/libxml/ruby_xml_node.h +17 -27
  90. data/ext/libxml/ruby_xml_node_set.c +10 -9
  91. data/ext/libxml/ruby_xml_node_set.h +20 -20
  92. data/ext/libxml/ruby_xml_ns.c +60 -69
  93. data/ext/libxml/ruby_xml_ns.h +12 -21
  94. data/ext/libxml/ruby_xml_parser.c +54 -53
  95. data/ext/libxml/ruby_xml_parser.h +31 -31
  96. data/ext/libxml/ruby_xml_parser_context.c +37 -91
  97. data/ext/libxml/ruby_xml_parser_context.h +20 -22
  98. data/ext/libxml/ruby_xml_reader.h +14 -14
  99. data/ext/libxml/ruby_xml_sax_parser.c +55 -55
  100. data/ext/libxml/ruby_xml_sax_parser.h +56 -56
  101. data/ext/libxml/ruby_xml_schema.c +44 -51
  102. data/ext/libxml/ruby_xml_schema.h +16 -16
  103. data/ext/libxml/ruby_xml_state.c +35 -96
  104. data/ext/libxml/ruby_xml_state.h +2 -3
  105. data/ext/libxml/ruby_xml_tree.h +12 -12
  106. data/ext/libxml/ruby_xml_xinclude.h +13 -13
  107. data/ext/libxml/ruby_xml_xpath.c +57 -18
  108. data/ext/libxml/ruby_xml_xpath.h +23 -23
  109. data/ext/libxml/ruby_xml_xpath_context.c +11 -7
  110. data/ext/libxml/ruby_xml_xpath_context.h +20 -20
  111. data/ext/libxml/ruby_xml_xpath_object.c +9 -16
  112. data/ext/libxml/ruby_xml_xpath_object.h +4 -10
  113. data/ext/libxml/ruby_xml_xpointer.c +11 -11
  114. data/ext/libxml/ruby_xml_xpointer.h +27 -27
  115. data/ext/libxml/ruby_xml_xpointer_context.h +18 -18
  116. data/ext/libxml/version.h +2 -2
  117. data/lib/libxml.rb +134 -125
  118. data/lib/libxml_ruby.so +0 -0
  119. data/mingw/libiconv-2.dll +0 -0
  120. data/mingw/libxml2-2.dll +0 -0
  121. data/mingw/libxml_ruby.so +0 -0
  122. data/test/ets_copy_bug.rb +1 -1
  123. data/test/ets_copy_bug2.rb +16 -27
  124. data/test/ets_doc_to_s.rb +1 -1
  125. data/test/ets_gpx.rb +1 -1
  126. data/test/ets_node_gc.rb +1 -1
  127. data/test/ets_tsr.rb +1 -1
  128. data/test/tc_well_formed.rb +1 -1
  129. data/test/tc_xml_attributes.rb +106 -0
  130. data/test/tc_xml_document.rb +10 -10
  131. data/test/tc_xml_document_write3.rb +1 -1
  132. data/test/tc_xml_dtd.rb +49 -0
  133. data/test/tc_xml_html_parser.rb +3 -3
  134. data/test/tc_xml_node.rb +69 -33
  135. data/test/tc_xml_node_attr.rb +170 -0
  136. data/test/{tc_xml_node8.rb → tc_xml_node_cdata.rb} +2 -2
  137. data/test/{tc_xml_node9.rb → tc_xml_node_comment.rb} +3 -3
  138. data/test/tc_xml_node_edit.rb +91 -0
  139. data/test/tc_xml_parser.rb +97 -50
  140. data/test/tc_xml_parser_context.rb +61 -23
  141. data/test/tc_xml_schema.rb +39 -0
  142. data/test/tc_xml_xinclude.rb +5 -6
  143. data/test/tc_xml_xpath.rb +51 -27
  144. data/test/test_suite.rb +27 -0
  145. data/vc/{libxml.sln → libxml_ruby.sln} +5 -5
  146. data/vc/{libxml.vcproj → libxml_ruby.vcproj} +9 -1
  147. metadata +106 -54
  148. data/mingw/mingw.rake +0 -36
  149. data/test/dtd-test.rb +0 -24
  150. data/test/merge_bug.rb +0 -55
  151. data/test/schema-test.rb +0 -74
  152. data/test/tc_xml_node2.rb +0 -25
  153. data/test/tc_xml_node3.rb +0 -27
  154. data/test/tc_xml_node4.rb +0 -86
  155. data/test/tc_xml_node5.rb +0 -52
  156. data/test/tc_xml_node6.rb +0 -27
  157. data/test/tc_xml_node7.rb +0 -35
  158. data/test/tc_xml_parser2.rb +0 -16
  159. data/test/tc_xml_parser3.rb +0 -23
  160. data/test/tc_xml_parser4.rb +0 -33
  161. data/test/tc_xml_parser5.rb +0 -27
  162. data/test/tc_xml_parser6.rb +0 -23
  163. data/test/tc_xml_parser7.rb +0 -28
  164. data/test/tc_xml_parser8.rb +0 -32
  165. data/test/tc_xml_parser9.rb +0 -11
  166. data/test/tc_xml_xpath2.rb +0 -14
  167. data/work/vc/debug/libxml.exp +0 -0
  168. data/work/vc/debug/libxml.ilk +0 -0
  169. data/work/vc/debug/libxml.lib +0 -0
  170. data/work/vc/debug/libxml.pdb +0 -0
  171. data/work/vc/debug/libxml.so +0 -0
@@ -1,20 +1,20 @@
1
- /* $Id: ruby_xml_xpath_context.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_XPATH_CONTEXT__
6
- #define __RUBY_XML_XPATH_CONTEXT__
7
-
8
- extern VALUE cXMLXPathContext;
9
-
10
- typedef struct ruby_xml_xpath_context {
11
- VALUE xd;
12
- xmlXPathContextPtr ctxt;
13
- } ruby_xml_xpath_context;
14
-
15
- VALUE ruby_xml_xpath_context_wrap(xmlXPathContextPtr ctxt);
16
- VALUE ruby_xml_xpath_context_new(VALUE anode);
17
- VALUE ruby_xml_xpath_context_register_namespace(VALUE self, VALUE prefix, VALUE uri);
18
- void ruby_init_xml_xpath_context(void);
19
-
20
- #endif
1
+ /* $Id: ruby_xml_xpath_context.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_XPATH_CONTEXT__
6
+ #define __RUBY_XML_XPATH_CONTEXT__
7
+
8
+ extern VALUE cXMLXPathContext;
9
+
10
+ typedef struct ruby_xml_xpath_context {
11
+ VALUE xd;
12
+ xmlXPathContextPtr ctxt;
13
+ } ruby_xml_xpath_context;
14
+
15
+ VALUE ruby_xml_xpath_context_wrap(xmlXPathContextPtr ctxt);
16
+ VALUE ruby_xml_xpath_context_new(VALUE anode);
17
+ VALUE ruby_xml_xpath_context_register_namespace(VALUE self, VALUE prefix, VALUE uri);
18
+ void ruby_init_xml_xpath_context(void);
19
+
20
+ #endif
@@ -24,8 +24,7 @@ ruby_xml_xpath_object_tabref(xmlXPathObjectPtr xpop, int apos) {
24
24
 
25
25
  switch(xpop->nodesetval->nodeTab[apos]->type) {
26
26
  case XML_ATTRIBUTE_NODE:
27
- return ruby_xml_attr_wrap(cXMLAttr,
28
- (xmlAttrPtr)xpop->nodesetval->nodeTab[apos]);
27
+ return Qnil;//ruby_xml_attr_wrap((xmlAttrPtr)xpop->nodesetval->nodeTab[apos]);
29
28
  break;
30
29
  default:
31
30
  return ruby_xml_node2_wrap(cXMLNode,
@@ -69,12 +68,6 @@ ruby_xml_xpath_object_wrap(xmlXPathObjectPtr xpop)
69
68
  ruby_xml_xpath_object_free,
70
69
  xpop);
71
70
 
72
- if (xpop->type == XPATH_NODESET && !((xpop->nodesetval == NULL) || (xpop->nodesetval->nodeNr == 0))) {
73
- int i;
74
- for (i = 0; i < xpop->nodesetval->nodeNr; i++) {
75
- ruby_xml_xpath_object_tabref(xpop, i);
76
- }
77
- }
78
71
  break;
79
72
  case XPATH_BOOLEAN:
80
73
  if (xpop->boolval != 0)
@@ -104,7 +97,7 @@ ruby_xml_xpath_object_wrap(xmlXPathObjectPtr xpop)
104
97
 
105
98
  /*
106
99
  * call-seq:
107
- * xpath_object.to_a => [node, ..., node]
100
+ * xpath_object.to_a -> [node, ..., node]
108
101
  *
109
102
  * Obtain an array of the nodes in this set.
110
103
  */
@@ -130,7 +123,7 @@ ruby_xml_xpath_object_to_a(VALUE self)
130
123
 
131
124
  /*
132
125
  * call-seq:
133
- * xpath_object.set => Node::Set
126
+ * xpath_object.set -> Node::Set
134
127
  *
135
128
  * Obtain the previous type object which is really
136
129
  * just a proxy back to this object. Unless the
@@ -153,7 +146,7 @@ ruby_xml_xpath_object_set(VALUE self)
153
146
 
154
147
  /*
155
148
  * call-seq:
156
- * xpath_object.empty? => (true|false)
149
+ * xpath_object.empty? -> (true|false)
157
150
  *
158
151
  * Determine whether this nodeset is empty (contains no nodes).
159
152
  */
@@ -171,7 +164,7 @@ ruby_xml_xpath_object_empty_q(VALUE self) {
171
164
 
172
165
  /*
173
166
  * call-seq:
174
- * xpath_object.each { |node| ... } => self
167
+ * xpath_object.each { |node| ... } -> self
175
168
  *
176
169
  * Call the supplied block for each node in this set.
177
170
  */
@@ -194,7 +187,7 @@ ruby_xml_xpath_object_each(VALUE self)
194
187
 
195
188
  /*
196
189
  * call-seq:
197
- * xpath_object.first => node
190
+ * xpath_object.first -> node
198
191
  *
199
192
  * Returns the first node in this node set, or nil if none exist.
200
193
  */
@@ -208,7 +201,7 @@ ruby_xml_xpath_object_first(VALUE self) {
208
201
 
209
202
  /*
210
203
  * call-seq:
211
- * xpath_object[i] => node
204
+ * xpath_object[i] -> node
212
205
  *
213
206
  * array index into set of nodes
214
207
  */
@@ -223,7 +216,7 @@ ruby_xml_xpath_object_aref(VALUE self, VALUE aref) {
223
216
 
224
217
  /*
225
218
  * call-seq:
226
- * xpath_object.length => num
219
+ * xpath_object.length -> num
227
220
  *
228
221
  * Obtain the length of the nodesetval node list.
229
222
  */
@@ -231,7 +224,7 @@ VALUE
231
224
  ruby_xml_xpath_object_length(VALUE self) {
232
225
  xmlXPathObjectPtr xpop;
233
226
 
234
- if ( ruby_xml_xpath_object_empty_q(self) == Qtrue )
227
+ if (ruby_xml_xpath_object_empty_q(self) == Qtrue)
235
228
  return INT2FIX(0);
236
229
 
237
230
  Data_Get_Struct(self,xmlXPathObject,xpop);
@@ -9,20 +9,14 @@ typedef struct ruby_xml_xpath_object_s {
9
9
  xmlXPathObjectPtr xpop;
10
10
  } ruby_xml_xpath_object;
11
11
 
12
+ void ruby_init_xml_xpath_object(void);
12
13
  VALUE ruby_xml_xpath_object_wrap(xmlXPathObjectPtr xpop);
13
- VALUE ruby_xml_xpath_object_to_a(VALUE self);
14
+
14
15
  VALUE ruby_xml_xpath_object_first(VALUE self);
15
- VALUE ruby_xml_xpath_object_set(VALUE self);
16
- VALUE ruby_xml_xpath_object_empty_q(VALUE self);
16
+ VALUE ruby_xml_xpath_object_to_a(VALUE self);
17
17
  VALUE ruby_xml_xpath_object_each(VALUE self);
18
+ VALUE ruby_xml_xpath_object_empty_q(VALUE self);
18
19
  VALUE ruby_xml_xpath_object_first(VALUE self);
19
20
  VALUE ruby_xml_xpath_object_length(VALUE self);
20
- VALUE ruby_xml_xpath_object_set_type(VALUE self);
21
- VALUE ruby_xml_xpath_object_string(VALUE self);
22
-
23
- void ruby_xml_xpath_object_mark(xmlXPathObjectPtr xpop);
24
- void ruby_xml_xpath_object_free(xmlXPathObjectPtr xpop);
25
-
26
- void ruby_init_xml_xpath_object(void);
27
21
 
28
22
  #endif
@@ -1,4 +1,4 @@
1
- /* $Id: ruby_xml_xpointer.c 300 2008-07-01 19:14:15Z cfis $ */
1
+ /* $Id: ruby_xml_xpointer.c 351 2008-07-09 19:55:21Z cfis $ */
2
2
 
3
3
  /* Please see the LICENSE file for copyright and distribution information */
4
4
 
@@ -11,7 +11,7 @@ VALUE eXMLXPointerInvalidExpression;
11
11
  VALUE
12
12
  ruby_xml_xpointer_point(VALUE class, VALUE rnode, VALUE xptr_str) {
13
13
  #ifdef LIBXML_XPTR_ENABLED
14
- ruby_xml_node *node;
14
+ xmlNodePtr xnode;
15
15
  xmlXPathContextPtr ctxt;
16
16
  VALUE rxptr_xpth_ctxt, rxxp;
17
17
  xmlXPathObjectPtr xpath;
@@ -20,10 +20,10 @@ ruby_xml_xpointer_point(VALUE class, VALUE rnode, VALUE xptr_str) {
20
20
  if (rb_obj_is_kind_of(rnode, cXMLNode) == Qfalse)
21
21
  rb_raise(rb_eTypeError, "require an XML::Node object");
22
22
 
23
- Data_Get_Struct(rnode, ruby_xml_node, node);
23
+ Data_Get_Struct(rnode, xmlNode, xnode);
24
24
 
25
25
  rxptr_xpth_ctxt =
26
- ruby_xml_xpath_context_wrap(ctxt=xmlXPtrNewContext(node->node->doc, node->node, NULL));
26
+ ruby_xml_xpath_context_wrap(ctxt=xmlXPtrNewContext(xnode->doc, xnode, NULL));
27
27
 
28
28
  if (NIL_P(rxptr_xpth_ctxt))
29
29
  return(Qnil);
@@ -49,7 +49,7 @@ ruby_xml_xpointer_point2(VALUE node, VALUE xptr_str) {
49
49
 
50
50
  /*
51
51
  * call-seq:
52
- * XML::XPointer.range(start_node, end_node) => xpath
52
+ * XML::XPointer.range(start_node, end_node) -> xpath
53
53
  *
54
54
  * Create an xpath representing the range between the supplied
55
55
  * start and end node.
@@ -57,7 +57,7 @@ ruby_xml_xpointer_point2(VALUE node, VALUE xptr_str) {
57
57
  VALUE
58
58
  ruby_xml_xpointer_range(VALUE class, VALUE rstart, VALUE rend) {
59
59
  #ifdef LIBXML_XPTR_ENABLED
60
- ruby_xml_node *start, *end;
60
+ xmlNodePtr start, end;
61
61
  VALUE rxxp;
62
62
  xmlXPathObjectPtr xpath;
63
63
 
@@ -66,15 +66,15 @@ ruby_xml_xpointer_range(VALUE class, VALUE rstart, VALUE rend) {
66
66
  if (rb_obj_is_kind_of(rend, cXMLNode) == Qfalse)
67
67
  rb_raise(rb_eTypeError, "require an XML::Node object as an ending point");
68
68
 
69
- Data_Get_Struct(rstart, ruby_xml_node, start);
70
- if (start->node == NULL)
69
+ Data_Get_Struct(rstart, xmlNode, start);
70
+ if (start == NULL)
71
71
  return(Qnil);
72
72
 
73
- Data_Get_Struct(rend, ruby_xml_node, end);
74
- if (end->node == NULL)
73
+ Data_Get_Struct(rend, xmlNode, end);
74
+ if (end == NULL)
75
75
  return(Qnil);
76
76
 
77
- xpath = xmlXPtrNewRangeNodes(start->node, end->node);
77
+ xpath = xmlXPtrNewRangeNodes(start, end);
78
78
  if (xpath == NULL)
79
79
  rb_fatal("You shouldn't be able to have this happen");
80
80
 
@@ -1,27 +1,27 @@
1
- /* $Id: ruby_xml_xpointer.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_XPOINTER__
6
- #define __RUBY_XML_XPOINTER__
7
-
8
- extern VALUE cXMLXPointer;
9
- extern VALUE eXMLXPointerInvalidExpression;
10
-
11
- typedef struct ruby_xml_xpointer {
12
- VALUE xd;
13
- VALUE ctxt;
14
- /*
15
- * This needs to go into a xpointer data struct:
16
- *
17
- * xmlLocationSetPtr xptr;
18
- *
19
- * I also need an xpointer data struct type.
20
- */
21
- } ruby_xml_xpointer;
22
-
23
- VALUE ruby_xml_xpointer_point(VALUE class, VALUE node, VALUE xptr_string);
24
- VALUE ruby_xml_xpointer_point2(VALUE node, VALUE xptr_string);
25
- void ruby_init_xml_xpointer(void);
26
-
27
- #endif
1
+ /* $Id: ruby_xml_xpointer.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_XPOINTER__
6
+ #define __RUBY_XML_XPOINTER__
7
+
8
+ extern VALUE cXMLXPointer;
9
+ extern VALUE eXMLXPointerInvalidExpression;
10
+
11
+ typedef struct ruby_xml_xpointer {
12
+ VALUE xd;
13
+ VALUE ctxt;
14
+ /*
15
+ * This needs to go into a xpointer data struct:
16
+ *
17
+ * xmlLocationSetPtr xptr;
18
+ *
19
+ * I also need an xpointer data struct type.
20
+ */
21
+ } ruby_xml_xpointer;
22
+
23
+ VALUE ruby_xml_xpointer_point(VALUE class, VALUE node, VALUE xptr_string);
24
+ VALUE ruby_xml_xpointer_point2(VALUE node, VALUE xptr_string);
25
+ void ruby_init_xml_xpointer(void);
26
+
27
+ #endif
@@ -1,18 +1,18 @@
1
- /* $Id: ruby_xml_xpointer_context.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_XPOINTER_CONTEXT__
6
- #define __RUBY_XML_XPOINTER_CONTEXT__
7
-
8
- extern VALUE cXMLXPointerContext;
9
- extern VALUE eXMLXPointerContextInvalidPath;
10
-
11
- typedef struct ruby_xml_xpointer_context {
12
- VALUE xd;
13
- xmlXPathContextPtr ctxt;
14
- } ruby_xml_xpointer_context;
15
-
16
- void ruby_init_xml_xpointer_context(void);
17
-
18
- #endif
1
+ /* $Id: ruby_xml_xpointer_context.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_XPOINTER_CONTEXT__
6
+ #define __RUBY_XML_XPOINTER_CONTEXT__
7
+
8
+ extern VALUE cXMLXPointerContext;
9
+ extern VALUE eXMLXPointerContextInvalidPath;
10
+
11
+ typedef struct ruby_xml_xpointer_context {
12
+ VALUE xd;
13
+ xmlXPathContextPtr ctxt;
14
+ } ruby_xml_xpointer_context;
15
+
16
+ void ruby_init_xml_xpointer_context(void);
17
+
18
+ #endif
data/ext/libxml/version.h CHANGED
@@ -1,9 +1,9 @@
1
1
  /* Don't nuke this block! It is used for automatically updating the
2
2
  * versions below. VERSION = string formatting, VERNUM = numbered
3
3
  * version for inline testing: increment both or none at all.*/
4
- #define RUBY_LIBXML_VERSION "0.6.0"
4
+ #define RUBY_LIBXML_VERSION "0.7.0"
5
5
  #define RUBY_LIBXML_VERNUM 0
6
6
  #define RUBY_LIBXML_VER_MAJ 0
7
- #define RUBY_LIBXML_VER_MIN 6
7
+ #define RUBY_LIBXML_VER_MIN 7
8
8
  #define RUBY_LIBXML_VER_MIC 0
9
9
  #define RUBY_LIBXML_VER_PATCH 0
data/lib/libxml.rb CHANGED
@@ -1,125 +1,134 @@
1
- # $Id: libxml.rb 291 2008-07-01 08:04:25Z cfis $
2
- # Please see the LICENSE file for copyright and distribution information
3
-
4
- require 'libxml_ruby.so'
5
-
6
- module XML::XMLParserOptions
7
- XML_PARSE_RECOVER = 1 # recover on errors
8
- XML_PARSE_NOENT = 2 # substitute entities
9
- XML_PARSE_DTDLOAD = 4 # load the external subset
10
- XML_PARSE_DTDATTR = 8 # default DTD attributes
11
- XML_PARSE_DTDVALID = 16 # validate with the DTD
12
- XML_PARSE_NOERROR = 32 # suppress error reports
13
- XML_PARSE_NOWARNING = 64 # suppress warning reports
14
- XML_PARSE_PEDANTIC = 128 # pedantic error reporting
15
- XML_PARSE_NOBLANKS = 256 # remove blank nodes
16
- XML_PARSE_SAX1 = 512 # use the SAX1 interface internally
17
- XML_PARSE_XINCLUDE = 1024 # Implement XInclude substitition
18
- XML_PARSE_NONET = 2048 # Forbid network access
19
- XML_PARSE_NODICT = 4096 # Do not reuse the context dictionnary
20
- XML_PARSE_NSCLEAN = 8192 # remove redundant namespaces declarations
21
- XML_PARSE_NOCDATA = 16384 # merge CDATA as text nodes
22
- XML_PARSE_NOXINCNODE = 32768 # do not generate XINCLUDE START/END nodes
23
- XML_PARSE_COMPACT = 65536 # compact small text nodes; no modification of the tree allowed afterwards (will possibly crash if you try to modify the tree)
24
- end
25
-
26
- class XML::Document
27
- include Enumerable
28
-
29
- # maybe, maybe not...
30
- def each(&blk)
31
- find('//*').each(&blk)
32
- end
33
- end
34
-
35
- class XML::Node::Set
36
- include Enumerable
37
-
38
- # inefficient, but maybe can find a way to cache the
39
- # ary and dump on change?
40
- def [](i, count = nil)
41
- if count
42
- to_a[i,count]
43
- else
44
- to_a[i]
45
- end
46
- end
47
-
48
- def to_s #:nodoc:
49
- to_a.to_s
50
- end
51
- end
52
-
53
- module XML::SiblingEnum
54
- private
55
-
56
- # Iterates nodes and attributes
57
- def siblings(node, &blk)
58
- if n = node
59
- loop do
60
- blk.call(n)
61
- break unless n = n.next
62
- end
63
- end
64
- end
65
- end
66
-
67
- class XML::Node
68
- include XML::SiblingEnum
69
- include Enumerable
70
- include Comparable
71
-
72
- # maybe these don't belong on all nodes...
73
- def each_child(&blk)
74
- siblings(child, &blk)
75
- end
76
-
77
- def each_attr(&blk)
78
- siblings(properties, &blk)
79
- end
80
-
81
- # all siblings INCLUDING self
82
- def each_sibling(&blk)
83
- siblings(self, &blk)
84
- end
85
-
86
- # I guess this is what you'd expect?
87
- alias :each :each_child
88
-
89
- def to_a
90
- inject([]) { |ary,n| ary << n }
91
- end
92
-
93
- def <=>(other)
94
- to_s <=> other.to_s
95
- end
96
-
97
- def clone
98
- copy(false)
99
- end
100
- end
101
-
102
- class XML::Attr
103
- include XML::SiblingEnum
104
- include Enumerable
105
-
106
- def each_sibling(&blk)
107
- siblings(self,&blk)
108
- end
109
-
110
- alias :each_attr :each_sibling
111
- alias :each :each_sibling
112
-
113
- def to_h
114
- inject({}) do |h,a| h[a.name] = a.value; h end
115
- end
116
-
117
- def to_a
118
- inject([]) do |ary,a| ary << [a.name, a.value] end
119
- end
120
-
121
- def to_s
122
- "#{name} = #{value}"
123
- end
124
- end
125
-
1
+ # $Id: libxml.rb 326 2008-07-08 23:00:50Z cfis $
2
+ # Please see the LICENSE file for copyright and distribution information
3
+
4
+ require 'libxml_ruby.so'
5
+
6
+ module XML::XMLParserOptions
7
+ XML_PARSE_RECOVER = 1 # recover on errors
8
+ XML_PARSE_NOENT = 2 # substitute entities
9
+ XML_PARSE_DTDLOAD = 4 # load the external subset
10
+ XML_PARSE_DTDATTR = 8 # default DTD attributes
11
+ XML_PARSE_DTDVALID = 16 # validate with the DTD
12
+ XML_PARSE_NOERROR = 32 # suppress error reports
13
+ XML_PARSE_NOWARNING = 64 # suppress warning reports
14
+ XML_PARSE_PEDANTIC = 128 # pedantic error reporting
15
+ XML_PARSE_NOBLANKS = 256 # remove blank nodes
16
+ XML_PARSE_SAX1 = 512 # use the SAX1 interface internally
17
+ XML_PARSE_XINCLUDE = 1024 # Implement XInclude substitition
18
+ XML_PARSE_NONET = 2048 # Forbid network access
19
+ XML_PARSE_NODICT = 4096 # Do not reuse the context dictionnary
20
+ XML_PARSE_NSCLEAN = 8192 # remove redundant namespaces declarations
21
+ XML_PARSE_NOCDATA = 16384 # merge CDATA as text nodes
22
+ XML_PARSE_NOXINCNODE = 32768 # do not generate XINCLUDE START/END nodes
23
+ XML_PARSE_COMPACT = 65536 # compact small text nodes; no modification of the tree allowed afterwards (will possibly crash if you try to modify the tree)
24
+ end
25
+
26
+ class XML::Document
27
+ include Enumerable
28
+
29
+ # maybe, maybe not...
30
+ def each(&blk)
31
+ find('//*').each(&blk)
32
+ end
33
+ end
34
+
35
+ class XML::Node::Set
36
+ include Enumerable
37
+
38
+ # inefficient, but maybe can find a way to cache the
39
+ # ary and dump on change?
40
+ def [](i, count = nil)
41
+ if count
42
+ to_a[i,count]
43
+ else
44
+ to_a[i]
45
+ end
46
+ end
47
+
48
+ def to_s #:nodoc:
49
+ to_a.to_s
50
+ end
51
+ end
52
+
53
+ module XML::SiblingEnum
54
+ def length
55
+ inject(0) do |result, node|
56
+ result + 1
57
+ end
58
+ end
59
+
60
+ private
61
+
62
+ # Iterates nodes and attributes
63
+ def siblings(node, &blk)
64
+ if n = node
65
+ loop do
66
+ blk.call(n)
67
+ break unless n = n.next
68
+ end
69
+ end
70
+ end
71
+ end
72
+
73
+ class XML::Node
74
+ include XML::SiblingEnum
75
+ include Enumerable
76
+
77
+ # maybe these don't belong on all nodes...
78
+ def each_child(&blk)
79
+ siblings(child, &blk)
80
+ end
81
+
82
+ def each_attr(&blk)
83
+ siblings(properties, &blk)
84
+ end
85
+
86
+ # all siblings INCLUDING self
87
+ def each_sibling(&blk)
88
+ siblings(self, &blk)
89
+ end
90
+
91
+ # I guess this is what you'd expect?
92
+ alias :each :each_child
93
+
94
+ def to_a
95
+ inject([]) do |ary,n|
96
+ ary << n
97
+ ary
98
+ end
99
+ end
100
+
101
+ def clone
102
+ copy(false)
103
+ end
104
+ end
105
+
106
+ class XML::Attr
107
+ include XML::SiblingEnum
108
+ include Enumerable
109
+
110
+ def each_sibling(&blk)
111
+ siblings(self,&blk)
112
+ end
113
+
114
+ alias :each_attr :each_sibling
115
+ alias :each :each_sibling
116
+
117
+ def to_h
118
+ inject({}) do |h,a|
119
+ h[a.name] = a.value
120
+ h
121
+ end
122
+ end
123
+
124
+ def to_a
125
+ inject([]) do |ary,a|
126
+ ary << [a.name, a.value]
127
+ ary
128
+ end
129
+ end
130
+
131
+ def to_s
132
+ "#{name} = #{value}"
133
+ end
134
+ end