Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Where to put local DTD files in Java projects

807607Oct 19 2006 — edited Oct 19 2006
I'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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 16 2006
Added on Oct 19 2006
2 comments
291 views