[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Site Navigation - XML/XSL Menu

Subject: Site Navigation - XML/XSL Menu
From: "Bjorn Aune" <fortgjort@xxxxxxx>
Date: Wed, 25 Feb 2004 09:29:09 +0100
xml xsl menu
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.

The current active PageID is added as a xsl parameter from an asp script.

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

_________________________________________________________________
MSN Messenger http://www.msn.no/computing/messenger Den raskeste veien mellom deg og dine venner



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.