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 09-07-2011, 10:13 AM   #1 (permalink)
kev
Registered Member
 
Join Date: Sep 2011
Posts: 1
kev is on a distinguished road
Default NSXMLParser for RSS

Thank you in advance for helping me with this bug.

I am trying to parse an xml RSS feed with HTML in the CDATA. I am using an NSXMLParser and getting the CDATA information using the delegate foundCDATA and then parsing the CDATA information. The CDATA is as follows:

Code:
<![CDATA[<h3>Courtyard Cafe - <em>closed for the interim, reopens Tues. 9/13<br /></em></h3> <h3>Collis Cafe - <em>closed for the interim, reopens Wed. 9/14<br /></em></h3>
My parsing succeeds until it reaches the <br />, at which point it breaks and kicks the error NSXMLParserErrorDomain error 5. The documentation doesn't tell me much about the error.

Do you have any idea what could be causing this error? Is the HTML/XML malformed? Is the <br /> unreadable by NSXMLParser?

Last edited by kev; 09-07-2011 at 10:22 AM.
kev is offline   Reply With Quote
Old 09-07-2011, 02:49 PM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

Does your xml not include the closing tags for the CDATA? As it stands what you posted is definitely malformed
smithdale87 is offline   Reply With Quote
Old 09-07-2011, 06:36 PM   #3 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 57
bobeast is on a distinguished road
Default

Quote:
Originally Posted by kev View Post
Thank you in advance for helping me with this bug.

I am trying to parse an xml RSS feed with HTML in the CDATA. I am using an NSXMLParser and getting the CDATA information using the delegate foundCDATA and then parsing the CDATA information. The CDATA is as follows:

Code:
<![CDATA[<h3>Courtyard Cafe - <em>closed for the interim, reopens Tues. 9/13<br /></em></h3> <h3>Collis Cafe - <em>closed for the interim, reopens Wed. 9/14<br /></em></h3>
My parsing succeeds until it reaches the <br />, at which point it breaks and kicks the error NSXMLParserErrorDomain error 5. The documentation doesn't tell me much about the error.

Do you have any idea what could be causing this error? Is the HTML/XML malformed? Is the <br /> unreadable by NSXMLParser?
It may be choking on the <br /> tag. Some parsers would intrerpret this as a closing tag with out an opening one. For tryseys, remove the / from your br tags and see if the parser chokes.
bobeast is offline   Reply With Quote
Reply

Bookmarks

Tags
cdata, html, nsxmlparser, parsing, xml

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: 372
8 members and 364 guests
apatsufas, JackReidy, jeroenkeij, Sami Gh, tim0504, UMAD, yomo710
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,671
Threads: 94,121
Posts: 402,904
Top Poster: BrianSlick (7,990)
Welcome to our newest member, JackReidy
Powered by vBadvanced CMPS v3.1.0

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