PHP Classes

File: rsd.xsl

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Luis I. Larrateguy  >  XML Menu  >  rsd.xsl  >  Download  
File: rsd.xsl
Role: Auxiliary data
Content type: text/plain
Description: the menu presentation
Class: XML Menu
Generate hierarchic menu defined in XML using XSLT
Author: By
Last change: New definitions of the XSL for showing on Mozilla.
Improve the code
Date: 11 years ago
Size: 2,845 bytes


Class file image Download
<?xml version="1.0" encoding="ISO-8859-1" ?>
/* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 * Copyright (C) 2003-2004 Luis I. Larrateguy <>
 *     This file is part of XMLMenu
 *  Foobar is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  any later version.
 *  XMLMenu is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  GNU General Public License for more details.
 *  You should have received a copy of the GNU General Public License
 *  along with Foobar; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 * @version 0.7.0
 * @copyright 2004 
<xsl:stylesheet version="1.0" xmlns:xsl="">

<xsl:template match="RSD">

<xsl:template match="mainmenu">
	<div id="{generate-id()}" style="width:{@w};z-index:{count(ancestor::node())};" class="mainmenu">
		<div><xsl:value-of select="@text"></xsl:value-of></div>
		<xsl:param name="parentid">generate-id()</xsl:param>
		<xsl:apply-templates select="menuitem">
				<xsl:with-param name="parentid" select="generate-id()" />

<xsl:template match="submenu">
		<div id="{generate-id()}" style="width:{@w};z-index:{count(ancestor::node())};" class="menu" onMouseOver="show('','{generate-id()}', '');" onMouseOut="hide('{generate-id()}');">
			<xsl:value-of select="@text"></xsl:value-of>
			<xsl:param name="parentid">generate-id()</xsl:param>
			<xsl:apply-templates select="menuitem">
					<xsl:with-param name="parentid"  select="generate-id()" />

<xsl:template match="menuitem">
		<xsl:when test="submenu = ''">
				<div id="{generate-id()}" style="" class="menuitem">
					<a href="{@link}"><xsl:value-of select="@text"/></a>
			<xsl:apply-templates />
				<xsl:param name="parentid" />
				<xsl:param name="deftop" select="generate-id()" />
				<div id="{generate-id()}" class="menuitem" onMouseOver="show('{$parentid}','{generate-id(submenu)}','{$deftop}');" onMouseOut="hide('{generate-id(submenu)}');">
					<a href="{@link}"><xsl:value-of select="@text"/> ...</a>
				<xsl:apply-templates select="submenu"/>