I am new to using xml4C and am trying to write a simple example in C++. 
I am using xml4c from IBM for AIX4.3.3.

I have no problem with an xml file with no error's, but only a problem
with something like:

<HELLO>
fnkjsdsf
<HELLO>

I get the following error when I run my program:

IOT/Abort trap(coredump)

Can anybody help??



My program is:

#include <iostream.h>
#include "dom/DOM.hpp"
#include "parsers/IDOMParser.hpp"
#include "util/PlatformUtils.hpp"
#include "idom/IDOM_DOMException.hpp"
#include "sax/ErrorHandler.hpp"
#include "sax/HandlerBase.hpp"

int
main( int ac, char* av[] )
{
    try {
        XMLPlatformUtils::Initialize();
    }
    catch (const XMLException& toCatch) {
        cout << "Error during initialization! :\n"
             << toCatch.getMessage() << "\n";
        return 1;
    }

    char* xmlFile = "x1.xml";
    IDOMParser* parser = new IDOMParser();
    parser->setValidationScheme(IDOMParser::Val_Always);    // optional.
    parser->setDoNamespaces(true);    // optional

    ErrorHandler* errHandler = (ErrorHandler*) new HandlerBase();
    parser->setErrorHandler(errHandler);

    try {
        parser->parse(xmlFile);
    }
    catch (const XMLException& toCatch) {
        cout << "\nFile not found: '" << xmlFile << "'\n"
             << "Exception message is: \n"
             << toCatch.getMessage() << "\n" ;
       return -1;
    }
    catch (const IDOM_DOMException& e)
    {
       cerr << "An IDOM error occured during parsing\n   IDOMException
code: " << e.code << endl;
    }

    return 0;

}


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

Reply via email to