Developer
Developer

Reputation: 6465

string is not getting parsed correctly from XML

I am parsing an XML file, ion which data is in "Portugese" language. data is getting parsed successfully but its not returnong the data as expected, Example=> I am parsing string "Próximo GP" and it is returning me "óximo GP". Its is trimming the first two letters. same problem I am having in other strings.

What should I do. Please help. Thanks-

Upvotes: 0

Views: 137

Answers (1)

Ole Begemann
Ole Begemann

Reputation: 135548

This is by design. NSXMLParser does not guarantee that it will deliver the entire string contents of an element in one go. You are supposed to declare a mutable string to store the found characters in and append to this string when the parser:foundCharacters: method is called multiple times. Look at Apple's sample code, they do it like this everywhere.

Upvotes: 2

Related Questions