From: raoul <rao...@gm...> - 2009-01-08 17:39:53
|
Ok, just saw that bug report http://bugzilla.gnome.org/show_bug.cgi?id=348006 ... Le jeudi 8 janvier 2009, raoul a écrit : > Hi there, > > I'm working with TextReader, and I had some trouble wen playing with > exceptions. In fact it was a problem in read() function. > > Here is the thing, when doing: > > xmlpp::TextReader reader("example.xml"); > > while(reader.read()) > { > [...] > } > > and if the xml file has a parse error, it just fall in an infinite loop > because read() always read the same node. > In fact, according to the xmlTextReaderRead() doc, this function can return > -1 if an error occured, and not just a boolean value. > Attached is a patch to make this work and also throw an exception. -- ------------------------ Raoul Hecky |