Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » XML parsing error
Re: XML parsing error [message #16846 is a reply to message #16836] Wed, 16 July 2008 23:32 Go to previous messageGo to previous message
bytefield is currently offline  bytefield
Messages: 210
Registered: December 2007
Experienced Member
Well, you have some problems there Rolling Eyes ;
First, is better to don't do all that stuff in constructor because if XmlParser fail it raise an exception and gui things get undone and appear other problems, because the exception is raised in constructor.
Your program get linked and executed(you didn't know it run) but because you don't catch the exception it finish immediately after start or it enter in a infinite loop while checking your xml file(that depends on circumstances, in the state that you put it here it get in infinite loop and if you try to correct it, then you will get some exceptions).
My advice is to use a construction like that in main function.
try
{
	XMLTestF().Run();
}
catch(XmlError xmlerror)
{
	PromptOK(GetLastErrorMessage());
}
catch(...)
{
	PromptOK("Unknow exception");
}

Other problem I've spotted is that you're not checking all xml tags and you're expecting that "message" tag to appear after "new" tag, instead based on your file the tag "timing" follow "new" tag, so your parsing loop get infinite because of that.
Verdict: Defective by design. Razz

Andrei


cdabbd745f1234c2751ee1f932d1dd75
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: NULL
Next Topic: XMLNode error
Goto Forum:
  


Current Time: Wed May 08 09:48:53 CEST 2024

Total time taken to generate the page: 0.02759 seconds