Sha256: f0a2e016bd229df764e66bfbd70103ade525103505b5c0fda7d887accd80b2cb

Contents?: true

Size: 773 Bytes

Versions: 2

Compression:

Stored size: 773 Bytes

Contents

module CqmValidators
      module Schematron
        module CProcessor


          def get_errors(document)
            document = get_document(document)
            processor.transform(document)
          end

          def processor
            return @processor if @processor
            doc = Nokogiri::XML(File.open(@schematron_file))
            doc.root["defaultPhase"] = ("errors")

            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
      end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cqm-validators-0.1.1 lib/schematron/c_processor.rb
cqm-validators-0.1.0 lib/schematron/c_processor.rb