At 01/01/11 17:27 +0530, Amit R Bhamare wrote:
>I am trying to use a parameter in sort tag.
> <xsl:sort select="$sort_order"/>
>When I am hardcoding the sort order as <xsl:sort select="Status"/> it works
>fine but when I define a parameter with
>& then putting the param in sort tag as mentioned above it is not working.
>Can somebody pl. explain why this is happening?
It is disallowed because you cannot express an XPath expression dynamically
and have it evaluated again after being evaluated once ... it always has to
be a static expression.
But ... the following is a static expression that will help you if you
don't engage certain nuances of namespace prefixes:
It sorts using the value of the first element whose name is the
I hope this helps.
p.s. you may be interested to see our web site for our XSLT/XPath book
(personal, and unlimited site and world staff licenses available; all with
no-charge perpetual updates) and for our deliveries and licensing of our
instructor-led training derived from the book (the instructor-led material
licensing can be for your internal use or for you to deliver to your own
G. Ken Holman mailto:[log in to unmask]
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/l/
Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (Fax:-0995)
Web site: XSL/XML/DSSSL/SGML/OmniMark services, training, products.
Book: Practical Transformation Using XSLT and XPath ISBN1-894049-05-5
Article: What is XSLT? http://www.xml.com/pub/2000/08/holman/index.html
Next public instructor-led training: 2001-01-27,2001-02-21,