From 1448668244c81cfc720bcdfa93af352a17cc230f Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 1 Jan 2008 05:43:50 +0000 Subject: * lib/rexml: 1.9 patch from Sam Ruby mentioned in his blog: [ruby-core:14639] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rexml/xpath_parser.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/rexml/xpath_parser.rb') 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 -- cgit v1.2.3