By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,996 Members | 1,180 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,996 IT Pros & Developers. It's quick & easy.

creating an rss.xml file dynamically has issues

P: n/a
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
Mar 6 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

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,"<","&lt;")
text = replace(text,">","&gt;")
tidyxml = text
End function

--
Mike Brind

Mar 6 '06 #2

P: n/a
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,"&","&amp;")
text = replace(text,"'","'")
text = replace(text,"'","'")
text = replace(text,""","""")
text = replace(text,""","""")
text = replace(text,"-","-")
text = replace(text,"<","&lt;")
text = replace(text,">","&gt;")
tidyxml = text
End function

--
Mike Brind
Mar 6 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.