How can I delete a node value retaining the attribute in XML in Flex -
i have xml like:
<root> <item> <item name="fruit">fruits</item> <item name="vegetable">vegetables</item> </item> </root>
how delete node value alone ("fruits" "vegetables") retaining attribute values "fruit" "vegetable" in xml in flex.
i think should iterate through items.
if want delete values items, so:
var i:int = 0; each (var node:xml in xml.item.item) { xml.item.item[i] = ""; i++; }
you can specify condition:
var i:int = 0; each (var node:xml in xml.item.item) { if (node.@name == 'fruit') xml.item.item[i] = ""; i++; }
Comments
Post a Comment