xsl-list
[Top] [All Lists]

RE: <xsl:sort> and <xsl:copy-of> in conjunction with one an other

2003-01-29 12:36:43
Hi Jan,
        I looked over your xslt and nothing seems to be wrong there.  Could you 
post a sample of your xml?

Thanks,
Andy

-----Original Message-----
From: Stanger, Jan [mailto:jan(_dot_)stanger(_at_)csfb(_dot_)com]
Sent: Wednesday, January 29, 2003 12:42 PM
To: 'xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com'
Subject: RE: [xsl] <xsl:sort> and <xsl:copy-of> in conjunction with one
an other


I am still somewhat puzzled by below section of my code. I am trying to sort 
all DataRow nodes by up to five columns. Now the output actually looks 
unchanged from the input XML, as if the sorting would not have taken place at 
all. Is there anything obvious that I am missing? I have studied the online 
XSLT FAQ that I have been made aware of yesterday, but none of the sorting 
examples have helped me in this particular case.

I have checked all below variables (sortby, sortdatatype etc.) and they do 
contain correct values. Could it be that the copy-of instruction actually uses 
the original XML tree as opposed to the 'indexed' version of it after the sort?

Any help is appreciated.
Jan

-----Original Message-----

        <!-- Actual sorting of data rows -->            
        <xsl:for-each select="DataRow">
            <xsl:sort select="column[(_at_)name=$sortby0]" 
data-type="{$sortdatatype0}" order="{$sortorder0}" />
            <xsl:sort select="column[(_at_)name=$sortby1]" 
data-type="{$sortdatatype1}" order="{$sortorder1}" />
            <xsl:sort select="column[(_at_)name=$sortby2]" 
data-type="{$sortdatatype2}" order="{$sortorder2}" />
            <xsl:sort select="column[(_at_)name=$sortby3]" 
data-type="{$sortdatatype3}" order="{$sortorder3}" />
            <xsl:sort select="column[(_at_)name=$sortby4]" 
data-type="{$sortdatatype4}" order="{$sortorder4}" />
            <!-- Finally copy each DataRow node to output XML -->               
 
            <xsl:copy-of select="." />            
        </xsl:for-each>



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list