Hi all,
Recently Ive been working with an XML document that has a structure
similar to the following:
<Members>
<Member id="1" name="John" color="blue">
<Member id="2" name="sally" color="blue">
<Member id=3" name="Moe" color="red"/>
<Member id=61" name="Elliot" color="green">
<Member id="123" name="Michael" color="blue"/>
</Member>
</Member>
</Member>
</Members>
Where member123 is a child of member61. member61 and member3 are
children of member2. And Member2 is a child of member1.
Now the Flex documentation states that a call to a IViewCursor.findAny
method is supposed to traverse the heirarchy of the XMLListCollection
(I save the XML as a XMLListCollection) and return values that match a
given id# or name, etc from the attributes in the XML node.
I have also tried to filter the list by color or whatever other
attribute is available and this doesnt work either.
Whenever I pass the XMLListCollection to a filterFunction, it passes
the entire XML document instead of item by item. The documentation
states that filterFunctions are supposed to pass each node to the
parameter in the method for evaulation: eg
protected function colorFilter(item:Object):Boolean
{
return [EMAIL PROTECTED] == 'blue';
}
is supposed to filter the XMLListcollection by color but it doesnt work.
Can anyone offer some advice on this? I have traced my cursor and my
item pass object and its passing the entire XML doc instead of the
individual node. And when I sort, using something similar to :
protected function treeSort():void{
var treeSort:Sort = new Sort();
treeSort.fields = [new SortField("@id")];
xmlListColVar.sort = treeSort; //My XMLListCol tree data provider
xmlListColVar.refresh();
}
The sort doesnt do anything. The docs say sorting is supposed to be
done this way and I think the nested nature of the XML Document has
something to do with it.
I would appreciate any and all help, advice, and assistance I can get.
Thanks!
Shawn