Re: [xsl] Passing XSL variable to Javascript!

Subject: Re: [xsl] Passing XSL variable to Javascript!
From: "Michael Beddow" <mbnospam@xxxxxxxxxxx>
Date: Fri, 10 Aug 2001 07:32:19 +0100
On Friday, August 10, 2001 2:28 AM
Syed Abuthaheer wrote:

> thanks a lot. it's working fine.
> regards,
> syed.
> ----- Original Message -----
> From: "Rosa I-Ting Cheng" <Rosa@xxxxxxxxxxxxx>
> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> Sent: Friday, August 10, 2001 9:19 AM
> Subject: RE: [xsl] Passing XSL variable to Javascript!
>
>
> > I haven't tested it, but try putting in braces {$temp} instead of
just
> > $temp.
> >

In case you're wondering why it works, the braces tell the XSLT
processor to evaluate the variable $temp before building the rest of the
attribute value that you're putting into the output tree. Otherwise, as
you found, it treats $temp as a literal string and passes it through.

The bad news is that such Attribute Value Templates aren't quite the
magic spell for forcing evaluation of variables that people sometimes
think when they first discover them. They are indeed intended for the
specific task of building the values of attributes, and the processor is
obliged to be very picky about their use in any other context. See the
list archives for related tales of woe.

Michael
---------------------------------------------------------
Michael Beddow   http://www.mbeddow.net/
XML and the Humanities page:  http://xml.lexilog.org.uk/
---------------------------------------------------------


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


Current Thread