|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|
|iPhone 4 iOS 5 Proximity Sensor||g00degg||iOS 5 and earlier||2||Nov 2, 2011 08:16 PM|
|My apple ID had deauthorised on my iPhone 4 and iOS5?!||waywardsage||iOS 5 and earlier||0||Oct 12, 2011 07:22 PM|
|iPhone 4 RAM problem||Arcticguy||iPhone Tips, Help and Troubleshooting||6||Mar 19, 2011 01:04 PM|
|iPhone 3GS Major Problem =/||marc.richards7||iPhone Tips, Help and Troubleshooting||1||Mar 10, 2011 10:09 AM|
|Weird iPhone problem / screen||di6turbed||iPhone Tips, Help and Troubleshooting||1||Nov 13, 2010 06:06 PM|
All times are GMT -5. The time now is 07:20 AM.