Sha256: 7fcccef20faea059c552e34a2bfa9ef5985e0bb00ab8ec1b2d7acacd3ff60fff

Contents?: true

Size: 656 Bytes

Versions: 53

Compression:

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

53 entries across 52 versions & 8 rubygems

Version Path
second_step-0.1.2 secondstep-notify-1.0.0-osx/lib/ruby/lib/ruby/gems/2.2.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb
simplenet-client-0.2.0 ./vendor/bundle/ruby/1.9.1/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb
simplenet-client-0.2.0 ./vendor/bundle/ruby/2.0.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb
allegro_api_client-0.0.9 gems/ruby/2.1.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb
allegro_api_client-0.0.8 gems/ruby/2.1.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb
allegro_api_client-0.0.7 gems/ruby/2.1.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb
allegro_api_client-0.0.6 gems/ruby/2.1.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb
allegro_api_client-0.0.5 gems/ruby/2.1.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb
allegro_api_client-0.0.4 gems/ruby/2.1.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb
allegro_api_client-0.0.3 gems/ruby/2.1.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb
allegro_api_client-0.0.2 gems/ruby/2.1.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb
allegro_api_client-0.0.1 gems/ruby/2.1.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb
plyom_user-0.3.1 vendor/bundle/ruby/2.0.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb
plyom_user-0.3.0 vendor/bundle/ruby/2.0.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb
plyom_user-0.2.9 vendor/bundle/ruby/2.0.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb
plyom_user-0.2.8 vendor/bundle/ruby/2.0.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb
plyom_user-0.2.7 vendor/bundle/ruby/2.0.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb
plyom_user-0.2.6 vendor/bundle/ruby/2.0.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb
plyom_user-0.2.5 vendor/bundle/ruby/2.0.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb