Sha256: 1b7d0cfacc0dd668dd1c9f5acedc3ffdac3182e55bf0f3a5fd8fd4f588f9df03

Contents?: true

Size: 584 Bytes

Versions: 14

Compression:

Stored size: 584 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

14 entries across 14 versions & 2 rubygems

Version Path
relaton-w3c-1.7.0 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.6.0 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.6.pre1 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.5.0 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.5.pre lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.4.0 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.3.3 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.3.2 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.3.1 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.3.0 lib/relaton_w3c/xml_parser.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/relaton-w3c-1.2.0/lib/relaton_w3c/xml_parser.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/relaton-w3c-1.2.0/lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.2.0 lib/relaton_w3c/xml_parser.rb
relaton-w3c-1.1.0 lib/relaton_w3c/xml_parser.rb