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="07822190222_2.jpg"/>
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="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE DIGITAL_VAULT_EXPORT SYSTEM "DigitalVaultExport.dtd" >
<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 "DigitalVaultExport.dtd"; 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
I'm using XML for saving Images into a DB.
The images are included by a content Tag like
<CONTENT FILE="07822190222_2.jpg"/>
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="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE DIGITAL_VAULT_EXPORT SYSTEM "DigitalVaultExport.dtd" >
<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 "DigitalVaultExport.dtd"; 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