Sha256: 9a5917f87390d3b37b400ae869865eea42997ce290724bf054185ec13ff67b54

Contents?: true

Size: 654 Bytes

Versions: 10

Compression:

Stored size: 654 Bytes

Contents

require 'nokogiri' unless defined?(Nokogiri)
require 'multi_xml/parsers/libxml2_parser'

module MultiXml
  module Parsers
    module Nokogiri #:nodoc:
      include Libxml2Parser

      extend self

      def parse_error() ::Nokogiri::XML::SyntaxError end

      def parse(xml)
        doc = ::Nokogiri::XML(xml)
        raise doc.errors.first if doc.errors.length > 0
        node_to_hash(doc.root)
      end

      def each_child(node, &block)
        node.children.each &block
      end

      def each_attr(node, &block)
        node.attribute_nodes.each &block
      end

      def node_name(node)
        node.node_name
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
multi_xml-0.4.2 lib/multi_xml/parsers/nokogiri.rb
nutshell-crm-0.0.6.alpha vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/nokogiri.rb
nutshell-crm-0.0.5 vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/nokogiri.rb
nutshell-crm-0.0.4 vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/nokogiri.rb
nutshell-crm-0.0.3 vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/nokogiri.rb
nutshell-crm-0.0.2 vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/nokogiri.rb
nutshell-crm-0.0.1 vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/nokogiri.rb
multi_xml-0.4.1 lib/multi_xml/parsers/nokogiri.rb
multi_xml-0.4.0 lib/multi_xml/parsers/nokogiri.rb
multi_xml-0.3.0 lib/multi_xml/parsers/nokogiri.rb