Re: [xsl] How to get ' to display properly

Subject: Re: [xsl] How to get ' to display properly
From: Mike Brown <mike@xxxxxxxx>
Date: Fri, 13 Apr 2001 14:40:58 -0600 (MDT)
Webster, Jon wrote:
> I am just really tired and I don't know xsl all that well, so I was hoping
> that someone could let me know how to format this line:
> 
> <a href="javascript:launchApp('" <xsl:value-of select="./ESP/USERNAME"/> ','
> <xsl:value-of select="./ESP/APPID"/> ', '<xsl:value-of
> select="./ESP/PATH"/>');"class="&linktext;">Click here</a> to link to
> ESP.</span>
>
> What I want the rendered text to look like is:
> 
> <a href="javascript:launchApp('joeuser','009238','/some/path');"
> class="&linktext;">Click here</a> to link to ESP.</span>

There's a problem in that you want a literal entity reference (&linktext;)
in the output. You can't do that in XSLT. Besides, this is for an HTML
browser, right? It won't know what &linktext; is. Was this a typo? Where 
is the linktext entity defined?

Anyway, you're making a common mistake. There is a curly-brace syntax that 
makes it much easier for you:

<a href="javascript:launchApp('{ESP/USERNAME}','{ESP/APPID},'{ESP/PATH}');" class="whatever">Click here</a> to link to ESP.

   - Mike
_____________________________________________________________________________
mike j. brown, software engineer at  |  xml/xslt: http://skew.org/xml/
webb.net in denver, colorado, USA    |  personal: http://hyperreal.org/~mike/

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


Current Thread