Giter Club home page Giter Club logo

schematron's Introduction

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.

schematron's People

Contributors

flazz avatar cchou avatar marly avatar

Watchers

Harry Porter-Mills avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.