[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Site Navigation - XML/XSL Menu


Subject: [xsl] Site Navigation - XML/XSL Menu
From: "Bjorn Aune" <fortgjort@xxxxxxx>
Date: Wed, 25 Feb 2004 09:29:09 +0100

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
Keywords