Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 31st, 2012  |  syntax: None  |  size: 0.71 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Read Tree Menu Xml C#
  2. <TREE_MENU_NESTED>
  3.  <TREE>Category I
  4.      <TREE ACTION="URL" LINK="c1/p1.html" TARGET="_self" ICON="icon_slide" >Product 1</TREE>
  5.      <TREE ACTION="URL" LINK="c2/p2.html" TARGET="_self" ICON="icon_slide" >Product 2</TREE>
  6.  </TREE>
  7.  <TREE>Category II
  8.      <TREE ACTION="URL" LINK="c2/p1.html" TARGET="_self" ICON="icon_slide" >Product 1</TREE>
  9.      <TREE ACTION="URL" LINK="c2/p2.html" TARGET="_self" ICON="icon_slide" >Product 2</TREE>
  10.  </TREE>
  11.  </TREE_MENU_NESTED>
  12.        
  13. XElement doc = XElement.Parse("You XML text");
  14.  
  15. foreach (XElement treeNode in doc.Elements())
  16.     Console.WriteLine(treeNode.Value);
  17.        
  18. XElement xmlTree = XElement.Parse("<TREE_MENU_NESTED>... ");
  19. Console.WriteLine(xmlTree);