Convert XML to be used in asp:menu using XSLT

juwqj209

New Member
We have a current system with a menu XML file which is in the following format:\[code\]<?xml version="1.0" encoding="UTF-8"?><Menu><item name="A" value="http://stackoverflow.com/questions/15733959/Red Apple" /><item name="B" value="http://stackoverflow.com/questions/15733959/Black Board" /><item name="B" value="http://stackoverflow.com/questions/15733959/Blue Earth" /></Menu>\[/code\]asp:menu\[code\]<asp:Menu ID="MenuControl" runat="server" Orientation="Horizontal" ><DataBindings><asp:MenuItemBinding TextField="MenuText" ToolTipField="tooltip" NavigateUrlField="destUrl" /></DataBindings></asp:Menu>\[/code\]In order to bind this data to asp:menu, the result should be in the following format:\[code\]<?xml version="1.0" encoding="UTF-8"?><MenuItems> <MenuItem MenuText="A" tooltip="A" destUrl=""> <MenuItem MenuText="Red Apple" tooltip="Red Apple" destUrl="~/RedApple.aspx" /> </MenuItem> <MenuItem MenuText="B" tooltip="B" destUrl=""> <MenuItem MenuText="Black Board" tooltip="Black Board" destUrl="~/BlackBoard.aspx" /> <MenuItem MenuText="Blue Earth" tooltip="Blue Earth" destUrl="~/BlueEarth.aspx" /> </MenuItem></MenuItems>\[/code\]XSLT seems to be logical choice. Does anyone know how to do it using XSLT?
 
Back
Top