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

following-sibling in a sorted result tree?

Subject: following-sibling in a sorted result tree?
From: "Peter Heald" <healdp@xxxxxxxxxxx>
Date: Wed, 27 Apr 2005 15:44:21 -0700
peter heald
Hi,

I have an xslt2 transform that outputs multiple html documents, as well as index files and hhc/hhk htmlHelp files.

Part of this is a sorted xsl:for-each loop that references the previous and next siblings (used to add next and previous page buttons in the html).

I have found that the sibling instructions reference the unsorted result tree, not the sorted tree which is the current context. The results match the order of the original XML, not the sorted loop, therefore the previous and next buttons are not in sync with the index and content pages, which are also sorted. So I'm guessing that following-sibling, for example, is not using the sorted result tree at all. Is there a way around this? Do I somehow need to create a parallel result tree?

Any thoughts would be much appreciated. Below is a little pseudo-code demonstrating the problem.

<xsl:for-each select="ITEM">
<xsl:sort select="@NAME"/>
<xsl:result-document href="./{$something}.html" format="myhtml">
.....
<xsl:value-of select="following-sibling::*[1]/@NAME"/> <!--next sorted ITEM ? -->
....
</xsl:result-document>
</xsl:for-each>


Why would the value-of line above result the next sibling according to the original XML file order and not the sorted order?

Thanks! Pete

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.