Internet Handholding posted on April 12, 2011 11:30

If you are using an Asp.net menu control with an Xml file, you may have a problem in that the root node is displayed.
For example, if your Xml file looks like this:
<Menu>
<Item name="Item 1">
<Item name="Item 1 1" />
<Item name="Item 1 2" />
</Item>
<Item name="Item 2">
<Item name="Item 2 1" />
<Item name="Item 2 2" />
</Item>
</Menu>
Your Asp.net menu control might display this:
Menu
Item 1
Item 1 1
Item 1 2
Item 2
Item 2 1
Item 2 2
But, you do not want the word Menu displayed first. What you want is this:
Item 1
Item 1 1
Item 1 2
Item 2
Item 2 1
Item 2 2
The way to eliminate the word Menu is to specify an Xpath attribute so only the Items are returned from the Xml file, like this:
<asp:XmlDataSource
XPath="Menu/Item"