0 Replies Latest reply on Sep 15, 2007 12:38 AM by steeban

    Parsing xml

      Hi all,
      i m receiving xml from a webservice as a string... i m trying to convert that string to xml... but its not happening...
      here is the as3 code which was developed using flex builder...

      package {
      import flash.display.Sprite;
      public class checkXML extends Sprite
      public function checkXML()
      var xmlString:String = new String()

      xmlString = "<NewDataSet>\r\n <Table>\r\n <Country>France</Country>\r\n <City>Le Touquet</City>\r\n </Table>\r\n <Table>\r\n <Country>France</Country>\r\n <City>Agen</City>\r\n </Table>\r\n </NewDataSet>";

      var tmp_ar:Array = xmlString.split("\r\n");
      var tmp_str:String= tmp_ar.join("");
      tmp_ar = tmp_str.split("> ");

      tmp_str = tmp_ar.join(">");
      tmp_ar = tmp_str.split("> ");
      }while(tmp_ar.length > 2)

      var tmp_xml:XML// = new XML()
      tmp_xml = new XML(tmp_str)
      trace(tmp_xml.children()) // this text is not returning

      am i doing in the right way ?
      Please help me out