string is partially parsed when symbol "&" is present
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(@"%@",currentPars开发者_如何学PythonedObjectContainer.GLDesc);
}
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.
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 &?
精彩评论