tags:

views:

124

answers:

3

I am trying to create an Xercesc DOM Parser in my code and for some reason and try to instiate an XercescDOM object I get a NULL pointer returned. I am using xercesc version 2.8 Here the code.

using namespace xercesc;
int main(int argc, char*argv[])
{
try
{
    XMLPlatformUtils::Initialize();
}
catch (const XMLException& e) 
{
    char* errMsg = XMLString::transcode(e.getMessage());
    cout << "Problem initializing parser: " << errMsg;
    XMLString::release(&errMsg);
}

XercesDOMParser* parser = new XercesDOMParser();
if (!parser)
    cout << "Failed to create parser";
}
A: 

This looks like it might be related.

Doug T.
+1  A: 

@Doug: no, this is not related, afaik, because the code you linked to tries to fetch the document from the parse() method, but this is a void function, so the result will always be "null" this way.

Otherwise, I don't see any problem with the parent post. It compiles almost ok and here I have a correct result (non-null parser).

Sebastien Tanguy
A: 

It was a bug some where else in my code.