Many thanks Mike
"Mike Brind" <pa*******@hotmail.com> wrote in message
news:11**********************@j52g2000cwj.googlegr oups.com...
Astra wrote:
Hi All
Creating an rss.xml file dynamically via ASP/ADO/DB, but find errors in
the
file.
Don't think it's an ASP prob to be honest. Think its more to do with the
fact that the ampersands are accepted in the file. Do I take it that you
have to 'escape' all non alphanumeric chars to produce a valid file?
I thought xml files were supposed to eradicate the usual invalid char
problems that tab-delimited and csvs used to have?
Any ideas?
Thanks
Robbie
No - you don't have to escape all non-alphanumeric characters, just the
ones that have special meaning in xml.
Try this function for cleaning your strings up prior to outputting them
to your rss.xml file:
function tidyxml(text)
text = replace(text,Chr(180),"'")
text = replace(text,"&","&")
text = replace(text,"'","'")
text = replace(text,"'","'")
text = replace(text,""","""")
text = replace(text,""","""")
text = replace(text,"-","-")
text = replace(text,"<","<")
text = replace(text,">",">")
tidyxml = text
End function
--
Mike Brind