1 Reply Latest reply on Jan 9, 2011 10:16 PM by flexprabu

    Hai..How to append more than 2 XML..i got error

    flexprabu

      public function sendXML():void

      {

           Application.application.prabu=new XML(<SolvEdge/>);

           for(var i:int=0;i<Application.application.locArr.length;i++)

        {

           temp1XML=new XML(<patient/>);

            ResultXML=new XML(<results/>);

           ResultXML.@survey_id='JNTHK20100810';

       

           ResultXML.@serviceline_id='';

           ResultXML.@location_id='';

           ResultXML.@score='';

           ResultXML.@surveytype='';

           ResultXML.@visittype_id;

           temp1XML.@fname=Application.application.fname;

           temp1XML.@lname=Application.application.lname;

           temp1XML.@dob=Application.application.DateofBStr;

           temp1XML.@ssn=Application.application.ssnStr;

           temp1XML.@dos;

           temp1XML.@hospital_value;

           temp1XML.@surgeon_id;

           temp1XML.@id=Application.application.ID;

          Application.application.prabu.appendChild(temp1XML);

       

           Application.application.prabu.patient.appendChild(ResultXML);

       

         }

       

      }

       

      this is my coding for generate XML in for loop but i got the error in appendChild

      that error is follows \

      Error

      TypeError: Error #1086: The appendChild method only works on lists containing one item.

      at XMLList/http://adobe.com/AS3/2006/builtin::appendChild()

       

       

      how can add this xml in for loop??????