• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Creating CDATA NSXMLElement
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Creating CDATA NSXMLElement


  • Subject: Creating CDATA NSXMLElement
  • From: Adam Radestock <email@hidden>
  • Date: Thu, 20 Sep 2007 12:51:52 +0100

Hi everyone,

After reading and re-reading the NSXML documentation from Apple, I still am unsure on the correct way to create a CDATA NSXMLElement.
I want to place some HTML code and/or a link within a CDATA wrapper in the string value of an NSXMLElement - like this:
<description><![CDATA[blah]]></description>


I currently have:

[item addChild:[NSXMLNode elementWithName:@"description" stringValue: [NSString stringWithFormat:@"<![CDATA[%@]]>", [[itemDictionary objectForKey:@"releaseNotes"] absoluteString]]]];

- 'item' being an NSXMLElement.

But when I save this out as XML, it comes out as:

<description>&lt;![CDATA[blah]]></description>

Can anyone suggest a solution?

Thanks in advance,

Adam Radestock
Glass Monkey Software
www.glassmonkey.co.uk
_______________________________________________

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


  • Follow-Ups:
    • Re: Creating CDATA NSXMLElement
      • From: Jim Correia <email@hidden>
  • Prev by Date: Re: Left Side Bar
  • Next by Date: Parsing HTTP headers
  • Previous by thread: Re: Left Side Bar
  • Next by thread: Re: Creating CDATA NSXMLElement
  • Index(es):
    • Date
    • Thread