[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Proper use of AVTs (was RE: (no subject))
> 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="{$sortby}"]" > 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
|
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
|