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 February 24th, 2004, 10:59 AM
Registered User
 
Join Date: Aug 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Site navigation

Im trying to make dynamic site navigation (multi-depth) with xsl, but are having some problems. The xml source is generated adPersistXML from a sql database as follows:

<xml>
<s:schema>
......
</s:schema>
<rs:data>
  <z:row PageID="1000" ParentID="0" MenuOrder="1" MenuLabel="Frontpage" />
  <z:row PageID="1001" ParentID="1000" MenuOrder="1" MenuLabel="Products" />
  <z:row PageID="1004" ParentID="1000" MenuOrder="2" MenuLabel="Contact" />
  <z:row PageID="1005" ParentID="1000" MenuOrder="3" MenuLabel="About" />
  <z:row PageID="1003" ParentID="1001" MenuOrder="1" MenuLabel="Car" />
  <z:row PageID="1002" ParentID="1001" MenuOrder="2" MenuLabel="House" />
  <z:row PageID="1008" ParentID="1002" MenuOrder="1" MenuLabel="House 1" />
  <z:row PageID="1009" ParentID="1002" MenuOrder="2" MenuLabel="House 2" />
  <z:row PageID="1006" ParentID="1003" MenuOrder="1" MenuLabel="Car 1" />
  <z:row PageID="1007" ParentID="1003" MenuOrder="2" MenuLabel="Car 2" />
</rs:data>
</xml>

As u can see it do not have the depth of the page stored in the database, so I want to determine the depth with xsl at the same time that I display the data.

Lets say that the current PageID is 1006 (Car 1) I want the XSL or rather HTML output to be like this

Products
  Car
  * Car 1
    Car 2
  House
Contact
About

The MenuOrder determines the siblings order.

To be able to do this I think I would have to determine the depth of the pages and also do a check if page is active or open. In this example the page "Car" (PageID=1003) is open, but not active. The children of the page "House" (PageID=1002) is not visible since its not open.

Each page therefore must be stored in a <div> with a css style class attribute, like class="Level2Open1Active1". The values in the classname should be dynamically produced by parameters from the xsl.

I hope there is someone out there that could help me with this one.
Thanx in advance!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Site Navigation aspcoder BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 14 May 24th, 2008 05:40 PM
navigation in a web site..... mallikalapati ASP.NET 2.0 Professional 3 February 11th, 2008 12:06 PM
how to add breadcrumb navigation to a LAMP site avail1now PHP How-To 0 February 17th, 2006 05:03 PM
how do i change the site icon on a geocitiies site uprocker2 HTML Code Clinic 2 March 4th, 2005 07:20 AM
Site navigation stu9820 ASP.NET 1.0 and 1.1 Basics 7 December 1st, 2003 06:03 PM





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