views:

76

answers:

1

I have an XMLList, I am trying to grab one from the list with a stone attribute == Opal but its not working, I don't understand why?

Here is the code:

var xml:XML = <bs><variation price="999999999.99" month="OCT" stone="Magic Pet Rock" image="https://www.sussexjewelers.com/birthstone_images/20_PE105-BT.png" style="PE105" gold_color="White" gold_carat="14"/>
<variation price="999999999.99" month="OCT" stone="Opal" image="https://www.sussexjewelers.com/birthstone_images/17_PE105-OP.png" style="PE105-OP" gold_color="Yellow" gold_carat="14"/>
<variation price="33212221.00" month="OCT" stone="Pink Tourmaline" image="https://www.sussexjewelers.com/birthstone_images/16_PE105-PT.png" style="PE105-PT" gold_color="Yellow" gold_carat="14"/></bs>;


var list:XMLList = xml.children();

trace(list) // returns all three variations

list = list.(@stone == 'Opal');

trace(list); // expecting to return the 2nd variation but actually returns nothing.

Can anyone see why this is not working as expected?

Thanks.

+1  A: 

I postd this question right before I figured it out...I need to add toXMLString() when I trace it.

trace(list.toXMLString());
John Isaacks
Yes, that's a weird Flex debugger issue. If an e4x expression returns just a single node it is there but trace is always empty.
radekg