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]

RE: param value in xsl:sort


> I'm trying to use the value of a parameter as the select value of an
> xsl:sort element.

You can't (this is a FAQ). <xsl:sort select="$param"/> means "sort by the
value of the parameter", which, since the parameter has the same value for
every member of the node-set, is the same as saying don't sort at all. There
is no way in standard XSLT of saying "sort by the value of the XPath
expression represented by the string value of $param". You can do this in
Saxon by writing <xsl:sort select="saxon:evaluate($param)"/>. If $param is
always an element name, and if you are careful about namespaces, you can do
it in standard XSLT by writing <xsl:sort select="*[name()=$param]"/>

Mike Kay 
> 




 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]