libxml-ruby 4.0.0-x64-mingw-ucrt → 4.1.2-x64-mingw-ucrt
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY +18 -0
- data/ext/libxml/extconf.rb +67 -61
- data/ext/libxml/ruby_xml.c +0 -40
- data/ext/libxml/ruby_xml_attr_decl.c +154 -153
- data/ext/libxml/ruby_xml_attributes.c +276 -275
- data/ext/libxml/ruby_xml_encoding.c +1 -1
- 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_parser.h +0 -2
- data/ext/libxml/ruby_xml_parser_options.h +0 -2
- 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 +3 -3
- 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/3.1/libxml_ruby.so +0 -0
- 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
- data/test/test_xml.rb +0 -8
- metadata +3 -4
- data/lib/3.2/libxml_ruby.so +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e94d9c3309f05c37ed7365121006aaddeab0c67d48aac5c4e94fa9a015b96fae
|
4
|
+
data.tar.gz: 51738495754fd3875fc146065997b60296859e38b105a1c0b2490a09fd338904
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d5424a7aadd9563e3eb2f0e812b49b702c894abfbdc7db1225e408827daa390f0316d6d3b03344077ebc2dc1fa79fe4c8f0304e68611ada810575e650c72a8f
|
7
|
+
data.tar.gz: 9406535bf7629a5272f04aa876ccd1fed324569e0738b50672678d482a05e22de0acc8c5f869929c4461e03423e521e84fbd9c987b0281b39ee8e88ce5eec092
|
data/HISTORY
CHANGED
@@ -1,5 +1,23 @@
|
|
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
|
+
|
16
|
+
== 4.1.0 / 2023-04-30
|
17
|
+
|
18
|
+
* Fix compile warning (or error) for rxml_encoding_to_rb_encoding (Charlie Savage)
|
19
|
+
* Breaking - Remove LibXML::XML.features since its uses functionality deprecated in LibXML (Charlie Savage)
|
20
|
+
|
3
21
|
== 4.0.0 / 2022-12-28
|
4
22
|
|
5
23
|
* Breaking - Remove support for XPointer since libxml2 has deprecated it and will remove it (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')
|
data/ext/libxml/ruby_xml.c
CHANGED
@@ -757,45 +757,6 @@ static VALUE rxml_default_save_no_empty_tags_set(VALUE klass, VALUE value)
|
|
757
757
|
}
|
758
758
|
}
|
759
759
|
|
760
|
-
/*
|
761
|
-
* call-seq:
|
762
|
-
* XML.features -> ["feature", ..., "feature"]
|
763
|
-
*
|
764
|
-
* Obtains an array of strings representing features supported
|
765
|
-
* (and enabled) by the installed libxml.
|
766
|
-
*/
|
767
|
-
static VALUE rxml_features(VALUE klass)
|
768
|
-
{
|
769
|
-
#ifndef LIBXML_LEGACY_ENABLED
|
770
|
-
return Qnil;
|
771
|
-
#else
|
772
|
-
VALUE arr, str;
|
773
|
-
int i, len = MAX_LIBXML_FEATURES_LEN;
|
774
|
-
char **list = NULL;
|
775
|
-
|
776
|
-
list = ALLOC_N(char *,MAX_LIBXML_FEATURES_LEN);
|
777
|
-
MEMZERO(list, char *, MAX_LIBXML_FEATURES_LEN);
|
778
|
-
|
779
|
-
arr = rb_ary_new();
|
780
|
-
if (xmlGetFeaturesList(&len, (const char **) list) == -1)
|
781
|
-
return Qnil;
|
782
|
-
|
783
|
-
for (i = 0; i < len; i++)
|
784
|
-
{
|
785
|
-
str = rb_str_new2((const char *) list[i]);
|
786
|
-
rb_gc_unregister_address(&str);
|
787
|
-
rb_ary_push(arr, str);
|
788
|
-
}
|
789
|
-
|
790
|
-
if (len == MAX_LIBXML_FEATURES_LEN)
|
791
|
-
rb_warn(
|
792
|
-
"Please contact libxml-devel@rubyforge.org and ask to have the \"MAX_LIBXML_FEATURES_LEN increased\" because you could possibly be seeing an incomplete list");
|
793
|
-
|
794
|
-
ruby_xfree(list);
|
795
|
-
return (arr);
|
796
|
-
#endif /* LIBXML_LEGACY_ENABLED */
|
797
|
-
}
|
798
|
-
|
799
760
|
/*
|
800
761
|
* call-seq:
|
801
762
|
* XML.indent_tree_output -> (true|false)
|
@@ -931,7 +892,6 @@ void rxml_init_xml(void)
|
|
931
892
|
rb_define_module_function(mXML, "default_warnings=", rxml_default_warnings_set, 1);
|
932
893
|
rb_define_module_function(mXML, "default_save_no_empty_tags", rxml_default_save_no_empty_tags_get, 0);
|
933
894
|
rb_define_module_function(mXML, "default_save_no_empty_tags=", rxml_default_save_no_empty_tags_set, 1);
|
934
|
-
rb_define_module_function(mXML, "features", rxml_features, 0);
|
935
895
|
rb_define_module_function(mXML, "indent_tree_output", rxml_indent_tree_output_get, 0);
|
936
896
|
rb_define_module_function(mXML, "indent_tree_output=", rxml_indent_tree_output_set, 1);
|
937
897
|
rb_define_module_function(mXML, "memory_dump", rxml_memory_dump, 0);
|
@@ -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
|
+
}
|