Hi Alex,

>
> We need to cache schemas, but there may be multiple versions of schemas for
> the same namespace. Since caching is done on the namespace basis, we'll need
> to maintain multiple schema caches.

You can cache using "namespace + schemaLocation" as a key or as a matter of
fact any other combination with namespace. Please have a look at
XMLSchemaDescription class for other combinations . Default GrammarCaching
implementaiton caches using targetNamespace as the key. You are free to write
your own implementaion as per your caching requirement.

> How would that work in Xerces? Are
> parsers currently restricted to using only one grammar cache?

Yes, one instance of parser can only accept one instance of grammar pool.
However same instance of grammar pool can be supplied to multiple instances of
the parser but not otherway round. Ideally this should be the way when
designing applications. There should be one central grammar pool which should
be shareable acorrs mulitple applications. When sharing across multiple
applications, Grammar Pool implementation should
make sure that its thread safe.

If yes, does

> it mean that for each grammar cache another instance of the parser (or
> parser factory) is needed?
>

No, one grammar pool can be shared across multiple instance of the parser. One
should maintain single GrammarPool but filter the criteria for supplying cached
grammars to the different instance of parser.
I am not sure if different  grammar pool  can be supplied b/w parse for the
_same_ instance of the parser. XMLParserConfiguration interface should have a
way to do that.


Neeraj



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to