libxml-ruby 5.0.4 → 5.0.6

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 (97) hide show
  1. checksums.yaml +4 -4
  2. data/HISTORY +17 -6
  3. data/README.rdoc +1 -1
  4. data/Rakefile +98 -98
  5. data/ext/libxml/extconf.h +1 -0
  6. data/ext/libxml/extconf.rb +5 -0
  7. data/ext/libxml/libxml.c +79 -79
  8. data/ext/libxml/ruby_xml.c +556 -556
  9. data/ext/libxml/ruby_xml_attr.c +333 -333
  10. data/ext/libxml/ruby_xml_attr.h +12 -12
  11. data/ext/libxml/ruby_xml_attr_decl.h +11 -11
  12. data/ext/libxml/ruby_xml_attributes.h +17 -17
  13. data/ext/libxml/ruby_xml_cbg.c +85 -85
  14. data/ext/libxml/ruby_xml_document.c +1129 -1129
  15. data/ext/libxml/ruby_xml_dtd.c +257 -257
  16. data/ext/libxml/ruby_xml_dtd.h +9 -9
  17. data/ext/libxml/ruby_xml_encoding.c +250 -250
  18. data/ext/libxml/ruby_xml_error.c +1003 -1003
  19. data/ext/libxml/ruby_xml_error.h +14 -14
  20. data/ext/libxml/ruby_xml_html_parser.c +91 -91
  21. data/ext/libxml/ruby_xml_html_parser.h +10 -10
  22. data/ext/libxml/ruby_xml_html_parser_context.c +351 -351
  23. data/ext/libxml/ruby_xml_html_parser_context.h +10 -10
  24. data/ext/libxml/ruby_xml_html_parser_options.c +48 -48
  25. data/ext/libxml/ruby_xml_html_parser_options.h +10 -10
  26. data/ext/libxml/ruby_xml_input_cbg.c +188 -188
  27. data/ext/libxml/ruby_xml_input_cbg.h +20 -20
  28. data/ext/libxml/ruby_xml_io.c +47 -47
  29. data/ext/libxml/ruby_xml_io.h +10 -10
  30. data/ext/libxml/ruby_xml_namespace.c +151 -151
  31. data/ext/libxml/ruby_xml_namespace.h +10 -10
  32. data/ext/libxml/ruby_xml_namespaces.c +293 -293
  33. data/ext/libxml/ruby_xml_namespaces.h +9 -9
  34. data/ext/libxml/ruby_xml_node.h +13 -13
  35. data/ext/libxml/ruby_xml_parser.c +91 -91
  36. data/ext/libxml/ruby_xml_parser.h +10 -10
  37. data/ext/libxml/ruby_xml_parser_context.c +1009 -1009
  38. data/ext/libxml/ruby_xml_parser_context.h +10 -10
  39. data/ext/libxml/ruby_xml_parser_options.c +74 -74
  40. data/ext/libxml/ruby_xml_parser_options.h +10 -10
  41. data/ext/libxml/ruby_xml_reader.h +14 -14
  42. data/ext/libxml/ruby_xml_relaxng.h +8 -8
  43. data/ext/libxml/ruby_xml_sax2_handler.c +326 -326
  44. data/ext/libxml/ruby_xml_sax2_handler.h +10 -10
  45. data/ext/libxml/ruby_xml_sax_parser.c +108 -108
  46. data/ext/libxml/ruby_xml_sax_parser.h +10 -10
  47. data/ext/libxml/ruby_xml_schema.h +25 -25
  48. data/ext/libxml/ruby_xml_schema_attribute.h +37 -37
  49. data/ext/libxml/ruby_xml_schema_element.h +11 -11
  50. data/ext/libxml/ruby_xml_schema_facet.c +50 -50
  51. data/ext/libxml/ruby_xml_schema_facet.h +9 -9
  52. data/ext/libxml/ruby_xml_schema_type.h +9 -9
  53. data/ext/libxml/ruby_xml_version.h +9 -9
  54. data/ext/libxml/ruby_xml_writer.c +1124 -1124
  55. data/ext/libxml/ruby_xml_writer.h +6 -6
  56. data/ext/libxml/ruby_xml_xinclude.c +20 -20
  57. data/ext/libxml/ruby_xml_xinclude.h +11 -11
  58. data/ext/libxml/ruby_xml_xpath.c +195 -195
  59. data/ext/libxml/ruby_xml_xpath.h +15 -15
  60. data/ext/libxml/ruby_xml_xpath_context.c +362 -362
  61. data/ext/libxml/ruby_xml_xpath_context.h +9 -9
  62. data/ext/libxml/ruby_xml_xpath_expression.h +10 -10
  63. data/ext/libxml/ruby_xml_xpath_object.h +17 -17
  64. data/lib/libxml/attr.rb +122 -122
  65. data/lib/libxml/attr_decl.rb +80 -80
  66. data/lib/libxml/attributes.rb +13 -13
  67. data/lib/libxml/document.rb +194 -194
  68. data/lib/libxml/error.rb +95 -95
  69. data/lib/libxml/hpricot.rb +77 -77
  70. data/lib/libxml/html_parser.rb +96 -96
  71. data/lib/libxml/namespace.rb +61 -61
  72. data/lib/libxml/namespaces.rb +37 -37
  73. data/lib/libxml/node.rb +323 -323
  74. data/lib/libxml/parser.rb +102 -102
  75. data/lib/libxml/sax_callbacks.rb +179 -179
  76. data/lib/libxml/sax_parser.rb +40 -40
  77. data/lib/libxml/tree.rb +28 -28
  78. data/lib/libxml-ruby.rb +2 -2
  79. data/lib/libxml.rb +4 -4
  80. data/lib/xml/libxml.rb +10 -10
  81. data/lib/xml.rb +13 -13
  82. data/libxml-ruby.gemspec +50 -49
  83. data/test/test_document.rb +140 -140
  84. data/test/test_document_write.rb +142 -142
  85. data/test/test_dtd.rb +126 -126
  86. data/test/test_encoding.rb +126 -126
  87. data/test/test_error.rb +197 -194
  88. data/test/test_helper.rb +21 -20
  89. data/test/test_namespace.rb +58 -58
  90. data/test/test_node.rb +235 -235
  91. data/test/test_node_write.rb +93 -93
  92. data/test/test_parser.rb +333 -333
  93. data/test/test_reader.rb +364 -364
  94. data/test/test_writer.rb +500 -468
  95. data/test/test_xml.rb +168 -168
  96. metadata +5 -5
  97. data/test/test.rb +0 -5
