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

Re: Comparing and re-assigning variables.

Subject: Re: Comparing and re-assigning variables.
From: "Ragulf Pickaxe" <jawxml@xxxxxxxxxxx>
Date: Mon, 24 Feb 2003 14:22:09 +0000
assignin
Have you considered a two-pass approach, reading and sorting your information in the first step into an intermediate result tree and then chaining to a second step that can address your information in the new already-sorted intermediate as a source node tree?

A computationally intensive one-pass approach that may be a candidate for you if the sorted collection is small is to revisit the sorted node list repeatedly for each member of the sorted node list in order to extract into result tree fragment variables indexed members based on their position relative to the position of the current node in the sorted list. This is not typically advised though because of the many many loops through the source information.

I hope this helps.

.......................... Ken

Just a newbie question concerning this issue...


I have never tried putting a for-each inside a variable, but if that is possible in the specs, could you then not do something like:

<xsl:variable name="SorterList">
 <xsl:for-each select="report-root/txns">
   <xsl:sort select="cpmBI"/>
   <xsl:sort select="date"/>
</xsl:variable>

<xsl:variable name="SortList2" select="document('')/xsl:stylesheet/xsl:template/xsl:variable[@name='SortList']/cpmMemBI"/>

Then loop trough SortList2 and get the values of the current and preceding cpmMemBI element?

I don't know if this is at all possible (and if the syntax should differ), but I think this would be easier than a two-pass solution.

Comments...?

Ragulf Pickaxe :)


_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail



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.