Delete all attributes of an element : delete « XML « Flash / Flex / ActionScript






Delete all attributes of an element

 

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



        var novel:XML = <BOOK ISBN="0000000000">
            <TITLE>ActionScript</TITLE>
            <AUTHOR>J, J</AUTHOR>
            <PUBLISHER>Books Ltd</PUBLISHER>
          </BOOK>;
          
        trace(novel);
        
        delete novel.@*;  
          
        trace(novel);
    }
  }
}

        








Related examples in the same category

1.Removing Elements, Text Nodes, and Attributes
2.To delete all the items in the XMLList, use a for loop and iterate over the items in reverse order
3.Removing XML Nodes
4.The delete operator works for other types of nodes as well, such as attributes.
5.Remove all attributes from the movie Tron.