# module ActiveSupport::XmlMini_NokogiriSAX

### Attributes

document_class[RW]

### Public Instance Methods

parse(data) click to toggle source

    # File lib/active_support/xml_mini/nokogirisax.rb, line 71
    def parse(data)
      if !data.respond_to?(:read)
        data = StringIO.new(data || '')
      end

      char = data.getc
      if char.nil?
        {}
      else
        data.ungetc(char)
        document = self.document_class.new
        parser = Nokogiri::XML::SAX::Parser.new(document)
        parser.parse(data)
        document.hash
      end
    end