Nsxmlparser Error 4
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up NSXMLParser gives error code 4 only sometimes, when the NSData input is always the same up vote 1 down vote favorite I am using the class XMLReader to parse some XML from a URL. The XML is successfully parsed sometimes, and sometimes I get: Error Domain=NSXMLParserErrorDomain Code=4 "The operation couldn’t be completed. (NSXMLParserErrorDomain error 4.)" The parse is usually successful the first time I run it, after changing something, and it fails after that until I change something else. For example, in the code below, I tried commenting out the [parser release] line, and it parsed successfully. Then I ran it again and back to error code 4. I log the same input data every time, success or fail. Any ideas what is going wrong here? I can paste in more code if that would help, but I have isolated the error to be within the NSXMLParser parse method (called in the code below), because it always receives the same data. Thanks! edit: I know that error code 4 is an empty document error. But I know my NSData is not empty. So there is something else happening here - (NSDictionary *)objectWithData:(NSData *)data { //data always makes it here, the same data gets logged regardless of parse success //NSLog(@"%@",data); // Clear out any old data [dictionaryStack release]; [textInProgress release]; dictionaryStack = [[NSMutableArray alloc] init]; textInProgress = [[NSMutableString alloc] init]; // Initialize the stack with a fresh dictionary [dictionaryStack addObject:[NSMutableDictionary dictionary]]; // Parse the XML NSXMLParser *parser = [[NSXMLParser alloc] initWithData:data]; par
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the http://stackoverflow.com/questions/10856424/nsxmlparser-gives-error-code-4-only-sometimes-when-the-nsdata-input-is-always-t Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up NSXMLParser error code 4 (Document is empty) and (parser: didStartElement: namespaceURI: qualifiedName: attributes: ) is not being called up vote 0 down vote http://stackoverflow.com/questions/27523885/nsxmlparser-error-code-4-document-is-empty-and-parser-didstartelement-names favorite I'm trying to parse a list of Projects info from an xml file from a web api. The beginning of the file looks like:
here for a quick overview of the site Help Center Detailed answers to http://stackoverflow.com/questions/20722191/the-operation-couldn-t-be-completed-nsxmlparsererrordomain-error-111 any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn https://ios.forums.wordpress.org/topic/nsxmlparsererrordomain-error-4-6 more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community nsxmlparser error Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up “The operation couldn’t be completed. (NSXMLParserErrorDomain error 111.)” up vote 1 down vote favorite I am trying to parse an XML string in Xcode. It parse the nsxmlparser error 4 string successfully, but after it gives error. Here is the xml String, parsing code and error message. please guide me. Thank you all in advance. XML String.
4 Inactive Nov 5, 2010, 10:00 AM I got my self-hosted blog to work just fine. The the 2.6 update came and it didn't work at all for me. I found a few tips about re-installing the app to get it to work, so I did. Now I get the NSXMLParserErrorDomain error 4 when I try to load my posts (have not tried writing one with the new 2.6.2). Can anyone figure out what the problem is? Signing in to my blog is not a problem and my comments load just fine. apptitude Moderator Nov 5, 2010, 3:27 PM MissComaDoll, have you tried disabling all your plugins? Inactive Nov 5, 2010, 6:26 PM Yes, I disabled all plugins ans even changes the theme to the standard one. Still the same problem. apptitude Moderator Nov 5, 2010, 8:46 PM OK I've got a hunch this issue is related to an issue someone else from the forum is having. Do you happen to have access to your .htaccess file? Inactive Nov 5, 2010, 11:41 PM Yes, I have access to the .htaccess file, something I should edit in it? I've set up an admin account for you att my blog (http://nannica.se/wp-admin) Did you get the mail with the account-info? apptitude Moderator Nov 6, 2010, 8:08 PM Hey there, I just loaded your blog up using 2.6.2 and it seems to load fine. I'm not seeing any NSXMLParserErrorDomain issues so far. Could you tell me the steps I could take to reproduce the issue? apptitude Moderator Nov 6, 2010, 8:09 PM Also: iPhone or iPad? Inactive Nov 7, 2010, 7:47 PM this is WIERD! I have re-installed the app 3-4 times and had the same error every time. Now when I did it again to go through all the steps, it works! askmatthewpotter Member Nov 17, 2010, 1:33 AM Is there any update to this? I have been looking for a solution on these forums for the NSXMLParserErrorDomain error 9. Topic Closed This topic has been closed to new replies. About this Topic Started 5 years ag