Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 15th, 2008, 03:52 PM
Registered User
 
Join Date: Jul 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Horizontal Menubar using XSL and Java Script

I need to create a horizontal Menubar using XSL and or Java script from the following XML file.
<MenuList>
<parentMenu MenuName="ParentMenu1" MenuId="1">
       <Menu MenuName="Menu1" MenuId="8"></Menu>
       <Menu MenuName="Menu2" MenuId="10"></Menu>
</parentMenu>
<parentMenu MenuName="ParentMenu2" MenuId="3">
       <Menu MenuName="Menu1" MenuId="22"></Menu>
           <parentMenu MenuName="Menu2" menuId="24">
              <Menu MenuName="SubMenu1" MenuId="30"></Menu>
              <Menu MenuName="SubMenu2" MenuId="31"></Menu>
           </parentMenu>
       <Menu MenuName="Menu3" MenuId="25"></Menu>
       <Menu MenuName="Menu4" MenuId="26"></Menu>
</parentMenu>
<parentMenu MenuName="ParentMenu3" MenuId="4">
       <Menu MenuName="Menu1" MenuId="32"></Menu>
</parentMenu>
<parentMenu MenuName="ParentMenu4" MenuId="5">
       <parentMenu MenuName="Menu1" menuId="33">
          <Menu MenuName="SubMenu1" MenuId="44"></Menu>
          <Menu MenuName="SubMenu2" MenuId="45"></Menu>
       </parentMenu>
       <parentMenu MenuName="Menu2" menuId="34">
          <Menu MenuName="SubMenu1" MenuId="47"></Menu>
          <Menu MenuName="SubMenu2" MenuId="48"></Menu>
       </parentMenu>
       <Menu MenuName="Menu3" MenuId="35"></Menu>
       <parentMenu Mullname="Menu4" menuId="36">
          <Menu MenuName="SubMenu1" MenuId="50"></Menu>
          <Menu MenuName="SubMenu2" MenuId="51"></Menu>
          <parentMenu MenuName="SubMenu3" menuId="54">
             <Menu MenuName="SubSubMenu1" MenuId="57"></Menu>
             <Menu MenuName="SubSubMenu2" MenuId="58"></Menu>
          </parentMenu>
          <Menu MenuName="SubMenu4" MenuId="55"></Menu>
       </parentMenu>
       <Menu MenuName="Menu5" MenuId="37"></Menu>
       <parentMenu MenuName="Menu6" menuId="40">
          <Menu MenuName="SubMenu1" MenuId="63"></Menu>
          <Menu MenuName="SubMenu2" MenuId="64"></Menu>
       </parentMenu>
</parentMenu>
</MenuList>

I am new to XSL and totally stumped on this. I have created this xml from table structure using java but not sure how to display it properly. Any help would be greatly appreciated.

Thanks,
Alex
 
Old July 16th, 2008, 02:43 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

You have not told us what your desired output should look like, so we cannot help you use XSLT to transform it.

If you don't know what your desired output should look like then that is a question for a different forum (i.e. a HTML, javascript or DHTML forum).

/- Sam Judson : Wrox Technical Editor -/
 
Old July 16th, 2008, 03:09 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

>I am new to XSL and totally stumped on this.

As Sam says, it's a two step process:

(a) Decide what HTML you want to generate

(b) Write the XSLT code to generate this HTML

I suspect you're stuck on (a) - which means it isn't an XSLT problem, so that fact that you're new to XSLT is irrelevant.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASSIGNING A JAVA SCRIPT VARIABLE TO A XSL VARIABLE SOMANATHAN10 XSLT 1 February 21st, 2007 04:26 AM
How to assign xsl param with java script varaible Sanjay.Verma XSLT 1 November 21st, 2006 04:34 AM
how create menubar, menu, menu item in xsl vijayanmsc XSLT 1 June 5th, 2006 06:43 AM
Java vs Java Script functions joemorrison74 J2EE 0 July 6th, 2005 04:28 PM
transformNode with xsl:script sonicDace XSLT 8 November 26th, 2003 09:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.