开发者

delete XML node, keep original

I need to delete some nodes from an XML variable and I want to keep the original intact.

So I pass the XML to a new variable and delete the nodes from that one but the original changes with it.

Is there a way to protect the XML from the original va开发者_Go百科riable?


you want to clone the xml, not just set another variable reference to it.

try var xmlbackup:XML = xml.copy();


I think that next code do the job too:

var newXML : XML = new XML(oldXML);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