Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 03-04-2009, 05:55 PM   #1 (permalink)
Registered Member
 
Join Date: Jan 2009
Posts: 5
phlycoder is on a distinguished road
Default NSXMLParser Error 4

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.
phlycoder is offline   Reply With Quote
Reply

Bookmarks

Tags
nsxmlparser

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 337
2 members and 335 guests
guusleijsten, LEARN2MAKE
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,113
Posts: 402,880
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:44 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0