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

RE: How to assign a nodelist to a variable

Subject: RE: How to assign a nodelist to a variable
From: "Martinez, Brian" <brian.martinez@xxxxxxxxxxx>
Date: Thu, 8 Jan 2004 10:27:15 -0700
onclick variable
Call me old-school--but please consider switching to plain text (or at least
not use HTML-heavy stationery) when posting to this list.  Those among us
who pay by volume for their bandwidth will thank you.  ;-)

> From: Robert A. van Ginkel [mailto:robert@xxxxxxxxxxxxx]
> Sent: Thursday, January 08, 2004 10:01 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  How to assign a nodelist to a variable
>
>so as u can see I want to put a value from XML through XSL in a XHTML
attribute. What I am doing doesn't work ofcourse, what will? writing a
function?

You need to read a bit more about the use of attribute value templates
(AVTs); see http://www.dpawson.co.uk/xsl/sect2/N1575.html#d1996e85.

In your example, you want to insert the value of the idx attribute from your
XML into the onclick attribute in your input element.  Attributes in result
elements require literal values, so simply trying to insert an XSLT element
into the attribute won't work.

With AVTs (delimited by curly braces {}) you can set the attribute value of
a result element using an XPath expression; so your input element becomes:

<input class="button" onclick="lgotoent('report.php?view={@idx}')"/>

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.