|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Sort Problem
hi,
Below is a snippet of my code. I am using a parameter called
"SORT_BY" to sort only when "SORT_BY" has a value. The value of "SORT_BY"
is (I've tested to be sure) the value of the child element to sort by or the
value is undefined. If the value is undefined then sorting is not done. My
problem is that when I do have a "value" to sort by, the code still behaves
as if it did not sort. I must be missing something here. Any help would be
greatly appreciated. Also, there is a good bit of javascript in my code but
I left it out because it is irrelevant to the problem.
<xsl:param name="SORT_BY" select="undefined"/>
<xsl:template match="/">
<HTML>
<head>
<SCRIPT language="JavaScript">
function init() { <!-- this
function builds a table -->
.
bunch of javascript
.
<xsl:choose>
<xsl:when test="$SORT_BY !=
undefined">
<xsl:for-each
select="ToDoList/ActionItem">
<xsl:sort
data-type="text" select="$SORT_BY" order="ascending"/>
<xsl:if
test="position()>=$FIRST_TABLE_ENTRY and
position()<=$LAST_TABLE_ENTRY">
more
javascript + XSL
<!--
builds a row in the table -->
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates
select="ToDoList/ActionItem[position()>=$FIRST_TABLE_ENTRY and
position()<=$LAST_TABLE_ENTRY]"/>
</xsl:otherwise>
</xsl:choose>
....
more javascript
...
</SCRIPT>
</head>
......
</xsl:template>
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








