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 02-12-2009, 01:22 AM   #1 (permalink)
New Member
 
Join Date: Feb 2009
Location: Mumbai
Posts: 13
pawans is on a distinguished road
Send a message via Yahoo to pawans
Unhappy TouchXML unable to parse XML with special characters

I dont know if this is the right place to post this question.

I am using TouchXML to parse XML coming from a webservice that has "&" "?" "@" like characters.

NSURL *theURL = [[NSURL alloc] initWithScheme:@"http" host:@"www.myserver.com" path:[@"/search.php?q=" stringByAppendingString:criteria]];
// object that actually grabs and processes the RSS data
CXMLDocument *rssParser = [[[CXMLDocument alloc] initWithContentsOfURL:theURL options:0 error:nil] autorelease];


// Create a new Array object to be used with the looping of the results from the rssParser
NSArray *resultNodes = NULL;

// Set the resultNodes Array to contain an object for every instance of an node in our RSS feed
resultNodes = [rssParser nodesForXPath:@"//Report" error:nil];

In debugger when I evaluate the object resultNodes, it shows 0 objects

However, when a use a XML file from resourceBundle that has no special charactes and is a simple XML. Everything works fine.

Reason for using TouchXML is to deal with XPath rather than using NSXMLParser SAX model.

Any ideas, what could be going on, or what I am doing wrong ?
pawans is offline   Reply With Quote
Old 06-04-2009, 10:24 AM   #2 (permalink)
Registered Member
 
Join Date: Jul 2008
Location: Hyderabad,India
Age: 25
Posts: 233
narendar is on a distinguished road
Default

Hello Pawans,

Did u solve your problem, actually I am also on the same wall like u

Can u please share here if u got any progress on this???

Thanks ,
Narendar
narendar is offline   Reply With Quote
Old 06-04-2009, 10:35 AM   #3 (permalink)
New Member
 
Join Date: Feb 2009
Location: Mumbai
Posts: 13
pawans is on a distinguished road
Send a message via Yahoo to pawans
Default

Narendra,

I could not move ahead touchxml and hence have to give it away. I am using the native iPhone SDK XML api for parsing and extracting values. Troublesome thought, but if u could manage to write a some what generic parser for ur applications, it helps.

-//Pawan
pawans is offline   Reply With Quote
Old 06-04-2009, 10:44 AM   #4 (permalink)
Registered Member
 
Join Date: Jul 2008
Location: Hyderabad,India
Age: 25
Posts: 233
narendar is on a distinguished road
Default

Hi Pawans ,

Thanks for ur Quick response,

I am Using NSXMLParser to parse my XML, some times it is getting the special character "&" where exception is taking place.

I googling but did not found better solution for that.

Generic parser?? Did u do implement any ting like that????

Thanks,
Narendar
narendar is offline   Reply With Quote
Old 06-04-2009, 11:19 AM   #5 (permalink)
New Member
 
Join Date: Feb 2009
Location: Mumbai
Posts: 13
pawans is on a distinguished road
Send a message via Yahoo to pawans
Default

Yes, NSXMLParser the way it is initialised takes care of the '&'..I do not have my laptop handy else would have sent the code. Will do that tomorrow if that is okay with you.

-/P
pawans is offline   Reply With Quote
Old 06-04-2009, 11:40 AM   #6 (permalink)
Registered Member
 
Join Date: Jul 2008
Location: Hyderabad,India
Age: 25
Posts: 233
narendar is on a distinguished road
Smile

Quote:
Originally Posted by pawans View Post
Yes, NSXMLParser the way it is initialised takes care of the '&'..I do not have my laptop handy else would have sent the code. Will do that tomorrow if that is okay with you.

-/P
Hey Thanks
I am in trouble because of this problem, in 2.2.1 it is running but in 3.0 it is not accepting & at all, I already have delay in my project . tomorrow will be my final build. please send me the code.

Thanks a lot
narendar is offline   Reply With Quote
Old 06-05-2009, 06:20 AM   #7 (permalink)
New Member
 
Join Date: Feb 2009
Location: Mumbai
Posts: 13
pawans is on a distinguished road
Send a message via Yahoo to pawans
Default

Sorry Narendar, I could not fint he code you are looking for.
I tried that stuff long time back and the projects are all gone. Though, recently we are using a class XMLToObject found over internet, maybe you can try that.

-//P
pawans is offline   Reply With Quote
Reply

Bookmarks

Tags
parse, touchxml, 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: 327
5 members and 322 guests
Anwerbl, guusleijsten, HowEver, LEARN2MAKE, mottdog
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,113
Posts: 402,879
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:38 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0