|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] following and 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&currentid={id}&previousid={preceding::id}&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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








