xsl-list
[Top] [All Lists]

Re: Set <xsl:sort> attributes with stylesheet parameters

2003-10-30 03:29:04
Hi Richard,

Why does the following code:

<xsl:sort select="*[local-name()=$sort-by]" order="$sort-order" />

not sort in the order specified by the value $sort-order?

Because you've forgotten to use an attribute value template ({}s) to
indicate that the sort order is the value of the $sort-order variable,
rather than the literal string "$sort-order". Try:

  <xsl:sort select="*[local-name() = $sort-by]"
            order="{$sort-order}" />

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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



<Prev in Thread] Current Thread [Next in Thread>