I'm trying to use getElementsByTagName api in w3c.Element. My XML structure is as:
<menu>
<name>name1</name>
<code>code1</code>
<menu> -----------------menus can have children.. so submenus
<name>name1-1</name>
<code>code1-1</code>
</menu>
<menu> -----------------menus can have children.. so submenus
<name>name1-1</name>
<code>code1-1</code>
</menu>
</menu>
so menus can have children and also be in the same level.. when i use
getElementsByTagName("menu
") it retrieves the complete list of menus but not just the menus that have tag name as menu in the immediate next level.. but all levels.. which is why i cant use recursion to copy my whole menu xml to a tree based objects.. can anyone throw some ideas around this..
Start Free Trial