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

following and preceding

Subject: following and preceding
From: Meltem Kogelbauer <meltem.kogelbauer@xxxxxxxxxxxxxxxxxx>
Date: Mon, 13 Aug 2001 09:12:09 +0100
following or preceding
Hi all

I have the following xml (simplified) document
<div>
	<id>23</id>
</div>
<accounts>
<element>
	<id>1</id>
</element>
<element>
	<id>2</id>
</element>
<element>
	<id>3</id>
</element>
<element>
	<id>4</id>
</element>
</accounts>
I am looping through the <element> nodes and retreving data from <id> as
well as some others at the same level. I need to pass the id's to the url as
the current id, previous id and the next id. So it follows like
<xsl:for-each select="element">
	<a
href="url&amp;currentid={id}&amp;previousid={preceding::id}&amp;nextid={foll
owing::id}" >name</a>
</xsl:for-each>

Of course I have conditions like if it is the last data in recordset then no
next id and similar to the previous one. This part is not a big problem.

The problem is that "preceding::id" is not returning what I need. The
"following::id" is working well. The "preceding::id" is only returning the
the id on the top level (id=23) and it is constant although I am in the
<element> loop. the <id>'s in the <element> nodes are actually going deeper
in nesting so they are not even at the same level with the top level id
(id=23). I could not figure this out.

Any ideas? Different ways?

Thanks very much in advance

Meltem

 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.