On 3/30/2010 4:17 PM, Sharath1983 wrote:

Hi,
I integrated xerces 3.1.0 with visual studio 2005 for creating a xml parser.
For the below lines of code where i actually created my own class
"XMLHandler" which has its own methods to read xml,but upon building i was
getting errors as shown below:

// This function gives the root element of the xml document
DOMElement XMLHandler::GetRootElement ()
{
        // Return document element
        return domDocument.getDocumentElement ();
}
DOMElement is an abstract base class, and you cannot return it by value. You probably meant to return it by pointer:

DOMElement* XMLHandler::GetRootElement () {
  return domDocument.getDocumentElement ();
}

The type of domDocument also seems wrong. This should probably be a pointer to an instance of DOMDocument, so you would need to use pointer syntax:

DOMElement* XMLHandler::GetRootElement () {
  return domDocument->getDocumentElement ();
}

Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to