Determining the Type of Content in a Node : Node type : XML Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » XML » Node type »

 

Determining the Type of Content in a Node


 

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

        var contentTest:XML = <test>
                                <a />
                                <b>Lorem Ipsum</b>
                                <c>
                                   <d />
                                </c>
                              </test>;
        trace(contentTest.a.hasSimpleContent());  // Displays: true
        trace(contentTest.b.hasSimpleContent());  // Displays: true
        trace(contentTest.c.hasSimpleContent());  // Displays: false
        trace(contentTest.d.hasComplexContent())// Displays: false
    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo XML
» Node type