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)
  item = doc.at "/bibitem|/bibdata"
  if item
    OgcBibliographicItem.new item_data(item)
  else
    warn "[relaton-ogc] can't find bibitem or bibdata element in the XML"
  end
end