I found the problem myself. I thought I would get an exception in the main program if validation was negative and thereby getting an error message, however it showed up not to work that way. Since I hadn't overriden the methods in the error handler I didn't get any error message showing me that something was wrong. My solution was to override the methods error, fatalError and warning for the errorhandler and take care of the errors and warnings there - i.e. output error messages.
cheers .jole 02-01-24 11.33, skrev Jole Jonikic p� [EMAIL PROTECTED] f�ljande: > Hi everyone, > > My simple question is: how can I let the SAXParser do a validation against > the DTD that I have stated at the beginning of the XML-file. > > I have the following line in the XML-file: > <!DOCTYPE adc:adConnexion SYSTEM "IFRAadConnexion1_0.dtd"> > > When running the sample SAXCount it gets validated but when trying to do the > same in my own program it doesn't bother checking validity against the > dtd-file. > > Shouldn't the following lines be enough???: > parser->setDoValidation (true); > parser->setDoNamespaces (true); > > I've attached a DocumentHandler to the parser and overriden the methods > startElement, endElement etc., do I need to attach an ErrorHandler and > override it's methods as well to make it work? (I tried that too but can't > manage to get the XML validated.) > > Thanks a lot for any help! > > Jole > > > PS. I have looked in the FAQ and searched the Mail Archives but been unable > to find an answer. > > > > > --------------------------------------------------------------------- > 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]
