RE: [xsl] Previous/Next element

Subject: RE: [xsl] Previous/Next element
From: "Conal Tuohy" <conalt@xxxxxxxxxxxxxxx>
Date: Thu, 10 Jul 2003 10:37:49 +1200
Hi James. I think I see your problem:

You have:
<a href="{concat('#', $ms, '.', preceding-sibling::*/@code)}">Prev</a>

The expression "preceding-sibling::*/@code" returns the @code attributes of
all preceding sibling elements of the current node, right? Not just the
immediately preceding sibling. Then by implicitly converting this to a
string you are accessing the FIRST such node, in document order (when you
want the last). Try this instead:


This finds the FIRST preceding sibling (in REVERSE order, because the
preceding-sibling axis is a reverse axis), and then returns ITS code

There's a detailed explanation here:



 XSL-List info and archive:

Current Thread