This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: sorting before transforming
- To: dminer at edison dot chisp dot net
- Subject: [xsl] Re: sorting before transforming
- From: Dimitre Novatchev <dnovatchev at yahoo dot com>
- Date: Fri, 20 Jul 2001 22:09:03 -0700 (PDT)
- Cc: xsl-list at lists dot mulberrytech dot com
- Reply-To: xsl-list at lists dot mulberrytech dot com
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