Sha256: 433e1e6155cabe17b8b527a7912d8327181dffbde199e35924655ddf990e49c5
Contents?: true
Size: 506 Bytes
Versions: 19
Compression:
Stored size: 506 Bytes
Contents
require "nokogiri" module RelatonIetf class XMLParser < RelatonBib::XMLParser class << self def from_xml(xml) doc = Nokogiri::XML(xml) ietfitem = doc.at("/bibitem|/bibdata") RelatonIetf::IetfBibliographicItem.new(item_data(ietfitem)) end private def item_data(ietfitem) data = super ext = ietfitem.at "./ext" return data unless ext data[:doctype] = ext.at("./doctype")&.text data end end end end
Version data entries
19 entries across 19 versions & 1 rubygems