I see there are other questions related to this, but none using NSXML.
So, I'm constructing an XML document from scratch using NSXML and when I create a NSXMLNode with a string value, all the "<" characters in that string are replaced with "& lt;" when I output the node, or save it to a file.
Example:
NSXMLNode *description = [NSXMLNode elementWithName:@"description"
stringValue:@"<![CDATA[Some Description</a>]]>"];
Then when I do
NSLog(@"description: %@", description);
I get the node with all the '<' characters replaced with "& lt;". However when I do
NSLog(@"description string value: %@", [description stringValue]);
I get the correct string output. This XML document is going to be saved as a KML file for google earth, and google earth gives me an error when it finds the "& lt;" token. Any idea how to make NSXML just output the '<'? I'm using OSX 10.6 and XCode 3.2 btw.