You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Andrew Cheng <an...@lumeria.com> on 2000/03/22 00:33:11 UTC

skipping DTD.....

i was wondering if there is a way around needing the DTD while parsing
an xml document......

i read the thread a while back about cacheing the DTD on a local
machine....but i would rather be able to have the parser just parse my
document by nodes......without refrencing an existing DTD......

any ideas on how i could do this???

Re: skipping DTD.....

Posted by Andy Clark <an...@apache.org>.
Andrew Cheng wrote:
> i was wondering if there is a way around needing the DTD while parsing
> an xml document......

[Q] Do your documents have DOCTYPE lines?

If they do, then the parser will read the file, even if not
validating. Check the documentation for more information on
the settings and behavior of the parser.

Perhaps you could write an EntityResolver that caches DTD
documents that are resolved and then just returns an input
source wrapped around the memory buffer each time that it's
requested. You would need to write the caching entity
resolver, the caching mechanism, and decide how you're
going to identify DTD entities and not other entities --
perhaps those system identifiers that end in ".dtd"...

-- 
Andy Clark * IBM, JTC - Silicon Valley * andyc@apache.org