|Jun 3, 2008, 09:18 AM||#1|
[iPhone] NSXMLParser problem
i am making us eof the NSXMLParser in my iPhone app.
What i am facing now is that in my xml file i am having characters like
<item>BOOKS & DVDs</item>
issue is that the foundCharacters method is returning me "BOOKS" , "&", "DVDs" in separately.
Actually it should return :BOOKS & DVDs" as a single string, isnt it?
the problem is there whereever i use "&", "trademark symbol" etc....
Its giving "my favourites" as a single string, means the problem is not because of whitespaces.
I tried appending all the strings that i got using appendString method of NSString class.
But the resulting string is displayed as "Books....." .
Its not because of the space limitation, i think the string is appending some miscs...
Please help me...
I got stuck up with my application...
|Jun 4, 2008, 03:58 AM||#4|
Yeah.. its actually '&' only when u open the file in DashCode, But in safari it will show as "&" only.
So my question is why foundCharacters: method stops when some special chars get encoutered?
ie... from <item>Books & DVDs</item>
foundCharacters: method is returning "Books" , "&" , "DVDs" separately in 3 separate method calls.
I am expecting entire string to get returned in a one call....
|Jun 4, 2008, 10:17 AM||#5|
Anyway, there are surely other, less obvious reasons the parser might break a text node value apart. It's an implementation detail that you can't predict. The behavior could also change in a future update.
So you're stuck. Your code will have to handle the concatination itself.
|Jun 5, 2008, 06:42 AM||#6|
this is how the parsers in java work as well. they don't always return one string and you have to concatenate the strings. using a stack to keep track of the element you are in will do the trick.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|NSXMLParser||MickeyT||iPhone/iPad Programming||3||Jun 18, 2014 04:29 PM|
|iPhone 3GS problems - there is a problem with your iPhone||Mat246||iPhone||17||Mar 13, 2013 04:14 AM|
|NSXmlParser error||leconteconte||iPhone/iPad Programming||2||Feb 28, 2013 06:29 AM|
|Resolved: NSXMLParser fails after first element?||ArtOfWarfare||Mac Programming||2||Jul 17, 2012 07:30 PM|
All times are GMT -5. The time now is 02:40 AM.