libxml-ruby 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +13 -0
- data/ext/libxml/libxml.c +885 -886
- data/ext/libxml/ruby_libxml.h +70 -72
- data/ext/libxml/ruby_xml_attr.c +76 -76
- data/ext/libxml/ruby_xml_attr.h +8 -8
- data/ext/libxml/ruby_xml_attributes.c +36 -36
- data/ext/libxml/ruby_xml_attributes.h +6 -6
- data/ext/libxml/ruby_xml_document.c +133 -220
- data/ext/libxml/ruby_xml_document.h +4 -7
- data/ext/libxml/ruby_xml_dtd.c +30 -109
- data/ext/libxml/ruby_xml_dtd.h +2 -11
- data/ext/libxml/ruby_xml_error.c +10 -10
- data/ext/libxml/ruby_xml_error.h +4 -4
- data/ext/libxml/ruby_xml_html_parser.c +28 -40
- data/ext/libxml/ruby_xml_html_parser.h +4 -4
- data/ext/libxml/ruby_xml_input.c +208 -32
- data/ext/libxml/ruby_xml_input.h +7 -5
- data/ext/libxml/ruby_xml_input_cbg.c +3 -3
- data/ext/libxml/ruby_xml_node.c +217 -217
- data/ext/libxml/ruby_xml_node.h +5 -5
- data/ext/libxml/ruby_xml_ns.c +26 -26
- data/ext/libxml/ruby_xml_ns.h +4 -4
- data/ext/libxml/ruby_xml_parser.c +151 -164
- data/ext/libxml/ruby_xml_parser.h +3 -8
- data/ext/libxml/ruby_xml_parser_context.c +105 -105
- data/ext/libxml/ruby_xml_parser_context.h +4 -4
- data/ext/libxml/ruby_xml_reader.c +145 -162
- data/ext/libxml/ruby_xml_reader.h +4 -4
- data/ext/libxml/ruby_xml_relaxng.c +30 -43
- data/ext/libxml/ruby_xml_relaxng.h +2 -7
- data/ext/libxml/ruby_xml_sax_parser.c +174 -228
- data/ext/libxml/ruby_xml_sax_parser.h +12 -20
- data/ext/libxml/ruby_xml_schema.c +31 -44
- data/ext/libxml/ruby_xml_schema.h +2 -7
- data/ext/libxml/ruby_xml_state.c +6 -6
- data/ext/libxml/ruby_xml_state.h +2 -2
- data/ext/libxml/ruby_xml_xinclude.c +1 -1
- data/ext/libxml/ruby_xml_xinclude.h +3 -3
- data/ext/libxml/ruby_xml_xpath.c +1 -1
- data/ext/libxml/ruby_xml_xpath.h +3 -12
- data/ext/libxml/ruby_xml_xpath_context.c +293 -294
- data/ext/libxml/ruby_xml_xpath_context.h +3 -7
- data/ext/libxml/ruby_xml_xpath_expression.c +11 -11
- data/ext/libxml/ruby_xml_xpath_expression.h +2 -2
- data/ext/libxml/ruby_xml_xpath_object.c +52 -66
- data/ext/libxml/ruby_xml_xpath_object.h +3 -14
- data/ext/libxml/ruby_xml_xpointer.c +11 -12
- data/ext/libxml/ruby_xml_xpointer.h +5 -7
- data/ext/libxml/sax_parser_callbacks.inc +53 -36
- data/ext/libxml/version.h +2 -2
- data/ext/vc/libxml_ruby.vcproj +1 -9
- data/lib/libxml/html_parser.rb +5 -5
- data/lib/libxml/parser.rb +4 -4
- data/lib/libxml/sax_parser.rb +24 -0
- data/test/tc_document_write.rb +2 -16
- data/test/tc_html_parser.rb +57 -5
- data/test/tc_input.rb +13 -0
- data/test/tc_parser.rb +11 -3
- data/test/tc_reader.rb +53 -34
- data/test/tc_sax_parser.rb +30 -8
- data/test/test.rb +8 -0
- data/test/test_suite.rb +1 -1
- metadata +5 -6
- data/ext/libxml/ruby_xml_encoding.c +0 -164
- data/ext/libxml/ruby_xml_encoding.h +0 -13
- data/test/tc_encoding.rb +0 -13
data/ext/libxml/ruby_xml_node.h
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
/* $Id: ruby_xml_node.h
|
1
|
+
/* $Id: ruby_xml_node.h 612 2008-11-21 08:01:29Z cfis $ */
|
2
2
|
|
3
3
|
/* Please see the LICENSE file for copyright and distribution information */
|
4
4
|
|
5
|
-
#ifndef
|
6
|
-
#define
|
5
|
+
#ifndef __rxml_NODE__
|
6
|
+
#define __rxml_NODE__
|
7
7
|
|
8
8
|
extern VALUE cXMLNode;
|
9
9
|
|
10
10
|
void ruby_init_xml_node(void);
|
11
|
-
void
|
12
|
-
VALUE
|
11
|
+
void rxml_node_mark_common(xmlNodePtr xnode);
|
12
|
+
VALUE rxml_node2_wrap(VALUE class, xmlNodePtr xnode);
|
13
13
|
VALUE check_string_or_symbol(VALUE val);
|
14
14
|
#endif
|
data/ext/libxml/ruby_xml_ns.c
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/* $Id: ruby_xml_ns.c
|
1
|
+
/* $Id: ruby_xml_ns.c 614 2008-11-22 08:04:39Z cfis $ */
|
2
2
|
|
3
3
|
/* Please see the LICENSE file for copyright and distribution information */
|
4
4
|
|
@@ -16,9 +16,9 @@ VALUE cXMLNS;
|
|
16
16
|
* with an node. */
|
17
17
|
|
18
18
|
|
19
|
-
VALUE
|
20
|
-
|
21
|
-
return Data_Wrap_Struct(
|
19
|
+
static VALUE
|
20
|
+
rxml_ns_alloc(VALUE klass) {
|
21
|
+
return Data_Wrap_Struct(klass, NULL, NULL, NULL);
|
22
22
|
}
|
23
23
|
|
24
24
|
/*
|
@@ -30,8 +30,8 @@ ruby_xml_ns_alloc(VALUE klass) {
|
|
30
30
|
*
|
31
31
|
* XML::NS.new(node, "xlink", "http://www.w3.org/1999/xlink")
|
32
32
|
*/
|
33
|
-
VALUE
|
34
|
-
|
33
|
+
static VALUE
|
34
|
+
rxml_ns_initialize(VALUE self, VALUE node, VALUE href, VALUE prefix) {
|
35
35
|
xmlNodePtr xnode;
|
36
36
|
xmlChar *xmlPrefix;
|
37
37
|
xmlNsPtr xns;
|
@@ -46,7 +46,7 @@ ruby_xml_ns_initialize(VALUE self, VALUE node, VALUE href, VALUE prefix) {
|
|
46
46
|
}
|
47
47
|
|
48
48
|
VALUE
|
49
|
-
|
49
|
+
rxml_ns_wrap(xmlNsPtr xns) {
|
50
50
|
return(Data_Wrap_Struct(cXMLNS, NULL, NULL, xns));
|
51
51
|
}
|
52
52
|
|
@@ -57,8 +57,8 @@ ruby_xml_ns_wrap(xmlNsPtr xns) {
|
|
57
57
|
*
|
58
58
|
* Obtain the namespace's href.
|
59
59
|
*/
|
60
|
-
VALUE
|
61
|
-
|
60
|
+
static VALUE
|
61
|
+
rxml_ns_href_get(VALUE self) {
|
62
62
|
xmlNsPtr xns;
|
63
63
|
Data_Get_Struct(self, xmlNs, xns);
|
64
64
|
if (xns == NULL || xns->href == NULL)
|
@@ -74,8 +74,8 @@ ruby_xml_ns_href_get(VALUE self) {
|
|
74
74
|
*
|
75
75
|
* Determine whether this namespace has an href.
|
76
76
|
*/
|
77
|
-
VALUE
|
78
|
-
|
77
|
+
static VALUE
|
78
|
+
rxml_ns_href_q(VALUE self) {
|
79
79
|
xmlNsPtr xns;
|
80
80
|
Data_Get_Struct(self, xmlNs, xns);
|
81
81
|
if (xns == NULL || xns->href == NULL)
|
@@ -91,14 +91,14 @@ ruby_xml_ns_href_q(VALUE self) {
|
|
91
91
|
*
|
92
92
|
* Obtain the next namespace.
|
93
93
|
*/
|
94
|
-
VALUE
|
95
|
-
|
94
|
+
static VALUE
|
95
|
+
rxml_ns_next(VALUE self) {
|
96
96
|
xmlNsPtr xns;
|
97
97
|
Data_Get_Struct(self, xmlNs, xns);
|
98
98
|
if (xns == NULL || xns->next == NULL)
|
99
99
|
return(Qnil);
|
100
100
|
else
|
101
|
-
return(
|
101
|
+
return(rxml_ns_wrap(xns->next));
|
102
102
|
}
|
103
103
|
|
104
104
|
|
@@ -109,8 +109,8 @@ ruby_xml_ns_next(VALUE self) {
|
|
109
109
|
*
|
110
110
|
* Obtain the namespace's prefix.
|
111
111
|
*/
|
112
|
-
VALUE
|
113
|
-
|
112
|
+
static VALUE
|
113
|
+
rxml_ns_prefix_get(VALUE self) {
|
114
114
|
xmlNsPtr xns;
|
115
115
|
Data_Get_Struct(self, xmlNs, xns);
|
116
116
|
if (xns == NULL || xns->prefix == NULL)
|
@@ -126,8 +126,8 @@ ruby_xml_ns_prefix_get(VALUE self) {
|
|
126
126
|
*
|
127
127
|
* Determine whether this namespace has a prefix.
|
128
128
|
*/
|
129
|
-
VALUE
|
130
|
-
|
129
|
+
static VALUE
|
130
|
+
rxml_ns_prefix_q(VALUE self) {
|
131
131
|
xmlNsPtr xns;
|
132
132
|
Data_Get_Struct(self, xmlNs, xns);
|
133
133
|
if (xns == NULL || xns->prefix == NULL)
|
@@ -145,12 +145,12 @@ ruby_xml_ns_prefix_q(VALUE self) {
|
|
145
145
|
void
|
146
146
|
ruby_init_xml_ns(void) {
|
147
147
|
cXMLNS = rb_define_class_under(mXML, "NS", rb_cObject);
|
148
|
-
rb_define_alloc_func(cXMLNS,
|
149
|
-
rb_define_method(cXMLNS, "initialize",
|
150
|
-
rb_define_method(cXMLNS, "href",
|
151
|
-
rb_define_method(cXMLNS, "href?",
|
152
|
-
rb_define_method(cXMLNS, "next",
|
153
|
-
rb_define_method(cXMLNS, "prefix",
|
154
|
-
rb_define_method(cXMLNS, "prefix?",
|
155
|
-
rb_define_method(cXMLNS, "to_s",
|
148
|
+
rb_define_alloc_func(cXMLNS, rxml_ns_alloc);
|
149
|
+
rb_define_method(cXMLNS, "initialize", rxml_ns_initialize, 3);
|
150
|
+
rb_define_method(cXMLNS, "href", rxml_ns_href_get, 0);
|
151
|
+
rb_define_method(cXMLNS, "href?", rxml_ns_href_q, 0);
|
152
|
+
rb_define_method(cXMLNS, "next", rxml_ns_next, 0);
|
153
|
+
rb_define_method(cXMLNS, "prefix", rxml_ns_prefix_get, 0);
|
154
|
+
rb_define_method(cXMLNS, "prefix?", rxml_ns_prefix_q, 0);
|
155
|
+
rb_define_method(cXMLNS, "to_s", rxml_ns_prefix_get, 0);
|
156
156
|
}
|
data/ext/libxml/ruby_xml_ns.h
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
/* $Id: ruby_xml_ns.h
|
1
|
+
/* $Id: ruby_xml_ns.h 612 2008-11-21 08:01:29Z cfis $ */
|
2
2
|
|
3
3
|
/* Please see the LICENSE file for copyright and distribution information */
|
4
4
|
|
5
|
-
#ifndef
|
6
|
-
#define
|
5
|
+
#ifndef __rxml_NS__
|
6
|
+
#define __rxml_NS__
|
7
7
|
|
8
8
|
extern VALUE cXMLNS;
|
9
9
|
|
10
10
|
void ruby_init_xml_ns(void);
|
11
|
-
VALUE
|
11
|
+
VALUE rxml_ns_wrap(xmlNsPtr ns);
|
12
12
|
#endif
|
@@ -1,164 +1,151 @@
|
|
1
|
-
/* $Id: ruby_xml_parser.c
|
2
|
-
|
3
|
-
/* Please see the LICENSE file for copyright and distribution information */
|
4
|
-
|
5
|
-
#include <stdarg.h>
|
6
|
-
#include "ruby_libxml.h"
|
7
|
-
|
8
|
-
VALUE cXMLParser;
|
9
|
-
static ID INPUT_ATTR;
|
10
|
-
static ID CONTEXT_ATTR;
|
11
|
-
|
12
|
-
/*
|
13
|
-
* Document-class: LibXML::XML::Parser
|
14
|
-
*
|
15
|
-
* The XML::Parser provides a tree based API for processing
|
16
|
-
* xml documents, in contract to XML::Reader's stream
|
17
|
-
* based api and XML::SaxParser callback based API.
|
18
|
-
*
|
19
|
-
* As a result, parsing a document creates an in-memory document object
|
20
|
-
* that consist of any number of XML::Node instances. This is simple
|
21
|
-
* and powerful model, but has the major limitation that the size of
|
22
|
-
* the document that can be processed is limited by the amount of
|
23
|
-
* memory available. In such cases, it is better to use the XML::Reader.
|
24
|
-
*
|
25
|
-
* Using the parser is simple:
|
26
|
-
*
|
27
|
-
* parser = XML::Parser.new
|
28
|
-
* parser.file = 'my_file'
|
29
|
-
* doc = parser.parse
|
30
|
-
*
|
31
|
-
* You can also parse strings (see XML::Parser.string) and io objects (see
|
32
|
-
* XML::Parser.io).
|
33
|
-
*/
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
VALUE
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
ctxt
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
ruby_init_parser(void) {
|
153
|
-
cXMLParser = rb_define_class_under(mXML, "Parser", rb_cObject);
|
154
|
-
|
155
|
-
/* Atributes */
|
156
|
-
INPUT_ATTR = rb_intern("@input");
|
157
|
-
CONTEXT_ATTR = rb_intern("@context");
|
158
|
-
rb_define_attr(cXMLParser, "input", 1, 0);
|
159
|
-
rb_define_attr(cXMLParser, "context", 1, 0);
|
160
|
-
|
161
|
-
/* Instance Methods */
|
162
|
-
rb_define_method(cXMLParser, "initialize", ruby_xml_parser_initialize, 0);
|
163
|
-
rb_define_method(cXMLParser, "parse", ruby_xml_parser_parse, 0);
|
164
|
-
}
|
1
|
+
/* $Id: ruby_xml_parser.c 613 2008-11-21 08:39:51Z cfis $ */
|
2
|
+
|
3
|
+
/* Please see the LICENSE file for copyright and distribution information */
|
4
|
+
|
5
|
+
#include <stdarg.h>
|
6
|
+
#include "ruby_libxml.h"
|
7
|
+
|
8
|
+
VALUE cXMLParser;
|
9
|
+
static ID INPUT_ATTR;
|
10
|
+
static ID CONTEXT_ATTR;
|
11
|
+
|
12
|
+
/*
|
13
|
+
* Document-class: LibXML::XML::Parser
|
14
|
+
*
|
15
|
+
* The XML::Parser provides a tree based API for processing
|
16
|
+
* xml documents, in contract to XML::Reader's stream
|
17
|
+
* based api and XML::SaxParser callback based API.
|
18
|
+
*
|
19
|
+
* As a result, parsing a document creates an in-memory document object
|
20
|
+
* that consist of any number of XML::Node instances. This is simple
|
21
|
+
* and powerful model, but has the major limitation that the size of
|
22
|
+
* the document that can be processed is limited by the amount of
|
23
|
+
* memory available. In such cases, it is better to use the XML::Reader.
|
24
|
+
*
|
25
|
+
* Using the parser is simple:
|
26
|
+
*
|
27
|
+
* parser = XML::Parser.new
|
28
|
+
* parser.file = 'my_file'
|
29
|
+
* doc = parser.parse
|
30
|
+
*
|
31
|
+
* You can also parse strings (see XML::Parser.string) and io objects (see
|
32
|
+
* XML::Parser.io).
|
33
|
+
*/
|
34
|
+
|
35
|
+
/*
|
36
|
+
* call-seq:
|
37
|
+
* parser.initialize -> parser
|
38
|
+
*
|
39
|
+
* Initiliazes instance of parser.
|
40
|
+
*/
|
41
|
+
static VALUE
|
42
|
+
rxml_parser_initialize(VALUE self) {
|
43
|
+
VALUE input = rb_class_new_instance(0, NULL, cXMLInput);
|
44
|
+
rb_iv_set(self, "@input", input);
|
45
|
+
rb_iv_set(self, "@context", Qnil);
|
46
|
+
return self;
|
47
|
+
}
|
48
|
+
|
49
|
+
static xmlParserCtxtPtr
|
50
|
+
rxml_parser_filename_ctxt(VALUE input) {
|
51
|
+
xmlParserCtxtPtr ctxt;
|
52
|
+
int retry_count = 0;
|
53
|
+
VALUE filename = rb_ivar_get(input, FILE_ATTR);
|
54
|
+
|
55
|
+
retry:
|
56
|
+
ctxt = xmlCreateFileParserCtxt(StringValuePtr(filename));
|
57
|
+
if (ctxt == NULL) {
|
58
|
+
if ((errno == EMFILE || errno == ENFILE) && retry_count == 0) {
|
59
|
+
retry_count++;
|
60
|
+
rb_gc();
|
61
|
+
goto retry;
|
62
|
+
} else {
|
63
|
+
rb_raise(rb_eIOError, StringValuePtr(filename));
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
return ctxt;
|
68
|
+
}
|
69
|
+
|
70
|
+
static xmlParserCtxtPtr
|
71
|
+
rxml_parser_str_ctxt(VALUE input) {
|
72
|
+
VALUE str = rb_ivar_get(input, STRING_ATTR);
|
73
|
+
return xmlCreateMemoryParserCtxt(StringValuePtr(str), RSTRING_LEN(str));
|
74
|
+
}
|
75
|
+
|
76
|
+
static xmlParserCtxtPtr
|
77
|
+
rxml_parser_io_ctxt(VALUE input) {
|
78
|
+
VALUE io = rb_ivar_get(input, IO_ATTR);
|
79
|
+
VALUE encoding = rb_ivar_get(input, ENCODING_ATTR);
|
80
|
+
xmlCharEncoding xmlEncoding = NUM2INT(encoding);
|
81
|
+
|
82
|
+
return xmlCreateIOParserCtxt(NULL, NULL,
|
83
|
+
(xmlInputReadCallback) rxml_read_callback,
|
84
|
+
NULL, io, xmlEncoding);
|
85
|
+
}
|
86
|
+
|
87
|
+
|
88
|
+
/*
|
89
|
+
* call-seq:
|
90
|
+
* parser.parse -> document
|
91
|
+
*
|
92
|
+
* Parse the input XML and create an XML::Document with
|
93
|
+
* it's content. If an error occurs, XML::Parser::ParseError
|
94
|
+
* is thrown.
|
95
|
+
*/
|
96
|
+
static VALUE
|
97
|
+
rxml_parser_parse(VALUE self) {
|
98
|
+
xmlParserCtxtPtr ctxt;
|
99
|
+
VALUE context;
|
100
|
+
VALUE input = rb_ivar_get(self, INPUT_ATTR);
|
101
|
+
|
102
|
+
context = rb_ivar_get(self, CONTEXT_ATTR);
|
103
|
+
if (context != Qnil)
|
104
|
+
rb_raise(rb_eRuntimeError, "You cannot parse a data source twice");
|
105
|
+
|
106
|
+
if (rb_ivar_get(input, FILE_ATTR) != Qnil)
|
107
|
+
ctxt = rxml_parser_filename_ctxt(input);
|
108
|
+
else if (rb_ivar_get(input, STRING_ATTR) != Qnil)
|
109
|
+
ctxt = rxml_parser_str_ctxt(input);
|
110
|
+
/*else if (rb_ivar_get(input, DOCUMENT_ATTR) != Qnil)
|
111
|
+
ctxt = rxml_parser_parse_document(input);*/
|
112
|
+
else if (rb_ivar_get(input, IO_ATTR) != Qnil)
|
113
|
+
ctxt = rxml_parser_io_ctxt(input);
|
114
|
+
else
|
115
|
+
rb_raise(rb_eArgError, "You must specify a parser data source");
|
116
|
+
|
117
|
+
if (!ctxt)
|
118
|
+
rxml_raise(&xmlLastError);
|
119
|
+
|
120
|
+
context = rxml_parser_context_wrap(ctxt);
|
121
|
+
rb_ivar_set(self, CONTEXT_ATTR, context);
|
122
|
+
|
123
|
+
if (xmlParseDocument(ctxt) == -1 || !ctxt->wellFormed) {
|
124
|
+
xmlFreeDoc(ctxt->myDoc);
|
125
|
+
rxml_raise(&ctxt->lastError);
|
126
|
+
}
|
127
|
+
|
128
|
+
return rxml_document_wrap(ctxt->myDoc);
|
129
|
+
}
|
130
|
+
|
131
|
+
|
132
|
+
// Rdoc needs to know
|
133
|
+
#ifdef RDOC_NEVER_DEFINED
|
134
|
+
mLibXML = rb_define_module("LibXML");
|
135
|
+
mXML = rb_define_module_under(mLibXML, "XML");
|
136
|
+
#endif
|
137
|
+
|
138
|
+
void
|
139
|
+
ruby_init_parser(void) {
|
140
|
+
cXMLParser = rb_define_class_under(mXML, "Parser", rb_cObject);
|
141
|
+
|
142
|
+
/* Atributes */
|
143
|
+
INPUT_ATTR = rb_intern("@input");
|
144
|
+
CONTEXT_ATTR = rb_intern("@context");
|
145
|
+
rb_define_attr(cXMLParser, "input", 1, 0);
|
146
|
+
rb_define_attr(cXMLParser, "context", 1, 0);
|
147
|
+
|
148
|
+
/* Instance Methods */
|
149
|
+
rb_define_method(cXMLParser, "initialize", rxml_parser_initialize, 0);
|
150
|
+
rb_define_method(cXMLParser, "parse", rxml_parser_parse, 0);
|
151
|
+
}
|