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

Sort Problem

Subject: Sort Problem
From: Heather Lindsay <heather.lindsay@xxxxxxxxxxxxx>
Date: Mon, 7 Aug 2000 10:49:59 -0400
xsl todolist
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()&gt;=$FIRST_TABLE_ENTRY and
position()&lt;=$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()&gt;=$FIRST_TABLE_ENTRY and
position()&lt;=$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


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.