You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Shu Yan Chan (UK)" <sh...@eu.citrix.com> on 2000/08/25 13:17:20 UTC

where to place dtd

I am trying to set up Tomcat3.1 to run on IIS and Apache Web Server(Linux).
I am writing a servlet which use the Sun XML Parser, I need to parse XML
file which use a dtd to made it valid.
The beginning of the XML I wanted to parse looks like:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE Test1 SYSTEM "testing.dtd">

where should I put my testing.dtd?  I tried to put it in the same directory
as where I put my class files, just under WEB-INF, and in the root of the
Tomcat's context, but still no luck.  I could change the "testing.dtd" tag
to an absolute URL, but I shouldn't need to, do I?

Yours,
Shu Yan

Re: where to place dtd

Posted by Steve Weiss <sw...@aamc.org>.
"Shu Yan Chan (UK)" wrote:
> 
> I am trying to set up Tomcat3.1 to run on IIS and Apache Web Server(Linux).
> I am writing a servlet which use the Sun XML Parser, I need to parse XML
> file which use a dtd to made it valid.
> The beginning of the XML I wanted to parse looks like:
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <!DOCTYPE Test1 SYSTEM "testing.dtd">

I think (but I could be wrong) that for this case you would need to put
your .xml file in the same directory as the DTD. If you specify SYSTEM,
then the parser will look for the dtd like a regular file on the disk,
so it needs path information. If you just use "testing.dtd", the xml
file and the dtd would probably need to be in the same directory. 


> where should I put my testing.dtd?  I tried to put it in the same directory
> as where I put my class files, just under WEB-INF, and in the root of the
> Tomcat's context, but still no luck.  I could change the "testing.dtd" tag
> to an absolute URL, but I shouldn't need to, do I?

If you use PUBLIC instead of SYSTEM, then you would need to use a URL.

-Steve
-- 
Steve Weiss      Association of American Medical Colleges
(202)828-0428    mailto:sweiss@aamc.org    http://www.aamc.org

Re: where to place dtd

Posted by Chris Cuilla <ch...@cuilla.com>.
Two things:

    1. As another poster indicated, set 'standalone="no"'.

    2. You can specify the following for your DTD:

            http://hostname/pathtodtd/testing.dtd

        And then simply make your DTD available through a web server (even a
local one on your machine). Tomcat works fine for this.

        I have tried (with Sun's XML parser) having the DTD in the same
directory I am running my code from and have not been successful. Of course I
may have been doing something dumb. In either case, the above works just fine
(if a mildly more cumbersome).

Hope this helps.

Chris


----- Original Message -----
From: "Shu Yan Chan (UK)" <sh...@eu.citrix.com>
To: <to...@jakarta.apache.org>
Sent: Friday, August 25, 2000 5:17 AM
Subject: where to place dtd


> I am trying to set up Tomcat3.1 to run on IIS and Apache Web Server(Linux).
> I am writing a servlet which use the Sun XML Parser, I need to parse XML
> file which use a dtd to made it valid.
> The beginning of the XML I wanted to parse looks like:
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <!DOCTYPE Test1 SYSTEM "testing.dtd">
>
> where should I put my testing.dtd?  I tried to put it in the same directory
> as where I put my class files, just under WEB-INF, and in the root of the
> Tomcat's context, but still no luck.  I could change the "testing.dtd" tag
> to an absolute URL, but I shouldn't need to, do I?
>
> Yours,
> Shu Yan


Re: where to place dtd

Posted by Pierre Neihouser <pi...@lionet.ie>.
Hi,

I have no idea where to put this DTD but maybe if you specify standalone="no"
instead of yes, that will notify the parser to look for it...

My $0.02

Pierre

"Shu Yan Chan (UK)" wrote:

> I am trying to set up Tomcat3.1 to run on IIS and Apache Web Server(Linux).
> I am writing a servlet which use the Sun XML Parser, I need to parse XML
> file which use a dtd to made it valid.
> The beginning of the XML I wanted to parse looks like:
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <!DOCTYPE Test1 SYSTEM "testing.dtd">
>
> where should I put my testing.dtd?  I tried to put it in the same directory
> as where I put my class files, just under WEB-INF, and in the root of the
> Tomcat's context, but still no luck.  I could change the "testing.dtd" tag
> to an absolute URL, but I shouldn't need to, do I?
>
> Yours,
> Shu Yan