Sha256: ee57d142124cf480f789a73d258dc74a5fb76e12559793d3fb1988abb94e0b1d

Contents?: true

Size: 343 Bytes

Versions: 4

Compression:

Stored size: 343 Bytes

Contents

require 'singleton'

module OmfCommon
  class RelaxNGSchema
    include Singleton

    SCHEMA_FILE = "#{File.dirname(__FILE__)}/../../protocol/#{OmfCommon::PROTOCOL_VERSION}.rng"

    def initialize
      @rng = File.read(SCHEMA_FILE)
    end

    def validate(document)
      Nokogiri::XML::RelaxNG(@rng).validate(document)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
omf_common-6.0.2.pre.2 lib/omf_common/message/xml/relaxng_schema.rb
omf_common-6.0.2.pre.1 lib/omf_common/message/xml/relaxng_schema.rb
omf_common-6.0.0 lib/omf_common/message/xml/relaxng_schema.rb
omf_common-6.0.0.pre.11 lib/omf_common/message/xml/relaxng_schema.rb