Where to put local DTD files in Java projects
807607Oct 19 2006 — edited Oct 19 2006I'm working on a Netbeans project where the program funcion is driven by an XML configuration file, which will be distributed with the program.
It's structured enough to warrant a DTD. The problem is, accesing it.
I'm currently accessing the XML as a resource, in the same directory as Main.class, which is in a package directory. Using a system <!DOCTYPE with a simple filename for the DTD works fine in the Netbeans XML editor, but, of course, when I run the program it runs with the project base as the current directory and can't find it. And the situation will be even worse when I prepare the program for distribution.
Anyone found a tidy approach to this? Is there some way of modifying the way the DocumentBuilder accesses DTDs?