whitesox99
MIS
Hi,
Need some help in parsing the following xml. I am trying build an hierarchical menu from the xml. Thr hierarchy can go to x-level deep.
Any help is appreciated.
Thanks
Need some help in parsing the following xml. I am trying build an hierarchical menu from the xml. Thr hierarchy can go to x-level deep.
Code:
<?xml version="1.0" encoding="windows-1252" ?>
<Menus>
<Menu>
<MenuID>1</MenuID>
<MenuName>File</MenuName>
<ParentID/>
<NumChild>3</NumChild>
<Menu>
<MenuID>12</MenuID>
<MenuName>Open</MenuName>
<ParentID>1</ParentID>
<NumChild>0</NumChild>
</Menu>
<Menu>
<MenuID>11</MenuID>
<MenuName>New</MenuName>
<ParentID>1</ParentID>
<NumChild>2</NumChild>
<Menu>
<MenuID>21</MenuID>
<MenuName>Program</MenuName>
<ParentID>11</ParentID>
<NumChild>1</NumChild>
<Menu>
<MenuID>31</MenuID>
<MenuName>Blank</MenuName>
<ParentID>21</ParentID>
<NumChild>0</NumChild>
</Menu>
</Menu>
<Menu>
<MenuID>61</MenuID>
<MenuName>Program2</MenuName>
<ParentID>11</ParentID>
<NumChild>0</NumChild>
</Menu>
</Menu>
<Menu>
<MenuID>5</MenuID>
<MenuName>Win</MenuName>
<ParentID>1</ParentID>
<NumChild>0</NumChild>
</Menu>
</Menu>
<Menu>
<MenuID>2</MenuID>
<MenuName>View</MenuName>
<ParentID/>
<NumChild>1</NumChild>
<Menu>
<MenuID>22</MenuID>
<MenuName>Printer</MenuName>
<ParentID>2</ParentID>
<NumChild>0</NumChild>
</Menu>
</Menu>
<Menu>
<MenuID>3</MenuID>
<MenuName>Doc</MenuName>
<ParentID/>
<NumChild>0</NumChild>
</Menu>
<Menu>
<MenuID>4</MenuID>
<MenuName>Tools</MenuName>
<ParentID/>
<NumChild>0</NumChild>
</Menu>
</Menus>
Any help is appreciated.
Thanks