Note that there are some explanatory texts on larger screens.

plurals
  1. POXML Parsing - NSXMLParserErrorDomain error 5
    primarykey
    data
    text
    <p>I'm trying to parse a XML File. It worked very well - until today...</p> <p>Here's how I start to parse the XML:</p> <pre><code>NSString *link = [[NSString alloc] init]; link = @"link_to_xml_file"; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:link] cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:30.0]; connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; </code></pre> <p>And here's how I'm using the received data:</p> <pre><code>- (void)connection:(NSURLConnection *)theConnection didReceiveData:(NSData *)incrementalData { if (data == nil) data = [[NSMutableData alloc] init]; [data appendData:incrementalData]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *filePath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.plist",actual]]; NSError *parseError = nil; NSDictionary *xmlDictionary = [XMLReader dictionaryForXMLString:[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] error:&amp;parseError]; if (parseError != nil) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:[parseError localizedDescription] delegate:nil cancelButtonTitle:@"Zurück" otherButtonTitles:nil]; [alert show]; [alert release]; } //shows an alertview with NSXMLParserErrorDomain error 5 NSLog(@"String: %@",[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]); //returns null NSLog(@"Dictionary: %@",xmlDictionary); //returns null NSMutableDictionary *tempDictForAddDate = [[NSMutableDictionary alloc] initWithDictionary:xmlDictionary]; NSDateFormatter *originalDate = [[NSDateFormatter alloc] init]; [originalDate setDateFormat:@"dd.MM.yyyy"]; NSString *today = [originalDate stringFromDate:[NSDate date]]; [tempDictForAddDate setObject:today forKey:@"updated"]; [tempDictForAddDate writeToFile:filePath atomically:YES]; self.contentList = [[tempDictForAddDate objectForKey:@"xmlObject"] objectForKey:@"event"]; [self sortContent]; } </code></pre> <p>The XML-File works in my browser. And every tag is closed. There aren't any errors but I never get the data of the file.</p> <p>I hope someone can help.</p> <p>mavrick3.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload