XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
gareth robertsSubject: XSL:Sort in Conditional Statement
Author: gareth roberts
Date: 08 Mar 2007 06:52 PM
Hi There,
I want to do a different sort depending on the value of a param e.g.

<xsl:if test="$order = 1">
<xsl:sort select="year" data-type="number" order="descending" />
</xsl:if>

However, I keep getting errors saying this isn't allowed. Is there anyway I can get round this problem?

Thanks

Postnext
Ivan PedruzziSubject: XSL:Sort in Conditional Statement
Author: Ivan Pedruzzi
Date: 08 Mar 2007 11:48 PM
Originally Posted: 08 Mar 2007 11:45 PM
xsl:sort has to be declared as direct child of for-each or apply-template.

Try a different approach, see attached file.

Hope this helps
Ivan Pedruzzi
Stylus Studio Team


Unknownbooks(5).xml


Unknownconditional-sorting.xsl

Posttop
gareth robertsSubject: XSL:Sort in Conditional Statement
Author: gareth roberts
Date: 09 Mar 2007 06:06 AM
thanks :) exactly what I needed

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.