Re: NSXML and >
Re: NSXML and >
- Subject: Re: NSXML and >
- From: glenn andreas <email@hidden>
- Date: Tue, 09 Feb 2010 14:52:40 -0600
The XML spec does not require '>' to be escaped as '>' (except in
the case of ']]>' when that doesn't mark the end of a cdata section).
Only '&' and '<' must be escaped - see section 2.4 of XML 1.0 spec.
Sent from my iPhone
On Feb 9, 2010, at 2:19 PM, Keith Blount <email@hidden> wrote:
Hello,
I'm using the NSXML classes to write out various strings, and it
seems that these classes convert "<" to "<" but not ">" to
">", which I find odd. For instance, consider the following code
snippet:
NSXMLElement*element = [[[NSXMLElementalloc]
initWithName:@"Test"stringValue:@"< & >"] autorelease];
NSLog (@"%@", element);
The output is:
<Test>< & ></Test>
Is this correct, or is this a bug? Or am I missing something? Do I
therefore need to replace all occurrences of ">" with ">" myself
to generate better XML?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden