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

Generic XSLT Sorting Template

Subject: Generic XSLT Sorting Template
From: "MoMad" <momad_no@xxxxxxxxxxx>
Date: Fri, 15 Nov 2002 18:59:07 -0800
sorting template
I am trying to find a way to create a generic xsl sorting function that
takes 5 parameters, which are the names of the nodes to sort.

I dont understand how to pass parameters to an xsl stylesheet, but basically
i just want a simple sorting function that sorts the xml and returns a
sorted version of the xml using xsl:copy.

So far this is what i got:


<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >

 <xsl:template name="GenericSort">
    <!-- The sort fields -->
    <xsl:param name="SortField0" select="" />
    <xsl:param name="SortField1" select="" />
    <xsl:param name="SortField2" select="" />
    <xsl:param name="SortField3" select="" />
    <xsl:param name="SortField4" select="" />

    <xsl:copy >
      <xsl:apply-templates>
        <xsl:sort select="$SortField0" />
        <xsl:sort select="$SortField1" />
        <xsl:sort select="$SortField2" />
        <xsl:sort select="$SortField3" />
        <xsl:sort select="$SortField4" />
      </xsl:apply-templates>
    </xsl:copy>
 </xsl:template>

</xsl:stylesheet>


But my problem is, it doesnt work... i want the first sort field
(sortfield0) to sort on the global node-set (ancestor::*[next-sibling()]) ??

Any help will be appreciated, thanks
MoMad

 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.