NSXMLparser errorcode 5

喜夏-厌秋 提交于 2019-12-14 02:05:46

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!