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=5716>.
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=5716

Can't parse with Validation more than one file

           Summary: Can't parse with Validation more than one file
           Product: Xerces-C++
           Version: 1.6.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Validating Parser (Schema) (Xerces 1.5 or up only)
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


With validation setted to true either with SAX or DOM I can parse only one file.
E.g.

function myfunc(xmlFile)
        try {
                XMLPlatformUtils::Initialize();
        }
        catch (const XMLException& toCatch) {
                cout << "Error during initialization! :\n" << toCatch.getMessage
() << "\n";
                exit(0);
        }
        DOMParser* parser;
        parser = new DOMParser();
        parser->setDoNamespaces(true);
        parser->setValidationScheme(DOMParser::Val_Always);
        parser->setDoSchema(true);
        try {
                parser->parse(xmlFile);
        }
        catch (const XMLException& toCatch) {
                cout << "\nFile not found: '" << xmlFile << "'\n" << "Exception 
message is: \n" << XMLString::transcode(toCatch.getMessage()) << "\n" << flush;
                exit(0);
        }
        catch (...) {
                cout << "Error" << endl << flush;
                exit(0);
        }
        XMLPlatformUtils::Terminate();
} // end of myfunc

int main()
{
   myfunc("file1.xml");
   myfunc("file2.xml"); <- this generate a segmentation fault
}

file1.xml & file2.xml refer at the same XMLSchema.

Thank you.

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

Reply via email to