= 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 524 def preceding( node ) ancestors = [] p = node.parent while p ancestors << p p = p.parent end acc = [] p = preceding_node_of( node ) while p if ancestors.include? p ancestors.delete(p) else acc << p end p = preceding_node_of( p ) end acc end