Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't find dtd within a JAR

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi together,

I'm using XML for saving Images into a DB.
The images are included by a content Tag like
<CONTENT FILE=&quot;07822190222_2.jpg&quot;/>

The Images and the XML Source File are archived
into a JAR Archive.

Now the problem:
To validate the above XML implementation I have
to declaire the DTD within my XML. This is done
as follows:

<?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?>
<!DOCTYPE DIGITAL_VAULT_EXPORT SYSTEM &quot;DigitalVaultExport.dtd&quot; >
<DIGITAL_VAULT_EXPORT>
.
.
.
</DIGITAL_VAULT_EXPORT>

Now I started to parse the XML file within a
Java Application by using SAXParser. The Parser
throws an Exception that the given dtd (here
DigitalVaultExport.dtd ) could not be found by throwing
following error mess:

org.xml.sax.SAXParseException: Relative URI &quot;DigitalVaultExport.dtd&quot;; can not be resolved without a document URI

I tried a number of possible solutions to include the
DigitalVaultExport.dtd:
1.)I put the dtd within the JAR Archive -> Same Error
2.)I put the dtd within the same FileSystem as
the Archive is found -> Same Error
....

If I use a http server and inlcude the dtd declaration
as everything works fine, but I wont use http URL.

Any idea?
Where has the dtd file to be that it could be found
by the parser? The specification tells ... relative URI
.... so where is the mistake here?
Has the dtd to be declaired explicit to the parser?

Thanks for help
Meinolf
 
Hello. Unfortunately, I´ve found myself with this very same problem. Have you managed to solve it? I haven´t... but if I found out anything, I´ll let you know here right away.
Can anybody else help us?
Thanks a lot

Paulo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top