3 Replies Latest reply on Oct 22, 2007 1:54 AM by AScracker

    Need help in crating XMl file

    AScracker Level 1
      Hi
      i am using this code get the detils from the xml and i need to pass the variable to another function to create the xml but when it's called for 60 times
      can any one give idea ro solve this issue..........

      ~~Sk

        • 1. Re: Need help in crating XMl file
          AScracker Level 1
          public function getEmpDetailsFrmXML() {
          var xmlFileName:String = "emp.xml";
          var employee_xml:XML = new XML();
          employee_xml['externalScope'] = this;
          employee_xml.ignoreWhite = true;
          employee_xml.load(xmlFileName);
          employee_xml.onLoad = function(success) {
          if (success) {
          var xmlData = this;
          this.externalScope.getetailsfrmXML.call(this.externalScope, xmlData);
          } else {
          trace("file not found");
          }
          };
          }
          // Function Used to get the Details frm the Xml
          public function getetailsfrmXML(details) {
          var __SeatingDetails:XML = new XML();
          __SeatingDetails.parseXML(details);
          var my_array:Array = new Array();
          var totalElements = XPath.selectNodes(__SeatingDetails, "//Employee/");
          for (var i = 0; i<=60; i++) {
          var currentNode:XMLNode = totalElements ;
          EmpName = currentNode.attributes.Empname;
          SeatNumber = currentNode.attributes.SeatNumber;
          prjName = currentNode.attributes.ProjectName;
          pmName = currentNode.attributes.PM;
          PamName = currentNode.attributes.PAM;
          var emp:String = EmpName+"_"+String(SeatNumber)+"_"+prjName+"_"+pmName+"_"+PamName;

          addData(EmpName, SeatNumber, prjName, pmName, PamName);
          }


          }
          • 2. Re: Need help in crating XMl file
            Darshan Rane Level 3
            whats ur actual question

            do u want to call function only once or 60 times
            • 3. Re: Need help in crating XMl file
              AScracker Level 1

              Actually i need to get 60 employee details ...
              but due this looping problem it producing details 60times ...
              i need to get the 60 emp delils in only one time...