Create a for loop to walk through all the childnodes.

-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Jiri
Sent: maandag 8 juni 2009 11:53
To: Flash Coders List
Subject: [Flashcoders] Delete node using e5x inline.

List,

Does anyone know how to delete nodes from an xml using ex4 and a 
condition specific in the node. I really need to delete these nodes.

For example:

var tXML:XML = new XML(
<data><image_conf>
   <randomImage id="1" delete="true"/>
   <randomImage id="2" delete="true"/>
   <randomImage id="3" />
   <randomImage id="4"/>
</image_conf></data>)

var pXML:XMLList = tXML.image_conf;

When i then use this:

delete pXML.randomImage.(attribute("delete") == "true")[0]

Not all the nodes with @delete = 'true' are removed.

trace(pXML.toXMLString())
// this is what is the output looks like
<image_conf>
   <randomImage id="2" delete="true"/>
   <randomImage id="3"/>
   <randomImage id="4"/>
</image_conf>


Much appreciated.

Jiri
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to