Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

general xsl query

Status
Not open for further replies.

sdagger2

Programmer
May 5, 2008
39
GB
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top