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

Error resolving the default value of a parameter in x

Subject: Error resolving the default value of a parameter in xsl:sort@order
From: Andrew Ashton <Andrew_Ashton@xxxxxxxxx>
Date: Fri, 09 Jan 2009 15:15:48 -0500
 Error resolving the default value of a parameter in  x
I am getting an error as I try to pass the xsl:sort order of a list  via a
URL parameter in Cocoon.  The style sheet receives two parameters, and sets
default values like this:
...
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
   <xsl:param name="sortBy" select="id"/>
   <xsl:param name="sortOrder" select="ascending" />
...

Later on, I sort a list using:
<xsl:sort select="(*|*/*)[name()=$sortBy]" order="{$sortOrder}"/>

Everything works fine if $sortOrder has been passed through the URL (i.e.,
http://example/home?sortBy=name&sortOrder=descending). However, if
$sortOrder is not set in the URL, I get an error, "order must be 'ascending'
or 'descending'."  My understanding is that it should use the default value
of 'ascending', and indeed it appears to correctly resolve the default value
of $sortBy when needed.

Thanks, Andy

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.