xsl-list
[Top] [All Lists]

Sorting problem

2003-09-03 11:54:43
Hello All,

I have been looking in the sorting FAQ but haven't been able to solve my
problem.


I am trying to do a sort based on a parameter which I can do ok with the
following sort statement:

<xsl:sort select="server_name[$sort='server_name'] | 
                            nds_name[$sort='nds_name'] |
                            short_name[$sort='short_name'] | 
                            total_space[$sort='total_space']"
order="{$order}" data-type="{$dtype}"/>

The above code sorts fine but I have one other sorting criteria. Based on
the used_space and total_space I figure a percent value and would like to
sort on it. The problem is I can get it to work all by its lonesome using
the following:

<xsl:sort select="format-number((number(used_space) div number(total_space))
* 100,'0')" order="{$order}" data-type="number"/>



but when I put it in with the following I get an error.

<xsl:sort select="server_name[$sort='server_name'] | 
                  nds_name[$sort='nds_name'] |
                  short_name[$sort='short_name'] | 
                  total_space[$sort='total_space'] | 
                  format-number((number(used_space) div number(total_space))
*100,'0')[$sort='percent']"
order="{$order}" data-type="{$dtype}"/>


Any help would be appreciated!

Todd Cox
National Cancer Institute
Rockville, MD

I am using the following XML file:

<Volume_Detail>
<time_stamp>Sep 3, 2003 2:21:58 PM</time_stamp>
-
<all_volumes_detail>
-
<volume_Detail>
<server_name>NCIDS1A</server_name>
<short_name>SYS</short_name>
<nds_name>NCIDS1A_SYS.NCI.NIH</nds_name>
<dir_entries>392704</dir_entries>
<avail_dir_entries>65535</avail_dir_entries>
<total_space>8525643776</total_space>
<used_space>5330829312</used_space>
<avail_space>3194814464</avail_space>
<purge_space>44171264</purge_space>
<last_modified>790852149</last_modified>
<vol_type>0</vol_type>
<status>online</status>
</volume_Detail>
-
<volume_Detail>
<server_name>NCIUTIL6</server_name>
<short_name>SYS</short_name>
<nds_name>NCIUTIL6_SYS.31SVCS.31.NCI.NIH</nds_name>
<dir_entries>254464</dir_entries>
<avail_dir_entries>65535</avail_dir_entries>
<total_space>4089643008</total_space>
<used_space>2840657920</used_space>
<avail_space>1248985088</avail_space>
<purge_space>240254976</purge_space>
<last_modified>790851857</last_modified>
<vol_type>0</vol_type>
<status>online</status>
</volume_Detail>
-
<volume_Detail>
<server_name>NCIUTIL6</server_name>
<short_name>SPOOL</short_name>
<nds_name>NCIUTIL6_SPOOL.31SVCS.31.NCI.NIH</nds_name>
<dir_entries>2147483647</dir_entries>
<avail_dir_entries>65535</avail_dir_entries>
<total_space>4434427904</total_space>
<used_space>22040576</used_space>
<avail_space>4412387328</avail_space>
<purge_space>0</purge_space>
<last_modified>790850842</last_modified>
<vol_type>0</vol_type>
<status>online</status>
</volume_Detail>
</all_volumes_detail>
</Volume_Detail>

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



<Prev in Thread] Current Thread [Next in Thread>