1 Reply Latest reply on Feb 16, 2010 1:09 AM by Yogi_ACE

    XML tree

    zakabalt Level 1

      Hello I have a XML tree and I want to get one data but I don't know how. The structure is something like this:


      . . . . 
      <node idCuenta="2445530" label="Drafts" id="Drafts" idPtRight="10" idPtLeft="9" idFolder="5" />
      <node idCuenta="2445530" label="Template" id="Template" idPtRight="12" idPtLeft="11" idFolder="3" />
      <node idCuenta="2445530" label="Trash" id="Trash" idPtRight="14" idPtLeft="13" idFolder="4" />
      . . . . .


      I want to know which is the idFolder when the label is Trash and the id is Trash. I have this code:


      var itemTree:Object = newTree.selectedItem;
      cuenta = new Number(itemTree.@idCuenta.toString());

      The selected item is not always the Trash, if will be the Trash is easy, but I want to know which is the Trash (idFolder) although the Template be selected.

      I know idCuenta, but I want to know which is the idFolder of Trash. For that, I know the id and the label will be 'Trash' but I don't know the idFolder.


      Can someone help me?




      PD: Sorry my english is not as good as I want.

        • 1. Re: XML tree
          Yogi_ACE Level 2

          I could not understand your problem exactly but I guess you want to retrieve other values of selected node attribute.


          If it is the problem then try using XML filters,

          var myNode:XMLList = yourXML.(@id.search("Trash") > -1);

          trace(myNode.@idFolder); // you has to traverse within resultant node


          It will search for the attribute value Trash and return you that particular node list (including its children).

          Kindly implement this code as per your requirement.


          If this post answers your question or helps, please mark it as such.