# E4X filtering based on descendant attribute values

**URL:** <https://forum.kirupa.com/t/e4x-filtering-based-on-descendant-attribute-values/306018>\
**Category:** flash\
**Created:** [March 8, 2010, 10:43am UTC](https://forum.kirupa.com/t/e4x-filtering-based-on-descendant-attribute-values/306018 "2010-03-08T10:43:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oybrator](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/oybrator/32/1384_2.png) [@oybrator](https://forum.kirupa.com/u/oybrator)\
**Post date:** [March 8, 2010, 10:43am UTC](https://forum.kirupa.com/t/e4x-filtering-based-on-descendant-attribute-values/306018/1 "2010-03-08T10:43:11Z")

</div>

I’m having hard time reaching the right nodes here. The XML structure is like this:

```auto

<map>
	<y>
		<rs>
			<r>
				<cs>
					<c n="egypt">
						<is>
							<i t="f/e/v">
						</is>
					</c>
				</cs>
			</r>
		</rs>
	</y>
</map>

```

[LIST]  
[_]rs = regions where r = one region  
[_]cs = countries, where c is one country  
[\*]is = companies, where i = one company  
[/LIST]

The company nodes (“i”) has a type attribute (“t”) with a value of either e, f or v and the country nodes (“c”) have a name attribute (“n”).

I’m trying to return a list of names for countries that contain company nodes with t value of f, so here are some of my attempts. None of them work.

```auto

_xml.y.rs.r.cs.c.(child("is").i.@t == "f").@n
_xml.y.rs.r.cs.c.(child("is").(i.@t == "f")).@n
_xml.y.rs.r.cs.c.(child("is").i.(@t == "f")).@n

```

The problem is that the selector either returns too many or too few nodes.
