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 » To get xml errors from LoadFromXML
To get xml errors from LoadFromXML [message #37806] Wed, 14 November 2012 09:18 Go to previous message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello all

Now it is not possible to get errors in XML strings detected by LoadFromXML() because they are catched inside and removed.

I would vote to remove the try-catch from LoadFromXML() and let the programmer to handle the error properly.

bool LoadFromXML(Callback1<XmlIO> xmlize, const String& xml)
{
	try {
		XmlNode node = ParseXML(xml);
		if(node.GetCount() == 0)
			return false;
		for(int i = 0; i < node.GetCount(); i++)
			if(node.Node(i).IsTag()) {
				Value dummy;
				xmlize(XmlIO(node.At(i), true, dummy));
				break;
			}
		return true;
	}
	catch(XmlError) {}    // XmlError is removed
	return false;
}


Best regards
IƱaki
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Xmlize default value
Next Topic: Bug: AString<B>::ReverseFind broken for wchar
Goto Forum:
  


Current Time: Thu Apr 18 03:21:28 CEST 2024

Total time taken to generate the page: 0.02237 seconds