title: Parsing an XML file with a DTD schema on a relative path
body: <p>I have the following java code:</p>
  
  <pre>
  <code>
  DocumentBuilder db=DocumentBuilderFactory.newInstance().newDocumentBuilder();
  Document doc=db.parse(new File("/opt/myfile"));
  </code>
  </pre>
  
  <p>And <code>/opt/myfile</code> contains something like:</p>
  
  <pre>
  &lt;?xml version="1.0" encoding="UTF-8"?>
  &lt;!DOCTYPE archive SYSTEM "../../schema/xml/schema.dtd">
  ...
  </pre>
  
  <p>I get the following error:</p>
  
  <pre>
  java.io.FileNotFoundException: /../schema/xml/schema.dtd (No such file or directory)
  </pre>
  
  <p>This is a large java framework that consumes an XML file produced elsewhere.  I think the relative path is the problem.  I don't think it will be acceptable to change the cwd before the JVM starts (the path comes from a config file that is read by the JVM itself) and I have not found a way to change the cwd while the JVM is running.  How do I parse this XML file with the appropriate DTD?</p>