Before anyone says use TouchXML I've already developed everything around NSXMLParser and have a decent understanding of it. My issue is that I'm getting NSXMLParser error code 4 at line 1 column1 with a null description. I've verified that the file exists at the URL.
rssParser triggers parserDidStartDocument and then errors out which makes me feel like it's not a file not found issue but rather something to do with the XML (below is a snippet of the xml). I can't supply the URL as it's a subscription feed provided by an outside vendor.
Code:
<?xml version="1.0" encoding="utf-8"?>
<feed> <item id="186522">
<title><![CDATA[Anderson Matrix Softball Bat: MATRIX Slow Pitch]]></title>
<description><![CDATA[The Anderson Matrix Slowpitch Composite bat!]]></description>
<link><![CDATA[http://SOMEADDRESS/click/jgslams/default/?siteKey=SOMEKEY]]></link>
<image><![CDATA[http://SOMEADDRESS/new/prod/jgslams/186522/300x300.jpg]]></image>
<price><![CDATA[$139.99]]></price>
<retail-price><![CDATA[]]></retail-price>
<shipping><![CDATA[FREE]]></shipping>
<condition><![CDATA[]]></condition>
<availability><![CDATA[Y]]></availability>
<pubDate>Wed, 04 Mar 2009 15:49:06 -0800</pubDate>
<metadata>
<hotness>8.2211</hotness>
<displayStatus></displayStatus>
<category>sna;oneaday</category>
<name><![CDATA[JustGrandSlams]]></name>
<key>jgslams</key>
</metadata>
</item>
</feed>
And here is the code I use to dump the error info.
Code:
- (void)parser :(NSXMLParser *)parser parseErrorOccurred :(NSError *)parseError {
NSString *errorString = [NSString stringWithFormat:@"Error %i, Description: %@, Line: %i, Column: %i", [parseError code], [[parser parserError] localizedDescription], [parser lineNumber], [parser columnNumber]];
NSLog(@"error parsing XML: %@", errorString);
UIAlertView * errorAlert = [[UIAlertView alloc] initWithTitle:@"Parsing Error!" message:errorString delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[errorAlert show];
}
Any help besides changing to TouchXML at this point would be great as it seems like it should be something fairly simple or I should be able to get more error information but I'm stumped.