> > Neil Wrote:

        My apologies for being late, i was on leave lately and didn't get chance 
to look into this thread.
 
>To keep with the theme of picking up long-dropped threads, 
>I thought >it would be useful if we talked about grammar caching a bit more.
>We've done lots of coding, but there are a couple of things that need
>cleaning up:
 
Right, most of the work have been done. Lets give it final blow this time :)
 
> To be more concrete, here are my thoughts on how to stabilize things:
> 
> - XMLGrammarPool should be made into an external property.  This
>   should be read-only within a parse, but if an application wants to
>   change it between parses it would be caveat emptor.  It's
>   conceivable this could be useful, so no point in preventing it.

        We will add the flexibility to whole grammar caching mechanism by making 
XMLGrammarPool as external property, it would be recognized by different 
configurations and validator components.

> - DOMASBuilderImpl should instantiate itself using
>   XMLGrammarCachingConfiguration rather than DTDXSParserConfiguration,
>   and XMLGrammarCachingConfiguration should extend
>   DTDXSParserConfiguration rather than StandardParserConfiguration.
> 
> - Once that's done, DOMASBuilderImpl can be made to use
>   XMLGrammarCachingConfiguration's grammar parsing functionality
>   rather than doing its own thing; this should considerably increase
>   its maintainability.
> 
> - Given DOM's requirements, it may be necessary to use a different
>   grammar pool implementation here than XMLGrammarCachingConfiguration
>   uses by default.  I hope this does not turn out to be the case
>   though; it would be nice to be able to configure our single default
>   implementation to give it the right characteristics.  If we're not
>   able to do otherwise then perhaps it's not sufficiently flexible?


We can also change the way JAXP1.2 changes are implemented. As the schema 
sources mentioned by JAXP1.2 schema source property are always pre-parsed, 

- Use XMLGrammarCachingConfiguration to preParse schema sources and the grammars 
would be stored in default pool.
- Supply this grammar pool to default configuration, as set by the application
in either of the ways
* using class name in org.apache.xerces.xni.parser.XMLParserConfiguration file 
in META-INF/services/
* using org.apache.xerces.xni.parser.XMLParserConfiguration system property.
* Default configuration (StandardParserConfiguration)

This pool would be available as part of XMLGrammarPool#retreiveInitialSet() to 
SchemaValidator component.

As schema grammar caching framework is ready , we need to go ahead with DTD 
grammar caching. Changes mentioned for DOMAsBuilderImpl seems good for the 
reasons mentioned. We should change this and also give thought about JAXP1.2 
changes.

> >Yep. And this would be equivalent to the default implementation
> where no grammar caching occurs.
> 
> Right.  This is what you should get if you just create a parser with
> StandardParserConfiguration.

That reminds me part of code that has been commented in 
StadardparserConfiguration (l358-363) when no grammar pool has been specified by 
the application. 
        When this is the case, we can have do nothing XMLGrammarPool 
implementation, dont cache any grammar and dont provide any grammars as part of 
initialGrammarSet.

Please let me know if i can be of any help to you.

Regards,

Neeraj B.
Sun Microsystems, inc.






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

Reply via email to