Hi all,

I have the the following program:

#include <iostream>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/util/PlatformUtils.hpp>

using namespace xercesc;

int main()
{
 XMLPlatformUtils :: Initialize();

 XercesDOMParser *parser = new XercesDOMParser;

 try {
   parser->parse("non existing file");
 }
 catch(...)
 {
   std::cout << "it threw an exception" << std::endl;
   delete parser;
   XMLPlatformUtils::Terminate();
   return 0;
 }

 std:: cout << "no exception was thrown" << std::endl;

 delete parser;
 XMLPlatformUtils::Terminate();
 return 0;
}


Since I don't have a file on my system which is called 'non existing
file', I expect that it would output 'it threw an exception', but it
doesn't: It outputs 'no exception was thrown'. To me this seems very
weird. Is this is a bug or a feature? How do I get to know whether the
file exists or not?

I am using gcc 4.2.1 with Xerces 2.8.

Thanks very much!
Wijnand

Reply via email to