Search code examples
xmlapache-flexflashe4x

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 variable?


Solution

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

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