ttt.asp格式
<?xml version="1.0" encoding="utf-8"?>
<FansgivingDatabase>
<Booking records="1">
<FLD fldid="1">AAA</FLD>
<FLD fldid="2">BBB</FLD>
<FLD fldid="3">CCC</FLD>
<FLD fldid="4">DDD</FLD>
</Booking>
</FansgivingDatabase>
load.asp
'读取XML中数据,写入数据库
Function UpdateXMLToDatabase(LinkURL)
'on error resume next
Dim objXML, loadResult
Dim http
Set http=Server.CreateObject("Microsoft.XMLHTTP")
http.Open "GET",LinkURL,False '"http://www.fansgiving.com/fansgiving/database/test.xml"
http.send
Set objXML = Server.CreateObject("Msxml2.DOMDocument")
objXML.async = False
objXML.ValidateOnParse=False
objXML.load(http.ResponseXML)
If objXML.ReadyState>2 Then
Response.Write("文档已经准备就绪。状态:"& objXML.ReadyState &"<br>")
Set item1=objXML.getElementsByTagName("FansgivingDatabase")
For i=0 To (item1.Length-1)
Set Booking=item1.Item(i).getElementsByTagName("Booking")
Response.Write(Booking.Item(0).Text)
Next
Else
Response.Write("文档还未准备就绪。状态:"& objXML.ReadyState &"<br>")
End If
Set http=Nothing
Set objXML=Nothing
end function