XMLMania

msg:702133 | 1:28 pm on Aug 21, 2004 (gmt 0) |
Yeah, you need to send the MIME-TYPE in the HTTP header. I suggest the general XML mime: "text/xml" I think RSS has its own type, but for compatibilty reasons I use the standard XML mime-type.
|
flyerguy

msg:702134 | 1:37 pm on Aug 21, 2004 (gmt 0) |
So, is this an IIS tweak or is it simply a matter of putting the correct lines at the top of my file? I currently have this: <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd"> <rss version="0.91">
|
XMLMania

msg:702135 | 1:53 pm on Aug 21, 2004 (gmt 0) |
Just try putting: Response.ContentType = "text/xml" At the top of your ASP code, or somewhere before the HTTP headers are sent.
|
flyerguy

msg:702136 | 2:08 pm on Aug 21, 2004 (gmt 0) |
I tried every combination I could think of with that, still no luck, the ASP file just outputs the data as raw text. How can the standards be so screwed up?! If i'm understanding this right, microsoft basically doesn't support XML? What is going on..
|
flyerguy

msg:702137 | 2:16 pm on Aug 21, 2004 (gmt 0) |
One more thing, I thought to look at this url in netscape, and it displays an error message: XML Parsing Error: xml processing instruction not at start of external entity Location: [example.com...] Line Number 2, Column 1:<?xml version="1.0" encoding="iso-8859-1"?> What would that indicate to you? [edited by: tedster at 5:42 pm (utc) on Aug. 30, 2004] [edit reason] use example.com [/edit]
|
XMLMania

msg:702138 | 2:19 pm on Aug 21, 2004 (gmt 0) |
<% Response.ContentType = "text/xml" %><?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd"> <rss version="0.91"> <channel> <title>Flyerstarter.com - Main Inventory Channel</title> <link>http://www.example.com</link> <description>Nightclub flyer photos, designs and typefaces.</description> <language>en-gb</language> <image> <title>Flyerstarter</title> <url>http://www.example.com/sitecore_files/Bar-Promotions.gif</url> <link>http://www.example.com</link> </image> <% set conn = server.createobject("adodb.connection") DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; " DSNtemp=dsntemp & "DBQ=" & server.mappath("/mydatabase.mdb") conn.Open DSNtemp sqlstmt = "SELECT tables FROM query ORDER BY table DESC;" Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sqlstmt, DSNtemp, 3, 3 x=0 while not rs.eof if x<15 then strdescrip = rs("descrip") finaldescrip = Replace(StripSymbols(strdescrip), "&", "&") response.write "<item>" response.write "<title>"& rs("itemname") &"</title>" response.write "<link>http://www.example.com/default.asp?pg=products&specific="&("ITEMID"))&"</link>" response.write "<description>"&finaldescrip&"</description>" response.write "</item>" end if x=x+1 rs.movenext wend set rs = nothing Conn.close set Conn = nothing %> </channel> </rss> Does the above not work? [edited by: tedster at 5:44 pm (utc) on Aug. 30, 2004]
|
flyerguy

msg:702139 | 2:39 pm on Aug 21, 2004 (gmt 0) |
You are da man. Thank you very much, works like a charm.
|
XMLMania

msg:702140 | 2:40 pm on Aug 21, 2004 (gmt 0) |
Out of curiosity, what code did you use?
|
flyerguy

msg:702141 | 2:52 pm on Aug 21, 2004 (gmt 0) |
Well, changing the header text to what you showed worked. I had two other problems though; a) For some reason, if I just did an F5 refresh, it wasn't reloading the changes I made. It would only show updates if I exited the browser and entered the URL again! Very frustrating, I probably had it entered right in the first place.. b) I had whitespace in front of the opening <title> etc. tags. This seemed to screw things up royally. So, what you posted in the last message is a functional way to do it. I still get the impression as an XML/RSS rookie that this whole topic is a can of worms, there seems to be no real standardization..
|
XMLMania

msg:702142 | 3:06 pm on Aug 21, 2004 (gmt 0) |
Ok thats cool :). XML is well standardised, but yeah... there are some issues with RSS and its variants.
|
jonathanbishop

msg:702143 | 12:18 pm on Sep 26, 2004 (gmt 0) |
Hi, I'm trying to make an RSS feed in ASP.NET on an IIS Server. I keep getting the error message "XML parsing error". I've included the DTD tag and set the content type to "text/xml" and the reponse encoding to "iso-8859-1". I don't think its a problem with my code as I got the same error when I uploaded the XML code from a RSS feed that works to my IIS webspace. I had a similar problem when I tried to put WML pages on an IIS server, but this was solved by changing the content type. Are there any settings that need to be changed to allow XML pages to be hosted on an IIS server?
|
|