title: Error in getting values from XML file to array Collection in Flex
body: <p>I am trying display values in a datagrid in my application. I have all the values as an xml file. I had only one set of record n the XML file,  to fill only one row of the data grid. While trying to store the values from the XML file to an Array Collection in the application File using the  code, i.e.,</p>
  
  <pre><code>&lt;mx:Model id="reviewList" source="assets/reviewList.xml"/&gt;
  &lt;mx:ArrayCollection id="reviewlist" source="{reviewList.Item}"/&gt; 
  </code></pre>
  
  <p>I get an error, saying </p>
  
  <pre><code>Error No# 1034: Type coercion failed cannot convert mx.utils::ObjectProxy to Array.
  </code></pre>
  
  <p>But If I have two record sets in the XML file, it works fine. If there is only one set, I get the above said error? What is the problem in this case?</p>
  
  <p>Here is my xml file:</p>
  
  <pre><code>&lt;ReviewList&gt;
  &lt;Item&gt;
      &lt;ReviewId&gt;1123&lt;/ReviewId&gt;
      &lt;TaskType&gt;User Requirement Specification&lt;/TaskType&gt;
      &lt;RequestId&gt;1223&lt;/RequestId&gt;
      &lt;ItemCodeVersion&gt;URS - 1&lt;/ItemCodeVersion&gt;
      &lt;ReviewStartDate&gt;29-Sep-2009&lt;/ReviewStartDate&gt;
      &lt;Status&gt;Review In Progress&lt;/Status&gt;
      &lt;Reviewer&gt;MR.RISHU GHOSE&lt;/Reviewer&gt;
      &lt;OpenDefect&gt;0&lt;/OpenDefect&gt;
      &lt;CasualAnalysisPending&gt;0&lt;/CasualAnalysisPending&gt;
      &lt;CloseDefects&gt;0&lt;/CloseDefects&gt;
      &lt;VerifiedDefects&gt;0&lt;/VerifiedDefects&gt;
  &lt;/Item&gt;
  
  &lt;/ReviewList&gt;
  </code></pre>
  
  <p>And this is the datagrid where I want the details to be displayed.</p>
  
  <pre><code>&lt;mx:DataGrid id="reviewDG" dataProvider="{reviewlist}" variableRowHeight="true" width="100%" height="200" 
                       horizontalScrollPolicy="off"&gt;
  
  &lt;mx:columns&gt;
      &lt;mx:DataGridColumn headerText="Review Id" dataField="ReviewId" textAlign="center" /&gt;
  
      &lt;mx:DataGridColumn headerText="Task Type" dataField="TaskType" textAlign="center"/&gt; 
  
      &lt;mx:DataGridColumn headerText="Request Id" dataField="RequestId" textAlign="center"/&gt; 
  
      &lt;mx:DataGridColumn headerText="Item Code-Ver" dataField="ItemCodeVersion" textAlign="center" headerWordWrap="true"/&gt; 
  
      &lt;mx:DataGridColumn headerText="Review Start Date" dataField="ReviewStartDate" textAlign="center" headerWordWrap="true"/&gt;
  
      &lt;mx:DataGridColumn headerText="Status" dataField="Status" textAlign="center"/&gt;
  
      &lt;mx:DataGridColumn headerText="Reviewer" dataField="Reviewer" textAlign="center"/&gt;
  
      &lt;mx:DataGridColumn headerText="Open Defect" dataField="OpenDefect" textAlign="center" headerWordWrap="true"/&gt; 
  
      &lt;mx:DataGridColumn headerText="Casual Analysis Pending" dataField="CasualAnalysisPending" textAlign="center" headerWordWrap="true"/&gt;
  
      &lt;mx:DataGridColumn headerText="Close Defects" dataField="CloseDefects" textAlign="center" headerWordWrap="true"/&gt;
  
      &lt;mx:DataGridColumn headerText="Verified Defects" dataField="VerifiedDefects" textAlign="center" headerWordWrap="true"/&gt;
  
      &lt;mx:DataGridColumn headerText="Review Details" dataField="ReviewDetails" width="65" headerWordWrap="true"&gt; 
       &lt;mx:itemRenderer&gt; 
         &lt;mx:Component&gt; 
          &lt;mx:Label text="View" click="outerDocument.onViewClick()"/&gt; 
         &lt;/mx:Component&gt; 
       &lt;/mx:itemRenderer&gt; 
      &lt;/mx:DataGridColumn&gt; 
  
  
  &lt;/mx:columns&gt;
    &lt;/mx:DataGrid&gt;    
  </code></pre>
  
  <p>There may be cases in my application where i need only one record to be displayed in the datagrid. In such cases how do I resolve this error?   </p>