libxml-ruby 3.2.4-x64-mingw-ucrt → 4.1.1-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 +15 -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 +3 -3
- data/ext/libxml/ruby_xml_error.h +1 -1
- 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_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/3.1/libxml_ruby.so +0 -0
- data/lib/3.2/libxml_ruby.so +0 -0
- data/lib/libxml/error.rb +7 -7
- data/lib/libxml-ruby.rb +1 -1
- data/test/test_error.rb +173 -157
- data/test/test_xml.rb +0 -8
- metadata +4 -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
@@ -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
|