<!-- #INCLUDE VIRTUAL="/inc/config.asp" --><!-- #INCLUDE VIRTUAL="/inc/db_open.asp" --><!-- #INCLUDE VIRTUAL="/inc/functions.asp" --><%

SQL = "SELECT TOP 6 * FROM tnews WHERE archived=0 ORDER BY date_created ASC"
Set rsNews = Conn.Execute(SQL)

'Grab the last date (this will act as our LastBuildDate)
arrDate = Split(rsNews("date_created"),"/")

SQL = "SELECT TOP 6 * FROM tnews WHERE archived=0 ORDER BY date_created DESC"
Set rsNews = Conn.Execute(SQL)

Response.ContentType = "application/xml"

%><?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet title="XSL_formatting" type="text/xsl" href="/rss/styles/news.xsl"?>
<rss version="2.0">
   <channel>
      <title>The Sovereign Group - Latest News</title>
      <link>http://<%= Request.ServerVariables("SERVER_NAME") %>/offshore-news/sovereign-news/latest-news.htm</link>
      <description>The Sovereign Group - Latest News - RSS Feed</description>
      <language>en-gb</language>
      <lastBuildDate><% 
	  	strDate = WeekdayName(WeekDay(arrDate(0) & "/" & arrDate(1) & "/" & arrDate(2)),True) & ", "
	  	strDate = strDate & arrDate(1) & " " & MonthName(arrDate(0)) & " " & arrDate(2)
	  	
	  	Response.Write(strDate & " GMT")
	  %></lastBuildDate>
<%
	  While (Not(rsNews.EOF))
	  		Set objNews = Server.CreateObject("Scripting.Dictionary")
			 
			For Each Item In rsNews.Fields
			 
			 	strData = ""
			   	strData = StringContentToXHTML(CStr(Item))
				strData = Replace(strData,"''","'")
				strData = Server.HTMLEncode(strData) 		  			
				
				strData = Replace(strData,VBCRLF, "<br />" & VBCRLF)
				
				objNews.Add Item.Name, CStr(strData)
				
			 Next %>
      <item>
         <title><%= getparagraph(objNews("header"),60) %></title>
         <guid isPermaLink="false"><%
		  arrYear = Split(objNews("date_created"),"/")
		  Response.Write(arrYear(1) & "-" & MonthName(arrYear(0),True) & "-" & Left(arrYear(2),4))
		 %></guid>
		 <link>http://<%= Request.ServerVariables("SERVER_NAME") %>/offshore-news/sovereign-news/<%= rsNews("id") %>/0/<%= Server.URLEncode(objNews("header")) %>.html</link>
         <description><%= GetParagraph(Replace(objNews("body"),"&#194;",""),512) %></description>
         <pubDate><% 
		  	strDate = WeekdayName(WeekDay(arrYear(0) & "/" & arrYear(1) & "/" & arrYear(2)),True) & ", "
		  	strDate = strDate & arrYear(1) & " " & MonthName(arrYear(0)) & " " & arrYear(2)
		  	
		  	Response.Write(strDate & " GMT")
	  %></pubDate>
      </item>
<%
		rsNews.MoveNext
	  Wend
%>
   </channel>
</rss>