--- src/org/apache/xml/resolver/Catalog.java.org	2008-04-08 13:58:50.828125000 -0500
+++ src/org/apache/xml/resolver/Catalog.java	2008-04-09 09:39:49.125000000 -0500
@@ -807,6 +807,7 @@
   protected synchronized void parseCatalogFile(String fileName)
     throws MalformedURLException, IOException, CatalogException {
 
+    URL newBase = null;
     CatalogEntry entry;
 
     // The base-base is the cwd. If the catalog file is specified
@@ -821,19 +822,39 @@
       catalogManager.debug.message(1, "Malformed URL on cwd", userdir);
       catalogCwd = null;
     }
+    catalogManager.debug.message(4, "catalog cwd", catalogCwd.toString());
 
     // The initial base URI is the location of the catalog file
-    try {
-      base = new URL(catalogCwd, fixSlashes(fileName));
-    } catch (MalformedURLException e) {
+
+    // We handle case if on windows and filename is denoted by
+    // a drive letter.  If so, treat as absolute.
+    String fixedFileName = fixSlashes(fileName);
+    String osname        = System.getProperty("os.name");
+    boolean windows      = (osname.indexOf("Windows") >= 0);
+    catalogManager.debug.message(4, "fixed filename", fixedFileName);
+    if (windows && (fixedFileName.charAt(1) == ':')) {
       try {
-	base = new URL("file:" + fixSlashes(fileName));
-      } catch (MalformedURLException e2) {
-	catalogManager.debug.message(1, "Malformed URL on catalog filename",
-		      fixSlashes(fileName));
-	base = null;
+        newBase = new URL("file:/" + fixedFileName);
+      } catch (MalformedURLException mue) {
+        catalogManager.debug.message(4, "Windows path failed", fixedFileName);
       }
     }
+    if (newBase == null) {
+      try {
+        newBase = new URL(catalogCwd, fixedFileName);
+      } catch (MalformedURLException e) {
+        catalogManager.debug.message(4, "context URL failed", fixedFileName);
+        try {
+          newBase = new URL("file:" + fixedFileName);
+        } catch (MalformedURLException e2) {
+          catalogManager.debug.message(1, "Malformed URL on catalog filename",
+                        fixedFileName);
+          // No reason to continue since base needs to be non-null
+          return;
+        }
+      }
+    }
+    base = newBase;
 
     catalogManager.debug.message(2, "Loading catalog", fileName);
     catalogManager.debug.message(4, "Default BASE", base.toString());
@@ -1692,10 +1713,16 @@
     }
 
     // Otherwise, look in the subordinate catalogs
-    return resolveSubordinateCatalogs(SYSTEM,
+    String resolved = resolveSubordinateCatalogs(SYSTEM,
 				      null,
 				      null,
 				      systemId);
+    if (resolved != null) {
+      return resolved;
+    }
+
+    // There could be a URI entry that maps systemId to another URI.
+    return resolveURI(systemId);
   }
 
   /**
