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:
META-INF/services/org.relaxng.datatype.DatatypeLibraryFactory
,
which must contain the name of the class that implements the interface
org.relaxng.datatype.DatatypeLibraryFactory
The main Jing
distribution includes a sample in the sample/datatype
directory.