7 Replies Latest reply on Oct 23, 2006 12:43 PM by FABIO.BARREIRO

    how to manipulate XML?

    FABIO.BARREIRO
      Hi guys

      I have this XML returned to my app:
      <menu>
      <categoria nome="cat1">
      <item>item 1</item>
      <item>item 2</item>
      <item>item 3</item>
      </categoria>

      <categoria nome="cat2">
      <item>item 1b</item>
      <item>item 2b</item>
      <item>item 3b</item>
      </categoria>

      <categoria nome="cat3">
      <item>item 1c</item>
      <item>item 2c</item>
      <item>item 3c</item>
      </categoria>
      </menu>


      this is retrieved by an HTTPService
      <mx:HTTPService id="xmlMenu" url="data/menu.xml" method="POST" useProxy="false" result="handler()" resultFormat="e4x" />

      How to manipulate the XML data in then result handler using action script?
      - show nodes length
      - get the atribute of node categoria
      - get to the values of node item

      i've tried
      xmlMenu.lastResult.menu.length.toString()
      xmlMenu.lastResult.menu.categoria[0].length.toString()
      xmlMenu.lastResult.menu.categoria[0].@nome
      xmlMenu.lastResult.menu.categoria[0].item[0]

      nothing happens