libxml-ruby 2.8.0 → 2.9.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 (81) hide show
  1. checksums.yaml +4 -4
  2. data/HISTORY +15 -0
  3. data/README.rdoc +7 -7
  4. data/Rakefile +80 -78
  5. data/ext/libxml/extconf.h +4 -0
  6. data/ext/libxml/extconf.rb +57 -116
  7. data/ext/libxml/libxml.c +4 -0
  8. data/ext/libxml/ruby_xml.c +977 -893
  9. data/ext/libxml/ruby_xml.h +20 -10
  10. data/ext/libxml/ruby_xml_attr.c +333 -333
  11. data/ext/libxml/ruby_xml_attr_decl.c +2 -2
  12. data/ext/libxml/ruby_xml_cbg.c +85 -85
  13. data/ext/libxml/ruby_xml_document.c +1133 -1147
  14. data/ext/libxml/ruby_xml_dtd.c +261 -268
  15. data/ext/libxml/ruby_xml_encoding.c +262 -260
  16. data/ext/libxml/ruby_xml_encoding.h +19 -19
  17. data/ext/libxml/ruby_xml_html_parser_context.c +337 -338
  18. data/ext/libxml/ruby_xml_input_cbg.c +191 -191
  19. data/ext/libxml/ruby_xml_io.c +52 -50
  20. data/ext/libxml/ruby_xml_namespace.c +2 -2
  21. data/ext/libxml/ruby_xml_node.c +1446 -1452
  22. data/ext/libxml/ruby_xml_parser_context.c +999 -1001
  23. data/ext/libxml/ruby_xml_reader.c +1226 -1228
  24. data/ext/libxml/ruby_xml_relaxng.c +110 -111
  25. data/ext/libxml/ruby_xml_sax2_handler.c +326 -328
  26. data/ext/libxml/ruby_xml_schema.c +300 -301
  27. data/ext/libxml/ruby_xml_version.h +3 -3
  28. data/ext/libxml/ruby_xml_writer.c +14 -15
  29. data/ext/libxml/ruby_xml_xpath.c +188 -188
  30. data/ext/libxml/ruby_xml_xpath_context.c +360 -361
  31. data/ext/libxml/ruby_xml_xpath_object.c +335 -335
  32. data/libxml-ruby.gemspec +47 -44
  33. data/test/tc_attr.rb +5 -7
  34. data/test/tc_attr_decl.rb +5 -6
  35. data/test/tc_attributes.rb +1 -2
  36. data/test/tc_canonicalize.rb +1 -2
  37. data/test/tc_deprecated_require.rb +1 -2
  38. data/test/tc_document.rb +4 -5
  39. data/test/tc_document_write.rb +2 -3
  40. data/test/tc_dtd.rb +4 -5
  41. data/test/tc_encoding.rb +126 -126
  42. data/test/tc_encoding_sax.rb +4 -3
  43. data/test/tc_error.rb +14 -15
  44. data/test/tc_html_parser.rb +15 -7
  45. data/test/tc_html_parser_context.rb +1 -2
  46. data/test/tc_namespace.rb +2 -3
  47. data/test/tc_namespaces.rb +5 -6
  48. data/test/tc_node.rb +2 -3
  49. data/test/tc_node_cdata.rb +2 -3
  50. data/test/tc_node_comment.rb +1 -2
  51. data/test/tc_node_copy.rb +1 -2
  52. data/test/tc_node_edit.rb +5 -7
  53. data/test/tc_node_pi.rb +1 -2
  54. data/test/tc_node_text.rb +2 -3
  55. data/test/tc_node_write.rb +2 -3
  56. data/test/tc_node_xlink.rb +1 -2
  57. data/test/tc_parser.rb +18 -24
  58. data/test/tc_parser_context.rb +6 -7
  59. data/test/tc_properties.rb +1 -2
  60. data/test/tc_reader.rb +9 -10
  61. data/test/tc_relaxng.rb +4 -5
  62. data/test/tc_sax_parser.rb +9 -10
  63. data/test/tc_schema.rb +4 -5
  64. data/test/tc_traversal.rb +1 -2
  65. data/test/tc_writer.rb +1 -2
  66. data/test/tc_xinclude.rb +1 -2
  67. data/test/tc_xml.rb +1 -2
  68. data/test/tc_xpath.rb +8 -9
  69. data/test/tc_xpath_context.rb +3 -4
  70. data/test/tc_xpath_expression.rb +3 -4
  71. data/test/tc_xpointer.rb +1 -3
  72. data/test/test_helper.rb +3 -1
  73. data/test/test_suite.rb +0 -1
  74. metadata +47 -11
  75. data/test/etc_doc_to_s.rb +0 -21
  76. data/test/ets_doc_file.rb +0 -17
  77. data/test/ets_doc_to_s.rb +0 -23
  78. data/test/ets_gpx.rb +0 -28
  79. data/test/ets_node_gc.rb +0 -23
  80. data/test/ets_test.xml +0 -2
  81. data/test/ets_tsr.rb +0 -11
