That is a tough one.  It is more of a transformation than a selection.

 

If you can't do it directly, consider using the selection expression to
return the nodes you do NOT want, then deleting them from the XML.

 

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Shailesh Mangal
Sent: Wednesday, January 24, 2007 8:13 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] e4x - attribute based selector

 

All,

I have a following xml structure retrieved from server
<root>
<parent name="good">
<child name="abc"/>
<child name="cba"/>
<child name="abc"/>
</parent>
<parent name="notGood">
<child name="abc"/>
<child name="def"/>
<child name="fed"/>
</parent>
</root>

and I want to make a selection based on the attribute of child. e.g.
for child with name "abc", get a result as..
<root>
<parent name="good">
<child name="abc"/>
<child name="abc"/>
</parent>
<parent name="notGood">
<child name="abc"/>
</parent>
</root>

I tried following, 
result..child.(@name=="abc")
result.root.parent.child.(@name=="abc")
but I end up getting following 
<child name="abc">
<child name="abc">
<child name="abc">

Any suggestions?
sxm

 

Reply via email to