例如,我想刪除所有價格標籤及其內容。刪除xml對象中的相同標籤節點
var xml:XML = <breakfast_menu>
<food>
<name>Belgian Waffles</name>
<price>$5.95</price>
<description>
two of our famous Belgian Waffles with plenty of real maple syrup
</description>
<calories>650</calories>
</food>
<food>
<name>Strawberry Belgian Waffles</name>
<price>$7.95</price>
<description>
light Belgian waffles covered with strawberries and whipped cream
</description>
<calories>900</calories>
</food>
<food>
<name>Berry-Berry Belgian Waffles</name>
<price>$8.95</price>
<description>
light Belgian waffles covered with an assortment of fresh berries and whipped cream
</description>
<calories>900</calories>
</food>
<food>
<name>French Toast</name>
<price>$4.50</price>
<description>
thick slices made from our homemade sourdough bread
</description>
<calories>600</calories>
</food>
<food>
<name>Homestyle Breakfast</name>
<price>$6.95</price>
<description>
two eggs, bacon or sausage, toast, and our ever-popular hash browns
</description>
<calories>950</calories>
</food>
</breakfast_menu>
我使用刪除xml..price,沒有工作,刪除操作僅適用於第一級,我想從整個樹刪除標籤,有沒有一些簡單的方法來做到這一點?
使用此唯一的刪除價格,你可以編寫一個函數來做到這一點嗎?我使用xml .. [tagName],但flash無法編譯,並且每次使用delete xml..price [0 ]不是一個好方法,我想。 – Max