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

passing a parameter to select attribute of <xsl:sort>

Subject: passing a parameter to select attribute of <xsl:sort>
From: "Ryan Daigle" <rwdaigle@xxxxxxxxx>
Date: Wed, 21 Jun 2000 13:06:01 -0400
xsl sort by parameter
	I am trying to pass a parameter into a sort element through another
template as follows:

<xsl:apply-templates select="list">
	<xsl:with-param name="title">Sort By Id:</xsl:with-param>
	<xsl:with-param name="order">ascending</xsl:with-param>
	<xsl:with-param name="orderingElement">./person/id</xsl:with-param>
</xsl:apply-templates>
...
<xsl:template match="list">
...
	<xsl:apply-templates select="./listItem">
		<xsl:sort order="{$order}" select="$orderingElement"/>
	</xsl:apply-templates>
</xsl:template>

	The "listItem" template is trivial and just outputs the elements under it.
When I use this format I don't get any processing errors (under Xalan
1.0.1), but the elements aren't sorted correctly.  They're just in the order
that they appear in the XML document.
	How do I go about passing a variable or parameter into the select attribute
of an <xsl:sort> element?
	Here is what the XML document looks like:

<?xml version ="1.0"?>
<!DOCTYPE list SYSTEM "../schemas/list.dtd">
<list>
	<listItem>
		<person>
			<id>05</id>
			<firstName>Ian</firstName>
			<lastName>Hunter</lastName>
		</person>
	</listItem>
	...
</list>

	Any help would be much appreciated.  Thank you!


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com


 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.