I've flatpack xml file in one jar that located in war lib as following
<!-- DTD can be pulled from the Jar or over the web-->
<!DOCTYPE PZMAP SYSTEM "flatpack.dtd" >
<!--<!DOCTYPE PZMAP SYSTEM "http://flatpack.sourceforge.net/flatpack.dtd" >-->
<COLUMN name="FIRSTNAME" />
<COLUMN name="LASTNAME" />
<COLUMN name="ADDRESS" />
<COLUMN name="CITY" />
<COLUMN name="STATE" />
<COLUMN name="ZIP" />
says (among other things) that the URL to find the "flatpack.dtd" document is the same as the URL for the XML document it's contained in except that the file part is "flatpack.dtd". In other words the two are in the same folder.
However this is only useful if the parser actually knows the URL of the XML document. In this case since you passed in an InputStream it has no idea of the URL where it came from. If you had used the getResource() method instead of getResourceAsStream(), and passed the resulting URL to the parser, then it would have known where to look for the DTD.