I think you'll need to let all the DOM objects (document, node lists, elements, etc) go out of scope before calling Terminate(). Try moving everything except the Initialize() and Terminate() calls to another function, then having main() call that function between Initialize() and Terminate().
Are you saying that the code crashes in getElementsByTagName()? What's the error that pops up? -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 30, 2002 8:54 AM To: [EMAIL PROTECTED] Subject: RE: problem during compiling in VC++6 SP5 Hi there i have try the approach used what Alberto suggest, however, exception error still occurs, in fact the error pops up when i tried and used the elm.getElementsByTagName("deviation") method (see the code below) can someone help me out Many thanks Regards Kit > > >Hi, can somebody help me out over this part, i have written a small code >using xerces c++ 1.6, but the application keep on crashing, can someone >point out what the problem with it, thanks > >here are the code > >int main(int argc, char* argv[]) >{ > XMLPlatformUtils::Initialize(); > > DOMParser theParser; > //theParser.setToCreateXMLDeclTypeNode(false); > //theParser.setDoValidation(true); > //theParser.setDoNamespaces(true); > > //Parse and retrieve a tree structure of this xml, stores in theDOM >object > theParser.parse("tempDig.xml"); > const DOM_Document theDOM = theParser.getDocument(); > > //Get a list of elements that lies within the List tag > DOM_NodeList Node_list = theDOM.getElementsByTagName("List"); > DOM_Element elm = (DOM_Element&)Node_list.item(0); > > DOM_NodeList deviation = elm.getElementsByTagName("deviation"); >// DOM_NodeList fault = elm.getElementsByTagName("fault"); >// DOM_NodeList consequence = elm.getElementsByTagName("consequence"); > > > XMLPlatformUtils::Terminate(); > return 0; >} _________________________________________________________________ �ϥ� MSN Messenger�A�P�B�ͦb�u�W��ѡGhttp://messenger.msn.com.hk --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
