}
}
if (sources.isEmpty()) {
return null;
}
final OASISCatalogManager catalogResolver = OASISCatalogManager.getCatalogManager(bus);
if (catalogResolver != null) {
catalogLocation = catalogLocation == null
? SchemaHandler.DEFAULT_CATALOG_LOCATION : catalogLocation;
URL catalogURL = ResourceUtils.getResourceURL(catalogLocation, bus);
if (catalogURL != null) {
try {
catalogResolver.loadCatalog(catalogURL);
factory.setResourceResolver(new LSResourceResolver() {
public LSInput resolveResource(String type, String namespaceURI, String publicId,
String systemId, String baseURI) {
try {
String resolvedLocation = catalogResolver.resolveSystem(systemId);
if (resolvedLocation == null) {
resolvedLocation = catalogResolver.resolveURI(namespaceURI);
}
if (resolvedLocation == null) {
resolvedLocation = catalogResolver.resolvePublic(publicId, systemId);
}
if (resolvedLocation != null) {
InputStream resourceStream =
ResourceUtils.getResourceStream(resolvedLocation, bus);
if (resourceStream != null) {