/** * Implements the EntityResolver.resolveEntity() interface method. * @param publicId the public id to resolve. * @param systemId the system id to resolve. * @throws SAXException if there is a parsing problem. * @throws IOException if there is an IO problem. * @return the resolved entity. * @see org.xml.sax.EntityResolver#resolveEntity */ @Override public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { if (isReference()) { return getRef().resolveEntity(publicId, systemId); } dieOnCircularReference(); log("resolveEntity: '" + publicId + "': '" + systemId + "'", Project.MSG_DEBUG); InputSource inputSource = getCatalogResolver().resolveEntity(publicId, systemId); if (inputSource == null) { log("No matching catalog entry found, parser will use: '" + systemId + "'", Project.MSG_DEBUG); } return inputSource; }
/** * @see org.eclipse.wst.wsdl.validation.internal.xml.XMLCatalog#resolveEntityLocation(java.lang.String, java.lang.String) */ public String resolveEntityLocation(String publicId, String systemId) { String resolvedId = null; try { InputSource is = xmlCatalog.resolveEntity(publicId, systemId); if (is != null) { resolvedId = is.getSystemId(); } } // catch (Exception e) { // Do nothing if the resource can't be resolved. } // needs to return null if it can't resolve the id if (resolvedId != null && resolvedId.equals("")) { resolvedId = null; } return resolvedId; }