libxml-ruby 3.2.4 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY +10 -0
- data/ext/libxml/libxml.c +0 -1
- data/ext/libxml/libxml_ruby.def +0 -1
- data/ext/libxml/ruby_libxml.h +0 -1
- data/ext/libxml/ruby_xml.c +1 -41
- data/ext/libxml/ruby_xml.h +1 -1
- data/ext/libxml/ruby_xml_cbg.c +1 -1
- data/ext/libxml/ruby_xml_dtd.c +1 -1
- data/ext/libxml/ruby_xml_encoding.c +2 -2
- data/ext/libxml/ruby_xml_error.c +2 -2
- data/ext/libxml/ruby_xml_error.h +1 -1
- data/ext/libxml/ruby_xml_input_cbg.c +1 -1
- data/ext/libxml/ruby_xml_io.c +1 -1
- data/ext/libxml/ruby_xml_node.c +0 -12
- data/ext/libxml/ruby_xml_parser.h +0 -2
- data/ext/libxml/ruby_xml_parser_options.h +0 -2
- data/ext/libxml/ruby_xml_version.h +5 -5
- data/lib/libxml-ruby.rb +1 -1
- data/test/test_xml.rb +0 -8
- metadata +3 -11
- data/MANIFEST +0 -166
- data/ext/libxml/ruby_xml_xpointer.c +0 -103
- data/ext/libxml/ruby_xml_xpointer.h +0 -11
- data/setup.rb +0 -1584
- data/test/test_suite.rb +0 -48
- data/test/test_xpointer.rb +0 -72
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5738b9c6f8515720321fdc1c4909d71642dae0eb6ece45df56715fc9e3a07c2f
|
4
|
+
data.tar.gz: 84b056d7300ad1b03cc09f9799839bbaaf648c50b3508c55f1d2c9aa9c554e04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76ba083abeb55264d7fbba86c82127afd4794cbdf93a1437623c2e71f02037f96fab3ef8a20b2648a61d53ec049af18f19917397dcefaab185135abbeae698b0
|
7
|
+
data.tar.gz: 807e907bde2917f2a1157a0e3c8fbf7b0da7cfa0cdf2806a28965aa1d51a630b0f81f93efc2e96449d407e947e597a613323f7a9265117af40e5daf877c6bb31
|
data/HISTORY
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
= Release History
|
2
2
|
|
3
|
+
== 4.1.0 / 2023-04-30
|
4
|
+
|
5
|
+
* Fix compile warning (or error) for rxml_encoding_to_rb_encoding (Charlie Savage)
|
6
|
+
* Breaking - Remove LibXML::XML.features since its uses functionality deprecated in LibXML (Charlie Savage)
|
7
|
+
|
8
|
+
== 4.0.0 / 2022-12-28
|
9
|
+
|
10
|
+
* Breaking - Remove support for XPointer since libxml2 has deprecated it and will remove it (Charlie Savage)
|
11
|
+
* Breaking - Remove support for ancient setup.rb script (Charlie Savage)
|
12
|
+
|
3
13
|
== 3.2.4 / 2022-10-29
|
4
14
|
|
5
15
|
* Support libxml2 version 2.10.2 (Charlie Savage)
|
data/ext/libxml/libxml.c
CHANGED
data/ext/libxml/libxml_ruby.def
CHANGED
data/ext/libxml/ruby_libxml.h
CHANGED
data/ext/libxml/ruby_xml.c
CHANGED
@@ -479,7 +479,7 @@ static VALUE rxml_default_line_numbers_set(VALUE klass, VALUE value)
|
|
479
479
|
}
|
480
480
|
}
|
481
481
|
|
482
|
-
int rxml_libxml_default_options()
|
482
|
+
int rxml_libxml_default_options(void)
|
483
483
|
{
|
484
484
|
int options = 0;
|
485
485
|
|
@@ -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);
|
data/ext/libxml/ruby_xml.h
CHANGED
data/ext/libxml/ruby_xml_cbg.c
CHANGED
data/ext/libxml/ruby_xml_dtd.c
CHANGED
@@ -235,7 +235,7 @@ static VALUE rxml_dtd_initialize(int argc, VALUE *argv, VALUE self)
|
|
235
235
|
return self;
|
236
236
|
}
|
237
237
|
|
238
|
-
void rxml_init_dtd()
|
238
|
+
void rxml_init_dtd(void)
|
239
239
|
{
|
240
240
|
cXMLDtd = rb_define_class_under(mXML, "Dtd", rb_cObject);
|
241
241
|
rb_define_alloc_func(cXMLDtd, rxml_dtd_alloc);
|
@@ -182,7 +182,7 @@ rb_encoding* rxml_figure_encoding(const xmlChar* xencoding)
|
|
182
182
|
VALUE rxml_new_cstr(const xmlChar* xstr, const xmlChar* xencoding)
|
183
183
|
{
|
184
184
|
rb_encoding *rbencoding = rxml_figure_encoding(xencoding);
|
185
|
-
return rb_external_str_new_with_enc((const char*)xstr, strlen((const char*)xstr), rbencoding);
|
185
|
+
return rb_external_str_new_with_enc((const char*)xstr, (long)strlen((const char*)xstr), rbencoding);
|
186
186
|
}
|
187
187
|
|
188
188
|
VALUE rxml_new_cstr_len(const xmlChar* xstr, const long length, const xmlChar* xencoding)
|
@@ -197,7 +197,7 @@ void rxml_init_encoding(void)
|
|
197
197
|
rb_define_module_function(mXMLEncoding, "from_s", rxml_encoding_from_s, 1);
|
198
198
|
rb_define_module_function(mXMLEncoding, "to_s", rxml_encoding_to_s, 1);
|
199
199
|
|
200
|
-
rb_define_module_function(mXMLEncoding, "to_rb_encoding", rxml_encoding_to_rb_encoding,
|
200
|
+
rb_define_module_function(mXMLEncoding, "to_rb_encoding", rxml_encoding_to_rb_encoding, 1);
|
201
201
|
|
202
202
|
/* -1: No char encoding detected. */
|
203
203
|
rb_define_const(mXMLEncoding, "ERROR", INT2NUM(XML_CHAR_ENCODING_ERROR));
|
data/ext/libxml/ruby_xml_error.c
CHANGED
@@ -44,7 +44,7 @@ static ID ERROR_HANDLER_ID;
|
|
44
44
|
* Returns the proc that will be called when libxml generates
|
45
45
|
* warning, error or fatal error messages.
|
46
46
|
*/
|
47
|
-
static VALUE rxml_error_get_handler()
|
47
|
+
static VALUE rxml_error_get_handler(void)
|
48
48
|
{
|
49
49
|
VALUE block = rb_cvar_get(eXMLError, ERROR_HANDLER_ID);
|
50
50
|
return block;
|
@@ -165,7 +165,7 @@ NORETURN(void rxml_raise(xmlErrorPtr xerror))
|
|
165
165
|
rb_exc_raise(error);
|
166
166
|
}
|
167
167
|
|
168
|
-
void rxml_init_error()
|
168
|
+
void rxml_init_error(void)
|
169
169
|
{
|
170
170
|
CALL_METHOD = rb_intern("call");
|
171
171
|
ERROR_HANDLER_ID = rb_intern("@@__error_handler_callback__");
|
data/ext/libxml/ruby_xml_error.h
CHANGED
@@ -88,7 +88,7 @@ int ic_close(void *context)
|
|
88
88
|
*
|
89
89
|
* Register a new set of I/O callback for handling parser input.
|
90
90
|
*/
|
91
|
-
static VALUE input_callbacks_register_input_callbacks()
|
91
|
+
static VALUE input_callbacks_register_input_callbacks(void)
|
92
92
|
{
|
93
93
|
xmlRegisterInputCallbacks(ic_match, ic_open, ic_read, ic_close);
|
94
94
|
return (Qtrue);
|
data/ext/libxml/ruby_xml_io.c
CHANGED
@@ -30,7 +30,7 @@ int rxml_write_callback(VALUE io, const char *buffer, int len)
|
|
30
30
|
{
|
31
31
|
// Could be StringIO
|
32
32
|
VALUE written, string;
|
33
|
-
string = rb_external_str_new_with_enc(buffer, strlen(buffer), rb_enc_get(io));
|
33
|
+
string = rb_external_str_new_with_enc(buffer, (long)strlen(buffer), rb_enc_get(io));
|
34
34
|
written = rb_funcall(io, WRITE_METHOD, 1, string);
|
35
35
|
return NUM2INT(written);
|
36
36
|
}
|
data/ext/libxml/ruby_xml_node.c
CHANGED
@@ -1001,17 +1001,6 @@ static VALUE rxml_node_path(VALUE self)
|
|
1001
1001
|
return result;
|
1002
1002
|
}
|
1003
1003
|
|
1004
|
-
/*
|
1005
|
-
* call-seq:
|
1006
|
-
* node.pointer -> XML::NodeSet
|
1007
|
-
*
|
1008
|
-
* Evaluates an XPointer expression relative to this node.
|
1009
|
-
*/
|
1010
|
-
static VALUE rxml_node_pointer(VALUE self, VALUE xptr_str)
|
1011
|
-
{
|
1012
|
-
return (rxml_xpointer_point2(self, xptr_str));
|
1013
|
-
}
|
1014
|
-
|
1015
1004
|
/*
|
1016
1005
|
* call-seq:
|
1017
1006
|
* node.prev -> XML::Node
|
@@ -1397,7 +1386,6 @@ void rxml_init_node(void)
|
|
1397
1386
|
rb_define_method(cXMLNode, "output_escaping?", rxml_node_output_escaping_q, 0);
|
1398
1387
|
rb_define_method(cXMLNode, "output_escaping=", rxml_node_output_escaping_set, 1);
|
1399
1388
|
rb_define_method(cXMLNode, "path", rxml_node_path, 0);
|
1400
|
-
rb_define_method(cXMLNode, "pointer", rxml_node_pointer, 1);
|
1401
1389
|
rb_define_method(cXMLNode, "remove!", rxml_node_remove_ex, 0);
|
1402
1390
|
rb_define_method(cXMLNode, "space_preserve", rxml_node_space_preserve_get, 0);
|
1403
1391
|
rb_define_method(cXMLNode, "space_preserve=", rxml_node_space_preserve_set, 1);
|
@@ -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 "
|
5
|
-
#define RUBY_LIBXML_VERNUM
|
6
|
-
#define RUBY_LIBXML_VER_MAJ
|
7
|
-
#define RUBY_LIBXML_VER_MIN
|
8
|
-
#define RUBY_LIBXML_VER_MIC
|
4
|
+
#define RUBY_LIBXML_VERSION "4.1.0"
|
5
|
+
#define RUBY_LIBXML_VERNUM 400
|
6
|
+
#define RUBY_LIBXML_VER_MAJ 4
|
7
|
+
#define RUBY_LIBXML_VER_MIN 1
|
8
|
+
#define RUBY_LIBXML_VER_MIC 0
|
9
9
|
#define RUBY_LIBXML_VER_PATCH 0
|
data/lib/libxml-ruby.rb
CHANGED
data/test/test_xml.rb
CHANGED
@@ -249,14 +249,6 @@ class TestXml < Minitest::Test
|
|
249
249
|
assert_instance_of(Integer, LibXML::XML::VERNUM)
|
250
250
|
end
|
251
251
|
|
252
|
-
def test_libxml_parser_features
|
253
|
-
if windows?
|
254
|
-
assert_nil(LibXML::XML.features)
|
255
|
-
else
|
256
|
-
assert_instance_of(Array, LibXML::XML.features)
|
257
|
-
end
|
258
|
-
end
|
259
|
-
|
260
252
|
def test_default_options
|
261
253
|
assert_equal(0, LibXML::XML.default_options)
|
262
254
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libxml-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ross Bamform
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date:
|
17
|
+
date: 2023-04-30 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: rake-compiler
|
@@ -58,7 +58,6 @@ extra_rdoc_files: []
|
|
58
58
|
files:
|
59
59
|
- HISTORY
|
60
60
|
- LICENSE
|
61
|
-
- MANIFEST
|
62
61
|
- README.rdoc
|
63
62
|
- Rakefile
|
64
63
|
- ext/libxml/extconf.h
|
@@ -136,8 +135,6 @@ files:
|
|
136
135
|
- ext/libxml/ruby_xml_xpath_expression.h
|
137
136
|
- ext/libxml/ruby_xml_xpath_object.c
|
138
137
|
- ext/libxml/ruby_xml_xpath_object.h
|
139
|
-
- ext/libxml/ruby_xml_xpointer.c
|
140
|
-
- ext/libxml/ruby_xml_xpointer.h
|
141
138
|
- ext/vc/libxml_ruby.sln
|
142
139
|
- lib/libxml-ruby.rb
|
143
140
|
- lib/libxml.rb
|
@@ -168,7 +165,6 @@ files:
|
|
168
165
|
- script/benchmark/sock_entries.xml
|
169
166
|
- script/benchmark/throughput
|
170
167
|
- script/test
|
171
|
-
- setup.rb
|
172
168
|
- test/c14n/given/doc.dtd
|
173
169
|
- test/c14n/given/example-1.xml
|
174
170
|
- test/c14n/given/example-2.xml
|
@@ -252,7 +248,6 @@ files:
|
|
252
248
|
- test/test_relaxng.rb
|
253
249
|
- test/test_sax_parser.rb
|
254
250
|
- test/test_schema.rb
|
255
|
-
- test/test_suite.rb
|
256
251
|
- test/test_traversal.rb
|
257
252
|
- test/test_writer.rb
|
258
253
|
- test/test_xinclude.rb
|
@@ -260,7 +255,6 @@ files:
|
|
260
255
|
- test/test_xpath.rb
|
261
256
|
- test/test_xpath_context.rb
|
262
257
|
- test/test_xpath_expression.rb
|
263
|
-
- test/test_xpointer.rb
|
264
258
|
homepage: https://xml4r.github.io/libxml-ruby/
|
265
259
|
licenses:
|
266
260
|
- MIT
|
@@ -280,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
280
274
|
- !ruby/object:Gem::Version
|
281
275
|
version: '0'
|
282
276
|
requirements: []
|
283
|
-
rubygems_version: 3.
|
277
|
+
rubygems_version: 3.4.8
|
284
278
|
signing_key:
|
285
279
|
specification_version: 4
|
286
280
|
summary: Ruby Bindings for LibXML2
|
@@ -317,7 +311,6 @@ test_files:
|
|
317
311
|
- test/test_relaxng.rb
|
318
312
|
- test/test_sax_parser.rb
|
319
313
|
- test/test_schema.rb
|
320
|
-
- test/test_suite.rb
|
321
314
|
- test/test_traversal.rb
|
322
315
|
- test/test_writer.rb
|
323
316
|
- test/test_xinclude.rb
|
@@ -325,4 +318,3 @@ test_files:
|
|
325
318
|
- test/test_xpath.rb
|
326
319
|
- test/test_xpath_context.rb
|
327
320
|
- test/test_xpath_expression.rb
|
328
|
-
- test/test_xpointer.rb
|
data/MANIFEST
DELETED
@@ -1,166 +0,0 @@
|
|
1
|
-
#!mast -x doc/libxml-ruby/rdoc -i .gitignore ext doc lib script test [A-Z]*
|
2
|
-
ext/libxml/extconf.rb
|
3
|
-
ext/libxml/libxml.c
|
4
|
-
ext/libxml/ruby_libxml.h
|
5
|
-
ext/libxml/ruby_xml.c
|
6
|
-
ext/libxml/ruby_xml.h
|
7
|
-
ext/libxml/ruby_xml_attr.c
|
8
|
-
ext/libxml/ruby_xml_attr.h
|
9
|
-
ext/libxml/ruby_xml_attr_decl.c
|
10
|
-
ext/libxml/ruby_xml_attr_decl.h
|
11
|
-
ext/libxml/ruby_xml_attributes.c
|
12
|
-
ext/libxml/ruby_xml_attributes.h
|
13
|
-
ext/libxml/ruby_xml_cbg.c
|
14
|
-
ext/libxml/ruby_xml_document.c
|
15
|
-
ext/libxml/ruby_xml_document.h
|
16
|
-
ext/libxml/ruby_xml_dtd.c
|
17
|
-
ext/libxml/ruby_xml_dtd.h
|
18
|
-
ext/libxml/ruby_xml_encoding.c
|
19
|
-
ext/libxml/ruby_xml_encoding.h
|
20
|
-
ext/libxml/ruby_xml_error.c
|
21
|
-
ext/libxml/ruby_xml_error.h
|
22
|
-
ext/libxml/ruby_xml_html_parser.c
|
23
|
-
ext/libxml/ruby_xml_html_parser.h
|
24
|
-
ext/libxml/ruby_xml_html_parser_context.c
|
25
|
-
ext/libxml/ruby_xml_html_parser_context.h
|
26
|
-
ext/libxml/ruby_xml_html_parser_options.c
|
27
|
-
ext/libxml/ruby_xml_html_parser_options.h
|
28
|
-
ext/libxml/ruby_xml_input_cbg.c
|
29
|
-
ext/libxml/ruby_xml_input_cbg.h
|
30
|
-
ext/libxml/ruby_xml_io.c
|
31
|
-
ext/libxml/ruby_xml_io.h
|
32
|
-
ext/libxml/ruby_xml_namespace.c
|
33
|
-
ext/libxml/ruby_xml_namespace.h
|
34
|
-
ext/libxml/ruby_xml_namespaces.c
|
35
|
-
ext/libxml/ruby_xml_namespaces.h
|
36
|
-
ext/libxml/ruby_xml_node.c
|
37
|
-
ext/libxml/ruby_xml_node.h
|
38
|
-
ext/libxml/ruby_xml_parser.c
|
39
|
-
ext/libxml/ruby_xml_parser.h
|
40
|
-
ext/libxml/ruby_xml_parser_context.c
|
41
|
-
ext/libxml/ruby_xml_parser_context.h
|
42
|
-
ext/libxml/ruby_xml_parser_options.c
|
43
|
-
ext/libxml/ruby_xml_parser_options.h
|
44
|
-
ext/libxml/ruby_xml_reader.c
|
45
|
-
ext/libxml/ruby_xml_reader.h
|
46
|
-
ext/libxml/ruby_xml_relaxng.c
|
47
|
-
ext/libxml/ruby_xml_relaxng.h
|
48
|
-
ext/libxml/ruby_xml_sax2_handler.c
|
49
|
-
ext/libxml/ruby_xml_sax2_handler.h
|
50
|
-
ext/libxml/ruby_xml_sax_parser.c
|
51
|
-
ext/libxml/ruby_xml_sax_parser.h
|
52
|
-
ext/libxml/ruby_xml_schema.c
|
53
|
-
ext/libxml/ruby_xml_schema.h
|
54
|
-
ext/libxml/ruby_xml_version.h
|
55
|
-
ext/libxml/ruby_xml_xinclude.c
|
56
|
-
ext/libxml/ruby_xml_xinclude.h
|
57
|
-
ext/libxml/ruby_xml_xpath.c
|
58
|
-
ext/libxml/ruby_xml_xpath.h
|
59
|
-
ext/libxml/ruby_xml_xpath_context.c
|
60
|
-
ext/libxml/ruby_xml_xpath_context.h
|
61
|
-
ext/libxml/ruby_xml_xpath_expression.c
|
62
|
-
ext/libxml/ruby_xml_xpath_expression.h
|
63
|
-
ext/libxml/ruby_xml_xpath_object.c
|
64
|
-
ext/libxml/ruby_xml_xpath_object.h
|
65
|
-
ext/libxml/ruby_xml_xpointer.c
|
66
|
-
ext/libxml/ruby_xml_xpointer.h
|
67
|
-
ext/mingw/Rakefile
|
68
|
-
ext/mingw/build.rake
|
69
|
-
ext/mingw/libiconv-2.dll
|
70
|
-
ext/mingw/libxml2-2.dll
|
71
|
-
ext/mingw/libxml_ruby.dll.a
|
72
|
-
ext/mingw/libxml_ruby.so
|
73
|
-
ext/vc/libxml_ruby.sln
|
74
|
-
ext/vc/libxml_ruby_18/libxml_ruby.vcproj
|
75
|
-
ext/vc/libxml_ruby_19/libxml_ruby_19.vcproj
|
76
|
-
doc/.htaccess
|
77
|
-
doc/.rsync-filter
|
78
|
-
lib/libxml/attr.rb
|
79
|
-
lib/libxml/attr_decl.rb
|
80
|
-
lib/libxml/attributes.rb
|
81
|
-
lib/libxml/document.rb
|
82
|
-
lib/libxml/error.rb
|
83
|
-
lib/libxml/hpricot.rb
|
84
|
-
lib/libxml/html_parser.rb
|
85
|
-
lib/libxml/namespace.rb
|
86
|
-
lib/libxml/namespaces.rb
|
87
|
-
lib/libxml/node.rb
|
88
|
-
lib/libxml/ns.rb
|
89
|
-
lib/libxml/parser.rb
|
90
|
-
lib/libxml/properties.rb
|
91
|
-
lib/libxml/reader.rb
|
92
|
-
lib/libxml/sax_callbacks.rb
|
93
|
-
lib/libxml/sax_parser.rb
|
94
|
-
lib/libxml/tree.rb
|
95
|
-
lib/libxml/xpath_object.rb
|
96
|
-
lib/libxml.rb
|
97
|
-
lib/xml/libxml.rb
|
98
|
-
lib/xml.rb
|
99
|
-
script/benchmark/depixelate
|
100
|
-
script/benchmark/hamlet.xml
|
101
|
-
script/benchmark/parsecount
|
102
|
-
script/benchmark/sock_entries.xml
|
103
|
-
script/benchmark/throughput
|
104
|
-
script/test
|
105
|
-
test/etc_doc_to_s.rb
|
106
|
-
test/ets_doc_file.rb
|
107
|
-
test/ets_doc_to_s.rb
|
108
|
-
test/ets_gpx.rb
|
109
|
-
test/ets_node_gc.rb
|
110
|
-
test/ets_test.xml
|
111
|
-
test/ets_tsr.rb
|
112
|
-
test/model/atom.xml
|
113
|
-
test/model/bands.xml
|
114
|
-
test/model/books.xml
|
115
|
-
test/model/merge_bug_data.xml
|
116
|
-
test/model/ruby-lang.html
|
117
|
-
test/model/rubynet.xml
|
118
|
-
test/model/rubynet_project
|
119
|
-
test/model/shiporder.rnc
|
120
|
-
test/model/shiporder.rng
|
121
|
-
test/model/shiporder.xml
|
122
|
-
test/model/shiporder.xsd
|
123
|
-
test/model/soap.xml
|
124
|
-
test/model/xinclude.xml
|
125
|
-
test/test_attr.rb
|
126
|
-
test/test_attr_decl.rb
|
127
|
-
test/test_attributes.rb
|
128
|
-
test/test_deprecated_require.rb
|
129
|
-
test/test_document.rb
|
130
|
-
test/test_document_write.rb
|
131
|
-
test/test_dtd.rb
|
132
|
-
test/test_error.rb
|
133
|
-
test/test_html_parser.rb
|
134
|
-
test/test_namespace.rb
|
135
|
-
test/test_namespaces.rb
|
136
|
-
test/test_node.rb
|
137
|
-
test/test_node_cdata.rb
|
138
|
-
test/test_node_comment.rb
|
139
|
-
test/test_node_copy.rb
|
140
|
-
test/test_node_edit.rb
|
141
|
-
test/test_node_pi.rb
|
142
|
-
test/test_node_text.rb
|
143
|
-
test/test_node_write.rb
|
144
|
-
test/test_node_xlink.rb
|
145
|
-
test/test_parser.rb
|
146
|
-
test/test_parser_context.rb
|
147
|
-
test/test_properties.rb
|
148
|
-
test/test_reader.rb
|
149
|
-
test/test_relaxng.rb
|
150
|
-
test/test_sax_parser.rb
|
151
|
-
test/test_schema.rb
|
152
|
-
test/test_traversal.rb
|
153
|
-
test/test_xinclude.rb
|
154
|
-
test/test_xml.rb
|
155
|
-
test/test_xpath.rb
|
156
|
-
test/test_xpath_context.rb
|
157
|
-
test/test_xpath_expression.rb
|
158
|
-
test/test_xpointer.rb
|
159
|
-
test/test_suite.rb
|
160
|
-
Rakefile
|
161
|
-
HISTORY.rdoc
|
162
|
-
PROFILE
|
163
|
-
TODO
|
164
|
-
LICENSE
|
165
|
-
README.rdoc
|
166
|
-
VERSION
|
@@ -1,103 +0,0 @@
|
|
1
|
-
/* Please see the LICENSE file for copyright and distribution information */
|
2
|
-
|
3
|
-
#include "ruby_libxml.h"
|
4
|
-
#include "ruby_xml_xpointer.h"
|
5
|
-
|
6
|
-
#ifdef LIBXML_XPTR_ENABLED
|
7
|
-
#include <libxml/xpointer.h>
|
8
|
-
#endif
|
9
|
-
|
10
|
-
VALUE cXMLXPointer;
|
11
|
-
|
12
|
-
/*
|
13
|
-
* Document-class: LibXML::XML::XPointer
|
14
|
-
*
|
15
|
-
* The XML::Pointer class provides a standards based API for searching an xml document.
|
16
|
-
* XPointer is based on the XML Path Language (XML::XPath) and is documented
|
17
|
-
* at http://www.w3.org/TR/WD-xptr.
|
18
|
-
*/
|
19
|
-
|
20
|
-
static VALUE rxml_xpointer_point(VALUE class, VALUE rnode, VALUE xptr_str)
|
21
|
-
{
|
22
|
-
#ifdef LIBXML_XPTR_ENABLED
|
23
|
-
xmlNodePtr xnode;
|
24
|
-
xmlXPathContextPtr xctxt;
|
25
|
-
xmlXPathObjectPtr xpop;
|
26
|
-
|
27
|
-
VALUE context;
|
28
|
-
VALUE result;
|
29
|
-
VALUE argv[1];
|
30
|
-
|
31
|
-
Check_Type(xptr_str, T_STRING);
|
32
|
-
if (rb_obj_is_kind_of(rnode, cXMLNode) == Qfalse)
|
33
|
-
rb_raise(rb_eTypeError, "require an XML::Node object");
|
34
|
-
|
35
|
-
Data_Get_Struct(rnode, xmlNode, xnode);
|
36
|
-
|
37
|
-
argv[0] = rb_funcall(rnode, rb_intern("doc"), 0);
|
38
|
-
context = rb_class_new_instance(1, argv, cXMLXPathContext);
|
39
|
-
Data_Get_Struct(context, xmlXPathContext, xctxt);
|
40
|
-
|
41
|
-
xpop = xmlXPtrEval((xmlChar*)StringValuePtr(xptr_str), xctxt);
|
42
|
-
if (!xpop)
|
43
|
-
rxml_raise(&xmlLastError);
|
44
|
-
|
45
|
-
result = rxml_xpath_object_wrap(xnode->doc, xpop);
|
46
|
-
rb_iv_set(result, "@context", context);
|
47
|
-
|
48
|
-
return(result);
|
49
|
-
#else
|
50
|
-
rb_warn("libxml was compiled without XPointer support");
|
51
|
-
return (Qfalse);
|
52
|
-
#endif
|
53
|
-
}
|
54
|
-
|
55
|
-
VALUE rxml_xpointer_point2(VALUE node, VALUE xptr_str)
|
56
|
-
{
|
57
|
-
return (rxml_xpointer_point(cXMLXPointer, node, xptr_str));
|
58
|
-
}
|
59
|
-
|
60
|
-
/*
|
61
|
-
* call-seq:
|
62
|
-
* XML::XPointer.range(start_node, end_node) -> xpath
|
63
|
-
*
|
64
|
-
* Create an xpath representing the range between the supplied
|
65
|
-
* start and end node.
|
66
|
-
*/
|
67
|
-
static VALUE rxml_xpointer_range(VALUE class, VALUE rstart, VALUE rend)
|
68
|
-
{
|
69
|
-
#if defined LIBXML_XPTR_ENABLED && defined LIBXML_XPTR_LOCS_ENABLED
|
70
|
-
xmlNodePtr start, end;
|
71
|
-
VALUE rxxp;
|
72
|
-
xmlXPathObjectPtr xpath;
|
73
|
-
|
74
|
-
if (rb_obj_is_kind_of(rstart, cXMLNode) == Qfalse)
|
75
|
-
rb_raise(rb_eTypeError, "require an XML::Node object as a starting point");
|
76
|
-
if (rb_obj_is_kind_of(rend, cXMLNode) == Qfalse)
|
77
|
-
rb_raise(rb_eTypeError, "require an XML::Node object as an ending point");
|
78
|
-
|
79
|
-
Data_Get_Struct(rstart, xmlNode, start);
|
80
|
-
if (start == NULL)
|
81
|
-
return(Qnil);
|
82
|
-
|
83
|
-
Data_Get_Struct(rend, xmlNode, end);
|
84
|
-
if (end == NULL)
|
85
|
-
return(Qnil);
|
86
|
-
|
87
|
-
xpath = xmlXPtrNewRangeNodes(start, end);
|
88
|
-
if (xpath == NULL)
|
89
|
-
rb_fatal("You shouldn't be able to have this happen");
|
90
|
-
|
91
|
-
rxxp = rxml_xpath_object_wrap(start->doc, xpath);
|
92
|
-
return(rxxp);
|
93
|
-
#else
|
94
|
-
rb_warn("libxml was compiled without XPointer support");
|
95
|
-
return (Qfalse);
|
96
|
-
#endif
|
97
|
-
}
|
98
|
-
|
99
|
-
void rxml_init_xpointer(void)
|
100
|
-
{
|
101
|
-
cXMLXPointer = rb_define_class_under(mXML, "XPointer", rb_cObject);
|
102
|
-
rb_define_singleton_method(cXMLXPointer, "range", rxml_xpointer_range, 2);
|
103
|
-
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
/* Please see the LICENSE file for copyright and distribution information */
|
2
|
-
|
3
|
-
#ifndef __RXML_XPOINTER__
|
4
|
-
#define __RXML_XPOINTER__
|
5
|
-
|
6
|
-
extern VALUE cXMLXPointer;
|
7
|
-
|
8
|
-
void rxml_init_xpointer(void);
|
9
|
-
VALUE rxml_xpointer_point2(VALUE node, VALUE xptr_str);
|
10
|
-
|
11
|
-
#endif
|