1 Reply Latest reply on Jul 3, 2007 12:26 PM by gjastrab

    Trying to read attributes from xml feed, having issues

    Tek_Mark
      Here is the XML file I am using (hoopstest.xml):
      <bbcareer version="1.1.0" date="Jul 03, 2007">
      <player name="John Doe" >
      <season year="2004-05" gp="22" gs="0" min="343" minavg="15.6" tp="134" ptsavg="6.1"
      fgm="49" fga="107" fgpct=".458" fgm3="5" fga3="16" fg3pct=".313" ftm="31" fta="47" ftpct=".660"
      oreb="20" dreb="42" treb="62" rebavg="2.82" pf="37" dq="0" ast="11" to="29" blk="12" stl="8">
      <tester>1</tester>
      </season>
      <season year="2005-06" gp="26" gs="15" min="582" minavg="22.4" tp="274" ptsavg="10.5"
      fgm="107" fga="184" fgpct=".582" fgm3="5" fga3="19" fg3pct=".263" ftm="55" fta="82" ftpct=".671"
      oreb="49" dreb="83" treb="132" rebavg="5.08" pf="56" dq="2" ast="25" to="49" blk="31" stl="23">
      <tester>2</tester>
      </season>
      <season year="2006-07" gp="25" gs="25" min="768" minavg="30.7" tp="490" ptsavg="19.6"
      fgm="179" fga="314" fgpct=".570" fgm3="12" fga3="31" fg3pct=".387" ftm="120" fta="163" ftpct=".736"
      oreb="89" dreb="106" treb="195" rebavg="7.80" pf="74" dq="3" ast="37" to="72" blk="40" stl="26">
      <tester>3</tester>
      </season>
      <season year="TOTAL" gp="73" gs="40" min="1693" minavg="23.2" tp="898" ptsavg="12.3"
      fgm="335" fga="605" fgpct=".554" fgm3="22" fga3="66" fg3pct=".333" ftm="206" fta="292" ftpct=".705"
      oreb="158" dreb="231" treb="389" rebavg="5.33" pf="167" dq="5" ast="73" to="150" blk="83" stl="57"> <tester>4</tester>
      </season>
      </player>
      </bbcareer>

      The tester is just so I can verify for many records are being read.

      In my app below, the 4 tester records show up, but the attributes do not. Any ideas why? TIA.

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute"
      creationComplete="feedRequest.send()">
      <mx:HTTPService id="feedRequest" url=" http://www.stats.com/hoopstest.xml" useProxy="false"/>
      <mx:Panel x="10" y="10" width="475" height="400" layout="absolute" title="Player Stats">
      <mx:DataGrid x="20" y="20" id="dgPosts" width="400"
      dataProvider="{feedRequest.lastResult.bbcareer.player.season}">
      <mx:columns>
      <mx:DataGridColumn headerText="Test" dataField="tester"/>
      <mx:DataGridColumn headerText="year" dataField="@year"/>
      <mx:DataGridColumn headerText="gp" dataField="@gp"/>
      <mx:DataGridColumn headerText="Min" dataField="@min"/>
      </mx:columns>
      </mx:DataGrid>
      </mx:Panel>
      </mx:Application>