// Entete du fichier #include #include #include #include #include #include #if defined(XERCES_NEW_IOSTREAMS) #include #else #include #endif #include <stdlib.h> #include <string.h> XERCES_CPP_NAMESPACE_USE //Dans ton code // Initialize the XML4C system try { XMLPlatformUtils::Initialize(); } catch (const XMLException& toCatch) { MessageBox("Error during initialization! Message:\n"); } SAXParser::ValSchemes valScheme = SAXParser::Val_Auto; // // Create a DTD validator to be used for our validation work. Then create // a SAX parser object and pass it our validator. Then, according to what // we were told on the command line, set it to validate or not. He owns // the validator, so we have to allocate it. // int errorCount = 0; DTDValidator* valToUse = new DTDValidator; SAXParser* parser = new SAXParser(valToUse); parser->setValidationScheme(valScheme); // // Get the starting time and kick off the parse of the indicated // file. Catch any exceptions that might propogate out of it. // int errorCode = 0; try { parser->parse("Logiconf.xml"); errorCount = parser->getErrorCount(); } catch (const OutOfMemoryException&) { MessageBox("OutOfMemoryException"); errorCode = 5; } catch (const XMLException& e) { MessageBox("Error during parsing"); errorCode = 4; } if(errorCode) { XMLPlatformUtils::Terminate(); MessageBox("Error code"); } if (!errorCount) { MessageBox(" XML + DTD = OK :)"); } else MessageBox("Ca marche poooooooooooooooooooo"); // // Delete the parser itself. Must be done prior to calling Terminate, below. // delete parser; // And call the termination method XMLPlatformUtils::Terminate(); </string.h></stdlib.h>