Hi Ismail ,

What exactly is the problem you are facing , what makes you say that passive caching is not working ?

Regards,
venu


Ismail Nalwala wrote:



Hi,
I am trying to use xni to cache xml schema grammars. The xerces
documentation mentions that active and passive caching of schemas are both
possible, as long as there is an an instance of the XMLGrammarPool object
associated with the parser. The sample code and documentation describes how
to preparse schema grammars to acheive active caching and preventing
unwanted grammars from entering the grammar pool. However I am unable to
get passive caching to work. I do not want to pre-detrmine all the grammars
that I may need, however I still want to maintain a cache of all the
grammars that are needed by my application.
I have tried doing the following with no luck. Any thoughts or guidance
will be greatly appreciated.

thanks
Ismail.

  SymbolTable sym = new SymbolTable(BIG_PRIME);

   XMLGrammarPoolImpl grammarPool = new XMLGrammarPoolImpl();
   grammarPool.unlockPool();
   XMLGrammarCachingConfiguration parserConfiguration = new
XMLGrammarCachingConfiguration (sym, grammarPool);
   parserConfiguration.unlockGrammarPool();
   parserConfiguration.setFeature(NAMESPACES_FEATURE_ID, true);
   parserConfiguration.setFeature(VALIDATION_FEATURE_ID, false);
   parserConfiguration.setFeature(SCHEMA_VALIDATION_FEATURE_ID, true);
   parserConfiguration.setProperty(GRAMMAR_POOL,grammarPool);

   XMLReader reader = new SAXParser(parserConfiguration);


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



Reply via email to