code: @Override
    public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
  
      String filename = xhtmlResourceMap.get(publicId);
      if (filename != null) {
        String resourceName = resourceFolder + "/" + filename;
        InputStream is = XHtmlEntityResolver.class.getResourceAsStream(resourceName);
  
        if (is == null) {
          throw new IOException("Resource '" + resourceName + "' not found in class path.");
        }
  
        return new InputSource(is);
      }
  
      return null;
    }
docs: Resolve XHtml resource entities, load from classpath resources.