Hi there. I've been using the LibXML library to work with XML files. Once I've used xmlParseFile() to parse a document, I want to check to see if the doc pointer is empty, and if it is, print an error. The problem is, LibXML likes to print its own errors if it can't parse the file ("I/O warning : failed to load external entity "file.xml""). In this case, it's not really an issue - I just have to use fstream to check for the file first, and print my custom error if it's not found, instead of letting LibXML try to parse it. However, if the file is there, but has some problem that causes it to fail to parse, LibXML will go ahead and print out its own message anyway.
I'm wondering if there's any way that I can stop it from doing this, so I can use my own messages, formatted the way I want them to be, without actually editing the source code and recompiling the whole library? I'm guessing the error message goes to stderr - is there a way to redirect that away from the console? And is there any reason why that would be a bad idea?