xsl-list
[Top] [All Lists]

Re: Previous/Next element

2003-07-09 16:36:13
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(_at_)mulberrytech(_dot_)com
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



<Prev in Thread] Current Thread [Next in Thread>