Thanks guys, those were both very helpful.

On Mon, Mar 9, 2009 at 3:35 AM, Muzak <[email protected]> wrote:

>
>> delete xml.child.(@id=="b");
>>
>>
> You might wanna try that first..
>
>   TypeError: Error #1119: Delete operator is not supported with operand of
> type XMLList.
> "delete" works as long as the XMLList is not retrieved using an expression,
> which in this case it is: (@id == "b").
>
> So the following works (and deletes all elements):
>
>   var s:String = '<parent><child id="a" /><child id="b" /><child id="a"
> /><child id="b" /></parent>';
>   var xml:XML = new XML(s);
>   delete xml.child;
>
> Bug or feature? Who knows..
>
> regards,
> Muzak
>
> ----- Original Message ----- From: "liutoday" <[email protected]>
> To: <[email protected]>
> Sent: Monday, March 09, 2009 5:28 AM
> Subject: RE: [Flashcoders] find and delete XML nodes
>
>
>
>>
>>
>>  Date: Sun, 8 Mar 2009 23:38:17 -0400
>>> From: [email protected]
>>> To: [email protected]
>>> Subject: [Flashcoders] find and delete XML nodes
>>>
>>> I have some xml nodes where I need to evaluate their attributes and
>>> delete
>>> them if they meet certain criteria. It's probably simple but its late and
>>> brain fatigue is setting in.
>>>
>>> Say I had this node
>>>
>>> <parent>
>>>  <child id="a" />
>>>  <child id="b" />
>>>  <child id="a" />
>>>  <child id="b" />
>>> </parent>
>>>
>>> How would I find and delete any <child> who's id is "b" ?
>>> --
>>> --Joel Stransky
>>> stranskydesign.com
>>> _______________________________________________
>>>
>>
>>
>> delete xml.child.(@id=="b");
>>
>>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>



-- 
--Joel Stransky
stranskydesign.com
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to