1

I'm trying to export an XML file that is embedded in a bigger file, that source XML contains lots of CDATA like this one:

<Title><![CDATA[BLABLA BLABLA]]></Title>

When i save the file:

NSData *xmlData = [xmlDocument XMLDataWithOptions:0];
[xmlData writeToFile:fileName atomically:YES] ;

all the CDATA is gone, i just get :

<Title>BLABLA BLABLA</Title>

How can i make it so that it saves the CDATA with it ?

Thank you

user3011168
  • 101
  • 1
  • 2

1 Answers1

1

The solution : add the flag NSXMLNodePreserveCDATA and problem is solved.

user3011168
  • 101
  • 1
  • 2