Re: XSLT Feature Request: template for xsl:sort and xsl:key

Wouldn't a conditional expression be an easier way to achieve this?

"G. Ken Holman" wrote:
> 
> Hi folks!
> 
> I would like to be able to specify an evaluation template for xsl:sort so
> that I can use <xsl:choose> to conditionally specify the value by which I
> would like a node sorted.  Since there is no conditional construct in
> XPath, I am unable to influence the sorted position using a conditional
> expression.
> 
> This has come up in writing a stylesheet for a topic map where an href
> attribute value may be either an internal reference to a topic or an
> external reference to a fragment: if I determine it is an internal
> reference (the substring before the '#' is empty), then I want the sort
> value to be obtained de-referenced from the topic, otherwise I want the
> sort value to be the href itself.
> 
> I could do this along the lines of:
> 
>    <xsl:sort order="descending">
>      <xsl:choose>
>        <xsl:when test="....
>        </xsl:when>
>        <xsl:otherwise>
>        </xsl:otherwise>
>      </xsl:choose>
>    </xsl:sort>
> 
> In the same way I could use conditionals for the use= expression of
> <xsl:key> if the absence of the use= attribute implied the calculation of
> the template.
> 
> Thanks!
> 
> ............. Ken
> 
> --
> G. Ken Holman                    mailto:gkholman@CraneSoftwrights.com
> Crane Softwrights Ltd.             http://www.CraneSoftwrights.com/m/
> Box 266, Kars, Ontario CANADA K0A-2E0   +1(613)489-0999   (Fax:-0995)
> Web site: XSL/XML/DSSSL/SGML services, training, libraries, products.
> Book: Practical Transformation Using XSLT and XPath ISBN1-894049-05-5
> Article:          What is XSLT? http://www.xml.com/pub/2000/08/holman
> Next public instructor-led training:     2000-10-03/05,2000-10-09/10,
> -        2000-10-19,2000-11-06/07,2000-11-12,2000-12-03/04,2001-01-27

Received on Thursday, 19 October 2000 23:47:36 UTC