
Untitled
By: a guest on
Jul 31st, 2012 | syntax:
None | size: 0.71 KB | hits: 13 | expires: Never
Read Tree Menu Xml C#
<TREE_MENU_NESTED>
<TREE>Category I
<TREE ACTION="URL" LINK="c1/p1.html" TARGET="_self" ICON="icon_slide" >Product 1</TREE>
<TREE ACTION="URL" LINK="c2/p2.html" TARGET="_self" ICON="icon_slide" >Product 2</TREE>
</TREE>
<TREE>Category II
<TREE ACTION="URL" LINK="c2/p1.html" TARGET="_self" ICON="icon_slide" >Product 1</TREE>
<TREE ACTION="URL" LINK="c2/p2.html" TARGET="_self" ICON="icon_slide" >Product 2</TREE>
</TREE>
</TREE_MENU_NESTED>
XElement doc = XElement.Parse("You XML text");
foreach (XElement treeNode in doc.Elements())
Console.WriteLine(treeNode.Value);
XElement xmlTree = XElement.Parse("<TREE_MENU_NESTED>... ");
Console.WriteLine(xmlTree);