@@ -1,6 +1,6 @@
1
- #ifndef __RXML_WRITER__
2
- #define __RXML_WRITER__
3
-
4
- extern VALUE cXMLWriter;
5
- void rxml_init_writer(void);
6
- #endif
1
+ #ifndef __RXML_WRITER__
2
+ #define __RXML_WRITER__
3
+
4
+ extern VALUE cXMLWriter;
5
+ void rxml_init_writer(void);
6
+ #endif
@@ -1,20 +1,20 @@
1
- #include "ruby_libxml.h"
2
- #include "ruby_xml_xinclude.h"
3
-
4
- #ifdef LIBXML_XINCLUDE_ENABLED
5
- #include <libxml/xinclude.h>
6
- #endif
7
-
8
- VALUE cXMLXInclude;
9
-
10
- /*
11
- * Document-class: LibXML::XML::XInclude
12
- *
13
- * The ruby bindings do not currently expose libxml's
14
- * XInclude fuctionality.
15
- */
16
-
17
- void rxml_init_xinclude(void)
18
- {
19
- cXMLXInclude = rb_define_class_under(mXML, "XInclude", rb_cObject);
20
- }
1
+ #include "ruby_libxml.h"
2
+ #include "ruby_xml_xinclude.h"
3
+
4
+ #ifdef LIBXML_XINCLUDE_ENABLED
5
+ #include <libxml/xinclude.h>
6
+ #endif
7
+
8
+ VALUE cXMLXInclude;
9
+
10
+ /*
11
+ * Document-class: LibXML::XML::XInclude
12
+ *
13
+ * The ruby bindings do not currently expose libxml's
14
+ * XInclude fuctionality.
15
+ */
16
+
17
+ void rxml_init_xinclude(void)
18
+ {
19
+ cXMLXInclude = rb_define_class_under(mXML, "XInclude", rb_cObject);
20
+ }
@@ -1,11 +1,11 @@
1
- /* Please see the LICENSE file for copyright and distribution information */
2
-
3
- #ifndef __RXML_XINCLUDE__
4
- #define __RXML_XINCLUDE__
5
-
6
- extern VALUE cXMLXInclude;
7
- extern VALUE eXMLXIncludeError;
8
-
9
- void rxml_init_xinclude(void);
10
-
11
- #endif
1
+ /* Please see the LICENSE file for copyright and distribution information */
2
+
3
+ #ifndef __RXML_XINCLUDE__
4
+ #define __RXML_XINCLUDE__
5
+
6
+ extern VALUE cXMLXInclude;
7
+ extern VALUE eXMLXIncludeError;
8
+
9
+ void rxml_init_xinclude(void);
10
+
11
+ #endif
@@ -1,195 +1,195 @@
1
- /*
2
- * Document-class: LibXML::XML::XPath
3
- *
4
- * The XML::XPath module is used to query XML documents. It is
5
- * usually accessed via the XML::Document#find or
6
- * XML::Node#find methods. For example:
7
- *
8
- * document.find('/foo', namespaces) -> XML::XPath::Object
9
- *
10
- * The optional namespaces parameter can be a string, array or
11
- * hash table.
12
- *
13
- * document.find('/foo', 'xlink:http://www.w3.org/1999/xlink')
14
- * document.find('/foo', ['xlink:http://www.w3.org/1999/xlink',
15
- * 'xi:http://www.w3.org/2001/XInclude')
16
- * document.find('/foo', 'xlink' => 'http://www.w3.org/1999/xlink',
17
- * 'xi' => 'http://www.w3.org/2001/XInclude')
18
- *
19
- *
20
- * === Working With Default Namespaces
21
- *
22
- * Finding namespaced elements and attributes can be tricky.
23
- * Lets work through an example of a document with a default
24
- * namespace:
25
- *
26
- * <?xml version="1.0" encoding="utf-8"?>
27
- * <feed xmlns="http://www.w3.org/2005/Atom">
28
- * <title type="text">Phil Bogle's Contacts</title>
29
- * </feed>
30
- *
31
- * To find nodes you must define the atom namespace for
32
- * libxml. One way to do this is:
33
- *
34
- * node = doc.find('atom:title', 'atom:http://www.w3.org/2005/Atom')
35
- *
36
- * Alternatively, you can register the default namespace like this:
37
- *
38
- * doc.root.namespaces.default_prefix = 'atom'
39
- * node = doc.find('atom:title')
40
- *
41
- * === More Complex Namespace Examples
42
- *
43
- * Lets work through some more complex examples using the
44
- * following xml document:
45
- *
46
- * <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
47
- * <soap:Body>
48
- * <getManufacturerNamesResponse xmlns="http://services.somewhere.com">
49
- * <IDAndNameList xmlns="http://services.somewhere.com">
50
- * <ns1:IdAndName xmlns:ns1="http://domain.somewhere.com"/>
51
- * </IDAndNameList>
52
- * </getManufacturerNamesResponse>
53
- * </soap:Body>
54
- * </soap:Envelope>
55
- *
56
- * # Since the soap namespace is defined on the root
57
- * # node we can directly use it.
58
- * doc.find('/soap:Envelope')
59
- *
60
- * # Since the ns1 namespace is not defined on the root node
61
- * # we have to first register it with the xpath engine.
62
- * doc.find('//ns1:IdAndName',
63
- * 'ns1:http://domain.somewhere.com')
64
- *
65
- * # Since the getManufacturerNamesResponse element uses a default
66
- * # namespace we first have to give it a prefix and register
67
- * # it with the xpath engine.
68
- * doc.find('//ns:getManufacturerNamesResponse',
69
- * 'ns:http://services.somewhere.com')
70
- *
71
- * # Here is an example showing a complex namespace aware
72
- * # xpath expression.
73
- * doc.find('/soap:Envelope/soap:Body/ns0:getManufacturerNamesResponse/ns0:IDAndNameList/ns1:IdAndName',
74
- * ['ns0:http://services.somewhere.com', 'ns1:http://domain.somewhere.com'])
75
- */
76
-
77
- #include "ruby_libxml.h"
78
- #include <libxml/xpathInternals.h>
79
-
80
- VALUE mXPath;
81
-
82
- VALUE rxml_xpath_to_value(xmlXPathContextPtr xctxt, xmlXPathObjectPtr xobject)
83
- {
84
- VALUE result;
85
- int type;
86
-
87
- if (xobject == NULL)
88
- {
89
- /* xmlLastError is different than xctxt->lastError. Use
90
- xmlLastError since it has the message set while xctxt->lastError
91
- does not. */
92
- const xmlError *xerror = xmlGetLastError();
93
- rxml_raise(xerror);
94
- }
95
-
96
- switch (type = xobject->type)
97
- {
98
- case XPATH_NODESET:
99
- result = rxml_xpath_object_wrap(xctxt->doc, xobject);
100
- break;
101
- case XPATH_BOOLEAN:
102
- result = (xobject->boolval != 0) ? Qtrue : Qfalse;
103
- xmlXPathFreeObject(xobject);
104
- break;
105
- case XPATH_NUMBER:
106
- result = rb_float_new(xobject->floatval);
107
- xmlXPathFreeObject(xobject);
108
- break;
109
- case XPATH_STRING:
110
- result = rxml_new_cstr(xobject->stringval, xctxt->doc->encoding);
111
- xmlXPathFreeObject(xobject);
112
- break;
113
- default:
114
- xmlXPathFreeObject(xobject);
115
- rb_raise(rb_eTypeError,
116
- "can't convert XPath object of type %d to Ruby value", type
117
- );
118
- }
119
-
120
- return result;
121
- }
122
-
123
- xmlXPathObjectPtr rxml_xpath_from_value(VALUE value)
124
- {
125
- xmlXPathObjectPtr result = NULL;
126
-
127
- switch (TYPE(value))
128
- {
129
- case T_TRUE:
130
- case T_FALSE:
131
- result = xmlXPathNewBoolean(RTEST(value));
132
- break;
133
- case T_FIXNUM:
134
- case T_FLOAT:
135
- result = xmlXPathNewFloat(NUM2DBL(value));
136
- break;
137
- case T_STRING:
138
- result = xmlXPathWrapString(xmlStrdup((const xmlChar *)StringValuePtr(value)));
139
- break;
140
- case T_NIL:
141
- result = xmlXPathNewNodeSet(NULL);
142
- break;
143
- case T_ARRAY:
144
- {
145
- long i, j;
146
- result = xmlXPathNewNodeSet(NULL);
147
-
148
- for (i = RARRAY_LEN(value); i > 0; i--)
149
- {
150
- xmlXPathObjectPtr obj = rxml_xpath_from_value(rb_ary_shift(value));
151
-
152
- if ((obj->nodesetval != NULL) && (obj->nodesetval->nodeNr != 0))
153
- {
154
- for (j = 0; j < obj->nodesetval->nodeNr; j++)
155
- {
156
- xmlXPathNodeSetAdd(result->nodesetval, obj->nodesetval->nodeTab[j]);
157
- }
158
- }
159
- }
160
- break;
161
- }
162
- default:
163
- rb_raise(rb_eTypeError,
164
- "can't convert object of type %s to XPath object", rb_obj_classname(value)
165
- );
166
- }
167
-
168
- return result;
169
- }
170
-
171
- void rxml_init_xpath(void)
172
- {
173
- mXPath = rb_define_module_under(mXML, "XPath");
174
-
175
- /* 0: Undefined value. */
176
- rb_define_const(mXPath, "UNDEFINED", INT2NUM(XPATH_UNDEFINED));
177
- /* 1: A nodeset, will be wrapped by XPath Object. */
178
- rb_define_const(mXPath, "NODESET", INT2NUM(XPATH_NODESET));
179
- /* 2: A boolean value. */
180
- rb_define_const(mXPath, "BOOLEAN", INT2NUM(XPATH_BOOLEAN));
181
- /* 3: A numeric value. */
182
- rb_define_const(mXPath, "NUMBER", INT2NUM(XPATH_NUMBER));
183
- /* 4: A string value. */
184
- rb_define_const(mXPath, "STRING", INT2NUM(XPATH_STRING));
185
- /* 5: An xpointer point */
186
- rb_define_const(mXPath, "POINT", INT2NUM(XPATH_POINT));
187
- /* 6: An xpointer range */
188
- rb_define_const(mXPath, "RANGE", INT2NUM(XPATH_RANGE));
189
- /* 7: An xpointer location set */
190
- rb_define_const(mXPath, "LOCATIONSET", INT2NUM(XPATH_LOCATIONSET));
191
- /* 8: XPath user type */
192
- rb_define_const(mXPath, "USERS", INT2NUM(XPATH_USERS));
193
- /* 9: An XSLT value tree, non modifiable */
194
- rb_define_const(mXPath, "XSLT_TREE", INT2NUM(XPATH_XSLT_TREE));
195
- }
1
+ /*
2
+ * Document-class: LibXML::XML::XPath
3
+ *
4
+ * The XML::XPath module is used to query XML documents. It is
5
+ * usually accessed via the XML::Document#find or
6
+ * XML::Node#find methods. For example:
7
+ *
8
+ * document.find('/foo', namespaces) -> XML::XPath::Object
9
+ *
10
+ * The optional namespaces parameter can be a string, array or
11
+ * hash table.
12
+ *
13
+ * document.find('/foo', 'xlink:http://www.w3.org/1999/xlink')
14
+ * document.find('/foo', ['xlink:http://www.w3.org/1999/xlink',
15
+ * 'xi:http://www.w3.org/2001/XInclude')
16
+ * document.find('/foo', 'xlink' => 'http://www.w3.org/1999/xlink',
17
+ * 'xi' => 'http://www.w3.org/2001/XInclude')
18
+ *
19
+ *
20
+ * === Working With Default Namespaces
21
+ *
22
+ * Finding namespaced elements and attributes can be tricky.
23
+ * Lets work through an example of a document with a default
24
+ * namespace:
25
+ *
26
+ * <?xml version="1.0" encoding="utf-8"?>
27
+ * <feed xmlns="http://www.w3.org/2005/Atom">
28
+ * <title type="text">Phil Bogle's Contacts</title>
29
+ * </feed>
30
+ *
31
+ * To find nodes you must define the atom namespace for
32
+ * libxml. One way to do this is:
33
+ *
34
+ * node = doc.find('atom:title', 'atom:http://www.w3.org/2005/Atom')
35
+ *
36
+ * Alternatively, you can register the default namespace like this:
37
+ *
38
+ * doc.root.namespaces.default_prefix = 'atom'
39
+ * node = doc.find('atom:title')
40
+ *
41
+ * === More Complex Namespace Examples
42
+ *
43
+ * Lets work through some more complex examples using the
44
+ * following xml document:
45
+ *
46
+ * <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
47
+ * <soap:Body>
48
+ * <getManufacturerNamesResponse xmlns="http://services.somewhere.com">
49
+ * <IDAndNameList xmlns="http://services.somewhere.com">
50
+ * <ns1:IdAndName xmlns:ns1="http://domain.somewhere.com"/>
51
+ * </IDAndNameList>
52
+ * </getManufacturerNamesResponse>
53
+ * </soap:Body>
54
+ * </soap:Envelope>
55
+ *
56
+ * # Since the soap namespace is defined on the root
57
+ * # node we can directly use it.
58
+ * doc.find('/soap:Envelope')
59
+ *
60
+ * # Since the ns1 namespace is not defined on the root node
61
+ * # we have to first register it with the xpath engine.
62
+ * doc.find('//ns1:IdAndName',
63
+ * 'ns1:http://domain.somewhere.com')
64
+ *
65
+ * # Since the getManufacturerNamesResponse element uses a default
66
+ * # namespace we first have to give it a prefix and register
67
+ * # it with the xpath engine.
68
+ * doc.find('//ns:getManufacturerNamesResponse',
69
+ * 'ns:http://services.somewhere.com')
70
+ *
71
+ * # Here is an example showing a complex namespace aware
72
+ * # xpath expression.
73
+ * doc.find('/soap:Envelope/soap:Body/ns0:getManufacturerNamesResponse/ns0:IDAndNameList/ns1:IdAndName',
74
+ * ['ns0:http://services.somewhere.com', 'ns1:http://domain.somewhere.com'])
75
+ */
76
+
77
+ #include "ruby_libxml.h"
78
+ #include <libxml/xpathInternals.h>
79
+
80
+ VALUE mXPath;
81
+
82
+ VALUE rxml_xpath_to_value(xmlXPathContextPtr xctxt, xmlXPathObjectPtr xobject)
83
+ {
84
+ VALUE result;
85
+ int type;
86
+
87
+ if (xobject == NULL)
88
+ {
89
+ /* xmlLastError is different than xctxt->lastError. Use
90
+ xmlLastError since it has the message set while xctxt->lastError
91
+ does not. */
92
+ const xmlError *xerror = xmlGetLastError();
93
+ rxml_raise(xerror);
94
+ }
95
+
96
+ switch (type = xobject->type)
97
+ {
98
+ case XPATH_NODESET:
99
+ result = rxml_xpath_object_wrap(xctxt->doc, xobject);
100
+ break;
101
+ case XPATH_BOOLEAN:
102
+ result = (xobject->boolval != 0) ? Qtrue : Qfalse;
103
+ xmlXPathFreeObject(xobject);
104
+ break;
105
+ case XPATH_NUMBER:
106
+ result = rb_float_new(xobject->floatval);
107
+ xmlXPathFreeObject(xobject);
108
+ break;
109
+ case XPATH_STRING:
110
+ result = rxml_new_cstr(xobject->stringval, xctxt->doc->encoding);
111
+ xmlXPathFreeObject(xobject);
112
+ break;
113
+ default:
114
+ xmlXPathFreeObject(xobject);
115
+ rb_raise(rb_eTypeError,
116
+ "can't convert XPath object of type %d to Ruby value", type
117
+ );
118
+ }
119
+
120
+ return result;
121
+ }
122
+
123
+ xmlXPathObjectPtr rxml_xpath_from_value(VALUE value)
124
+ {
125
+ xmlXPathObjectPtr result = NULL;
126
+
127
+ switch (TYPE(value))
128
+ {
129
+ case T_TRUE:
130
+ case T_FALSE:
131
+ result = xmlXPathNewBoolean(RTEST(value));
132
+ break;
133
+ case T_FIXNUM:
134
+ case T_FLOAT:
135
+ result = xmlXPathNewFloat(NUM2DBL(value));
136
+ break;
137
+ case T_STRING:
138
+ result = xmlXPathWrapString(xmlStrdup((const xmlChar *)StringValuePtr(value)));
139
+ break;
140
+ case T_NIL:
141
+ result = xmlXPathNewNodeSet(NULL);
142
+ break;
143
+ case T_ARRAY:
144
+ {
145
+ long i, j;
146
+ result = xmlXPathNewNodeSet(NULL);
147
+
148
+ for (i = RARRAY_LEN(value); i > 0; i--)
149
+ {
150
+ xmlXPathObjectPtr obj = rxml_xpath_from_value(rb_ary_shift(value));
151
+
152
+ if ((obj->nodesetval != NULL) && (obj->nodesetval->nodeNr != 0))
153
+ {
154
+ for (j = 0; j < obj->nodesetval->nodeNr; j++)
155
+ {
156
+ xmlXPathNodeSetAdd(result->nodesetval, obj->nodesetval->nodeTab[j]);
157
+ }
158
+ }
159
+ }
160
+ break;
161
+ }
162
+ default:
163
+ rb_raise(rb_eTypeError,
164
+ "can't convert object of type %s to XPath object", rb_obj_classname(value)
165
+ );
166
+ }
167
+
168
+ return result;
169
+ }
170
+
171
+ void rxml_init_xpath(void)
172
+ {
173
+ mXPath = rb_define_module_under(mXML, "XPath");
174
+
175
+ /* 0: Undefined value. */
176
+ rb_define_const(mXPath, "UNDEFINED", INT2NUM(XPATH_UNDEFINED));
177
+ /* 1: A nodeset, will be wrapped by XPath Object. */
178
+ rb_define_const(mXPath, "NODESET", INT2NUM(XPATH_NODESET));
179
+ /* 2: A boolean value. */
180
+ rb_define_const(mXPath, "BOOLEAN", INT2NUM(XPATH_BOOLEAN));
181
+ /* 3: A numeric value. */
182
+ rb_define_const(mXPath, "NUMBER", INT2NUM(XPATH_NUMBER));
183
+ /* 4: A string value. */
184
+ rb_define_const(mXPath, "STRING", INT2NUM(XPATH_STRING));
185
+ /* 5: An xpointer point */
186
+ rb_define_const(mXPath, "POINT", INT2NUM(XPATH_POINT));
187
+ /* 6: An xpointer range */
188
+ rb_define_const(mXPath, "RANGE", INT2NUM(XPATH_RANGE));
189
+ /* 7: An xpointer location set */
190
+ rb_define_const(mXPath, "LOCATIONSET", INT2NUM(XPATH_LOCATIONSET));
191
+ /* 8: XPath user type */
192
+ rb_define_const(mXPath, "USERS", INT2NUM(XPATH_USERS));
193
+ /* 9: An XSLT value tree, non modifiable */
194
+ rb_define_const(mXPath, "XSLT_TREE", INT2NUM(XPATH_XSLT_TREE));
195
+ }
@@ -1,15 +1,15 @@
1
- /* Please see the LICENSE file for copyright and distribution information */
2
-
3
- #ifndef __RXML_XPATH__
4
- #define __RXML_XPATH__
5
-
6
- #include <libxml/xpath.h>
7
-
8
- extern VALUE mXPath;
9
-
10
- void rxml_init_xpath(void);
11
-
12
- VALUE rxml_xpath_to_value(xmlXPathContextPtr, xmlXPathObjectPtr);
13
- xmlXPathObjectPtr rxml_xpath_from_value(VALUE);
14
-
15
- #endif
1
+ /* Please see the LICENSE file for copyright and distribution information */
2
+
3
+ #ifndef __RXML_XPATH__
4
+ #define __RXML_XPATH__
5
+
6
+ #include <libxml/xpath.h>
7
+
8
+ extern VALUE mXPath;
9
+
10
+ void rxml_init_xpath(void);
11
+
12
+ VALUE rxml_xpath_to_value(xmlXPathContextPtr, xmlXPathObjectPtr);
13
+ xmlXPathObjectPtr rxml_xpath_from_value(VALUE);
14
+
15
+ #endif