Hi Neil, I've tried setting useCachedGrammarInParse, but that did not have any effect. I also tried to use an EntityResolver, returning my DTD in the memory buffer to the parser and using a <!DOCTYPE root SYSTEM "mydtd"> statement in the xml file, but then all I get is a runtime exception because the dtd could not be opened (which means that the parser is not trying to resolve entities...).
I just don't know what I'm doing wrong! Do you have any idea? Thanks for your help, Heiko > Hi Heiko, > > A couple of suggestions: > > - try setting useCachedGrammarInParse to true; the parser should then start > using the grammar you've loaded; > - register an EntityResolver implementation to see if the parser is trying > to resolve entities. If it is, then evidently it's not paying attention to > the grammar you've preloaded (or something went wrong with the preloading). > > Hope that helps, > Neil > > Hi, > > > > I just migrated from Xerces 1.1 to 2.3.0 and now have the problem, that the > > parser does not recognize the DTD for validating my documents - it just says > > that all elements are not valid and all the attributes are not declared. If I > > change the validation scheme to val_auto, nothing happens, even if my > > documents don't match the DTD. Can anyone help me? > > > > Thanks, > > > > Heiko > > > > <code> > > > > SAXParser* parser = new SAXParser; > > > > parser->setValidationScheme(SAXParser::Val_Alway); > > parser->setDoNamespaces(false); > > > > MemBufInputSource* ruledtd = new MemBufInputSource > > ( > > (const XMLByte*)_r2r_ruledtd, strlen(_r2r_ruledtd), "dummy", false > > ); > > > > parser->loadGrammar(*ruledtd, Grammar::DTDGrammarType, true); > > > > parser->setDocumentHandler(hnd_p); > > parser->setErrorHandler(hnd_p); > > > > StreamInputSource streamReader(&in); > > > > parser->parse(streamReader); > > > > </code> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
