Removing Elements, Text Nodes, and Attributes : Delete : XML Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » XML » Delete »

 

Removing Elements, Text Nodes, and Attributes


 


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

        var example:XML = <example>
                            <fruit color="Red">Apple</fruit>
                            <vegetable color="Green">Broccoli</vegetable>
                            <dairy color="White">Milk</dairy>
                          </example>;
                          
        delete example.fruit.@color;
        
        delete example.dairy;
        
        delete example.vegetable.text(  )[0];
        
        traceexample );


    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo XML
» Delete