Jump to content
Search Community

XMLLoader: XML parser failure event?

AmiKaze test
Moderator Tag

Recommended Posts

Hi,

 

I've just started using LoaderMax and it looks great.

 

I ran a few tests for the XMLLoader and I have one remark / request:

 

When the XML I'm loading is not formatted correcly, e.g. I do not close a tag, I get this error: "Exception fault: TypeError: Error #1090: XML parser failure: element is malformed." (I use FDT, so there might be some IDE-specific formatting of the error message.) This is logical, because the element IS malformed, but I don't like the fact that I get a fatal error: what I would like to see is an event that is dispatched (or a callback being executed or whatever) so I can provide the user with the correct feedback of why something isn't working.

 

The code it's crashing on is in XMLLoader.as on line 457 (I'm using version 1.0):

 

var xml:XML = _content =  new XML(_loader.data);

I personally always use a try/catch statement for executing the above code in my own loaders, but of course I'm not going to tell you how to code, you're far more experienced than me. :)

 

The reason I think this functionality is extra important is because the whole reason people use XML is because it can be edited outside of the code. This means that there's a bigger risk of faulty formatted XML, since it's not being checked at compile time.

 

I must admit I haven't read the entire documentation, so maybe this has already been covered, but then I hope this post will be useful to someone else.

 

Thanks in advance,

 

- AmiKaze.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...