大家看看这段asp
为什么生成的xml只有<?xml version="1.0" encoding="GB2312"?>
<!--#include file="GetDB.inc"-->
<%
on error resume next
Dim SQL,RS
Set RS = Server.CreateObject("ADODB.RecordSet")
Set conn = server.createobject("ADODB.connection")
OpenDBConn conn
SQL = "SELECT * FROM basic"
RS.Open SQL,Conn,1,1
RS.MoveFirst
Dim xmldoc
Set xmldoc = server.CreateObject("Msxml2.DOMDocument.4.0")
Dim version
Set version = xmldoc.createProcessingInstruction("xml","version='1.0' encoding='GB2312'")
xmldoc.appendchild(version)
Dim root
Set root = xmldoc.CreateNode("root")
xmldoc.appendChild(root)
while (Not RS.EOF)
Set childNode = xmldoc.CreateNode("student")
For Each f in rs.Fields
Set childnextNode = xmldoc.CreateNode(f.name)
childnextNode.Text = f.Value
childNode.appendChild(childnextNode)
Next
RS.MoveNext
root.appendChild childNode
wend
xmldoc.save(Server.Mappath("info.xml"))
%>