I read a xml file contains

<![CDATA[<property id="SubClass"></property>]]>

When I write back into file , it will become:

&lt;property id="SubClass"&gt;&lt;/property&gt;

How can I avoid it and write back the original string ? I mean just write back:

<![CDATA[<property id="SubClass"></property>]]>

P.S.

I used alert() to display it before write to file.It's all right but without .Like:

<property id="SubClass"></property>

The writing back function is following:

var xmlObj = <![CDATA[<property id="SubClass"></property>]]>;
FLfile.write(path, xmlObj);//unescape() is useless there.

FLfile is an object in jsfl(FlashJavaScript).

有帮助吗?

解决方案

If you run into a problem where the parser is replacing special symbols of XML syntax, save the XML as a String opposed to XML object to preserve the data.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top