1 Reply Latest reply on Jul 5, 2007 8:12 AM by levancho

    How to acces XML-sub-elements inside a dataProvider ?

    mukulneetika
      Hi,

      Is there a way I can access sub-elements inside an XML document that I get over HTTPRequest?

      For example my XML document looks like this:
      <top>
      <secondlevel>
      <date>7/2</date>
      <thirdlevel>
      <earnings>10</earnings>
      </thirdlevel>
      </secondlevel>
      <secondlevel>
      <date>7/3</date>
      <thirdlevel>
      <earnings>20</earnings>
      </thirdlevel>
      </secondlevel>
      <secondlevel>
      <date>7/4</date>
      <thirdlevel>
      <earnings>30</earnings>
      </thirdlevel>
      </secondlevel>
      </top>

      How do I access elements inside "thirdlevel"?

      And my MXML looks like this:

      <mx:LineChart width="300" height="300" id="chart"
      paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0"
      showDataTips="true"
      dataProvider="{srv.lastResult.top.secondlevel}">

      <mx:horizontalAxis>
      <mx:CategoryAxis categoryField="date" title="Day"/>
      </mx:horizontalAxis>

      <mx:series>
      <mx:LineSeries id="myline" yField="earnings" name="Earnings" displayName="Earning"/>
      <!-- how do I access earnings inside "thirdlevel" ? -->
      </mx:series>
      </mx:LineChart>

      Thanks,
      Mukul.
      http://mukulblog.blogspot.com