<%@ LANGUAGE = VBScript CodePage = 936%>
<%
Option Explicit
Response.Buffer = True
Response.CharSet="GB2312"
Server.ScriptTimeout=9999999
Dim Action,ReportTxt
Dim Conn,Conn_T,DateTime,IsSql,objADOXDatabase
Dim DefaultData,DvbbsVersion

DefaultData = "DefaultData/Skins_Dv71.mdb"
DateTime = "now()"
IsSql = 0
Action = Request.QueryString("action")
DefaultData = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath(DefaultData)

Sub PageMain()
	Dim XmlDom,FilePath
	Dim XslDoc
	Dim StyleDom,XSLTemplate
	FilePath = "files/update.xslt"
	FilePath = Server.MapPath(FilePath)
	Set XslDoc = Server.CreateObject("Microsoft.FreeThreadedXMLDOM")
	If Not XslDoc.load(FilePath) Then
		Response.Write "请检查："&FilePath&"文件是否存在或该文件语法错误！"
		Response.End
	End If
	Dim Node,CNode
	Set Node=XslDoc.createNode(1,"xsl:variable","http://www.w3.org/1999/XSL/Transform")
	Set CNode=XslDoc.createNode(2,"name","")
	CNode.text="action"
	Node.attributes.setNamedItem(CNode)
	Node.text=Action
	XslDoc.documentElement.appendChild(node)
	'输出XML数据
	'Response.ContentType="text/xml"
	'Response.Write "<?xml version=""1.0"" encoding=""gb2312""?>"&vbNewLine
	'Response.Write XslDoc.documentElement.XML
	'Response.End
	If Action = "7" Then
		FilePath = "data/UpdateReport.xml"
		FilePath = Server.MapPath(FilePath)
		Set XmlDom = Server.CreateObject("MSXML.DOMDocument")
		If XmlDom.load(FilePath) Then
			Dim UpdateReportNode,Childs
			Set UpdateReportNode = XmlDom.DocumentElement.SelectNodes("UpdateReport")
			Childs = UpdateReportNode.Length	'列表数
			If Childs>10 Then
				Dim objRemoveNode,i
				For i=0 To (Childs-11)
					XmlDom.documentElement.removeChild(UpdateReportNode.item(i))
				Next
				XmlDom.save FilePath
			End If
		End If
	End If

	Set XSLTemplate=Server.CreateObject("Msxml2.XSLTemplate")
	XSLTemplate.stylesheet=XslDoc
	Set StyleDom = XSLTemplate.createProcessor()
	StyleDom.input = XslDoc
	If Isobject(XmlDom) Then
		StyleDom.input = XmlDom
	End If
	StyleDom.transform()
	Response.Write StyleDom.output
	Set XSLTemplate = Nothing
	Set XslDoc = Nothing
	Set XmlDom = Nothing
End Sub

Sub Footer()
	If IsObject(Conn) Then
		Conn.close
		Set Conn = Nothing
	End If
	If IsObject(Conn_T) Then
		Set Conn_T = Nothing
	End If
End Sub
%>
