Sha256: 0c67f2529685c4a326c21a3f2441e67041861ce599b16f8947673136b99c657e

Contents?: true

Size: 369 Bytes

Versions: 1

Compression:

Stored size: 369 Bytes

Contents

require 'nokogiri'

module MoneyXmlValidator
  def self.validate(utf_source)
    gem_root = File.expand_path("../..", __FILE__)

    path = "#{gem_root}/lib/money_xml_validator/money_xsd/schemas/_Document.xsd"
    io = File.open(path)
    schema = Nokogiri::XML::Schema(io)

    doc = Nokogiri::XML(utf_source)


    errors = schema.validate(doc)

    errors
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
money_xml_validator-1.0.0 lib/money_xml_validator.rb