DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9308>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9308

Exception when parsing the xml file

           Summary: Exception when parsing the xml file
           Product: Xerces-C++
           Version: 1.5.1
          Platform: Other
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: DOM
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


While parsing our xml file (relation.xml) on Win2k we get the following error:
(Actually, there is a relation.xml in the specified directory)

Our Application Message : Importing relation from file relation.xml...
Message from Xerces:
Fatal Error at file "",line 0, colume 0
Message: An exception occured! Type:RuntimeException, Message: The primary 
document entity could not be opened. Id=D:\iMAP\bin\xmls\relation.xml


Our code snippet is as follows

   DOMParser parser;

    //enable schema validation
    parser.setValidationScheme(DOMParser::Val_Auto);
    parser.setDoNamespaces(true);
    parser.setDoSchema(true);

    //enable error handler
    XMLErrorHandler errorHandler;
    parser.setErrorHandler(&errorHandler);

    //enable writing of entity nodes back to file
    parser.setCreateEntityReferenceNodes(true);
    parser.setToCreateXMLDeclTypeNode(true);

    //locate xml file
    string filename= _path + "/" + _xmlFile;

    try {
        parser.parse(filename.c_str());
    }
    catch (const XMLException& ) {
         //log error & return
   }
    catch (const DOM_DOMException& ) {
         //log error & return
   }
    catch (...) {
         //log error & return
   }
    if (errorHandler.getSawErrors()){
        //log error 
        // OUR APPLICATION CATCHES THE ERROR MESSAGE HERE

   }

This piece of code works fine on SUN platform

Thanks

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

Reply via email to