5 Replies Latest reply on Oct 24, 2007 5:03 AM by Greg Dove

    display xml elements

    jagguy99 Level 1
      I can read in a file and display the XML elements of 1 tag (book)but i cant do elements of many tags (all book tags)like this

      input from file
      ----
      <?xml version="1.0" ?>
      <books>
      <book author="Mmark twain" title="huck finn" />
      <book author="mark twain2" title="huck finn2" /> /cant print out?
      </books>

      output and no 2nd line from above???
      ---
      Mmark twain author
      huck finn title


      AS
      ---
      var xRootNode:XMLNode =xmlData.firstChild ;
      var xnBook:XMLNode =xRootNode.firstChild;

      var attrib:Object =xnBook.attributes

      for (var sattrib:String in attrib ) {
      trace(attrib[sattrib]+ " " + sattrib); //only prints 1 line of <book> tag and not 2


      }