public DatatypeBuilder createDatatypeBuilder(String type) throws DatatypeException {
   if (type.equals("ID") || type.equals("IDREF") || type.equals("IDREFS")) {
     if (xsdDatatypeLibrary == null) {
       xsdDatatypeLibrary =
           factory.createDatatypeLibrary(WellKnownNamespaces.XML_SCHEMA_DATATYPES);
       if (xsdDatatypeLibrary == null) throw new DatatypeException();
     }
     return xsdDatatypeLibrary.createDatatypeBuilder(type);
   }
   throw new DatatypeException();
 }
 public DatatypeLibrary createDatatypeLibrary(String uri) {
   if (uri.equals("")) return builtinDatatypeLibrary;
   if (uri.equals(WellKnownNamespaces.RELAX_NG_COMPATIBILITY_DATATYPES))
     return compatibilityDatatypeLibrary;
   return core.createDatatypeLibrary(uri);
 }