libxml-ruby 0.5.4 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +23 -23
- data/README +144 -144
- data/ext/libxml/extconf.rb +26 -27
- data/ext/libxml/libxml.c +7 -37
- data/ext/libxml/{libxml.h → ruby_libxml.h} +93 -98
- data/ext/libxml/ruby_xml_attr.c +405 -387
- data/ext/libxml/ruby_xml_attr.h +19 -18
- data/ext/libxml/ruby_xml_document.c +1111 -1115
- data/ext/libxml/ruby_xml_document.h +27 -24
- data/ext/libxml/ruby_xml_dtd.c +168 -168
- data/ext/libxml/ruby_xml_html_parser.c +449 -450
- data/ext/libxml/ruby_xml_html_parser.h +1 -1
- data/ext/libxml/ruby_xml_input_cbg.c +158 -158
- data/ext/libxml/ruby_xml_node.c +2410 -2395
- data/ext/libxml/ruby_xml_node.h +1 -1
- data/ext/libxml/ruby_xml_node_set.c +170 -170
- data/ext/libxml/ruby_xml_node_set.h +1 -1
- data/ext/libxml/ruby_xml_ns.c +153 -153
- data/ext/libxml/ruby_xml_ns.h +1 -1
- data/ext/libxml/ruby_xml_parser.c +1425 -1422
- data/ext/libxml/ruby_xml_parser.h +1 -1
- data/ext/libxml/ruby_xml_parser_context.c +750 -716
- data/ext/libxml/ruby_xml_parser_context.h +1 -1
- data/ext/libxml/ruby_xml_reader.c +900 -896
- data/ext/libxml/ruby_xml_sax_parser.c +485 -485
- data/ext/libxml/ruby_xml_sax_parser.h +1 -1
- data/ext/libxml/ruby_xml_schema.c +146 -142
- data/ext/libxml/ruby_xml_state.c +5 -6
- data/ext/libxml/ruby_xml_state.h +1 -0
- data/ext/libxml/ruby_xml_tree.c +43 -43
- data/ext/libxml/ruby_xml_tree.h +1 -1
- data/ext/libxml/ruby_xml_xinclude.c +20 -20
- data/ext/libxml/ruby_xml_xinclude.h +1 -1
- data/ext/libxml/ruby_xml_xpath.c +243 -252
- data/ext/libxml/ruby_xml_xpath.h +1 -1
- data/ext/libxml/ruby_xml_xpath_context.c +118 -118
- data/ext/libxml/ruby_xml_xpath_context.h +1 -1
- data/ext/libxml/ruby_xml_xpath_object.c +43 -29
- data/ext/libxml/ruby_xml_xpath_object.h +0 -1
- data/ext/libxml/ruby_xml_xpointer.c +100 -100
- data/ext/libxml/ruby_xml_xpointer.h +1 -1
- data/ext/libxml/ruby_xml_xpointer_context.c +21 -21
- data/ext/libxml/ruby_xml_xpointer_context.h +1 -1
- data/ext/libxml/sax_parser_callbacks.inc +213 -213
- data/ext/libxml/version.h +9 -9
- data/lib/libxml.rb +24 -3
- data/mingw/libiconv-2.dll +0 -0
- data/mingw/libxml2-2.dll +0 -0
- data/mingw/libxml_ruby.so +0 -0
- data/mingw/mingw.rake +36 -0
- data/test/dtd-test.rb +24 -24
- data/test/etc_doc_to_s.rb +1 -3
- data/test/ets_copy_bug.rb +21 -21
- data/test/ets_copy_bug2.rb +32 -32
- data/test/ets_copy_bug3.rb +38 -0
- data/test/ets_doc_file.rb +1 -0
- data/test/{model/default_validation_bug.rb → gc.log} +0 -0
- data/test/merge_bug.rb +55 -55
- data/test/schema-test.rb +74 -74
- data/test/tc_well_formed.rb +11 -0
- data/test/tc_xml_document.rb +52 -52
- data/test/tc_xml_document_write.rb +24 -24
- data/test/tc_xml_document_write2.rb +54 -54
- data/test/tc_xml_document_write3.rb +96 -96
- data/test/tc_xml_html_parser.rb +63 -63
- data/test/tc_xml_node.rb +59 -59
- data/test/tc_xml_node2.rb +25 -25
- data/test/tc_xml_node3.rb +27 -27
- data/test/tc_xml_node4.rb +86 -86
- data/test/tc_xml_node5.rb +52 -52
- data/test/tc_xml_node6.rb +27 -27
- data/test/tc_xml_node7.rb +35 -35
- data/test/tc_xml_node8.rb +32 -32
- data/test/tc_xml_node9.rb +32 -32
- data/test/tc_xml_node_set.rb +24 -24
- data/test/tc_xml_node_set2.rb +37 -37
- data/test/tc_xml_node_xlink.rb +28 -28
- data/test/tc_xml_parser.rb +190 -178
- data/test/tc_xml_parser2.rb +16 -17
- data/test/tc_xml_parser3.rb +23 -23
- data/test/tc_xml_parser4.rb +33 -33
- data/test/tc_xml_parser5.rb +27 -27
- data/test/tc_xml_parser6.rb +23 -23
- data/test/tc_xml_parser7.rb +28 -28
- data/test/tc_xml_parser8.rb +32 -32
- data/test/tc_xml_parser9.rb +11 -0
- data/test/tc_xml_parser_context.rb +88 -88
- data/test/tc_xml_reader.rb +112 -109
- data/test/tc_xml_sax_parser.rb +104 -94
- data/test/tc_xml_sax_parser2.rb +51 -0
- data/test/tc_xml_xinclude.rb +30 -30
- data/test/tc_xml_xpath.rb +38 -38
- data/test/tc_xml_xpath2.rb +14 -0
- data/test/tc_xml_xpointer.rb +78 -78
- data/vc/libxml.sln +20 -0
- data/vc/libxml.vcproj +389 -0
- data/work/Rakefile +247 -0
- data/work/task/make +26 -0
- data/work/task/memory +37 -0
- data/work/task/rdoc +39 -0
- data/work/task/setup +1616 -0
- data/work/task/test +29 -0
- data/work/test/ets_runner.rb +33 -0
- data/work/test/libxml_test.rb +3 -0
- data/work/test/runner.rb +0 -0
- data/work/test/runner_ets.rb +33 -0
- data/work/vc/debug/libxml.exp +0 -0
- data/work/vc/debug/libxml.ilk +0 -0
- data/work/vc/debug/libxml.lib +0 -0
- data/work/vc/debug/libxml.pdb +0 -0
- data/work/vc/debug/libxml.so +0 -0
- metadata +158 -189
- data/MANIFEST +0 -138
- data/NOTES +0 -9
- data/Rakefile +0 -38
- data/TODO +0 -75
- data/VERSION +0 -1
- data/log/Changelog-0.txt +0 -426
- data/log/Changelog.txt +0 -435
- data/meta/project.yaml +0 -27
- data/meta/unixname +0 -1
- data/setup.rb +0 -1472
- data/site/css/normal.css +0 -182
- data/site/img/raze-tiny.png +0 -0
- data/site/img/red-cube.jpg +0 -0
- data/site/img/xml-ruby.png +0 -0
- data/site/index.xml +0 -43
- data/site/install.xml +0 -77
- data/site/layout.rhtml +0 -38
- data/site/layout.xsl +0 -67
- data/site/license.xml +0 -32
- data/site/log/changelog.xml +0 -1324
- data/site/log/changelog.xsl +0 -42
- data/test/model/merge_bug_data.xml +0 -58
- data/test/model/rubynet.xml +0 -78
- data/test/model/rubynet_project +0 -13
- data/test/model/saxtest.xml +0 -5
- data/test/model/simple.xml +0 -7
- data/test/model/xinclude.xml +0 -5
@@ -1,142 +1,146 @@
|
|
1
|
-
#include "
|
2
|
-
#include "ruby_xml_schema.h"
|
3
|
-
|
4
|
-
VALUE cXMLSchema;
|
5
|
-
|
6
|
-
static void
|
7
|
-
ruby_xml_schema_mark(ruby_xml_schema *rxschema) {
|
8
|
-
return;
|
9
|
-
}
|
10
|
-
|
11
|
-
void
|
12
|
-
ruby_xml_schema_free(ruby_xml_schema *rxschema) {
|
13
|
-
if (rxschema->schema != NULL) {
|
14
|
-
xmlSchemaFree(rxschema->schema);
|
15
|
-
rxschema->schema = NULL;
|
16
|
-
}
|
17
|
-
|
18
|
-
|
19
|
-
}
|
20
|
-
|
21
|
-
/*
|
22
|
-
* call-seq:
|
23
|
-
* XML::Schema.new(schema_uri) => schema
|
24
|
-
*
|
25
|
-
* Create a new schema from the specified URI.
|
26
|
-
*/
|
27
|
-
VALUE
|
28
|
-
ruby_xml_schema_init_from_uri(int argc, VALUE *argv, VALUE class) {
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
-
|
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
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
1
|
+
#include "ruby_libxml.h"
|
2
|
+
#include "ruby_xml_schema.h"
|
3
|
+
|
4
|
+
VALUE cXMLSchema;
|
5
|
+
|
6
|
+
static void
|
7
|
+
ruby_xml_schema_mark(ruby_xml_schema *rxschema) {
|
8
|
+
return;
|
9
|
+
}
|
10
|
+
|
11
|
+
void
|
12
|
+
ruby_xml_schema_free(ruby_xml_schema *rxschema) {
|
13
|
+
if (rxschema->schema != NULL) {
|
14
|
+
xmlSchemaFree(rxschema->schema);
|
15
|
+
rxschema->schema = NULL;
|
16
|
+
}
|
17
|
+
|
18
|
+
ruby_xfree(rxschema);
|
19
|
+
}
|
20
|
+
|
21
|
+
/*
|
22
|
+
* call-seq:
|
23
|
+
* XML::Schema.new(schema_uri) => schema
|
24
|
+
*
|
25
|
+
* Create a new schema from the specified URI.
|
26
|
+
*/
|
27
|
+
VALUE
|
28
|
+
ruby_xml_schema_init_from_uri(int argc, VALUE *argv, VALUE class) {
|
29
|
+
xmlSchemaParserCtxtPtr parser;
|
30
|
+
ruby_xml_schema *schema;
|
31
|
+
|
32
|
+
VALUE uri;
|
33
|
+
VALUE result = Qnil;
|
34
|
+
|
35
|
+
switch (argc) {
|
36
|
+
case 1:
|
37
|
+
rb_scan_args(argc, argv, "10", &uri);
|
38
|
+
Check_Type(uri, T_STRING);
|
39
|
+
|
40
|
+
parser = xmlSchemaNewParserCtxt(StringValuePtr(uri));
|
41
|
+
schema = ALLOC(ruby_xml_schema);
|
42
|
+
schema->schema = xmlSchemaParse(parser);
|
43
|
+
xmlSchemaFreeParserCtxt(parser);
|
44
|
+
|
45
|
+
result = Data_Wrap_Struct(cXMLSchema, ruby_xml_schema_mark, ruby_xml_schema_free, schema);
|
46
|
+
break;
|
47
|
+
default:
|
48
|
+
rb_raise(rb_eArgError, "wrong number of arguments (need 1)");
|
49
|
+
}
|
50
|
+
return(result);
|
51
|
+
}
|
52
|
+
|
53
|
+
/*
|
54
|
+
* call-seq:
|
55
|
+
* XML::Schema.from_string("schema_data") => "value"
|
56
|
+
*
|
57
|
+
* Create a new schema using the specified string.
|
58
|
+
*/
|
59
|
+
VALUE
|
60
|
+
ruby_xml_schema_init_from_str(int argc, VALUE *argv, VALUE class) {
|
61
|
+
VALUE schema_str;
|
62
|
+
|
63
|
+
xmlSchemaParserCtxtPtr parser;
|
64
|
+
//xmlSchemaPtr sptr;
|
65
|
+
ruby_xml_schema *rxschema;
|
66
|
+
|
67
|
+
switch (argc) {
|
68
|
+
case 1:
|
69
|
+
rb_scan_args(argc, argv, "10", &schema_str);
|
70
|
+
|
71
|
+
Check_Type(schema_str, T_STRING);
|
72
|
+
|
73
|
+
parser = xmlSchemaNewMemParserCtxt(StringValuePtr(schema_str), strlen(StringValuePtr(schema_str)));
|
74
|
+
rxschema = ALLOC(ruby_xml_schema);
|
75
|
+
rxschema->schema = xmlSchemaParse(parser);
|
76
|
+
xmlSchemaFreeParserCtxt(parser);
|
77
|
+
|
78
|
+
return( Data_Wrap_Struct(cXMLSchema, ruby_xml_schema_mark, ruby_xml_schema_free, rxschema) );
|
79
|
+
default:
|
80
|
+
rb_raise(rb_eArgError, "wrong number of arguments (need 1)");
|
81
|
+
}
|
82
|
+
return Qnil;
|
83
|
+
}
|
84
|
+
|
85
|
+
/* TODO what is this patch doing here?
|
86
|
+
|
87
|
+
xmlSchemaParserCtxtPtr parser;
|
88
|
+
xmlSchemaPtr sptr;
|
89
|
+
xmlSchemaValidCtxtPtr vptr;
|
90
|
+
+ int is_invalid;
|
91
|
+
|
92
|
+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &source) == FAILURE) {
|
93
|
+
return;
|
94
|
+
@@ -598,26 +598,24 @@
|
95
|
+
convert_to_string_ex(&source);
|
96
|
+
parser = xmlSchemaNewParserCtxt(Z_STRVAL_P(source));
|
97
|
+
sptr = xmlSchemaParse(parser);
|
98
|
+
break;
|
99
|
+
case SCHEMA_BLOB:
|
100
|
+
convert_to_string_ex(&source);
|
101
|
+
parser = xmlSchemaNewMemParserCtxt(Z_STRVAL_P(source), Z_STRLEN_P(source));
|
102
|
+
sptr = xmlSchemaParse(parser);
|
103
|
+
break;
|
104
|
+
}
|
105
|
+
|
106
|
+
vptr = xmlSchemaNewValidCtxt(sptr);
|
107
|
+
+ is_invalid = xmlSchemaValidateDoc(vptr, (xmlDocPtr) sxe->document->ptr);
|
108
|
+
xmlSchemaFree(sptr);
|
109
|
+
xmlSchemaFreeValidCtxt(vptr);
|
110
|
+
xmlSchemaFreeParserCtxt(parser);
|
111
|
+
|
112
|
+
- if (is_valid) {
|
113
|
+
- RETURN_TRUE;
|
114
|
+
- } else {
|
115
|
+
+ if (is_invalid) {
|
116
|
+
RETURN_FALSE;
|
117
|
+
+ } else {
|
118
|
+
+ RETURN_TRUE;
|
119
|
+
}
|
120
|
+
}
|
121
|
+
}}}
|
122
|
+
@@ -695,7 +693,7 @@
|
123
|
+
{
|
124
|
+
if (!strcmp(method, "xsearch")) {
|
125
|
+
simplexml_ce_xpath_search(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
126
|
+
-#ifdef xmlSchemaParserCtxtPtr
|
127
|
+
+#ifdef LIBXML_SCHEMAS_ENABLED
|
128
|
+
} else if (!strcmp(method, "validate_schema_file")) {
|
129
|
+
simplexml_ce_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, SCHEMA_FILE);
|
130
|
+
} else if (!strcmp(method, "validate_schema_buffer")) {
|
131
|
+
*/
|
132
|
+
|
133
|
+
void ruby_schema_free(ruby_xml_schema *rxs) {
|
134
|
+
}
|
135
|
+
|
136
|
+
// Rdoc needs to know
|
137
|
+
#ifdef RDOC_NEVER_DEFINED
|
138
|
+
mXML = rb_define_module("XML");
|
139
|
+
#endif
|
140
|
+
|
141
|
+
void ruby_init_xml_schema(void) {
|
142
|
+
cXMLSchema = rb_define_class_under(mXML, "Schema", rb_cObject);
|
143
|
+
rb_define_singleton_method(cXMLSchema, "new", ruby_xml_schema_init_from_uri, -1);
|
144
|
+
rb_define_singleton_method(cXMLSchema, "from_string", ruby_xml_schema_init_from_str, -1);
|
145
|
+
}
|
146
|
+
|
data/ext/libxml/ruby_xml_state.c
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* $Id$ */
|
2
2
|
|
3
|
-
#include "
|
3
|
+
#include "ruby_libxml.h"
|
4
4
|
|
5
5
|
VALUE cXMLState;
|
6
6
|
static VALUE weak_holder;
|
@@ -14,7 +14,7 @@ void
|
|
14
14
|
ruby_xml_state_free(int * dummy) {
|
15
15
|
if ( dummy==NULL ) return;
|
16
16
|
xmlCleanupParser();
|
17
|
-
|
17
|
+
ruby_xfree(dummy);
|
18
18
|
dummy=NULL;
|
19
19
|
weak_holder=Qnil;
|
20
20
|
rb_ivar_set(cXMLState,id_state,Qnil);
|
@@ -57,10 +57,9 @@ ruby_xml_state_object() {
|
|
57
57
|
|
58
58
|
VALUE
|
59
59
|
ruby_xml_state_object_find_aux(VALUE id) {
|
60
|
-
rb_funcall(rb_const_get(rb_cModule,rb_intern("ObjectSpace")),
|
61
|
-
|
62
|
-
|
63
|
-
id);
|
60
|
+
return rb_funcall(rb_const_get(rb_cModule,rb_intern("ObjectSpace")),
|
61
|
+
rb_intern("_id2ref"),
|
62
|
+
1, id);
|
64
63
|
}
|
65
64
|
|
66
65
|
|
data/ext/libxml/ruby_xml_state.h
CHANGED
data/ext/libxml/ruby_xml_tree.c
CHANGED
@@ -1,43 +1,43 @@
|
|
1
|
-
/* $Id: ruby_xml_tree.c
|
2
|
-
|
3
|
-
/* Please see the LICENSE file for copyright and distribution information */
|
4
|
-
|
5
|
-
#include "
|
6
|
-
#include "ruby_xml_tree.h"
|
7
|
-
|
8
|
-
VALUE cXMLTree;
|
9
|
-
|
10
|
-
// Rdoc needs to know
|
11
|
-
#ifdef RDOC_NEVER_DEFINED
|
12
|
-
mXML = rb_define_module("XML");
|
13
|
-
#endif
|
14
|
-
|
15
|
-
void
|
16
|
-
ruby_init_xml_tree(void) {
|
17
|
-
cXMLTree = rb_define_class_under(mXML, "Tree", rb_cObject);
|
18
|
-
|
19
|
-
rb_define_const(cXMLTree, "ELEMENT_NODE", INT2FIX(XML_ELEMENT_NODE));
|
20
|
-
rb_define_const(cXMLTree, "ATTRIBUTE_NODE", INT2FIX(XML_ATTRIBUTE_NODE));
|
21
|
-
rb_define_const(cXMLTree, "TEXT_NODE", INT2FIX(XML_TEXT_NODE));
|
22
|
-
rb_define_const(cXMLTree, "CDATA_SECTION_NODE", INT2FIX(XML_CDATA_SECTION_NODE));
|
23
|
-
rb_define_const(cXMLTree, "ENTITY_REF_NODE", INT2FIX(XML_ENTITY_REF_NODE));
|
24
|
-
rb_define_const(cXMLTree, "ENTITY_NODE", INT2FIX(XML_ENTITY_NODE));
|
25
|
-
rb_define_const(cXMLTree, "PI_NODE", INT2FIX(XML_PI_NODE));
|
26
|
-
rb_define_const(cXMLTree, "COMMENT_NODE", INT2FIX(XML_COMMENT_NODE));
|
27
|
-
rb_define_const(cXMLTree, "DOCUMENT_NODE", INT2FIX(XML_DOCUMENT_NODE));
|
28
|
-
rb_define_const(cXMLTree, "DOCUMENT_TYPE_NODE", INT2FIX(XML_DOCUMENT_TYPE_NODE));
|
29
|
-
rb_define_const(cXMLTree, "DOCUMENT_FRAG_NODE", INT2FIX(XML_DOCUMENT_FRAG_NODE));
|
30
|
-
rb_define_const(cXMLTree, "NOTATION_NODE", INT2FIX(XML_NOTATION_NODE));
|
31
|
-
rb_define_const(cXMLTree, "HTML_DOCUMENT_NODE", INT2FIX(XML_HTML_DOCUMENT_NODE));
|
32
|
-
rb_define_const(cXMLTree, "DTD_NODE", INT2FIX(XML_DTD_NODE));
|
33
|
-
rb_define_const(cXMLTree, "ELEMENT_DECL", INT2FIX(XML_ELEMENT_DECL));
|
34
|
-
rb_define_const(cXMLTree, "ATTRIBUTE_DECL", INT2FIX(XML_ATTRIBUTE_DECL));
|
35
|
-
rb_define_const(cXMLTree, "ENTITY_DECL", INT2FIX(XML_ENTITY_DECL));
|
36
|
-
rb_define_const(cXMLTree, "NAMESPACE_DECL", INT2FIX(XML_NAMESPACE_DECL));
|
37
|
-
rb_define_const(cXMLTree, "XINCLUDE_START", INT2FIX(XML_XINCLUDE_START));
|
38
|
-
rb_define_const(cXMLTree, "XINCLUDE_END", INT2FIX(XML_XINCLUDE_END));
|
39
|
-
|
40
|
-
#ifdef LIBXML_DOCB_ENABLED
|
41
|
-
rb_define_const(cXMLTree, "DOCB_DOCUMENT_NODE", INT2FIX(XML_DOCB_DOCUMENT_NODE));
|
42
|
-
#endif
|
43
|
-
}
|
1
|
+
/* $Id: ruby_xml_tree.c 300 2008-07-01 19:14:15Z cfis $ */
|
2
|
+
|
3
|
+
/* Please see the LICENSE file for copyright and distribution information */
|
4
|
+
|
5
|
+
#include "ruby_libxml.h"
|
6
|
+
#include "ruby_xml_tree.h"
|
7
|
+
|
8
|
+
VALUE cXMLTree;
|
9
|
+
|
10
|
+
// Rdoc needs to know
|
11
|
+
#ifdef RDOC_NEVER_DEFINED
|
12
|
+
mXML = rb_define_module("XML");
|
13
|
+
#endif
|
14
|
+
|
15
|
+
void
|
16
|
+
ruby_init_xml_tree(void) {
|
17
|
+
cXMLTree = rb_define_class_under(mXML, "Tree", rb_cObject);
|
18
|
+
|
19
|
+
rb_define_const(cXMLTree, "ELEMENT_NODE", INT2FIX(XML_ELEMENT_NODE));
|
20
|
+
rb_define_const(cXMLTree, "ATTRIBUTE_NODE", INT2FIX(XML_ATTRIBUTE_NODE));
|
21
|
+
rb_define_const(cXMLTree, "TEXT_NODE", INT2FIX(XML_TEXT_NODE));
|
22
|
+
rb_define_const(cXMLTree, "CDATA_SECTION_NODE", INT2FIX(XML_CDATA_SECTION_NODE));
|
23
|
+
rb_define_const(cXMLTree, "ENTITY_REF_NODE", INT2FIX(XML_ENTITY_REF_NODE));
|
24
|
+
rb_define_const(cXMLTree, "ENTITY_NODE", INT2FIX(XML_ENTITY_NODE));
|
25
|
+
rb_define_const(cXMLTree, "PI_NODE", INT2FIX(XML_PI_NODE));
|
26
|
+
rb_define_const(cXMLTree, "COMMENT_NODE", INT2FIX(XML_COMMENT_NODE));
|
27
|
+
rb_define_const(cXMLTree, "DOCUMENT_NODE", INT2FIX(XML_DOCUMENT_NODE));
|
28
|
+
rb_define_const(cXMLTree, "DOCUMENT_TYPE_NODE", INT2FIX(XML_DOCUMENT_TYPE_NODE));
|
29
|
+
rb_define_const(cXMLTree, "DOCUMENT_FRAG_NODE", INT2FIX(XML_DOCUMENT_FRAG_NODE));
|
30
|
+
rb_define_const(cXMLTree, "NOTATION_NODE", INT2FIX(XML_NOTATION_NODE));
|
31
|
+
rb_define_const(cXMLTree, "HTML_DOCUMENT_NODE", INT2FIX(XML_HTML_DOCUMENT_NODE));
|
32
|
+
rb_define_const(cXMLTree, "DTD_NODE", INT2FIX(XML_DTD_NODE));
|
33
|
+
rb_define_const(cXMLTree, "ELEMENT_DECL", INT2FIX(XML_ELEMENT_DECL));
|
34
|
+
rb_define_const(cXMLTree, "ATTRIBUTE_DECL", INT2FIX(XML_ATTRIBUTE_DECL));
|
35
|
+
rb_define_const(cXMLTree, "ENTITY_DECL", INT2FIX(XML_ENTITY_DECL));
|
36
|
+
rb_define_const(cXMLTree, "NAMESPACE_DECL", INT2FIX(XML_NAMESPACE_DECL));
|
37
|
+
rb_define_const(cXMLTree, "XINCLUDE_START", INT2FIX(XML_XINCLUDE_START));
|
38
|
+
rb_define_const(cXMLTree, "XINCLUDE_END", INT2FIX(XML_XINCLUDE_END));
|
39
|
+
|
40
|
+
#ifdef LIBXML_DOCB_ENABLED
|
41
|
+
rb_define_const(cXMLTree, "DOCB_DOCUMENT_NODE", INT2FIX(XML_DOCB_DOCUMENT_NODE));
|
42
|
+
#endif
|
43
|
+
}
|
data/ext/libxml/ruby_xml_tree.h
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
/* $Id: ruby_xml_xinclude.c
|
2
|
-
|
3
|
-
/* Please see the LICENSE file for copyright and distribution information */
|
4
|
-
|
5
|
-
#include "
|
6
|
-
#include "ruby_xml_xinclude.h"
|
7
|
-
|
8
|
-
VALUE cXMLXInclude;
|
9
|
-
VALUE eXMLXIncludeError;
|
10
|
-
|
11
|
-
// Rdoc needs to know
|
12
|
-
#ifdef RDOC_NEVER_DEFINED
|
13
|
-
mXML = rb_define_module("XML");
|
14
|
-
#endif
|
15
|
-
|
16
|
-
void
|
17
|
-
ruby_init_xml_xinclude(void) {
|
18
|
-
cXMLXInclude = rb_define_class_under(mXML, "XInclude", rb_cObject);
|
19
|
-
eXMLXIncludeError = rb_define_class_under(cXMLXInclude, "Error", rb_eRuntimeError);
|
20
|
-
}
|
1
|
+
/* $Id: ruby_xml_xinclude.c 300 2008-07-01 19:14:15Z cfis $ */
|
2
|
+
|
3
|
+
/* Please see the LICENSE file for copyright and distribution information */
|
4
|
+
|
5
|
+
#include "ruby_libxml.h"
|
6
|
+
#include "ruby_xml_xinclude.h"
|
7
|
+
|
8
|
+
VALUE cXMLXInclude;
|
9
|
+
VALUE eXMLXIncludeError;
|
10
|
+
|
11
|
+
// Rdoc needs to know
|
12
|
+
#ifdef RDOC_NEVER_DEFINED
|
13
|
+
mXML = rb_define_module("XML");
|
14
|
+
#endif
|
15
|
+
|
16
|
+
void
|
17
|
+
ruby_init_xml_xinclude(void) {
|
18
|
+
cXMLXInclude = rb_define_class_under(mXML, "XInclude", rb_cObject);
|
19
|
+
eXMLXIncludeError = rb_define_class_under(cXMLXInclude, "Error", rb_eRuntimeError);
|
20
|
+
}
|