DatatypeLibrary dl = datatypeLibraryFactory.createDatatypeLibrary(datatypeLibrary);
if (dl == null) {
error("unrecognized_datatype_library", datatypeLibrary, (Locator) loc);
} else {
try {
DatatypeBuilder dtb = dl.createDatatypeBuilder(type);
try {
Datatype dt = dtb.createDatatype();
Object obj = dt.createValue(value, new ValidationContextImpl(context, ns));
if (obj != null) {
return pb.makeValue(dt, obj);
}
error("invalid_value", value, (Locator) loc);