<?xml version="1.0" encoding="ISO-8859-1" ?>
<%
	response.buffer=true
	response.ContentType = "text/xml"

	Function ApplyXMLFormatting(strInput)
		strInput = replace(strInput,"&","&amp;")
		strInput = replace(strInput,"'","&apos;")
		strInput = replace(strInput,"""","&quot;")
		strInput = replace(strInput,">","&gt;")
		strInput = replace(strInput,"<","&lt;")

		ApplyXMLFormatting = strInput
	End Function

	Function RemoveHTML( strText )
		Dim RegEx
		Set RegEx = New RegExp
		RegEx.Pattern = "<[^>]*>"
		RegEx.Global = True
		strText = Replace(strText, "<br>", chr(10))
		strText = Replace(strText, "<Br>", chr(10))
		strText = Replace(strText, "<bR>", chr(10))
		strText = Replace(strText, "<BR>", chr(10))
		RemoveHTML = RegEx.Replace(strText, "")
	End Function

%>

<rss version="2.0">
	<channel>
		<title>Champion Newspapers</title>
		<link>http://www.champnews.com</link>
		<description>All the latest news from Champion Newspapers</description>
		<language>en-uk</language>
		<copyright>Copyright 2007-2010 Champion Media Group. All Rights Reserved</copyright>
<%
	set connect=server.createobject("ADODB.connection")
	set rs=server.createobject("ADODB.recordset")
	connect.open "dsn=chuser;UID=chuser;PWD=n29c18j28r12;"
	mysql="SELECT * FROM tblcontent_champnews WHERE cmgtitle<>'' AND year(dateadded) = " & year(now()) & " ORDER BY dateadded DESC"
	rs.open mysql,connect,3
	do while not rs.eof
%>
	<item>
		<title><%=ApplyXMLFormatting(rs("cmgtitle"))%></title>
		<link>http://www.champnews.com/html/newsstory.asp?id=<%=rs("newsid")%></link>
		<description>Stories by Champion Newspapers, the BEST for news in your area</description>
		<datePosted><%=rs("dateadded")%></datePosted>
	</item>
<%
		rs.movenext
	loop

	rs.close
	set rs=nothing
	connect.close
	set connect=nothing
%>
	</channel>
</rss>
