问题
I'm using Amazon's simpledb in my app. When parsing xml it gives an error with the code 5. ie. NSXMLParserErrorDomain error 5.
Sometimes it works fine and without any significant change in the navigation is gives that error. Again it works fine when i restart the app several times without doing any changes to the code or navigation in the system. I cant figure out the reason why this happens.
thanks
回答1:
Debugging 101: look at the headers to find what errors mean.
If you look at NSXMLParser.h
, you will see that error 5 is NSXMLParserPrematureDocumentEndError
.
I think it's safe to say that the XML document is not complete. How are you loading the document? Are you ensuring that you load the whole document before parsing it?
回答2:
The Best way to remove this error (IPhone -NSXMLParserErrorDomain error 5.)
open http://www.w3schools.com/xml/xml_validator.asp
Validate your XML here because this error mainly Error in XML that you parse in Iphone .
来源:https://stackoverflow.com/questions/2651033/nsxmlparser-errorcode-5