<%@ Language=JavaScript %>
<!-- #INCLUDE VIRTUAL="/include/webman.asp" -->
<%
	OpenDatabase();
	Response.ContentType = "text/xml";
	var stories = getRecordsetArray("select top 50 title, article_id, body from articles where type = 'N' and live = 'Y' order by rating");

	function getStart(text) {
		var tx = String(text);
		if(tx.length > 500) {
			tx = tx.substring(0, 500) + "...";
		}
		return tx;
	}
	
	function fmtTextForXML(text) {
		var t = String(text);
		if(t=="" || t=="undefined" || t=="null")
			return "";
		else
			return Server.HTMLEncode(t);
	}

%>
<!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>Illustration: News</title>
<link>http://www.illustrationweb.com</link>
<description>The latest agency news for illustrators from Illustration</description>
<language>en-gb</language>
<% for(each in stories){ %>
<item>
	<title><%=fmtTextForXML(stories[each].title)%></title>
	<link>http://www.illustrationweb.com/news/newsitempage.asp?article_id=<%=fmtTextForXML(stories[each].article_id)%></link>
	<description><%=fmtTextForXML(getStart(stories[each].body))%></description>
</item>
<% } %>
</channel>
</rss>
<% CloseDatabase(); %>



