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

Re: sorting before transforming

Subject: Re: sorting before transforming
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 20 Jul 2001 22:09:03 -0700 (PDT)
xsl multiple pass sorting
Dan Miner wrote:

[snip]

> What I'd like to do is sort a list of nodes and then transform
> this sorted node list.  <xsl:sort> appears to only work on the
> resulting output and can not be applied to the input document.
> 
> Is it possible to sort nodes in the input?  If not, is there a way
> to "chain" stylesheets?  [ XML1 -> XSL1 -> XML2 -> XSL2 -> XML3, etc]

Hi Dan,

It is always possible to capture the result of sorting within a xsl:variable and
(after converting this RTF to a regular node-set using the xxx:node-set() extension
function) then to apply templates on the contents of this xsl:variable.

E.g.:

<xsl:variable name="vSorted">
  <xsl:for-each select="$employees">
    <xsl:sort select="@name"/>

    <xsl:copy-of select="."/>
  </xsl:for-each>
</xsl:variable>

<xsl:apply-templates select="msxsl:node-set($vSorted)/*"/>


Also have a look at the recent thread about multiple passes and the generic template
for multiple pass processing:

http://sources.redhat.com/ml/xsl-list/2001-06/msg01147.html

http://sources.redhat.com/ml/xsl-list/2001-07/msg00391.html


Hope this helped.

Cheers,
Dimitre Novatchev.


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

 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.