0

I have an XML tag like

I can parse this element, but I get only the s character in my string.

<title>Transport information Classic World&#039;s </title>

And I parsed it like this, but in my object I get only the 's' character.

 if ([elementname isEqualToString:@"title"])
 {
      currentTweet.content = currentNodeContent;
 }

How can I decode the whole text in title ?

Kara
  • 6,115
  • 16
  • 50
  • 57
Tamás Nyiri
  • 91
  • 1
  • 2
  • 10

2 Answers2

0

If you have such possibility, wrap special characters in CDATA tags, when you create this XML.

Jeepston
  • 1,361
  • 7
  • 7
0

Try while you creating XML use CDATA tags like

<title><![CDATA[Transport information Classic World&#039;s]]></title>

Also here is a list of HTML Tags and more cases XML with those characters is invalid, unless they are contained within a CDATA. Also try this Question hope with help you

As You asking the you can not change the XML so till now you will not resolve i think parser is not able to parse this XML.

Community
  • 1
  • 1
Buntylm
  • 7,345
  • 1
  • 31
  • 51
  • Unfortunately I can't change the xml file – Tamás Nyiri May 20 '13 at 11:59
  • I see it, but my XML parser get only one character, not the whole Transport information Classic World's text! Then i can parset it perfectly! – Tamás Nyiri May 21 '13 at 18:52
  • @BuntyMadan Please see my question http://stackoverflow.com/questions/43539307/how-to-post-string-with-special-character-using-xml-parsing-in-objective-c. How can I use your code hear – Muju Apr 21 '17 at 10:49