Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

using iso schematron in ruby and shell

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 iso-schematron-xslt1
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .semver
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.md
Octocat-spinner-32 schematron.gemspec
README.md

ISO Schematron

Ruby gem for validating XML against schematron schema

Uses ISO Schematron version: 2010-01-25

Installation

% gem install schematron

Command line example

% stron my_schema.stron my_xml_document.xml

Ruby API example

# overhead
require "libxml"
require "schematron"

include LibXML

# load the schematron xml
stron_doc = XML::Document.file "/path/to/my_schema.stron"

# make a schematron object
stron = Schematron::Schema.new stron_doc

# load the xml document you wish to validate
xml_doc = XML::Document.file "/path/to/my_xml_document.xml"

# validate it
results = stron.validate xml_doc

# print out the results
stron.validate(instance_doc).each do |error|
  puts "#{error[:line]}: #{error[:message]}"
end

Copyright © 2009-2010 Francesco Lazzarino.

Sponsored by Florida Center for Library Automation.

See LICENSE.txt for terms.

Something went wrong with that request. Please try again.