soulcutter / saxerator

A SAX-based XML parser for parsing large files into manageable chunks
MIT License
128 stars 19 forks source link

Optional errors #71

Open ExplosiveGM opened 3 years ago

ExplosiveGM commented 3 years ago

I need parse some invalid files. Now i hack it this way:

module Saxerator
  module Adapters
    class Ox
      def error(message, _, _)
        # raise Saxerator::ParseException, message
      end
    end
  end
end

Can you add option ignore_errors?

def error(message, _, _)
  return if ignore_errors
  raise Saxerator::ParseException, message
end
soulcutter commented 3 years ago

Your hack is pretty good! My reservation about adding that as configuration is whether or not it's supportable in every adapter. If you submit this as a PR I would be interested in accepting that change.