libxml-ruby 3.2.1 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/HISTORY +37 -0
- data/Rakefile +24 -16
- data/ext/libxml/libxml.c +0 -1
- data/ext/libxml/libxml_ruby.def +0 -1
- data/ext/libxml/ruby_libxml.h +0 -23
- data/ext/libxml/ruby_xml.c +3 -37
- data/ext/libxml/ruby_xml.h +1 -1
- data/ext/libxml/ruby_xml_cbg.c +1 -1
- data/ext/libxml/ruby_xml_document.c +6 -0
- data/ext/libxml/ruby_xml_dtd.c +1 -1
- data/ext/libxml/ruby_xml_encoding.c +2 -2
- data/ext/libxml/ruby_xml_encoding.h +2 -0
- data/ext/libxml/ruby_xml_error.c +3 -3
- data/ext/libxml/ruby_xml_error.h +3 -1
- data/ext/libxml/ruby_xml_html_parser.c +2 -0
- data/ext/libxml/ruby_xml_html_parser_context.c +1 -1
- data/ext/libxml/ruby_xml_html_parser_options.c +2 -0
- data/ext/libxml/ruby_xml_input_cbg.c +4 -7
- data/ext/libxml/ruby_xml_io.c +1 -1
- data/ext/libxml/ruby_xml_namespace.c +1 -0
- data/ext/libxml/ruby_xml_node.c +11 -15
- data/ext/libxml/ruby_xml_parser.h +0 -2
- data/ext/libxml/ruby_xml_parser_context.c +2 -0
- data/ext/libxml/ruby_xml_parser_options.h +0 -2
- 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 +4 -4
- 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/lib/libxml/error.rb +7 -7
- 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_error.rb +173 -157
- 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 +12 -7
- metadata +11 -18
- data/MANIFEST +0 -166
- data/ext/libxml/ruby_xml_xpointer.c +0 -99
- data/ext/libxml/ruby_xml_xpointer.h +0 -11
- data/setup.rb +0 -1584
- data/test/test.xml +0 -2
- data/test/test_suite.rb +0 -48
- data/test/test_xpointer.rb +0 -72
data/test/test.xml
DELETED
data/test/test_suite.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
# Change to current directory so relative
|
4
|
-
# requires work.
|
5
|
-
dir = File.dirname(__FILE__)
|
6
|
-
Dir.chdir(dir)
|
7
|
-
|
8
|
-
require './test_attr'
|
9
|
-
require './test_attr_decl'
|
10
|
-
require './test_attributes'
|
11
|
-
require './test_canonicalize'
|
12
|
-
require './test_document'
|
13
|
-
require './test_document_write'
|
14
|
-
require './test_dtd'
|
15
|
-
require './test_error'
|
16
|
-
require './test_html_parser'
|
17
|
-
require './test_html_parser_context'
|
18
|
-
require './test_namespace'
|
19
|
-
require './test_namespaces'
|
20
|
-
require './test_node'
|
21
|
-
require './test_node_cdata'
|
22
|
-
require './test_node_comment'
|
23
|
-
require './test_node_copy'
|
24
|
-
require './test_node_edit'
|
25
|
-
require './test_node_pi'
|
26
|
-
require './test_node_text'
|
27
|
-
require './test_node_write'
|
28
|
-
require './test_node_xlink'
|
29
|
-
require './test_parser'
|
30
|
-
require './test_parser_context'
|
31
|
-
require './test_reader'
|
32
|
-
require './test_relaxng'
|
33
|
-
require './test_sax_parser'
|
34
|
-
require './test_schema'
|
35
|
-
require './test_traversal'
|
36
|
-
require './test_writer'
|
37
|
-
require './test_xinclude'
|
38
|
-
require './test_xpath'
|
39
|
-
require './test_xpath_context'
|
40
|
-
require './test_xpath_expression'
|
41
|
-
require './test_xpointer'
|
42
|
-
|
43
|
-
require './test_encoding'
|
44
|
-
require './test_encoding_sax'
|
45
|
-
|
46
|
-
# Compatibility
|
47
|
-
require './test_properties'
|
48
|
-
require './test_deprecated_require'
|
data/test/test_xpointer.rb
DELETED
@@ -1,72 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
require_relative './test_helper'
|
3
|
-
|
4
|
-
class TC_XML_XPointer < Minitest::Test
|
5
|
-
def setup()
|
6
|
-
xp = LibXML::XML::Parser.string('<!DOCTYPE ra [<!ELEMENT ra (foo+)><!ATTLIST ra id ID #IMPLIED><!ELEMENT foo (#PCDATA)><!ATTLIST foo id ID #IMPLIED>]><ra id="start"><foo id="one">one</foo><foo id="two">two</foo><foo id="three">three</foo></ra>')
|
7
|
-
@doc = xp.parse
|
8
|
-
assert_instance_of(LibXML::XML::Document, @doc)
|
9
|
-
@root = @doc.root
|
10
|
-
assert_instance_of(LibXML::XML::Node, @root)
|
11
|
-
end
|
12
|
-
|
13
|
-
def teardown()
|
14
|
-
@doc = nil
|
15
|
-
@root = nil
|
16
|
-
@xptr = nil
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_libxml_xpointer_id
|
20
|
-
xptr = @root.pointer('xpointer(id("two"))')
|
21
|
-
assert_instance_of(LibXML::XML::XPath::Object, xptr)
|
22
|
-
xptr.each do |node|
|
23
|
-
# It seems from the spec that the pointer should
|
24
|
-
# be the whole node, rather than just the ID attr.
|
25
|
-
assert_equal('two', node.content)
|
26
|
-
assert_instance_of(LibXML::XML::Node, node)
|
27
|
-
assert_equal('two', node['id'])
|
28
|
-
end
|
29
|
-
|
30
|
-
# FIXME: Not sure at all about this kind of range
|
31
|
-
if ENV['NOTWORKING']
|
32
|
-
@xptr = @root.pointer('xpointer(id("two")) xpointer(id("three"))')
|
33
|
-
assert_instance_of(LibXML::XML::XPath, @xptr)
|
34
|
-
assert_instance_of(LibXML::XML::Node::Set, @xptr.set)
|
35
|
-
assert_equal(2, @xptr.set.length)
|
36
|
-
for n in @xptr.set
|
37
|
-
assert_match(/two|three/, n.to_s)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
# FIXME: There is a bug in these ranges...
|
43
|
-
if ENV['NOTWORKING']
|
44
|
-
def test_libxml_xpointer_range()
|
45
|
-
nstart = nend = nil
|
46
|
-
@xptr = @root.pointer('xpointer(id("one"))').set
|
47
|
-
@xptr.each{|n| nstart = n}
|
48
|
-
assert_instance_of(LibXML::XML::Node, nstart)
|
49
|
-
@xptr = @root.pointer('xpointer(id("three"))').set
|
50
|
-
@xptr.each{|n| nend = n}
|
51
|
-
assert_instance_of(LibXML::XML::Node, nend)
|
52
|
-
range = LibXML::XML::XPointer.range(nstart, nend)
|
53
|
-
assert_instance_of(LibXML::XML::XPath, range)
|
54
|
-
assert_instance_of(LibXML::XML::Node::Set, range.set)
|
55
|
-
|
56
|
-
for n in range.set
|
57
|
-
assert_match(/one|two|three/, n.to_s)
|
58
|
-
end
|
59
|
-
assert_equal(3, range.set.length)
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
# def test_libxml_xpointer_start_point()
|
64
|
-
# @xptr = @root.pointer('xpointer(start-point("one"))')
|
65
|
-
# assert_instance_of(LibXML::XML::XPath, @xptr)
|
66
|
-
# set = @xptr.set
|
67
|
-
# assert_instance_of(LibXML::XML::Node::Set, set)
|
68
|
-
# for n in set
|
69
|
-
# assert_match(/one|two|three/, n.to_s)
|
70
|
-
# end
|
71
|
-
# end
|
72
|
-
end
|