Sha256: 6bdefab1b593f14ba68c9b4e6b54bd6e8c157a506a801a59c893c4d663fd88a2

Contents?: true

Size: 694 Bytes

Versions: 6

Compression:

Stored size: 694 Bytes

Contents

#!/usr/bin/ruby

require 'optparse'
require 'libxml'
require 'schematron'

include LibXML


puts "Usage: validate [schematron] [instance]" if ARGV.size != 2

# use the line numbers
XML.default_line_numbers = true

# Get sch and xml from command line
schema_doc = XML::Document.file ARGV[0]
instance_doc = XML::Document.file ARGV[1]

stron = Schematron::Schema.new schema_doc
stron.validate(instance_doc).each do |error|
  puts '%s "%s" on line %d: %s' % [
                                   error[:type],
                                   error[:name],
                                   error[:line],
                                   error[:message]
                                  ]
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
flazz-schematron-0.0.3 bin/stron
flazz-schematron-0.1.0 bin/stron
schematron-0.1.0 bin/stron
schematron-0.0.1 bin/validate
schematron-0.0.2 bin/stron
schematron-0.0.3 bin/stron