Subject: Re: [xsl] Retrieving top section from a navigation tree From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 27 Oct 2004 13:17:54 -0400 |
I have a navigation tree and would like to find out which main navigation section I am located underneath when i have the unique id of the page I am viewing.
Here's an example tree; <xsl:variable name="ul"> <ul id="menu"> <li id="1">one</li> <li id="2">two <ul> <li id="2-1">two-one</li> <li id="2-2">two-two <ul> <li id="2-2-1">two-two-one</li> </ul> </li> </ul> </li> <li id="3">three</li> </ul> </xsl:variable>
<xsl:variable name="id" select=="'2-2-1'" />
Say I am viewing the page "2-2-1", I would now like to write an xpath expression that retrieves the name (text element) of the containing top li element. In this case the name would be "two".
I have tried to look at the problem from differen perspectives;
- one is to find the top <li> elements and filter out any that does not contain an <li> element that matches the page $id
- the other is to find the <li> element with the specific @id, and traverse outwards to find the containing top <li> element
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Retrieving top section fr, David Carlisle | Thread | Re: [xsl] Retrieving top section fr, Dimtre Novatchev |
[xsl] General FO Implementation Fea, W. Eliot Kimber | Date | Re: [xsl] Changing tag text, Gary Hegenbart |
Month |