Class: RelatonBib::XMLParser
Class Method Summary collapse
-
.from_xml(xml) ⇒ RelatonBib::BibliographicItem?
Parse XML bibdata.
Class Method Details
.from_xml(xml) ⇒ RelatonBib::BibliographicItem?
Parse XML bibdata
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/relaton_bib/xml_parser.rb', line 13 def from_xml(xml) doc = Nokogiri::XML(xml) doc.remove_namespaces! bibitem = doc.at "/bibitem|/bibdata" if bibitem bib_item item_data(bibitem) else Util.warn "WARNING: can't find bibitem or bibdata element in the XML" nil end end |