<?xml version= "1.0" encoding= "Utf-8"?>
<photos>
<photo filename= "The path of the big picture" thumbnail= "The path of the small map" description= "Picture expression"/>
</photos>
<%
Dim sSQL
Dim rs
Dim Scrlf
Dim sxmlclear
Dim srsshead
Dim srssend
SCRLF = Chr &CHR (10) ' Carriage return + linefeed
Sxmlclear = sxmlclear & <?xml version= ' 1.0 ' encoding= ' utf-8 '?> ' & Scrlf
Srsshead = "<photos ' >" & SCRLF
Srsshead = srsshead & "<photo filename=" 1 "thumbnail=" 2 "description=" 3 "/>" & Scrlf
Srssend = "</photos>"
Response.charset= "gb2312" dataset
Response.contenttype= "text/xml" Data flow format definition
Output
Response.Write Sxmlclear
Response.Write Srsshead
OpenData
Ssql= "SELECT * from P_MXDP"
Set rs = Server.CreateObject ("ADODB.") Recordset ")
Rs. Open sSQL, conn,1,1
If not (rs.eof and RS.BOF) then
Do as not rs.eof
Listinfo=listinfo & "<item>" & Scrlf
Listinfo=listinfo & "<photo filename=" "& RS (" B_pic ") &" Thumbnail= "" & RS ("S_pic") & "" Descri Ption= "" & RS ("DECC") & "/>" & Scrlf
Listinfo=listinfo & "</item>" & Scrlf & Scrlf
Rs.movenext
Loop
End If
Rs.close
Set rs=nothing
Response.Write Srssend
Body=sxmlclear&srsshead&listinfo&srssend
WriteXml ". /ph.xml ", body
function WriteXml (filename,bodytext)
Set FSO = Server.CreateObject ("Scripting.FileSystemObject")
Set fout = fso. CreateTextFile (Server.MapPath (filename), true)
Fout. WriteLine BodyText
Fout.close
End Function