commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Dudziak <tom...@gmail.com>
Subject Re: [Digester] How to turn off parse's attempt to retrieve dtd?
Date Wed, 15 Jun 2005 09:12:29 GMT
> But as you've got a broken DOCTYPE you have two options:
> (1) use some parser-specific property setting to tell the parser to
> ignore external DTDs. If you're using Sun's java 1.4 or later then the
> underlying parser is actually Xerces, so see
>   http://xml.apache.org/xerces2-j/features.html
>   for feature external-parameter-entities
> and see also method Digester.setProperty. Of course this isn't terribly
> portable, nor guaranteed to work in future JVMs (though I can't see Sun
> ditching Xerces for anything else in the near future).
> 
> (2) write a custom EntityResolver subclass that returns an empty stream
> when asked for the DTD, and register that with Digester using
> Digester.setEntityResolver.

Forrest and others use the xml-resolver component from
http://xml.apache.org/commons/components/resolver/index.html, which
provides such an entity resolver that is able to map system
identifiers to (different) urls.
Have a look at the "XML Entity and URI Resolvers" article
(http://xml.apache.org/commons/components/resolver/resolver-article.html)
for a more in-depth explanation.

Tom

---------------------------------------------------------------------
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