I am trying to get a single SAXParser instance to be re-used multiple
times. I have a problem however that successive XML documents fed to the
parser could reference different versions of a schema under the same
namespace (in my case namespace http://def.wmo.int/collect/2014 with
http://schemas.wmo.int/collect/1.1/collect.xsd or
http://schemas.wmo.int/collect/1.2/collect.xsd). I have

parser->cacheGrammarFromParse(true);
and
parser->setHandleMultipleImports(true);

but still the parser will only validate those documents properly using the
same version of the schema as was used by the very first document parsed
after instantiation of the parser. Subsequent documents using the other
version fails validation even if they are valid. Is there any way to
overcome this other than killing and re-creating the parser with every
document ? I am trying to prevent this as the parser needs to verify
thousands of documents and not caching means having to re-parse a myriad of
cascading schemas every time.

Thanks

Reply via email to