= private = protected
preceding( node )
Builds a nodeset of all of the preceding nodes of the supplied node, in reverse document order
preceding
includes every element in the document that precedes this node,
except for ancestors
# File lib/rexml/xpath_parser.rb, line 584 def preceding( node ) #puts "IN PRECEDING" ancestors = [] p = node.parent while p ancestors << p p = p.parent end acc = [] p = preceding_node_of( node ) #puts "P = #{p.inspect}" while p if ancestors.include? p ancestors.delete(p) else acc << p end p = preceding_node_of( p ) #puts "P = #{p.inspect}" end acc end