Problem with creating XML from an XML file.
I am having an XML file which I am reading in Flash/AS3. I store the loaded XML into a variable say: parentXML. From this parentXML, I am creating two XMLs say child1XML and child2XML, depending on certain conditions.
The problem I am facing is that when I change a property of a node in any XML, it gets changed in the other XMLs also, wherever it was added.
What I think is happening is that in actual no new node is getting added in the child XMLs, rather just the reference is getting added.
Any idea how I can resolve this issue? here is a snippet of the code I am using:
/* Creating child XML */
for (var i:int = 0; i < parentXML.project.length(); i++)
{
for (var j:int = 0; j < parentXML.project.info.length(); j++)
{
if (parentXML.project.info.@category == "something")
{
child1XML.appendChild(parentXML.project);
}
}
}