You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Kiran BV <bv...@hotmail.com> on 2004/04/21 23:40:28 UTC
Question on grammar caching
1. I have a set of in-memory schema grammars for one or more namespaces. I
always want to use this instead of the one specified in the xml instance
doc.
I can cache the in-memory grammars but would the SAX Parser automatically
resolve the schema in the instance doc to the in-memory one.
Since I would be writing a generic handler, I would not know the names of
the exact schema locations specified in the instance document.
2. Can I force validation on a xml which does NOT have a schemaLocation
specified using the in-memory schema.
3. What happens if the SAX parser has an error while grammars are cached.
Are they cleared and the grammars have to be cached again.
Thanks
Kiran
_________________________________________________________________
>From must-see cities to the best beaches, plan a getaway with the Spring
Travel Guide! http://special.msn.com/local/springtravel.armx
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
Re: Question on grammar caching
Posted by Gareth Reakes <ga...@parthenoncomputing.com>.
Hi,
> 1. I have a set of in-memory schema grammars for one or more namespaces. I
> always want to use this instead of the one specified in the xml instance
> doc.
> I can cache the in-memory grammars but would the SAX Parser automatically
> resolve the schema in the instance doc to the in-memory one.
> Since I would be writing a generic handler, I would not know the names of
> the exact schema locations specified in the instance document.
It will be based on namespace so will do what you want. Check out
usedCachedGrammarinParse.
> 2. Can I force validation on a xml which does NOT have a schemaLocation
> specified using the in-memory schema.
Yes, set validation to on. schemaLocation is only a hint.
> 3. What happens if the SAX parser has an error while grammars are cached.
> Are they cleared and the grammars have to be cached again.
No, they are still cached.
Gareth
--
Gareth Reakes, Managing Director Parthenon Computing
+44-1865-811184 http://www.parthcomp.com
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org