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);
精彩评论