Jump to content

RSS / XML as an ASP file?


jonkemm

Recommended Posts

Hiya,I'm trying to learn how to make a dynamic XML document in ASP but can't get it to work. Am I fighting a loosing battle or is there a trick to it?Here's the xml example (borrowed from a site just to try and get it to work):http://www.atlantisnightclub.co.uk/rss/rss.xmlThis clearly worksBut when I do the same thing in asp: (Literally the same code but in an ASP file)http://www.atlantisnightclub.co.uk/rss/rss.aspIt doesn't work...I'm sure i'm being an idiot even trying this but i've seen it work:http://www.aspmessageboard.com/scripts/rss.aspPlease help?Jk

Link to comment
Share on other sites

It works perfectly in IE7 and FF2. Opera 9 is the only browser which didn't said this is an RSS feed but still displayed the contents.I don't know how, but what you must do is to tell ASP to send the file with XML or RSS's MIME type. I don't know how is that done in ASP, but in PHP it's "header('application/xml')".

Link to comment
Share on other sites

Thank you (genius!) - With a little googling I found that using this...<%@LANGUAGE="VBSCRIPT"%><% Response.ContentType = "application/xml" %><?xml version="1.0" encoding="ISO-8859-1"?>...as the first line sorted it.<% Response.ContentType = "application/xml" %> was the line that solved it.I then had an error because there was a space in front of the <?xml version="1.0" encoding="ISO-8859-1"?> tag (hence the reason it's all on the same line!)Hopefully this should help others in the future?Jk

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...