Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - dynamic sort [Thread Next] Re: dynamic sortTo: NULL Date: 9/6/2004 10:17:00 AM Michael Frost wrote: > How can I pass different expressions as a variable to xsl:sort, like: > > expression 1 : *[name()='myval'] > expression 2 : tree1/tree2[somenode='someval']/tree3/someothernode > > making this sorting possible: > > .. > <xsl:variable name="v_sort" select=" -->expression<-- "/> > > <xsl:for-each select="mynodeset"> > <xsl:sort select="$v_sort"/> > .. > </xsl:for-each> > > > Both expressions works fine when inserted directly into the sort! > I know that xsl variables cannot be passed directly to xsl:sort, but > is there some other solution or workaround to this problem? Nope. XSLT doesn't support dynamic XPath evaluation. XSLT is compiled language and requires all XPath expressions to be known at compile time. -- Oleg Tkachenko [XML MVP] http://blog.tkachenko.com | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
