Class: RelatonOgc::XMLParser

Inherits:
RelatonIsoBib::XMLParser
  • Object
show all
Defined in:
lib/relaton_ogc/xml_parser.rb

Class Method Summary collapse

Class Method Details

.from_xml(xml) ⇒ RelatonOgc::OgcBibliographicItem

Override RelatonIsoBib::XMLParser.form_xml method.

Parameters:

  • xml (String)

Returns:



9
10
11
12
13
14
15
16
17
# File 'lib/relaton_ogc/xml_parser.rb', line 9

def from_xml(xml)
  doc = Nokogiri::XML(xml)
  isoitem = doc.at "/bibitem|/bibdata"
  if isoitem
    OgcBibliographicItem.new item_data(isoitem)
  else
    warn "[relato-ogc] can't find bibitem or bibdata element in the XML"
  end
end