Retrieve a list of employees hired in the year 2004 : Filter « XML « Flash / Flex / ActionScript

Home
Flash / Flex / ActionScript
1.Animation
2.Array
3.Class
4.Data Type
5.Development
6.Function
7.Graphics
8.Language
9.Network
10.Regular Expressions
11.Statement
12.String
13.TextField
14.XML
Flash / Flex / ActionScript » XML » Filter 
Retrieve a list of employees hired in the year 2004
 

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.*.(@HIRED >= 107&& @HIRED <= 101));
        
    }
  }
}

        
Related examples in the same category
1.Filtering XML Data
2.Returns a list of employees with a salary less than or equal to $35,000.
3.Returns a list of employees with a salary between $35,000 and $50,000:
4.Returns a list of the designers in the company:
5.A list of employees whose ID number is 238
6.Searching XML
7.Use regular repression to filter tag value
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.