RE: [xsl] amp

Subject: RE: [xsl] amp
From: Geoff <ghank@xxxxxxxxxxx>
Date: 27 Sep 2002 09:06:22 -0500
On Fri, 2002-09-27 at 03:24, Stevenson Ngila wrote:
> The data come from the DB, and it's the user who feed the DB hence can not
> control user from using '&'. Is there  a way of escaping this character if
> the data comes from the DB? I have resaerched all over on the  internet but
> have not gotten an appropriate explaination. It tells me to use '&amp;' but
> this data comes from the DB, how can i pick all '&' and trasform them in to
> '&amp;'.
> 

It seems to me there is a fairly simple solution to this. Just alter the
script(s) that insert data from the users or alter the script that
converts db records into xml to search for & and replace it with &amp.
Be careful not replace the "&" in "&amp" though so maybe you should
search for " & " (space ampersand space). Any decent language will have
a replace function for strings or you could even use regular
expressions. You will probably need to use this in many places so you
would be well off to use a function or class for this.

This is more of a programming issue than an xslt issue so you can
contact me off list if you want to follow up. 


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


Current Thread