1 Reply Latest reply on Aug 7, 2006 5:31 PM by ntsiii

    XML Parser  Error

    negima
      Hi,
      I am a newbie to Flex 2 and can't seem to get a basic script to work. All the formating and syntax seems correct, but it just does not work.

      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" xmlns="*" applicationComplete="uReq.send()" backgroundGradientColors="[#f4fbfd, #2d6bb9]">


      <mx:HTTPService url="t.xml" id="uReq">
      </mx:HTTPService>

      ....................................

      <mx:DataGrid x="250" y="162" width="540" height="278" dataProvider="{uReq.lastResult.users.user}">

      </mx:DataGrid>

      XML FILE:
      <?xml version="1.0"?>
      <users>
      <user>
      <ain>1</ain>
      <FirstName>Simmy</FirstName>
      <MidName>K</MidName>
      <LastName>Gotten</LastName>
      <Address>23423 jjhgjhgj st</Address>
      <City>fghjj</City><State>hjkjhk</State>
      <Zip>11222</Zip>
      <Level>9</Level>
      <Type>Gassos</Type>
      <CheckDate>8/23/2005</CheckDate>
      <Sent>no</Sent>
      <Comment>ghjhgj</Comment>
      </user>

      <user>
      <ain>2</ain>
      <FirstName>sdfghj</FirstName>
      <MidName>sdfghjk</MidName>
      <LastName>cvbnm</LastName>
      <Address>fghjk 576fghj bnm</Address>
      <City>fghj</City>
      <State>vyubhni</State>
      <Zip>43456</Zip>
      <Level>10</Level>
      <Type>Gassos</Type>
      <CheckDate>10/23/2005</CheckDate>
      <Sent>no</Sent>
      <Comment>4vtrrrtefce</Comment>
      </user>

      <users/>

      The problem is either i get an 1096 XML parser error or I don't get any error but the dataGrid is still empty.
        • 1. Re: XML Parser  Error
          ntsiii Level 3
          First, use a result handler function on the HTTPService result event, and trace, alert or step throught the result object so you can see what is being returned.

          You have to make sure you are getting data first. If you get an error, make the xml file tiny, like <root><node/></root> and make sure you can load that.

          Then hard code the XML in the app, make sure you can display it. then put it together.

          Tracy