View Single Post
  #1 (permalink)  
Old June 22nd, 2009, 09:08 AM
sdagger sdagger is offline
Authorized User
Points: 49, Level: 1
Points: 49, Level: 1 Points: 49, Level: 1 Points: 49, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2008
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default General XSLT query

Hi

I am completely new to XML and XSL and now using an application call site publisher by Teamsite interwoven. I have managed to understand some basic XSL concepts but struggling with a problem I cannot seem to get my head round.

The left navigation from our site pulls in the links from a sitemap file which works great. The left nav has 3 levels of navigation and I am trying to create a simple xsl component to a content page which also reads in the site map links but what I am trying to do is:

Say I have 3 main links and 3 sublinks

Level one
Level one a
Level one b
Level one c
Level two
Level two a

etc. Whilst in level one, I have a link in the main content of the page at the footer with a link to level one a and so on. When I am on page level one c, I want the footer link to not to goto level two but to a seperate page.

So I would like to loop through the links and determine the page i'm on using a current page variable and do a comparison. When I get the match, I would like to check to see if there is a link after this, if so, show the next page link url, otherwise, goto a generic page (ie, hardcoded link).

Sorry if a bit vague but tried to explain in english.

Some code I have is:
<!-- get current page -->
<xsl:variable name "currpage">
<xsl:value-of select="/pagelocation/page_info/@pagename">
</xsl:variable>

Then to loop through the sitemap (3 altogher - one loop for each level of sitemap:-

<xsl:for-each select = "node[@visible-in-sitemap='true']">
Do some code in here. Currently just display value-of select="link/value"
</xsl:for-each>

Thank you to anyone who can help me. Maybe there is some easy syntax to do this but I do not know XSL much at all.
Reply With Quote