Keith,

It was very kind of you to provide your function to me.  This will
definitely work for me.  I was just hoping I could avoid manipulating
the xml but I suppose theres nothing too wrong with it unless the XML
is huge hehe.

Thanks a ton!

Best Regards,

- - Dan



--- In [email protected], [EMAIL PROTECTED] wrote:
>
> Run this method over your XML before using it as you dataProvider.
> Probably a better way to do but it worked for me in similar situation.
> 
> var myXMLWithBranches:XML=iconizeXML(myOriginalXML);
> //---------------
> 
> 
> 
> private function iconizeXML(xmlobj:XML):XML
> {
>       function iconize(xml:XML):XML
>       {
>               if(xml.localName().indexOf("parent") != -1){
>                       [EMAIL PROTECTED]"true";
>               }
>               var n:int=0;
>               var c:XML;
>               while(n < xml.children().length()){
>                       c=xml.children()[n];
>                       iconize(c);
>                       n++;
>               }
>               return xml;
>       }
>       return iconize(xmlobj); 
> }
> 
> 
> 
> --Keith H--
> 
> ----- Original Message -----
> From: discipl4 <[EMAIL PROTECTED]>
> Date: Thursday, May 31, 2007 3:19 pm
> Subject: [flexcoders] Empty branch in a TREE - show folder instead of
> file icon?
> To: [email protected]
> 
> > Hi friends - thanks in advance for any help you can provide.  I am
> > displaying a simple XML in a TREE component and if I have an empty
> > branch, it shows up as a file icon instead of a folder - which is
> > expected.
> > 
> > My XML looks like
> > 
> > <root>
> > <parent1>
> >   <child1>
> > <parent2>
> > </root>
> > 
> > Parent one is a folder...  parent two is a file.  
> > 
> > The underlying dataprovider is an XMLListCollection.  How can I
> > declare each parent node as a branch?  I basically want to insert
> > 'isBranch=true' onto each parent node.
> > 
> > Thanks!
> > 
> > - - Dan
> > 
> >
>


Reply via email to