[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: sort parameter problem
> > The following construct hasn't any sort effect when called > with sort=bar > parameter: > <xsl:template name="list-foos"> > <xsl:param name="sort"/> > <xsl:for-each select="foos/foo"> > <xsl:sort select="$sort"/> > [..] > </xsl:for-each> > </xsl:template> It has no effect because every node has the same value of the sort key, that is, the value of the parameter $sort. > > The XSL spec says: > xsl:sort has a select attribute whose value is an expression. > And the sort key is the value of that expression. It's not the value of the expression that results from evaluating the expression. In other words, the sort key is the value of $sort, not the value of the expression contained in $sort. This is a FAQ. The most common circumventions are: (a) use a construct such as select="*[name()=$name]" (b) use saxon:evaluate() or xalan:evaluate() (c) modify the stylesheet before use Mike Kay XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|