jasperreports DTD (SYSTEM vs. PUBLIC)

By: Tony Piazza - tonypiazza
jasperreports DTD (SYSTEM vs. PUBLIC)
2002-09-01 20:11
While running our reports in production we occasionally have problems referencing the PUBLIC DTD that is referenced in XML report definition files. I had hoped that referencing a local copy would fix the problem. Unfortunately the reports stop working when I do that. I know that my XML syntax is valid. The problem occurs when we try to run the reports. Any help you can give would be greatly appreciated.


By: Teodor Danciu - teodord
RE: jasperreports DTD (SYSTEM vs. PUBLIC)
2002-09-02 00:41


XML report templates are valid only when validated
against the internal DTD files that come with the
JAR file. That URL that we use in the XML file
points in fact to this internal DTD file which is
loaded using the getResourceAsStream() method.

Saying that sometimes you have troubles finding
the DTD file sounds like saying sometimes you
have troubles finding some class in the JAR file.

It would be interesting to see this exception you
got from time to time.
All you have to do is to make sure that the
supplied DTD files are available through classpath
when compiling the reports, just like any other
class of the library.

There's absolutely no point in making a copy of the
DTD files on disk. Check the JRXmlDigester class
to see how the DTDs are loaded.
Instead, you should concentrate on finding the real

Thank you,

By: Kundan Lal - lalkundan
RE: jasperreports DTD (SYSTEM vs. PUBLIC)
2004-10-04 02:59
Hi teodord,

I read same answer of yours for the DTD lookup error, in following link http://sourceforge.net/forum/message.php?msg_id=1996798

but i got following error on my linux machine.

Error : java.net.SocketException: Network is unreachable.

I also checked the code in JRXmlDigester class..

if (
systemId.equals("http://jasperreports.sourceforge.net/dtds/jasperreport.dtd") ||
dtd = "net/sf/jasperreports/engine/dtds/jasperreport.dtd";
else if (
systemId.equals("http://jasperreports.sourceforge.net/dtds/jasperprint.dtd") ||
dtd = "net/sf/jasperreports/engine/dtds/jasperprint.dtd";

But when i connected to net This problem was solved.

But i need to resolve the problem without net connection??? how can i do this
ktrinad's picture
Joined: Aug 9 2006 - 2:36am
Last seen: 16 years 10 months ago

0 Answers:

No answers yet