Skip to content

Instantly share code, notes, and snippets.

@caubry
Last active December 21, 2015 20:49
Show Gist options
  • Select an option

  • Save caubry/6364300 to your computer and use it in GitHub Desktop.

Select an option

Save caubry/6364300 to your computer and use it in GitHub Desktop.
var myXML:XML = generalInformationService._xml;
for (var i:int = 0; i < myXML.length(); i++)
{
var node:XML = myXML[i];
var brandNode:String = myXML[i].@brand;
var newNodes:XML = new XML( <BRAND><NAME>{brandNode}</NAME></BRAND> );
node.prependChild(newNodes);
delete node.@brand;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment