aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rexml/xpath_parser.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-01 05:43:50 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-01 05:43:50 +0000
commit1448668244c81cfc720bcdfa93af352a17cc230f (patch)
tree550af4707b22d099f4d8393e29ef6da424aca813 /lib/rexml/xpath_parser.rb
parent96e7713754c477fe98806b905301356371accb68 (diff)
downloadruby-1448668244c81cfc720bcdfa93af352a17cc230f.tar.gz
* lib/rexml: 1.9 patch from Sam Ruby mentioned in his blog:
<http://intertwingly.net/blog/2007/12/31/Porting-REXML-to-Ruby-1-9> [ruby-core:14639] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml/xpath_parser.rb')
-rw-r--r--lib/rexml/xpath_parser.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/rexml/xpath_parser.rb b/lib/rexml/xpath_parser.rb
index eb608fdb34..4275c2db0e 100644
--- a/lib/rexml/xpath_parser.rb
+++ b/lib/rexml/xpath_parser.rb
@@ -222,7 +222,7 @@ module REXML
when :child
new_nodeset = []
nt = nil
- for node in nodeset
+ nodeset.each do |node|
nt = node.node_type
new_nodeset += node.children if nt == :element or nt == :document
end
@@ -266,7 +266,7 @@ module REXML
when :ancestor
new_nodeset = []
- for node in nodeset
+ nodeset.each do |node|
while node.parent
node = node.parent
new_nodeset << node unless new_nodeset.include? node
@@ -277,7 +277,7 @@ module REXML
when :ancestor_or_self
new_nodeset = []
- for node in nodeset
+ nodeset.each do |node|
if node.node_type == :element
new_nodeset << node
while ( node.parent )
@@ -341,7 +341,7 @@ module REXML
when :descendant
results = []
nt = nil
- for node in nodeset
+ nodeset.each do |node|
nt = node.node_type
results += expr( path_stack.dclone.unshift( :descendant_or_self ),
node.children ) if nt == :element or nt == :document
@@ -376,7 +376,7 @@ module REXML
when :preceding
new_nodeset = []
- for node in nodeset
+ nodeset.each do |node|
new_nodeset += preceding( node )
end
#puts "NEW NODESET => #{new_nodeset.inspect}"
@@ -385,7 +385,7 @@ module REXML
when :following
new_nodeset = []
- for node in nodeset
+ nodeset.each do |node|
new_nodeset += following( node )
end
nodeset = new_nodeset
@@ -395,7 +395,7 @@ module REXML
#puts "In :namespace"
new_nodeset = []
prefix = path_stack.shift
- for node in nodeset
+ nodeset.each do |node|
if (node.node_type == :element or node.node_type == :attribute)
if @namespaces
namespaces = @namespaces