xsl-list
[Top] [All Lists]

Proper use of AVTs (was RE: (no subject))

2003-11-25 09:26:53
From: Amir Yiron [mailto:amir(_at_)WavionNetworks(_dot_)com]
Sent: Tuesday, November 25, 2003 8:29 AM
Subject: 

Please use a subject line when posting to the list--it will make message
threading in the archives more reliable.

I have the following line in my xslt file:

<xsl:sort select="MIB[(_at_)name=&quot;{$sortby}&quot;]"  
order="{$sortorder}" />

when 'sortby' and 'sortorder' are valid pre-defined 
parameters (I checked
that both are valid at
that point). Result shows that the sort considers the 'order' 
but ignores
the 'select'.

When I replace the {$sortby} by a valid value, it works fine!
Any suggestion?

Learning more about attribute value templates--when you can and can't use
them in XSLT--would be a good start.

There is no need, nor is it legal, to use an AVT in an XPath expression.  It
may not generate an error, but as you've discovered the content of the curly
braces are ignored.  There's also no need to enclose the variable within
quotes:

<xsl:sort select="MIB[(_at_)name=$sortby]" order="{$sortorder}"/>

(The order attribute does use an AVT, so that is unchanged.)

hth,
b.

| brian martinez                           
brian(_dot_)martinez(_at_)cendant(_dot_)com |
| lead gui programmer                                    303.357.3548 |
| cheap tickets, part of trip network                fax 303.357.3380 |
| 6560 greenwood plaza blvd., suite 400           englewood, co 80111 |
| cendant travel distribution services   http://www.cheaptickets.com/ |

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



<Prev in Thread] Current Thread [Next in Thread>
  • Proper use of AVTs (was RE: (no subject)), Martinez, Brian <=