Sha256: 7de4a04df903bd7442495d9007b07e959ca42411f2b60d248324c215fbd85503
Contents?: true
Size: 622 Bytes
Versions: 17
Compression:
Stored size: 622 Bytes
Contents
module HealthDataStandards module Validate module Schema class Validator include BaseValidator def initialize(name, schema_file) @name = name @schema_file = schema_file @xsd = Nokogiri::XML::Schema(File.new(@schema_file)) end # Validate the document against the configured schema def validate(document,data={}) @xsd.errors.clear doc = get_document(document) @xsd.validate(doc).map do |error| build_error(error.message, "/", data[:file_name]) end end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems