Subject: [xsl] Re: sorting before transforming From: Dimitre Novatchev <dnovatchev@xxxxxxxxx> Date: Fri, 20 Jul 2001 22:09:03 -0700 (PDT) |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Problems still with eleme, Trevor Nash | Thread | [xsl] Why does using the XSL namesp, Aaron Hope |
[xsl] Elements print sometimes only, Tamre2 | Date | [xsl] Why does using the XSL namesp, Aaron Hope |
Month |