You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2002/01/07 13:54:41 UTC

DO NOT REPLY [Bug 5716] New: - Can't parse with Validation more than one file

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: xerces-c-dev@xml.apache.org
        ReportedBy: domfe@libero.it


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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org