Dear all,

        I am very new to Xerces-C. I have the following codes (in MSVC++)

        I am trying to build the .EXE for the following codes. The
compilation is OK. But when I tried to run this code, some problem
happens. System complains on Application Error. I have checked it... and
it happens at the DOM_NodeList... Please help. I am struggling.... Please
help. Thanks. Wish you all the best.


#include <util/PlatformUtils.hpp>
#include <util/XMLString.hpp>
#include <util/XMLUniDefs.hpp>
#include <dom/DOM.hpp>
#include <parsers/DOMParser.hpp>
int main(int argc, char* argv[])
{
        char *xmlFile = "me.xml";       
        DOMString nodeValue;
        DOMString nodeName;
        try {
                XMLPlatformUtils::Initialize();
        } catch (const XMLException &toCatch) {
                cout << "Error during initialization! :\n"
                         << toCatch.getMessage() << "\n";
                return 1;
        }
        DOMParser *parser = new DOMParser();
        try {
                parser->parse(xmlFile);
                DOM_Document doc = parser->getDocument();       
                DOM_Element root = doc.getDocumentElement();
                DOM_NodeList list = root.getElementsByTagName("ENABLINGBITS");
        } catch (const XMLException &toCatch) {
                cout << "\nFile not found: " << xmlFile << "\n"
                         << "Exception message is: \n"
                         << toCatch.getMessage() << "\n";
                return -1;
        }
        XMLPlatformUtils::Terminate();  
        return 0;

}



Best regards,
Jordan CN CHONG 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to