|
def tag_end name
@tag_stack.pop
name =~ Namespace::NAMESPLIT
prefix = $1
local = $2
uri = get_namespace prefix
# find the observers for start_element
procs = get_procs( end_element:end_element, name )
listeners = get_listeners( end_element:end_element, name )
# notify observers
procs.each { |ob| ob.call( uri, local, name ) } if procs
listeners.each { |ob| ob.end_element( uri, local, name ) } if listeners
namespace_mapping = @namespace_stack.pop
# find the observers for namespaces
procs = get_procs( end_prefix_mapping:end_prefix_mapping, name )
listeners = get_listeners( end_prefix_mapping:end_prefix_mapping, name )
if procs or listeners
namespace_mapping.each do |prefix, uri|
# notify observers of namespaces
procs.each { |ob| ob.call( prefix ) } if procs
listeners.each { |ob| ob.end_prefix_mapping(prefix) } if listeners
end
end
end
|