1
確定這裏是我的代碼:E4X有條件的調用沒有返回任何東西只有1匹配?
var xml:XML =
<xml>
<typeA amount1="500" amount2="300" amount3="250" date="2008-02-17"/>
<typeA amount1="500" amount2="300" amount3="250" date="2008-02-16"/>
<typeA amount1="500" amount2="300" amount3="250" date="2008-02-17"/>
<typeB amount1="500" amount2="300" amount3="250" date="2008-02-18"/>
<typeB amount1="500" amount2="300" amount3="250" date="2008-02-19"/>
<typeC amount1="500" amount2="300" amount3="250" date="2008-02-20"/>
<typeC amount1="500" amount2="300" amount3="250" date="2008-02-21"/>
<typeC amount1="500" amount2="300" amount3="250" date="2008-02-20"/>
</xml>;
trace(xml.typeA.(@date == "2008-02-16")); // no results
trace(xml.typeA.(@date == "2008-02-17")); // finds both
trace(xml.typeC.(@date == "2008-02-20")); // finds both
trace(xml.typeC.(@date == "2008-02-21")); // no results
現在看來似乎只是發現它,如果有更多的則是1和次數。
我做錯了什麼?