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 ?
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.
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.
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.
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.