libxml-ruby 3.2.0 → 3.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY +23 -1
- data/README.rdoc +52 -36
- data/Rakefile +24 -16
- data/ext/libxml/ruby_xml.c +4 -0
- data/ext/libxml/ruby_xml_document.c +0 -4
- data/ext/libxml/ruby_xml_encoding.c +1 -13
- data/ext/libxml/ruby_xml_encoding.h +0 -3
- data/ext/libxml/ruby_xml_io.c +14 -18
- data/ext/libxml/ruby_xml_io.h +1 -1
- data/ext/libxml/ruby_xml_namespace.c +1 -0
- data/ext/libxml/ruby_xml_node.c +8 -4
- data/ext/libxml/ruby_xml_schema.c +151 -79
- data/ext/libxml/ruby_xml_schema.h +2 -5
- data/ext/libxml/ruby_xml_schema_attribute.c +23 -71
- data/ext/libxml/ruby_xml_schema_element.c +28 -54
- data/ext/libxml/ruby_xml_schema_facet.c +15 -21
- data/ext/libxml/ruby_xml_schema_type.c +19 -37
- data/ext/libxml/ruby_xml_version.h +3 -3
- data/ext/libxml/ruby_xml_writer.c +189 -192
- data/libxml-ruby.gemspec +1 -1
- data/test/model/shiporder.rnc +2 -2
- data/test/model/shiporder.rng +2 -2
- data/test/model/shiporder.xsd +7 -3
- data/test/model/shiporder_bad.xsd +40 -0
- data/test/model/shiporder_import.xsd +45 -0
- data/test/test_document.rb +111 -110
- data/test/test_dtd.rb +2 -1
- data/test/test_helper.rb +2 -0
- data/test/test_parser.rb +1 -1
- data/test/test_parser_context.rb +3 -9
- data/test/test_reader.rb +2 -1
- data/test/test_sax_parser.rb +13 -6
- data/test/test_schema.rb +92 -29
- data/test/test_writer.rb +48 -25
- data/test/test_xml.rb +2 -1
- metadata +11 -10
- data/ext/libxml/extconf.h +0 -3
@@ -17,34 +17,36 @@ static void rxml_schema_type_free(xmlSchemaTypePtr xschema_type)
|
|
17
17
|
|
18
18
|
VALUE rxml_wrap_schema_type(xmlSchemaTypePtr xtype)
|
19
19
|
{
|
20
|
-
|
21
|
-
}
|
20
|
+
VALUE result;
|
22
21
|
|
23
|
-
|
24
|
-
|
25
|
-
xmlSchemaTypePtr xtype;
|
22
|
+
if (!xtype)
|
23
|
+
rb_raise(rb_eArgError, "XML::Schema::Type required!");
|
26
24
|
|
27
|
-
|
25
|
+
result = Data_Wrap_Struct(cXMLSchemaType, NULL, rxml_schema_type_free, xtype);
|
28
26
|
|
29
|
-
QNIL_OR_STRING(xtype->
|
27
|
+
rb_iv_set(result, "@name", QNIL_OR_STRING(xtype->name));
|
28
|
+
rb_iv_set(result, "@namespace", QNIL_OR_STRING(xtype->targetNamespace));
|
29
|
+
rb_iv_set(result, "@kind", INT2NUM(xtype->type));
|
30
|
+
|
31
|
+
return result;
|
30
32
|
}
|
31
33
|
|
32
|
-
static VALUE
|
34
|
+
static VALUE rxml_schema_type_base(VALUE self)
|
33
35
|
{
|
34
36
|
xmlSchemaTypePtr xtype;
|
35
37
|
|
36
38
|
Data_Get_Struct(self, xmlSchemaType, xtype);
|
37
39
|
|
38
|
-
|
40
|
+
return (xtype->baseType != xtype) ? rxml_wrap_schema_type(xtype->baseType) : Qnil;
|
39
41
|
}
|
40
42
|
|
41
|
-
static VALUE
|
43
|
+
static VALUE rxml_schema_type_node(VALUE self)
|
42
44
|
{
|
43
45
|
xmlSchemaTypePtr xtype;
|
44
46
|
|
45
47
|
Data_Get_Struct(self, xmlSchemaType, xtype);
|
46
48
|
|
47
|
-
return
|
49
|
+
return (xtype->node != NULL) ? rxml_node_wrap(xtype->node) : Qnil;
|
48
50
|
}
|
49
51
|
|
50
52
|
static VALUE rxml_schema_type_facets(VALUE self)
|
@@ -68,27 +70,6 @@ static VALUE rxml_schema_type_facets(VALUE self)
|
|
68
70
|
return result;
|
69
71
|
}
|
70
72
|
|
71
|
-
static VALUE rxml_schema_type_node(VALUE self)
|
72
|
-
{
|
73
|
-
xmlSchemaTypePtr xtype;
|
74
|
-
|
75
|
-
Data_Get_Struct(self, xmlSchemaType, xtype);
|
76
|
-
|
77
|
-
if(xtype->node != NULL)
|
78
|
-
return rxml_node_wrap(xtype->node);
|
79
|
-
else
|
80
|
-
return Qnil;
|
81
|
-
}
|
82
|
-
|
83
|
-
static VALUE rxml_schema_type_kind(VALUE self)
|
84
|
-
{
|
85
|
-
xmlSchemaTypePtr xtype;
|
86
|
-
|
87
|
-
Data_Get_Struct(self, xmlSchemaType, xtype);
|
88
|
-
|
89
|
-
return INT2NUM(xtype->type);
|
90
|
-
}
|
91
|
-
|
92
73
|
static VALUE rxml_schema_type_annot(VALUE self)
|
93
74
|
{
|
94
75
|
VALUE result = Qnil;
|
@@ -220,13 +201,14 @@ void rxml_init_schema_type(void)
|
|
220
201
|
|
221
202
|
cXMLSchemaType = rb_define_class_under(cXMLSchema, "Type", rb_cObject);
|
222
203
|
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
204
|
+
rb_define_attr(cXMLSchemaType, "namespace", 1, 0);
|
205
|
+
rb_define_attr(cXMLSchemaType, "name", 1, 0);
|
206
|
+
rb_define_attr(cXMLSchemaType, "kind", 1, 0);
|
207
|
+
|
227
208
|
rb_define_method(cXMLSchemaType, "base", rxml_schema_type_base, 0);
|
228
|
-
rb_define_method(cXMLSchemaType, "kind", rxml_schema_type_kind, 0);
|
229
209
|
rb_define_method(cXMLSchemaType, "node", rxml_schema_type_node, 0);
|
210
|
+
rb_define_method(cXMLSchemaType, "elements", rxml_schema_type_elements, 0);
|
211
|
+
rb_define_method(cXMLSchemaType, "attributes", rxml_schema_type_attributes, 0);
|
230
212
|
rb_define_method(cXMLSchemaType, "facets", rxml_schema_type_facets, 0);
|
231
213
|
rb_define_method(cXMLSchemaType, "annotation", rxml_schema_type_annot, 0);
|
232
214
|
}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
/* Don't nuke this block! It is used for automatically updating the
|
2
2
|
* versions below. VERSION = string formatting, VERNUM = numbered
|
3
3
|
* version for inline testing: increment both or none at all.*/
|
4
|
-
#define RUBY_LIBXML_VERSION "3.2.
|
5
|
-
#define RUBY_LIBXML_VERNUM
|
4
|
+
#define RUBY_LIBXML_VERSION "3.2.3"
|
5
|
+
#define RUBY_LIBXML_VERNUM 323
|
6
6
|
#define RUBY_LIBXML_VER_MAJ 3
|
7
7
|
#define RUBY_LIBXML_VER_MIN 2
|
8
|
-
#define RUBY_LIBXML_VER_MIC
|
8
|
+
#define RUBY_LIBXML_VER_MIC 3
|
9
9
|
#define RUBY_LIBXML_VER_PATCH 0
|