class QontoOfx::OfxValidator

Validate an OFX document against the schema

Public Instance Methods

valid?(input) click to toggle source
# File lib/ofx_validator.rb, line 8
def valid?(input)
  path = File.join(File.dirname(__FILE__), "../schema/OFX2_Protocol.xsd")
  schema = Nokogiri::XML::Schema(File.open(path))
  document = Nokogiri::XML(input)
  schema.validate(document).empty?
rescue => e
  false
end