3 Replies Latest reply on Oct 29, 2009 10:46 AM by hamburg1984

    Remove specific elements from a XMLList




      i've got an xml file which is structured like shown below.


      <?xml version="1.0" encoding="UTF-8"?>
          <main id="1" name="Level1">
              <sub id="1" name="Level2">
                  <sub2 id="1" name="Level3">
                      <data id="1" name="Data1"/>
                      <data id="2" name="Data2"/>
                  <sub2 id="2" name="Level3_2">
                      <data id="3" name="Data3"/>
                      <data id="4" name="Data4"/>




      This my application code


      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" creationComplete="svcXml.send()">
                [Bindable] private var fullXML:XMLList;
                import mx.rpc.events.ResultEvent;
                private function contentHandler(evt:ResultEvent):void{
                        fullXML = evt.result.data;
      <mx:HTTPService id="svcXml" url="xmlfile.xml" result="contentHandler(event)" resultFormat="e4x"/>
         <mx:Tree id="menu" labelField="@name" width="300" height="100%" >
            <mx:XMLListCollection source="{fullXML}">




      My question is: How do I ignore all <data> elements? I can't modify the xml file itself because it will be an external source.


      The generated tree should look like this:





      Thanks for your help!