Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dynamic XML from SQL DB

0 views
Skip to first unread message

Simon Gare

unread,
Oct 1, 2009, 7:40:46 AM10/1/09
to

Hi All,

I have a content managed site that I need to create an sitemap XML for. The
pages can be switched on and off by the client so the XML file needs to read
values from the db.

At the moment we are doing this in Classic ASP that uses an IF statement to
look at a BIT value in the table and display the page, see the code below,
but need a proper XML file to handle this.

Thanks in Advance

Simon Gare
www.london.chauffeurcarcompany.com

et XMLSiteMap = Server.CreateObject("ADODB.Recordset")
XMLSiteMap.ActiveConnection = MM_TobiasNET_STRING
XMLSiteMap.Source = "SELECT * FROM dbo.CMSViewWebPages WHERE CDID ="&
companyID
XMLSiteMap.CursorType = 0
XMLSiteMap.CursorLocation = 2
XMLSiteMap.LockType = 1
XMLSiteMap.Open ()

XMLSiteMap_numRows = 0

Response.Write "<?xml version=""1.0"" encoding=""UTF-8"" ?>"&VbCrlf
Response.Write "<urlset
xmlns=""http://www.google.com/schemas/sitemap/0.84"">"&vbcrlf
Response.Write "<url>"&vbcrlf
Response.Write "<loc>http://" & request.servervariables("server_name") &
"/index.asp</loc>"&vbcrlf
Response.Write "<priority>1.0</priority>"&vbcrlf
Response.Write "<changefreq>weekly</changefreq>"&vbcrlf
Response.Write "</url>"&vbcrlf
If ABS(XMLSiteMap.Fields.Item("achievements").value) = 1 Then


0 new messages