libxml-ruby 0.9.8-x86-mswin32-60 → 0.9.9-x86-mswin32-60
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +41 -1
- data/LICENSE +3 -4
- data/README +37 -24
- data/Rakefile +2 -2
- data/ext/libxml/extconf.rb +31 -12
- data/ext/libxml/libxml.c +56 -858
- data/ext/libxml/ruby_libxml.h +93 -96
- data/ext/libxml/ruby_xml.c +855 -0
- data/ext/libxml/ruby_xml.h +9 -0
- data/ext/libxml/ruby_xml_attr.c +3 -9
- data/ext/libxml/ruby_xml_attr.h +2 -2
- data/ext/libxml/ruby_xml_attr_decl.c +2 -8
- data/ext/libxml/ruby_xml_attr_decl.h +1 -1
- data/ext/libxml/ruby_xml_attributes.c +6 -8
- data/ext/libxml/ruby_xml_attributes.h +1 -1
- data/ext/libxml/ruby_xml_document.c +915 -895
- data/ext/libxml/ruby_xml_document.h +2 -2
- data/ext/libxml/ruby_xml_dtd.c +257 -136
- data/ext/libxml/ruby_xml_dtd.h +1 -1
- data/ext/libxml/ruby_xml_encoding.c +55 -37
- data/ext/libxml/ruby_xml_encoding.h +1 -1
- data/ext/libxml/ruby_xml_error.c +526 -1058
- data/ext/libxml/ruby_xml_error.h +1 -1
- data/ext/libxml/ruby_xml_html_parser.c +2 -8
- data/ext/libxml/ruby_xml_html_parser.h +2 -2
- data/ext/libxml/ruby_xml_html_parser_context.c +175 -145
- data/ext/libxml/ruby_xml_html_parser_context.h +1 -1
- data/ext/libxml/ruby_xml_html_parser_options.c +12 -20
- data/ext/libxml/ruby_xml_html_parser_options.h +1 -1
- data/ext/libxml/ruby_xml_input_cbg.c +2 -8
- data/ext/libxml/ruby_xml_input_cbg.h +1 -1
- data/ext/libxml/ruby_xml_namespace.c +2 -8
- data/ext/libxml/ruby_xml_namespace.h +2 -2
- data/ext/libxml/ruby_xml_namespaces.c +1 -9
- data/ext/libxml/ruby_xml_namespaces.h +1 -1
- data/ext/libxml/ruby_xml_node.c +182 -121
- data/ext/libxml/ruby_xml_node.h +2 -2
- data/ext/libxml/ruby_xml_parser.c +2 -8
- data/ext/libxml/ruby_xml_parser.h +2 -2
- data/ext/libxml/ruby_xml_parser_context.c +952 -901
- data/ext/libxml/ruby_xml_parser_context.h +2 -2
- data/ext/libxml/ruby_xml_parser_options.c +2 -9
- data/ext/libxml/ruby_xml_parser_options.h +1 -1
- data/ext/libxml/ruby_xml_reader.c +1002 -993
- data/ext/libxml/ruby_xml_reader.h +1 -1
- data/ext/libxml/ruby_xml_relaxng.c +1 -7
- data/ext/libxml/ruby_xml_relaxng.h +1 -1
- data/ext/libxml/ruby_xml_sax2_handler.c +2 -2
- data/ext/libxml/ruby_xml_sax2_handler.h +1 -1
- data/ext/libxml/ruby_xml_sax_parser.c +2 -8
- data/ext/libxml/ruby_xml_sax_parser.h +2 -2
- data/ext/libxml/ruby_xml_schema.c +1 -7
- data/ext/libxml/ruby_xml_schema.h +1 -1
- data/ext/libxml/{version.h → ruby_xml_version.h} +2 -2
- data/ext/libxml/ruby_xml_xinclude.c +2 -8
- data/ext/libxml/ruby_xml_xinclude.h +2 -2
- data/ext/libxml/ruby_xml_xpath.c +17 -18
- data/ext/libxml/ruby_xml_xpath.h +2 -2
- data/ext/libxml/ruby_xml_xpath_context.c +387 -389
- data/ext/libxml/ruby_xml_xpath_context.h +2 -2
- data/ext/libxml/ruby_xml_xpath_expression.c +18 -8
- data/ext/libxml/ruby_xml_xpath_expression.h +1 -1
- data/ext/libxml/ruby_xml_xpath_object.c +19 -8
- data/ext/libxml/ruby_xml_xpath_object.h +1 -1
- data/ext/libxml/ruby_xml_xpointer.c +2 -8
- data/ext/libxml/ruby_xml_xpointer.h +2 -2
- data/ext/mingw/libxml_ruby.dll.a +0 -0
- data/ext/mingw/libxml_ruby.so +0 -0
- data/ext/vc/libxml_ruby.sln +7 -1
- data/lib/libxml.rb +1 -12
- data/lib/libxml/attr.rb +0 -3
- data/lib/libxml/attr_decl.rb +0 -3
- data/lib/libxml/attributes.rb +0 -3
- data/lib/libxml/document.rb +31 -5
- data/lib/libxml/error.rb +8 -4
- data/lib/libxml/properties.rb +0 -5
- data/lib/libxml/sax_callbacks.rb +30 -19
- data/lib/libxml/tree.rb +0 -1
- data/lib/libxml/xpath_object.rb +0 -13
- data/test/model/definition.dtd +8 -0
- data/test/tc_attributes.rb +4 -1
- data/test/tc_document.rb +16 -0
- data/test/tc_dtd.rb +30 -2
- data/test/tc_html_parser.rb +55 -10
- data/test/tc_node.rb +67 -1
- data/test/tc_node_edit.rb +26 -6
- data/test/tc_node_text.rb +41 -23
- data/test/tc_parser.rb +50 -0
- data/test/tc_reader.rb +15 -0
- data/test/tc_relaxng.rb +1 -1
- data/test/tc_sax_parser.rb +37 -5
- data/test/tc_schema.rb +1 -1
- data/test/tc_xpath.rb +1 -0
- data/test/tc_xpath_expression.rb +4 -2
- metadata +6 -6
- data/ext/libxml/ruby_xml_state.c +0 -51
- data/ext/libxml/ruby_xml_state.h +0 -11
- data/ext/vc/libxml_ruby.vcproj +0 -460
@@ -1,4 +1,4 @@
|
|
1
|
-
/* $Id: ruby_xml_document.h
|
1
|
+
/* $Id: ruby_xml_document.h 758 2009-01-25 20:36:03Z cfis $ */
|
2
2
|
|
3
3
|
/* Please see the LICENSE file for copyright and distribution information */
|
4
4
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
extern VALUE cXMLDocument;
|
9
9
|
|
10
|
-
void
|
10
|
+
void rxml_init_document();
|
11
11
|
|
12
12
|
|
13
13
|
#if defined(_WIN32)
|
data/ext/libxml/ruby_xml_dtd.c
CHANGED
@@ -1,136 +1,257 @@
|
|
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
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
}
|
42
|
-
|
43
|
-
|
44
|
-
{
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
if (xdtd->_private
|
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
|
-
|
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
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
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
|
+
rb_warning("XmlNode is not bound! (%s:%d)", __FILE__, __LINE__);
|
51
|
+
return;
|
52
|
+
}
|
53
|
+
|
54
|
+
rxml_node_mark_common((xmlNodePtr) xdtd);
|
55
|
+
}
|
56
|
+
|
57
|
+
|
58
|
+
static VALUE rxml_dtd_alloc(VALUE klass)
|
59
|
+
{
|
60
|
+
return Data_Wrap_Struct(klass, rxml_dtd_mark, rxml_dtd_free, NULL);
|
61
|
+
}
|
62
|
+
|
63
|
+
VALUE rxml_dtd_wrap(xmlDtdPtr xdtd)
|
64
|
+
{
|
65
|
+
VALUE result;
|
66
|
+
|
67
|
+
// This node is already wrapped
|
68
|
+
if (xdtd->_private != NULL)
|
69
|
+
return (VALUE) xdtd->_private;
|
70
|
+
|
71
|
+
result = Data_Wrap_Struct(cXMLDtd, NULL, NULL, xdtd);
|
72
|
+
|
73
|
+
xdtd->_private = (void*) result;
|
74
|
+
|
75
|
+
return result;
|
76
|
+
}
|
77
|
+
|
78
|
+
/*
|
79
|
+
* call-seq:
|
80
|
+
* dtd.external_id -> "string"
|
81
|
+
*
|
82
|
+
* Obtain this dtd's external identifer (for a PUBLIC DTD).
|
83
|
+
*/
|
84
|
+
static VALUE rxml_dtd_external_id_get(VALUE self)
|
85
|
+
{
|
86
|
+
xmlDtdPtr xdtd;
|
87
|
+
Data_Get_Struct(self, xmlDtd, xdtd);
|
88
|
+
|
89
|
+
|
90
|
+
if (xdtd->ExternalID == NULL)
|
91
|
+
return (Qnil);
|
92
|
+
else
|
93
|
+
return (rb_str_new2((const char*) xdtd->ExternalID));
|
94
|
+
}
|
95
|
+
|
96
|
+
/*
|
97
|
+
* call-seq:
|
98
|
+
* dtd.name -> "string"
|
99
|
+
*
|
100
|
+
* Obtain this dtd's name.
|
101
|
+
*/
|
102
|
+
static VALUE rxml_dtd_name_get(VALUE self)
|
103
|
+
{
|
104
|
+
xmlDtdPtr xdtd;
|
105
|
+
Data_Get_Struct(self, xmlDtd, xdtd);
|
106
|
+
|
107
|
+
|
108
|
+
if (xdtd->name == NULL)
|
109
|
+
return (Qnil);
|
110
|
+
else
|
111
|
+
return (rb_str_new2((const char*) xdtd->name));
|
112
|
+
}
|
113
|
+
|
114
|
+
|
115
|
+
/*
|
116
|
+
* call-seq:
|
117
|
+
* dtd.uri -> "string"
|
118
|
+
*
|
119
|
+
* Obtain this dtd's URI (for a SYSTEM or PUBLIC DTD).
|
120
|
+
*/
|
121
|
+
static VALUE rxml_dtd_uri_get(VALUE self)
|
122
|
+
{
|
123
|
+
xmlDtdPtr xdtd;
|
124
|
+
Data_Get_Struct(self, xmlDtd, xdtd);
|
125
|
+
|
126
|
+
|
127
|
+
if (xdtd->SystemID == NULL)
|
128
|
+
return (Qnil);
|
129
|
+
else
|
130
|
+
return (rb_str_new2((const char*) xdtd->SystemID));
|
131
|
+
}
|
132
|
+
|
133
|
+
/*
|
134
|
+
* call-seq:
|
135
|
+
* XML::Dtd.new("DTD string") -> dtd
|
136
|
+
* XML::Dtd.new("public", "system") -> dtd
|
137
|
+
* XML::Dtd.new("name", "public", "system", document) -> external subset dtd
|
138
|
+
* XML::Dtd.new("name", "public", "system", document, false) -> internal subset dtd
|
139
|
+
* XML::Dtd.new("name", "public", "system", document, true) -> internal subset dtd
|
140
|
+
*
|
141
|
+
* Create a new Dtd from the specified public and system
|
142
|
+
* identifiers.
|
143
|
+
*/
|
144
|
+
static VALUE rxml_dtd_initialize(int argc, VALUE *argv, VALUE self)
|
145
|
+
{
|
146
|
+
VALUE external, system, dtd_string;
|
147
|
+
xmlParserInputBufferPtr buffer;
|
148
|
+
xmlCharEncoding enc = XML_CHAR_ENCODING_NONE;
|
149
|
+
xmlChar *new_string;
|
150
|
+
xmlDtdPtr xdtd;
|
151
|
+
|
152
|
+
// 1 argument -- string --> parsujeme jako dtd
|
153
|
+
// 2 arguments -- public, system --> bude se hledat
|
154
|
+
// 3 arguments -- public, system, name --> creates an external subset (any parameter may be nil)
|
155
|
+
// 4 arguments -- public, system, name, doc --> creates an external subset (any parameter may be nil)
|
156
|
+
// 5 arguments -- public, system, name, doc, true --> creates an internal subset (all but last parameter may be nil)
|
157
|
+
switch (argc)
|
158
|
+
{
|
159
|
+
case 3:
|
160
|
+
case 4:
|
161
|
+
case 5: {
|
162
|
+
VALUE name, doc, internal;
|
163
|
+
const xmlChar *xname = NULL, *xpublic = NULL, *xsystem = NULL;
|
164
|
+
xmlDocPtr xdoc = NULL;
|
165
|
+
|
166
|
+
rb_scan_args(argc, argv, "32", &external, &system, &name, &doc, &internal);
|
167
|
+
|
168
|
+
if (external != Qnil) {
|
169
|
+
Check_Type(external, T_STRING);
|
170
|
+
xpublic = (const xmlChar*) StringValuePtr(external);
|
171
|
+
}
|
172
|
+
if (system != Qnil) {
|
173
|
+
Check_Type(system, T_STRING);
|
174
|
+
xsystem = (const xmlChar*) StringValuePtr(system);
|
175
|
+
}
|
176
|
+
if (name != Qnil) {
|
177
|
+
Check_Type(name, T_STRING);
|
178
|
+
xname = (const xmlChar*) StringValuePtr(name);
|
179
|
+
}
|
180
|
+
if (doc != Qnil) {
|
181
|
+
if (rb_obj_is_kind_of(doc, cXMLDocument) == Qfalse)
|
182
|
+
rb_raise(rb_eTypeError, "Must pass an XML::Document object");
|
183
|
+
Data_Get_Struct(doc, xmlDoc, xdoc);
|
184
|
+
}
|
185
|
+
|
186
|
+
if (internal == Qnil || internal == Qfalse)
|
187
|
+
xdtd = xmlNewDtd(xdoc, xname, xpublic, xsystem);
|
188
|
+
else
|
189
|
+
xdtd = xmlCreateIntSubset(xdoc, xname, xpublic, xsystem);
|
190
|
+
|
191
|
+
if (xdtd == NULL)
|
192
|
+
rxml_raise(&xmlLastError);
|
193
|
+
|
194
|
+
/* Document will free this dtd now. */
|
195
|
+
RDATA(self)->dfree = NULL;
|
196
|
+
DATA_PTR(self) = xdtd;
|
197
|
+
|
198
|
+
xmlSetTreeDoc((xmlNodePtr) xdtd, xdoc);
|
199
|
+
}
|
200
|
+
break;
|
201
|
+
|
202
|
+
case 2:
|
203
|
+
rb_scan_args(argc, argv, "20", &external, &system);
|
204
|
+
|
205
|
+
Check_Type(external, T_STRING);
|
206
|
+
Check_Type(system, T_STRING);
|
207
|
+
|
208
|
+
xdtd = xmlParseDTD((xmlChar*) StringValuePtr(external),
|
209
|
+
(xmlChar*) StringValuePtr(system));
|
210
|
+
|
211
|
+
if (xdtd == NULL)
|
212
|
+
rxml_raise(&xmlLastError);
|
213
|
+
|
214
|
+
DATA_PTR(self) = xdtd;
|
215
|
+
|
216
|
+
xmlSetTreeDoc((xmlNodePtr) xdtd, NULL);
|
217
|
+
break;
|
218
|
+
|
219
|
+
case 1:
|
220
|
+
rb_scan_args(argc, argv, "10", &dtd_string);
|
221
|
+
Check_Type(dtd_string, T_STRING);
|
222
|
+
|
223
|
+
/* Note that buffer is freed by xmlParserInputBufferPush*/
|
224
|
+
buffer = xmlAllocParserInputBuffer(enc);
|
225
|
+
new_string = xmlStrdup((xmlChar*) StringValuePtr(dtd_string));
|
226
|
+
xmlParserInputBufferPush(buffer, xmlStrlen(new_string),
|
227
|
+
(const char*) new_string);
|
228
|
+
|
229
|
+
xdtd = xmlIOParseDTD(NULL, buffer, enc);
|
230
|
+
|
231
|
+
if (xdtd == NULL)
|
232
|
+
rxml_raise(&xmlLastError);
|
233
|
+
|
234
|
+
xmlFree(new_string);
|
235
|
+
|
236
|
+
DATA_PTR(self) = xdtd;
|
237
|
+
break;
|
238
|
+
|
239
|
+
default:
|
240
|
+
rb_raise(rb_eArgError, "wrong number of arguments");
|
241
|
+
}
|
242
|
+
|
243
|
+
return self;
|
244
|
+
}
|
245
|
+
|
246
|
+
void rxml_init_dtd()
|
247
|
+
{
|
248
|
+
cXMLDtd = rb_define_class_under(mXML, "Dtd", rb_cObject);
|
249
|
+
rb_define_alloc_func(cXMLDtd, rxml_dtd_alloc);
|
250
|
+
rb_define_method(cXMLDtd, "initialize", rxml_dtd_initialize, -1);
|
251
|
+
rb_define_method(cXMLDtd, "external_id", rxml_dtd_external_id_get, 0);
|
252
|
+
rb_define_method(cXMLDtd, "name", rxml_dtd_name_get, 0);
|
253
|
+
rb_define_method(cXMLDtd, "uri", rxml_dtd_uri_get, 0);
|
254
|
+
|
255
|
+
rb_define_alias(cXMLDtd, "system_id", "uri");
|
256
|
+
}
|
257
|
+
|
data/ext/libxml/ruby_xml_dtd.h
CHANGED
@@ -8,13 +8,14 @@
|
|
8
8
|
/*
|
9
9
|
* Document-class: LibXML::XML::Encoding
|
10
10
|
*
|
11
|
-
* The encoding class
|
12
|
-
* supports
|
13
|
-
* internally before processing them.
|
11
|
+
* The encoding class exposes the encodings that libxml
|
12
|
+
* supports via constants.
|
14
13
|
*
|
15
|
-
*
|
14
|
+
* LibXML converts all data sources to UTF8
|
15
|
+
* internally before processing them. By default,
|
16
|
+
* LibXML determines a data source's encoding
|
16
17
|
* using the algorithm described on its
|
17
|
-
* website[
|
18
|
+
* website[http://xmlsoft.org/encoding.html].
|
18
19
|
*
|
19
20
|
* However, you may override a data source's encoding
|
20
21
|
* by using the encoding constants defined in this
|
@@ -76,41 +77,58 @@ static VALUE rxml_encoding_to_s(VALUE klass, VALUE encoding)
|
|
76
77
|
return rb_str_new2(xecoding);
|
77
78
|
}
|
78
79
|
|
79
|
-
|
80
|
-
#ifdef RDOC_NEVER_DEFINED
|
81
|
-
mLibXML = rb_define_module("LibXML");
|
82
|
-
mXML = rb_define_module_under(mLibXML, "XML");
|
83
|
-
#endif
|
84
|
-
|
85
|
-
void ruby_init_xml_encoding(void)
|
80
|
+
void rxml_init_encoding(void)
|
86
81
|
{
|
87
82
|
mXMLEncoding = rb_define_module_under(mXML, "Encoding");
|
88
83
|
rb_define_module_function(mXMLEncoding, "from_s", rxml_encoding_from_s, 1);
|
89
84
|
rb_define_module_function(mXMLEncoding, "to_s", rxml_encoding_to_s, 1);
|
90
85
|
|
91
|
-
|
92
|
-
rb_define_const(mXMLEncoding, "ERROR", INT2NUM(XML_CHAR_ENCODING_ERROR));
|
93
|
-
|
94
|
-
rb_define_const(mXMLEncoding, "
|
95
|
-
|
96
|
-
rb_define_const(mXMLEncoding, "
|
97
|
-
|
98
|
-
rb_define_const(mXMLEncoding, "
|
99
|
-
|
100
|
-
rb_define_const(mXMLEncoding, "
|
101
|
-
|
102
|
-
rb_define_const(mXMLEncoding, "
|
103
|
-
|
104
|
-
rb_define_const(mXMLEncoding, "
|
105
|
-
|
106
|
-
rb_define_const(mXMLEncoding, "
|
107
|
-
|
108
|
-
rb_define_const(mXMLEncoding, "
|
109
|
-
|
110
|
-
rb_define_const(mXMLEncoding, "
|
111
|
-
|
112
|
-
rb_define_const(mXMLEncoding, "
|
113
|
-
|
114
|
-
rb_define_const(mXMLEncoding, "
|
115
|
-
|
86
|
+
/* -1: No char encoding detected. */
|
87
|
+
rb_define_const(mXMLEncoding, "ERROR", INT2NUM(XML_CHAR_ENCODING_ERROR));
|
88
|
+
/* 0: No char encoding detected. */
|
89
|
+
rb_define_const(mXMLEncoding, "NONE", INT2NUM(XML_CHAR_ENCODING_NONE));
|
90
|
+
/* 1: UTF-8 */
|
91
|
+
rb_define_const(mXMLEncoding, "UTF_8", INT2NUM(XML_CHAR_ENCODING_UTF8));
|
92
|
+
/* 2: UTF-16 little endian. */
|
93
|
+
rb_define_const(mXMLEncoding, "UTF_16LE", INT2NUM(XML_CHAR_ENCODING_UTF16LE));
|
94
|
+
/* 3: UTF-16 big endian. */
|
95
|
+
rb_define_const(mXMLEncoding, "UTF_16BE", INT2NUM(XML_CHAR_ENCODING_UTF16BE));
|
96
|
+
/* 4: UCS-4 little endian. */
|
97
|
+
rb_define_const(mXMLEncoding, "UCS_4LE", INT2NUM(XML_CHAR_ENCODING_UCS4LE));
|
98
|
+
/* 5: UCS-4 big endian. */
|
99
|
+
rb_define_const(mXMLEncoding, "UCS_4BE", INT2NUM(XML_CHAR_ENCODING_UCS4BE));
|
100
|
+
/* 6: EBCDIC uh! */
|
101
|
+
rb_define_const(mXMLEncoding, "EBCDIC", INT2NUM(XML_CHAR_ENCODING_EBCDIC));
|
102
|
+
/* 7: UCS-4 unusual ordering. */
|
103
|
+
rb_define_const(mXMLEncoding, "UCS_4_2143", INT2NUM(XML_CHAR_ENCODING_UCS4_2143));
|
104
|
+
/* 8: UCS-4 unusual ordering. */
|
105
|
+
rb_define_const(mXMLEncoding, "UCS_4_3412", INT2NUM(XML_CHAR_ENCODING_UCS4_3412));
|
106
|
+
/* 9: UCS-2. */
|
107
|
+
rb_define_const(mXMLEncoding, "UCS_2", INT2NUM(XML_CHAR_ENCODING_UCS2));
|
108
|
+
/* 10: ISO-8859-1 ISO Latin 1. */
|
109
|
+
rb_define_const(mXMLEncoding, "ISO_8859_1", INT2NUM(XML_CHAR_ENCODING_8859_1));
|
110
|
+
/* 11: ISO-8859-2 ISO Latin 2. */
|
111
|
+
rb_define_const(mXMLEncoding, "ISO_8859_2", INT2NUM(XML_CHAR_ENCODING_8859_2));
|
112
|
+
/* 12: ISO-8859-3. */
|
113
|
+
rb_define_const(mXMLEncoding, "ISO_8859_3", INT2NUM(XML_CHAR_ENCODING_8859_3));
|
114
|
+
/* 13: ISO-8859-4. */
|
115
|
+
rb_define_const(mXMLEncoding, "ISO_8859_4", INT2NUM(XML_CHAR_ENCODING_8859_4));
|
116
|
+
/* 14: ISO-8859-5. */
|
117
|
+
rb_define_const(mXMLEncoding, "ISO_8859_5", INT2NUM(XML_CHAR_ENCODING_8859_5));
|
118
|
+
/* 15: ISO-8859-6. */
|
119
|
+
rb_define_const(mXMLEncoding, "ISO_8859_6", INT2NUM(XML_CHAR_ENCODING_8859_6));
|
120
|
+
/* 16: ISO-8859-7. */
|
121
|
+
rb_define_const(mXMLEncoding, "ISO_8859_7", INT2NUM(XML_CHAR_ENCODING_8859_7));
|
122
|
+
/* 17: ISO-8859-8. */
|
123
|
+
rb_define_const(mXMLEncoding, "ISO_8859_8", INT2NUM(XML_CHAR_ENCODING_8859_8));
|
124
|
+
/* 18: ISO-8859-9. */
|
125
|
+
rb_define_const(mXMLEncoding, "ISO_8859_9", INT2NUM(XML_CHAR_ENCODING_8859_9));
|
126
|
+
/* 19: ISO-2022-JP. */
|
127
|
+
rb_define_const(mXMLEncoding, "ISO_2022_JP", INT2NUM(XML_CHAR_ENCODING_2022_JP));
|
128
|
+
/* 20: Shift_JIS. */
|
129
|
+
rb_define_const(mXMLEncoding, "SHIFT_JIS", INT2NUM(XML_CHAR_ENCODING_SHIFT_JIS));
|
130
|
+
/* 21: EUC-JP. */
|
131
|
+
rb_define_const(mXMLEncoding, "EUC_JP", INT2NUM(XML_CHAR_ENCODING_EUC_JP));
|
132
|
+
/* 22: pure ASCII. */
|
133
|
+
rb_define_const(mXMLEncoding, "ASCII", INT2NUM(XML_CHAR_ENCODING_ASCII));
|
116
134
|
}
|