# Xml.contains problem?

**URL:** <https://forum.kirupa.com/t/xml-contains-problem/315224>\
**Category:** Uncategorized\
**Created:** [October 20, 2010, 2:54pm UTC](https://forum.kirupa.com/t/xml-contains-problem/315224 "2010-10-20T14:54:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![activa](https://avatars.discourse-cdn.com/v4/letter/a/8491ac/32.png) [@activa](https://forum.kirupa.com/u/activa)\
**Post date:** [October 20, 2010, 2:54pm UTC](https://forum.kirupa.com/t/xml-contains-problem/315224/1 "2010-10-20T14:54:02Z")

</div>

I have the code:

```auto
var xml:XML = 
<cbr>
	<gamelist>
		<xref source="a" />
		<xref source="b" />
		<xref source="c" />
		<xref source="d" />
	</gamelist>;
	<stuff>
		<xref source="a" />
		<xref source="b" />
		<xref source="c" />
		<xref source="d" />
	</stuff>;
</cbr>
trace(xml.gamelist.xref.(@source == "b").childIndex()); 

```

which works fine if the value I’m testing for is in the XML, it returns “2”… but if I test for a value not there, say “e”, I get an error:

“TypeError: Error #1086: The childIndex method only works on lists containing one item.”

which I don’t understand… I thought the list only contained one item, as I was limiting it to the single “gamelist” item?
