This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Conditional xsl:sort


> I have the following:
> 
> ...
> <xsl:for-each select="Transaction">
>     <xsl:sort select="*[local-name() = string($sortby)]" 
> data-type="{$datatype}" order="{$order}"/>
> 
>     <xsl:if test="$sortby = 'Description'">
>         <xsl:sort select="Code" data-type="number" order="{$order}"/>
>     </xsl:if>
> ...
> 
> and I'm getting this:
> 
> ...
> Keyword xsl:sort may not be used here.
> ...
> 
> for the second, conditional, xsl:sort.  Why?

Because <xsl:sort> may not be used inside <xsl:if>. You're trying to
make the language up as you go along.

Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]