Re: [xsl] Previous/Next element

Subject: Re: [xsl] Previous/Next element
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 09 Jul 2003 19:36:13 -0400
James,

As it happens, someone else had exactly this same problem earlier today.

When you say
<span class="prev"> <a href="{concat('#', $ms, '.', preceding-sibling::*/@code)}">Prev</a>


The expression "preceding-sibling::*/@code" is evaluated and converted into a string, as it must be in order to be concatenated.

The string value of a set of nodes is the value of the first of the set in document order. That's why your link always goes back to the first one of your preceding siblings.

You want "preceding-sibling::*[1]/@code". Or "(preceding-sibling::*/@code)[last()]" would also do.

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 ======================================================================


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread