Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do you create nested navigation with XML?

Posted on 2010-08-24
5
Medium Priority
?
414 Views
Last Modified: 2012-05-10
I am new to XML and I need to create a simple left navigation bar that is nested, but I can't seem to get it to work.  I have attached my incomplete code, but I'm not sure if you need anything else.  I need this as soon as possible please!
<?xml version="1.0" encoding="utf-8" ?> 
- <navigation>
- <elements>
- <navigation>
  <name>Info</name> 
- <elements>
- <page>
  <name>Overview</name> 
  <uri>${LINK}</uri> 
  </page>
- <navigation>
<!--Start sub menu-->
  <name>Sub Menu Title</name> 
- <elements>
- <link>
  <name>Sub Menu Link 1</name> 
  <href>http://www.link.com</href> 
  <target>_new</target> 
  </link>
- <link>
  <name>Sub Menu Link 2</name> 
  <href>http://www.link.com</href> 
  <target>_new</target> 
  </link>
- <link>
  <name>Sub Menu Link 3</name> 
  <href>http://www.link.com</href> 
  <target>_new</target> 
  </link>
  </elements>
  </navigation>
 <!--end sub menu--> 
- <link>
  <name>Menu Link</name> 
  <href>http://www.link.com</href> 
  <target>_new</target> 
  </link>
- <link>
  <name>Website</name> 
  <href>http://www.link.com</href> 
  <target>_new</target> 
  </link>
- <link>
  <name>Stories</name> 
  <href>http://www.link.com</href> 
  <target>_new</target> 
  </link>
  </elements>
  <displayMode>ONE_COLUMN</displayMode> 
  </navigation>

Open in new window

0
Comment
Question by:lhedgecoth
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 21

Expert Comment

by:MogalManic
ID: 33521742
XML is just data!  What language are you using to transform this into a menu?  XSLT?  ASP.Net?  Java?   Perl?  Python?
0
 

Author Comment

by:lhedgecoth
ID: 33522080
Sorry, like I said I'm new to this....we are using the xml navigation in Alfresco and I believe it uses JSP.  I hope that's what you needed to know.
0
 
LVL 3

Accepted Solution

by:
ahll earned 2000 total points
ID: 33570379
Well,

What you attached is not "your code", its basically the menu structure. You need to "decrypt" this and convert it to actual links or buttons to create your menu in a user friendly way.
In order to do this you need to use one of the programming languages(JSP in your case). The algorithm is pretty straight forward, just loop through all the XML file and look for the <link> node, then start building your link with the properties inside the node.
The loop would run till there is no more <link> nodes left.
0
 

Author Closing Comment

by:lhedgecoth
ID: 33576885
Thank you for your explanation, I really appreciate it!
0
 
LVL 3

Expert Comment

by:ahll
ID: 33576899
Glad it helped. Thanks for the point and good luck!.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question