SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : Dynamic HTML :

Previous DiscussionNext Discussion
 An actual, real discussion! -- an XML menu...
Ok, here's what I'm looking to do.

Let's say I have an XML file that looks like this (excerpt):


<menu>
<item>Menu Item 1
<sub_item_1>Sub 1</sub_item_1>
<sub_item_2>Sub 2</sub_item_2>
<sub_item_3>Sub 3</sub_item_3>
</item>
<item>Menu Item 2</item>
<item>Menu Item 3
<sub_item_1>Sub 1
<sub_sub_item_1>Sub Sub 1</sub_sub_item_1>
<sub_sub_item_3>Sub Sub 2</sub_sub_item_2>
<sub_sub_item_3>Sub Sub 3</sub_sub_item_3>
</sub_item_1>
<sub_item_2>Sub 2</sub_item_2>
<sub_item_3>Sub 3</sub_item_3>
</item>
</menu>


Now, what I want to do is take this menu, and make it a vertical, multi-level menu.

I want to do this client-side (without a server-side language). I know how to load the XML, but I can't quite figure out how to traverse the menu and get the results I want.

What I'm looking for is your classic "file menu" functionality.

I've seen some very vague, very incomplete examples. I don't usually work with XML much, so that's why I'm asking here.

On Google, it turns up some stuff, but nothing like what I'm looking for.

Started By Monte on May 22, 2009 at 10:41:28 AM

9 Response(s) | Reply

View All Replies | Goto Page: 2 1
Monte on May 25, 2009 at 6:49:51 AM

"Data (DOM-) centric: Traverse (the whole) XML menu data using DOM-methods (like getFirstChild, getNextSibling, getWhateverNode).
More function centric: Selectively pull nodes from the XML menu data using XPath expressions."

Either of these would work, MHenke. I'm just not sure exactly how to do it. Could you point me to an example on the web?


View All Replies | Goto Page: 2 1

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2000 InsideDHTML.com, LLC. All rights reserved.