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

Generating HTML <link> navigation

Subject: Generating HTML <link> navigation
From: "Mario Caprino" <mariocaprino@xxxxxxxxxxx>
Date: Thu, 21 Oct 2004 15:27:14 +0200
xsl link href
Hi,

I am trying to fill the HTML <link rel="next"> and <link rel="prev"> with content through XSLT.
I have a xml document that contains the sorted sequence of the pages. It looks like this;
...
<li id="tinnsoldaten" href="tinnsoldaten.html">The Steadfast Tin Soldier</li>
<li id="klatremusiknipe" href="klatremusiknipe.html">Vole in Trouble</li>
<li id="kariusogbaktus" href="kariusogbaktus.html">Karius and Baktus</li>
<li id="veslefrikk" href="veslefrikk.html">Little Freddy and his Fiddle</li>
...


When processing the the page with the id="klatremusiknipe" I want to fill the link elements like follows;
<link href="tinnsoldaten.html" rel="prev" />
<link href="kariusogbaktus" rel="next" />
... as "tinnsoldaten" is the page listed before the current and "kariusogbaktus" is the one listed just after.


The way I believe I need to go about this is first find the <li> element that has the same id as the page I am processing. Then print out the href attribute of the preceding and following sibling. Sadly my understanding of writing xpath expressions using these axis are weak.

I currently have the following none working solution;

$html-head-link-id= id of the current page being processed
$id-submenu-list= the sorted list of pages described above

These are the expressions that against my will validate to nothing when run...
<xsl:variable name="html-head-link-next" select="$id-submenu-list/following-sibling::li[@id=$html-head-link-id][1]" />
<xsl:variable name="html-head-link-prev" select="$id-submenu-list/preceding-sibling::li[@id=$html-head-link-id][1]" />


Any suggestions to what the correct xpath syntax would be for this case is highly appreciated.
Thank you.


Best regards,
Mario Caprino

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


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.