Project

ruby_rnv

0.0
No commit activity in last 3 years
No release in over 3 years
RelaxNG compact syntax validator for Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.14
~> 5.0
~> 10.0

Runtime

 Project Readme

RelaxNG Compact Syntax validator for Ruby

Based on http://www.davidashen.net/rnv.html by David Tolpin. Original C program has been refactored to be useable as a library. The result is integrated with Nokogiri SAX parser to provide a high level ruby gem.

Usage

require 'rnv'

validator = RNV::Validator.new
validator.load_schema_from_file("test/fixtures/test330.rnc")
validator.parse_file("test/fixtures/test330_2_invalid.xml")

pp validator.errors # [#<RNV::Error code: :rnv_er_emis, message: 'incomplete content', line: 2, col: 8>, #<RNV::Error code: :rnv_er_elem, message: 'element ^bar not allowed', line: 3, col: 8>]