libxml-ruby 4.1.0 → 4.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY +13 -0
- data/ext/libxml/extconf.rb +67 -61
- data/ext/libxml/ruby_xml_attr_decl.c +154 -153
- data/ext/libxml/ruby_xml_attributes.c +276 -275
- data/ext/libxml/ruby_xml_error.c +2 -2
- data/ext/libxml/ruby_xml_html_parser_context.c +0 -1
- data/ext/libxml/ruby_xml_input_cbg.c +4 -7
- data/ext/libxml/ruby_xml_reader.c +1245 -1242
- data/ext/libxml/ruby_xml_relaxng.c +113 -112
- data/ext/libxml/ruby_xml_schema.c +422 -420
- data/ext/libxml/ruby_xml_schema_attribute.c +108 -107
- data/ext/libxml/ruby_xml_schema_element.c +70 -69
- data/ext/libxml/ruby_xml_schema_type.c +252 -251
- data/ext/libxml/ruby_xml_version.h +2 -2
- data/ext/libxml/ruby_xml_writer.c +1138 -1137
- data/ext/libxml/ruby_xml_xpath_expression.c +81 -81
- data/ext/libxml/ruby_xml_xpath_object.c +340 -339
- data/lib/libxml/error.rb +7 -7
- data/lib/libxml/schema/element.rb +27 -19
- data/test/test_error.rb +173 -157
- data/test/test_schema.rb +237 -231
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d298b5603240e7ea8b02a030fce5d7a850cd00f0a6a1aac4325dc37b85f7bed4
|
4
|
+
data.tar.gz: 8f9f870fe5f055d9d4b3d30afc9a20cc5c1dbea3332e11e2426ee703fcb83202
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef9b908bf3c1b2f4fe1fe848557e3e8e5265e980a5285c9f213395b80229c295868e007f2f03913ff286d716720d1d995938bcdcdcccaf65dc73022b2cedf15e
|
7
|
+
data.tar.gz: d44818d023a575fd2e5c6d40580382fe809f694d28462fff16500109aa33fa483ee555c6ea27ece9dd4f9756f7fe6c34d1aeaa34162b99e847d4171585624265
|
data/HISTORY
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
= Release History
|
2
2
|
|
3
|
+
== 4.1.2 / 2023-11-04
|
4
|
+
|
5
|
+
* Fix Ruby warnings about undefined allocators (yuuji.yaginuma, Christopher Sahnwaldt)
|
6
|
+
* Fix Schema::Element required? and array? (John Andrews)
|
7
|
+
* Remove SchemaElement#minOccurs and SchemaElement#maxOccurs since they actually did not work (Charlie Savage)
|
8
|
+
* Fix typo: XPatch -> XPath (Christopher Sahnwaldt)
|
9
|
+
* Introduce new alternative Homebrew installation search paths to extconf makefile (Pierce Brooks)
|
10
|
+
|
11
|
+
== 4.1.1 / 2023-05-01
|
12
|
+
|
13
|
+
* Fix compile warning (or error) for input_callbacks_register_input_callbacks (Charlie Savage)
|
14
|
+
* Remove call to deprecated function htmlDefaultSAXHandlerInit (Charlie Savage)
|
15
|
+
|
3
16
|
== 4.1.0 / 2023-04-30
|
4
17
|
|
5
18
|
* Fix compile warning (or error) for rxml_encoding_to_rb_encoding (Charlie Savage)
|
data/ext/libxml/extconf.rb
CHANGED
@@ -1,61 +1,67 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'mkmf'
|
4
|
-
|
5
|
-
def crash(str)
|
6
|
-
printf(" extconf failure: %s\n", str)
|
7
|
-
exit 1
|
8
|
-
end
|
9
|
-
|
10
|
-
xc = with_config('xml2-config')
|
11
|
-
if xc
|
12
|
-
cflags = `#{xc} --cflags`.chomp
|
13
|
-
if $? != 0
|
14
|
-
cflags = nil
|
15
|
-
else
|
16
|
-
libs = `#{xc} --libs`.chomp
|
17
|
-
if $? != 0
|
18
|
-
libs = nil
|
19
|
-
else
|
20
|
-
$CFLAGS += ' ' + cflags
|
21
|
-
$libs = libs + " " + $libs
|
22
|
-
end
|
23
|
-
end
|
24
|
-
else
|
25
|
-
dir_config('xml2')
|
26
|
-
end
|
27
|
-
|
28
|
-
found_header = find_header('libxml/xmlversion.h',
|
29
|
-
'/opt/include/libxml2',
|
30
|
-
'/opt/local/include/libxml2',
|
31
|
-
'/
|
32
|
-
'/usr/include/libxml2',
|
33
|
-
'/usr/
|
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
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'mkmf'
|
4
|
+
|
5
|
+
def crash(str)
|
6
|
+
printf(" extconf failure: %s\n", str)
|
7
|
+
exit 1
|
8
|
+
end
|
9
|
+
|
10
|
+
xc = with_config('xml2-config')
|
11
|
+
if xc
|
12
|
+
cflags = `#{xc} --cflags`.chomp
|
13
|
+
if $? != 0
|
14
|
+
cflags = nil
|
15
|
+
else
|
16
|
+
libs = `#{xc} --libs`.chomp
|
17
|
+
if $? != 0
|
18
|
+
libs = nil
|
19
|
+
else
|
20
|
+
$CFLAGS += ' ' + cflags
|
21
|
+
$libs = libs + " " + $libs
|
22
|
+
end
|
23
|
+
end
|
24
|
+
else
|
25
|
+
dir_config('xml2')
|
26
|
+
end
|
27
|
+
|
28
|
+
found_header = find_header('libxml/xmlversion.h',
|
29
|
+
'/opt/include/libxml2',
|
30
|
+
'/opt/local/include/libxml2',
|
31
|
+
'/opt/homebrew/opt/libxml2/include/libxml2',
|
32
|
+
'/usr/local/include/libxml2',
|
33
|
+
'/usr/include/libxml2',
|
34
|
+
'/usr/local/include',
|
35
|
+
'/usr/local/opt/libxml2/include/libxml2')
|
36
|
+
|
37
|
+
found_lib = find_library('xml2', 'xmlParseDoc',
|
38
|
+
'/opt/lib',
|
39
|
+
'/opt/local/lib',
|
40
|
+
'/opt/homebrew/opt/libxml2/lib',
|
41
|
+
'/usr/lib',
|
42
|
+
'/usr/local/lib',
|
43
|
+
'/usr/local/opt/libxml2/lib')
|
44
|
+
|
45
|
+
found_lib ||= find_library('libxml2', 'xmlParseDoc',
|
46
|
+
'/opt/lib',
|
47
|
+
'/opt/local/lib',
|
48
|
+
'/opt/homebrew/opt/libxml2/lib',
|
49
|
+
'/usr/lib',
|
50
|
+
'/usr/local/lib',
|
51
|
+
'/usr/local/opt/libxml2/lib')
|
52
|
+
|
53
|
+
if !found_header || !found_lib
|
54
|
+
crash(<<~EOL)
|
55
|
+
Cannot find libxml2.
|
56
|
+
|
57
|
+
Install the library or try one of the following options to extconf.rb:
|
58
|
+
|
59
|
+
--with-xml2-config=/path/to/xml2-config
|
60
|
+
--with-xml2-dir=/path/to/libxml2
|
61
|
+
--with-xml2-lib=/path/to/libxml2/lib
|
62
|
+
--with-xml2-include=/path/to/libxml2/include
|
63
|
+
EOL
|
64
|
+
end
|
65
|
+
|
66
|
+
create_header()
|
67
|
+
create_makefile('libxml_ruby')
|
@@ -1,153 +1,154 @@
|
|
1
|
-
/* Please see the LICENSE file for copyright and distribution information */
|
2
|
-
|
3
|
-
/*
|
4
|
-
* Document-class: LibXML::XML::AttrDecl
|
5
|
-
*
|
6
|
-
* At attribute declaration is used in XML::Dtds to define
|
7
|
-
* what attributes are allowed on an element. An attribute
|
8
|
-
* declaration defines an attribues name, data type and default
|
9
|
-
* value (if any).
|
10
|
-
*/
|
11
|
-
|
12
|
-
#include "ruby_libxml.h"
|
13
|
-
|
14
|
-
VALUE cXMLAttrDecl;
|
15
|
-
|
16
|
-
void rxml_attr_decl_mark(xmlAttributePtr xattr)
|
17
|
-
{
|
18
|
-
rxml_node_mark((xmlNodePtr) xattr);
|
19
|
-
}
|
20
|
-
|
21
|
-
VALUE rxml_attr_decl_wrap(xmlAttributePtr xattr)
|
22
|
-
{
|
23
|
-
return Data_Wrap_Struct(cXMLAttrDecl, rxml_attr_decl_mark, NULL, xattr);
|
24
|
-
}
|
25
|
-
|
26
|
-
/*
|
27
|
-
* call-seq:
|
28
|
-
* attr_decl.doc -> XML::Document
|
29
|
-
*
|
30
|
-
* Returns this attribute declaration's document.
|
31
|
-
*/
|
32
|
-
static VALUE rxml_attr_decl_doc_get(VALUE self)
|
33
|
-
{
|
34
|
-
xmlAttributePtr xattr;
|
35
|
-
Data_Get_Struct(self, xmlAttribute, xattr);
|
36
|
-
if (xattr->doc == NULL)
|
37
|
-
return Qnil;
|
38
|
-
else
|
39
|
-
return rxml_document_wrap(xattr->doc);
|
40
|
-
}
|
41
|
-
|
42
|
-
|
43
|
-
/*
|
44
|
-
* call-seq:
|
45
|
-
* attr_decl.name -> "name"
|
46
|
-
*
|
47
|
-
* Obtain this attribute declaration's name.
|
48
|
-
*/
|
49
|
-
static VALUE rxml_attr_decl_name_get(VALUE self)
|
50
|
-
{
|
51
|
-
xmlAttributePtr xattr;
|
52
|
-
Data_Get_Struct(self, xmlAttribute, xattr);
|
53
|
-
|
54
|
-
if (xattr->name == NULL)
|
55
|
-
return Qnil;
|
56
|
-
else
|
57
|
-
return rxml_new_cstr( xattr->name, xattr->doc->encoding);
|
58
|
-
}
|
59
|
-
|
60
|
-
/*
|
61
|
-
* call-seq:
|
62
|
-
* attr_decl.next -> XML::AttrDecl
|
63
|
-
*
|
64
|
-
* Obtain the next attribute declaration.
|
65
|
-
*/
|
66
|
-
static VALUE rxml_attr_decl_next_get(VALUE self)
|
67
|
-
{
|
68
|
-
xmlAttributePtr xattr;
|
69
|
-
Data_Get_Struct(self, xmlAttribute, xattr);
|
70
|
-
if (xattr->next == NULL)
|
71
|
-
return Qnil;
|
72
|
-
else
|
73
|
-
return rxml_attr_decl_wrap((xmlAttributePtr)xattr->next);
|
74
|
-
}
|
75
|
-
|
76
|
-
/*
|
77
|
-
* call-seq:
|
78
|
-
* attr_decl.type -> num
|
79
|
-
*
|
80
|
-
* Obtain this attribute declaration's type node type.
|
81
|
-
*/
|
82
|
-
static VALUE rxml_attr_decl_node_type(VALUE self)
|
83
|
-
{
|
84
|
-
xmlAttrPtr xattr;
|
85
|
-
Data_Get_Struct(self, xmlAttr, xattr);
|
86
|
-
return INT2NUM(xattr->type);
|
87
|
-
}
|
88
|
-
|
89
|
-
/*
|
90
|
-
* call-seq:
|
91
|
-
* attr_decl.parent -> XML::Dtd
|
92
|
-
*
|
93
|
-
* Obtain this attribute declaration's parent which
|
94
|
-
* is an instance of a XML::DTD.
|
95
|
-
*/
|
96
|
-
static VALUE rxml_attr_decl_parent_get(VALUE self)
|
97
|
-
{
|
98
|
-
xmlAttributePtr xattr;
|
99
|
-
Data_Get_Struct(self, xmlAttribute, xattr);
|
100
|
-
|
101
|
-
if (xattr->parent == NULL)
|
102
|
-
return Qnil;
|
103
|
-
else
|
104
|
-
return rxml_dtd_wrap(xattr->parent);
|
105
|
-
}
|
106
|
-
|
107
|
-
/*
|
108
|
-
* call-seq:
|
109
|
-
* attr_decl.prev -> (XML::AttrDecl | XML::ElementDecl)
|
110
|
-
*
|
111
|
-
* Obtain the previous attribute declaration or the owning
|
112
|
-
* element declration (not implemented).
|
113
|
-
*/
|
114
|
-
static VALUE rxml_attr_decl_prev_get(VALUE self)
|
115
|
-
{
|
116
|
-
xmlAttributePtr xattr;
|
117
|
-
Data_Get_Struct(self, xmlAttribute, xattr);
|
118
|
-
|
119
|
-
if (xattr->prev == NULL)
|
120
|
-
return Qnil;
|
121
|
-
else
|
122
|
-
return rxml_attr_decl_wrap((xmlAttributePtr)xattr->prev);
|
123
|
-
}
|
124
|
-
|
125
|
-
/*
|
126
|
-
* call-seq:
|
127
|
-
* attr_decl.value -> "value"
|
128
|
-
*
|
129
|
-
* Obtain the default value of this attribute declaration.
|
130
|
-
*/
|
131
|
-
VALUE rxml_attr_decl_value_get(VALUE self)
|
132
|
-
{
|
133
|
-
xmlAttributePtr xattr;
|
134
|
-
|
135
|
-
Data_Get_Struct(self, xmlAttribute, xattr);
|
136
|
-
|
137
|
-
if (xattr->defaultValue)
|
138
|
-
return rxml_new_cstr(xattr->defaultValue, NULL);
|
139
|
-
else
|
140
|
-
return Qnil;
|
141
|
-
}
|
142
|
-
|
143
|
-
void rxml_init_attr_decl(void)
|
144
|
-
{
|
145
|
-
cXMLAttrDecl = rb_define_class_under(mXML, "AttrDecl", rb_cObject);
|
146
|
-
|
147
|
-
rb_define_method(cXMLAttrDecl, "
|
148
|
-
rb_define_method(cXMLAttrDecl, "
|
149
|
-
rb_define_method(cXMLAttrDecl, "
|
150
|
-
rb_define_method(cXMLAttrDecl, "
|
151
|
-
rb_define_method(cXMLAttrDecl, "
|
152
|
-
rb_define_method(cXMLAttrDecl, "
|
153
|
-
|
1
|
+
/* Please see the LICENSE file for copyright and distribution information */
|
2
|
+
|
3
|
+
/*
|
4
|
+
* Document-class: LibXML::XML::AttrDecl
|
5
|
+
*
|
6
|
+
* At attribute declaration is used in XML::Dtds to define
|
7
|
+
* what attributes are allowed on an element. An attribute
|
8
|
+
* declaration defines an attribues name, data type and default
|
9
|
+
* value (if any).
|
10
|
+
*/
|
11
|
+
|
12
|
+
#include "ruby_libxml.h"
|
13
|
+
|
14
|
+
VALUE cXMLAttrDecl;
|
15
|
+
|
16
|
+
void rxml_attr_decl_mark(xmlAttributePtr xattr)
|
17
|
+
{
|
18
|
+
rxml_node_mark((xmlNodePtr) xattr);
|
19
|
+
}
|
20
|
+
|
21
|
+
VALUE rxml_attr_decl_wrap(xmlAttributePtr xattr)
|
22
|
+
{
|
23
|
+
return Data_Wrap_Struct(cXMLAttrDecl, rxml_attr_decl_mark, NULL, xattr);
|
24
|
+
}
|
25
|
+
|
26
|
+
/*
|
27
|
+
* call-seq:
|
28
|
+
* attr_decl.doc -> XML::Document
|
29
|
+
*
|
30
|
+
* Returns this attribute declaration's document.
|
31
|
+
*/
|
32
|
+
static VALUE rxml_attr_decl_doc_get(VALUE self)
|
33
|
+
{
|
34
|
+
xmlAttributePtr xattr;
|
35
|
+
Data_Get_Struct(self, xmlAttribute, xattr);
|
36
|
+
if (xattr->doc == NULL)
|
37
|
+
return Qnil;
|
38
|
+
else
|
39
|
+
return rxml_document_wrap(xattr->doc);
|
40
|
+
}
|
41
|
+
|
42
|
+
|
43
|
+
/*
|
44
|
+
* call-seq:
|
45
|
+
* attr_decl.name -> "name"
|
46
|
+
*
|
47
|
+
* Obtain this attribute declaration's name.
|
48
|
+
*/
|
49
|
+
static VALUE rxml_attr_decl_name_get(VALUE self)
|
50
|
+
{
|
51
|
+
xmlAttributePtr xattr;
|
52
|
+
Data_Get_Struct(self, xmlAttribute, xattr);
|
53
|
+
|
54
|
+
if (xattr->name == NULL)
|
55
|
+
return Qnil;
|
56
|
+
else
|
57
|
+
return rxml_new_cstr( xattr->name, xattr->doc->encoding);
|
58
|
+
}
|
59
|
+
|
60
|
+
/*
|
61
|
+
* call-seq:
|
62
|
+
* attr_decl.next -> XML::AttrDecl
|
63
|
+
*
|
64
|
+
* Obtain the next attribute declaration.
|
65
|
+
*/
|
66
|
+
static VALUE rxml_attr_decl_next_get(VALUE self)
|
67
|
+
{
|
68
|
+
xmlAttributePtr xattr;
|
69
|
+
Data_Get_Struct(self, xmlAttribute, xattr);
|
70
|
+
if (xattr->next == NULL)
|
71
|
+
return Qnil;
|
72
|
+
else
|
73
|
+
return rxml_attr_decl_wrap((xmlAttributePtr)xattr->next);
|
74
|
+
}
|
75
|
+
|
76
|
+
/*
|
77
|
+
* call-seq:
|
78
|
+
* attr_decl.type -> num
|
79
|
+
*
|
80
|
+
* Obtain this attribute declaration's type node type.
|
81
|
+
*/
|
82
|
+
static VALUE rxml_attr_decl_node_type(VALUE self)
|
83
|
+
{
|
84
|
+
xmlAttrPtr xattr;
|
85
|
+
Data_Get_Struct(self, xmlAttr, xattr);
|
86
|
+
return INT2NUM(xattr->type);
|
87
|
+
}
|
88
|
+
|
89
|
+
/*
|
90
|
+
* call-seq:
|
91
|
+
* attr_decl.parent -> XML::Dtd
|
92
|
+
*
|
93
|
+
* Obtain this attribute declaration's parent which
|
94
|
+
* is an instance of a XML::DTD.
|
95
|
+
*/
|
96
|
+
static VALUE rxml_attr_decl_parent_get(VALUE self)
|
97
|
+
{
|
98
|
+
xmlAttributePtr xattr;
|
99
|
+
Data_Get_Struct(self, xmlAttribute, xattr);
|
100
|
+
|
101
|
+
if (xattr->parent == NULL)
|
102
|
+
return Qnil;
|
103
|
+
else
|
104
|
+
return rxml_dtd_wrap(xattr->parent);
|
105
|
+
}
|
106
|
+
|
107
|
+
/*
|
108
|
+
* call-seq:
|
109
|
+
* attr_decl.prev -> (XML::AttrDecl | XML::ElementDecl)
|
110
|
+
*
|
111
|
+
* Obtain the previous attribute declaration or the owning
|
112
|
+
* element declration (not implemented).
|
113
|
+
*/
|
114
|
+
static VALUE rxml_attr_decl_prev_get(VALUE self)
|
115
|
+
{
|
116
|
+
xmlAttributePtr xattr;
|
117
|
+
Data_Get_Struct(self, xmlAttribute, xattr);
|
118
|
+
|
119
|
+
if (xattr->prev == NULL)
|
120
|
+
return Qnil;
|
121
|
+
else
|
122
|
+
return rxml_attr_decl_wrap((xmlAttributePtr)xattr->prev);
|
123
|
+
}
|
124
|
+
|
125
|
+
/*
|
126
|
+
* call-seq:
|
127
|
+
* attr_decl.value -> "value"
|
128
|
+
*
|
129
|
+
* Obtain the default value of this attribute declaration.
|
130
|
+
*/
|
131
|
+
VALUE rxml_attr_decl_value_get(VALUE self)
|
132
|
+
{
|
133
|
+
xmlAttributePtr xattr;
|
134
|
+
|
135
|
+
Data_Get_Struct(self, xmlAttribute, xattr);
|
136
|
+
|
137
|
+
if (xattr->defaultValue)
|
138
|
+
return rxml_new_cstr(xattr->defaultValue, NULL);
|
139
|
+
else
|
140
|
+
return Qnil;
|
141
|
+
}
|
142
|
+
|
143
|
+
void rxml_init_attr_decl(void)
|
144
|
+
{
|
145
|
+
cXMLAttrDecl = rb_define_class_under(mXML, "AttrDecl", rb_cObject);
|
146
|
+
rb_undef_alloc_func(cXMLAttrDecl);
|
147
|
+
rb_define_method(cXMLAttrDecl, "doc", rxml_attr_decl_doc_get, 0);
|
148
|
+
rb_define_method(cXMLAttrDecl, "name", rxml_attr_decl_name_get, 0);
|
149
|
+
rb_define_method(cXMLAttrDecl, "next", rxml_attr_decl_next_get, 0);
|
150
|
+
rb_define_method(cXMLAttrDecl, "node_type", rxml_attr_decl_node_type, 0);
|
151
|
+
rb_define_method(cXMLAttrDecl, "parent", rxml_attr_decl_parent_get, 0);
|
152
|
+
rb_define_method(cXMLAttrDecl, "prev", rxml_attr_decl_prev_get, 0);
|
153
|
+
rb_define_method(cXMLAttrDecl, "value", rxml_attr_decl_value_get, 0);
|
154
|
+
}
|