/** * Create and register a set of types specified in a user schema file. * We use the (illegal) DAML+OIL approach that the uriref of the type * is the url of the schema file with fragment ID corresponding the * the name of the type. * * @param uri the absolute uri of the schema file to be loaded, this should be a resolvable URL * @param encoding the encoding of the source file (can be null) * @param tm the type mapper into which to load the definitions * @return a List of strings giving the uri's of the newly defined datatypes * @throws DatatypeFormatException if there is a problem during load (not that we use Xerces * in default mode for load which may provide diagnostic output direct to stderr) */ public static List<String> loadUserDefined(String uri, String encoding, TypeMapper tm) throws DatatypeFormatException { return loadUserDefined(new XMLInputSource(null, uri, uri), tm); }
/** * Create and register a set of types specified in a user schema file. * We use the (illegal) DAML+OIL approach that the uriref of the type * is the url of the schema file with fragment ID corresponding the * the name of the type. * * @param uri the absolute uri of the schema file to be loaded * @param reader the Reader stream onto the file (useful if you wish to load a cached copy of the schema file) * @param encoding the encoding of the source file (can be null) * @param tm the type mapper into which to load the definitions * @return a List of strings giving the uri's of the newly defined datatypes * @throws DatatypeFormatException if there is a problem during load (not that we use Xerces * in default mode for load which may provide diagnostic output direct to stderr) */ public static List<String> loadUserDefined(String uri, Reader reader, String encoding, TypeMapper tm) throws DatatypeFormatException { return loadUserDefined(new XMLInputSource(null, uri, uri, reader, encoding), tm); }