Skip to content

Commit

Permalink
patch OpenURL library to correctly handle multiple metadata items of …
Browse files Browse the repository at this point in the history
…the same type
  • Loading branch information
Miriam Goldberg committed Jul 14, 2008
1 parent 39672d3 commit 0393472
Showing 1 changed file with 8 additions and 4 deletions.
Expand Up @@ -68,8 +68,10 @@ def xml(co_elem)
if @metadata.length > 0
meta["metadata"] = meta["metadata-by-val"].add_element("ctx:metadata")
@metadata.each do |k,v|
meta[k] = meta["metadata"].add_element("ctx:"+k)
meta[k].text = v
(Array === v ? v : [v]).each {|val|
meta[k] = meta["metadata"].add_element("ctx:"+k)
meta[k].text = val
}
end
end
end
Expand Down Expand Up @@ -173,8 +175,10 @@ def xml_for_ref_entity(co_elem)
meta["format_container"].add_namespace(@abbr, meta["format"].text)
meta["format_container"].add_attribute("xsi:schemaLocation", meta["format"].text+" http://www.openurl.info/registry/docs/info:ofi/fmt:xml:xsd:"+@format)
@metadata.each do |k,v|
meta[k] = meta["format_container"].add_element(@abbr+":"+k)
meta[k].text = v
(Array === v ? v : [v]).each {|val|
meta[k] = meta["format_container"].add_element(@abbr+":"+k)
meta[k].text = val
}
end
end
end
Expand Down

0 comments on commit 0393472

Please sign in to comment.