How do I get a Flex tree to display only specific XML nodes?
A sample of the XML data is below. Only the Grouper and Product elements should be displayed as branch and leaf nodes respectively; the Name elements should not be displayed. I can't use XSL or e4x to modify the XML as the Name elements' text is used as the label for the Grouper and Product tree nodes. Also, I cannot move the Name element to be an attribute as it needs to include a CDATA section.
It looks like using a custom TreeDataDescriptor is the way forward but I cannot find any examples of using one with XML.
Any advice appreciated.
Thanks,
Al H.
<Grouper Type="ProductHeading" Id="" icon="drugIcon">
<Name>ASPAV</Name>
<Product Id="1002081" icon="genericIcon">
<Name>ASPAV dispersible tablet</Name>
</Product>
</Grouper>
<Grouper Type="ProductHeading" Id="" icon="drugIcon">
<Name>ASPELLIN</Name>
<Product Id="1005755" icon="genericIcon">
<Name>ASPELLIN liniment</Name>
</Product>
</Grouper>