def _start_element(name, attrs = [])
name = normalize_name(name)
node = stack.last
object = node.object
sax_config = sax_config_for(object)
if sax_config
attrs = Hash[attrs]
if collection_config = sax_config.collection_config(name, attrs)
object = collection_config.data_class.new
sax_config = sax_config_for(object)
stack.push(StackNode.new(object, collection_config))
set_attributes_on(object, attrs)
end
sax_config.element_configs_for_attribute(name, attrs).each do |ec|
unless parsed_config?(object, ec)
object.send(ec.setter, ec.value_from_attrs(attrs))
mark_as_parsed(object, ec)
end
end
if !collection_config && element_config = sax_config.element_config_for_tag(name, attrs)
new_object =
case element_config.data_class.to_s
when "Integer" then 0
when "Float" then 0.0
when "Symbol" then nil
when "Time" then Time.at(0)
when "" then object
else
element_config.data_class.new
end
stack.push(StackNode.new(new_object, element_config))
set_attributes_on(new_object, attrs)
end
end
end