Hi,
Lets consider an XML as tree of nodes. Let me explain u the meaning of
"id". My sample XML string look like:
<node> <!--First Level -->
<node id="1" name="A" code="1"> <!--Second Level -->
<node id="2" name="A-1" code="1-1"/> <!--Third Level -->
<node id="3" name="A-2" code="1-2">
<node id="4" name="A-2-1" code="1-2-1"/> <!--
Fourth Level-->
<node id="5" name="A-2-2" code="1-2-2"/>.
.
</node>
</node>
<!-- & So on--->
</node>
Here my each XML node has unique Id attribute.
Now suppose I create a tree with this XML & i click on any node. For the
selected node, say node with id="5", i can find out the value of "id"
attribute of selected node & save this in session object. Means now i
have idea about which node i selected.
Now suppose , i create two children for selected node i.e for node with
id="5". So my XML changes somewhat like below:
<node> <!--First Level -->
<node id="1" name="A" code="1"> <!--Second Level -->
<node id="2" name="A-1" code="1-1"/> <!--Third Level -->
<node id="3" name="A-2" code="1-2">
<node id="4" name="A-2-1" code="1-2-1"/> <!--
Fourth Level-->
<node id="5" name="A-2-2" code="1-2-2"/>.
<node id="100" name="A-2-2-1"
code="1-2-2-1"/> < !-- Level 5th--->
<node id="101" name="A-2-2-2"
code="1-2-2-2"/> .
</node>
</node>
<!-- & So on--->
</node>
So my dataProvider changes & tree gets collapsed.
As we have already stored the id attribte value of selected node in
session. Now we can iterate over XMLListCollection to find the XML node
with that particular id value.
& Now i use expandItem() method & selectedItem property, providing
selected node. But none of these things works.
Thanks & Regards,
Baljeet