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

having trouble with xsl:choose and xsl:sort

Subject: having trouble with xsl:choose and xsl:sort
From: "Cox, Todd (NIH/NCI)" <tcox@xxxxxxxxxxxx>
Date: Sun, 5 Jan 2003 00:32:20 -0500
xsl sort choose
Hello All,

I am tring to provide sorting a sorting capability using parameters as my
selecting process. I am using Cocoon and when I try to use a <xsl:choose>
and select a <xsl:sort> I get a Can't have a <xsl:sort> in a <xsl:choose>.
The the stylesheet is as follows:

<xsl:param name="sort"/>
<xsl:for-each select="all_volumes_detail/volume_Detail">
<xsl:choose>
<xsl:when test="$sort='server'">
	<xsl:sort select="server_name"/>
</xsl:when>
<xsl:otherwise>
	<xsl:sort select="format-number((number(used_space) div
number(total_space)) * 	100,'0')" order="descending" data-type="number"/>
</xsl:otherwise>
</xsl:choose>
<tr>      		
        			
        			<td><xsl:value-of
select="server_name"/></td>
        			<td><xsl:value-of select="nds_name"/></td>
					<td><xsl:value-of
select="short_name"/></td>
					<td><xsl:value-of
select="dir_entries"/></td>
					<td><xsl:value-of
select="avail_dir_entries"/></td>
					<td><xsl:value-of
select="total_space"/> GB</td>
					<td><xsl:value-of
select="used_space"/> GB</td>
					<td><xsl:value-of
select="avail_space"/> GB</td>
					<td><xsl:value-of
select="purge_space"/> MB</td>
					<xsl:choose>
          				<xsl:when
test="format-number((number(used_space) div number(total_space)) *
100,'0')&gt;'90'">
            				<td bgcolor="#ff0000"><xsl:value-of
select="format-number((number(used_space) div number(total_space)) *
100,'0')"/>%</td>
            			</xsl:when>
          			<xsl:otherwise>
            			<td><xsl:value-of
select="format-number((number(used_space) div number(total_space)) *
100,'0')"/>%</td>
          			</xsl:otherwise>
        			</xsl:choose>

The sort works if I don't use the <xsl:choose>. Does anyone have any ideas?

Thanks,

Todd Cox
National Cancer Institute

 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.