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

RE: Previous/Next element

Subject: RE: Previous/Next element
From: "Conal Tuohy" <conalt@xxxxxxxxxxxxxxx>
Date: Thu, 10 Jul 2003 10:37:49 +1200
xsl previous element
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:

preceding-sibling::*[1]/@code

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

There's a detailed explanation here:
http://www.dpawson.co.uk/xsl/sect2/N1641.html#d1950e19

Cheers!

Con


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


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.