Skip to content

dholroyd/relaxng-rust

Repository files navigation

relaxng-rust

Rust implementation of the RELAX NG XML schema language.

Example

start =
  element data { children }

children =
  element dog { text } |
  element sheep { text }
<data>
  <cats>henry</cats>
</data>
$ rng validate schema.rnc input.xml

Validating "input.xml"
error: element-start not expected here
 --> input.xml:2:4
  |
2 |   <cats>henry</cats>
  |    ^^^^ Not allowed
help: Expected Element sheep dog

Status

The relaxng-validator crate passes all 384 tests from the RELAX NG test suite.

All 44 XML Schema built-in datatypes are supported (except NOTATION, which the RelaxNG spec forbids).

Subprojects

  • relaxng-syntax supports parsing both the 'compact' (non-XML) syntax and the XML syntax into an 'abstract sytax tree' representation of an individual schema file.
  • relaxng-model provides an intermediate representation of an RELAX NG schema, which might be composed of multiple related schema component files.
  • relaxng-validator able to perform validation of instance documents. Uses xmlparser.
  • relaxng-tool - a demo CLI program to validate XML documents against a RELAX NG schema.
  • relaxng-exemplifier - generate random example XML documents from a schema, for testing

About

Rust implementation of the RELAX NG XML schema language

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages