Reputation: 347
If I have a string like "Fuel & Additives" when my XML parser goes through it ignores anything BEFORE the "&" symbol, why?
if ([elementname isEqualToString:@"GLDesc"])
{
currentParsedObjectContainer.GLDesc = currentNodeContent;
NSLog(@"%@",currentParsedObjectContainer.GLDesc);
}
Upvotes: 1
Views: 119
Reputation: 13696
The ampersand character (&) and the left angle bracket (<) may appear in their literal form only when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed elsewhere, they must be escaped using either numeric character references or the strings "&" and "<" respectively.
http://www.w3.org/TR/2000/REC-xml-20001006#syntax
As the above snippet states, you'll need to escape & to the string &
before passing it to the XML parser.
Upvotes: 7
Reputation: 5963
I'm going to say it has something to do with character codes (for example <). I'm not really familiar with xml though, so I'm not sure. Try &?
Upvotes: -1