Hi Jesus,

I can't test this with your data, but you could try something like this to delete an entire node:

var nodeToDelete:XML = XML(temp..A.(@HREF == id));
deleteNode(nodeToDelete);

private function deleteNode(nodeToDelete:XML):void
{
     //collection of nodes containing the node to delete
     var xlcParent:XMLListCollection = new XMLListCollection(nodeToDelete.parent().children());
     //index of node to delete in collection
     var iIndex:int = xlcParent.getItemIndex(nodeToDelete);   
     xlcParent.removeItemAt(iIndex);        
}

-TH

--- In [email protected], Jesús Iglesias <[EMAIL PROTECTED]> wrote:
>
> Hi,
> I have a XML which really is some xhtml.
> I want to delete come nodes but but I can't find the right way:
>
> var temp:XML;
> delete temp..A.(@HREF == id);
>
> This reports error: delete operand cand not be used with xmllist operand
> (more or less)
>
> And this way:
>
> var allTags: XMLList = temp..A.(@HREF == id);
> var item:XML;
> for each(item in allTags) {
> delete item;
> }
> Reports: Attempt to delete the fixed property item. Only dynamically
> defined properties can be deleted. TextEditorNuevaImagen.mxml
> grupochs.com line 96 24 de julio de 2006 12:26:48 728
>
> I can delete all subnodes and all attributes, but A node stays empty. I
> want to remove the whole A node.
>
> Thanks.
>
> Jesús Iglesias
> Alvento Soluciones Móviles
> Poeta Querol, 5 - 2
> 46002 Valencia (España)
> [tel]: (+34) 96.353.02.15
> [fax]: (+34) 96.353.08.09
> [e-mail]: <mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
> [web]: <http://www.alvento.com/> www.alvento.com
>
> Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
> contiene información de carácter confidencial exclusivamente dirigida a
> su destinatario o destinatarios y propiedad de Alvento Soluciones S.A.
> Queda prohibida su divulgación, copia o distribución a terceros sin la
> previa autorización escrita de Alvento Soluciones S.A., en virtud de la
> legislación vigente. En el caso de haber recibido este correo
> electrónico por error, se ruega notificar inmediatamente esta
> circunstancia mediante reenvío a la dirección electrónica del remitente
> y la destrucción del mismo.
>
>
> The information in this e-mail and in any attachments is classified as
> Alvento Soluciones S.A. Confidential and Proprietary Information and
> solely for the attention and use of the named addressee(s). You are
> hereby notified that any dissemination, distribution or copy of this
> communication is prohibited without the prior written consent of Alvento
> Soluciones S.A. and it is strictly prohibited by law. If you have
> received this communication by error, please, notify the sender by
> replying e-mail.
>

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to