Jing support for XML Schema Datatypes

Jing contains a built-in partial implementation of the W3C XML Schema Part 2 Recommendation. Jing follows the Guidelines for using W3C XML Schema Datatypes with RELAX NG.

The following datatypes are implemented:

Other datatypes are recognized but validated like string.

The implementation of the pattern facet requires an implementation of regular expressions as defined in XML Schema Part 2. The implementation must implement the the interface com.thaiopensource.datatype.xsd.RegexEngine. Jing finds an implementation of this interface using the service provider technique: a JAR file containing an implementation of this interface must contain a file META-INF/services/com.thaiopensource.datatype.xsd.RegexEngine that contains the name of class that implements the interface. Jing contains a provider of this interface implemented using the package org.apache.xerces.utils.regex which is included in the Xerces XML Parser. Jing will automatically use this if that package is available on your CLASSPATH. This requires at least version 1.3.1 of Xerces-J.

Alternatively, you can use IBM's Regex for Java package, available from Alphaworks. You can create a RegexEngine that uses this simply by changing org.apache.xerces.utils to com.ibm in com/thaiopensource/datatype/xsd/regex/xerces/RegexEngineImpl.java. The sample implementation does not include such a class because the license for Regex for Java is currently rather restrictive.