# RELAX NG Pluggable Datatype Libraries

A vendor-independent Java interface for RELAX NG datatype libraries has been developed by James Clark and KAWAGUCHI Kohsuke. RELAX NG datatype libraries should be interchangeable between RELAX NG validators that support this interface. The interface is hosted at SourceForge in the relaxng project. There is API documentation.

In particular, the Jing validator now supports this interface.

The interface allows validators to find datatype libraries dynamically at run-time. In order for a validator to be able to find a datatype library:

- the datatype library should be packaged as JAR file
- the JAR file must be on the Java CLASSPATH
- the JAR file must include additional metadata in the form of a file `META-INF/services/org.relaxng.datatype.DatatypeLibraryFactory`, which must contain the name of the class that implements the interface `org.relaxng.datatype.DatatypeLibraryFactory`

This will only work with JDK 1.2 or greater. It will not work with JDK 1.1.

The main Jing distribution includes a sample in the `sample/datatype` directory.