Yes you can use the caching in the parser. And frankly it is THE way to go, if you like speed that is :) Simplest way to go:
poParser->setFeature(XMLUni::fgXercesCacheGrammarFromParse, true); Then use the same parser for all parses (do not delete it). The grammar will be cached on the first parse. On all parses after that the grammar will be reused (not loaded and not parsed) and this makes a HUGE difference in speed. Note that you can have multiple grammars in the cache. If a requested grammar is not in the cache then it will be parsed and cached automatically. Note the grammar cache is owned by ONE parser instance so if you delete the parser the cache has to be recreated. / Erik PS: A grammar describes a valid XML file. A grammar is either a DTD or a Schema. -----Original Message----- From: Mark Horton [mailto:[EMAIL PROTECTED]] Sent: den 25 december 2002 04:33 To: [EMAIL PROTECTED] Subject: DTD caching Hi, I've been trying to cache a simple DTD for use in multiple parses. Is using an EntityResolver the best/only way to do this? I noticed some methods for caching and loading grammar in XercesDomParser but I couldn't get it to work. I deducted that this is because I am using a standard DTD and not XML Grammar. Is this correct? Or can you use the grammar caching with DTDs? (To be honest I'm not sure of the difference between Grammar and DTD.) Mark --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