@@ -1,268 +1,261 @@
1
- #include "ruby_libxml.h"
2
- #include "ruby_xml_dtd.h"
3
-
4
- /*
5
- * Document-class: LibXML::XML::Dtd
6
- *
7
- * The XML::Dtd class is used to prepare DTD's for validation of xml
8
- * documents.
9
- *
10
- * DTDs can be created from a string or a pair of public and system identifiers.
11
- * Once a Dtd object is instantiated, an XML document can be validated by the
12
- * XML::Document#validate method providing the XML::Dtd object as parameeter.
13
- * The method will raise an exception if the document is
14
- * not valid.
15
- *
16
- * Basic usage:
17
- *
18
- * # parse DTD
19
- * dtd = XML::Dtd.new(<<EOF)
20
- * <!ELEMENT root (item*) >
21
- * <!ELEMENT item (#PCDATA) >
22
- * EOF
23
- *
24
- * # parse xml document to be validated
25
- * instance = XML::Document.file('instance.xml')
26
- *
27
- * # validate
28
- * instance.validate(dtd)
29
- */
30
-
31
- VALUE cXMLDtd;
32
-
33
- void rxml_dtd_free(xmlDtdPtr xdtd)
34
- {
35
- /* Set _private to NULL so that we won't reuse the
36
- same, freed, Ruby wrapper object later.*/
37
- xdtd->_private = NULL;
38
-
39
- if (xdtd->doc == NULL && xdtd->parent == NULL)
40
- xmlFreeDtd(xdtd);
41
- }
42
-
43
- void rxml_dtd_mark(xmlDtdPtr xdtd)
44
- {
45
- if (xdtd == NULL)
46
- return;
47
-
48
- if (xdtd->_private == NULL)
49
- {
50
- return;
51
- }
52
-
53
- rxml_node_mark((xmlNodePtr) xdtd);
54
- }
55
-
56
-
57
- static VALUE rxml_dtd_alloc(VALUE klass)
58
- {
59
- return Data_Wrap_Struct(klass, rxml_dtd_mark, rxml_dtd_free, NULL);
60
- }
61
-
62
- VALUE rxml_dtd_wrap(xmlDtdPtr xdtd)
63
- {
64
- VALUE result;
65
-
66
- // This node is already wrapped
67
- if (xdtd->_private != NULL)
68
- return (VALUE) xdtd->_private;
69
-
70
- result = Data_Wrap_Struct(cXMLDtd, NULL, NULL, xdtd);
71
-
72
- xdtd->_private = (void*) result;
73
-
74
- return result;
75
- }
76
-
77
- /*
78
- * call-seq:
79
- * dtd.external_id -> "string"
80
- *
81
- * Obtain this dtd's external identifer (for a PUBLIC DTD).
82
- */
83
- static VALUE rxml_dtd_external_id_get(VALUE self)
84
- {
85
- xmlDtdPtr xdtd;
86
- Data_Get_Struct(self, xmlDtd, xdtd);
87
-
88
-
89
- if (xdtd->ExternalID == NULL)
90
- return (Qnil);
91
- else
92
- return (rxml_new_cstr((const char*) xdtd->ExternalID, NULL));
93
- }
94
-
95
- /*
96
- * call-seq:
97
- * dtd.name -> "string"
98
- *
99
- * Obtain this dtd's name.
100
- */
101
- static VALUE rxml_dtd_name_get(VALUE self)
102
- {
103
- xmlDtdPtr xdtd;
104
- Data_Get_Struct(self, xmlDtd, xdtd);
105
-
106
-
107
- if (xdtd->name == NULL)
108
- return (Qnil);
109
- else
110
- return (rxml_new_cstr((const char*) xdtd->name, NULL));
111
- }
112
-
113
-
114
- /*
115
- * call-seq:
116
- * dtd.uri -> "string"
117
- *
118
- * Obtain this dtd's URI (for a SYSTEM or PUBLIC DTD).
119
- */
120
- static VALUE rxml_dtd_uri_get(VALUE self)
121
- {
122
- xmlDtdPtr xdtd;
123
- Data_Get_Struct(self, xmlDtd, xdtd);
124
-
125
- if (xdtd->SystemID == NULL)
126
- return (Qnil);
127
- else
128
- return (rxml_new_cstr((const char*) xdtd->SystemID, NULL));
129
- }
130
-
131
- /*
132
- * call-seq:
133
- * node.type -> num
134
- *
135
- * Obtain this node's type identifier.
136
- */
137
- static VALUE rxml_dtd_type(VALUE self)
138
- {
139
- xmlDtdPtr xdtd;
140
- Data_Get_Struct(self, xmlDtd, xdtd);
141
- return (INT2NUM(xdtd->type));
142
- }
143
-
144
- /*
145
- * call-seq:
146
- * XML::Dtd.new("DTD string") -> dtd
147
- * XML::Dtd.new("public", "system") -> dtd
148
- * XML::Dtd.new("name", "public", "system", document) -> external subset dtd
149
- * XML::Dtd.new("name", "public", "system", document, false) -> internal subset dtd
150
- * XML::Dtd.new("name", "public", "system", document, true) -> internal subset dtd
151
- *
152
- * Create a new Dtd from the specified public and system
153
- * identifiers.
154
- */
155
- static VALUE rxml_dtd_initialize(int argc, VALUE *argv, VALUE self)
156
- {
157
- VALUE external, system, dtd_string;
158
- xmlParserInputBufferPtr buffer;
159
- xmlCharEncoding enc = XML_CHAR_ENCODING_NONE;
160
- xmlChar *new_string;
161
- xmlDtdPtr xdtd;
162
-
163
- // 1 argument -- string --> parsujeme jako dtd
164
- // 2 arguments -- public, system --> bude se hledat
165
- // 3 arguments -- public, system, name --> creates an external subset (any parameter may be nil)
166
- // 4 arguments -- public, system, name, doc --> creates an external subset (any parameter may be nil)
167
- // 5 arguments -- public, system, name, doc, true --> creates an internal subset (all but last parameter may be nil)
168
- switch (argc)
169
- {
170
- case 3:
171
- case 4:
172
- case 5: {
173
- VALUE name, doc, internal;
174
- const xmlChar *xname = NULL, *xpublic = NULL, *xsystem = NULL;
175
- xmlDocPtr xdoc = NULL;
176
-
177
- rb_scan_args(argc, argv, "32", &external, &system, &name, &doc, &internal);
178
-
179
- if (external != Qnil) {
180
- Check_Type(external, T_STRING);
181
- xpublic = (const xmlChar*) StringValuePtr(external);
182
- }
183
- if (system != Qnil) {
184
- Check_Type(system, T_STRING);
185
- xsystem = (const xmlChar*) StringValuePtr(system);
186
- }
187
- if (name != Qnil) {
188
- Check_Type(name, T_STRING);
189
- xname = (const xmlChar*) StringValuePtr(name);
190
- }
191
- if (doc != Qnil) {
192
- if (rb_obj_is_kind_of(doc, cXMLDocument) == Qfalse)
193
- rb_raise(rb_eTypeError, "Must pass an XML::Document object");
194
- Data_Get_Struct(doc, xmlDoc, xdoc);
195
- }
196
-
197
- if (internal == Qnil || internal == Qfalse)
198
- xdtd = xmlNewDtd(xdoc, xname, xpublic, xsystem);
199
- else
200
- xdtd = xmlCreateIntSubset(xdoc, xname, xpublic, xsystem);
201
-
202
- if (xdtd == NULL)
203
- rxml_raise(&xmlLastError);
204
-
205
- /* Document will free this dtd now. */
206
- RDATA(self)->dfree = NULL;
207
- DATA_PTR(self) = xdtd;
208
-
209
- xmlSetTreeDoc((xmlNodePtr) xdtd, xdoc);
210
- }
211
- break;
212
-
213
- case 2:
214
- rb_scan_args(argc, argv, "20", &external, &system);
215
-
216
- Check_Type(external, T_STRING);
217
- Check_Type(system, T_STRING);
218
-
219
- xdtd = xmlParseDTD((xmlChar*) StringValuePtr(external),
220
- (xmlChar*) StringValuePtr(system));
221
-
222
- if (xdtd == NULL)
223
- rxml_raise(&xmlLastError);
224
-
225
- DATA_PTR(self) = xdtd;
226
-
227
- xmlSetTreeDoc((xmlNodePtr) xdtd, NULL);
228
- break;
229
-
230
- case 1:
231
- rb_scan_args(argc, argv, "10", &dtd_string);
232
- Check_Type(dtd_string, T_STRING);
233
-
234
- /* Note that buffer is freed by xmlParserInputBufferPush*/
235
- buffer = xmlAllocParserInputBuffer(enc);
236
- new_string = xmlStrdup((xmlChar*) StringValuePtr(dtd_string));
237
- xmlParserInputBufferPush(buffer, xmlStrlen(new_string),
238
- (const char*) new_string);
239
-
240
- xdtd = xmlIOParseDTD(NULL, buffer, enc);
241
-
242
- if (xdtd == NULL)
243
- rxml_raise(&xmlLastError);
244
-
245
- xmlFree(new_string);
246
-
247
- DATA_PTR(self) = xdtd;
248
- break;
249
-
250
- default:
251
- rb_raise(rb_eArgError, "wrong number of arguments");
252
- }
253
-
254
- return self;
255
- }
256
-
257
- void rxml_init_dtd()
258
- {
259
- cXMLDtd = rb_define_class_under(mXML, "Dtd", rb_cObject);
260
- rb_define_alloc_func(cXMLDtd, rxml_dtd_alloc);
261
- rb_define_method(cXMLDtd, "initialize", rxml_dtd_initialize, -1);
262
- rb_define_method(cXMLDtd, "external_id", rxml_dtd_external_id_get, 0);
263
- rb_define_method(cXMLDtd, "name", rxml_dtd_name_get, 0);
264
- rb_define_method(cXMLDtd, "uri", rxml_dtd_uri_get, 0);
265
- rb_define_method(cXMLDtd, "node_type", rxml_dtd_type, 0);
266
- rb_define_alias(cXMLDtd, "system_id", "uri");
267
- }
268
-
1
+ #include "ruby_libxml.h"
2
+ #include "ruby_xml_dtd.h"
3
+
4
+ /*
5
+ * Document-class: LibXML::XML::Dtd
6
+ *
7
+ * The XML::Dtd class is used to prepare DTD's for validation of xml
8
+ * documents.
9
+ *
10
+ * DTDs can be created from a string or a pair of public and system identifiers.
11
+ * Once a Dtd object is instantiated, an XML document can be validated by the
12
+ * XML::Document#validate method providing the XML::Dtd object as parameeter.
13
+ * The method will raise an exception if the document is
14
+ * not valid.
15
+ *
16
+ * Basic usage:
17
+ *
18
+ * # parse DTD
19
+ * dtd = XML::Dtd.new(<<EOF)
20
+ * <!ELEMENT root (item*) >
21
+ * <!ELEMENT item (#PCDATA) >
22
+ * EOF
23
+ *
24
+ * # parse xml document to be validated
25
+ * instance = XML::Document.file('instance.xml')
26
+ *
27
+ * # validate
28
+ * instance.validate(dtd)
29
+ */
30
+
31
+ VALUE cXMLDtd;
32
+
33
+ void rxml_dtd_free(xmlDtdPtr xdtd)
34
+ {
35
+ /* Clear our private pointer so that we won't reuse the
36
+ same, freed, Ruby wrapper object later.*/
37
+ rxml_unregister_dtd(xdtd);
38
+
39
+ if (xdtd->doc == NULL && xdtd->parent == NULL)
40
+ xmlFreeDtd(xdtd);
41
+ }
42
+
43
+ void rxml_dtd_mark(xmlDtdPtr xdtd)
44
+ {
45
+ VALUE doc = Qnil;
46
+
47
+ if (xdtd == NULL)
48
+ return;
49
+
50
+ doc = rxml_lookup_doc(xdtd->doc);
51
+ rb_gc_mark(doc);
52
+ }
53
+
54
+ static VALUE rxml_dtd_alloc(VALUE klass)
55
+ {
56
+ return Data_Wrap_Struct(klass, rxml_dtd_mark, rxml_dtd_free, NULL);
57
+ }
58
+
59
+ VALUE rxml_dtd_wrap(xmlDtdPtr xdtd)
60
+ {
61
+ VALUE result = rxml_lookup_dtd(xdtd);
62
+
63
+ // This node is already wrapped
64
+ if (result == Qnil) {
65
+ result = Data_Wrap_Struct(cXMLDtd, NULL, NULL, xdtd);
66
+ rxml_register_dtd(xdtd, result);
67
+ }
68
+ return result;
69
+ }
70
+
71
+ /*
72
+ * call-seq:
73
+ * dtd.external_id -> "string"
74
+ *
75
+ * Obtain this dtd's external identifer (for a PUBLIC DTD).
76
+ */
77
+ static VALUE rxml_dtd_external_id_get(VALUE self)
78
+ {
79
+ xmlDtdPtr xdtd;
80
+ Data_Get_Struct(self, xmlDtd, xdtd);
81
+
82
+
83
+ if (xdtd->ExternalID == NULL)
84
+ return (Qnil);
85
+ else
86
+ return (rxml_new_cstr( xdtd->ExternalID, NULL));
87
+ }
88
+
89
+ /*
90
+ * call-seq:
91
+ * dtd.name -> "string"
92
+ *
93
+ * Obtain this dtd's name.
94
+ */
95
+ static VALUE rxml_dtd_name_get(VALUE self)
96
+ {
97
+ xmlDtdPtr xdtd;
98
+ Data_Get_Struct(self, xmlDtd, xdtd);
99
+
100
+
101
+ if (xdtd->name == NULL)
102
+ return (Qnil);
103
+ else
104
+ return (rxml_new_cstr( xdtd->name, NULL));
105
+ }
106
+
107
+
108
+ /*
109
+ * call-seq:
110
+ * dtd.uri -> "string"
111
+ *
112
+ * Obtain this dtd's URI (for a SYSTEM or PUBLIC DTD).
113
+ */
114
+ static VALUE rxml_dtd_uri_get(VALUE self)
115
+ {
116
+ xmlDtdPtr xdtd;
117
+ Data_Get_Struct(self, xmlDtd, xdtd);
118
+
119
+ if (xdtd->SystemID == NULL)
120
+ return (Qnil);
121
+ else
122
+ return (rxml_new_cstr( xdtd->SystemID, NULL));
123
+ }
124
+
125
+ /*
126
+ * call-seq:
127
+ * node.type -> num
128
+ *
129
+ * Obtain this node's type identifier.
130
+ */
131
+ static VALUE rxml_dtd_type(VALUE self)
132
+ {
133
+ xmlDtdPtr xdtd;
134
+ Data_Get_Struct(self, xmlDtd, xdtd);
135
+ return (INT2NUM(xdtd->type));
136
+ }
137
+
138
+ /*
139
+ * call-seq:
140
+ * XML::Dtd.new("DTD string") -> dtd
141
+ * XML::Dtd.new("public", "system") -> dtd
142
+ * XML::Dtd.new("name", "public", "system", document) -> external subset dtd
143
+ * XML::Dtd.new("name", "public", "system", document, false) -> internal subset dtd
144
+ * XML::Dtd.new("name", "public", "system", document, true) -> internal subset dtd
145
+ *
146
+ * Create a new Dtd from the specified public and system
147
+ * identifiers.
148
+ */
149
+ static VALUE rxml_dtd_initialize(int argc, VALUE *argv, VALUE self)
150
+ {
151
+ VALUE external, system, dtd_string;
152
+ xmlParserInputBufferPtr buffer;
153
+ xmlCharEncoding enc = XML_CHAR_ENCODING_NONE;
154
+ xmlChar *new_string;
155
+ xmlDtdPtr xdtd;
156
+
157
+ // 1 argument -- string --> parsujeme jako dtd
158
+ // 2 arguments -- public, system --> bude se hledat
159
+ // 3 arguments -- public, system, name --> creates an external subset (any parameter may be nil)
160
+ // 4 arguments -- public, system, name, doc --> creates an external subset (any parameter may be nil)
161
+ // 5 arguments -- public, system, name, doc, true --> creates an internal subset (all but last parameter may be nil)
162
+ switch (argc)
163
+ {
164
+ case 3:
165
+ case 4:
166
+ case 5: {
167
+ VALUE name, doc, internal;
168
+ const xmlChar *xname = NULL, *xpublic = NULL, *xsystem = NULL;
169
+ xmlDocPtr xdoc = NULL;
170
+
171
+ rb_scan_args(argc, argv, "32", &external, &system, &name, &doc, &internal);
172
+
173
+ if (external != Qnil) {
174
+ Check_Type(external, T_STRING);
175
+ xpublic = (const xmlChar*) StringValuePtr(external);
176
+ }
177
+ if (system != Qnil) {
178
+ Check_Type(system, T_STRING);
179
+ xsystem = (const xmlChar*) StringValuePtr(system);
180
+ }
181
+ if (name != Qnil) {
182
+ Check_Type(name, T_STRING);
183
+ xname = (const xmlChar*) StringValuePtr(name);
184
+ }
185
+ if (doc != Qnil) {
186
+ if (rb_obj_is_kind_of(doc, cXMLDocument) == Qfalse)
187
+ rb_raise(rb_eTypeError, "Must pass an XML::Document object");
188
+ Data_Get_Struct(doc, xmlDoc, xdoc);
189
+ }
190
+
191
+ if (internal == Qnil || internal == Qfalse)
192
+ xdtd = xmlNewDtd(xdoc, xname, xpublic, xsystem);
193
+ else
194
+ xdtd = xmlCreateIntSubset(xdoc, xname, xpublic, xsystem);
195
+
196
+ if (xdtd == NULL)
197
+ rxml_raise(&xmlLastError);
198
+
199
+ /* Document will free this dtd now. */
200
+ RDATA(self)->dfree = NULL;
201
+ DATA_PTR(self) = xdtd;
202
+
203
+ xmlSetTreeDoc((xmlNodePtr) xdtd, xdoc);
204
+ }
205
+ break;
206
+
207
+ case 2:
208
+ rb_scan_args(argc, argv, "20", &external, &system);
209
+
210
+ Check_Type(external, T_STRING);
211
+ Check_Type(system, T_STRING);
212
+
213
+ xdtd = xmlParseDTD((xmlChar*) StringValuePtr(external),
214
+ (xmlChar*) StringValuePtr(system));
215
+
216
+ if (xdtd == NULL)
217
+ rxml_raise(&xmlLastError);
218
+
219
+ DATA_PTR(self) = xdtd;
220
+
221
+ xmlSetTreeDoc((xmlNodePtr) xdtd, NULL);
222
+ break;
223
+
224
+ case 1:
225
+ rb_scan_args(argc, argv, "10", &dtd_string);
226
+ Check_Type(dtd_string, T_STRING);
227
+
228
+ /* Note that buffer is freed by xmlParserInputBufferPush*/
229
+ buffer = xmlAllocParserInputBuffer(enc);
230
+ new_string = xmlStrdup((xmlChar*) StringValuePtr(dtd_string));
231
+ xmlParserInputBufferPush(buffer, xmlStrlen(new_string),
232
+ (const char*) new_string);
233
+
234
+ xdtd = xmlIOParseDTD(NULL, buffer, enc);
235
+
236
+ if (xdtd == NULL)
237
+ rxml_raise(&xmlLastError);
238
+
239
+ xmlFree(new_string);
240
+
241
+ DATA_PTR(self) = xdtd;
242
+ break;
243
+
244
+ default:
245
+ rb_raise(rb_eArgError, "wrong number of arguments");
246
+ }
247
+
248
+ return self;
249
+ }
250
+
251
+ void rxml_init_dtd()
252
+ {
253
+ cXMLDtd = rb_define_class_under(mXML, "Dtd", rb_cObject);
254
+ rb_define_alloc_func(cXMLDtd, rxml_dtd_alloc);
255
+ rb_define_method(cXMLDtd, "initialize", rxml_dtd_initialize, -1);
256
+ rb_define_method(cXMLDtd, "external_id", rxml_dtd_external_id_get, 0);
257
+ rb_define_method(cXMLDtd, "name", rxml_dtd_name_get, 0);
258
+ rb_define_method(cXMLDtd, "uri", rxml_dtd_uri_get, 0);
259
+ rb_define_method(cXMLDtd, "node_type", rxml_dtd_type, 0);
260
+ rb_define_alias(cXMLDtd, "system_id", "uri");
261
+ }