[jdom-interest] [NEWBEE] Open an XML-file by using a DTD in a JAR

Andreas Riedel riedelandreas at yahoo.de
Mon Jun 17 07:17:10 PDT 2002


Hello List.

I just start to work with JDOM and made my first test.
To test, I open an existing XML file on my device,
generated for Log4J.

The XML-File starts with:
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

The source



  SAXBuilder f_SaxBuilder = new SAXBuilder();

  Document f_DocJDOM = null;

  try {
   f_DocJDOM = f_SaxBuilder.build( new File(
"log4jUserAccess.xml" ) );
  } // try
  catch( JDOMException f_excJDOM ) {
    f_excJDOM.printStackTrace();
  } // catch




The DTD is in the log4j.jar, I included in my
classpath:

java -cp
./classes;./lib/jdom.jar;./lib/xerces.jar;./lib/log4j.jar;
test.Test

But when I run the program, I get the following
exception:

org.xml.sax.SAXParseException: File
"file:/C:/Projects/Test/~gen/dist/log4j.dtd"

When I unzip the log4j.jar and copy the log4j.dtd to
that directory, it's run.

But I want, that JDOM open the log4j.dtd in the
log4J.jar.

Does anybody have an solution for that problem.

TIA

Andreas Riedel.


__________________________________________________________________

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Yahoo! präsentiert als offizieller Sponsor das Fußball-Highlight des
Jahres: - http://www.FIFAworldcup.com



More information about the jdom-interest mailing list