lib/schematron/c_processor.rb in cqm-validators-0.1.1 vs lib/schematron/c_processor.rb in cqm-validators-1.0.1.0

- old
+ new

@@ -1,26 +1,26 @@ +# frozen_string_literal: true + module CqmValidators - module Schematron - module CProcessor + module Schematron + module CProcessor + def get_errors(document) + document = get_document(document) + processor.transform(document) + end + def processor + return @processor if @processor - def get_errors(document) - document = get_document(document) - processor.transform(document) - end + doc = Nokogiri::XML(File.open(@schematron_file)) + doc.root['defaultPhase'] = 'errors' - def processor - return @processor if @processor - doc = Nokogiri::XML(File.open(@schematron_file)) - doc.root["defaultPhase"] = ("errors") + xslt = Nokogiri::XSLT(File.open(ISO_SCHEMATRON)) - xslt = Nokogiri::XSLT(File.open(ISO_SCHEMATRON)) - - result = xslt.transform(doc) - #this is stupid but needs to be done to assocaite the xslt file with a dirctory - result = Nokogiri::XML(result.to_s,@schematron_file) - @processor = Nokogiri::XSLT::Stylesheet.parse_stylesheet_doc(result) - end - - end + result = xslt.transform(doc) + # this needs to be done to associate the xslt file with a dirctory + result = Nokogiri::XML(result.to_s, @schematron_file) + @processor = Nokogiri::XSLT::Stylesheet.parse_stylesheet_doc(result) end + end + end end