velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank_McLean" <>
Subject Creating a URL with ampersands (not &amp;s) for XML output
Date Wed, 22 Aug 2007 16:55:13 GMT


I have a template which creates XML.  One of the elements is a URI to an
image.  This URI calls a servlet which generates the appropriate image.
It contains an ampersand delimited list of parameters, so my XML should
look something like:




Now, try as I might, I CANNOT get velocity to STOP replacing the literal
'&' with the entity code '&amp;'.


I first create the $distCode (the parameter list) using '_' as a
separator.  Then I $distCode.replaceAll('_','&') and this seems to make
$distCode just what I want.  However, if I then write -


<http://.../blah?$%7bdistCode%7d%3c/imageUrl> >


- Velocity kindly butts in and escapes all my hard won '&'s. J


Right now, I just cannot see a way around this.  I would really rather
avoid any solutions like the following, if I can help it, as the whole
aim is to make this easy to use:







Any help gratefully received...



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message