xerces-c-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Brenneis <stevebrenn...@yahoo.com>
Subject Strange problem
Date Fri, 04 Sep 2009 13:36:48 GMT
I am having a problem with Xerces 2.8. I have the following code:

void ConfigReader::readConfig()
{
    ConfigErrorHandler err;

    try
    {
        xercesc::XercesDOMParser parser;
        parser.setValidationScheme(xercesc::XercesDOMParser::Val_Auto);
        parser.setErrorHandler(&err);
        parser.parse(configpath.c_str());
        doc = parser.getDocument();
        if (doc)
        {
            xercesc::DOMElement *root = doc->getDocumentElement();
        }
    }
    catch (const xercesc::XMLException& e)
    {
        StringHelper error(e.getMessage());
        throw ConfigException(std::string("Configuration error: ")
                        + std::string(error.toString()));
    }
}

The file it is reading looks like this:

<rahub>
  <general/>
</rahub>

When I call DOMDocument::getDocumentElement, it always returns null. There are no calls to
any of the error or warning methods in  the error handler class and there are no exceptions
thrown. I actually just copied and pasted this code from another application I wrote, which
is working just fine.

Any ideas?



      
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message