Sha256: 7f0f2455456dee92f93f0dada0d2258baf836f0623636bd3cd0428f35286995c
Contents?: true
Size: 705 Bytes
Versions: 5
Compression:
Stored size: 705 Bytes
Contents
require "nokogiri" require "jing" module Asciidoctor module Rfc::Common module Validate class << self def validate(doc, filename) schema = Jing.new(filename) File.write(".tmp.xml", doc.to_xml) begin errors = schema.validate(".tmp.xml") rescue Jing::Error => e abort "[metanorma-ietf] Validation error: #{e}" end if errors.none? warn "[metanorma-ietf] Validation passed." else errors.each do |error| warn "[metanorma-ietf] #{error[:message]} @ #{error[:line]}:#{error[:column]}" end end end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems