You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Doug Miller <mi...@nni.com> on 2001/04/09 23:51:48 UTC

Location of DTD file

A remote client is sending me an XML string.  It contains a reference to
a DTD file in the DOCTYPE statement.  The file name is unqualified (i.e.
"sometype.dtd") since the client doesn't know where it will exist on the
server.

How can I tell the SAX parser where to go look for the dtd file?

I am using version 1.1 of the parser.

Any thoughts?

Thanks,
Doug Miller


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


Re: Location of DTD file

Posted by Milind Gadre <mi...@ecplatforms.com>.
Doug, register a EntityResolver with the parser prior to calling the
pare method.

Regards...

Milind Gadre
ecPlatforms, Inc
901 Mariner's Island Blvd, Suite 565
San Mateo, CA 94404
C: 510-919-0596
F: 815-352-0779
milind@ecplatforms.com

----- Original Message -----
From: "Doug Miller" <mi...@nni.com>
To: <xe...@xml.apache.org>
Sent: Monday, April 09, 2001 2:51 PM
Subject: Location of DTD file


> A remote client is sending me an XML string.  It contains a reference
to
> a DTD file in the DOCTYPE statement.  The file name is unqualified
(i.e.
> "sometype.dtd") since the client doesn't know where it will exist on
the
> server.
>
> How can I tell the SAX parser where to go look for the dtd file?
>
> I am using version 1.1 of the parser.
>
> Any thoughts?
>
> Thanks,
> Doug Miller
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>


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


Re: Location of DTD file

Posted by Vanasri Upadhye <vu...@powertec.com>.
Why don't you try to add the doctype statement with url in xml file so that
the parser will take the dtd file and parse the xml file.
hope this makes some sense
Good Luck
Vanasri
----- Original Message -----
From: "Andy Clark" <an...@apache.org>
To: <xe...@xml.apache.org>
Sent: Monday, April 09, 2001 9:42 PM
Subject: Re: Location of DTD file


> Doug Miller wrote:
> > A remote client is sending me an XML string.  It contains a reference to
>
> Is there a base URI for the remote client? If so, then set
> the systemId on the input source that you hand to the parser
> so that the parser can figure out the relative path of the
> DTD. For example:
>
>   Reader reader = new StringReader(XML_STRING);
>   InputSource source = new InputSource(reader);
>   source.setSystemId(REMOTE_HOST_URI);
>
> Else, follow Milind's suggestion of using an EntityResolver.
>
> --
> Andy Clark * IBM, TRL - Japan * andyc@apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>


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


Re: Location of DTD file

Posted by Andy Clark <an...@apache.org>.
Doug Miller wrote:
> A remote client is sending me an XML string.  It contains a reference to

Is there a base URI for the remote client? If so, then set
the systemId on the input source that you hand to the parser
so that the parser can figure out the relative path of the
DTD. For example:

  Reader reader = new StringReader(XML_STRING);
  InputSource source = new InputSource(reader);
  source.setSystemId(REMOTE_HOST_URI);

Else, follow Milind's suggestion of using an EntityResolver.

-- 
Andy Clark * IBM, TRL - Japan * andyc@apache.org

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