nokogiri 1.5.7-x86-mswin32-60 → 1.5.8-x86-mswin32-60
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 +9 -0
- data/CHANGELOG.rdoc +9 -0
- data/lib/nokogiri/1.8/nokogiri.so +0 -0
- data/lib/nokogiri/1.9/nokogiri.so +0 -0
- data/lib/nokogiri/2.0/nokogiri.so +0 -0
- data/lib/nokogiri/version.rb +1 -1
- data/lib/nokogiri/xml/builder.rb +3 -1
- data/lib/nokogiri/xml/document.rb +2 -1
- data/test/namespaces/test_additional_namespaces_in_builder_doc.rb +14 -0
- data/test/namespaces/test_namespaces_in_builder_doc.rb +6 -0
- data/test/namespaces/test_namespaces_in_created_doc.rb +6 -0
- data/test/namespaces/test_namespaces_in_parsed_doc.rb +6 -0
- data/test/test_reader.rb +33 -0
- metadata +6 -4
data/CHANGELOG.ja.rdoc
CHANGED
@@ -1,4 +1,13 @@
|
|
1
1
|
|
2
|
+
=== 1.5.8 / 2013年03月19日
|
3
|
+
|
4
|
+
* Bugfixes
|
5
|
+
|
6
|
+
* (JRuby) Fix EmptyStackException thrown by elements with xlink:href attributes and no base_uri #534, #805. (Thanks, Patrick Quinn and Brian Hoffman!)
|
7
|
+
* Fixes duplicate attributes issue introduced in 1.5.7. #865
|
8
|
+
* Allow use of a prefixed namespace on a root node using Nokogiri::XML::Builder #868
|
9
|
+
|
10
|
+
|
2
11
|
=== 1.5.7 / 2013年03月18日
|
3
12
|
|
4
13
|
* Features
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,4 +1,13 @@
|
|
1
1
|
|
2
|
+
=== 1.5.8 / 2013-03-19
|
3
|
+
|
4
|
+
* Bugfixes
|
5
|
+
|
6
|
+
* (JRuby) Fix EmptyStackException thrown by elements with xlink:href attributes and no base_uri #534, #805. (Thanks, Patrick Quinn and Brian Hoffman!)
|
7
|
+
* Fixes duplicate attributes issue introduced in 1.5.7. #865
|
8
|
+
* Allow use of a prefixed namespace on a root node using Nokogiri::XML::Builder #868
|
9
|
+
|
10
|
+
|
2
11
|
=== 1.5.7 / 2013-03-18
|
3
12
|
|
4
13
|
* Features
|
Binary file
|
Binary file
|
Binary file
|
data/lib/nokogiri/version.rb
CHANGED
data/lib/nokogiri/xml/builder.rb
CHANGED
@@ -318,7 +318,9 @@ module Nokogiri
|
|
318
318
|
# Build a tag that is associated with namespace +ns+. Raises an
|
319
319
|
# ArgumentError if +ns+ has not been defined higher in the tree.
|
320
320
|
def [] ns
|
321
|
-
|
321
|
+
if @parent != @doc
|
322
|
+
@ns = @parent.namespace_definitions.find { |x| x.prefix == ns.to_s }
|
323
|
+
end
|
322
324
|
return self if @ns
|
323
325
|
|
324
326
|
@parent.ancestors.each do |a|
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "helper"
|
2
|
+
|
3
|
+
module Nokogiri
|
4
|
+
module XML
|
5
|
+
class TestAdditionalNamespacesInBuilderDoc < Nokogiri::TestCase
|
6
|
+
def test_builder_namespaced_root_node_ns
|
7
|
+
b = Nokogiri::XML::Builder.new do |x|
|
8
|
+
x[:foo].RDF(:'xmlns:foo' => 'http://foo.io')
|
9
|
+
end
|
10
|
+
assert_equal 'http://foo.io', b.doc.root.namespace.href
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -55,6 +55,12 @@ module Nokogiri
|
|
55
55
|
def test_builder_buried_decl_ns
|
56
56
|
assert_equal 'ns:veg', check_namespace(@doc.root.elements[3].elements[1])
|
57
57
|
end
|
58
|
+
def test_builder_namespace_count
|
59
|
+
n = @doc.root.clone
|
60
|
+
n.children.each(&:remove)
|
61
|
+
ns_attrs = n.to_xml.scan(/\bxmlns(?::.+?)?=/)
|
62
|
+
assert_equal 3, ns_attrs.length
|
63
|
+
end
|
58
64
|
end
|
59
65
|
end
|
60
66
|
end
|
@@ -57,6 +57,12 @@ module Nokogiri
|
|
57
57
|
def test_created_buried_decl_ns
|
58
58
|
assert_equal 'ns:veg', check_namespace(@doc.root.elements[3].elements[1])
|
59
59
|
end
|
60
|
+
def test_created_namespace_count
|
61
|
+
n = @doc.root.clone
|
62
|
+
n.children.each(&:remove)
|
63
|
+
ns_attrs = n.to_xml.scan(/\bxmlns(?::.+?)?=/)
|
64
|
+
assert_equal 3, ns_attrs.length
|
65
|
+
end
|
60
66
|
end
|
61
67
|
end
|
62
68
|
end
|
@@ -55,6 +55,12 @@ module Nokogiri
|
|
55
55
|
def test_parsed_buried_decl_ns
|
56
56
|
assert_equal 'ns:veg', check_namespace(@doc.root.elements[3].elements[1])
|
57
57
|
end
|
58
|
+
def test_parsed_namespace_count
|
59
|
+
n = @doc.root.clone
|
60
|
+
n.children.each(&:remove)
|
61
|
+
ns_attrs = n.to_xml.scan(/\bxmlns(?::.+?)?=/)
|
62
|
+
assert_equal 3, ns_attrs.length
|
63
|
+
end
|
58
64
|
end
|
59
65
|
end
|
60
66
|
end
|
data/test/test_reader.rb
CHANGED
@@ -433,6 +433,39 @@ class TestReader < Nokogiri::TestCase
|
|
433
433
|
reader.map {|n| n.base_uri })
|
434
434
|
end
|
435
435
|
|
436
|
+
def test_xlink_href_without_base_uri
|
437
|
+
reader = Nokogiri::XML::Reader(<<-eoxml)
|
438
|
+
<x xmlns:xlink="http://www.w3.org/1999/xlink">
|
439
|
+
<link xlink:href="#other">Link</link>
|
440
|
+
<other id="other">Linked Element</other>
|
441
|
+
</x>
|
442
|
+
eoxml
|
443
|
+
|
444
|
+
reader.each do |node|
|
445
|
+
if node.node_type == Nokogiri::XML::Reader::TYPE_ELEMENT
|
446
|
+
if node.name == 'link'
|
447
|
+
assert_nil node.base_uri
|
448
|
+
end
|
449
|
+
end
|
450
|
+
end
|
451
|
+
end
|
452
|
+
|
453
|
+
def test_xlink_href_with_base_uri
|
454
|
+
reader = Nokogiri::XML::Reader(<<-eoxml)
|
455
|
+
<x xml:base="http://base.example.org/base/"
|
456
|
+
xmlns:xlink="http://www.w3.org/1999/xlink">
|
457
|
+
<link xlink:href="#other">Link</link>
|
458
|
+
<other id="other">Linked Element</other>
|
459
|
+
</x>
|
460
|
+
eoxml
|
461
|
+
|
462
|
+
reader.each do |node|
|
463
|
+
if node.node_type == Nokogiri::XML::Reader::TYPE_ELEMENT
|
464
|
+
assert_equal node.base_uri, "http://base.example.org/base/"
|
465
|
+
end
|
466
|
+
end
|
467
|
+
end
|
468
|
+
|
436
469
|
def test_read_from_memory
|
437
470
|
called = false
|
438
471
|
reader = Nokogiri::XML::Reader.from_memory('<foo>bar</foo>')
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nokogiri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 1.5.
|
9
|
+
- 8
|
10
|
+
version: 1.5.8
|
11
11
|
platform: x86-mswin32-60
|
12
12
|
authors:
|
13
13
|
- Aaron Patterson
|
@@ -18,7 +18,7 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2013-03-
|
21
|
+
date: 2013-03-19 00:00:00 Z
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
24
|
prerelease: false
|
@@ -502,6 +502,7 @@ files:
|
|
502
502
|
- test_all
|
503
503
|
- test/namespaces/test_namespaces_in_builder_doc.rb
|
504
504
|
- test/namespaces/test_namespaces_in_created_doc.rb
|
505
|
+
- test/namespaces/test_additional_namespaces_in_builder_doc.rb
|
505
506
|
- test/namespaces/test_namespaces_in_parsed_doc.rb
|
506
507
|
- lib/nokogiri/nokogiri.rb
|
507
508
|
- lib/nokogiri/1.8/nokogiri.so
|
@@ -606,6 +607,7 @@ test_files:
|
|
606
607
|
- test/test_convert_xpath.rb
|
607
608
|
- test/namespaces/test_namespaces_in_builder_doc.rb
|
608
609
|
- test/namespaces/test_namespaces_in_created_doc.rb
|
610
|
+
- test/namespaces/test_additional_namespaces_in_builder_doc.rb
|
609
611
|
- test/namespaces/test_namespaces_in_parsed_doc.rb
|
610
612
|
- test/test_xslt_transforms.rb
|
611
613
|
- test/test_nokogiri.rb
|