The DTD grammar is cached using the system id that you pass when you call load grammar. When you parse you xml file, does the system id of the DOCTYPE resolves to the same id that you passed to load grammar?
"Bagepalli, Kiran" wrote: > I am trying the following piece of code > > XMLPlatformUtils::Initialize(); > SAX2XMLReader* parser = XMLReaderFactory::createXMLReader(); > > parser->loadGrammar("d:\\datacenter\\xml\\Storeinfo.dtd", > Grammar::DTDGrammarType, true); > parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, true); > parser->setFeature(XMLUni::fgXercesUseCachedGrammarInParse, true); > parser->setFeature(XMLUni::fgXercesCacheGrammarFromParse, true); > > parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, true); > parser->setFeature(XMLUni::fgXercesSchema, true); > parser->setFeature(XMLUni::fgXercesSchemaFullChecking, true); > parser->setFeature(XMLUni::fgSAX2CoreNameSpacePrefixes, true); > parser->setFeature(XMLUni::fgSAX2CoreValidation, true); > parser->setFeature(XMLUni::fgXercesDynamic, true); > > parser->parse("d:\\datacenter\\xml\\Storeinfo.xml"); > XMLPlatformUtils::UnInitialize(); > > First even though I load the DTD, parse does not seem to find it. In the > code in > in IGXMLScanner (line 1303) > Grammar* grammar = fGrammarResolver->getGrammar(sysIdSrc->getSystemId()); > always returns NULL. > > After that, the parser crashes while doing a scanDocTypeDecl. > > Here are the enclosed files. Please copy them to a directory other than the > directory where the exe is present. > Can someone please explain what is wrong. > > Thanks > Kiran > > > > ------------------------------------------------------------------------ > > StoreInfo.dtdName: StoreInfo.dtd > Type: unspecified type (application/octet-stream) > > StoreInfo.xmlName: StoreInfo.xml > Type: XML Document (text/xml) > > ------------------------------------------------------------------------ > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]