Sha256: 4a944a07eaf5185b63ae461cb3f4bcede0a02c7166450d6f98479453a945a8cd

Contents?: true

Size: 716 Bytes

Versions: 15

Compression:

Stored size: 716 Bytes

Contents

# frozen_string_literal: true

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

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
cqm-validators-4.0.5 lib/schematron/c_processor.rb
cqm-validators-4.0.4 lib/schematron/c_processor.rb
cqm-validators-4.0.3 lib/schematron/c_processor.rb
cqm-validators-4.0.2 lib/schematron/c_processor.rb
cqm-validators-4.0.1 lib/schematron/c_processor.rb
cqm-validators-3.1.3 lib/schematron/c_processor.rb
cqm-validators-4.0.0 lib/schematron/c_processor.rb
cqm-validators-3.1.2 lib/schematron/c_processor.rb
cqm-validators-3.1.1 lib/schematron/c_processor.rb
cqm-validators-2.0.2 lib/schematron/c_processor.rb
cqm-validators-3.0.1 lib/schematron/c_processor.rb
cqm-validators-3.0.0 lib/schematron/c_processor.rb
cqm-validators-2.0.1 lib/schematron/c_processor.rb
cqm-validators-2.0.0 lib/schematron/c_processor.rb
cqm-validators-1.0.1.0 lib/schematron/c_processor.rb