Method: IsoDoc::Metadata#agency1

Defined in:
lib/isodoc/metadata_contributor.rb

#agency1(xml) ⇒ Object



65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/isodoc/metadata_contributor.rb', line 65

def agency1(xml)
  agency = ""
  publisher = []
  xml.xpath(ns("//bibdata/contributor[xmlns:role/@type = 'publisher']/" \
               "organization")).each do |org|
    name = org.at(ns("./name[@language = '#{@lang}']")) ||
      org.at(ns("./name"))
    agency1 = org.at(ns("./abbreviation"))&.text || name&.text
    publisher << name.text if name
    agency = iso?(org) ? "ISO/#{agency}" : "#{agency}#{agency1}/"
  end
  [agency, publisher]
end