Sha256: adf96c63c2a6fdc2243fa29f10ef3366aab438d0db0e64e3e908b9829dbf5202
Contents?: true
Size: 351 Bytes
Versions: 10
Compression:
Stored size: 351 Bytes
Contents
require 'nokogiri' class XmlValidator def self.validate(xml_file, schema_file) schema = Nokogiri::XML::Schema(File.read(schema_file)) doc = Nokogiri::XML::Document.parse(File.read(xml_file)) validation = schema.validate(doc) validation.each do |error| raise error.message end return validation.length == 0 end end
Version data entries
10 entries across 10 versions & 1 rubygems