Sha256: a8b9a1cdc28e1a2cfb62026b066f85551550ee2d48722f8a15630f7c44a6895f

Contents?: true

Size: 587 Bytes

Versions: 29

Compression:

Stored size: 587 Bytes

Contents

module RelatonW3c
  class XMLParser < RelatonBib::XMLParser
    class << self
      private

      # Override RelatonBib::XMLParser.item_data method.
      # @param item [Nokogiri::XML::Element]
      # @returtn [Hash]
      def item_data(item)
        data = super
        ext = item.at "./ext"
        return data unless ext

        data[:doctype] = ext.at("./doctype")&.text
        data
      end

      # @param item_hash [Hash]
      # @return [RelatonBib::BibliographicItem]
      def bib_item(item_hash)
        W3cBibliographicItem.new(**item_hash)
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
relaton-w3c-1.16.1 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.16.0 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.14.3 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.14.2 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.14.1 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.14.0 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.13.1 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.13.0 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.12.4 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.12.3 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.12.2 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.12.1 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.12.0 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.11.6 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.11.5 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.11.4 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.11.3 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.11.2 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.11.1 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.11.0 lib/relaton_w3c/xml_parser.rb