Solved

xml dropdown menus

Posted on 2004-10-28
177 Views
Last Modified: 2006-11-17
hI GUYS,

I desparately need to create an xml drop down menu currectly it drops down but how do i create a sub menu e.g

file
 |-----add( i hav acheived this)
          |----------------xyz(how do i acheive this)

pls help with some code examples, i have been trying all day. thanks

so far this is xml code

<?xml version="1.0"?>
<TOPICLIST TYPE="MenuItems">
<TOPICS TYPE="Employees">
  <TOPIC>
    <TITLE>Add</TITLE>
    <URL>Admin.aspx</URL>
  </TOPIC>
  <TOPIC>
    <TITLE>Edit</TITLE>
    <URL>AminEdit.aspx</URL>
      </TOPIC>
  <TOPIC>
    <TITLE>Search</TITLE>
    <URL>AminEdit.aspx</URL>
   
     </TOPIC>
 
   
 
  </TOPICS>

<TOPICS TYPE="Clients">
  <TOPIC>
    <TITLE>Clients</TITLE>
    <URL>#</URL>
  </TOPIC>
  <TOPIC>
    <TITLE>Matter</TITLE>
    <URL>#</URL>
  </TOPIC>
  <TOPIC>
    <TITLE>TaskCodes</TITLE>
    <URL>#</URL>
  </TOPIC>
</TOPICS>

<TOPICS TYPE="Receipts">
<TOPIC>
    <TITLE>ReceiptTypes</TITLE>
    <URL>#</URL>
      </TOPIC>
      <TOPIC>
    <TITLE>Expenses</TITLE>
    <URL>#</URL>
      </TOPIC>


  <TOPICS TYPE="Suppliers">
    <TOPIC>
      <TITLE>Add</TITLE>
      <URL>#</URL>
    </TOPIC>
    <TOPIC>
      <TITLE>Edit</TITLE>
      <URL>#</URL>
    </TOPIC>
    <TOPIC>
      <TITLE>Exit</TITLE>
      <URL>#</URL>
    </TOPIC>
  </TOPICS>

  <TOPICS TYPE="User Access &amp; Security">
    <TOPIC>
      <TITLE>Groups</TITLE>
      <URL>#</URL>
    </TOPIC>
    <TOPIC>
      <TITLE>Groups Approvers</TITLE>
      <URL>#</URL>
    </TOPIC>
    <TOPIC>
      <TITLE>Group Type</TITLE>
      <URL>#</URL>
    </TOPIC>
      </TOPICS>
 <TOPICS TYPE="System Administration">
    <TOPIC>
      <TITLE>System Params</TITLE>
      <URL>#</URL>
    </TOPIC>
    <TOPIC>
      <TITLE>Country</TITLE>
      <URL>#</URL>
    </TOPIC>
    <TOPIC>
      <TITLE>Currency</TITLE>
      <URL>#</URL>
    </TOPIC>
   
  </TOPICS>
 
   </TOPICS>

</TOPICLIST>


and this is the xsl code

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
  <!-- BUILD MENU BAR -->

  <DIV ID="divMenuBar">
  <TABLE ID="tblMenuBar" BORDER="0">
  <TR>
  <xsl:for-each select="//TOPICS[TOPIC]">
    <TD CLASS="clsMenuBarItem"><xsl:attribute name="ID">tdMenuBarItem<xsl:value-of select="@TYPE" /></xsl:attribute>
      <xsl:value-of select="@TYPE" /></TD>
   <xsl:if test="position()!=last()">
      <TD>|</TD>
   </xsl:if>
  </xsl:for-each>
  </TR>
  </TABLE>
  </DIV>

  <!-- BUILD INDIVIDUAL MENUS -->

  <xsl:for-each select="//TOPICS[TOPIC]">
    <DIV CLASS="clsMenu">
    <xsl:attribute name="ID">divMenu<xsl:value-of select="@TYPE" /></xsl:attribute>
      <DIV CLASS="clsMenuSpacer"></DIV>
      <xsl:for-each select="TOPIC">
      <DIV>
      <A>
        <xsl:attribute name="HREF"><xsl:value-of select="URL" />
        </xsl:attribute>
        <xsl:value-of select="TITLE" />
      </A>
      </DIV>
       <DIV>
      <A>
        <xsl:attribute name="HREF"><xsl:value-of select="URL" />
        </xsl:attribute>
        <xsl:value-of select="SUB" />
      </A>
      </DIV>
      </xsl:for-each>
    </DIV>
  </xsl:for-each>

</xsl:template>

</xsl:stylesheet>




0
Question by:SirReadAlot
    6 Comments
     

    Author Comment

    by:SirReadAlot
    anyone??
    0
     

    Author Comment

    by:SirReadAlot
    can anyone give me some tips
    0
     
    LVL 8

    Expert Comment

    by:a_twixt_in_the_tale
    0
     
    LVL 8

    Accepted Solution

    by:
    0
     

    Author Comment

    by:SirReadAlot
    no item demo?
    0
     

    Author Comment

    by:SirReadAlot
    tHANKS for the link
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    The Complete Ruby on Rails Developer Course

    Ruby on Rails is one of the most popular web development frameworks, and a useful tool used by both startups and more established companies to build strong graphic user interfaces, and responsive websites and apps.

    The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
    The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    884 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

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now