Build MenusTransform in REXSEL.

Constructs the menu panel and the various drop down menus.

// -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* // -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* // // Page to XHTML Transform: Build Menu Panel // // Author: // Name : Hugh Field-Richards // Email : hsfr@hsfr.org.uk // // Copyright 2009 - 2024 Hugh Field-Richards. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* // -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* stylesheet { version "1.0" xmlns "page" "http://www.hsfr.org.uk/Schema/Page" xmlns "graphic" "http://www.hsfr.org.uk/Schema/Graphic" xmlns "a" "http://relaxng.org/ns/annotation/1.0" xmlns "xhtml" "http://www.w3.org/1999/xhtml" xmlns "list" "http://www.hsfr.org.uk/Schema/List" xmlns "link" "http://www.hsfr.org.uk/Schema/Link" xmlns "text" "http://www.hsfr.org.uk/Schema/Text" xmlns "news" "http://www.hsfr.org.uk/Schema/News" xmlns "email" "http://www.hsfr.org.uk/Schema/Email" xmlns “paloose” “http://www.paloose.org/schemas/Paloose/1.0" // -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* // // Create panel within which the menu sits. function buildMenusPanel.menusPanel { element "div" { attribute "id" "menu" element "nav" { apply-templates using "//menus//list:list[@id = 'nav-menu']" scope "menus" } } } // -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* // // Top level menu items. match using "//menus//list:list[@id = 'nav-menu']" scope "menus" { element "ul" { attribute "class" "dropdown" apply-templates scope "topMenus" } } match using "list:item" scope "topMenus" { element "li" { apply-templates scope "topMenuItem" } } match using "link:link" scope "topMenuItem" { element "a" { attribute "href" { value "@ref" } attribute "class" "hide" value "." } } // -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* // // Sub-menu items. match using "list:list" scope "topMenuItem" { element "ul" { attribute "class" "subMenuType" apply-templates scope "subMenus" } } match using "list:item" scope "subMenus" { element "li" { apply-templates scope "subMenusItem" } } match using "link:link" scope "subMenusItem" { element "a" { attribute "href" { value "@ref" } value "." } } // -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* // // Sub-sub-menu items. match using "list:list" scope "subMenusItem" { element "ul" { attribute "class" "subsubMenuType" apply-templates scope "subsubMenus" } } match using "list:item" scope "subsubMenus" { element "li" { apply-templates scope "subsubMenusItem" } } match using "link:link" scope "subsubMenusItem" { element "a" { attribute "href" { value "@ref" } value "." } } }
Copyright 2006 – 2024 Hugh Field-Richards. All Rights Reserved.