* Commons.Xml.Relaxng ** Introduction RelaxngValidatingReader is an implementation to validate XML with RELAX NG grammar. You can use full standard grammar components with it. Currently it supports both xml syntax and compact syntax. It supports RELAX NG predefined datatypes and XML Schema datatypes (its DatatypeLibrary is http://www.w3.org/2001/XMLSchema-datatypes ). All classes which is expected to use are in namespace Commons.Xml.Relaxng, except for Commons.Xml.Relaxng.Rnc.RncParser class (which is used to parse compact syntax). There is another namespace Commons.Xml.Relaxng.Derivative which is not expected to be used in users custom classes, though the classes are public as yet. ** Grammar Object Model RELAX NG grammar structure is represented in abstract RelaxngPattern class and its derivations. The easiest way to get this instance is to use static Read() method of RelaxngPattern class: RelaxngPattern pattern = RelaxngPattern.Read ( new XmlTextReader ("relaxng.rng"); You can also use RelaxngPattern class to reuse grammar instance, as already described (see Grammar Object Model). And also, RelaxngGrammar and its contents can be created with managed code like System.Xml.Schema.XmlSchema. ** Compact Syntax Support Commons.Xml.Relaxng.dll also supports RELAX NG Compact Syntax. To parse compact syntax file, use Commons.Xml.Relaxng.Rnc.RncParser class: RncParser parser = new RncParser (new NameTable ()); TextReader source = new StreamReader ("relaxng.rnc"); RelaxngGrammar grammar = parser.Parse (source); ** Validating Reader usage RelaxngValidatingReader is used to validate XML document with RELAX NG grammar. The usage is simple: XmlReader instance = new XmlTextReader ("instance.xml"); XmlReader grammar = new XmlTextReader ("my.rng"); RelaxngValidatingReader reader = new RelaxngValidatingReader (instance, grammar); Then Read() method (and other reading methods such as ReadElementString()) reads the instance, validating with the supplied grammar. ** Datatype support Commons.Xml.Relaxng now supports custom datatype library. There are two classes from which you have to write classes derived.