Link to home
Start Free TrialLog in
Avatar of smacca
smaccaFlag for Australia

asked on

How to recursively get parent nodes until top of tree is reached?

I have the following XML as example:


<Menu Name="home" Text="Home" NavigateUrl="/tmc" Visible="True" >
     <Menu Name="sites" Text="Control Sites" NavigateUrl="/tmc/sites.aspx" PageTitle="Monitor Control Sites" Visible="True">          
          <Menu Name="br" Text="Brisbane" NavigateUrl="locations.aspx?site=br" Visible="True">

                             ....this can keep going 'n' levels deeper
          </Menu>
    </Menu>
</Menu>

Now, if I was in the deepest child node in the tree (for example sake), how can I recursively navigate to each parent node (ie parent of current, parent of current, parent of current and so on).

Cheers.


ASKER CERTIFIED SOLUTION
Avatar of b1xml2
b1xml2
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial