[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

Subject: Proper use of AVTs (was RE: (no subject))
From: "Martinez, Brian" <brian.martinez@xxxxxxxxxxx>
Date: Tue, 25 Nov 2003 09:26:53 -0700
cendant greenwood plaza
> From: Amir Yiron [mailto:amir@xxxxxxxxxxxxxxxxxx]
> 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[@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[@name=$sortby]" order="{$sortorder}"/>

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

hth,
b.

| brian martinez                           brian.martinez@xxxxxxxxxxx |
| 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.