RE: [flexcoders] e4X delete question
I am surprised you are not getting an error. You can delete an XML object but not an XMLList. You will need to loop over the XMLList and delete the nodes individually: for (i:int =0;ip.lenght()... //I never can remember when length is a property or method delete p[i] ... Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of matt wicks Sent: Tuesday, October 30, 2007 9:39 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] e4X delete question Hi all I have an xml structure which is like this map cliphkjkj/clip cliphh document hxsjka/document /clip clip documentkkk/document /clip /map And I want to delete the document nodes in one swoop .. var p:XMLList = _mapDataProfile.clip..document delete _mapDataProfile.clip..document var s:XMLList=_mapDataProfile.clip..document but p and s are the same - what am I missing here? Thanks ! Matt
Re: [flexcoders] e4X delete question
Tracy, that's what I thought too, but the live docs says you can delete XMLLists ( http://livedocs.adobe.com/flex/201/langref/operators.html#delete_(XML)). Maybe this is a documentation bug. Another possibility is that the .. is getting in the way. I've had problems with it before where it needed to be replaced with the descendants method. Try delete _mapDataProfile.clip.descendants(document) Try and see if that helps. - Dan Freiman On 10/30/07, Tracy Spratt [EMAIL PROTECTED] wrote: I am surprised you are not getting an error. You can delete an XML object but not an XMLList. You will need to loop over the XMLList and delete the nodes individually: for (i:int =0;ip.lenght()… //I never can remember when length is a property or method delete p[i] … Tracy -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *matt wicks *Sent:* Tuesday, October 30, 2007 9:39 AM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] e4X delete question Hi all I have an xml structure which is like this map cliphkjkj/clip cliphh document hxsjka/document /clip clip documentkkk/document /clip /map And I want to delete the document nodes in one swoop .. *var* p:XMLList = _mapDataProfile.clip..document *delete* _mapDataProfile.clip..document *var* s:XMLList=_mapDataProfile.clip..document but p and s are the same - what am I missing here? Thanks ! Matt
RE: [flexcoders] e4X delete question
Thanks to both - will try it out tomorrow - mtt _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Freiman Sent: 30 October 2007 18:30 To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] e4X delete question Tracy, that's what I thought too, but the live docs says you can delete XMLLists (http://livedocs. http://livedocs.adobe.com/flex/201/langref/operators.html#delete_(XML) adobe.com/flex/201/langref/operators.html#delete_(XML) ). Maybe this is a documentation bug. Another possibility is that the .. is getting in the way. I've had problems with it before where it needed to be replaced with the descendants method. Try delete _mapDataProfile.clip.descendants(document) Try and see if that helps. - Dan Freiman On 10/30/07, Tracy Spratt [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] com wrote: I am surprised you are not getting an error. You can delete an XML object but not an XMLList. You will need to loop over the XMLList and delete the nodes individually: for (i:int =0;ip.lenght(). //I never can remember when length is a property or method delete p[i] . Tracy _ From: [EMAIL PROTECTED] mailto:flexcoders@yahoogroups.com ups.com [mailto: mailto:flexcoders@yahoogroups.com [EMAIL PROTECTED] On Behalf Of matt wicks Sent: Tuesday, October 30, 2007 9:39 AM To: [EMAIL PROTECTED] mailto:flexcoders@yahoogroups.com ups.com Subject: [flexcoders] e4X delete question Hi all I have an xml structure which is like this map cliphkjkj/clip cliphh document hxsjka/document /clip clip documentkkk/document /clip /map And I want to delete the document nodes in one swoop .. var p:XMLList = _mapDataProfile.clip..document delete _mapDataProfile.clip..document var s:XMLList=_mapDataProfile.clip..document but p and s are the same - what am I missing here? Thanks ! Matt