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-14-2010, 01:34 PM   #1 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 11
redondo is on a distinguished road
Smile Replace numeric character entity references

Hi everyone!

I am getting a XML document with TBXML.

This XML-document has this encoding at the top of the file:
iso-8859-1

When I receive the values from the elements it contains:

"#&35;", "#&10;", "#&45;" etc etc.

I thought the problem was TBXML, so I tried parse the XML-document with NSXMLParser instead, but I got the same result!

Then I tried downloading MWFeedParser which has a method named "stringByDecodingXMLEntities" which worked with many of the characters but not everyone. Not those I exemplified earlier in this post.

Then I tried to download RegExKitLite to do all this but with no success.

Should it be this hard?

All I want is readable text from the XML-document.
redondo is offline   Reply With Quote
Old 09-14-2010, 01:42 PM   #2 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 24
silverpie is on a distinguished road
Default

Quote:
Originally Posted by redondo View Post
"#&35;", "#&10;", "#&45;" etc etc.
Are you sure they're #& and not &#? Only the latter is a correct entity.

And I can tell you that each of those escapes, if it is what it is trying to be, is the character at that codepoint, base ten (so those three are #, linefeed, and hyphen).
silverpie is offline   Reply With Quote
Old 09-14-2010, 01:49 PM   #3 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 11
redondo is on a distinguished road
Default

Quote:
Originally Posted by silverpie View Post
Are you sure they're #& and not &#? Only the latter is a correct entity.

And I can tell you that each of those escapes, if it is what it is trying to be, is the character at that codepoint, base ten (so those three are #, linefeed, and hyphen).
Sorry. Of course it's like that. I know that these represents characters.
But how do I do to replace these numeric characters?
redondo is offline   Reply With Quote
Reply

Bookmarks

Tags
entity references, nsxmlparser, tbxml

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: 323
17 members and 306 guests
2ndSegment, bignoggins, cayladv57, cgokey, dermotos, djohnson, Domele, guusleijsten, Hamad, heshiming, linkmx, Objective Zero, Rudy, Sloshmonster, teebee74, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,654
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, cayladv57
Powered by vBadvanced CMPS v3.1.0

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