var pets:XML = <pets>
        <t n="moe">
                <a>dog</a>
        </t>
        <t n="larry">
                <a>snake</a>
                <a>cat</a>
        </t>
        <t n="curly">
                <a>mouse</a>
        </t>
</pets>

var parentT:XMLList = pets..t.(elements().contains(<a>cat</a>)).@n;

Regards,

Keith Reinfeld
Home Page: http://keithreinfeld.home.comcast.net

> -----Original Message-----
> From: [email protected] [mailto:flashcoders-
> [email protected]] On Behalf Of Mendelsohn, Michael
> Sent: Friday, April 22, 2011 2:42 PM
> To: Flash Coders List
> Subject: [Flashcoders] quick E4X question
> 
> Hi list...
> 
> With this xml, given an <a> node, I want to find its parent <t> node.
> // not working
> var parentT:XMLList = pets..*.(t.contains(<a>cat</a>));
> 
> thanks,
> Michael M.
> 
> <pets>
>       <t n="moe">
>               <a>dog></a>
>       </t>
>       <t n="larry">
>               <a>snake</a>
>               <a>cat</a>
>       </t>
>       <t n="curly">
>               <a>mouse</a>
>       </t>
> </pets>
> 
> 
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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

Reply via email to