Boris Kolpackov <boris <at> codesynthesis.com> writes:

> 
> Hi Vijay,
> 
> Vijay S. Bajwa <vijay.bajwa <at> citigroup.com> writes:
> 
> > I tried the followin 2 lines:
> >
> >  saxParser->loadGrammar ("/home/vb11258/zas/GTS-Oasys/schema/GTS-Oasys.xsd",
> >               Grammar::SchemaGrammarType, true);
> >  saxParser->useCachedGrammarInParse(true);
> 
> Here is the parser setup that works for me:
> 
>       SAX2XMLReader* sax (XMLReaderFactory::createXMLReader());
> 
>       sax->setFeature (XMLUni::fgSAX2CoreNameSpaces, true);
>       sax->setFeature (XMLUni::fgSAX2CoreNameSpacePrefixes, true);
>       sax->setFeature (XMLUni::fgXercesValidationErrorAsFatal, true);
>       sax->setFeature (XMLUni::fgSAX2CoreValidation, true);
>       sax->setFeature (XMLUni::fgXercesSchema, true);
>       sax->setFeature (XMLUni::fgXercesSchemaFullChecking, true);
> 
>       sax->loadGrammar ("structure.xsd", Grammar::SchemaGrammarType, true);
>       sax->setFeature (XMLUni::fgXercesUseCachedGrammarInParse, true);

Boris, thanks! The one which worked for me was:
    saxParser->setExternalNoNamespaceSchemaLocation (schemaLocation);
    saxParser->useCachedGrammarInParse(true);

The former points to a schema location independently of the XML, and the latter 
uses the schema fom cache (hopefully!)

Regards,
Vijay




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

Reply via email to