sboag 00/10/06 00:47:50
Modified: java/src/org/apache/xalan/utils SystemIDResolver.java
Log:
Clip off "file:" from "file:xxx". Hack to workaround problem with URI class.
Revision Changes Path
1.6 +13 -1
xml-xalan/java/src/org/apache/xalan/utils/SystemIDResolver.java
Index: SystemIDResolver.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/utils/SystemIDResolver.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SystemIDResolver.java 2000/10/02 02:43:09 1.5
+++ SystemIDResolver.java 2000/10/06 07:47:49 1.6
@@ -60,8 +60,12 @@
import org.apache.xalan.utils.URI;
import org.apache.xalan.utils.URI.MalformedURIException;
+import java.io.*;
+import java.lang.StringBuffer;
+
public class SystemIDResolver
-{
+{
+
/**
* Take a SystemID string and try and turn it into a good absolute URL.
* @exception SAXException thrown if the string can't be turned into a URL.
@@ -69,6 +73,13 @@
public static String getAbsoluteURI(String urlString, String base)
throws SAXException
{
+ // bit of a hack here. Need to talk to URI person to see if this can be
fixed.
+ if((null != base) &&
+ urlString.startsWith("file:") && (urlString.charAt(5) != '/'))
+ {
+ urlString = urlString.substring(5);
+ }
+
URI uri;
try
{
@@ -87,6 +98,7 @@
throw new SAXException(mue);
}
String uriStr = uri.toString();
+
return uriStr;
}
}