nokogiri 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of nokogiri might be problematic. Click here for more details.
- data/CHANGELOG.ja.rdoc +45 -0
- data/CHANGELOG.rdoc +53 -1
- data/Manifest.txt +3 -3
- data/README.ja.rdoc +1 -1
- data/README.rdoc +11 -5
- data/Rakefile +13 -79
- data/ext/nokogiri/extconf.rb +22 -74
- data/ext/nokogiri/html_document.c +17 -8
- data/ext/nokogiri/html_element_description.c +20 -16
- data/ext/nokogiri/html_entity_lookup.c +2 -2
- data/ext/nokogiri/html_sax_parser_context.c +10 -8
- data/ext/nokogiri/nokogiri.c +0 -1
- data/ext/nokogiri/nokogiri.h +33 -28
- data/ext/nokogiri/xml_attr.c +7 -5
- data/ext/nokogiri/xml_attribute_decl.c +5 -2
- data/ext/nokogiri/xml_cdata.c +4 -2
- data/ext/nokogiri/xml_comment.c +4 -2
- data/ext/nokogiri/xml_document.c +93 -15
- data/ext/nokogiri/xml_document.h +0 -1
- data/ext/nokogiri/xml_document_fragment.c +4 -2
- data/ext/nokogiri/xml_dtd.c +18 -8
- data/ext/nokogiri/xml_element_content.c +2 -2
- data/ext/nokogiri/xml_entity_decl.c +15 -2
- data/ext/nokogiri/xml_entity_reference.c +4 -2
- data/ext/nokogiri/xml_io.c +1 -1
- data/ext/nokogiri/xml_namespace.c +5 -3
- data/ext/nokogiri/xml_node.c +353 -114
- data/ext/nokogiri/xml_node_set.c +35 -22
- data/ext/nokogiri/xml_node_set.h +1 -1
- data/ext/nokogiri/xml_processing_instruction.c +4 -2
- data/ext/nokogiri/xml_reader.c +119 -47
- data/ext/nokogiri/xml_relax_ng.c +21 -12
- data/ext/nokogiri/xml_sax_parser.c +6 -3
- data/ext/nokogiri/xml_sax_parser.h +13 -17
- data/ext/nokogiri/xml_sax_parser_context.c +8 -6
- data/ext/nokogiri/xml_sax_push_parser.c +7 -6
- data/ext/nokogiri/xml_schema.c +62 -13
- data/ext/nokogiri/xml_syntax_error.c +18 -12
- data/ext/nokogiri/xml_syntax_error.h +1 -1
- data/ext/nokogiri/xml_text.c +4 -2
- data/ext/nokogiri/xml_xpath_context.c +60 -23
- data/ext/nokogiri/xslt_stylesheet.c +14 -3
- data/lib/nokogiri.rb +17 -0
- data/lib/nokogiri/css/generated_parser.rb +72 -62
- data/lib/nokogiri/css/generated_tokenizer.rb +23 -24
- data/lib/nokogiri/css/parser.y +3 -1
- data/lib/nokogiri/css/tokenizer.rex +3 -3
- data/lib/nokogiri/css/xpath_visitor.rb +8 -3
- data/lib/nokogiri/ffi/html/sax/parser_context.rb +3 -3
- data/lib/nokogiri/ffi/libxml.rb +16 -2
- data/lib/nokogiri/ffi/structs/common_node.rb +15 -3
- data/lib/nokogiri/ffi/structs/xml_document.rb +13 -4
- data/lib/nokogiri/ffi/structs/xml_xpath_context.rb +3 -2
- data/lib/nokogiri/ffi/weak_bucket.rb +40 -0
- data/lib/nokogiri/ffi/xml/document.rb +27 -0
- data/lib/nokogiri/ffi/xml/entity_decl.rb +9 -0
- data/lib/nokogiri/ffi/xml/node.rb +142 -61
- data/lib/nokogiri/ffi/xml/node_set.rb +15 -12
- data/lib/nokogiri/ffi/xml/reader.rb +5 -0
- data/lib/nokogiri/ffi/xml/schema.rb +17 -0
- data/lib/nokogiri/ffi/xml/syntax_error.rb +4 -4
- data/lib/nokogiri/ffi/xml/xpath.rb +0 -10
- data/lib/nokogiri/ffi/xml/xpath_context.rb +22 -9
- data/lib/nokogiri/ffi/xslt/stylesheet.rb +3 -0
- data/lib/nokogiri/html/document.rb +5 -3
- data/lib/nokogiri/html/document_fragment.rb +28 -7
- data/lib/nokogiri/version.rb +6 -2
- data/lib/nokogiri/version_warning.rb +6 -3
- data/lib/nokogiri/xml.rb +1 -1
- data/lib/nokogiri/xml/builder.rb +35 -22
- data/lib/nokogiri/xml/document.rb +44 -12
- data/lib/nokogiri/xml/document_fragment.rb +16 -12
- data/lib/nokogiri/xml/entity_decl.rb +4 -0
- data/lib/nokogiri/xml/node.rb +152 -95
- data/lib/nokogiri/xml/node_set.rb +2 -1
- data/lib/nokogiri/xml/sax/push_parser.rb +1 -1
- data/lib/nokogiri/xml/schema.rb +1 -5
- data/lib/nokogiri/xml/syntax_error.rb +4 -0
- data/lib/nokogiri/xml/text.rb +9 -0
- data/lib/nokogiri/xml/xpath/syntax_error.rb +3 -0
- data/tasks/cross_compile.rb +158 -0
- data/tasks/test.rb +0 -6
- data/test/css/test_xpath_visitor.rb +9 -0
- data/test/helper.rb +49 -11
- data/test/html/sax/test_parser.rb +11 -1
- data/test/html/test_document.rb +8 -0
- data/test/html/test_document_fragment.rb +14 -2
- data/test/html/test_element_description.rb +5 -1
- data/test/html/test_node.rb +5 -66
- data/test/test_reader.rb +28 -0
- data/test/test_xslt_transforms.rb +14 -0
- data/test/xml/test_builder.rb +43 -0
- data/test/xml/test_cdata.rb +12 -0
- data/test/xml/test_document.rb +74 -39
- data/test/xml/test_document_fragment.rb +36 -0
- data/test/xml/test_entity_decl.rb +37 -0
- data/test/xml/test_node.rb +192 -65
- data/test/xml/test_node_reparenting.rb +253 -236
- data/test/xml/test_node_set.rb +67 -0
- data/test/xml/test_text.rb +8 -0
- data/test/xml/test_xpath.rb +32 -0
- metadata +103 -48
- data.tar.gz.sig +0 -0
- data/ext/nokogiri/xml_xpath.c +0 -53
- data/ext/nokogiri/xml_xpath.h +0 -11
- data/lib/nokogiri/xml/fragment_handler.rb +0 -79
- metadata.gz.sig +0 -0
data/test/xml/test_node_set.rb
CHANGED
@@ -459,6 +459,15 @@ module Nokogiri
|
|
459
459
|
assert_equal employees.length, employees[0, employees.length].length
|
460
460
|
end
|
461
461
|
|
462
|
+
def test_slice_waaaaaay_off_the_end
|
463
|
+
xml = Nokogiri::XML::Builder.new {
|
464
|
+
root { 100.times { div } }
|
465
|
+
}.doc
|
466
|
+
nodes = xml.css "div"
|
467
|
+
assert_equal 1, nodes.slice(99, 100_000).length
|
468
|
+
assert_equal 0, nodes.slice(100, 100_000).length
|
469
|
+
end
|
470
|
+
|
462
471
|
def test_array_slice_with_start_and_end
|
463
472
|
employees = @xml.search("//employee")
|
464
473
|
assert_equal [employees[1], employees[2], employees[3]], employees[1,3].to_a
|
@@ -577,6 +586,64 @@ module Nokogiri
|
|
577
586
|
|
578
587
|
assert_equal children, children.reverse.reverse
|
579
588
|
end
|
589
|
+
|
590
|
+
def test_node_set_dup_result_has_document_and_is_decorated
|
591
|
+
x = Module.new do
|
592
|
+
def awesome! ; end
|
593
|
+
end
|
594
|
+
util_decorate(@xml, x)
|
595
|
+
node_set = @xml.css("address")
|
596
|
+
new_set = node_set.dup
|
597
|
+
assert_equal node_set.document, new_set.document
|
598
|
+
assert new_set.respond_to?(:awesome!)
|
599
|
+
end
|
600
|
+
|
601
|
+
def test_node_set_union_result_has_document_and_is_decorated
|
602
|
+
x = Module.new do
|
603
|
+
def awesome! ; end
|
604
|
+
end
|
605
|
+
util_decorate(@xml, x)
|
606
|
+
node_set1 = @xml.css("address")
|
607
|
+
node_set2 = @xml.css("address")
|
608
|
+
new_set = node_set1 | node_set2
|
609
|
+
assert_equal node_set1.document, new_set.document
|
610
|
+
assert new_set.respond_to?(:awesome!)
|
611
|
+
end
|
612
|
+
|
613
|
+
def test_node_set_intersection_result_has_document_and_is_decorated
|
614
|
+
x = Module.new do
|
615
|
+
def awesome! ; end
|
616
|
+
end
|
617
|
+
util_decorate(@xml, x)
|
618
|
+
node_set1 = @xml.css("address")
|
619
|
+
node_set2 = @xml.css("address")
|
620
|
+
new_set = node_set1 & node_set2
|
621
|
+
assert_equal node_set1.document, new_set.document
|
622
|
+
assert new_set.respond_to?(:awesome!)
|
623
|
+
end
|
624
|
+
|
625
|
+
def test_node_set_difference_result_has_document_and_is_decorated
|
626
|
+
x = Module.new do
|
627
|
+
def awesome! ; end
|
628
|
+
end
|
629
|
+
util_decorate(@xml, x)
|
630
|
+
node_set1 = @xml.css("address")
|
631
|
+
node_set2 = @xml.css("address")
|
632
|
+
new_set = node_set1 - node_set2
|
633
|
+
assert_equal node_set1.document, new_set.document
|
634
|
+
assert new_set.respond_to?(:awesome!)
|
635
|
+
end
|
636
|
+
|
637
|
+
def test_node_set_slice_result_has_document_and_is_decorated
|
638
|
+
x = Module.new do
|
639
|
+
def awesome! ; end
|
640
|
+
end
|
641
|
+
util_decorate(@xml, x)
|
642
|
+
node_set = @xml.css("address")
|
643
|
+
new_set = node_set[0..-1]
|
644
|
+
assert_equal node_set.document, new_set.document
|
645
|
+
assert new_set.respond_to?(:awesome!)
|
646
|
+
end
|
580
647
|
end
|
581
648
|
end
|
582
649
|
end
|
data/test/xml/test_text.rb
CHANGED
@@ -25,6 +25,14 @@ module Nokogiri
|
|
25
25
|
node = Nokogiri::XML::Element.new('foo', doc)
|
26
26
|
text = Text.new('hello world', node)
|
27
27
|
end
|
28
|
+
|
29
|
+
def test_content=
|
30
|
+
node = Text.new('foo', Document.new)
|
31
|
+
assert_equal('foo', node.content)
|
32
|
+
node.content = '& <foo> &'
|
33
|
+
assert_equal('& <foo> &', node.content)
|
34
|
+
assert_equal('& <foo> &amp;', node.to_xml)
|
35
|
+
end
|
28
36
|
end
|
29
37
|
end
|
30
38
|
end
|
data/test/xml/test_xpath.rb
CHANGED
@@ -27,9 +27,30 @@ module Nokogiri
|
|
27
27
|
def my_filter set, attribute, value
|
28
28
|
set.find_all { |x| x[attribute] == value }
|
29
29
|
end
|
30
|
+
|
31
|
+
def saves_node_set node_set
|
32
|
+
@things = node_set
|
33
|
+
end
|
30
34
|
}.new
|
31
35
|
end
|
32
36
|
|
37
|
+
def test_unknown_attribute
|
38
|
+
assert_equal 0, @xml.xpath('//employee[@id="asdfasdf"]/@fooo').length
|
39
|
+
assert_nil @xml.xpath('//employee[@id="asdfasdf"]/@fooo')[0]
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_boolean
|
43
|
+
assert_equal false, @xml.xpath('1 = 2')
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_number
|
47
|
+
assert_equal 2, @xml.xpath('1 + 1')
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_string
|
51
|
+
assert_equal 'foo', @xml.xpath('concat("fo", "o")')
|
52
|
+
end
|
53
|
+
|
33
54
|
def test_css_search_uses_custom_selectors_with_arguments
|
34
55
|
set = @xml.css('employee > address:my_filter("domestic", "Yes")', @handler)
|
35
56
|
assert set.length > 0
|
@@ -95,6 +116,17 @@ module Nokogiri
|
|
95
116
|
assert_equal(set.to_a, @handler.things.flatten)
|
96
117
|
end
|
97
118
|
|
119
|
+
def test_custom_xpath_handler_is_passed_a_decorated_node_set
|
120
|
+
x = Module.new do
|
121
|
+
def awesome! ; end
|
122
|
+
end
|
123
|
+
util_decorate(@xml, x)
|
124
|
+
set = @xml.xpath('//employee/name')
|
125
|
+
@xml.xpath('//employee[saves_node_set(name)]', @handler)
|
126
|
+
assert_equal @xml, @handler.things.document
|
127
|
+
assert @handler.things.respond_to?(:awesome!)
|
128
|
+
end
|
129
|
+
|
98
130
|
def test_code_that_invokes_OP_RESET_inside_libxml2
|
99
131
|
doc = "<html><body id='foo'><foo>hi</foo></body></html>"
|
100
132
|
xpath = 'id("foo")//foo'
|
metadata
CHANGED
@@ -1,79 +1,101 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nokogiri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 4
|
8
|
+
- 2
|
9
|
+
version: 1.4.2
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Aaron Patterson
|
8
13
|
- Mike Dalessio
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
|
-
cert_chain:
|
12
|
-
- |
|
13
|
-
-----BEGIN CERTIFICATE-----
|
14
|
-
MIIDNjCCAh6gAwIBAgIBADANBgkqhkiG9w0BAQUFADBBMQ8wDQYDVQQDDAZhYXJv
|
15
|
-
bnAxGTAXBgoJkiaJk/IsZAEZFglydWJ5Zm9yZ2UxEzARBgoJkiaJk/IsZAEZFgNv
|
16
|
-
cmcwHhcNMDkxMTA1MDAwNDQ4WhcNMTAxMTA1MDAwNDQ4WjBBMQ8wDQYDVQQDDAZh
|
17
|
-
YXJvbnAxGTAXBgoJkiaJk/IsZAEZFglydWJ5Zm9yZ2UxEzARBgoJkiaJk/IsZAEZ
|
18
|
-
FgNvcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDNSD14Gb2mCX/5
|
19
|
-
fE85uW/jT7fcYI8XolrzdpzfvxD3y+Pt/yA5eciBiE+hNAWU2PM1ZMOq4MOV9EqR
|
20
|
-
hYzupp/zFoC7ZZ3PF8nJBFKgfKNf0sp9o3XCUviaZjoSYNIvGQocrakQo+h3x3Od
|
21
|
-
NqZWtVsLz9P/G1foUBpc95gGGBodbj/CZVc32F+xVvmejqe3RaMLGI70ZOuTcsRi
|
22
|
-
t8V4T7okmUbLi6VmPYlH/9mKvU7ObRHXMYNhkkife5phh8vjsiCd8Q397+jFaL0f
|
23
|
-
Cd23idNV7lbvdjIuYLV+9u5cPkDjANLAnGRaRS1x2SEfH/8g0Te6/jeKfzBH83D0
|
24
|
-
5v5HTx+HAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
|
25
|
-
BBTs3LnPhoi2m7BTf9tHvNQYsOG7aTANBgkqhkiG9w0BAQUFAAOCAQEAVH7G+nSf
|
26
|
-
WMPz7Iwcnd+WrWWq/mr5ke0qQoiz4tk0h7bsa3fEnUDBiMfmQhv/uBzA4Gkw9zxB
|
27
|
-
IfKljsZq0yE+du/1u2Mph7dMIg2oiwMurpduPpx9sfaqsqSBBOzggxiUEmHDNrPT
|
28
|
-
uTzaid0gdOx/TacZ4RwrEnx6XNkhxC2YaTH2Y68hoJzSzRGtdU2Kk6mT4YraCP+u
|
29
|
-
ETP5hCJAiB5l4jC8U6wwvKQDHTMoaUu3eu/txe1PDjoe3GICzs/e6bzYBWYmKu7J
|
30
|
-
5YM3l5J4rDvIPAGH4VRr5nSs+qbZh+kCdE1khvTxH51xkR3qAfEEogAd2VlnjELM
|
31
|
-
f9Gw8x3RwgLvkA==
|
32
|
-
-----END CERTIFICATE-----
|
16
|
+
cert_chain: []
|
33
17
|
|
34
|
-
date:
|
18
|
+
date: 2010-05-22 00:00:00 -04:00
|
35
19
|
default_executable:
|
36
20
|
dependencies:
|
37
21
|
- !ruby/object:Gem::Dependency
|
38
|
-
name:
|
22
|
+
name: rubyforge
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 2
|
30
|
+
- 0
|
31
|
+
- 4
|
32
|
+
version: 2.0.4
|
39
33
|
type: :development
|
40
|
-
|
41
|
-
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: racc
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
42
39
|
requirements:
|
43
40
|
- - ">="
|
44
41
|
- !ruby/object:Gem::Version
|
42
|
+
segments:
|
43
|
+
- 0
|
45
44
|
version: "0"
|
46
|
-
|
45
|
+
type: :development
|
46
|
+
version_requirements: *id002
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rexical
|
49
|
-
|
50
|
-
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
49
|
+
prerelease: false
|
50
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
52
51
|
requirements:
|
53
52
|
- - ">="
|
54
53
|
- !ruby/object:Gem::Version
|
54
|
+
segments:
|
55
|
+
- 0
|
55
56
|
version: "0"
|
56
|
-
|
57
|
+
type: :development
|
58
|
+
version_requirements: *id003
|
57
59
|
- !ruby/object:Gem::Dependency
|
58
60
|
name: rake-compiler
|
59
|
-
|
60
|
-
|
61
|
-
version_requirements: !ruby/object:Gem::Requirement
|
61
|
+
prerelease: false
|
62
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
62
63
|
requirements:
|
63
64
|
- - ">="
|
64
65
|
- !ruby/object:Gem::Version
|
66
|
+
segments:
|
67
|
+
- 0
|
65
68
|
version: "0"
|
66
|
-
|
69
|
+
type: :development
|
70
|
+
version_requirements: *id004
|
67
71
|
- !ruby/object:Gem::Dependency
|
68
|
-
name:
|
72
|
+
name: minitest
|
73
|
+
prerelease: false
|
74
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
segments:
|
79
|
+
- 1
|
80
|
+
- 6
|
81
|
+
- 0
|
82
|
+
version: 1.6.0
|
69
83
|
type: :development
|
70
|
-
|
71
|
-
|
84
|
+
version_requirements: *id005
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: hoe
|
87
|
+
prerelease: false
|
88
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
72
89
|
requirements:
|
73
90
|
- - ">="
|
74
91
|
- !ruby/object:Gem::Version
|
75
|
-
|
76
|
-
|
92
|
+
segments:
|
93
|
+
- 2
|
94
|
+
- 6
|
95
|
+
- 0
|
96
|
+
version: 2.6.0
|
97
|
+
type: :development
|
98
|
+
version_requirements: *id006
|
77
99
|
description: "Nokogiri (\xE9\x8B\xB8) is an HTML, XML, SAX, and Reader parser. Among Nokogiri's\n\
|
78
100
|
many features is the ability to search documents via XPath or CSS3 selectors.\n\n\
|
79
101
|
XML is like violence - if it doesn\xE2\x80\x99t solve your problems, you are not using\n\
|
@@ -91,6 +113,38 @@ extra_rdoc_files:
|
|
91
113
|
- CHANGELOG.rdoc
|
92
114
|
- README.ja.rdoc
|
93
115
|
- README.rdoc
|
116
|
+
- ext/nokogiri/html_document.c
|
117
|
+
- ext/nokogiri/html_element_description.c
|
118
|
+
- ext/nokogiri/html_entity_lookup.c
|
119
|
+
- ext/nokogiri/html_sax_parser_context.c
|
120
|
+
- ext/nokogiri/nokogiri.c
|
121
|
+
- ext/nokogiri/xml_attr.c
|
122
|
+
- ext/nokogiri/xml_attribute_decl.c
|
123
|
+
- ext/nokogiri/xml_cdata.c
|
124
|
+
- ext/nokogiri/xml_comment.c
|
125
|
+
- ext/nokogiri/xml_document.c
|
126
|
+
- ext/nokogiri/xml_document_fragment.c
|
127
|
+
- ext/nokogiri/xml_dtd.c
|
128
|
+
- ext/nokogiri/xml_element_content.c
|
129
|
+
- ext/nokogiri/xml_element_decl.c
|
130
|
+
- ext/nokogiri/xml_encoding_handler.c
|
131
|
+
- ext/nokogiri/xml_entity_decl.c
|
132
|
+
- ext/nokogiri/xml_entity_reference.c
|
133
|
+
- ext/nokogiri/xml_io.c
|
134
|
+
- ext/nokogiri/xml_namespace.c
|
135
|
+
- ext/nokogiri/xml_node.c
|
136
|
+
- ext/nokogiri/xml_node_set.c
|
137
|
+
- ext/nokogiri/xml_processing_instruction.c
|
138
|
+
- ext/nokogiri/xml_reader.c
|
139
|
+
- ext/nokogiri/xml_relax_ng.c
|
140
|
+
- ext/nokogiri/xml_sax_parser.c
|
141
|
+
- ext/nokogiri/xml_sax_parser_context.c
|
142
|
+
- ext/nokogiri/xml_sax_push_parser.c
|
143
|
+
- ext/nokogiri/xml_schema.c
|
144
|
+
- ext/nokogiri/xml_syntax_error.c
|
145
|
+
- ext/nokogiri/xml_text.c
|
146
|
+
- ext/nokogiri/xml_xpath_context.c
|
147
|
+
- ext/nokogiri/xslt_stylesheet.c
|
94
148
|
files:
|
95
149
|
- .autotest
|
96
150
|
- CHANGELOG.ja.rdoc
|
@@ -162,8 +216,6 @@ files:
|
|
162
216
|
- ext/nokogiri/xml_syntax_error.h
|
163
217
|
- ext/nokogiri/xml_text.c
|
164
218
|
- ext/nokogiri/xml_text.h
|
165
|
-
- ext/nokogiri/xml_xpath.c
|
166
|
-
- ext/nokogiri/xml_xpath.h
|
167
219
|
- ext/nokogiri/xml_xpath_context.c
|
168
220
|
- ext/nokogiri/xml_xpath_context.h
|
169
221
|
- ext/nokogiri/xslt_stylesheet.c
|
@@ -216,6 +268,7 @@ files:
|
|
216
268
|
- lib/nokogiri/ffi/structs/xml_xpath_object.rb
|
217
269
|
- lib/nokogiri/ffi/structs/xml_xpath_parser_context.rb
|
218
270
|
- lib/nokogiri/ffi/structs/xslt_stylesheet.rb
|
271
|
+
- lib/nokogiri/ffi/weak_bucket.rb
|
219
272
|
- lib/nokogiri/ffi/xml/attr.rb
|
220
273
|
- lib/nokogiri/ffi/xml/attribute_decl.rb
|
221
274
|
- lib/nokogiri/ffi/xml/cdata.rb
|
@@ -265,7 +318,6 @@ files:
|
|
265
318
|
- lib/nokogiri/xml/element_content.rb
|
266
319
|
- lib/nokogiri/xml/element_decl.rb
|
267
320
|
- lib/nokogiri/xml/entity_decl.rb
|
268
|
-
- lib/nokogiri/xml/fragment_handler.rb
|
269
321
|
- lib/nokogiri/xml/namespace.rb
|
270
322
|
- lib/nokogiri/xml/node.rb
|
271
323
|
- lib/nokogiri/xml/node/save_options.rb
|
@@ -285,12 +337,14 @@ files:
|
|
285
337
|
- lib/nokogiri/xml/sax/push_parser.rb
|
286
338
|
- lib/nokogiri/xml/schema.rb
|
287
339
|
- lib/nokogiri/xml/syntax_error.rb
|
340
|
+
- lib/nokogiri/xml/text.rb
|
288
341
|
- lib/nokogiri/xml/xpath.rb
|
289
342
|
- lib/nokogiri/xml/xpath/syntax_error.rb
|
290
343
|
- lib/nokogiri/xml/xpath_context.rb
|
291
344
|
- lib/nokogiri/xslt.rb
|
292
345
|
- lib/nokogiri/xslt/stylesheet.rb
|
293
346
|
- lib/xsd/xmlparser/nokogiri.rb
|
347
|
+
- tasks/cross_compile.rb
|
294
348
|
- tasks/test.rb
|
295
349
|
- test/css/test_nthiness.rb
|
296
350
|
- test/css/test_parser.rb
|
@@ -378,23 +432,24 @@ rdoc_options:
|
|
378
432
|
- README.rdoc
|
379
433
|
require_paths:
|
380
434
|
- lib
|
381
|
-
- ext
|
382
435
|
required_ruby_version: !ruby/object:Gem::Requirement
|
383
436
|
requirements:
|
384
437
|
- - ">="
|
385
438
|
- !ruby/object:Gem::Version
|
439
|
+
segments:
|
440
|
+
- 0
|
386
441
|
version: "0"
|
387
|
-
version:
|
388
442
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
389
443
|
requirements:
|
390
444
|
- - ">="
|
391
445
|
- !ruby/object:Gem::Version
|
446
|
+
segments:
|
447
|
+
- 0
|
392
448
|
version: "0"
|
393
|
-
version:
|
394
449
|
requirements: []
|
395
450
|
|
396
451
|
rubyforge_project: nokogiri
|
397
|
-
rubygems_version: 1.3.
|
452
|
+
rubygems_version: 1.3.6
|
398
453
|
signing_key:
|
399
454
|
specification_version: 3
|
400
455
|
summary: "Nokogiri (\xE9\x8B\xB8) is an HTML, XML, SAX, and Reader parser"
|
data.tar.gz.sig
DELETED
Binary file
|
data/ext/nokogiri/xml_xpath.c
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
#include <xml_xpath.h>
|
2
|
-
|
3
|
-
static void deallocate(xmlXPathObjectPtr xpath)
|
4
|
-
{
|
5
|
-
NOKOGIRI_DEBUG_START(xpath);
|
6
|
-
xmlXPathFreeNodeSetList(xpath); // despite the name, this frees the xpath but not the contained node set
|
7
|
-
NOKOGIRI_DEBUG_END(xpath);
|
8
|
-
}
|
9
|
-
|
10
|
-
VALUE Nokogiri_wrap_xml_xpath(xmlXPathObjectPtr xpath)
|
11
|
-
{
|
12
|
-
return Data_Wrap_Struct(cNokogiriXmlXpath, 0, deallocate, xpath);
|
13
|
-
}
|
14
|
-
|
15
|
-
/*
|
16
|
-
* call-seq:
|
17
|
-
* node_set
|
18
|
-
*
|
19
|
-
* Fetch the node set associated with this xpath context.
|
20
|
-
*/
|
21
|
-
static VALUE node_set(VALUE self)
|
22
|
-
{
|
23
|
-
xmlXPathObjectPtr xpath;
|
24
|
-
Data_Get_Struct(self, xmlXPathObject, xpath);
|
25
|
-
|
26
|
-
VALUE node_set = Qnil;
|
27
|
-
|
28
|
-
if (xpath->nodesetval)
|
29
|
-
node_set = Nokogiri_wrap_xml_node_set(xpath->nodesetval);
|
30
|
-
|
31
|
-
if(NIL_P(node_set))
|
32
|
-
node_set = Nokogiri_wrap_xml_node_set(xmlXPathNodeSetCreate(NULL));
|
33
|
-
|
34
|
-
rb_funcall(node_set, rb_intern("document="), 1, rb_iv_get(self, "@document"));
|
35
|
-
|
36
|
-
return node_set;
|
37
|
-
}
|
38
|
-
|
39
|
-
VALUE cNokogiriXmlXpath;
|
40
|
-
void init_xml_xpath(void)
|
41
|
-
{
|
42
|
-
VALUE module = rb_define_module("Nokogiri");
|
43
|
-
VALUE xml = rb_define_module_under(module, "XML");
|
44
|
-
|
45
|
-
/*
|
46
|
-
* This class wraps an XPath object and should only be instantiated from
|
47
|
-
* XPathContext.
|
48
|
-
*/
|
49
|
-
VALUE klass = rb_define_class_under(xml, "XPath", rb_cObject);
|
50
|
-
|
51
|
-
cNokogiriXmlXpath = klass;
|
52
|
-
rb_define_method(klass, "node_set", node_set, 0);
|
53
|
-
}
|