Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: xml description
zaky
Newbie

Posts: 1
Registered: 9/5/2003
Member Is Offline
posted on 9/5/2003 at 03:19 PM Reply With Quote
xml description


Donno if there is someone interested abt this but i needed a a xml description of the menus ....
So i did it :
<?xml version="1.0" encoding="iso-8859-1"?>
<menubar>
<menuitem text="Menu0" link="link.html" icon="ic.gif">
<menuitem text="Menu00" link="link.html" icon="ic.gif"/>
<menuitem text="Menu01" link="link.html" icon="ic.gif">
<menuitem text="Menu010" link="link.html" icon="ic.gif"/>
</menuitem>
</menuitem>
<menuitem text="Menu1" link="link.html" icon="ic.gif"/>
<menuitem text="Menu2" link="link.html" icon="ic.gif">
<menuitem text="Menu20" link="link.html" icon="ic.gif"/>
<menuitem text="Menu21" link="link.html" icon="ic.gif"/>
</menuitem>
<menuitem text="Menu3" link="link.html" icon="ic.gif"/>
</menubar>
and i parsed this with xslt to transforem it in javascript structure:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:variable name="path"></xsl:variable>
<xsl:template match="/">
var MENU_ITEMS =[
<xsl:apply-templates mode="mi"/>]
</xsl:template>
<xsl:template match="//menuitem" mode="mi">
<xsl:text>[&quot;</xsl:text>
<xsl:if test="@icon!=''">
<xsl:text>&lt;img src='</xsl:text>
<xsl:value-of select="concat($path,@icon)"/>
<xsl:text>' border='0' align='left' /&gt;</xsl:text>
</xsl:if>
<xsl:value-of select="@text"/>
<xsl:text>&quot;,&quot;</xsl:text>
<xsl:value-of select="@link"/>
<xsl:text>&quot;,{&quot;tw&quot;:&quot;_self&quot;}</xsl:text>
<xsl:if test="count(*)>0">
<xsl:text>,
</xsl:text>
<xsl:apply-templates mode="mi"/>
</xsl:if>
<xsl:text>],
</xsl:text>
</xsl:template>
</xsl:stylesheet>
I hope it is useful for someone for me was... :)
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page Tigra Menu
Product Demonstrations Live Demos:
Traditional Blue
White Steps
Inner HTML
All Together
Frames Targeting
Free Download Free Download
Free Download Menu Builders
Online Builder
Builder for Windows
Product Documentation Documentation:
Documenation Page
Change Log
Menus Comparison Table
Support Forum Support Forum
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004