Rafael Sousa (Ext_Altior) wrote:
Hi everybody!
The possibility to cache the grammar from the schemas that are used for
validation is very useful. That way, we can avoid reading many times the
same schema file from disk, and building the same grammar objects over
and over.
But what is the best way to explicitly do this, without having to wait
for the first XML message that uses some schema? Because what happens is
that the first time a schema is used takes much more time than the next
ones. It would be nice to be able to construct and cache the grammar
we'll use during system initialization, where time requisites are more
lenient...
You probably want to use the loadGrammar() API on the parser instance
you're using. Be sure to call it with the last parameter as true, so it
keeps the grammar in its cache.
Dave