Find data nested deep within an XML tree. : XML hierarchy : XML Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » XML » XML hierarchy »

 

Find data nested deep within an XML tree.


 


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

        var myXML:XML = <alpha>
                            <beta>
                                <charlie delta="echo">foxtrot</charlie>
                            </beta>
                            <beta>
                                <golf hotel="india">juliet</golf>
                           </beta>
                        </alpha>;
        trace(myXML.beta[1].golf);           // Displays: juliet
        trace(myXML.beta[0].charlie.@delta)// Displays: echo

    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo XML
» XML hierarchy