Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flazz/schematron
using iso schematron in ruby and shell
https://github.com/flazz/schematron
Last synced: 6 days ago
JSON representation
using iso schematron in ruby and shell
- Host: GitHub
- URL: https://github.com/flazz/schematron
- Owner: flazz
- License: mit
- Created: 2009-03-04T14:46:07.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2011-11-03T14:22:11.000Z (about 13 years ago)
- Last Synced: 2024-10-19T21:39:43.084Z (26 days ago)
- Language: Ruby
- Homepage:
- Size: 168 KB
- Stars: 19
- Watchers: 4
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
ISO Schematron
==============Ruby gem for validating XML against schematron schema
Uses [ISO Schematron](http://www.schematron.com) 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](mailto:[email protected]).
Sponsored by [Florida Center for Library Automation](http://www.fcla.edu).
See LICENSE.txt for terms.