%title%

    # File /home/ser/Work/rexml/rexml/xpath.rb, line 45
      def XPath::filter elements, path
    			return elements if path.nil? or path == '' or elements.size == 0
    			case path
    			when /^\/u											# Descendant
    				return axe( elements, "descendant-or-self", $' )
    			when /^\?\b(\[\-]*)\b::/u							# Axe
    				axe_name = $1
    				rest = $'
    				return axe( elements, $1, $' )
    			when /^\(?=\b([:!\_][-\_]*:)?[-!\\_]*\b([^:(]|$)|\)/u	# Child
    				rest = $'
    				results = []
    				elements.each do |element|
    					results |= filter( element.to_a, rest )
    				end
    				return results
    			when /^\?(\[\-]*)\/u							# / Function
    				return function( elements, $1, $' )
    			when /^\b(([:!\_][-\_]*:)?([-!\\_]*))\b/u		# Element name
    				expanded_name=$1
    				name = $3
    				ns = $2
    				ns.chop! if ns
    				rest = $'
    				if false
    					puts "MATCH PARAMETERS:"
    					puts "name muts be #{name}"
    					puts "Functions.namespace_context['#{ns}'] is '#{Functions.namespace_context[ns].to_s}'"
    					puts "CHECKING:"
    				end
    				elements.delete_if do |element|
    					if element.kind_of? Element and false
    						puts "element namespace is '#{element.namespace}'"
    						puts "element name is '#{name}'"
    						puts "element.namespace is #{element.namespace}"
    					end
    					!(element.kind_of? Element and
    						(element.expanded_name == name or
    						 (element.name == name and
    						  element.namespace == Functions.namespace_context[ns])))
    				end
    				return filter( elements, rest )
    			when /^\/u
    				matches = []
    				elements.each do |element|
    					matches |= predicate( element.to_a, path[1..-1] ) if element.kind_of? Element
    				end
    				return matches
    			when /^\/u												# Predicate
    				return predicate( elements, path )
    			when /^\?\\/u										# Ancestor
    				return axe( elements, "ancestor", $' )
    			when /^\?\/u											# Parent
    				return filter( elements.collect{|e|e.parent}, $' )
    			when /^\?\/u												# Self
    				return filter( elements, $' )
    			when /^\/u													# Any
    				results = []
    				elements.each do |element|
    					results |= filter( [element], $' ) if element.kind_of? Element
    					#if element.kind_of? Element
    					#	children = element.to_a
    					#	children.delete_if { |child| !child.kind_of?(Element) }
    					#	results |= filter( children, $' )
    					#end
    				end
    				return results
    			end
    			return []
    		end