libxml-ruby 3.2.1 → 3.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY +22 -0
- data/Rakefile +24 -16
- data/ext/libxml/ruby_libxml.h +0 -22
- data/ext/libxml/ruby_xml.c +6 -0
- data/ext/libxml/ruby_xml_document.c +6 -0
- data/ext/libxml/ruby_xml_encoding.h +2 -0
- data/ext/libxml/ruby_xml_error.h +2 -0
- data/ext/libxml/ruby_xml_html_parser.c +2 -0
- data/ext/libxml/ruby_xml_html_parser_context.c +1 -0
- data/ext/libxml/ruby_xml_html_parser_options.c +2 -0
- data/ext/libxml/ruby_xml_namespace.c +1 -0
- data/ext/libxml/ruby_xml_node.c +12 -4
- data/ext/libxml/ruby_xml_parser_context.c +2 -0
- data/ext/libxml/ruby_xml_reader.c +3 -0
- data/ext/libxml/ruby_xml_reader.h +0 -3
- data/ext/libxml/ruby_xml_relaxng.c +2 -0
- data/ext/libxml/ruby_xml_relaxng.h +0 -2
- data/ext/libxml/ruby_xml_schema.c +223 -81
- data/ext/libxml/ruby_xml_schema.h +4 -788
- data/ext/libxml/ruby_xml_schema_attribute.c +69 -71
- data/ext/libxml/ruby_xml_schema_attribute.h +25 -3
- data/ext/libxml/ruby_xml_schema_element.c +28 -54
- data/ext/libxml/ruby_xml_schema_element.h +0 -3
- data/ext/libxml/ruby_xml_schema_facet.c +19 -21
- data/ext/libxml/ruby_xml_schema_facet.h +0 -4
- data/ext/libxml/ruby_xml_schema_type.c +56 -37
- data/ext/libxml/ruby_xml_version.h +3 -3
- data/ext/libxml/ruby_xml_writer.c +4 -0
- data/ext/libxml/ruby_xml_writer.h +0 -4
- data/ext/libxml/ruby_xml_xinclude.c +4 -0
- data/ext/libxml/ruby_xml_xpath.c +1 -0
- data/ext/libxml/ruby_xml_xpath.h +2 -0
- data/ext/libxml/ruby_xml_xpath_context.c +2 -0
- data/ext/libxml/ruby_xml_xpath_object.c +1 -0
- data/ext/libxml/ruby_xml_xpointer.c +5 -1
- data/lib/libxml-ruby.rb +1 -1
- 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 +2 -1
- data/test/test_dtd.rb +2 -1
- data/test/test_helper.rb +6 -0
- data/test/test_parser.rb +1 -1
- data/test/test_parser_context.rb +1 -7
- 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_xml.rb +17 -4
- metadata +11 -10
- data/test/test.xml +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f06b4949ffd040a0587458c5e06af9638a8bbd5138d9febdade9c1ffe89f9e9
|
4
|
+
data.tar.gz: d4e6ba9273e3b897fe09710e56a6e13faf9b37b99ac409dfac950f9ebce8cca7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87a83e5460f26c7ee1678587b2123ca5663cb45af60f2f8aef4e49486e7c77c6f0b7d74f15c9c6e45f025d3206e9f0b986bc416a18077af1cc35c9ce5f2c7d52
|
7
|
+
data.tar.gz: c6bb25a27405a90be3ce34cffea4c79c2a359daebd82041dd1f2c2b536a1c064bcedeb75157b440ca2cc629c6c86cbaad7d58eaba1a877c383f6cffc8930fd05
|
data/HISTORY
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
= Release History
|
2
2
|
|
3
|
+
== 3.2.4 / 2022-10-29
|
4
|
+
|
5
|
+
* Support libxml2 version 2.10.2 (Charlie Savage)
|
6
|
+
* Reduce number of globally included C header files (Charlie Savage)
|
7
|
+
|
8
|
+
== 3.2.3 / 2022-05-22
|
9
|
+
|
10
|
+
* Change some getter methods to instance variables with attr_accessors for easier debuggability (David Hansen)
|
11
|
+
* Add a number of tests related to schemas (David Hansen)
|
12
|
+
* Add schema.imported_elements so we can find imported elements (David Hansen)
|
13
|
+
* Fix segfault under windows when dereferencing a pre-existing error where the node has already been freed (David Hansen)
|
14
|
+
* Update to change name from imported_elements to imported_ns_elements and return a hash of hashes for namespaced elements (David Hansen)
|
15
|
+
* Only call xmlGetFeaturesList if LIBXML_LEGACY_ENABLED is defined. Most distros still ship libxml2 with legacy features enabled, but this will change (Nick Wellnhofer)
|
16
|
+
* Update GitHub Actions to use ruby/setup-ruby (Greg)
|
17
|
+
* Fix memory leak in rxml_node_path, node.path (vovanmozg)
|
18
|
+
|
19
|
+
== 3.2.2 / 2022-01-15
|
20
|
+
* Switch to Github actions for CI/CD (Greg)
|
21
|
+
* Test fixes (Greg, Sergio Durigan Junior)
|
22
|
+
* Fix typo on test/test_sax_parser.rb (Sergio Durigan Junior)
|
23
|
+
* Update homepage in gemspec (Pirate Praveen Arimbrathodiyil)
|
24
|
+
|
3
25
|
== 3.2.1 / 2020-11-05
|
4
26
|
|
5
27
|
* Fix incorrect handling of encodings when using XMLWriter.io (Charlie Savage)
|
data/Rakefile
CHANGED
@@ -16,21 +16,29 @@ spec = Gem::Specification.load("#{GEM_NAME}.gemspec")
|
|
16
16
|
task :default => [:test]
|
17
17
|
|
18
18
|
# Setup compile tasks
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
ext.config_options <<
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
19
|
+
Rake::ExtensionTask.new do |ext|
|
20
|
+
ext.gem_spec = spec
|
21
|
+
ext.name = SO_NAME
|
22
|
+
ext.ext_dir = "ext/libxml"
|
23
|
+
ext.lib_dir = "lib/#{RUBY_VERSION.sub(/\.\d$/, '')}"
|
24
|
+
if RUBY_PLATFORM.match(/mswin|mingw/)
|
25
|
+
ext.config_options <<
|
26
|
+
if (dir = ENV['WINDOWS_XML2_INCLUDE'])
|
27
|
+
"--with-xml2-include=#{dir}"
|
28
|
+
else
|
29
|
+
case RUBY_PLATFORM
|
30
|
+
when 'i386-mingw32'
|
31
|
+
'--with-xml2-include=C:/msys64/mingw32/include/libxml2'
|
32
|
+
when 'x64-mingw32'
|
33
|
+
'--with-xml2-include=C:/msys64/mingw64/include/libxml2'
|
34
|
+
when 'x64-mingw-ucrt'
|
35
|
+
'--with-xml2-include=C:/msys64/ucrt64/include/libxml2'
|
36
|
+
else
|
37
|
+
raise "Unknown Windows Ruby, please set ENV['WINDOWS_XML2_INCLUDE']"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
else
|
41
|
+
ext.config_options << '--with-xml2-include=/usr/include/libxml2'
|
34
42
|
end
|
35
43
|
end
|
36
44
|
|
@@ -41,7 +49,7 @@ Gem::PackageTask.new(spec) do |pkg|
|
|
41
49
|
end
|
42
50
|
|
43
51
|
# Setup Windows Gem
|
44
|
-
if RUBY_PLATFORM.match(/
|
52
|
+
if RUBY_PLATFORM.match(/mswin|mingw/)
|
45
53
|
binaries = (FileList['lib/**/*.so',
|
46
54
|
'lib/**/*dll'])
|
47
55
|
|
data/ext/libxml/ruby_libxml.h
CHANGED
@@ -4,29 +4,7 @@
|
|
4
4
|
#define __RUBY_LIBXML_H__
|
5
5
|
|
6
6
|
#include <ruby.h>
|
7
|
-
#include <libxml/parser.h>
|
8
|
-
#include <libxml/parserInternals.h>
|
9
|
-
#include <libxml/debugXML.h>
|
10
7
|
#include <libxml/xmlversion.h>
|
11
|
-
#include <libxml/xmlmemory.h>
|
12
|
-
#include <libxml/xpath.h>
|
13
|
-
#include <libxml/valid.h>
|
14
|
-
#include <libxml/catalog.h>
|
15
|
-
#include <libxml/HTMLparser.h>
|
16
|
-
#include <libxml/xmlreader.h>
|
17
|
-
#include <libxml/c14n.h>
|
18
|
-
|
19
|
-
#include <ruby/encoding.h>
|
20
|
-
|
21
|
-
#ifdef LIBXML_DEBUG_ENABLED
|
22
|
-
#include <libxml/xpathInternals.h>
|
23
|
-
#endif
|
24
|
-
#ifdef LIBXML_XINCLUDE_ENABLED
|
25
|
-
#include <libxml/xinclude.h>
|
26
|
-
#endif
|
27
|
-
#ifdef LIBXML_XPTR_ENABLED
|
28
|
-
#include <libxml/xpointer.h>
|
29
|
-
#endif
|
30
8
|
|
31
9
|
#include "ruby_xml_version.h"
|
32
10
|
#include "ruby_xml.h"
|
data/ext/libxml/ruby_xml.c
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
#include "ruby_libxml.h"
|
2
2
|
#include "ruby_xml.h"
|
3
3
|
|
4
|
+
#include <libxml/catalog.h>
|
5
|
+
|
4
6
|
VALUE mXML;
|
5
7
|
|
6
8
|
/*
|
@@ -764,6 +766,9 @@ static VALUE rxml_default_save_no_empty_tags_set(VALUE klass, VALUE value)
|
|
764
766
|
*/
|
765
767
|
static VALUE rxml_features(VALUE klass)
|
766
768
|
{
|
769
|
+
#ifndef LIBXML_LEGACY_ENABLED
|
770
|
+
return Qnil;
|
771
|
+
#else
|
767
772
|
VALUE arr, str;
|
768
773
|
int i, len = MAX_LIBXML_FEATURES_LEN;
|
769
774
|
char **list = NULL;
|
@@ -788,6 +793,7 @@ static VALUE rxml_features(VALUE klass)
|
|
788
793
|
|
789
794
|
ruby_xfree(list);
|
790
795
|
return (arr);
|
796
|
+
#endif /* LIBXML_LEGACY_ENABLED */
|
791
797
|
}
|
792
798
|
|
793
799
|
/*
|
@@ -52,6 +52,12 @@
|
|
52
52
|
#include "ruby_libxml.h"
|
53
53
|
#include "ruby_xml_document.h"
|
54
54
|
|
55
|
+
#include <libxml/c14n.h>
|
56
|
+
#include <libxml/debugXML.h>
|
57
|
+
#include <libxml/relaxng.h>
|
58
|
+
#include <libxml/xmlschemas.h>
|
59
|
+
#include <libxml/xinclude.h>
|
60
|
+
|
55
61
|
VALUE cXMLDocument;
|
56
62
|
|
57
63
|
void rxml_document_free(xmlDocPtr xdoc)
|
data/ext/libxml/ruby_xml_error.h
CHANGED
@@ -52,6 +52,7 @@ static VALUE rxml_namespace_initialize(VALUE self, VALUE node, VALUE prefix,
|
|
52
52
|
|
53
53
|
Check_Type(node, T_DATA);
|
54
54
|
Data_Get_Struct(node, xmlNode, xnode);
|
55
|
+
xmlResetLastError();
|
55
56
|
|
56
57
|
/* Prefix can be null - that means its the default namespace */
|
57
58
|
xmlPrefix = NIL_P(prefix) ? NULL : (xmlChar *)StringValuePtr(prefix);
|
data/ext/libxml/ruby_xml_node.c
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
#include "ruby_xml_node.h"
|
3
3
|
#include <assert.h>
|
4
4
|
|
5
|
+
#include <libxml/debugXML.h>
|
6
|
+
#include <libxml/parserInternals.h>
|
7
|
+
#include <libxml/xlink.h>
|
8
|
+
|
5
9
|
VALUE cXMLNode;
|
6
10
|
|
7
11
|
/* Document-class: LibXML::XML::Node
|
@@ -983,14 +987,18 @@ static VALUE rxml_node_path(VALUE self)
|
|
983
987
|
{
|
984
988
|
xmlNodePtr xnode;
|
985
989
|
xmlChar *path;
|
990
|
+
VALUE result = Qnil;
|
986
991
|
|
987
992
|
xnode = rxml_get_xnode(self);
|
988
993
|
path = xmlGetNodePath(xnode);
|
989
994
|
|
990
|
-
if (path
|
991
|
-
|
992
|
-
|
993
|
-
|
995
|
+
if (path)
|
996
|
+
{
|
997
|
+
result = rxml_new_cstr( path, NULL);
|
998
|
+
xmlFree(path);
|
999
|
+
}
|
1000
|
+
|
1001
|
+
return result;
|
994
1002
|
}
|
995
1003
|
|
996
1004
|
/*
|