|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: sorting before transforming
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








