Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8861435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:29:31+00:00 2026-06-14T15:29:31+00:00

I am creating an application for iOS which needs to create an XML document.

  • 0

I am creating an application for iOS which needs to create an XML document. I do this via KissXML. Part of the XML looks like

<ISIN><![CDATA[12345678]]></ISIN>

I cannot find any option in KissXML to create the CDATA part. Simply adding a string with the CDATA stuff as text will result in escaping the special characters like < and >. Can anyone give me a hint in how to write CDATA with KissXML?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:29:32+00:00Added an answer on June 14, 2026 at 3:29 pm

    Even though the solution by @moq is ugly, it works. I have cleaned up the string creation code and added it into a category.

    DDXMLNode+CDATA.h:

    #import <Foundation/Foundation.h>
    #import "DDXMLNode.h"
    
    @interface DDXMLNode (CDATA)
    
    /**
     Creates a new XML element with an inner CDATA block
     <name><![CDATA[string]]></name>
     */
    + (id)cdataElementWithName:(NSString *)name stringValue:(NSString *)string;
    
    @end
    

    DDXMLNode+CDATA.m:

    #import "DDXMLNode+CDATA.h"
    #import "DDXMLElement.h"
    #import "DDXMLDocument.h"
    
    @implementation DDXMLNode (CDATA)
    
    + (id)cdataElementWithName:(NSString *)name stringValue:(NSString *)string
    {
        NSString* nodeString = [NSString stringWithFormat:@"<%@><![CDATA[%@]]></%@>", name, string, name];
        DDXMLElement* cdataNode = [[DDXMLDocument alloc] initWithXMLString:nodeString
                                                                   options:DDXMLDocumentXMLKind
                                                                     error:nil].rootElement;
        return [cdataNode copy];
    }
    
    @end
    

    The code is also available in this gist.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating an iOS application, which in one of its screens, I'm using a
Let's say I'm building an iOS application which needs to load some static JSON
I'm creating an application for iOS and I'm stuck on a math issue. I
I'm creating an application for iOS 5 and I'm drawing some gradients. The following
Im creating application in java using XML. XML- <?xml version=1.0 encoding=UTF-8?> <songlist id=slist> <song
I am creating application for MAC using cocoa framework, I would like to know
I am creating application in cocos2d, but one thing I would like to know
I'm creating simple Socket server. Flex application will be client for this server. On
I am creating a static library for iOS which reads data from files which
So, I was creating an application for iOS with Xcode 4.2.1, I don't know

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.