Hergert writes:
>what is wrong if i tell Xalan as an Example instead of "foo.xml" using
"d:\xyz\hdghei\foo.xml" in this example foo.xml is there yes I am sure
 ^^^

I'll borrow the answer from the Xalan-Java FAQ:
Q: Why do I get 'file not found' when I pass c:\path\filename.txt?
A: Xalan often requires legal URLs as system identifiers, not local
pathnames (this is partly due to underlying parsers requiring this).
A simple (but not always correct!) way to change a local pathname into
a URL in Java 1.1x is:
  public static String filenameToURL(String filename)
  {
    File f = new File(filename);
    String tmp = f.getAbsolutePath();
    if (File.separatorChar == '\\')
    {
      tmp = tmp.replace('\\', '/');
    }
    // Note: gives incorrect results when filename already begins with
file:///
    return "file:///" + tmp;
  }
For a slightly more detailed example, see org.apache.xml.utils.
SystemIDResolver

Learn more about the details of URL/URIs:
  ftp://ftp.isi.edu/in-notes/rfc1738.txt
  ftp://ftp.isi.edu/in-notes/rfc1808.txt
  ftp://ftp.isi.edu/in-notes/rfc2396.txt

I hope you can fill in the other details.
.................David Marston

Reply via email to