def get_entity_list(entity_type, ns=Model::NS_MMD_1)
entity_list = @document.elements[
"//[local-name()='metadata' and namespace-uri()='%s']/[local-name()='%s-list' and namespace-uri()='%s'][1]" %
[Model::NS_MMD_1, Utils.entity_type_to_string(entity_type), ns]]
unless entity_list.nil? or entity_list.is_a? REXML::Text
collection = Model::ScoredCollection.new(entity_list.attributes['count'],
entity_list.attributes['offset'])
read_list_method = method('read_' + entity_list.name.gsub('-', '_'))
read_list_method.call(entity_list, collection, true) if read_list_method
return collection
else
return Model::ScoredCollection.new
end
end