You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Martin Schmidt <ne...@gmx.de> on 2001/08/09 14:11:47 UTC

Problem with relative path to external DTD

Hi all,

I have a very strange problem using SAX (Xerces 1.4.2, JSDK 1.3, RedHat
7) and external DTDs. 

I wrote a small Java program (ValidateXML) which performs validating
parsing. 

I have a file test.xml which references a test.dtd
<!DOCTYPE root_node SYSTEM "test.dtd">

When I call "java ValidateXML test.xml" and all files are in one
directory everything goes right.
But if the test.xml and the DTD are both in an other directory the
parser can't find the DTD when I call "java ValidateXML ../test.xml".
If I change the reference to the DTD everything works well again:
<!DOCTYPE root_node SYSTEM "../test.dtd">

This confuses me, because I don't understand why the path to the DTD is
not relative to the test.xml, but relative to the directory from where
the parser was executed.

Unfortunaltely I can't use http references or absolute paths. I tried
the protocol file, but I couldn't handle relative paths with it.

Thank you very much for your help.

        .\\artin Schmidt

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org


Re: Problem with relative path to external DTD

Posted by Maik Weber <ma...@gmx.de>.
hello martin,

i can't imagine that this is possible. I had never problems like this.
Do you test it with the samples?

greetings maik

Martin Schmidt wrote:

> Hi all,
>
> I have a very strange problem using SAX (Xerces 1.4.2, JSDK 1.3, RedHat
> 7) and external DTDs.
>
> I wrote a small Java program (ValidateXML) which performs validating
> parsing.
>
> I have a file test.xml which references a test.dtd
> <!DOCTYPE root_node SYSTEM "test.dtd">
>
> When I call "java ValidateXML test.xml" and all files are in one
> directory everything goes right.
> But if the test.xml and the DTD are both in an other directory the
> parser can't find the DTD when I call "java ValidateXML ../test.xml".
> If I change the reference to the DTD everything works well again:
> <!DOCTYPE root_node SYSTEM "../test.dtd">
>
> This confuses me, because I don't understand why the path to the DTD is
> not relative to the test.xml, but relative to the directory from where
> the parser was executed.
>
> Unfortunaltely I can't use http references or absolute paths. I tried
> the protocol file, but I couldn't handle relative paths with it.
>
> Thank you very much for your help.
>
>         .\\artin Schmidt
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org

--
* Homepage: www.webis-world.de
* mailto        : maikweber@gmx.de
* ICQ           : #57313947



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org