commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject RE: [digester] validating against system dtd?
Date Thu, 18 Sep 2003 21:13:57 GMT
On Thu, 18 Sep 2003, Phillip Qin wrote:

> Date: Thu, 18 Sep 2003 14:05:49 -0400
> From: Phillip Qin <Phillip.Qin@shareowner.com>
> Reply-To: Jakarta Commons Users List <commons-user@jakarta.apache.org>
> To: 'Jakarta Commons Users List' <commons-user@jakarta.apache.org>
> Subject: RE: [digester] validating against system dtd?
>
> Craig,
>
> If I don't use InputSource, is following snippet "not to avoid"?
>
> 	Digester d = DigesterLoader.createDigester(url);
> 	d.push(this);
> 	d.parse(input);
>

The key question is what "input" is.  If it's an InputStream, then the XML
parser has no way to know what the absolute URL of the input document was,
and therefore no way to resolve relative URLs.  (The URL you pass to
createDigester() is for the XML document containing the Digester rules,
not the XML document to be parsed.)

Note that this issue is by no means specific to Digester -- it'll happen
to you with direct calls to DOM or SAX parsers as well, because it is the
XML parser that actually resolves these things.  Digester doesn't have a
clue.

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message