cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Koch <k...@pixelpark.com>
Subject Re: escaping & in xsl --> JavaScript
Date Fri, 05 Jan 2001 11:28:21 GMT
Hi

Thomas Viohl schrieb:
> 
> How can I simply escap (or unescape) the & character for building javascript
> URLs?
> 
> My code:
> ....
> <xsl:text>javascript:parent.mainFrame.location=
>         'next_page.xml?param1=abcd</xsl:text>                                 
                         <xsl:text>&amp;</xsl:text>
> <--- result=&amp;                                               <xsl:text>param2=xyz;'
> ....
> 
> it should give the result:
> javascript:parent.mainFrame.location='next_page.xml?param1=abcd&param2=xyz;'
> 
> but gives this:
> javascript:parent.mainFrame.location='next_page.xml?param1=abcd&amp;param2=x
> yz;'

This is correct, because '&' must be escaped as '&amp;' in href
attributes, too.
-- 
Johannes Koch  . IT Developer
Pixelpark AG   . http://www.pixelpark.com
Rotherstra├če 8 . 10553 Berlin  .  Germany
phone: +49 30 5058 - 1288  .  fax: - 1355

Mime
View raw message