1

我有一个 XMLList,我试图从列表中抓取一个带有石头属性 == Opal 但它不起作用,我不明白为什么?

这是代码:

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.

谁能明白为什么这不能按预期工作?

谢谢。

4

1 回答 1

2

我在弄清楚之前就发布了这个问题......我需要在跟踪它时添加 toXMLString() 。

trace(list.toXMLString());
于 2009-04-29T18:18:29.553 回答