0

I did find this piece of code (slightly edited):

var destinations:XML = <destinations>
       <destination location="japan">
        <exchangeRate>400</exchangeRate>
        <placesOfInterest>Samurai History</placesOfInterest>
    </destination>   
    <destination location="australia">
        <exchangeRate>140</exchangeRate>
        <placesOfInterest>Surf and BBQ</placesOfInterest>
    </destination>
    <destination location="peru">
        <exchangeRate>30</exchangeRate>
        <placesOfInterest>Food</placesOfInterest>
    </destination>
</destinations>;

//FILTER BY ATTRIBUTE NAME  -------------------
var filteredByLocation:XMLList = destinations.destination.(@location == "japan");
trace("Attribute Name: "+filteredByLocation);

//FILTER BY NODE VALUE ----------------------
var filteredByExchangeRate:XMLList = destinations.destination.(exchangeRate < 200);
trace("Node Value: "+filteredByExchangeRate);

I'd like to know if it's possible to do the opposite. I mean, get everything but not the node with the attribute name.

Thanks in advance for your help.

4

1 回答 1

0

我太困了:

//FILTER BY ATTRIBUTE NAME  -------------------
var filteredByLocation:XMLList = destinations.destination.(@location != "japan");
trace("Attribute Name: "+filteredByLocation);

无论如何,它对那里的人很有用。

于 2013-08-26T15:06:23.607 回答