Index: src/main/java/org/apache/fop/apps/io/InternalResourceResolver.java
===================================================================
--- src/main/java/org/apache/fop/apps/io/InternalResourceResolver.java	(revision 1858116)
+++ src/main/java/org/apache/fop/apps/io/InternalResourceResolver.java	(working copy)
@@ -110,9 +110,36 @@
      * @return the resolved URI
      */
     public URI resolveFromBase(URI uri) {
-        return baseUri.resolve(uri);
+        return resolveFrom(baseUri, uri);
     }
 
+    private static URI resolveFrom(URI baseUri, URI uri) {
+        if (uri == null)
+            return baseUri;
+        else if (uri.isAbsolute())
+            return uri;
+
+        // this really ought to be just a simple baseUri.resolve(uri), but because of
+        // https://bugs.openjdk.java.net/browse/JDK-8020755 we may need to do a bit of
+        // work(-around):
+        String scheme = baseUri.getScheme();
+        String root = baseUri.getRawSchemeSpecificPart();
+        int slashPos = root.lastIndexOf('/');
+        if (slashPos >= 0)
+            root = root.substring(0, slashPos + 1);
+        if (root.endsWith("."))
+            root += "/";
+
+        String fragment = uri.getFragment();
+        String path = uri.getPath();
+
+        try {
+            return new URI(scheme, root + path, fragment).normalize();
+        } catch (URISyntaxException ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+
     /**
      * Performs some sanitation for some of the most common URI syntax mistakes.
      *
