Returns a list of employees with a salary between $35,000 and $50,000 : Filter : XML Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » XML » Filter »

 

Returns a list of employees with a salary between $35,000 and $50,000


 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){


        var staff:XML = <STAFF>
          <EMPLOYEE ID="501" HIRED="109">
            <NAME>M</NAME>
            <MANAGER>J</MANAGER>
            <SALARY>25000</SALARY>
            <POSITION>Designer</POSITION>
          </EMPLOYEE>
        
          <EMPLOYEE ID="238" HIRED="101">
            <NAME>J</NAME>
            <MANAGER>D</MANAGER>
            <SALARY>55000</SALARY>
            <POSITION>Manager</POSITION>
          </EMPLOYEE>
        </STAFF>
        
        trace(staff.*.(SALARY >= 35000 && SALARY <= 50000));

    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo XML
» Filter